@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.js
CHANGED
|
@@ -425,9 +425,26 @@ import * as React2 from "react";
|
|
|
425
425
|
import { TooltipTrigger, Tooltip as AriaTooltip, OverlayArrow, Focusable } from "react-aria-components";
|
|
426
426
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
427
427
|
function Tooltip({ label, placement = "top", delay = 500, children }) {
|
|
428
|
-
const props = React2.isValidElement(
|
|
428
|
+
const props = React2.isValidElement(
|
|
429
|
+
children
|
|
430
|
+
) ? children.props : void 0;
|
|
429
431
|
const isDisabledChild = props?.isDisabled === true || props?.disabled === true;
|
|
430
|
-
const target = React2.isValidElement(children) && !isDisabledChild ? React2.cloneElement(children, { className: cx(children.props.className, "pire-tooltip-target") }) : isDisabledChild ?
|
|
432
|
+
const target = React2.isValidElement(children) && !isDisabledChild ? React2.cloneElement(children, { className: cx(children.props.className, "pire-tooltip-target") }) : isDisabledChild ? (
|
|
433
|
+
// `Focusable` also dev-warns when the element it clones onto has neither a native
|
|
434
|
+
// interactive tag nor an ARIA widget role — a bare `<span>` is neither. Every disabled
|
|
435
|
+
// control this wraps (`IconButton`, `Button`, …) is button-shaped, so `role="button"` plus
|
|
436
|
+
// `aria-disabled` describes the wrapper the same way its disabled child already describes
|
|
437
|
+
// itself, and is what lets the accessible name (from the child's own text or `aria-label`)
|
|
438
|
+
// reach the element that actually holds focus. No static `tabIndex` here on purpose: it
|
|
439
|
+
// would win over the one `Focusable` computes at clone time (react-aria's `mergeProps` lets
|
|
440
|
+
// a prop already on this element beat the one it supplies), silently making the span
|
|
441
|
+
// unfocusable again and reintroducing the defect this file exists to fix. A real `<button>`
|
|
442
|
+
// is not an option either: `children` is very often a button itself (`IconButton`), and a
|
|
443
|
+
// button nested in a button is invalid HTML that browsers repair by breaking the DOM tree.
|
|
444
|
+
// biome-ignore lint/a11y/useFocusableInteractive: tabIndex is added by Focusable's clone, not statically — see above.
|
|
445
|
+
// biome-ignore lint/a11y/useSemanticElements: a real <button> would nest inside the disabled child, which is often one itself — see above.
|
|
446
|
+
/* @__PURE__ */ jsx3("span", { className: "pire-tooltip-target", role: "button", "aria-disabled": "true", children })
|
|
447
|
+
) : /* @__PURE__ */ jsx3("span", { className: "pire-tooltip-target", children });
|
|
431
448
|
return /* @__PURE__ */ jsxs2(TooltipTrigger, { delay, closeDelay: 0, children: [
|
|
432
449
|
/* @__PURE__ */ jsx3(Focusable, { children: target }),
|
|
433
450
|
/* @__PURE__ */ jsxs2(AriaTooltip, { className: "pire-tooltip", placement, offset: 6, children: [
|
|
@@ -672,10 +689,7 @@ var esMessages = {
|
|
|
672
689
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
673
690
|
var MessagesContext = React5.createContext(enMessages);
|
|
674
691
|
function PireIntlProvider({ messages, children }) {
|
|
675
|
-
const value = React5.useMemo(
|
|
676
|
-
() => messages ? { ...enMessages, ...messages } : enMessages,
|
|
677
|
-
[messages]
|
|
678
|
-
);
|
|
692
|
+
const value = React5.useMemo(() => messages ? { ...enMessages, ...messages } : enMessages, [messages]);
|
|
679
693
|
return /* @__PURE__ */ jsx6(MessagesContext.Provider, { value, children });
|
|
680
694
|
}
|
|
681
695
|
function usePireMessages() {
|
|
@@ -690,37 +704,64 @@ function useMessage(key, override) {
|
|
|
690
704
|
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
691
705
|
var Tag = React6.forwardRef(function Tag2({ children, onRemove, isDisabled, category, className, ...rest }, ref) {
|
|
692
706
|
const msg = usePireMessages();
|
|
693
|
-
return /* @__PURE__ */ jsxs5(
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
+
return /* @__PURE__ */ jsxs5(
|
|
708
|
+
"span",
|
|
709
|
+
{
|
|
710
|
+
ref,
|
|
711
|
+
className: cx("pire-tag", className),
|
|
712
|
+
"data-disabled": isDisabled ? "true" : void 0,
|
|
713
|
+
...rest,
|
|
714
|
+
children: [
|
|
715
|
+
category ? /* @__PURE__ */ jsx7("span", { className: "pire-tag-swatch", "data-category": category, "aria-hidden": "true" }) : null,
|
|
716
|
+
children,
|
|
717
|
+
onRemove ? /* @__PURE__ */ jsx7(
|
|
718
|
+
AriaButton3,
|
|
719
|
+
{
|
|
720
|
+
className: "pire-tag-remove",
|
|
721
|
+
isDisabled,
|
|
722
|
+
onPress: onRemove,
|
|
723
|
+
"aria-label": typeof children === "string" ? msg.tagRemoveNamed.replace("{name}", children) : msg.tagRemove,
|
|
724
|
+
children: /* @__PURE__ */ jsx7(Icon, { name: "x", size: 12 })
|
|
725
|
+
}
|
|
726
|
+
) : null
|
|
727
|
+
]
|
|
728
|
+
}
|
|
729
|
+
);
|
|
707
730
|
});
|
|
708
731
|
|
|
709
732
|
// src/components/core/Card.tsx
|
|
710
733
|
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
711
|
-
function Card({
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
734
|
+
function Card({
|
|
735
|
+
title,
|
|
736
|
+
subtitle,
|
|
737
|
+
icon,
|
|
738
|
+
actions,
|
|
739
|
+
footer,
|
|
740
|
+
interactive,
|
|
741
|
+
children,
|
|
742
|
+
className,
|
|
743
|
+
...rest
|
|
744
|
+
}) {
|
|
745
|
+
return /* @__PURE__ */ jsxs6(
|
|
746
|
+
"section",
|
|
747
|
+
{
|
|
748
|
+
className: cx("pire-card", className),
|
|
749
|
+
"data-interactive": interactive ? "true" : void 0,
|
|
750
|
+
...rest,
|
|
751
|
+
children: [
|
|
752
|
+
title || actions ? /* @__PURE__ */ jsxs6("header", { className: "pire-card-head", children: [
|
|
753
|
+
icon ? /* @__PURE__ */ jsx8(Icon, { name: icon, size: 20, style: { color: "var(--text-secondary)" } }) : null,
|
|
754
|
+
/* @__PURE__ */ jsxs6("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
755
|
+
/* @__PURE__ */ jsx8("h3", { className: "pire-card-title", children: title }),
|
|
756
|
+
subtitle ? /* @__PURE__ */ jsx8("p", { className: "pire-card-sub", style: { margin: 0 }, children: subtitle }) : null
|
|
757
|
+
] }),
|
|
758
|
+
actions ? /* @__PURE__ */ jsx8("div", { style: { display: "flex", gap: "var(--sp-1)" }, children: actions }) : null
|
|
759
|
+
] }) : null,
|
|
760
|
+
children ? /* @__PURE__ */ jsx8("div", { className: "pire-card-body", children }) : null,
|
|
761
|
+
footer ? /* @__PURE__ */ jsx8("footer", { className: "pire-card-foot", children: footer }) : null
|
|
762
|
+
]
|
|
763
|
+
}
|
|
764
|
+
);
|
|
724
765
|
}
|
|
725
766
|
|
|
726
767
|
// src/components/core/Avatar.tsx
|
|
@@ -755,7 +796,10 @@ function SegmentedControl({
|
|
|
755
796
|
style,
|
|
756
797
|
...rest
|
|
757
798
|
}) {
|
|
758
|
-
const selected = React8.useMemo(
|
|
799
|
+
const selected = React8.useMemo(
|
|
800
|
+
() => new Set(value ? [value] : defaultValue ? [defaultValue] : []),
|
|
801
|
+
[value, defaultValue]
|
|
802
|
+
);
|
|
759
803
|
return /* @__PURE__ */ jsx10(
|
|
760
804
|
ToggleButtonGroup,
|
|
761
805
|
{
|
|
@@ -904,7 +948,17 @@ function Kbd({ children, size = "md", className, ...rest }) {
|
|
|
904
948
|
|
|
905
949
|
// src/components/forms/FormField.tsx
|
|
906
950
|
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
907
|
-
function FormField({
|
|
951
|
+
function FormField({
|
|
952
|
+
label,
|
|
953
|
+
htmlFor,
|
|
954
|
+
isRequired,
|
|
955
|
+
hint,
|
|
956
|
+
error,
|
|
957
|
+
layout = "stacked",
|
|
958
|
+
children,
|
|
959
|
+
className,
|
|
960
|
+
...rest
|
|
961
|
+
}) {
|
|
908
962
|
return /* @__PURE__ */ jsxs9("div", { className: cx("pire-field", className), "data-layout": layout, ...rest, children: [
|
|
909
963
|
/* @__PURE__ */ jsxs9("label", { className: "pire-field-label", htmlFor, children: [
|
|
910
964
|
label,
|
|
@@ -1034,11 +1088,14 @@ function TextArea({
|
|
|
1034
1088
|
...rest
|
|
1035
1089
|
}) {
|
|
1036
1090
|
const innerRef = React11.useRef(null);
|
|
1037
|
-
const ref = React11.useCallback(
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1091
|
+
const ref = React11.useCallback(
|
|
1092
|
+
(node) => {
|
|
1093
|
+
innerRef.current = node;
|
|
1094
|
+
if (typeof textAreaRef === "function") textAreaRef(node);
|
|
1095
|
+
else if (textAreaRef) textAreaRef.current = node;
|
|
1096
|
+
},
|
|
1097
|
+
[textAreaRef]
|
|
1098
|
+
);
|
|
1042
1099
|
const grow = React11.useCallback(() => {
|
|
1043
1100
|
const el = innerRef.current;
|
|
1044
1101
|
if (!el || !autoGrow) return;
|
|
@@ -1168,7 +1225,16 @@ function Select({
|
|
|
1168
1225
|
className: "pire-listbox",
|
|
1169
1226
|
items,
|
|
1170
1227
|
renderEmptyState: () => /* @__PURE__ */ jsx19("div", { className: "pire-listbox-status", role: "status", "aria-live": "polite", children: emptyLabel ?? msg.selectEmpty }),
|
|
1171
|
-
children: (item) => /* @__PURE__ */ jsx19(
|
|
1228
|
+
children: (item) => /* @__PURE__ */ jsx19(
|
|
1229
|
+
ListBoxItem,
|
|
1230
|
+
{
|
|
1231
|
+
className: "pire-option",
|
|
1232
|
+
id: item.value,
|
|
1233
|
+
textValue: item.label,
|
|
1234
|
+
isDisabled: item.isDisabled,
|
|
1235
|
+
children: item.label
|
|
1236
|
+
}
|
|
1237
|
+
)
|
|
1172
1238
|
}
|
|
1173
1239
|
) })
|
|
1174
1240
|
]
|
|
@@ -1198,7 +1264,14 @@ import {
|
|
|
1198
1264
|
FieldError as FieldError4
|
|
1199
1265
|
} from "react-aria-components";
|
|
1200
1266
|
import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1201
|
-
function RadioGroup({
|
|
1267
|
+
function RadioGroup({
|
|
1268
|
+
label,
|
|
1269
|
+
description,
|
|
1270
|
+
errorMessage,
|
|
1271
|
+
children,
|
|
1272
|
+
className,
|
|
1273
|
+
...rest
|
|
1274
|
+
}) {
|
|
1202
1275
|
return /* @__PURE__ */ jsxs14(AriaRadioGroup, { className: cx("pire-field", className), validationBehavior: "aria", ...rest, children: [
|
|
1203
1276
|
label ? /* @__PURE__ */ jsx21(Label4, { className: "pire-field-label", children: label }) : null,
|
|
1204
1277
|
/* @__PURE__ */ jsx21("div", { className: "pire-radiogroup", children }),
|
|
@@ -1227,7 +1300,13 @@ function Switch({ label, children, className, ...rest }) {
|
|
|
1227
1300
|
}
|
|
1228
1301
|
|
|
1229
1302
|
// src/components/forms/ChoiceCardGroup.tsx
|
|
1230
|
-
import {
|
|
1303
|
+
import {
|
|
1304
|
+
RadioGroup as AriaRadioGroup2,
|
|
1305
|
+
Radio as AriaRadio2,
|
|
1306
|
+
Label as Label5,
|
|
1307
|
+
Text as Text7,
|
|
1308
|
+
FieldError as FieldError5
|
|
1309
|
+
} from "react-aria-components";
|
|
1231
1310
|
import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1232
1311
|
function ChoiceCardGroup({
|
|
1233
1312
|
label,
|
|
@@ -1261,12 +1340,21 @@ function ChoiceCardGroup({
|
|
|
1261
1340
|
label,
|
|
1262
1341
|
isRequired ? /* @__PURE__ */ jsx23("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1263
1342
|
] }) : null,
|
|
1264
|
-
/* @__PURE__ */ jsx23("div", { className: "pire-choicecards", style: { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }, children: options.map((option) => /* @__PURE__ */ jsxs16(
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1343
|
+
/* @__PURE__ */ jsx23("div", { className: "pire-choicecards", style: { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }, children: options.map((option) => /* @__PURE__ */ jsxs16(
|
|
1344
|
+
AriaRadio2,
|
|
1345
|
+
{
|
|
1346
|
+
value: option.id,
|
|
1347
|
+
className: "pire-choicecard",
|
|
1348
|
+
isDisabled: option.isDisabled,
|
|
1349
|
+
children: [
|
|
1350
|
+
option.icon ? /* @__PURE__ */ jsx23(Icon, { name: option.icon, size: 20 }) : null,
|
|
1351
|
+
/* @__PURE__ */ jsx23("span", { className: "pire-choicecard-label", children: option.label }),
|
|
1352
|
+
option.description ? /* @__PURE__ */ jsx23("span", { className: "pire-choicecard-desc", children: option.description }) : null,
|
|
1353
|
+
option.preview ? /* @__PURE__ */ jsx23("span", { className: "pire-choicecard-preview", "aria-hidden": "true", children: option.preview }) : null
|
|
1354
|
+
]
|
|
1355
|
+
},
|
|
1356
|
+
option.id
|
|
1357
|
+
)) }),
|
|
1270
1358
|
description ? /* @__PURE__ */ jsx23(Text7, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
1271
1359
|
/* @__PURE__ */ jsx23(FieldError5, { className: "pire-field-error", children: errorMessage })
|
|
1272
1360
|
]
|
|
@@ -1381,7 +1469,16 @@ function ComboBox({
|
|
|
1381
1469
|
children: clearLabel ?? msg.inputClear
|
|
1382
1470
|
}
|
|
1383
1471
|
) : null,
|
|
1384
|
-
/* @__PURE__ */ jsx24(
|
|
1472
|
+
/* @__PURE__ */ jsx24(
|
|
1473
|
+
AriaButton6,
|
|
1474
|
+
{
|
|
1475
|
+
className: "pire-iconbtn",
|
|
1476
|
+
"data-size": "sm",
|
|
1477
|
+
"aria-label": msg.comboBoxShowSuggestions,
|
|
1478
|
+
style: { width: 20, height: 20 },
|
|
1479
|
+
children: /* @__PURE__ */ jsx24(Icon, { name: "chevron-down", size: 16 })
|
|
1480
|
+
}
|
|
1481
|
+
)
|
|
1385
1482
|
]
|
|
1386
1483
|
}
|
|
1387
1484
|
),
|
|
@@ -1396,10 +1493,19 @@ function ComboBox({
|
|
|
1396
1493
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 48) onLoadMore();
|
|
1397
1494
|
} : void 0,
|
|
1398
1495
|
renderEmptyState: showsStatus ? () => /* @__PURE__ */ jsx24("div", { className: "pire-listbox-status", role: "status", "aria-live": "polite", children: isLoading ? loadingLabel ?? msg.comboBoxLoading : emptyLabel }) : void 0,
|
|
1399
|
-
children: (item) => /* @__PURE__ */ jsxs17(
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1496
|
+
children: (item) => /* @__PURE__ */ jsxs17(
|
|
1497
|
+
ListBoxItem2,
|
|
1498
|
+
{
|
|
1499
|
+
className: "pire-option",
|
|
1500
|
+
id: item.value,
|
|
1501
|
+
textValue: item.label,
|
|
1502
|
+
isDisabled: item.isDisabled,
|
|
1503
|
+
children: [
|
|
1504
|
+
/* @__PURE__ */ jsx24("span", { className: "pire-option-label", children: item.label }),
|
|
1505
|
+
item.secondary ? /* @__PURE__ */ jsx24("span", { className: "pire-option-secondary", children: item.secondary }) : null
|
|
1506
|
+
]
|
|
1507
|
+
}
|
|
1508
|
+
)
|
|
1403
1509
|
}
|
|
1404
1510
|
) })
|
|
1405
1511
|
]
|
|
@@ -1536,7 +1642,16 @@ function MultiComboBox({
|
|
|
1536
1642
|
}
|
|
1537
1643
|
)
|
|
1538
1644
|
] }),
|
|
1539
|
-
/* @__PURE__ */ jsx25(
|
|
1645
|
+
/* @__PURE__ */ jsx25(
|
|
1646
|
+
AriaButton7,
|
|
1647
|
+
{
|
|
1648
|
+
className: "pire-iconbtn",
|
|
1649
|
+
"data-size": "sm",
|
|
1650
|
+
"aria-label": msg.comboBoxShowSuggestions,
|
|
1651
|
+
style: { width: 20, height: 20 },
|
|
1652
|
+
children: /* @__PURE__ */ jsx25(Icon, { name: "chevron-down", size: 16 })
|
|
1653
|
+
}
|
|
1654
|
+
)
|
|
1540
1655
|
]
|
|
1541
1656
|
}
|
|
1542
1657
|
),
|
|
@@ -1552,10 +1667,19 @@ function MultiComboBox({
|
|
|
1552
1667
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 48) onLoadMore();
|
|
1553
1668
|
} : void 0,
|
|
1554
1669
|
renderEmptyState: showsStatus ? () => /* @__PURE__ */ jsx25("div", { className: "pire-listbox-status", role: "status", "aria-live": "polite", children: isLoading ? loadingLabel ?? msg.comboBoxLoading : emptyLabel }) : void 0,
|
|
1555
|
-
children: (item) => /* @__PURE__ */ jsxs18(
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1670
|
+
children: (item) => /* @__PURE__ */ jsxs18(
|
|
1671
|
+
ListBoxItem3,
|
|
1672
|
+
{
|
|
1673
|
+
className: "pire-option",
|
|
1674
|
+
id: item.value,
|
|
1675
|
+
textValue: item.label,
|
|
1676
|
+
isDisabled: item.isDisabled,
|
|
1677
|
+
children: [
|
|
1678
|
+
/* @__PURE__ */ jsx25("span", { className: "pire-option-label", children: item.label }),
|
|
1679
|
+
item.secondary ? /* @__PURE__ */ jsx25("span", { className: "pire-option-secondary", children: item.secondary }) : null
|
|
1680
|
+
]
|
|
1681
|
+
}
|
|
1682
|
+
)
|
|
1559
1683
|
}
|
|
1560
1684
|
) })
|
|
1561
1685
|
]
|
|
@@ -1725,7 +1849,15 @@ function NumberField({
|
|
|
1725
1849
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1726
1850
|
"data-stepper": stepperLayout,
|
|
1727
1851
|
children: [
|
|
1728
|
-
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */ jsx26(
|
|
1852
|
+
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */ jsx26(
|
|
1853
|
+
AriaButton8,
|
|
1854
|
+
{
|
|
1855
|
+
slot: "decrement",
|
|
1856
|
+
className: "pire-qty-btn",
|
|
1857
|
+
"aria-label": decrementLabel ?? msg.numberFieldDecrease,
|
|
1858
|
+
children: /* @__PURE__ */ jsx26(Icon, { name: "minus", size: 16 })
|
|
1859
|
+
}
|
|
1860
|
+
) : null,
|
|
1729
1861
|
/* @__PURE__ */ jsx26(
|
|
1730
1862
|
AriaInput4,
|
|
1731
1863
|
{
|
|
@@ -1737,10 +1869,34 @@ function NumberField({
|
|
|
1737
1869
|
),
|
|
1738
1870
|
suffix ? /* @__PURE__ */ jsx26("span", { className: "pire-affix", children: suffix }) : null,
|
|
1739
1871
|
showsClear ? /* @__PURE__ */ jsx26(ClearButton, { label: clearLabel ?? msg.inputClear, onClear: () => handleChange(NaN) }) : null,
|
|
1740
|
-
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */ jsx26(
|
|
1872
|
+
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */ jsx26(
|
|
1873
|
+
AriaButton8,
|
|
1874
|
+
{
|
|
1875
|
+
slot: "increment",
|
|
1876
|
+
className: "pire-qty-btn",
|
|
1877
|
+
"aria-label": incrementLabel ?? msg.numberFieldIncrease,
|
|
1878
|
+
children: /* @__PURE__ */ jsx26(Icon, { name: "plus", size: 16 })
|
|
1879
|
+
}
|
|
1880
|
+
) : null,
|
|
1741
1881
|
hideStepper ? null : stepperLayout === "inline" ? null : /* @__PURE__ */ jsxs19("span", { className: "pire-stepper", children: [
|
|
1742
|
-
/* @__PURE__ */ jsx26(
|
|
1743
|
-
|
|
1882
|
+
/* @__PURE__ */ jsx26(
|
|
1883
|
+
AriaButton8,
|
|
1884
|
+
{
|
|
1885
|
+
slot: "increment",
|
|
1886
|
+
className: "pire-stepper-btn",
|
|
1887
|
+
"aria-label": incrementLabel ?? msg.numberFieldIncrease,
|
|
1888
|
+
children: /* @__PURE__ */ jsx26(Icon, { name: "plus", size: 10 })
|
|
1889
|
+
}
|
|
1890
|
+
),
|
|
1891
|
+
/* @__PURE__ */ jsx26(
|
|
1892
|
+
AriaButton8,
|
|
1893
|
+
{
|
|
1894
|
+
slot: "decrement",
|
|
1895
|
+
className: "pire-stepper-btn",
|
|
1896
|
+
"aria-label": decrementLabel ?? msg.numberFieldDecrease,
|
|
1897
|
+
children: /* @__PURE__ */ jsx26(Icon, { name: "minus", size: 10 })
|
|
1898
|
+
}
|
|
1899
|
+
)
|
|
1744
1900
|
] })
|
|
1745
1901
|
]
|
|
1746
1902
|
}
|
|
@@ -1890,7 +2046,16 @@ function DatePicker({
|
|
|
1890
2046
|
children: [
|
|
1891
2047
|
/* @__PURE__ */ jsx28(DateInput, { className: "pire-datefield", children: (segment) => /* @__PURE__ */ jsx28(DateSegment, { segment, className: "pire-datesegment" }) }),
|
|
1892
2048
|
showsClear ? /* @__PURE__ */ jsx28(ClearButton2, { label: clearLabel ?? msg.inputClear }) : null,
|
|
1893
|
-
/* @__PURE__ */ jsx28(
|
|
2049
|
+
/* @__PURE__ */ jsx28(
|
|
2050
|
+
AriaButton9,
|
|
2051
|
+
{
|
|
2052
|
+
className: "pire-iconbtn",
|
|
2053
|
+
"data-size": "sm",
|
|
2054
|
+
"aria-label": msg.datePickerOpenCalendar,
|
|
2055
|
+
style: { width: 24, height: 24 },
|
|
2056
|
+
children: /* @__PURE__ */ jsx28(Icon, { name: "calendar", size: 16 })
|
|
2057
|
+
}
|
|
2058
|
+
)
|
|
1894
2059
|
]
|
|
1895
2060
|
}
|
|
1896
2061
|
),
|
|
@@ -1898,9 +2063,27 @@ function DatePicker({
|
|
|
1898
2063
|
/* @__PURE__ */ jsx28(FieldError9, { className: "pire-field-error", children: errorMessage }),
|
|
1899
2064
|
/* @__PURE__ */ jsx28(Popover4, { className: "pire-popover", children: /* @__PURE__ */ jsx28(AriaDialog, { children: /* @__PURE__ */ jsxs20(Calendar, { className: "pire-calendar", children: [
|
|
1900
2065
|
/* @__PURE__ */ jsxs20("header", { className: "pire-calendar-head", children: [
|
|
1901
|
-
/* @__PURE__ */ jsx28(
|
|
2066
|
+
/* @__PURE__ */ jsx28(
|
|
2067
|
+
AriaButton9,
|
|
2068
|
+
{
|
|
2069
|
+
slot: "previous",
|
|
2070
|
+
className: "pire-iconbtn",
|
|
2071
|
+
"data-size": "sm",
|
|
2072
|
+
"aria-label": msg.datePickerPreviousMonth,
|
|
2073
|
+
children: /* @__PURE__ */ jsx28(Icon, { name: "chevron-left", size: 16 })
|
|
2074
|
+
}
|
|
2075
|
+
),
|
|
1902
2076
|
/* @__PURE__ */ jsx28(Heading2, { className: "pire-calendar-title" }),
|
|
1903
|
-
/* @__PURE__ */ jsx28(
|
|
2077
|
+
/* @__PURE__ */ jsx28(
|
|
2078
|
+
AriaButton9,
|
|
2079
|
+
{
|
|
2080
|
+
slot: "next",
|
|
2081
|
+
className: "pire-iconbtn",
|
|
2082
|
+
"data-size": "sm",
|
|
2083
|
+
"aria-label": msg.datePickerNextMonth,
|
|
2084
|
+
children: /* @__PURE__ */ jsx28(Icon, { name: "chevron-right", size: 16 })
|
|
2085
|
+
}
|
|
2086
|
+
)
|
|
1904
2087
|
] }),
|
|
1905
2088
|
/* @__PURE__ */ jsxs20(CalendarGrid, { className: "pire-calendar-grid", children: [
|
|
1906
2089
|
/* @__PURE__ */ jsx28(CalendarGridHeader, { children: (day) => /* @__PURE__ */ jsx28(CalendarHeaderCell, { children: day }) }),
|
|
@@ -2006,7 +2189,9 @@ function DateRangePicker({
|
|
|
2006
2189
|
onChange(null);
|
|
2007
2190
|
return;
|
|
2008
2191
|
}
|
|
2009
|
-
onChange(
|
|
2192
|
+
onChange(
|
|
2193
|
+
valueFormat === "iso" ? { start: next.start.toString(), end: next.end.toString() } : { start: next.start, end: next.end }
|
|
2194
|
+
);
|
|
2010
2195
|
};
|
|
2011
2196
|
return /* @__PURE__ */ jsxs21(
|
|
2012
2197
|
AriaDateRangePicker,
|
|
@@ -2209,7 +2394,13 @@ function Skeleton({ shape = "text", width, height, className, style, ...rest })
|
|
|
2209
2394
|
);
|
|
2210
2395
|
}
|
|
2211
2396
|
var BAR_WIDTHS = ["72%", "54%", "86%", "63%"];
|
|
2212
|
-
function SkeletonTableRow({
|
|
2397
|
+
function SkeletonTableRow({
|
|
2398
|
+
columns,
|
|
2399
|
+
density = "regular",
|
|
2400
|
+
className,
|
|
2401
|
+
style,
|
|
2402
|
+
...rest
|
|
2403
|
+
}) {
|
|
2213
2404
|
const cells = typeof columns === "number" ? Array.from({ length: columns }, () => ({})) : columns;
|
|
2214
2405
|
return /* @__PURE__ */ jsx31(
|
|
2215
2406
|
"div",
|
|
@@ -2221,18 +2412,15 @@ function SkeletonTableRow({ columns, density = "regular", className, style, ...r
|
|
|
2221
2412
|
...rest,
|
|
2222
2413
|
children: cells.map((c, i) => {
|
|
2223
2414
|
const align = c.numeric ? "right" : c.align ?? "left";
|
|
2224
|
-
return (
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
"
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
},
|
|
2234
|
-
i
|
|
2235
|
-
)
|
|
2415
|
+
return /* @__PURE__ */ jsx31(
|
|
2416
|
+
"div",
|
|
2417
|
+
{
|
|
2418
|
+
className: "pire-skeleton-cell",
|
|
2419
|
+
"data-align": align,
|
|
2420
|
+
style: { width: c.width, flex: c.width ? "0 0 auto" : void 0 },
|
|
2421
|
+
children: /* @__PURE__ */ jsx31(Skeleton, { width: BAR_WIDTHS[i % BAR_WIDTHS.length] })
|
|
2422
|
+
},
|
|
2423
|
+
i
|
|
2236
2424
|
);
|
|
2237
2425
|
})
|
|
2238
2426
|
}
|
|
@@ -2286,10 +2474,11 @@ function DataTable({
|
|
|
2286
2474
|
break;
|
|
2287
2475
|
}
|
|
2288
2476
|
if (typeof column.width !== "number") {
|
|
2289
|
-
if (IS_DEV2)
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2477
|
+
if (IS_DEV2)
|
|
2478
|
+
warnOnce2(
|
|
2479
|
+
`pin-width:${column.key}`,
|
|
2480
|
+
`DataTable column "${column.key}" is pinned but has no numeric width, so its offset cannot be computed. It will scroll.`
|
|
2481
|
+
);
|
|
2293
2482
|
broke = "width";
|
|
2294
2483
|
break;
|
|
2295
2484
|
}
|
|
@@ -2393,7 +2582,9 @@ function DataTable({
|
|
|
2393
2582
|
{
|
|
2394
2583
|
size: 12,
|
|
2395
2584
|
name: sort?.key === c.key ? sort.dir === "asc" ? "arrow-up" : "arrow-down" : "chevrons-up-down",
|
|
2396
|
-
style: {
|
|
2585
|
+
style: {
|
|
2586
|
+
color: sort?.key === c.key ? "var(--accent-subtle-fg)" : "var(--text-tertiary)"
|
|
2587
|
+
}
|
|
2397
2588
|
}
|
|
2398
2589
|
) : null
|
|
2399
2590
|
] })
|
|
@@ -2402,44 +2593,53 @@ function DataTable({
|
|
|
2402
2593
|
)
|
|
2403
2594
|
))
|
|
2404
2595
|
] }),
|
|
2405
|
-
/* @__PURE__ */ jsx32(
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
{
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
Cell,
|
|
2425
|
-
{
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2596
|
+
/* @__PURE__ */ jsx32(
|
|
2597
|
+
TableBody,
|
|
2598
|
+
{
|
|
2599
|
+
renderEmptyState: () => isLoading ? /* @__PURE__ */ jsxs23("div", { className: "pire-table-loading", role: "status", "aria-live": "polite", children: [
|
|
2600
|
+
/* @__PURE__ */ jsx32("span", { className: "pire-sr-only", children: loadingLabel ?? msg.dataTableLoading }),
|
|
2601
|
+
Array.from({ length: skeletonRows }, (_, i) => (
|
|
2602
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: placeholder rows are positional.
|
|
2603
|
+
/* @__PURE__ */ jsx32(SkeletonTableRow, { columns: skeletonColumns, density }, i)
|
|
2604
|
+
))
|
|
2605
|
+
] }) : /* @__PURE__ */ jsx32("div", { className: "pire-table-empty", children: emptyLabel ?? msg.dataTableEmpty }),
|
|
2606
|
+
children: body.flatMap((row) => {
|
|
2607
|
+
const rowIsDisabled = presentation.get(row.id)?.isDisabled;
|
|
2608
|
+
const record = /* @__PURE__ */ jsxs23(
|
|
2609
|
+
Row,
|
|
2610
|
+
{
|
|
2611
|
+
id: row.id,
|
|
2612
|
+
className: cx("pire-tr", presentation.get(row.id)?.className),
|
|
2613
|
+
"data-pressable": onRowAction && !rowIsDisabled ? "true" : void 0,
|
|
2614
|
+
children: [
|
|
2615
|
+
hasCheckboxColumn ? /* @__PURE__ */ jsx32(Cell, { className: "pire-td", ...pinProps(null), children: /* @__PURE__ */ jsx32(Checkbox, { slot: "selection", "aria-label": msg.dataTableSelectRow }) }) : null,
|
|
2616
|
+
columns.map((c) => {
|
|
2617
|
+
const pin = pinProps(c.key);
|
|
2618
|
+
return /* @__PURE__ */ jsx32(
|
|
2619
|
+
Cell,
|
|
2620
|
+
{
|
|
2621
|
+
className: "pire-td",
|
|
2622
|
+
"data-numeric": c.numeric ? "true" : void 0,
|
|
2623
|
+
"data-tone": c.tone?.(row) ?? void 0,
|
|
2624
|
+
...pin,
|
|
2625
|
+
style: { ...pin.style, textAlign: c.align && !c.numeric ? c.align : void 0 },
|
|
2626
|
+
children: c.render ? c.render(row) : row[c.key]
|
|
2627
|
+
},
|
|
2628
|
+
c.key
|
|
2629
|
+
);
|
|
2630
|
+
})
|
|
2631
|
+
]
|
|
2632
|
+
},
|
|
2633
|
+
row.id
|
|
2634
|
+
);
|
|
2635
|
+
if (!renderExpanded || !expanded.has(String(row.id))) return [record];
|
|
2636
|
+
return [
|
|
2637
|
+
record,
|
|
2638
|
+
/* @__PURE__ */ jsx32(Row, { id: expandedKey(row.id), className: "pire-tr-expanded", children: /* @__PURE__ */ jsx32(Cell, { className: "pire-td-expanded", colSpan: spanAll, children: renderExpanded(row) }) }, expandedKey(row.id))
|
|
2639
|
+
];
|
|
2640
|
+
})
|
|
2641
|
+
}
|
|
2642
|
+
),
|
|
2443
2643
|
footer && !isLoading ? /* @__PURE__ */ jsx32(TableFooter, { className: "pire-tfoot", children: /* @__PURE__ */ jsxs23(Row, { id: "__pire_footer__", className: "pire-tr-footer", children: [
|
|
2444
2644
|
hasCheckboxColumn ? /* @__PURE__ */ jsx32(Cell, { className: "pire-tf", ...pinProps(null) }) : null,
|
|
2445
2645
|
columns.map((c, i) => {
|
|
@@ -2509,10 +2709,17 @@ function ValueHelpDialog({
|
|
|
2509
2709
|
onClose,
|
|
2510
2710
|
footer: /* @__PURE__ */ jsxs24(Fragment2, { children: [
|
|
2511
2711
|
/* @__PURE__ */ jsx33(Button, { variant: "tertiary", onPress: onClose, children: msg.valueHelpDialogCancel }),
|
|
2512
|
-
isMultiple ? /* @__PURE__ */ jsx33(
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2712
|
+
isMultiple ? /* @__PURE__ */ jsx33(
|
|
2713
|
+
Button,
|
|
2714
|
+
{
|
|
2715
|
+
variant: "primary",
|
|
2716
|
+
onPress: () => {
|
|
2717
|
+
onConfirm?.(selectedKeys ?? []);
|
|
2718
|
+
onClose?.();
|
|
2719
|
+
},
|
|
2720
|
+
children: msg.valueHelpConfirm
|
|
2721
|
+
}
|
|
2722
|
+
) : null
|
|
2516
2723
|
] }),
|
|
2517
2724
|
children: /* @__PURE__ */ jsxs24("div", { style: { display: "flex", flexDirection: "column", gap: "var(--sp-3)" }, children: [
|
|
2518
2725
|
/* @__PURE__ */ jsx33(
|
|
@@ -2533,28 +2740,35 @@ function ValueHelpDialog({
|
|
|
2533
2740
|
/* @__PURE__ */ jsx33(Button, { size: "sm", variant: "tertiary", onPress: () => onSelectionChange?.([]), children: msg.valueHelpClearSelection }),
|
|
2534
2741
|
/* @__PURE__ */ jsx33("span", { className: "pire-valuehelp-count", children: msg.valueHelpSelectedCount.replace("{count}", String(selectedKeys?.length ?? 0)) })
|
|
2535
2742
|
] }) : null,
|
|
2536
|
-
/* @__PURE__ */ jsx33(
|
|
2537
|
-
|
|
2538
|
-
if (el.scrollHeight - el.scrollTop - el.clientHeight < 64) onLoadMore();
|
|
2539
|
-
} : void 0, style: { overflow: "auto", maxHeight: "48vh" }, children: /* @__PURE__ */ jsx33(
|
|
2540
|
-
DataTable,
|
|
2743
|
+
/* @__PURE__ */ jsx33(
|
|
2744
|
+
"div",
|
|
2541
2745
|
{
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2746
|
+
onScroll: onLoadMore ? (event) => {
|
|
2747
|
+
const el = event.currentTarget;
|
|
2748
|
+
if (el.scrollHeight - el.scrollTop - el.clientHeight < 64) onLoadMore();
|
|
2749
|
+
} : void 0,
|
|
2750
|
+
style: { overflow: "auto", maxHeight: "48vh" },
|
|
2751
|
+
children: /* @__PURE__ */ jsx33(
|
|
2752
|
+
DataTable,
|
|
2753
|
+
{
|
|
2754
|
+
"aria-label": typeof title === "string" ? title : msg.valueHelpDialogTitle,
|
|
2755
|
+
density: "condensed",
|
|
2756
|
+
columns,
|
|
2757
|
+
rows: filtered,
|
|
2758
|
+
isLoading,
|
|
2759
|
+
emptyLabel: emptyLabel ?? msg.valueHelpDialogEmpty,
|
|
2760
|
+
selectable: isMultiple ? "multiple" : void 0,
|
|
2761
|
+
hideSelectAll: isMultiple,
|
|
2762
|
+
selected: isMultiple ? selectedKeys : void 0,
|
|
2763
|
+
onSelectionChange: isMultiple ? onSelectionChange : void 0,
|
|
2764
|
+
onRowAction: isMultiple ? void 0 : (row) => {
|
|
2765
|
+
onSelect?.(row);
|
|
2766
|
+
onClose?.();
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2769
|
+
)
|
|
2556
2770
|
}
|
|
2557
|
-
)
|
|
2771
|
+
)
|
|
2558
2772
|
] })
|
|
2559
2773
|
}
|
|
2560
2774
|
);
|
|
@@ -2700,7 +2914,9 @@ function screenFiles(files, { maxSize, acceptedFileTypes }) {
|
|
|
2700
2914
|
continue;
|
|
2701
2915
|
}
|
|
2702
2916
|
if (acceptedFileTypes?.length) {
|
|
2703
|
-
const ok = acceptedFileTypes.some(
|
|
2917
|
+
const ok = acceptedFileTypes.some(
|
|
2918
|
+
(t) => t.startsWith(".") ? file.name.toLowerCase().endsWith(t.toLowerCase()) : t.endsWith("/*") ? file.type.startsWith(t.slice(0, -1)) : file.type === t
|
|
2919
|
+
);
|
|
2704
2920
|
if (!ok) {
|
|
2705
2921
|
rejected.push({ file, reason: "type" });
|
|
2706
2922
|
continue;
|
|
@@ -2737,9 +2953,12 @@ function FileUpload({
|
|
|
2737
2953
|
const [uncontrolled, setUncontrolled] = React21.useState(defaultValue ?? []);
|
|
2738
2954
|
const files = value ?? uncontrolled;
|
|
2739
2955
|
const created = React21.useRef([]);
|
|
2740
|
-
React21.useEffect(
|
|
2741
|
-
|
|
2742
|
-
|
|
2956
|
+
React21.useEffect(
|
|
2957
|
+
() => () => {
|
|
2958
|
+
for (const url of created.current) URL.revokeObjectURL(url);
|
|
2959
|
+
},
|
|
2960
|
+
[]
|
|
2961
|
+
);
|
|
2743
2962
|
const commit = (next) => {
|
|
2744
2963
|
if (value === void 0) setUncontrolled(next);
|
|
2745
2964
|
onChange?.(next);
|
|
@@ -2873,14 +3092,7 @@ import { jsx as jsx38, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
|
2873
3092
|
function Menu({ minWidth, className, style, ...rest }) {
|
|
2874
3093
|
const width = typeof minWidth === "number" ? `${minWidth}px` : minWidth;
|
|
2875
3094
|
const menuStyle = width == null ? style : { ["--pire-menu-min-w"]: width, ...style };
|
|
2876
|
-
return /* @__PURE__ */ jsx38(
|
|
2877
|
-
AriaMenu,
|
|
2878
|
-
{
|
|
2879
|
-
className: cx("pire-menu", className),
|
|
2880
|
-
style: menuStyle,
|
|
2881
|
-
...rest
|
|
2882
|
-
}
|
|
2883
|
-
);
|
|
3095
|
+
return /* @__PURE__ */ jsx38(AriaMenu, { className: cx("pire-menu", className), style: menuStyle, ...rest });
|
|
2884
3096
|
}
|
|
2885
3097
|
var shortcutKeys = (shortcut) => {
|
|
2886
3098
|
if (shortcut == null) return [];
|
|
@@ -2909,7 +3121,14 @@ function MenuItem({
|
|
|
2909
3121
|
/* @__PURE__ */ jsx38("span", { className: "pire-menu-item-label", children }),
|
|
2910
3122
|
description ? /* @__PURE__ */ jsx38("span", { className: "pire-menu-item-desc", children: description }) : null
|
|
2911
3123
|
] }),
|
|
2912
|
-
keys.length ? /* @__PURE__ */ jsx38("span", { className: "pire-menu-item-shortcut", children: keys.map((cap, index) => /* @__PURE__ */ jsx38(
|
|
3124
|
+
keys.length ? /* @__PURE__ */ jsx38("span", { className: "pire-menu-item-shortcut", children: keys.map((cap, index) => /* @__PURE__ */ jsx38(
|
|
3125
|
+
Kbd,
|
|
3126
|
+
{
|
|
3127
|
+
size: "sm",
|
|
3128
|
+
children: cap
|
|
3129
|
+
},
|
|
3130
|
+
`${cap}-${index}`
|
|
3131
|
+
)) }) : null
|
|
2913
3132
|
]
|
|
2914
3133
|
}
|
|
2915
3134
|
);
|
|
@@ -2944,6 +3163,7 @@ function SideNav({
|
|
|
2944
3163
|
onExpandedChange,
|
|
2945
3164
|
collapsed,
|
|
2946
3165
|
railFlyout = true,
|
|
3166
|
+
bordered = true,
|
|
2947
3167
|
footer,
|
|
2948
3168
|
className,
|
|
2949
3169
|
...rest
|
|
@@ -3052,6 +3272,7 @@ function SideNav({
|
|
|
3052
3272
|
{
|
|
3053
3273
|
className: cx("pire-sidenav", className),
|
|
3054
3274
|
"data-collapsed": collapsed ? "true" : void 0,
|
|
3275
|
+
"data-bordered": bordered ? void 0 : "false",
|
|
3055
3276
|
"aria-label": msg.sideNavLabel,
|
|
3056
3277
|
...rest,
|
|
3057
3278
|
children: [
|
|
@@ -3243,7 +3464,9 @@ function childrenOfType(children, type, what, parent) {
|
|
|
3243
3464
|
}
|
|
3244
3465
|
if (!React24.isValidElement(child) || child.type !== type) {
|
|
3245
3466
|
const isWrapper = React24.isValidElement(child) && typeof child.type !== "string" && !CONFIG_ELEMENTS.has(child.type);
|
|
3246
|
-
throw new Error(
|
|
3467
|
+
throw new Error(
|
|
3468
|
+
`[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.` : "")
|
|
3469
|
+
);
|
|
3247
3470
|
}
|
|
3248
3471
|
out.push({ ...child.props, key: child.key != null ? String(child.key) : `${path}${i}` });
|
|
3249
3472
|
});
|
|
@@ -3254,13 +3477,24 @@ function childrenOfType(children, type, what, parent) {
|
|
|
3254
3477
|
function readTabs(children) {
|
|
3255
3478
|
return childrenOfType(children, RibbonTab, "Ribbon.Tab", "Ribbon").map((tab) => ({
|
|
3256
3479
|
...tab,
|
|
3257
|
-
groups: childrenOfType(tab.children, RibbonGroup, "Ribbon.Group", "Ribbon.Tab").map(
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3480
|
+
groups: childrenOfType(tab.children, RibbonGroup, "Ribbon.Group", "Ribbon.Tab").map(
|
|
3481
|
+
(group) => ({
|
|
3482
|
+
...group,
|
|
3483
|
+
commands: childrenOfType(
|
|
3484
|
+
group.children,
|
|
3485
|
+
RibbonCommand,
|
|
3486
|
+
"Ribbon.Command",
|
|
3487
|
+
"Ribbon.Group"
|
|
3488
|
+
)
|
|
3489
|
+
})
|
|
3490
|
+
)
|
|
3261
3491
|
}));
|
|
3262
3492
|
}
|
|
3263
|
-
function Command({
|
|
3493
|
+
function Command({
|
|
3494
|
+
command,
|
|
3495
|
+
selectionCount,
|
|
3496
|
+
inBar
|
|
3497
|
+
}) {
|
|
3264
3498
|
const size = inBar ? "sm" : command.size ?? "sm";
|
|
3265
3499
|
const isDisabled = command.isDisabled || command.requiresSelection === true && selectionCount === 0;
|
|
3266
3500
|
return /* @__PURE__ */ jsxs35(
|
|
@@ -3307,7 +3541,13 @@ function useTrailingOverflow() {
|
|
|
3307
3541
|
}, []);
|
|
3308
3542
|
return [ref, overflow];
|
|
3309
3543
|
}
|
|
3310
|
-
function Surface({
|
|
3544
|
+
function Surface({
|
|
3545
|
+
className,
|
|
3546
|
+
id,
|
|
3547
|
+
label,
|
|
3548
|
+
trailing,
|
|
3549
|
+
children
|
|
3550
|
+
}) {
|
|
3311
3551
|
const [scrollRef, overflow] = useTrailingOverflow();
|
|
3312
3552
|
const domId = id ? { id } : {};
|
|
3313
3553
|
return /* @__PURE__ */ jsxs35(Toolbar, { ...domId, className, "aria-label": label, children: [
|
|
@@ -3348,10 +3588,13 @@ function Ribbon({
|
|
|
3348
3588
|
const [ownTab, setOwnTab] = React24.useState(defaultValue);
|
|
3349
3589
|
const requested = value ?? ownTab;
|
|
3350
3590
|
const selected = visible.some((tab) => tab.id === requested) ? requested : fallback;
|
|
3351
|
-
const select = React24.useCallback(
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3591
|
+
const select = React24.useCallback(
|
|
3592
|
+
(id) => {
|
|
3593
|
+
setOwnTab(id);
|
|
3594
|
+
onChange?.(id);
|
|
3595
|
+
},
|
|
3596
|
+
[onChange]
|
|
3597
|
+
);
|
|
3355
3598
|
const hadSelection = React24.useRef(false);
|
|
3356
3599
|
React24.useEffect(() => {
|
|
3357
3600
|
const has = count > 0;
|
|
@@ -3447,7 +3690,15 @@ var KIND_ICON = {
|
|
|
3447
3690
|
warning: "alert-triangle",
|
|
3448
3691
|
error: "alert-octagon"
|
|
3449
3692
|
};
|
|
3450
|
-
function InlineMessage({
|
|
3693
|
+
function InlineMessage({
|
|
3694
|
+
kind = "info",
|
|
3695
|
+
title,
|
|
3696
|
+
action,
|
|
3697
|
+
onClose,
|
|
3698
|
+
children,
|
|
3699
|
+
className,
|
|
3700
|
+
...rest
|
|
3701
|
+
}) {
|
|
3451
3702
|
const msg = usePireMessages();
|
|
3452
3703
|
const assertive = kind === "error" || kind === "warning";
|
|
3453
3704
|
return /* @__PURE__ */ jsxs36(
|
|
@@ -3480,7 +3731,14 @@ var KIND_ICON2 = {
|
|
|
3480
3731
|
warning: "alert-triangle",
|
|
3481
3732
|
error: "alert-octagon"
|
|
3482
3733
|
};
|
|
3483
|
-
function Toast({
|
|
3734
|
+
function Toast({
|
|
3735
|
+
kind = "success",
|
|
3736
|
+
onClose,
|
|
3737
|
+
position = "bottom-center",
|
|
3738
|
+
children,
|
|
3739
|
+
className,
|
|
3740
|
+
...rest
|
|
3741
|
+
}) {
|
|
3484
3742
|
const msg = usePireMessages();
|
|
3485
3743
|
return /* @__PURE__ */ jsxs37(
|
|
3486
3744
|
"div",
|
|
@@ -3499,21 +3757,36 @@ function Toast({ kind = "success", onClose, position = "bottom-center", children
|
|
|
3499
3757
|
);
|
|
3500
3758
|
}
|
|
3501
3759
|
var ToastContext = React25.createContext(null);
|
|
3502
|
-
function ToastProvider({
|
|
3760
|
+
function ToastProvider({
|
|
3761
|
+
children,
|
|
3762
|
+
timeout = 6e3
|
|
3763
|
+
}) {
|
|
3503
3764
|
const msg = usePireMessages();
|
|
3504
3765
|
const [toasts, setToasts] = React25.useState([]);
|
|
3505
3766
|
const close = React25.useCallback((id) => setToasts((t) => t.filter((x) => x.id !== id)), []);
|
|
3506
|
-
const add = React25.useCallback(
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3767
|
+
const add = React25.useCallback(
|
|
3768
|
+
(toast) => {
|
|
3769
|
+
const id = Math.random().toString(36).slice(2);
|
|
3770
|
+
setToasts((t) => [...t, { ...toast, id }]);
|
|
3771
|
+
const ms = toast.timeout ?? timeout;
|
|
3772
|
+
if (ms > 0) setTimeout(() => close(id), ms);
|
|
3773
|
+
return id;
|
|
3774
|
+
},
|
|
3775
|
+
[close, timeout]
|
|
3776
|
+
);
|
|
3513
3777
|
const value = React25.useMemo(() => ({ add, close }), [add, close]);
|
|
3514
3778
|
return /* @__PURE__ */ jsxs37(ToastContext.Provider, { value, children: [
|
|
3515
3779
|
children,
|
|
3516
|
-
/* @__PURE__ */ jsx46("div", { className: "pire-toast-region", role: "region", "aria-label": msg.toastRegionLabel, children: toasts.map((t) => /* @__PURE__ */ jsx46(
|
|
3780
|
+
/* @__PURE__ */ jsx46("div", { className: "pire-toast-region", role: "region", "aria-label": msg.toastRegionLabel, children: toasts.map((t) => /* @__PURE__ */ jsx46(
|
|
3781
|
+
Toast,
|
|
3782
|
+
{
|
|
3783
|
+
kind: t.kind,
|
|
3784
|
+
onClose: () => close(t.id),
|
|
3785
|
+
style: { position: "static", transform: "none" },
|
|
3786
|
+
children: t.message
|
|
3787
|
+
},
|
|
3788
|
+
t.id
|
|
3789
|
+
)) })
|
|
3517
3790
|
] });
|
|
3518
3791
|
}
|
|
3519
3792
|
function useToast() {
|
|
@@ -3561,7 +3834,17 @@ function KpiTile({
|
|
|
3561
3834
|
|
|
3562
3835
|
// src/components/data/ObjectHeader.tsx
|
|
3563
3836
|
import { jsx as jsx48, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3564
|
-
function ObjectHeader({
|
|
3837
|
+
function ObjectHeader({
|
|
3838
|
+
title,
|
|
3839
|
+
subtitle,
|
|
3840
|
+
id,
|
|
3841
|
+
breadcrumb,
|
|
3842
|
+
badge,
|
|
3843
|
+
facts,
|
|
3844
|
+
actions,
|
|
3845
|
+
className,
|
|
3846
|
+
...rest
|
|
3847
|
+
}) {
|
|
3565
3848
|
return /* @__PURE__ */ jsxs39("header", { className: cx("pire-objheader", className), ...rest, children: [
|
|
3566
3849
|
breadcrumb,
|
|
3567
3850
|
/* @__PURE__ */ jsxs39("div", { className: "pire-objheader-row", children: [
|
|
@@ -3577,7 +3860,15 @@ function ObjectHeader({ title, subtitle, id, breadcrumb, badge, facts, actions,
|
|
|
3577
3860
|
] }),
|
|
3578
3861
|
facts?.length ? /* @__PURE__ */ jsx48("dl", { className: "pire-facts", style: { margin: 0 }, children: facts.map((fact) => /* @__PURE__ */ jsxs39("div", { children: [
|
|
3579
3862
|
/* @__PURE__ */ jsx48("dt", { className: "pire-fact-label", children: fact.label }),
|
|
3580
|
-
/* @__PURE__ */ jsx48(
|
|
3863
|
+
/* @__PURE__ */ jsx48(
|
|
3864
|
+
"dd",
|
|
3865
|
+
{
|
|
3866
|
+
className: "pire-fact-value",
|
|
3867
|
+
"data-numeric": fact.numeric ? "true" : void 0,
|
|
3868
|
+
style: { margin: 0 },
|
|
3869
|
+
children: fact.value
|
|
3870
|
+
}
|
|
3871
|
+
)
|
|
3581
3872
|
] }, fact.label)) }) : null
|
|
3582
3873
|
] });
|
|
3583
3874
|
}
|
|
@@ -3616,7 +3907,14 @@ function FilterBar({
|
|
|
3616
3907
|
|
|
3617
3908
|
// src/components/data/DescriptionList.tsx
|
|
3618
3909
|
import { jsx as jsx50, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
3619
|
-
function DescriptionList({
|
|
3910
|
+
function DescriptionList({
|
|
3911
|
+
items,
|
|
3912
|
+
layout = "rows",
|
|
3913
|
+
columns = 3,
|
|
3914
|
+
className,
|
|
3915
|
+
style,
|
|
3916
|
+
...rest
|
|
3917
|
+
}) {
|
|
3620
3918
|
return /* @__PURE__ */ jsx50(
|
|
3621
3919
|
"dl",
|
|
3622
3920
|
{
|
|
@@ -3674,10 +3972,7 @@ function linearScale(values, tickCount = 4, startAtZero = true) {
|
|
|
3674
3972
|
const min = toStepPrecision(Math.floor(low / step + EDGE_TOLERANCE) * step);
|
|
3675
3973
|
const max = toStepPrecision(Math.ceil(high / step - EDGE_TOLERANCE) * step);
|
|
3676
3974
|
const stepCount = Math.round((max - min) / step);
|
|
3677
|
-
const ticks = Array.from(
|
|
3678
|
-
{ length: stepCount + 1 },
|
|
3679
|
-
(_, index) => toStepPrecision(min + index * step)
|
|
3680
|
-
);
|
|
3975
|
+
const ticks = Array.from({ length: stepCount + 1 }, (_, index) => toStepPrecision(min + index * step));
|
|
3681
3976
|
return { min, max, ticks };
|
|
3682
3977
|
}
|
|
3683
3978
|
function scalePosition(value, scale) {
|
|
@@ -3705,10 +4000,14 @@ function warnOnDonutShape(series, categoryCount, chartLabel) {
|
|
|
3705
4000
|
complaints.push(`it has ${series.length} series but a donut draws one \u2014 the rest are ignored`);
|
|
3706
4001
|
}
|
|
3707
4002
|
if (categoryCount > VIZ_SLOT_COUNT) {
|
|
3708
|
-
complaints.push(
|
|
4003
|
+
complaints.push(
|
|
4004
|
+
`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"`
|
|
4005
|
+
);
|
|
3709
4006
|
}
|
|
3710
4007
|
if (series[0]?.values.some((value) => value != null && value < 0)) {
|
|
3711
|
-
complaints.push(
|
|
4008
|
+
complaints.push(
|
|
4009
|
+
"it contains negative values, which have no part-to-whole meaning \u2014 a signed measure belongs in a bar chart"
|
|
4010
|
+
);
|
|
3712
4011
|
}
|
|
3713
4012
|
if (complaints.length === 0) return;
|
|
3714
4013
|
warnedCharts.add(`donut:${chartLabel}`);
|
|
@@ -3721,7 +4020,9 @@ function flatValues(series) {
|
|
|
3721
4020
|
return series.flatMap((one) => one.values);
|
|
3722
4021
|
}
|
|
3723
4022
|
function alignToCategories(series, categoryCount) {
|
|
3724
|
-
return series.map(
|
|
4023
|
+
return series.map(
|
|
4024
|
+
(one) => one.values.length <= categoryCount ? one : { ...one, values: one.values.slice(0, categoryCount) }
|
|
4025
|
+
);
|
|
3725
4026
|
}
|
|
3726
4027
|
|
|
3727
4028
|
// src/components/data/ChartFrame.tsx
|
|
@@ -3980,10 +4281,12 @@ function LineChart({
|
|
|
3980
4281
|
},
|
|
3981
4282
|
tick
|
|
3982
4283
|
)),
|
|
3983
|
-
categories.map(
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
4284
|
+
categories.map(
|
|
4285
|
+
(category, index) => index % labelEvery === 0 ? (
|
|
4286
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
4287
|
+
/* @__PURE__ */ jsx54("text", { x: xAt(index), y: height - 6, textAnchor: "middle", children: category }, index)
|
|
4288
|
+
) : null
|
|
4289
|
+
)
|
|
3987
4290
|
] }),
|
|
3988
4291
|
showArea && series[0] ? /* @__PURE__ */ jsx54(
|
|
3989
4292
|
"path",
|
|
@@ -3994,19 +4297,20 @@ function LineChart({
|
|
|
3994
4297
|
}
|
|
3995
4298
|
) : null,
|
|
3996
4299
|
/* @__PURE__ */ jsx54("g", { className: "pire-chart-line", fill: "none", children: series.map((one, index) => /* @__PURE__ */ jsx54("path", { d: pathFor(one.values), stroke: seriesColor(one, index) }, one.id)) }),
|
|
3997
|
-
withMarkers ? /* @__PURE__ */ jsx54("g", { className: "pire-chart-marker", children: series.map(
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4300
|
+
withMarkers ? /* @__PURE__ */ jsx54("g", { className: "pire-chart-marker", children: series.map(
|
|
4301
|
+
(one, seriesIndex) => one.values.map(
|
|
4302
|
+
(value, index) => value == null ? null : /* @__PURE__ */ jsx54(
|
|
4303
|
+
"circle",
|
|
4304
|
+
{
|
|
4305
|
+
cx: xAt(index),
|
|
4306
|
+
cy: yAt(value),
|
|
4307
|
+
r: 4,
|
|
4308
|
+
fill: seriesColor(one, seriesIndex)
|
|
4309
|
+
},
|
|
4310
|
+
`${one.id}-${index}`
|
|
4311
|
+
)
|
|
4008
4312
|
)
|
|
4009
|
-
)
|
|
4313
|
+
) }) : null
|
|
4010
4314
|
]
|
|
4011
4315
|
}
|
|
4012
4316
|
) : null,
|
|
@@ -4014,7 +4318,9 @@ function LineChart({
|
|
|
4014
4318
|
"div",
|
|
4015
4319
|
{
|
|
4016
4320
|
className: "pire-chart-hover",
|
|
4017
|
-
style: {
|
|
4321
|
+
style: {
|
|
4322
|
+
inset: `${PLOT_INSET.top}px ${PLOT_INSET.right}px ${PLOT_INSET.bottom}px ${PLOT_INSET.left}px`
|
|
4323
|
+
},
|
|
4018
4324
|
children: categories.map((category, categoryIndex) => (
|
|
4019
4325
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
4020
4326
|
/* @__PURE__ */ jsx54("div", { className: "pire-chart-band", children: /* @__PURE__ */ jsxs45("span", { className: "pire-chart-tip", role: "presentation", children: [
|
|
@@ -4154,15 +4460,31 @@ function LinkList({ items, onSelect, emphasis = "key", className, ...rest }) {
|
|
|
4154
4460
|
|
|
4155
4461
|
// src/components/data/RecordCard.tsx
|
|
4156
4462
|
import { jsx as jsx57, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
4157
|
-
function RecordCard({
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4463
|
+
function RecordCard({
|
|
4464
|
+
title,
|
|
4465
|
+
subtitle,
|
|
4466
|
+
icon,
|
|
4467
|
+
action,
|
|
4468
|
+
isDisabled,
|
|
4469
|
+
className,
|
|
4470
|
+
...rest
|
|
4471
|
+
}) {
|
|
4472
|
+
return /* @__PURE__ */ jsxs48(
|
|
4473
|
+
"div",
|
|
4474
|
+
{
|
|
4475
|
+
className: cx("pire-recordcard", className),
|
|
4476
|
+
"data-disabled": isDisabled ? "true" : void 0,
|
|
4477
|
+
...rest,
|
|
4478
|
+
children: [
|
|
4479
|
+
icon ? /* @__PURE__ */ jsx57("span", { className: "pire-recordcard-tile", "aria-hidden": "true", children: /* @__PURE__ */ jsx57(Icon, { name: icon, size: 20 }) }) : null,
|
|
4480
|
+
/* @__PURE__ */ jsxs48("span", { className: "pire-recordcard-body", children: [
|
|
4481
|
+
/* @__PURE__ */ jsx57("span", { className: "pire-recordcard-title", children: title }),
|
|
4482
|
+
subtitle ? /* @__PURE__ */ jsx57("span", { className: "pire-recordcard-sub", children: subtitle }) : null
|
|
4483
|
+
] }),
|
|
4484
|
+
action ? /* @__PURE__ */ jsx57("span", { className: "pire-recordcard-action", children: action }) : null
|
|
4485
|
+
]
|
|
4486
|
+
}
|
|
4487
|
+
);
|
|
4166
4488
|
}
|
|
4167
4489
|
|
|
4168
4490
|
// src/components/data/ViewSwitcher.tsx
|
|
@@ -4262,7 +4584,14 @@ function SectionHeader({ title, meta, actions, className, ...rest }) {
|
|
|
4262
4584
|
|
|
4263
4585
|
// src/components/layout/SelectionBar.tsx
|
|
4264
4586
|
import { jsx as jsx63, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
4265
|
-
function SelectionBar({
|
|
4587
|
+
function SelectionBar({
|
|
4588
|
+
count,
|
|
4589
|
+
noun = "record",
|
|
4590
|
+
children,
|
|
4591
|
+
actions,
|
|
4592
|
+
className,
|
|
4593
|
+
...rest
|
|
4594
|
+
}) {
|
|
4266
4595
|
if (!count) return null;
|
|
4267
4596
|
return /* @__PURE__ */ jsxs53("div", { className: cx("pire-selectionbar", className), role: "status", "aria-live": "polite", ...rest, children: [
|
|
4268
4597
|
/* @__PURE__ */ jsxs53("span", { className: "pire-selectionbar-count", children: [
|
|
@@ -4361,7 +4690,14 @@ function ConfirmDialog({
|
|
|
4361
4690
|
// pairs with an explicit role for the same reason.
|
|
4362
4691
|
/* @__PURE__ */ jsx66("div", { className: "pire-confirm-facts", role: "group", "aria-label": msg.confirmDialogFactsLabel, children: /* @__PURE__ */ jsx66(DescriptionList, { layout: "rows", items: facts }) })
|
|
4363
4692
|
) : null,
|
|
4364
|
-
consequence ? /* @__PURE__ */ jsx66(
|
|
4693
|
+
consequence ? /* @__PURE__ */ jsx66(
|
|
4694
|
+
InlineMessage,
|
|
4695
|
+
{
|
|
4696
|
+
kind: tone === "danger" ? "error" : "warning",
|
|
4697
|
+
style: { marginBottom: children ? "var(--sp-3)" : 0 },
|
|
4698
|
+
children: consequence
|
|
4699
|
+
}
|
|
4700
|
+
) : null,
|
|
4365
4701
|
children
|
|
4366
4702
|
]
|
|
4367
4703
|
}
|
|
@@ -4413,10 +4749,13 @@ function CommandPalette({
|
|
|
4413
4749
|
for (const group of groups) for (const item of group.items) byId.set(item.id, searchableText(item));
|
|
4414
4750
|
return byId;
|
|
4415
4751
|
}, [groups]);
|
|
4416
|
-
const filter = React28.useCallback(
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
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
|
+
);
|
|
4420
4759
|
const handleInputChange = (value) => {
|
|
4421
4760
|
setQuery(value);
|
|
4422
4761
|
onSearch?.(value);
|
|
@@ -4549,7 +4888,10 @@ function AppLauncher({
|
|
|
4549
4888
|
if (isFilteredExternally) return sections;
|
|
4550
4889
|
const q = query.trim();
|
|
4551
4890
|
if (!q) return sections;
|
|
4552
|
-
return sections.map((section) => ({
|
|
4891
|
+
return sections.map((section) => ({
|
|
4892
|
+
...section,
|
|
4893
|
+
items: section.items.filter((i) => contains(searchableText2(i), q))
|
|
4894
|
+
})).filter((section) => section.items.length > 0);
|
|
4553
4895
|
}, [sections, query, isFilteredExternally, contains]);
|
|
4554
4896
|
const isEmpty = !isLoading && visible.length === 0;
|
|
4555
4897
|
const label = ariaLabel ?? msg.appLauncherLabel;
|
|
@@ -4606,7 +4948,13 @@ function AppLauncher({
|
|
|
4606
4948
|
onAction?.(item.id);
|
|
4607
4949
|
},
|
|
4608
4950
|
children: [
|
|
4609
|
-
item.icon ? /* @__PURE__ */ jsx68("span", { className: "pire-launcher-item-icon", children: /* @__PURE__ */ jsx68(
|
|
4951
|
+
item.icon ? /* @__PURE__ */ jsx68("span", { className: "pire-launcher-item-icon", children: /* @__PURE__ */ jsx68(
|
|
4952
|
+
Icon,
|
|
4953
|
+
{
|
|
4954
|
+
name: item.icon,
|
|
4955
|
+
size: (section.variant ?? "tile") === "tile" ? 20 : 16
|
|
4956
|
+
}
|
|
4957
|
+
) }) : null,
|
|
4610
4958
|
/* @__PURE__ */ jsxs58("span", { className: "pire-launcher-item-text", children: [
|
|
4611
4959
|
/* @__PURE__ */ jsx68("span", { className: "pire-launcher-item-label", children: item.label }),
|
|
4612
4960
|
showsDescription ? /* @__PURE__ */ jsx68("span", { className: "pire-launcher-item-desc", children: item.description }) : null
|
|
@@ -4627,7 +4975,16 @@ function AppLauncher({
|
|
|
4627
4975
|
// src/components/patterns/SidePanel.tsx
|
|
4628
4976
|
import { ModalOverlay as ModalOverlay3, Modal as Modal3, Dialog as AriaDialog6, Heading as Heading5 } from "react-aria-components";
|
|
4629
4977
|
import { jsx as jsx69, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
4630
|
-
function SidePanel({
|
|
4978
|
+
function SidePanel({
|
|
4979
|
+
isOpen,
|
|
4980
|
+
title,
|
|
4981
|
+
subtitle,
|
|
4982
|
+
width = 400,
|
|
4983
|
+
children,
|
|
4984
|
+
footer,
|
|
4985
|
+
onClose,
|
|
4986
|
+
className
|
|
4987
|
+
}) {
|
|
4631
4988
|
const msg = usePireMessages();
|
|
4632
4989
|
return /* @__PURE__ */ jsx69(
|
|
4633
4990
|
ModalOverlay3,
|
|
@@ -4655,7 +5012,15 @@ function SidePanel({ isOpen, title, subtitle, width = 400, children, footer, onC
|
|
|
4655
5012
|
|
|
4656
5013
|
// src/components/patterns/EmptyState.tsx
|
|
4657
5014
|
import { jsx as jsx70, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
4658
|
-
function EmptyState({
|
|
5015
|
+
function EmptyState({
|
|
5016
|
+
icon = "file-text",
|
|
5017
|
+
title,
|
|
5018
|
+
action,
|
|
5019
|
+
compact,
|
|
5020
|
+
children,
|
|
5021
|
+
className,
|
|
5022
|
+
...rest
|
|
5023
|
+
}) {
|
|
4659
5024
|
return /* @__PURE__ */ jsxs60("div", { className: cx("pire-empty", className), "data-compact": compact ? "true" : void 0, ...rest, children: [
|
|
4660
5025
|
/* @__PURE__ */ jsx70(Icon, { name: icon, size: 24, className: "pire-empty-icon" }),
|
|
4661
5026
|
title ? /* @__PURE__ */ jsx70("p", { className: "pire-empty-title", style: { margin: 0 }, children: title }) : null,
|
|
@@ -4728,22 +5093,25 @@ function NumPad({
|
|
|
4728
5093
|
}) {
|
|
4729
5094
|
const msg = usePireMessages();
|
|
4730
5095
|
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
|
-
|
|
5096
|
+
const applyKey = React30.useCallback(
|
|
5097
|
+
(key) => {
|
|
5098
|
+
if (isDisabled) return;
|
|
5099
|
+
if (key.value === "backspace") {
|
|
5100
|
+
onChange(value.slice(0, -1));
|
|
5101
|
+
return;
|
|
5102
|
+
}
|
|
5103
|
+
if (key.value === "clear") {
|
|
5104
|
+
onChange("");
|
|
5105
|
+
return;
|
|
5106
|
+
}
|
|
5107
|
+
if (isInsertable(key.value)) {
|
|
5108
|
+
onChange(value + key.value);
|
|
5109
|
+
return;
|
|
5110
|
+
}
|
|
5111
|
+
onAction?.(key.value);
|
|
5112
|
+
},
|
|
5113
|
+
[isDisabled, value, onChange, onAction]
|
|
5114
|
+
);
|
|
4747
5115
|
useNumPadKeyboard((keyValue) => applyKey({ value: keyValue }), isDisabled, containerRef);
|
|
4748
5116
|
const keys = [...BASE_KEYS, ...extraKeys];
|
|
4749
5117
|
return /* @__PURE__ */ jsxs61(
|
|
@@ -4813,9 +5181,12 @@ function FileDropZone({
|
|
|
4813
5181
|
const [uncontrolled, setUncontrolled] = React31.useState(defaultValue ?? []);
|
|
4814
5182
|
const files = value ?? uncontrolled;
|
|
4815
5183
|
const created = React31.useRef([]);
|
|
4816
|
-
React31.useEffect(
|
|
4817
|
-
|
|
4818
|
-
|
|
5184
|
+
React31.useEffect(
|
|
5185
|
+
() => () => {
|
|
5186
|
+
for (const url of created.current) URL.revokeObjectURL(url);
|
|
5187
|
+
},
|
|
5188
|
+
[]
|
|
5189
|
+
);
|
|
4819
5190
|
const commit = (next) => {
|
|
4820
5191
|
if (value === void 0) setUncontrolled(next);
|
|
4821
5192
|
onChange?.(next);
|
|
@@ -4846,9 +5217,7 @@ function FileDropZone({
|
|
|
4846
5217
|
"data-height": height,
|
|
4847
5218
|
isDisabled: isDisabled || isReadOnly,
|
|
4848
5219
|
onDrop: async (e) => {
|
|
4849
|
-
const dropped = await Promise.all(
|
|
4850
|
-
e.items.filter(isFileDropItem).map((item) => item.getFile())
|
|
4851
|
-
);
|
|
5220
|
+
const dropped = await Promise.all(e.items.filter(isFileDropItem).map((item) => item.getFile()));
|
|
4852
5221
|
accept(dropped);
|
|
4853
5222
|
},
|
|
4854
5223
|
children: [
|
|
@@ -4887,7 +5256,14 @@ function FileDropZone({
|
|
|
4887
5256
|
}
|
|
4888
5257
|
|
|
4889
5258
|
// src/index.ts
|
|
4890
|
-
import {
|
|
5259
|
+
import {
|
|
5260
|
+
DialogTrigger as DialogTrigger2,
|
|
5261
|
+
MenuTrigger as MenuTrigger3,
|
|
5262
|
+
SubmenuTrigger,
|
|
5263
|
+
Popover as Popover9,
|
|
5264
|
+
RouterProvider,
|
|
5265
|
+
I18nProvider
|
|
5266
|
+
} from "react-aria-components";
|
|
4891
5267
|
import { Focusable as Focusable2 } from "react-aria-components";
|
|
4892
5268
|
export {
|
|
4893
5269
|
AppLauncher,
|