@orianatech/pire 1.5.0 → 2.0.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/forms/ChoiceCardGroup.d.cts +11 -1
- package/dist/components/forms/ChoiceCardGroup.d.ts +11 -1
- package/dist/components/forms/ChoiceCardGroup.d.ts.map +1 -1
- package/dist/components/forms/ComboBox.d.cts +11 -1
- package/dist/components/forms/ComboBox.d.ts +11 -1
- package/dist/components/forms/ComboBox.d.ts.map +1 -1
- package/dist/components/forms/DatePicker.d.cts +11 -1
- package/dist/components/forms/DatePicker.d.ts +11 -1
- package/dist/components/forms/DatePicker.d.ts.map +1 -1
- package/dist/components/forms/DateRangePicker.d.cts +11 -1
- package/dist/components/forms/DateRangePicker.d.ts +11 -1
- package/dist/components/forms/DateRangePicker.d.ts.map +1 -1
- package/dist/components/forms/FieldDescription.d.cts +16 -0
- package/dist/components/forms/FieldDescription.d.ts +17 -0
- package/dist/components/forms/FieldDescription.d.ts.map +1 -0
- package/dist/components/forms/FieldHelp.d.cts +19 -0
- package/dist/components/forms/FieldHelp.d.ts +20 -0
- package/dist/components/forms/FieldHelp.d.ts.map +1 -0
- package/dist/components/forms/FieldLabel.d.cts +36 -0
- package/dist/components/forms/FieldLabel.d.ts +37 -0
- package/dist/components/forms/FieldLabel.d.ts.map +1 -0
- package/dist/components/forms/FormField.d.cts +10 -1
- package/dist/components/forms/FormField.d.ts +10 -1
- package/dist/components/forms/FormField.d.ts.map +1 -1
- package/dist/components/forms/Input.d.cts +11 -1
- package/dist/components/forms/Input.d.ts +11 -1
- package/dist/components/forms/Input.d.ts.map +1 -1
- package/dist/components/forms/MultiComboBox.d.cts +11 -1
- package/dist/components/forms/MultiComboBox.d.ts +11 -1
- package/dist/components/forms/MultiComboBox.d.ts.map +1 -1
- package/dist/components/forms/NumberField.d.cts +11 -1
- package/dist/components/forms/NumberField.d.ts +11 -1
- package/dist/components/forms/NumberField.d.ts.map +1 -1
- package/dist/components/forms/Select.d.cts +38 -4
- package/dist/components/forms/Select.d.ts +38 -4
- package/dist/components/forms/Select.d.ts.map +1 -1
- package/dist/components/forms/TextArea.d.cts +11 -1
- package/dist/components/forms/TextArea.d.ts +11 -1
- package/dist/components/forms/TextArea.d.ts.map +1 -1
- package/dist/components/patterns/NumPad.d.cts +19 -2
- package/dist/components/patterns/NumPad.d.ts +19 -2
- package/dist/components/patterns/NumPad.d.ts.map +1 -1
- package/dist/components/utils/decimalSeparator.d.cts +9 -0
- package/dist/components/utils/decimalSeparator.d.ts +10 -0
- package/dist/components/utils/decimalSeparator.d.ts.map +1 -0
- package/dist/components/utils/devWarn.d.cts +9 -0
- package/dist/components/utils/devWarn.d.ts +10 -0
- package/dist/components/utils/devWarn.d.ts.map +1 -0
- package/dist/components.css +19 -0
- package/dist/i18n/messages.d.cts +16 -1
- package/dist/i18n/messages.d.ts +16 -1
- package/dist/i18n/messages.d.ts.map +1 -1
- package/dist/index.cjs +988 -845
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +874 -752
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -531,6 +531,7 @@ var enMessages = {
|
|
|
531
531
|
inlineMessageDismiss: "Dismiss message",
|
|
532
532
|
toastDismiss: "Dismiss",
|
|
533
533
|
toastRegionLabel: "Notifications",
|
|
534
|
+
selectPlaceholder: "Select\u2026",
|
|
534
535
|
selectEmpty: "No options available",
|
|
535
536
|
comboBoxShowSuggestions: "Show suggestions",
|
|
536
537
|
comboBoxLoading: "Searching\u2026",
|
|
@@ -541,6 +542,8 @@ var enMessages = {
|
|
|
541
542
|
numberFieldIncrease: "Increase",
|
|
542
543
|
numberFieldDecrease: "Decrease",
|
|
543
544
|
inputClear: "Clear",
|
|
545
|
+
fieldHelp: "More information",
|
|
546
|
+
fieldHelpNamed: "More information about {label}",
|
|
544
547
|
valueHelpFieldPlaceholder: "Not selected",
|
|
545
548
|
valueHelpFieldClear: "Clear selection",
|
|
546
549
|
valueHelpFieldOpenNamed: "Select {label}",
|
|
@@ -584,6 +587,7 @@ var enMessages = {
|
|
|
584
587
|
chartEmpty: "No data for this period",
|
|
585
588
|
numPadClear: "Clear",
|
|
586
589
|
numPadBackspace: "Remove last digit",
|
|
590
|
+
numPadDecimal: "Decimal separator",
|
|
587
591
|
viewSwitcherName: "Saved views: {view}",
|
|
588
592
|
viewSwitcherNameModified: "Saved views: {view}, modified",
|
|
589
593
|
viewSwitcherModifiedMark: "\xB7 modified",
|
|
@@ -615,6 +619,7 @@ var esMessages = {
|
|
|
615
619
|
inlineMessageDismiss: "Descartar mensaje",
|
|
616
620
|
toastDismiss: "Descartar",
|
|
617
621
|
toastRegionLabel: "Notificaciones",
|
|
622
|
+
selectPlaceholder: "Seleccionar\u2026",
|
|
618
623
|
selectEmpty: "Sin opciones disponibles",
|
|
619
624
|
comboBoxShowSuggestions: "Mostrar sugerencias",
|
|
620
625
|
comboBoxLoading: "Buscando\u2026",
|
|
@@ -625,6 +630,8 @@ var esMessages = {
|
|
|
625
630
|
numberFieldIncrease: "Aumentar",
|
|
626
631
|
numberFieldDecrease: "Disminuir",
|
|
627
632
|
inputClear: "Limpiar",
|
|
633
|
+
fieldHelp: "M\xE1s informaci\xF3n",
|
|
634
|
+
fieldHelpNamed: "M\xE1s informaci\xF3n sobre {label}",
|
|
628
635
|
valueHelpFieldPlaceholder: "Sin seleccionar",
|
|
629
636
|
valueHelpFieldClear: "Limpiar selecci\xF3n",
|
|
630
637
|
valueHelpFieldOpenNamed: "Seleccionar {label}",
|
|
@@ -668,6 +675,7 @@ var esMessages = {
|
|
|
668
675
|
chartEmpty: "Sin datos para este per\xEDodo",
|
|
669
676
|
numPadClear: "Limpiar",
|
|
670
677
|
numPadBackspace: "Borrar \xFAltimo d\xEDgito",
|
|
678
|
+
numPadDecimal: "Separador decimal",
|
|
671
679
|
viewSwitcherName: "Vistas guardadas: {view}",
|
|
672
680
|
viewSwitcherNameModified: "Vistas guardadas: {view}, modificada",
|
|
673
681
|
viewSwitcherModifiedMark: "\xB7 modificada",
|
|
@@ -946,8 +954,25 @@ function Kbd({ children, size = "md", className, ...rest }) {
|
|
|
946
954
|
return /* @__PURE__ */ jsx15("kbd", { className: cx("pire-kbd", className), "data-size": size, ...rest, children });
|
|
947
955
|
}
|
|
948
956
|
|
|
957
|
+
// src/components/forms/FieldHelp.tsx
|
|
958
|
+
import { ButtonContext } from "react-aria-components";
|
|
959
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
960
|
+
function FieldHelp({ children, label, placement = "top" }) {
|
|
961
|
+
const msg = usePireMessages();
|
|
962
|
+
return (
|
|
963
|
+
// React Aria hands every descendant Button the nearest slotted ButtonContext. Inside a
|
|
964
|
+
// NumberField that context has only `increment` and `decrement`, and an unslotted Button
|
|
965
|
+
// throws `A slot prop is required`; inside DatePicker, DateRangePicker and ComboBox the same
|
|
966
|
+
// Button is silently adopted as the field's *trigger*, which is worse than a crash because it
|
|
967
|
+
// renders. `value={null}` is React Aria's own idiom for lifting a subtree back out of a
|
|
968
|
+
// slotted context — the same one `MultiComboBox` and `FieldLabel` use — and is what makes
|
|
969
|
+
// this component safe anywhere.
|
|
970
|
+
/* @__PURE__ */ jsx16(ButtonContext.Provider, { value: null, children: /* @__PURE__ */ jsx16(Tooltip, { label: children, placement, children: /* @__PURE__ */ jsx16(IconButton, { icon: "help-circle", label: label ?? msg.fieldHelp, size: "sm", hideTooltip: true }) }) })
|
|
971
|
+
);
|
|
972
|
+
}
|
|
973
|
+
|
|
949
974
|
// src/components/forms/FormField.tsx
|
|
950
|
-
import { jsx as
|
|
975
|
+
import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
951
976
|
function FormField({
|
|
952
977
|
label,
|
|
953
978
|
htmlFor,
|
|
@@ -955,20 +980,25 @@ function FormField({
|
|
|
955
980
|
hint,
|
|
956
981
|
error,
|
|
957
982
|
layout = "stacked",
|
|
983
|
+
help,
|
|
958
984
|
children,
|
|
959
985
|
className,
|
|
960
986
|
...rest
|
|
961
987
|
}) {
|
|
988
|
+
const labelEl = /* @__PURE__ */ jsxs9("label", { className: "pire-field-label", htmlFor, children: [
|
|
989
|
+
label,
|
|
990
|
+
isRequired ? /* @__PURE__ */ jsx17("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
991
|
+
] });
|
|
962
992
|
return /* @__PURE__ */ jsxs9("div", { className: cx("pire-field", className), "data-layout": layout, ...rest, children: [
|
|
963
|
-
/* @__PURE__ */ jsxs9("
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
] }),
|
|
993
|
+
help ? /* @__PURE__ */ jsxs9("div", { className: "pire-field-labelrow", children: [
|
|
994
|
+
labelEl,
|
|
995
|
+
/* @__PURE__ */ jsx17(FieldHelp, { children: help })
|
|
996
|
+
] }) : labelEl,
|
|
967
997
|
children,
|
|
968
998
|
error ? /* @__PURE__ */ jsxs9("span", { className: "pire-field-error", role: "alert", children: [
|
|
969
|
-
/* @__PURE__ */
|
|
999
|
+
/* @__PURE__ */ jsx17(Icon, { name: "alert-circle", size: 12 }),
|
|
970
1000
|
error
|
|
971
|
-
] }) : hint ? /* @__PURE__ */
|
|
1001
|
+
] }) : hint ? /* @__PURE__ */ jsx17("span", { className: "pire-field-hint", children: hint }) : null
|
|
972
1002
|
] });
|
|
973
1003
|
}
|
|
974
1004
|
|
|
@@ -976,10 +1006,8 @@ function FormField({
|
|
|
976
1006
|
import * as React10 from "react";
|
|
977
1007
|
import {
|
|
978
1008
|
TextField,
|
|
979
|
-
Label,
|
|
980
1009
|
Input as AriaInput,
|
|
981
1010
|
Group,
|
|
982
|
-
Text as Text3,
|
|
983
1011
|
FieldError,
|
|
984
1012
|
Button as AriaButton4
|
|
985
1013
|
} from "react-aria-components";
|
|
@@ -990,13 +1018,75 @@ function focusFieldOf(button) {
|
|
|
990
1018
|
control?.querySelector(".pire-datesegment, .pire-input, input, textarea")?.focus();
|
|
991
1019
|
}
|
|
992
1020
|
|
|
1021
|
+
// src/components/forms/FieldLabel.tsx
|
|
1022
|
+
import { ButtonContext as ButtonContext2, Label } from "react-aria-components";
|
|
1023
|
+
|
|
1024
|
+
// src/components/utils/devWarn.ts
|
|
1025
|
+
var IS_DEV2 = process.env.NODE_ENV !== "production";
|
|
1026
|
+
var warned2 = /* @__PURE__ */ new Set();
|
|
1027
|
+
function warnOnce2(key, message) {
|
|
1028
|
+
if (warned2.has(key)) return;
|
|
1029
|
+
warned2.add(key);
|
|
1030
|
+
console.warn(`[pire] ${message}`);
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
// src/components/forms/FieldLabel.tsx
|
|
1034
|
+
import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1035
|
+
function warnHelpWithoutLabel(component, label, help) {
|
|
1036
|
+
if (!IS_DEV2 || !help || label) return;
|
|
1037
|
+
warnOnce2(
|
|
1038
|
+
`help-without-label:${component}`,
|
|
1039
|
+
`${component}: \`help\` needs a visible \`label\`. Its icon is drawn beside one, so a field named only by \`aria-label\` renders no icon at all \u2014 the text still reaches a screen reader through the field's description, but nothing on screen offers it. Pass \`label\`, or move the sentence to \`description\`.`
|
|
1040
|
+
);
|
|
1041
|
+
}
|
|
1042
|
+
function FieldLabel({ label, isRequired, help }) {
|
|
1043
|
+
const msg = usePireMessages();
|
|
1044
|
+
const text = /* @__PURE__ */ jsxs10(Label, { className: "pire-field-label", children: [
|
|
1045
|
+
label,
|
|
1046
|
+
isRequired ? /* @__PURE__ */ jsx18("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1047
|
+
] });
|
|
1048
|
+
return (
|
|
1049
|
+
// React Aria's own idiom for lifting a subtree back out of a slotted context — the same one
|
|
1050
|
+
// `MultiComboBox` uses on its chips, and the one Popover uses on the way into an overlay.
|
|
1051
|
+
// Without it every Button below a field inherits that field's trigger props.
|
|
1052
|
+
/* @__PURE__ */ jsx18(ButtonContext2.Provider, { value: null, children: help ? /* @__PURE__ */ jsxs10("div", { className: "pire-field-labelrow", children: [
|
|
1053
|
+
text,
|
|
1054
|
+
/* @__PURE__ */ jsx18(
|
|
1055
|
+
FieldHelp,
|
|
1056
|
+
{
|
|
1057
|
+
label: typeof label === "string" ? msg.fieldHelpNamed.replace("{label}", label.toLowerCase()) : void 0,
|
|
1058
|
+
children: help
|
|
1059
|
+
}
|
|
1060
|
+
)
|
|
1061
|
+
] }) : text })
|
|
1062
|
+
);
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
// src/components/forms/FieldDescription.tsx
|
|
1066
|
+
import { Text as Text3 } from "react-aria-components";
|
|
1067
|
+
import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1068
|
+
function FieldDescription({ description, help }) {
|
|
1069
|
+
if (!description && !help) return null;
|
|
1070
|
+
return (
|
|
1071
|
+
// The class is picked, never combined: `.pire-sr-only` is `!important` and pairing it with
|
|
1072
|
+
// another pire-* class is what grew the document sideways in 0.23.0. Choosing `pire-sr-only`
|
|
1073
|
+
// when there is no visible description also keeps the node out of `.pire-field`'s flex gap —
|
|
1074
|
+
// a `pire-field-hint` holding only hidden text still opens a visible gap under every field.
|
|
1075
|
+
/* @__PURE__ */ jsxs11(Text3, { slot: "description", className: description ? "pire-field-hint" : "pire-sr-only", children: [
|
|
1076
|
+
description,
|
|
1077
|
+
help ? /* @__PURE__ */ jsx19("span", { className: "pire-sr-only", children: help }) : null
|
|
1078
|
+
] })
|
|
1079
|
+
);
|
|
1080
|
+
}
|
|
1081
|
+
|
|
993
1082
|
// src/components/forms/Input.tsx
|
|
994
|
-
import { jsx as
|
|
1083
|
+
import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
995
1084
|
function Input({
|
|
996
1085
|
label,
|
|
997
1086
|
icon,
|
|
998
1087
|
suffix,
|
|
999
1088
|
description,
|
|
1089
|
+
help,
|
|
1000
1090
|
errorMessage,
|
|
1001
1091
|
size = "md",
|
|
1002
1092
|
numeric,
|
|
@@ -1020,7 +1110,8 @@ function Input({
|
|
|
1020
1110
|
const takesOverValue = isClearable && !isControlled;
|
|
1021
1111
|
const valueProps = takesOverValue ? { value: ownValue, defaultValue: void 0 } : {};
|
|
1022
1112
|
const showsClear = isClearable && currentValue !== "" && !rest.isDisabled && !rest.isReadOnly;
|
|
1023
|
-
|
|
1113
|
+
warnHelpWithoutLabel("Input", label, help);
|
|
1114
|
+
return /* @__PURE__ */ jsxs12(
|
|
1024
1115
|
TextField,
|
|
1025
1116
|
{
|
|
1026
1117
|
className: cx("pire-field", className),
|
|
@@ -1030,11 +1121,8 @@ function Input({
|
|
|
1030
1121
|
...rest,
|
|
1031
1122
|
...valueProps,
|
|
1032
1123
|
children: [
|
|
1033
|
-
label ? /* @__PURE__ */
|
|
1034
|
-
|
|
1035
|
-
rest.isRequired ? /* @__PURE__ */ jsx17("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1036
|
-
] }) : null,
|
|
1037
|
-
/* @__PURE__ */ jsxs10(
|
|
1124
|
+
label ? /* @__PURE__ */ jsx20(FieldLabel, { label, isRequired: rest.isRequired, help }) : null,
|
|
1125
|
+
/* @__PURE__ */ jsxs12(
|
|
1038
1126
|
Group,
|
|
1039
1127
|
{
|
|
1040
1128
|
className: "pire-control",
|
|
@@ -1043,9 +1131,9 @@ function Input({
|
|
|
1043
1131
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1044
1132
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1045
1133
|
children: [
|
|
1046
|
-
icon ? /* @__PURE__ */
|
|
1047
|
-
/* @__PURE__ */
|
|
1048
|
-
showsClear ? /* @__PURE__ */
|
|
1134
|
+
icon ? /* @__PURE__ */ jsx20(Icon, { name: icon, size: 16, className: "pire-leading-icon" }) : null,
|
|
1135
|
+
/* @__PURE__ */ jsx20(AriaInput, { ref: inputRef, className: "pire-input", "data-numeric": numeric ? "true" : void 0 }),
|
|
1136
|
+
showsClear ? /* @__PURE__ */ jsx20(
|
|
1049
1137
|
AriaButton4,
|
|
1050
1138
|
{
|
|
1051
1139
|
className: "pire-input-clear",
|
|
@@ -1056,12 +1144,12 @@ function Input({
|
|
|
1056
1144
|
children: clearLabel ?? msg.inputClear
|
|
1057
1145
|
}
|
|
1058
1146
|
) : null,
|
|
1059
|
-
suffix ? /* @__PURE__ */
|
|
1147
|
+
suffix ? /* @__PURE__ */ jsx20("span", { className: "pire-affix", children: suffix }) : null
|
|
1060
1148
|
]
|
|
1061
1149
|
}
|
|
1062
1150
|
),
|
|
1063
|
-
|
|
1064
|
-
/* @__PURE__ */
|
|
1151
|
+
/* @__PURE__ */ jsx20(FieldDescription, { description, help }),
|
|
1152
|
+
/* @__PURE__ */ jsx20(FieldError, { className: "pire-field-error", children: errorMessage })
|
|
1065
1153
|
]
|
|
1066
1154
|
}
|
|
1067
1155
|
);
|
|
@@ -1069,12 +1157,13 @@ function Input({
|
|
|
1069
1157
|
|
|
1070
1158
|
// src/components/forms/TextArea.tsx
|
|
1071
1159
|
import * as React11 from "react";
|
|
1072
|
-
import { TextField as TextField2,
|
|
1073
|
-
import { jsx as
|
|
1160
|
+
import { TextField as TextField2, TextArea as AriaTextArea, Group as Group2, FieldError as FieldError2 } from "react-aria-components";
|
|
1161
|
+
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1074
1162
|
var useIsomorphicLayoutEffect = typeof document === "undefined" ? React11.useEffect : React11.useLayoutEffect;
|
|
1075
1163
|
function TextArea({
|
|
1076
1164
|
label,
|
|
1077
1165
|
description,
|
|
1166
|
+
help,
|
|
1078
1167
|
errorMessage,
|
|
1079
1168
|
size = "md",
|
|
1080
1169
|
rows = 3,
|
|
@@ -1114,7 +1203,8 @@ function TextArea({
|
|
|
1114
1203
|
}
|
|
1115
1204
|
grow();
|
|
1116
1205
|
}, [autoGrow, grow, rest.value]);
|
|
1117
|
-
|
|
1206
|
+
warnHelpWithoutLabel("TextArea", label, help);
|
|
1207
|
+
return /* @__PURE__ */ jsxs13(
|
|
1118
1208
|
TextField2,
|
|
1119
1209
|
{
|
|
1120
1210
|
className: cx("pire-field", className),
|
|
@@ -1123,11 +1213,8 @@ function TextArea({
|
|
|
1123
1213
|
validationBehavior: "aria",
|
|
1124
1214
|
...rest,
|
|
1125
1215
|
children: [
|
|
1126
|
-
label ? /* @__PURE__ */
|
|
1127
|
-
|
|
1128
|
-
rest.isRequired ? /* @__PURE__ */ jsx18("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1129
|
-
] }) : null,
|
|
1130
|
-
/* @__PURE__ */ jsx18(
|
|
1216
|
+
label ? /* @__PURE__ */ jsx21(FieldLabel, { label, isRequired: rest.isRequired, help }) : null,
|
|
1217
|
+
/* @__PURE__ */ jsx21(
|
|
1131
1218
|
Group2,
|
|
1132
1219
|
{
|
|
1133
1220
|
className: "pire-control",
|
|
@@ -1136,7 +1223,7 @@ function TextArea({
|
|
|
1136
1223
|
"data-multiline": "true",
|
|
1137
1224
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1138
1225
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1139
|
-
children: /* @__PURE__ */
|
|
1226
|
+
children: /* @__PURE__ */ jsx21(
|
|
1140
1227
|
AriaTextArea,
|
|
1141
1228
|
{
|
|
1142
1229
|
ref,
|
|
@@ -1148,26 +1235,26 @@ function TextArea({
|
|
|
1148
1235
|
)
|
|
1149
1236
|
}
|
|
1150
1237
|
),
|
|
1151
|
-
|
|
1152
|
-
/* @__PURE__ */
|
|
1238
|
+
/* @__PURE__ */ jsx21(FieldDescription, { description, help }),
|
|
1239
|
+
/* @__PURE__ */ jsx21(FieldError2, { className: "pire-field-error", children: errorMessage })
|
|
1153
1240
|
]
|
|
1154
1241
|
}
|
|
1155
1242
|
);
|
|
1156
1243
|
}
|
|
1157
1244
|
|
|
1158
1245
|
// src/components/forms/Select.tsx
|
|
1246
|
+
import * as React12 from "react";
|
|
1159
1247
|
import {
|
|
1160
1248
|
Select as AriaSelect,
|
|
1161
|
-
Label as Label3,
|
|
1162
1249
|
Button as AriaButton5,
|
|
1163
1250
|
SelectValue,
|
|
1164
1251
|
Popover,
|
|
1165
1252
|
ListBox,
|
|
1166
1253
|
ListBoxItem,
|
|
1167
|
-
Text as Text5,
|
|
1168
1254
|
FieldError as FieldError3
|
|
1169
1255
|
} from "react-aria-components";
|
|
1170
|
-
import { jsx as
|
|
1256
|
+
import { jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1257
|
+
var CLEAR_KEY = "__pire-select-clear__";
|
|
1171
1258
|
var norm = (o) => typeof o === "string" ? { value: o, label: o, isDisabled: false } : o;
|
|
1172
1259
|
function Select({
|
|
1173
1260
|
label,
|
|
@@ -1175,8 +1262,10 @@ function Select({
|
|
|
1175
1262
|
defaultValue,
|
|
1176
1263
|
onChange,
|
|
1177
1264
|
options = [],
|
|
1178
|
-
placeholder
|
|
1265
|
+
placeholder,
|
|
1266
|
+
isClearable,
|
|
1179
1267
|
description,
|
|
1268
|
+
help,
|
|
1180
1269
|
errorMessage,
|
|
1181
1270
|
emptyLabel,
|
|
1182
1271
|
size = "md",
|
|
@@ -1187,24 +1276,46 @@ function Select({
|
|
|
1187
1276
|
}) {
|
|
1188
1277
|
const msg = usePireMessages();
|
|
1189
1278
|
const items = options.map(norm);
|
|
1190
|
-
|
|
1279
|
+
const effectivePlaceholder = placeholder ?? msg.selectPlaceholder;
|
|
1280
|
+
const isSelectionControlled = value !== void 0;
|
|
1281
|
+
const [ownSelection, setOwnSelection] = React12.useState(defaultValue ?? null);
|
|
1282
|
+
const takesOverSelection = isClearable === true && !isSelectionControlled;
|
|
1283
|
+
const collides = items.some((item) => item.value === CLEAR_KEY);
|
|
1284
|
+
const showsClear = isClearable === true && !rest.isDisabled && items.length > 0 && !collides;
|
|
1285
|
+
if (IS_DEV2 && isClearable === true && !rest.isDisabled && collides) {
|
|
1286
|
+
warnOnce2(
|
|
1287
|
+
CLEAR_KEY,
|
|
1288
|
+
`Select: an option's value is "${CLEAR_KEY}", which isClearable reserves for its "nothing chosen" row. The clear row has been dropped so the option keeps working \u2014 rename the option to get it back.`
|
|
1289
|
+
);
|
|
1290
|
+
}
|
|
1291
|
+
const rows = showsClear ? [
|
|
1292
|
+
// The row's own label falls back to the dictionary even when `placeholder` is explicitly
|
|
1293
|
+
// `''`: an empty trigger is a deliberate, supported shape, but a listbox option with no
|
|
1294
|
+
// accessible name is not — it would be unreachable by name and silent to a screen reader.
|
|
1295
|
+
{ value: CLEAR_KEY, label: effectivePlaceholder || msg.selectPlaceholder, isDisabled: false },
|
|
1296
|
+
...items
|
|
1297
|
+
] : items;
|
|
1298
|
+
warnHelpWithoutLabel("Select", label, help);
|
|
1299
|
+
return /* @__PURE__ */ jsxs14(
|
|
1191
1300
|
AriaSelect,
|
|
1192
1301
|
{
|
|
1193
1302
|
className: cx("pire-field", className),
|
|
1194
1303
|
style,
|
|
1195
|
-
selectedKey: value,
|
|
1196
|
-
defaultSelectedKey: defaultValue,
|
|
1197
|
-
onSelectionChange: (k) =>
|
|
1304
|
+
selectedKey: takesOverSelection ? ownSelection : value,
|
|
1305
|
+
defaultSelectedKey: takesOverSelection ? void 0 : defaultValue,
|
|
1306
|
+
onSelectionChange: (k) => {
|
|
1307
|
+
const raw = k == null ? null : String(k);
|
|
1308
|
+
const next = showsClear && raw === CLEAR_KEY ? null : raw;
|
|
1309
|
+
if (takesOverSelection) setOwnSelection(next);
|
|
1310
|
+
onChange?.(next);
|
|
1311
|
+
},
|
|
1198
1312
|
allowsEmptyCollection: true,
|
|
1199
|
-
placeholder,
|
|
1313
|
+
placeholder: effectivePlaceholder,
|
|
1200
1314
|
validationBehavior: "aria",
|
|
1201
1315
|
...rest,
|
|
1202
1316
|
children: [
|
|
1203
|
-
label ? /* @__PURE__ */
|
|
1204
|
-
|
|
1205
|
-
rest.isRequired ? /* @__PURE__ */ jsx19("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1206
|
-
] }) : null,
|
|
1207
|
-
/* @__PURE__ */ jsxs12(
|
|
1317
|
+
label ? /* @__PURE__ */ jsx22(FieldLabel, { label, isRequired: rest.isRequired, help }) : null,
|
|
1318
|
+
/* @__PURE__ */ jsxs14(
|
|
1208
1319
|
AriaButton5,
|
|
1209
1320
|
{
|
|
1210
1321
|
className: "pire-control",
|
|
@@ -1212,26 +1323,27 @@ function Select({
|
|
|
1212
1323
|
"data-full-width": String(fullWidth),
|
|
1213
1324
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1214
1325
|
children: [
|
|
1215
|
-
/* @__PURE__ */
|
|
1216
|
-
/* @__PURE__ */
|
|
1326
|
+
/* @__PURE__ */ jsx22(SelectValue, { className: "pire-select-value" }),
|
|
1327
|
+
/* @__PURE__ */ jsx22(Icon, { name: "chevron-down", size: 16, className: "pire-leading-icon" })
|
|
1217
1328
|
]
|
|
1218
1329
|
}
|
|
1219
1330
|
),
|
|
1220
|
-
|
|
1221
|
-
/* @__PURE__ */
|
|
1222
|
-
/* @__PURE__ */
|
|
1331
|
+
/* @__PURE__ */ jsx22(FieldDescription, { description, help }),
|
|
1332
|
+
/* @__PURE__ */ jsx22(FieldError3, { className: "pire-field-error", children: errorMessage }),
|
|
1333
|
+
/* @__PURE__ */ jsx22(Popover, { className: "pire-popover", children: /* @__PURE__ */ jsx22(
|
|
1223
1334
|
ListBox,
|
|
1224
1335
|
{
|
|
1225
1336
|
className: "pire-listbox",
|
|
1226
|
-
items,
|
|
1227
|
-
renderEmptyState: () => /* @__PURE__ */
|
|
1228
|
-
children: (item) => /* @__PURE__ */
|
|
1337
|
+
items: rows,
|
|
1338
|
+
renderEmptyState: () => /* @__PURE__ */ jsx22("div", { className: "pire-listbox-status", role: "status", "aria-live": "polite", children: emptyLabel ?? msg.selectEmpty }),
|
|
1339
|
+
children: (item) => /* @__PURE__ */ jsx22(
|
|
1229
1340
|
ListBoxItem,
|
|
1230
1341
|
{
|
|
1231
1342
|
className: "pire-option",
|
|
1232
1343
|
id: item.value,
|
|
1233
1344
|
textValue: item.label,
|
|
1234
1345
|
isDisabled: item.isDisabled,
|
|
1346
|
+
"data-clear": item.value === CLEAR_KEY ? "true" : void 0,
|
|
1235
1347
|
children: item.label
|
|
1236
1348
|
}
|
|
1237
1349
|
)
|
|
@@ -1244,13 +1356,13 @@ function Select({
|
|
|
1244
1356
|
|
|
1245
1357
|
// src/components/forms/Checkbox.tsx
|
|
1246
1358
|
import { Checkbox as AriaCheckbox } from "react-aria-components";
|
|
1247
|
-
import { Fragment, jsx as
|
|
1359
|
+
import { Fragment, jsx as jsx23, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1248
1360
|
function Checkbox({ label, hint, children, className, ...rest }) {
|
|
1249
|
-
return /* @__PURE__ */
|
|
1250
|
-
/* @__PURE__ */
|
|
1251
|
-
/* @__PURE__ */
|
|
1361
|
+
return /* @__PURE__ */ jsx23(AriaCheckbox, { className: cx("pire-choice", className), ...rest, children: ({ isSelected, isIndeterminate }) => /* @__PURE__ */ jsxs15(Fragment, { children: [
|
|
1362
|
+
/* @__PURE__ */ jsx23("span", { className: "pire-choice-box", "aria-hidden": "true", children: isIndeterminate ? /* @__PURE__ */ jsx23(Icon, { name: "minus", size: 12 }) : isSelected ? /* @__PURE__ */ jsx23(Icon, { name: "check", size: 12 }) : null }),
|
|
1363
|
+
/* @__PURE__ */ jsxs15("span", { children: [
|
|
1252
1364
|
label ?? children,
|
|
1253
|
-
hint ? /* @__PURE__ */
|
|
1365
|
+
hint ? /* @__PURE__ */ jsx23("span", { className: "pire-choice-hint", children: hint }) : null
|
|
1254
1366
|
] })
|
|
1255
1367
|
] }) });
|
|
1256
1368
|
}
|
|
@@ -1259,11 +1371,11 @@ function Checkbox({ label, hint, children, className, ...rest }) {
|
|
|
1259
1371
|
import {
|
|
1260
1372
|
RadioGroup as AriaRadioGroup,
|
|
1261
1373
|
Radio as AriaRadio,
|
|
1262
|
-
Label as
|
|
1263
|
-
Text as
|
|
1374
|
+
Label as Label2,
|
|
1375
|
+
Text as Text4,
|
|
1264
1376
|
FieldError as FieldError4
|
|
1265
1377
|
} from "react-aria-components";
|
|
1266
|
-
import { jsx as
|
|
1378
|
+
import { jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1267
1379
|
function RadioGroup({
|
|
1268
1380
|
label,
|
|
1269
1381
|
description,
|
|
@@ -1272,45 +1384,40 @@ function RadioGroup({
|
|
|
1272
1384
|
className,
|
|
1273
1385
|
...rest
|
|
1274
1386
|
}) {
|
|
1275
|
-
return /* @__PURE__ */
|
|
1276
|
-
label ? /* @__PURE__ */
|
|
1277
|
-
/* @__PURE__ */
|
|
1278
|
-
description ? /* @__PURE__ */
|
|
1279
|
-
/* @__PURE__ */
|
|
1387
|
+
return /* @__PURE__ */ jsxs16(AriaRadioGroup, { className: cx("pire-field", className), validationBehavior: "aria", ...rest, children: [
|
|
1388
|
+
label ? /* @__PURE__ */ jsx24(Label2, { className: "pire-field-label", children: label }) : null,
|
|
1389
|
+
/* @__PURE__ */ jsx24("div", { className: "pire-radiogroup", children }),
|
|
1390
|
+
description ? /* @__PURE__ */ jsx24(Text4, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
1391
|
+
/* @__PURE__ */ jsx24(FieldError4, { className: "pire-field-error", children: errorMessage })
|
|
1280
1392
|
] });
|
|
1281
1393
|
}
|
|
1282
1394
|
function Radio({ label, hint, children, className, ...rest }) {
|
|
1283
|
-
return /* @__PURE__ */
|
|
1284
|
-
/* @__PURE__ */
|
|
1285
|
-
/* @__PURE__ */
|
|
1395
|
+
return /* @__PURE__ */ jsxs16(AriaRadio, { className: cx("pire-choice", className), ...rest, children: [
|
|
1396
|
+
/* @__PURE__ */ jsx24("span", { className: "pire-choice-box", "data-radio": "true", "aria-hidden": "true" }),
|
|
1397
|
+
/* @__PURE__ */ jsxs16("span", { children: [
|
|
1286
1398
|
label ?? children,
|
|
1287
|
-
hint ? /* @__PURE__ */
|
|
1399
|
+
hint ? /* @__PURE__ */ jsx24("span", { className: "pire-choice-hint", children: hint }) : null
|
|
1288
1400
|
] })
|
|
1289
1401
|
] });
|
|
1290
1402
|
}
|
|
1291
1403
|
|
|
1292
1404
|
// src/components/forms/Switch.tsx
|
|
1293
1405
|
import { Switch as AriaSwitch } from "react-aria-components";
|
|
1294
|
-
import { jsx as
|
|
1406
|
+
import { jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1295
1407
|
function Switch({ label, children, className, ...rest }) {
|
|
1296
|
-
return /* @__PURE__ */
|
|
1297
|
-
/* @__PURE__ */
|
|
1298
|
-
/* @__PURE__ */
|
|
1408
|
+
return /* @__PURE__ */ jsxs17(AriaSwitch, { className: cx("pire-choice", className), ...rest, children: [
|
|
1409
|
+
/* @__PURE__ */ jsx25("span", { className: "pire-switch-track", "aria-hidden": "true", children: /* @__PURE__ */ jsx25("span", { className: "pire-switch-thumb" }) }),
|
|
1410
|
+
/* @__PURE__ */ jsx25("span", { children: label ?? children })
|
|
1299
1411
|
] });
|
|
1300
1412
|
}
|
|
1301
1413
|
|
|
1302
1414
|
// src/components/forms/ChoiceCardGroup.tsx
|
|
1303
|
-
import {
|
|
1304
|
-
|
|
1305
|
-
Radio as AriaRadio2,
|
|
1306
|
-
Label as Label5,
|
|
1307
|
-
Text as Text7,
|
|
1308
|
-
FieldError as FieldError5
|
|
1309
|
-
} from "react-aria-components";
|
|
1310
|
-
import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1415
|
+
import { RadioGroup as AriaRadioGroup2, Radio as AriaRadio2, FieldError as FieldError5 } from "react-aria-components";
|
|
1416
|
+
import { jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1311
1417
|
function ChoiceCardGroup({
|
|
1312
1418
|
label,
|
|
1313
1419
|
description,
|
|
1420
|
+
help,
|
|
1314
1421
|
errorMessage,
|
|
1315
1422
|
options,
|
|
1316
1423
|
value,
|
|
@@ -1323,7 +1430,8 @@ function ChoiceCardGroup({
|
|
|
1323
1430
|
style,
|
|
1324
1431
|
...rest
|
|
1325
1432
|
}) {
|
|
1326
|
-
|
|
1433
|
+
warnHelpWithoutLabel("ChoiceCardGroup", label, help);
|
|
1434
|
+
return /* @__PURE__ */ jsxs18(
|
|
1327
1435
|
AriaRadioGroup2,
|
|
1328
1436
|
{
|
|
1329
1437
|
className: cx("pire-field", className),
|
|
@@ -1336,47 +1444,42 @@ function ChoiceCardGroup({
|
|
|
1336
1444
|
isDisabled,
|
|
1337
1445
|
isRequired,
|
|
1338
1446
|
children: [
|
|
1339
|
-
label ? /* @__PURE__ */
|
|
1340
|
-
|
|
1341
|
-
isRequired ? /* @__PURE__ */ jsx23("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1342
|
-
] }) : null,
|
|
1343
|
-
/* @__PURE__ */ jsx23("div", { className: "pire-choicecards", style: { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }, children: options.map((option) => /* @__PURE__ */ jsxs16(
|
|
1447
|
+
label ? /* @__PURE__ */ jsx26(FieldLabel, { label, isRequired, help }) : null,
|
|
1448
|
+
/* @__PURE__ */ jsx26("div", { className: "pire-choicecards", style: { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }, children: options.map((option) => /* @__PURE__ */ jsxs18(
|
|
1344
1449
|
AriaRadio2,
|
|
1345
1450
|
{
|
|
1346
1451
|
value: option.id,
|
|
1347
1452
|
className: "pire-choicecard",
|
|
1348
1453
|
isDisabled: option.isDisabled,
|
|
1349
1454
|
children: [
|
|
1350
|
-
option.icon ? /* @__PURE__ */
|
|
1351
|
-
/* @__PURE__ */
|
|
1352
|
-
option.description ? /* @__PURE__ */
|
|
1353
|
-
option.preview ? /* @__PURE__ */
|
|
1455
|
+
option.icon ? /* @__PURE__ */ jsx26(Icon, { name: option.icon, size: 20 }) : null,
|
|
1456
|
+
/* @__PURE__ */ jsx26("span", { className: "pire-choicecard-label", children: option.label }),
|
|
1457
|
+
option.description ? /* @__PURE__ */ jsx26("span", { className: "pire-choicecard-desc", children: option.description }) : null,
|
|
1458
|
+
option.preview ? /* @__PURE__ */ jsx26("span", { className: "pire-choicecard-preview", "aria-hidden": "true", children: option.preview }) : null
|
|
1354
1459
|
]
|
|
1355
1460
|
},
|
|
1356
1461
|
option.id
|
|
1357
1462
|
)) }),
|
|
1358
|
-
|
|
1359
|
-
/* @__PURE__ */
|
|
1463
|
+
/* @__PURE__ */ jsx26(FieldDescription, { description, help }),
|
|
1464
|
+
/* @__PURE__ */ jsx26(FieldError5, { className: "pire-field-error", children: errorMessage })
|
|
1360
1465
|
]
|
|
1361
1466
|
}
|
|
1362
1467
|
);
|
|
1363
1468
|
}
|
|
1364
1469
|
|
|
1365
1470
|
// src/components/forms/ComboBox.tsx
|
|
1366
|
-
import * as
|
|
1471
|
+
import * as React13 from "react";
|
|
1367
1472
|
import {
|
|
1368
1473
|
ComboBox as AriaComboBox,
|
|
1369
|
-
Label as Label6,
|
|
1370
1474
|
Input as AriaInput2,
|
|
1371
1475
|
Button as AriaButton6,
|
|
1372
1476
|
Group as Group3,
|
|
1373
1477
|
Popover as Popover2,
|
|
1374
1478
|
ListBox as ListBox2,
|
|
1375
1479
|
ListBoxItem as ListBoxItem2,
|
|
1376
|
-
Text as Text8,
|
|
1377
1480
|
FieldError as FieldError6
|
|
1378
1481
|
} from "react-aria-components";
|
|
1379
|
-
import { jsx as
|
|
1482
|
+
import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1380
1483
|
var norm2 = (o) => typeof o === "string" ? { value: o, label: o } : o;
|
|
1381
1484
|
function ComboBox({
|
|
1382
1485
|
label,
|
|
@@ -1387,6 +1490,7 @@ function ComboBox({
|
|
|
1387
1490
|
inputValue,
|
|
1388
1491
|
options = [],
|
|
1389
1492
|
description,
|
|
1493
|
+
help,
|
|
1390
1494
|
errorMessage,
|
|
1391
1495
|
size = "md",
|
|
1392
1496
|
fullWidth = true,
|
|
@@ -1404,10 +1508,10 @@ function ComboBox({
|
|
|
1404
1508
|
const msg = usePireMessages();
|
|
1405
1509
|
const items = options.map(norm2);
|
|
1406
1510
|
const isSelectionControlled = value !== void 0;
|
|
1407
|
-
const [ownSelection, setOwnSelection] =
|
|
1511
|
+
const [ownSelection, setOwnSelection] = React13.useState(defaultValue ?? null);
|
|
1408
1512
|
const takesOverSelection = isClearable === true && !isSelectionControlled;
|
|
1409
1513
|
const currentSelection = isSelectionControlled ? value : ownSelection;
|
|
1410
|
-
const [typedText, setTypedText] =
|
|
1514
|
+
const [typedText, setTypedText] = React13.useState("");
|
|
1411
1515
|
const currentText = inputValue !== void 0 ? inputValue : typedText;
|
|
1412
1516
|
const handleInputChange = isClearable ? (text) => {
|
|
1413
1517
|
setTypedText(text);
|
|
@@ -1422,7 +1526,8 @@ function ComboBox({
|
|
|
1422
1526
|
};
|
|
1423
1527
|
const collection = isFilteredExternally ? { items } : { defaultItems: items };
|
|
1424
1528
|
const showsStatus = isLoading || isFilteredExternally && items.length === 0 && emptyLabel != null;
|
|
1425
|
-
|
|
1529
|
+
warnHelpWithoutLabel("ComboBox", label, help);
|
|
1530
|
+
return /* @__PURE__ */ jsxs19(
|
|
1426
1531
|
AriaComboBox,
|
|
1427
1532
|
{
|
|
1428
1533
|
className: cx("pire-field", className),
|
|
@@ -1443,11 +1548,8 @@ function ComboBox({
|
|
|
1443
1548
|
validationBehavior: "aria",
|
|
1444
1549
|
...rest,
|
|
1445
1550
|
children: [
|
|
1446
|
-
label ? /* @__PURE__ */
|
|
1447
|
-
|
|
1448
|
-
rest.isRequired ? /* @__PURE__ */ jsx24("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1449
|
-
] }) : null,
|
|
1450
|
-
/* @__PURE__ */ jsxs17(
|
|
1551
|
+
label ? /* @__PURE__ */ jsx27(FieldLabel, { label, isRequired: rest.isRequired, help }) : null,
|
|
1552
|
+
/* @__PURE__ */ jsxs19(
|
|
1451
1553
|
Group3,
|
|
1452
1554
|
{
|
|
1453
1555
|
className: "pire-control",
|
|
@@ -1455,9 +1557,9 @@ function ComboBox({
|
|
|
1455
1557
|
"data-full-width": String(fullWidth),
|
|
1456
1558
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1457
1559
|
children: [
|
|
1458
|
-
/* @__PURE__ */
|
|
1459
|
-
/* @__PURE__ */
|
|
1460
|
-
showsClear ? /* @__PURE__ */
|
|
1560
|
+
/* @__PURE__ */ jsx27(Icon, { name: "search", size: 16, className: "pire-leading-icon" }),
|
|
1561
|
+
/* @__PURE__ */ jsx27(AriaInput2, { className: "pire-input", placeholder: rest.placeholder }),
|
|
1562
|
+
showsClear ? /* @__PURE__ */ jsx27(
|
|
1461
1563
|
AriaButton6,
|
|
1462
1564
|
{
|
|
1463
1565
|
className: "pire-input-clear",
|
|
@@ -1469,22 +1571,22 @@ function ComboBox({
|
|
|
1469
1571
|
children: clearLabel ?? msg.inputClear
|
|
1470
1572
|
}
|
|
1471
1573
|
) : null,
|
|
1472
|
-
/* @__PURE__ */
|
|
1574
|
+
/* @__PURE__ */ jsx27(
|
|
1473
1575
|
AriaButton6,
|
|
1474
1576
|
{
|
|
1475
1577
|
className: "pire-iconbtn",
|
|
1476
1578
|
"data-size": "sm",
|
|
1477
1579
|
"aria-label": msg.comboBoxShowSuggestions,
|
|
1478
1580
|
style: { width: 20, height: 20 },
|
|
1479
|
-
children: /* @__PURE__ */
|
|
1581
|
+
children: /* @__PURE__ */ jsx27(Icon, { name: "chevron-down", size: 16 })
|
|
1480
1582
|
}
|
|
1481
1583
|
)
|
|
1482
1584
|
]
|
|
1483
1585
|
}
|
|
1484
1586
|
),
|
|
1485
|
-
|
|
1486
|
-
/* @__PURE__ */
|
|
1487
|
-
/* @__PURE__ */
|
|
1587
|
+
/* @__PURE__ */ jsx27(FieldDescription, { description, help }),
|
|
1588
|
+
/* @__PURE__ */ jsx27(FieldError6, { className: "pire-field-error", children: errorMessage }),
|
|
1589
|
+
/* @__PURE__ */ jsx27(Popover2, { className: "pire-popover", children: /* @__PURE__ */ jsx27(
|
|
1488
1590
|
ListBox2,
|
|
1489
1591
|
{
|
|
1490
1592
|
className: "pire-listbox",
|
|
@@ -1492,8 +1594,8 @@ function ComboBox({
|
|
|
1492
1594
|
const el = e.currentTarget;
|
|
1493
1595
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 48) onLoadMore();
|
|
1494
1596
|
} : void 0,
|
|
1495
|
-
renderEmptyState: showsStatus ? () => /* @__PURE__ */
|
|
1496
|
-
children: (item) => /* @__PURE__ */
|
|
1597
|
+
renderEmptyState: showsStatus ? () => /* @__PURE__ */ jsx27("div", { className: "pire-listbox-status", role: "status", "aria-live": "polite", children: isLoading ? loadingLabel ?? msg.comboBoxLoading : emptyLabel }) : void 0,
|
|
1598
|
+
children: (item) => /* @__PURE__ */ jsxs19(
|
|
1497
1599
|
ListBoxItem2,
|
|
1498
1600
|
{
|
|
1499
1601
|
className: "pire-option",
|
|
@@ -1501,8 +1603,8 @@ function ComboBox({
|
|
|
1501
1603
|
textValue: item.label,
|
|
1502
1604
|
isDisabled: item.isDisabled,
|
|
1503
1605
|
children: [
|
|
1504
|
-
/* @__PURE__ */
|
|
1505
|
-
item.secondary ? /* @__PURE__ */
|
|
1606
|
+
/* @__PURE__ */ jsx27("span", { className: "pire-option-label", children: item.label }),
|
|
1607
|
+
item.secondary ? /* @__PURE__ */ jsx27("span", { className: "pire-option-secondary", children: item.secondary }) : null
|
|
1506
1608
|
]
|
|
1507
1609
|
}
|
|
1508
1610
|
)
|
|
@@ -1514,22 +1616,20 @@ function ComboBox({
|
|
|
1514
1616
|
}
|
|
1515
1617
|
|
|
1516
1618
|
// src/components/forms/MultiComboBox.tsx
|
|
1517
|
-
import * as
|
|
1619
|
+
import * as React14 from "react";
|
|
1518
1620
|
import {
|
|
1519
1621
|
ComboBox as AriaComboBox2,
|
|
1520
|
-
Label as Label7,
|
|
1521
1622
|
Input as AriaInput3,
|
|
1522
1623
|
Button as AriaButton7,
|
|
1523
|
-
ButtonContext,
|
|
1624
|
+
ButtonContext as ButtonContext3,
|
|
1524
1625
|
Group as Group4,
|
|
1525
1626
|
Popover as Popover3,
|
|
1526
1627
|
ListBox as ListBox3,
|
|
1527
1628
|
ListBoxItem as ListBoxItem3,
|
|
1528
|
-
Text as Text9,
|
|
1529
1629
|
FieldError as FieldError7,
|
|
1530
1630
|
VisuallyHidden
|
|
1531
1631
|
} from "react-aria-components";
|
|
1532
|
-
import { jsx as
|
|
1632
|
+
import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1533
1633
|
var norm3 = (o) => typeof o === "string" ? { value: o, label: o } : o;
|
|
1534
1634
|
function MultiComboBox({
|
|
1535
1635
|
label,
|
|
@@ -1539,6 +1639,7 @@ function MultiComboBox({
|
|
|
1539
1639
|
onInputChange,
|
|
1540
1640
|
options = [],
|
|
1541
1641
|
description,
|
|
1642
|
+
help,
|
|
1542
1643
|
errorMessage,
|
|
1543
1644
|
allowsCustomValue,
|
|
1544
1645
|
size = "md",
|
|
@@ -1553,15 +1654,15 @@ function MultiComboBox({
|
|
|
1553
1654
|
...rest
|
|
1554
1655
|
}) {
|
|
1555
1656
|
const msg = usePireMessages();
|
|
1556
|
-
const items =
|
|
1657
|
+
const items = React14.useMemo(() => options.map(norm3), [options]);
|
|
1557
1658
|
const collection = isFilteredExternally ? { items } : { defaultItems: items };
|
|
1558
1659
|
const showsStatus = isLoading || isFilteredExternally && items.length === 0 && emptyLabel != null;
|
|
1559
|
-
const [uncontrolled, setUncontrolled] =
|
|
1560
|
-
const [announcement, setAnnouncement] =
|
|
1561
|
-
const inputRef =
|
|
1660
|
+
const [uncontrolled, setUncontrolled] = React14.useState(defaultValue ?? []);
|
|
1661
|
+
const [announcement, setAnnouncement] = React14.useState("");
|
|
1662
|
+
const inputRef = React14.useRef(null);
|
|
1562
1663
|
const raw = value ?? uncontrolled;
|
|
1563
1664
|
const contentKey = raw.join("\0");
|
|
1564
|
-
const values =
|
|
1665
|
+
const values = React14.useMemo(() => raw, [contentKey]);
|
|
1565
1666
|
const labelOf = (v) => items.find((o) => o.value === v)?.label ?? v;
|
|
1566
1667
|
const isEditable = !rest.isDisabled && !rest.isReadOnly;
|
|
1567
1668
|
const commit = (next) => {
|
|
@@ -1594,7 +1695,8 @@ function MultiComboBox({
|
|
|
1594
1695
|
e.stopPropagation();
|
|
1595
1696
|
if (!values.includes(next)) commit([...values, next]);
|
|
1596
1697
|
};
|
|
1597
|
-
|
|
1698
|
+
warnHelpWithoutLabel("MultiComboBox", label, help);
|
|
1699
|
+
return /* @__PURE__ */ jsxs20(
|
|
1598
1700
|
AriaComboBox2,
|
|
1599
1701
|
{
|
|
1600
1702
|
className: cx("pire-field", className),
|
|
@@ -1611,11 +1713,8 @@ function MultiComboBox({
|
|
|
1611
1713
|
validationBehavior: "aria",
|
|
1612
1714
|
...rest,
|
|
1613
1715
|
children: [
|
|
1614
|
-
label ? /* @__PURE__ */
|
|
1615
|
-
|
|
1616
|
-
rest.isRequired ? /* @__PURE__ */ jsx25("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1617
|
-
] }) : null,
|
|
1618
|
-
/* @__PURE__ */ jsxs18(
|
|
1716
|
+
label ? /* @__PURE__ */ jsx28(FieldLabel, { label, isRequired: rest.isRequired, help }) : null,
|
|
1717
|
+
/* @__PURE__ */ jsxs20(
|
|
1619
1718
|
Group4,
|
|
1620
1719
|
{
|
|
1621
1720
|
className: "pire-control",
|
|
@@ -1625,14 +1724,14 @@ function MultiComboBox({
|
|
|
1625
1724
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1626
1725
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1627
1726
|
children: [
|
|
1628
|
-
/* @__PURE__ */
|
|
1629
|
-
/* @__PURE__ */
|
|
1630
|
-
/* @__PURE__ */
|
|
1727
|
+
/* @__PURE__ */ jsx28(Icon, { name: "search", size: 16, className: "pire-leading-icon" }),
|
|
1728
|
+
/* @__PURE__ */ jsxs20("div", { className: "pire-chipfield", children: [
|
|
1729
|
+
/* @__PURE__ */ jsx28(ButtonContext3.Provider, { value: null, children: values.map((v) => (
|
|
1631
1730
|
/* Disabled follows the field, not `isEditable`: a read-only field's chips are
|
|
1632
1731
|
real, current values and should read as such — they simply lose the × . */
|
|
1633
|
-
/* @__PURE__ */
|
|
1732
|
+
/* @__PURE__ */ jsx28(Tag, { isDisabled: rest.isDisabled, onRemove: isEditable ? () => remove(v) : void 0, children: labelOf(v) }, v)
|
|
1634
1733
|
)) }),
|
|
1635
|
-
/* @__PURE__ */
|
|
1734
|
+
/* @__PURE__ */ jsx28(
|
|
1636
1735
|
AriaInput3,
|
|
1637
1736
|
{
|
|
1638
1737
|
ref: inputRef,
|
|
@@ -1642,23 +1741,23 @@ function MultiComboBox({
|
|
|
1642
1741
|
}
|
|
1643
1742
|
)
|
|
1644
1743
|
] }),
|
|
1645
|
-
/* @__PURE__ */
|
|
1744
|
+
/* @__PURE__ */ jsx28(
|
|
1646
1745
|
AriaButton7,
|
|
1647
1746
|
{
|
|
1648
1747
|
className: "pire-iconbtn",
|
|
1649
1748
|
"data-size": "sm",
|
|
1650
1749
|
"aria-label": msg.comboBoxShowSuggestions,
|
|
1651
1750
|
style: { width: 20, height: 20 },
|
|
1652
|
-
children: /* @__PURE__ */
|
|
1751
|
+
children: /* @__PURE__ */ jsx28(Icon, { name: "chevron-down", size: 16 })
|
|
1653
1752
|
}
|
|
1654
1753
|
)
|
|
1655
1754
|
]
|
|
1656
1755
|
}
|
|
1657
1756
|
),
|
|
1658
|
-
/* @__PURE__ */
|
|
1659
|
-
|
|
1660
|
-
/* @__PURE__ */
|
|
1661
|
-
/* @__PURE__ */
|
|
1757
|
+
/* @__PURE__ */ jsx28(VisuallyHidden, { children: /* @__PURE__ */ jsx28("span", { "aria-live": "polite", children: announcement }) }),
|
|
1758
|
+
/* @__PURE__ */ jsx28(FieldDescription, { description, help }),
|
|
1759
|
+
/* @__PURE__ */ jsx28(FieldError7, { className: "pire-field-error", children: errorMessage }),
|
|
1760
|
+
/* @__PURE__ */ jsx28(Popover3, { className: "pire-popover", children: /* @__PURE__ */ jsx28(
|
|
1662
1761
|
ListBox3,
|
|
1663
1762
|
{
|
|
1664
1763
|
className: "pire-listbox",
|
|
@@ -1666,8 +1765,8 @@ function MultiComboBox({
|
|
|
1666
1765
|
const el = e.currentTarget;
|
|
1667
1766
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 48) onLoadMore();
|
|
1668
1767
|
} : void 0,
|
|
1669
|
-
renderEmptyState: showsStatus ? () => /* @__PURE__ */
|
|
1670
|
-
children: (item) => /* @__PURE__ */
|
|
1768
|
+
renderEmptyState: showsStatus ? () => /* @__PURE__ */ jsx28("div", { className: "pire-listbox-status", role: "status", "aria-live": "polite", children: isLoading ? loadingLabel ?? msg.comboBoxLoading : emptyLabel }) : void 0,
|
|
1769
|
+
children: (item) => /* @__PURE__ */ jsxs20(
|
|
1671
1770
|
ListBoxItem3,
|
|
1672
1771
|
{
|
|
1673
1772
|
className: "pire-option",
|
|
@@ -1675,8 +1774,8 @@ function MultiComboBox({
|
|
|
1675
1774
|
textValue: item.label,
|
|
1676
1775
|
isDisabled: item.isDisabled,
|
|
1677
1776
|
children: [
|
|
1678
|
-
/* @__PURE__ */
|
|
1679
|
-
item.secondary ? /* @__PURE__ */
|
|
1777
|
+
/* @__PURE__ */ jsx28("span", { className: "pire-option-label", children: item.label }),
|
|
1778
|
+
item.secondary ? /* @__PURE__ */ jsx28("span", { className: "pire-option-secondary", children: item.secondary }) : null
|
|
1680
1779
|
]
|
|
1681
1780
|
}
|
|
1682
1781
|
)
|
|
@@ -1688,22 +1787,24 @@ function MultiComboBox({
|
|
|
1688
1787
|
}
|
|
1689
1788
|
|
|
1690
1789
|
// src/components/forms/NumberField.tsx
|
|
1691
|
-
import * as
|
|
1790
|
+
import * as React15 from "react";
|
|
1692
1791
|
import {
|
|
1693
1792
|
NumberField as AriaNumberField,
|
|
1694
|
-
Label as Label8,
|
|
1695
1793
|
Input as AriaInput4,
|
|
1696
1794
|
Group as Group5,
|
|
1697
1795
|
Button as AriaButton8,
|
|
1698
|
-
Text as Text10,
|
|
1699
1796
|
FieldError as FieldError8,
|
|
1700
1797
|
useLocale,
|
|
1701
1798
|
NumberFieldStateContext
|
|
1702
1799
|
} from "react-aria-components";
|
|
1703
|
-
|
|
1800
|
+
|
|
1801
|
+
// src/components/utils/decimalSeparator.ts
|
|
1704
1802
|
function decimalSeparatorFor(locale) {
|
|
1705
1803
|
return new Intl.NumberFormat(locale).formatToParts(1.1).find((part) => part.type === "decimal")?.value ?? ".";
|
|
1706
1804
|
}
|
|
1805
|
+
|
|
1806
|
+
// src/components/forms/NumberField.tsx
|
|
1807
|
+
import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1707
1808
|
function typeIntoInput(el, text) {
|
|
1708
1809
|
const start = el.selectionStart ?? el.value.length;
|
|
1709
1810
|
const end = el.selectionEnd ?? start;
|
|
@@ -1734,11 +1835,11 @@ function toAriaNumber(value) {
|
|
|
1734
1835
|
return typeof value === "number" ? value : Number(value);
|
|
1735
1836
|
}
|
|
1736
1837
|
function ClearButton({ label, onClear }) {
|
|
1737
|
-
const state =
|
|
1838
|
+
const state = React15.useContext(NumberFieldStateContext);
|
|
1738
1839
|
if (!state?.inputValue) {
|
|
1739
1840
|
return null;
|
|
1740
1841
|
}
|
|
1741
|
-
return /* @__PURE__ */
|
|
1842
|
+
return /* @__PURE__ */ jsx29(
|
|
1742
1843
|
AriaButton8,
|
|
1743
1844
|
{
|
|
1744
1845
|
className: "pire-input-clear",
|
|
@@ -1755,6 +1856,7 @@ function NumberField({
|
|
|
1755
1856
|
label,
|
|
1756
1857
|
suffix,
|
|
1757
1858
|
description,
|
|
1859
|
+
help,
|
|
1758
1860
|
errorMessage,
|
|
1759
1861
|
hideStepper,
|
|
1760
1862
|
stepperLayout = "stacked",
|
|
@@ -1776,7 +1878,7 @@ function NumberField({
|
|
|
1776
1878
|
const { locale } = useLocale();
|
|
1777
1879
|
const empty = emptyValue === void 0 ? NaN : emptyValue;
|
|
1778
1880
|
const isControlled = value !== void 0;
|
|
1779
|
-
const [ownValue, setOwnValue] =
|
|
1881
|
+
const [ownValue, setOwnValue] = React15.useState(() => toAriaNumber(defaultValue) ?? NaN);
|
|
1780
1882
|
const takesOverValue = Boolean(isClearable) && !isControlled;
|
|
1781
1883
|
const valueProps = takesOverValue ? { value: ownValue, defaultValue: void 0 } : { value: toAriaNumber(value), defaultValue: toAriaNumber(defaultValue) };
|
|
1782
1884
|
const handleChange = (next) => {
|
|
@@ -1825,7 +1927,8 @@ function NumberField({
|
|
|
1825
1927
|
event.stopPropagation();
|
|
1826
1928
|
typeIntoInput(event.currentTarget, localised);
|
|
1827
1929
|
};
|
|
1828
|
-
|
|
1930
|
+
warnHelpWithoutLabel("NumberField", label, help);
|
|
1931
|
+
return /* @__PURE__ */ jsxs21(
|
|
1829
1932
|
AriaNumberField,
|
|
1830
1933
|
{
|
|
1831
1934
|
className: cx("pire-field", className),
|
|
@@ -1835,11 +1938,8 @@ function NumberField({
|
|
|
1835
1938
|
...rest,
|
|
1836
1939
|
...valueProps,
|
|
1837
1940
|
children: [
|
|
1838
|
-
label ? /* @__PURE__ */
|
|
1839
|
-
|
|
1840
|
-
rest.isRequired ? /* @__PURE__ */ jsx26("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1841
|
-
] }) : null,
|
|
1842
|
-
/* @__PURE__ */ jsxs19(
|
|
1941
|
+
label ? /* @__PURE__ */ jsx29(FieldLabel, { label, isRequired: rest.isRequired, help }) : null,
|
|
1942
|
+
/* @__PURE__ */ jsxs21(
|
|
1843
1943
|
Group5,
|
|
1844
1944
|
{
|
|
1845
1945
|
className: "pire-control",
|
|
@@ -1849,16 +1949,16 @@ function NumberField({
|
|
|
1849
1949
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1850
1950
|
"data-stepper": stepperLayout,
|
|
1851
1951
|
children: [
|
|
1852
|
-
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */
|
|
1952
|
+
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */ jsx29(
|
|
1853
1953
|
AriaButton8,
|
|
1854
1954
|
{
|
|
1855
1955
|
slot: "decrement",
|
|
1856
1956
|
className: "pire-qty-btn",
|
|
1857
1957
|
"aria-label": decrementLabel ?? msg.numberFieldDecrease,
|
|
1858
|
-
children: /* @__PURE__ */
|
|
1958
|
+
children: /* @__PURE__ */ jsx29(Icon, { name: "minus", size: 16 })
|
|
1859
1959
|
}
|
|
1860
1960
|
) : null,
|
|
1861
|
-
/* @__PURE__ */
|
|
1961
|
+
/* @__PURE__ */ jsx29(
|
|
1862
1962
|
AriaInput4,
|
|
1863
1963
|
{
|
|
1864
1964
|
className: "pire-input",
|
|
@@ -1867,52 +1967,52 @@ function NumberField({
|
|
|
1867
1967
|
onPasteCapture: handlePaste
|
|
1868
1968
|
}
|
|
1869
1969
|
),
|
|
1870
|
-
suffix ? /* @__PURE__ */
|
|
1871
|
-
showsClear ? /* @__PURE__ */
|
|
1872
|
-
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */
|
|
1970
|
+
suffix ? /* @__PURE__ */ jsx29("span", { className: "pire-affix", children: suffix }) : null,
|
|
1971
|
+
showsClear ? /* @__PURE__ */ jsx29(ClearButton, { label: clearLabel ?? msg.inputClear, onClear: () => handleChange(NaN) }) : null,
|
|
1972
|
+
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */ jsx29(
|
|
1873
1973
|
AriaButton8,
|
|
1874
1974
|
{
|
|
1875
1975
|
slot: "increment",
|
|
1876
1976
|
className: "pire-qty-btn",
|
|
1877
1977
|
"aria-label": incrementLabel ?? msg.numberFieldIncrease,
|
|
1878
|
-
children: /* @__PURE__ */
|
|
1978
|
+
children: /* @__PURE__ */ jsx29(Icon, { name: "plus", size: 16 })
|
|
1879
1979
|
}
|
|
1880
1980
|
) : null,
|
|
1881
|
-
hideStepper ? null : stepperLayout === "inline" ? null : /* @__PURE__ */
|
|
1882
|
-
/* @__PURE__ */
|
|
1981
|
+
hideStepper ? null : stepperLayout === "inline" ? null : /* @__PURE__ */ jsxs21("span", { className: "pire-stepper", children: [
|
|
1982
|
+
/* @__PURE__ */ jsx29(
|
|
1883
1983
|
AriaButton8,
|
|
1884
1984
|
{
|
|
1885
1985
|
slot: "increment",
|
|
1886
1986
|
className: "pire-stepper-btn",
|
|
1887
1987
|
"aria-label": incrementLabel ?? msg.numberFieldIncrease,
|
|
1888
|
-
children: /* @__PURE__ */
|
|
1988
|
+
children: /* @__PURE__ */ jsx29(Icon, { name: "plus", size: 10 })
|
|
1889
1989
|
}
|
|
1890
1990
|
),
|
|
1891
|
-
/* @__PURE__ */
|
|
1991
|
+
/* @__PURE__ */ jsx29(
|
|
1892
1992
|
AriaButton8,
|
|
1893
1993
|
{
|
|
1894
1994
|
slot: "decrement",
|
|
1895
1995
|
className: "pire-stepper-btn",
|
|
1896
1996
|
"aria-label": decrementLabel ?? msg.numberFieldDecrease,
|
|
1897
|
-
children: /* @__PURE__ */
|
|
1997
|
+
children: /* @__PURE__ */ jsx29(Icon, { name: "minus", size: 10 })
|
|
1898
1998
|
}
|
|
1899
1999
|
)
|
|
1900
2000
|
] })
|
|
1901
2001
|
]
|
|
1902
2002
|
}
|
|
1903
2003
|
),
|
|
1904
|
-
|
|
1905
|
-
/* @__PURE__ */
|
|
2004
|
+
/* @__PURE__ */ jsx29(FieldDescription, { description, help }),
|
|
2005
|
+
/* @__PURE__ */ jsx29(FieldError8, { className: "pire-field-error", children: errorMessage })
|
|
1906
2006
|
]
|
|
1907
2007
|
}
|
|
1908
2008
|
);
|
|
1909
2009
|
}
|
|
1910
2010
|
|
|
1911
2011
|
// src/components/forms/QuantityStepper.tsx
|
|
1912
|
-
import { jsx as
|
|
2012
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1913
2013
|
function QuantityStepper({ size = "md", ...rest }) {
|
|
1914
2014
|
const msg = usePireMessages();
|
|
1915
|
-
return /* @__PURE__ */
|
|
2015
|
+
return /* @__PURE__ */ jsx30(
|
|
1916
2016
|
NumberField,
|
|
1917
2017
|
{
|
|
1918
2018
|
...rest,
|
|
@@ -1926,10 +2026,9 @@ function QuantityStepper({ size = "md", ...rest }) {
|
|
|
1926
2026
|
}
|
|
1927
2027
|
|
|
1928
2028
|
// src/components/forms/DatePicker.tsx
|
|
1929
|
-
import * as
|
|
2029
|
+
import * as React16 from "react";
|
|
1930
2030
|
import {
|
|
1931
2031
|
DatePicker as AriaDatePicker,
|
|
1932
|
-
Label as Label9,
|
|
1933
2032
|
Group as Group6,
|
|
1934
2033
|
DateInput,
|
|
1935
2034
|
DateSegment,
|
|
@@ -1943,7 +2042,6 @@ import {
|
|
|
1943
2042
|
CalendarGridBody,
|
|
1944
2043
|
CalendarCell,
|
|
1945
2044
|
Heading as Heading2,
|
|
1946
|
-
Text as Text11,
|
|
1947
2045
|
FieldError as FieldError9,
|
|
1948
2046
|
DatePickerStateContext
|
|
1949
2047
|
} from "react-aria-components";
|
|
@@ -1976,13 +2074,13 @@ function coerceBound(value) {
|
|
|
1976
2074
|
}
|
|
1977
2075
|
|
|
1978
2076
|
// src/components/forms/DatePicker.tsx
|
|
1979
|
-
import { jsx as
|
|
2077
|
+
import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1980
2078
|
function ClearButton2({ label }) {
|
|
1981
|
-
const state =
|
|
2079
|
+
const state = React16.useContext(DatePickerStateContext);
|
|
1982
2080
|
if (!state?.value) {
|
|
1983
2081
|
return null;
|
|
1984
2082
|
}
|
|
1985
|
-
return /* @__PURE__ */
|
|
2083
|
+
return /* @__PURE__ */ jsx31(
|
|
1986
2084
|
AriaButton9,
|
|
1987
2085
|
{
|
|
1988
2086
|
className: "pire-input-clear",
|
|
@@ -1998,6 +2096,7 @@ function ClearButton2({ label }) {
|
|
|
1998
2096
|
function DatePicker({
|
|
1999
2097
|
label,
|
|
2000
2098
|
description,
|
|
2099
|
+
help,
|
|
2001
2100
|
errorMessage,
|
|
2002
2101
|
size = "md",
|
|
2003
2102
|
fullWidth = true,
|
|
@@ -2018,7 +2117,8 @@ function DatePicker({
|
|
|
2018
2117
|
const handleChange = (next) => onChange?.(
|
|
2019
2118
|
valueFormat === "iso" && next ? next.toString() : next
|
|
2020
2119
|
);
|
|
2021
|
-
|
|
2120
|
+
warnHelpWithoutLabel("DatePicker", label, help);
|
|
2121
|
+
return /* @__PURE__ */ jsxs22(
|
|
2022
2122
|
AriaDatePicker,
|
|
2023
2123
|
{
|
|
2024
2124
|
className: cx("pire-field", className),
|
|
@@ -2031,11 +2131,8 @@ function DatePicker({
|
|
|
2031
2131
|
onChange: handleChange,
|
|
2032
2132
|
...rest,
|
|
2033
2133
|
children: [
|
|
2034
|
-
label ? /* @__PURE__ */
|
|
2035
|
-
|
|
2036
|
-
rest.isRequired ? /* @__PURE__ */ jsx28("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
2037
|
-
] }) : null,
|
|
2038
|
-
/* @__PURE__ */ jsxs20(
|
|
2134
|
+
label ? /* @__PURE__ */ jsx31(FieldLabel, { label, isRequired: rest.isRequired, help }) : null,
|
|
2135
|
+
/* @__PURE__ */ jsxs22(
|
|
2039
2136
|
Group6,
|
|
2040
2137
|
{
|
|
2041
2138
|
className: "pire-control",
|
|
@@ -2044,50 +2141,50 @@ function DatePicker({
|
|
|
2044
2141
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
2045
2142
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
2046
2143
|
children: [
|
|
2047
|
-
/* @__PURE__ */
|
|
2048
|
-
showsClear ? /* @__PURE__ */
|
|
2049
|
-
/* @__PURE__ */
|
|
2144
|
+
/* @__PURE__ */ jsx31(DateInput, { className: "pire-datefield", children: (segment) => /* @__PURE__ */ jsx31(DateSegment, { segment, className: "pire-datesegment" }) }),
|
|
2145
|
+
showsClear ? /* @__PURE__ */ jsx31(ClearButton2, { label: clearLabel ?? msg.inputClear }) : null,
|
|
2146
|
+
/* @__PURE__ */ jsx31(
|
|
2050
2147
|
AriaButton9,
|
|
2051
2148
|
{
|
|
2052
2149
|
className: "pire-iconbtn",
|
|
2053
2150
|
"data-size": "sm",
|
|
2054
2151
|
"aria-label": msg.datePickerOpenCalendar,
|
|
2055
2152
|
style: { width: 24, height: 24 },
|
|
2056
|
-
children: /* @__PURE__ */
|
|
2153
|
+
children: /* @__PURE__ */ jsx31(Icon, { name: "calendar", size: 16 })
|
|
2057
2154
|
}
|
|
2058
2155
|
)
|
|
2059
2156
|
]
|
|
2060
2157
|
}
|
|
2061
2158
|
),
|
|
2062
|
-
|
|
2063
|
-
/* @__PURE__ */
|
|
2064
|
-
/* @__PURE__ */
|
|
2065
|
-
/* @__PURE__ */
|
|
2066
|
-
/* @__PURE__ */
|
|
2159
|
+
/* @__PURE__ */ jsx31(FieldDescription, { description, help }),
|
|
2160
|
+
/* @__PURE__ */ jsx31(FieldError9, { className: "pire-field-error", children: errorMessage }),
|
|
2161
|
+
/* @__PURE__ */ jsx31(Popover4, { className: "pire-popover", children: /* @__PURE__ */ jsx31(AriaDialog, { children: /* @__PURE__ */ jsxs22(Calendar, { className: "pire-calendar", children: [
|
|
2162
|
+
/* @__PURE__ */ jsxs22("header", { className: "pire-calendar-head", children: [
|
|
2163
|
+
/* @__PURE__ */ jsx31(
|
|
2067
2164
|
AriaButton9,
|
|
2068
2165
|
{
|
|
2069
2166
|
slot: "previous",
|
|
2070
2167
|
className: "pire-iconbtn",
|
|
2071
2168
|
"data-size": "sm",
|
|
2072
2169
|
"aria-label": msg.datePickerPreviousMonth,
|
|
2073
|
-
children: /* @__PURE__ */
|
|
2170
|
+
children: /* @__PURE__ */ jsx31(Icon, { name: "chevron-left", size: 16 })
|
|
2074
2171
|
}
|
|
2075
2172
|
),
|
|
2076
|
-
/* @__PURE__ */
|
|
2077
|
-
/* @__PURE__ */
|
|
2173
|
+
/* @__PURE__ */ jsx31(Heading2, { className: "pire-calendar-title" }),
|
|
2174
|
+
/* @__PURE__ */ jsx31(
|
|
2078
2175
|
AriaButton9,
|
|
2079
2176
|
{
|
|
2080
2177
|
slot: "next",
|
|
2081
2178
|
className: "pire-iconbtn",
|
|
2082
2179
|
"data-size": "sm",
|
|
2083
2180
|
"aria-label": msg.datePickerNextMonth,
|
|
2084
|
-
children: /* @__PURE__ */
|
|
2181
|
+
children: /* @__PURE__ */ jsx31(Icon, { name: "chevron-right", size: 16 })
|
|
2085
2182
|
}
|
|
2086
2183
|
)
|
|
2087
2184
|
] }),
|
|
2088
|
-
/* @__PURE__ */
|
|
2089
|
-
/* @__PURE__ */
|
|
2090
|
-
/* @__PURE__ */
|
|
2185
|
+
/* @__PURE__ */ jsxs22(CalendarGrid, { className: "pire-calendar-grid", children: [
|
|
2186
|
+
/* @__PURE__ */ jsx31(CalendarGridHeader, { children: (day) => /* @__PURE__ */ jsx31(CalendarHeaderCell, { children: day }) }),
|
|
2187
|
+
/* @__PURE__ */ jsx31(CalendarGridBody, { children: (date) => /* @__PURE__ */ jsx31(CalendarCell, { date, className: "pire-calendar-cell" }) })
|
|
2091
2188
|
] })
|
|
2092
2189
|
] }) }) })
|
|
2093
2190
|
]
|
|
@@ -2096,10 +2193,9 @@ function DatePicker({
|
|
|
2096
2193
|
}
|
|
2097
2194
|
|
|
2098
2195
|
// src/components/forms/DateRangePicker.tsx
|
|
2099
|
-
import * as
|
|
2196
|
+
import * as React17 from "react";
|
|
2100
2197
|
import {
|
|
2101
2198
|
DateRangePicker as AriaDateRangePicker,
|
|
2102
|
-
Label as Label10,
|
|
2103
2199
|
Group as Group7,
|
|
2104
2200
|
DateInput as DateInput2,
|
|
2105
2201
|
DateSegment as DateSegment2,
|
|
@@ -2113,11 +2209,10 @@ import {
|
|
|
2113
2209
|
CalendarGridBody as CalendarGridBody2,
|
|
2114
2210
|
CalendarCell as CalendarCell2,
|
|
2115
2211
|
Heading as Heading3,
|
|
2116
|
-
Text as Text12,
|
|
2117
2212
|
FieldError as FieldError10,
|
|
2118
2213
|
DateRangePickerStateContext
|
|
2119
2214
|
} from "react-aria-components";
|
|
2120
|
-
import { jsx as
|
|
2215
|
+
import { jsx as jsx32, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2121
2216
|
function coerceRange(range) {
|
|
2122
2217
|
if (range === void 0) {
|
|
2123
2218
|
return void 0;
|
|
@@ -2138,11 +2233,11 @@ function rangeLengthInDays(range) {
|
|
|
2138
2233
|
return end.toDate("UTC").getTime() / 864e5 - start.toDate("UTC").getTime() / 864e5 + 1;
|
|
2139
2234
|
}
|
|
2140
2235
|
function ClearButton3({ label }) {
|
|
2141
|
-
const state =
|
|
2236
|
+
const state = React17.useContext(DateRangePickerStateContext);
|
|
2142
2237
|
if (!state?.value?.start && !state?.value?.end) {
|
|
2143
2238
|
return null;
|
|
2144
2239
|
}
|
|
2145
|
-
return /* @__PURE__ */
|
|
2240
|
+
return /* @__PURE__ */ jsx32(
|
|
2146
2241
|
AriaButton10,
|
|
2147
2242
|
{
|
|
2148
2243
|
className: "pire-input-clear",
|
|
@@ -2158,6 +2253,7 @@ function ClearButton3({ label }) {
|
|
|
2158
2253
|
function DateRangePicker({
|
|
2159
2254
|
label,
|
|
2160
2255
|
description,
|
|
2256
|
+
help,
|
|
2161
2257
|
errorMessage,
|
|
2162
2258
|
maxRangeDays,
|
|
2163
2259
|
presets,
|
|
@@ -2193,7 +2289,8 @@ function DateRangePicker({
|
|
|
2193
2289
|
valueFormat === "iso" ? { start: next.start.toString(), end: next.end.toString() } : { start: next.start, end: next.end }
|
|
2194
2290
|
);
|
|
2195
2291
|
};
|
|
2196
|
-
|
|
2292
|
+
warnHelpWithoutLabel("DateRangePicker", label, help);
|
|
2293
|
+
return /* @__PURE__ */ jsxs23(
|
|
2197
2294
|
AriaDateRangePicker,
|
|
2198
2295
|
{
|
|
2199
2296
|
className: cx("pire-field", className),
|
|
@@ -2209,11 +2306,8 @@ function DateRangePicker({
|
|
|
2209
2306
|
...rest,
|
|
2210
2307
|
isInvalid: rest.isInvalid || tooLong || void 0,
|
|
2211
2308
|
children: [
|
|
2212
|
-
label ? /* @__PURE__ */
|
|
2213
|
-
|
|
2214
|
-
rest.isRequired ? /* @__PURE__ */ jsx29("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
2215
|
-
] }) : null,
|
|
2216
|
-
/* @__PURE__ */ jsxs21(
|
|
2309
|
+
label ? /* @__PURE__ */ jsx32(FieldLabel, { label, isRequired: rest.isRequired, help }) : null,
|
|
2310
|
+
/* @__PURE__ */ jsxs23(
|
|
2217
2311
|
Group7,
|
|
2218
2312
|
{
|
|
2219
2313
|
className: "pire-control pire-daterange-control",
|
|
@@ -2222,30 +2316,30 @@ function DateRangePicker({
|
|
|
2222
2316
|
"data-invalid": rest.isInvalid || tooLong ? "true" : void 0,
|
|
2223
2317
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
2224
2318
|
children: [
|
|
2225
|
-
/* @__PURE__ */
|
|
2226
|
-
/* @__PURE__ */
|
|
2227
|
-
/* @__PURE__ */
|
|
2228
|
-
isClearable && !rest.isDisabled && !rest.isReadOnly ? /* @__PURE__ */
|
|
2229
|
-
/* @__PURE__ */
|
|
2319
|
+
/* @__PURE__ */ jsx32(DateInput2, { slot: "start", className: "pire-datefield", children: (segment) => /* @__PURE__ */ jsx32(DateSegment2, { segment, className: "pire-datesegment" }) }),
|
|
2320
|
+
/* @__PURE__ */ jsx32("span", { "aria-hidden": "true", className: "pire-daterange-dash", children: "\u2013" }),
|
|
2321
|
+
/* @__PURE__ */ jsx32(DateInput2, { slot: "end", className: "pire-datefield", children: (segment) => /* @__PURE__ */ jsx32(DateSegment2, { segment, className: "pire-datesegment" }) }),
|
|
2322
|
+
isClearable && !rest.isDisabled && !rest.isReadOnly ? /* @__PURE__ */ jsx32(ClearButton3, { label: clearLabel ?? msg.inputClear }) : null,
|
|
2323
|
+
/* @__PURE__ */ jsx32(
|
|
2230
2324
|
AriaButton10,
|
|
2231
2325
|
{
|
|
2232
2326
|
className: "pire-iconbtn",
|
|
2233
2327
|
"data-size": "sm",
|
|
2234
2328
|
"aria-label": msg.datePickerOpenCalendar,
|
|
2235
2329
|
style: { width: 24, height: 24 },
|
|
2236
|
-
children: /* @__PURE__ */
|
|
2330
|
+
children: /* @__PURE__ */ jsx32(Icon, { name: "calendar", size: 16 })
|
|
2237
2331
|
}
|
|
2238
2332
|
)
|
|
2239
2333
|
]
|
|
2240
2334
|
}
|
|
2241
2335
|
),
|
|
2242
|
-
|
|
2243
|
-
/* @__PURE__ */
|
|
2244
|
-
/* @__PURE__ */
|
|
2336
|
+
/* @__PURE__ */ jsx32(FieldDescription, { description, help }),
|
|
2337
|
+
/* @__PURE__ */ jsx32(FieldError10, { className: "pire-field-error", children: errorMessage }),
|
|
2338
|
+
/* @__PURE__ */ jsx32(Popover5, { className: "pire-popover", children: /* @__PURE__ */ jsxs23(AriaDialog2, { className: "pire-daterange-dialog", children: [
|
|
2245
2339
|
presets?.length ? (
|
|
2246
2340
|
// Before the calendar in the DOM, so keyboard users reach the shortcut without
|
|
2247
2341
|
// arrowing through a month first.
|
|
2248
|
-
/* @__PURE__ */
|
|
2342
|
+
/* @__PURE__ */ jsx32("div", { className: "pire-daterange-presets", role: "group", "aria-label": msg.dateRangePresetsLabel, children: presets.map((preset) => /* @__PURE__ */ jsx32(
|
|
2249
2343
|
AriaButton10,
|
|
2250
2344
|
{
|
|
2251
2345
|
className: "pire-daterange-preset",
|
|
@@ -2255,33 +2349,33 @@ function DateRangePicker({
|
|
|
2255
2349
|
preset.id
|
|
2256
2350
|
)) })
|
|
2257
2351
|
) : null,
|
|
2258
|
-
/* @__PURE__ */
|
|
2259
|
-
/* @__PURE__ */
|
|
2260
|
-
/* @__PURE__ */
|
|
2352
|
+
/* @__PURE__ */ jsxs23(RangeCalendar, { className: "pire-calendar", children: [
|
|
2353
|
+
/* @__PURE__ */ jsxs23("header", { className: "pire-calendar-head", children: [
|
|
2354
|
+
/* @__PURE__ */ jsx32(
|
|
2261
2355
|
AriaButton10,
|
|
2262
2356
|
{
|
|
2263
2357
|
slot: "previous",
|
|
2264
2358
|
className: "pire-iconbtn",
|
|
2265
2359
|
"data-size": "sm",
|
|
2266
2360
|
"aria-label": msg.datePickerPreviousMonth,
|
|
2267
|
-
children: /* @__PURE__ */
|
|
2361
|
+
children: /* @__PURE__ */ jsx32(Icon, { name: "chevron-left", size: 16 })
|
|
2268
2362
|
}
|
|
2269
2363
|
),
|
|
2270
|
-
/* @__PURE__ */
|
|
2271
|
-
/* @__PURE__ */
|
|
2364
|
+
/* @__PURE__ */ jsx32(Heading3, { className: "pire-calendar-title" }),
|
|
2365
|
+
/* @__PURE__ */ jsx32(
|
|
2272
2366
|
AriaButton10,
|
|
2273
2367
|
{
|
|
2274
2368
|
slot: "next",
|
|
2275
2369
|
className: "pire-iconbtn",
|
|
2276
2370
|
"data-size": "sm",
|
|
2277
2371
|
"aria-label": msg.datePickerNextMonth,
|
|
2278
|
-
children: /* @__PURE__ */
|
|
2372
|
+
children: /* @__PURE__ */ jsx32(Icon, { name: "chevron-right", size: 16 })
|
|
2279
2373
|
}
|
|
2280
2374
|
)
|
|
2281
2375
|
] }),
|
|
2282
|
-
/* @__PURE__ */
|
|
2283
|
-
/* @__PURE__ */
|
|
2284
|
-
/* @__PURE__ */
|
|
2376
|
+
/* @__PURE__ */ jsxs23(CalendarGrid2, { className: "pire-calendar-grid", children: [
|
|
2377
|
+
/* @__PURE__ */ jsx32(CalendarGridHeader2, { children: (day) => /* @__PURE__ */ jsx32(CalendarHeaderCell2, { children: day }) }),
|
|
2378
|
+
/* @__PURE__ */ jsx32(CalendarGridBody2, { children: (date) => /* @__PURE__ */ jsx32(CalendarCell2, { date, className: "pire-calendar-cell" }) })
|
|
2285
2379
|
] })
|
|
2286
2380
|
] })
|
|
2287
2381
|
] }) })
|
|
@@ -2291,26 +2385,26 @@ function DateRangePicker({
|
|
|
2291
2385
|
}
|
|
2292
2386
|
|
|
2293
2387
|
// src/components/forms/ValueHelpField.tsx
|
|
2294
|
-
import * as
|
|
2388
|
+
import * as React21 from "react";
|
|
2295
2389
|
|
|
2296
2390
|
// src/components/patterns/ValueHelpDialog.tsx
|
|
2297
|
-
import * as
|
|
2391
|
+
import * as React20 from "react";
|
|
2298
2392
|
|
|
2299
2393
|
// src/components/feedback/Dialog.tsx
|
|
2300
|
-
import * as
|
|
2394
|
+
import * as React18 from "react";
|
|
2301
2395
|
import { ModalOverlay, Modal, Dialog as AriaDialog3, Heading as Heading4 } from "react-aria-components";
|
|
2302
|
-
import { jsx as
|
|
2396
|
+
import { jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2303
2397
|
function DialogTitle({ children, className }) {
|
|
2304
|
-
return /* @__PURE__ */
|
|
2398
|
+
return /* @__PURE__ */ jsx33(Heading4, { slot: "title", className: cx("pire-dialog-title", className), children });
|
|
2305
2399
|
}
|
|
2306
2400
|
function DialogDescription({ children, className }) {
|
|
2307
|
-
return /* @__PURE__ */
|
|
2401
|
+
return /* @__PURE__ */ jsx33("p", { className: cx("pire-dialog-sub", className), style: { margin: 0 }, children });
|
|
2308
2402
|
}
|
|
2309
2403
|
function DialogBody({ children, className }) {
|
|
2310
|
-
return /* @__PURE__ */
|
|
2404
|
+
return /* @__PURE__ */ jsx33("div", { className: cx("pire-dialog-body", className), children });
|
|
2311
2405
|
}
|
|
2312
2406
|
function DialogActions({ children, className }) {
|
|
2313
|
-
return /* @__PURE__ */
|
|
2407
|
+
return /* @__PURE__ */ jsx33("footer", { className: cx("pire-dialog-foot", className), children });
|
|
2314
2408
|
}
|
|
2315
2409
|
function Dialog({
|
|
2316
2410
|
isOpen,
|
|
@@ -2331,19 +2425,19 @@ function Dialog({
|
|
|
2331
2425
|
onClose?.();
|
|
2332
2426
|
onOpenChange?.(false);
|
|
2333
2427
|
};
|
|
2334
|
-
const parts =
|
|
2335
|
-
const slotOf = (type) => parts.find((node) =>
|
|
2428
|
+
const parts = React18.Children.toArray(children);
|
|
2429
|
+
const slotOf = (type) => parts.find((node) => React18.isValidElement(node) && node.type === type);
|
|
2336
2430
|
const titleSlot = slotOf(DialogTitle);
|
|
2337
2431
|
const descriptionSlot = slotOf(DialogDescription);
|
|
2338
2432
|
const bodySlot = slotOf(DialogBody);
|
|
2339
2433
|
const actionsSlot = slotOf(DialogActions);
|
|
2340
2434
|
const slots = [titleSlot, descriptionSlot, bodySlot, actionsSlot];
|
|
2341
2435
|
const loose = parts.filter((node) => !slots.includes(node));
|
|
2342
|
-
const heading = titleSlot ?? (title ? /* @__PURE__ */
|
|
2343
|
-
const description = descriptionSlot ?? (subtitle ? /* @__PURE__ */
|
|
2344
|
-
const actions = actionsSlot ?? (footer ? /* @__PURE__ */
|
|
2345
|
-
const body = bodySlot ?? (loose.length ? /* @__PURE__ */
|
|
2346
|
-
return /* @__PURE__ */
|
|
2436
|
+
const heading = titleSlot ?? (title ? /* @__PURE__ */ jsx33(Heading4, { slot: "title", className: "pire-dialog-title", children: title }) : null);
|
|
2437
|
+
const description = descriptionSlot ?? (subtitle ? /* @__PURE__ */ jsx33("p", { className: "pire-dialog-sub", style: { margin: 0 }, children: subtitle }) : null);
|
|
2438
|
+
const actions = actionsSlot ?? (footer ? /* @__PURE__ */ jsx33("footer", { className: "pire-dialog-foot", children: footer }) : null);
|
|
2439
|
+
const body = bodySlot ?? (loose.length ? /* @__PURE__ */ jsx33("div", { className: "pire-dialog-body", children: loose }) : null);
|
|
2440
|
+
return /* @__PURE__ */ jsx33(
|
|
2347
2441
|
ModalOverlay,
|
|
2348
2442
|
{
|
|
2349
2443
|
className: "pire-modal-overlay",
|
|
@@ -2352,13 +2446,13 @@ function Dialog({
|
|
|
2352
2446
|
onOpenChange: (o) => {
|
|
2353
2447
|
if (!o) close();
|
|
2354
2448
|
},
|
|
2355
|
-
children: /* @__PURE__ */
|
|
2356
|
-
heading || description ? /* @__PURE__ */
|
|
2357
|
-
/* @__PURE__ */
|
|
2449
|
+
children: /* @__PURE__ */ jsx33(Modal, { className: cx("pire-modal", className), "data-size": size, style, children: /* @__PURE__ */ jsxs24(AriaDialog3, { className: "pire-dialog", children: [
|
|
2450
|
+
heading || description ? /* @__PURE__ */ jsxs24("header", { className: "pire-dialog-head", children: [
|
|
2451
|
+
/* @__PURE__ */ jsxs24("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
2358
2452
|
heading,
|
|
2359
2453
|
description
|
|
2360
2454
|
] }),
|
|
2361
|
-
showClose ? /* @__PURE__ */
|
|
2455
|
+
showClose ? /* @__PURE__ */ jsx33(IconButton, { icon: "x", label: msg.dialogClose, size: "sm", onPress: close }) : null
|
|
2362
2456
|
] }) : null,
|
|
2363
2457
|
body,
|
|
2364
2458
|
actions
|
|
@@ -2368,7 +2462,7 @@ function Dialog({
|
|
|
2368
2462
|
}
|
|
2369
2463
|
|
|
2370
2464
|
// src/components/data/DataTable.tsx
|
|
2371
|
-
import * as
|
|
2465
|
+
import * as React19 from "react";
|
|
2372
2466
|
import {
|
|
2373
2467
|
Table,
|
|
2374
2468
|
TableHeader,
|
|
@@ -2380,9 +2474,9 @@ import {
|
|
|
2380
2474
|
} from "react-aria-components";
|
|
2381
2475
|
|
|
2382
2476
|
// src/components/feedback/Skeleton.tsx
|
|
2383
|
-
import { jsx as
|
|
2477
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
2384
2478
|
function Skeleton({ shape = "text", width, height, className, style, ...rest }) {
|
|
2385
|
-
return /* @__PURE__ */
|
|
2479
|
+
return /* @__PURE__ */ jsx34(
|
|
2386
2480
|
"div",
|
|
2387
2481
|
{
|
|
2388
2482
|
className: cx("pire-skeleton", className),
|
|
@@ -2402,7 +2496,7 @@ function SkeletonTableRow({
|
|
|
2402
2496
|
...rest
|
|
2403
2497
|
}) {
|
|
2404
2498
|
const cells = typeof columns === "number" ? Array.from({ length: columns }, () => ({})) : columns;
|
|
2405
|
-
return /* @__PURE__ */
|
|
2499
|
+
return /* @__PURE__ */ jsx34(
|
|
2406
2500
|
"div",
|
|
2407
2501
|
{
|
|
2408
2502
|
className: cx("pire-skeleton-row", className),
|
|
@@ -2412,13 +2506,13 @@ function SkeletonTableRow({
|
|
|
2412
2506
|
...rest,
|
|
2413
2507
|
children: cells.map((c, i) => {
|
|
2414
2508
|
const align = c.numeric ? "right" : c.align ?? "left";
|
|
2415
|
-
return /* @__PURE__ */
|
|
2509
|
+
return /* @__PURE__ */ jsx34(
|
|
2416
2510
|
"div",
|
|
2417
2511
|
{
|
|
2418
2512
|
className: "pire-skeleton-cell",
|
|
2419
2513
|
"data-align": align,
|
|
2420
2514
|
style: { width: c.width, flex: c.width ? "0 0 auto" : void 0 },
|
|
2421
|
-
children: /* @__PURE__ */
|
|
2515
|
+
children: /* @__PURE__ */ jsx34(Skeleton, { width: BAR_WIDTHS[i % BAR_WIDTHS.length] })
|
|
2422
2516
|
},
|
|
2423
2517
|
i
|
|
2424
2518
|
);
|
|
@@ -2428,12 +2522,12 @@ function SkeletonTableRow({
|
|
|
2428
2522
|
}
|
|
2429
2523
|
|
|
2430
2524
|
// src/components/data/DataTable.tsx
|
|
2431
|
-
import { jsx as
|
|
2432
|
-
var
|
|
2433
|
-
var
|
|
2434
|
-
function
|
|
2435
|
-
if (
|
|
2436
|
-
|
|
2525
|
+
import { jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2526
|
+
var IS_DEV3 = process.env.NODE_ENV !== "production";
|
|
2527
|
+
var warned3 = /* @__PURE__ */ new Set();
|
|
2528
|
+
function warnOnce3(key, message) {
|
|
2529
|
+
if (warned3.has(key)) return;
|
|
2530
|
+
warned3.add(key);
|
|
2437
2531
|
console.warn(`[pire] ${message}`);
|
|
2438
2532
|
}
|
|
2439
2533
|
var CHECKBOX_W = 44;
|
|
@@ -2464,7 +2558,7 @@ function DataTable({
|
|
|
2464
2558
|
const msg = usePireMessages();
|
|
2465
2559
|
const selectionMode = selectable === true || selectable === "multiple" ? "multiple" : selectable === "single" ? "single" : "none";
|
|
2466
2560
|
const hasCheckboxColumn = selectionMode === "multiple";
|
|
2467
|
-
const pinnedGeometry =
|
|
2561
|
+
const pinnedGeometry = React19.useMemo(() => {
|
|
2468
2562
|
const geometry = /* @__PURE__ */ new Map();
|
|
2469
2563
|
let x = hasCheckboxColumn ? CHECKBOX_W : 0;
|
|
2470
2564
|
let broke = null;
|
|
@@ -2474,8 +2568,8 @@ function DataTable({
|
|
|
2474
2568
|
break;
|
|
2475
2569
|
}
|
|
2476
2570
|
if (typeof column.width !== "number") {
|
|
2477
|
-
if (
|
|
2478
|
-
|
|
2571
|
+
if (IS_DEV3)
|
|
2572
|
+
warnOnce3(
|
|
2479
2573
|
`pin-width:${column.key}`,
|
|
2480
2574
|
`DataTable column "${column.key}" is pinned but has no numeric width, so its offset cannot be computed. It will scroll.`
|
|
2481
2575
|
);
|
|
@@ -2485,10 +2579,10 @@ function DataTable({
|
|
|
2485
2579
|
geometry.set(column.key, { left: x, width: column.width });
|
|
2486
2580
|
x += column.width;
|
|
2487
2581
|
}
|
|
2488
|
-
if (
|
|
2582
|
+
if (IS_DEV3 && broke === "unpinned") {
|
|
2489
2583
|
const stranded = columns.slice(geometry.size).find((c) => c.pinned);
|
|
2490
2584
|
if (stranded) {
|
|
2491
|
-
|
|
2585
|
+
warnOnce3(
|
|
2492
2586
|
`pin-gap:${stranded.key}`,
|
|
2493
2587
|
`DataTable column "${stranded.key}" is pinned but does not sit in the leading run, so it will scroll. Move it before the first unpinned column.`
|
|
2494
2588
|
);
|
|
@@ -2530,14 +2624,14 @@ function DataTable({
|
|
|
2530
2624
|
style: { left: box.left, width: box.width, minWidth: box.width, maxWidth: box.width }
|
|
2531
2625
|
};
|
|
2532
2626
|
};
|
|
2533
|
-
return /* @__PURE__ */
|
|
2627
|
+
return /* @__PURE__ */ jsx35(
|
|
2534
2628
|
"div",
|
|
2535
2629
|
{
|
|
2536
2630
|
className: cx("pire-table-wrap", className),
|
|
2537
2631
|
style,
|
|
2538
2632
|
"data-loading": isLoading ? "true" : void 0,
|
|
2539
2633
|
"aria-busy": isLoading ? "true" : void 0,
|
|
2540
|
-
children: /* @__PURE__ */
|
|
2634
|
+
children: /* @__PURE__ */ jsxs25(
|
|
2541
2635
|
Table,
|
|
2542
2636
|
{
|
|
2543
2637
|
className: "pire-table",
|
|
@@ -2556,8 +2650,8 @@ function DataTable({
|
|
|
2556
2650
|
if (row) onRowAction(row);
|
|
2557
2651
|
} : void 0,
|
|
2558
2652
|
children: [
|
|
2559
|
-
/* @__PURE__ */
|
|
2560
|
-
hasCheckboxColumn ? /* @__PURE__ */
|
|
2653
|
+
/* @__PURE__ */ jsxs25(TableHeader, { className: "pire-thead-row", children: [
|
|
2654
|
+
hasCheckboxColumn ? /* @__PURE__ */ jsx35(Column, { className: "pire-th", ...pinProps(null), children: hideSelectAll ? /* @__PURE__ */ jsx35("span", { className: "pire-sr-only", children: msg.dataTableSelectionColumn }) : /* @__PURE__ */ jsx35(Checkbox, { slot: "selection", "aria-label": msg.dataTableSelectAll }) }) : null,
|
|
2561
2655
|
columns.map((c, i) => (
|
|
2562
2656
|
// The checkbox column is never the row header — a selection control does not identify
|
|
2563
2657
|
// the record — so the first *data* column carries it regardless of whether a checkbox
|
|
@@ -2565,7 +2659,7 @@ function DataTable({
|
|
|
2565
2659
|
// table with no row header at all: invisible on first paint, and a hard crash from
|
|
2566
2660
|
// React Aria's own "table must have a row header" invariant the moment `rows` changes
|
|
2567
2661
|
// under it (search, sort, a paginated load).
|
|
2568
|
-
/* @__PURE__ */
|
|
2662
|
+
/* @__PURE__ */ jsx35(
|
|
2569
2663
|
Column,
|
|
2570
2664
|
{
|
|
2571
2665
|
id: c.key,
|
|
@@ -2575,9 +2669,9 @@ function DataTable({
|
|
|
2575
2669
|
"data-align": c.numeric || c.align === "right" ? "right" : c.align,
|
|
2576
2670
|
"data-allows-sorting": c.sortable ? "true" : void 0,
|
|
2577
2671
|
...pinProps(c.key),
|
|
2578
|
-
children: /* @__PURE__ */
|
|
2672
|
+
children: /* @__PURE__ */ jsxs25("span", { className: c.hideLabel ? "pire-sr-only" : "pire-th-inner", children: [
|
|
2579
2673
|
c.label,
|
|
2580
|
-
c.sortable ? /* @__PURE__ */
|
|
2674
|
+
c.sortable ? /* @__PURE__ */ jsx35(
|
|
2581
2675
|
Icon,
|
|
2582
2676
|
{
|
|
2583
2677
|
size: 12,
|
|
@@ -2593,29 +2687,29 @@ function DataTable({
|
|
|
2593
2687
|
)
|
|
2594
2688
|
))
|
|
2595
2689
|
] }),
|
|
2596
|
-
/* @__PURE__ */
|
|
2690
|
+
/* @__PURE__ */ jsx35(
|
|
2597
2691
|
TableBody,
|
|
2598
2692
|
{
|
|
2599
|
-
renderEmptyState: () => isLoading ? /* @__PURE__ */
|
|
2600
|
-
/* @__PURE__ */
|
|
2693
|
+
renderEmptyState: () => isLoading ? /* @__PURE__ */ jsxs25("div", { className: "pire-table-loading", role: "status", "aria-live": "polite", children: [
|
|
2694
|
+
/* @__PURE__ */ jsx35("span", { className: "pire-sr-only", children: loadingLabel ?? msg.dataTableLoading }),
|
|
2601
2695
|
Array.from({ length: skeletonRows }, (_, i) => (
|
|
2602
2696
|
// biome-ignore lint/suspicious/noArrayIndexKey: placeholder rows are positional.
|
|
2603
|
-
/* @__PURE__ */
|
|
2697
|
+
/* @__PURE__ */ jsx35(SkeletonTableRow, { columns: skeletonColumns, density }, i)
|
|
2604
2698
|
))
|
|
2605
|
-
] }) : /* @__PURE__ */
|
|
2699
|
+
] }) : /* @__PURE__ */ jsx35("div", { className: "pire-table-empty", children: emptyLabel ?? msg.dataTableEmpty }),
|
|
2606
2700
|
children: body.flatMap((row) => {
|
|
2607
2701
|
const rowIsDisabled = presentation.get(row.id)?.isDisabled;
|
|
2608
|
-
const record = /* @__PURE__ */
|
|
2702
|
+
const record = /* @__PURE__ */ jsxs25(
|
|
2609
2703
|
Row,
|
|
2610
2704
|
{
|
|
2611
2705
|
id: row.id,
|
|
2612
2706
|
className: cx("pire-tr", presentation.get(row.id)?.className),
|
|
2613
2707
|
"data-pressable": onRowAction && !rowIsDisabled ? "true" : void 0,
|
|
2614
2708
|
children: [
|
|
2615
|
-
hasCheckboxColumn ? /* @__PURE__ */
|
|
2709
|
+
hasCheckboxColumn ? /* @__PURE__ */ jsx35(Cell, { className: "pire-td", ...pinProps(null), children: /* @__PURE__ */ jsx35(Checkbox, { slot: "selection", "aria-label": msg.dataTableSelectRow }) }) : null,
|
|
2616
2710
|
columns.map((c) => {
|
|
2617
2711
|
const pin = pinProps(c.key);
|
|
2618
|
-
return /* @__PURE__ */
|
|
2712
|
+
return /* @__PURE__ */ jsx35(
|
|
2619
2713
|
Cell,
|
|
2620
2714
|
{
|
|
2621
2715
|
className: "pire-td",
|
|
@@ -2635,23 +2729,23 @@ function DataTable({
|
|
|
2635
2729
|
if (!renderExpanded || !expanded.has(String(row.id))) return [record];
|
|
2636
2730
|
return [
|
|
2637
2731
|
record,
|
|
2638
|
-
/* @__PURE__ */
|
|
2732
|
+
/* @__PURE__ */ jsx35(Row, { id: expandedKey(row.id), className: "pire-tr-expanded", children: /* @__PURE__ */ jsx35(Cell, { className: "pire-td-expanded", colSpan: spanAll, children: renderExpanded(row) }) }, expandedKey(row.id))
|
|
2639
2733
|
];
|
|
2640
2734
|
})
|
|
2641
2735
|
}
|
|
2642
2736
|
),
|
|
2643
|
-
footer && !isLoading ? /* @__PURE__ */
|
|
2644
|
-
hasCheckboxColumn ? /* @__PURE__ */
|
|
2737
|
+
footer && !isLoading ? /* @__PURE__ */ jsx35(TableFooter, { className: "pire-tfoot", children: /* @__PURE__ */ jsxs25(Row, { id: "__pire_footer__", className: "pire-tr-footer", children: [
|
|
2738
|
+
hasCheckboxColumn ? /* @__PURE__ */ jsx35(Cell, { className: "pire-tf", ...pinProps(null) }) : null,
|
|
2645
2739
|
columns.map((c, i) => {
|
|
2646
2740
|
const pin = pinProps(c.key);
|
|
2647
|
-
return /* @__PURE__ */
|
|
2741
|
+
return /* @__PURE__ */ jsx35(
|
|
2648
2742
|
Cell,
|
|
2649
2743
|
{
|
|
2650
2744
|
className: "pire-tf",
|
|
2651
2745
|
"data-numeric": c.numeric ? "true" : void 0,
|
|
2652
2746
|
...pin,
|
|
2653
2747
|
style: { ...pin.style, textAlign: c.align && !c.numeric ? c.align : void 0 },
|
|
2654
|
-
children: footer[c.key] ?? (i === 0 ? /* @__PURE__ */
|
|
2748
|
+
children: footer[c.key] ?? (i === 0 ? /* @__PURE__ */ jsx35("span", { className: "pire-sr-only", children: msg.dataTableSummaryRow }) : null)
|
|
2655
2749
|
},
|
|
2656
2750
|
c.key
|
|
2657
2751
|
);
|
|
@@ -2665,7 +2759,7 @@ function DataTable({
|
|
|
2665
2759
|
}
|
|
2666
2760
|
|
|
2667
2761
|
// src/components/patterns/ValueHelpDialog.tsx
|
|
2668
|
-
import { Fragment as Fragment2, jsx as
|
|
2762
|
+
import { Fragment as Fragment2, jsx as jsx36, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2669
2763
|
function ValueHelpDialog({
|
|
2670
2764
|
isOpen,
|
|
2671
2765
|
title,
|
|
@@ -2685,12 +2779,12 @@ function ValueHelpDialog({
|
|
|
2685
2779
|
onConfirm
|
|
2686
2780
|
}) {
|
|
2687
2781
|
const msg = usePireMessages();
|
|
2688
|
-
const [query, setQuery] =
|
|
2689
|
-
|
|
2782
|
+
const [query, setQuery] = React20.useState("");
|
|
2783
|
+
React20.useEffect(() => {
|
|
2690
2784
|
if (isOpen) setQuery("");
|
|
2691
2785
|
}, [isOpen]);
|
|
2692
2786
|
const isMultiple = selectionMode === "multiple";
|
|
2693
|
-
const filtered =
|
|
2787
|
+
const filtered = React20.useMemo(() => {
|
|
2694
2788
|
if (isFilteredExternally) return rows;
|
|
2695
2789
|
const q = query.trim().toLowerCase();
|
|
2696
2790
|
if (!q) return rows;
|
|
@@ -2700,16 +2794,16 @@ function ValueHelpDialog({
|
|
|
2700
2794
|
setQuery(value);
|
|
2701
2795
|
onSearch?.(value);
|
|
2702
2796
|
};
|
|
2703
|
-
return /* @__PURE__ */
|
|
2797
|
+
return /* @__PURE__ */ jsx36(
|
|
2704
2798
|
Dialog,
|
|
2705
2799
|
{
|
|
2706
2800
|
isOpen,
|
|
2707
2801
|
size: "lg",
|
|
2708
2802
|
title: title ?? msg.valueHelpDialogTitle,
|
|
2709
2803
|
onClose,
|
|
2710
|
-
footer: /* @__PURE__ */
|
|
2711
|
-
/* @__PURE__ */
|
|
2712
|
-
isMultiple ? /* @__PURE__ */
|
|
2804
|
+
footer: /* @__PURE__ */ jsxs26(Fragment2, { children: [
|
|
2805
|
+
/* @__PURE__ */ jsx36(Button, { variant: "tertiary", onPress: onClose, children: msg.valueHelpDialogCancel }),
|
|
2806
|
+
isMultiple ? /* @__PURE__ */ jsx36(
|
|
2713
2807
|
Button,
|
|
2714
2808
|
{
|
|
2715
2809
|
variant: "primary",
|
|
@@ -2721,8 +2815,8 @@ function ValueHelpDialog({
|
|
|
2721
2815
|
}
|
|
2722
2816
|
) : null
|
|
2723
2817
|
] }),
|
|
2724
|
-
children: /* @__PURE__ */
|
|
2725
|
-
/* @__PURE__ */
|
|
2818
|
+
children: /* @__PURE__ */ jsxs26("div", { style: { display: "flex", flexDirection: "column", gap: "var(--sp-3)" }, children: [
|
|
2819
|
+
/* @__PURE__ */ jsx36(
|
|
2726
2820
|
Input,
|
|
2727
2821
|
{
|
|
2728
2822
|
"aria-label": msg.valueHelpDialogSearch,
|
|
@@ -2735,12 +2829,12 @@ function ValueHelpDialog({
|
|
|
2735
2829
|
autoFocus: true
|
|
2736
2830
|
}
|
|
2737
2831
|
),
|
|
2738
|
-
isMultiple ? /* @__PURE__ */
|
|
2739
|
-
/* @__PURE__ */
|
|
2740
|
-
/* @__PURE__ */
|
|
2741
|
-
/* @__PURE__ */
|
|
2832
|
+
isMultiple ? /* @__PURE__ */ jsxs26("div", { className: "pire-valuehelp-selectionbar", children: [
|
|
2833
|
+
/* @__PURE__ */ jsx36(Button, { size: "sm", variant: "tertiary", onPress: () => onSelectionChange?.(rows.map((r) => r.id)), children: msg.valueHelpSelectAllCount.replace("{count}", String(rows.length)) }),
|
|
2834
|
+
/* @__PURE__ */ jsx36(Button, { size: "sm", variant: "tertiary", onPress: () => onSelectionChange?.([]), children: msg.valueHelpClearSelection }),
|
|
2835
|
+
/* @__PURE__ */ jsx36("span", { className: "pire-valuehelp-count", children: msg.valueHelpSelectedCount.replace("{count}", String(selectedKeys?.length ?? 0)) })
|
|
2742
2836
|
] }) : null,
|
|
2743
|
-
/* @__PURE__ */
|
|
2837
|
+
/* @__PURE__ */ jsx36(
|
|
2744
2838
|
"div",
|
|
2745
2839
|
{
|
|
2746
2840
|
onScroll: onLoadMore ? (event) => {
|
|
@@ -2748,7 +2842,7 @@ function ValueHelpDialog({
|
|
|
2748
2842
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 64) onLoadMore();
|
|
2749
2843
|
} : void 0,
|
|
2750
2844
|
style: { overflow: "auto", maxHeight: "48vh" },
|
|
2751
|
-
children: /* @__PURE__ */
|
|
2845
|
+
children: /* @__PURE__ */ jsx36(
|
|
2752
2846
|
DataTable,
|
|
2753
2847
|
{
|
|
2754
2848
|
"aria-label": typeof title === "string" ? title : msg.valueHelpDialogTitle,
|
|
@@ -2775,7 +2869,7 @@ function ValueHelpDialog({
|
|
|
2775
2869
|
}
|
|
2776
2870
|
|
|
2777
2871
|
// src/components/forms/ValueHelpField.tsx
|
|
2778
|
-
import { jsx as
|
|
2872
|
+
import { jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2779
2873
|
var defaultFormat = (row) => [row.id, row.name ?? row.label ?? row.text].filter(Boolean).join(" \u2014 ");
|
|
2780
2874
|
function ValueHelpField({
|
|
2781
2875
|
label,
|
|
@@ -2801,9 +2895,9 @@ function ValueHelpField({
|
|
|
2801
2895
|
style
|
|
2802
2896
|
}) {
|
|
2803
2897
|
const msg = usePireMessages();
|
|
2804
|
-
const [open, setOpen] =
|
|
2805
|
-
return /* @__PURE__ */
|
|
2806
|
-
/* @__PURE__ */
|
|
2898
|
+
const [open, setOpen] = React21.useState(false);
|
|
2899
|
+
return /* @__PURE__ */ jsxs27("div", { className: cx(className), style, children: [
|
|
2900
|
+
/* @__PURE__ */ jsx37(
|
|
2807
2901
|
Input,
|
|
2808
2902
|
{
|
|
2809
2903
|
label,
|
|
@@ -2815,8 +2909,8 @@ function ValueHelpField({
|
|
|
2815
2909
|
placeholder: placeholder ?? msg.valueHelpFieldPlaceholder,
|
|
2816
2910
|
description,
|
|
2817
2911
|
errorMessage,
|
|
2818
|
-
suffix: /* @__PURE__ */
|
|
2819
|
-
allowsClear && value ? /* @__PURE__ */
|
|
2912
|
+
suffix: /* @__PURE__ */ jsxs27("span", { className: "pire-valuehelp-actions", children: [
|
|
2913
|
+
allowsClear && value ? /* @__PURE__ */ jsx37(
|
|
2820
2914
|
IconButton,
|
|
2821
2915
|
{
|
|
2822
2916
|
icon: "x",
|
|
@@ -2825,7 +2919,7 @@ function ValueHelpField({
|
|
|
2825
2919
|
onPress: () => onChange?.(null)
|
|
2826
2920
|
}
|
|
2827
2921
|
) : null,
|
|
2828
|
-
/* @__PURE__ */
|
|
2922
|
+
/* @__PURE__ */ jsx37(
|
|
2829
2923
|
IconButton,
|
|
2830
2924
|
{
|
|
2831
2925
|
icon: "search",
|
|
@@ -2837,7 +2931,7 @@ function ValueHelpField({
|
|
|
2837
2931
|
] })
|
|
2838
2932
|
}
|
|
2839
2933
|
),
|
|
2840
|
-
/* @__PURE__ */
|
|
2934
|
+
/* @__PURE__ */ jsx37(
|
|
2841
2935
|
ValueHelpDialog,
|
|
2842
2936
|
{
|
|
2843
2937
|
isOpen: open,
|
|
@@ -2857,12 +2951,12 @@ function ValueHelpField({
|
|
|
2857
2951
|
}
|
|
2858
2952
|
|
|
2859
2953
|
// src/components/forms/FileUpload.tsx
|
|
2860
|
-
import * as
|
|
2861
|
-
import { FileTrigger, Text as
|
|
2954
|
+
import * as React22 from "react";
|
|
2955
|
+
import { FileTrigger, Text as Text5 } from "react-aria-components";
|
|
2862
2956
|
|
|
2863
2957
|
// src/components/feedback/ProgressBar.tsx
|
|
2864
|
-
import { ProgressBar as AriaProgressBar, Label as
|
|
2865
|
-
import { Fragment as Fragment3, jsx as
|
|
2958
|
+
import { ProgressBar as AriaProgressBar, Label as Label3 } from "react-aria-components";
|
|
2959
|
+
import { Fragment as Fragment3, jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2866
2960
|
function ProgressBar({
|
|
2867
2961
|
value = 0,
|
|
2868
2962
|
minValue = 0,
|
|
@@ -2875,7 +2969,7 @@ function ProgressBar({
|
|
|
2875
2969
|
className,
|
|
2876
2970
|
style
|
|
2877
2971
|
}) {
|
|
2878
|
-
return /* @__PURE__ */
|
|
2972
|
+
return /* @__PURE__ */ jsx38(
|
|
2879
2973
|
AriaProgressBar,
|
|
2880
2974
|
{
|
|
2881
2975
|
className: cx("pire-progress", className),
|
|
@@ -2886,19 +2980,19 @@ function ProgressBar({
|
|
|
2886
2980
|
maxValue,
|
|
2887
2981
|
isIndeterminate,
|
|
2888
2982
|
style,
|
|
2889
|
-
children: ({ percentage, valueText }) => /* @__PURE__ */
|
|
2890
|
-
label || showValue ? /* @__PURE__ */
|
|
2891
|
-
label ? /* @__PURE__ */
|
|
2892
|
-
showValue && !isIndeterminate ? /* @__PURE__ */
|
|
2983
|
+
children: ({ percentage, valueText }) => /* @__PURE__ */ jsxs28(Fragment3, { children: [
|
|
2984
|
+
label || showValue ? /* @__PURE__ */ jsxs28("div", { className: "pire-progress-head", children: [
|
|
2985
|
+
label ? /* @__PURE__ */ jsx38(Label3, { children: label }) : /* @__PURE__ */ jsx38("span", {}),
|
|
2986
|
+
showValue && !isIndeterminate ? /* @__PURE__ */ jsx38("span", { className: "pire-numeric", children: valueText }) : null
|
|
2893
2987
|
] }) : null,
|
|
2894
|
-
/* @__PURE__ */
|
|
2988
|
+
/* @__PURE__ */ jsx38("div", { className: "pire-progress-track", children: /* @__PURE__ */ jsx38("div", { className: "pire-progress-fill", style: { width: `${isIndeterminate ? 40 : percentage}%` } }) })
|
|
2895
2989
|
] })
|
|
2896
2990
|
}
|
|
2897
2991
|
);
|
|
2898
2992
|
}
|
|
2899
2993
|
|
|
2900
2994
|
// src/components/forms/FileUpload.tsx
|
|
2901
|
-
import { jsx as
|
|
2995
|
+
import { jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2902
2996
|
var isImage = (file) => file.type.startsWith("image/");
|
|
2903
2997
|
function formatFileSize(bytes) {
|
|
2904
2998
|
if (bytes < 1024) return `${bytes} B`;
|
|
@@ -2950,10 +3044,10 @@ function FileUpload({
|
|
|
2950
3044
|
...rest
|
|
2951
3045
|
}) {
|
|
2952
3046
|
const msg = usePireMessages();
|
|
2953
|
-
const [uncontrolled, setUncontrolled] =
|
|
3047
|
+
const [uncontrolled, setUncontrolled] = React22.useState(defaultValue ?? []);
|
|
2954
3048
|
const files = value ?? uncontrolled;
|
|
2955
|
-
const created =
|
|
2956
|
-
|
|
3049
|
+
const created = React22.useRef([]);
|
|
3050
|
+
React22.useEffect(
|
|
2957
3051
|
() => () => {
|
|
2958
3052
|
for (const url of created.current) URL.revokeObjectURL(url);
|
|
2959
3053
|
},
|
|
@@ -2976,7 +3070,7 @@ function FileUpload({
|
|
|
2976
3070
|
commit(allowsMultiple ? [...files, ...wrapped] : wrapped.slice(0, 1));
|
|
2977
3071
|
};
|
|
2978
3072
|
const remove = (target) => commit(files.filter((f) => f.file !== target));
|
|
2979
|
-
return /* @__PURE__ */
|
|
3073
|
+
return /* @__PURE__ */ jsxs29(
|
|
2980
3074
|
"div",
|
|
2981
3075
|
{
|
|
2982
3076
|
className: cx("pire-field", "pire-fileupload", className),
|
|
@@ -2985,24 +3079,24 @@ function FileUpload({
|
|
|
2985
3079
|
"data-invalid": isInvalid ? "true" : void 0,
|
|
2986
3080
|
...rest,
|
|
2987
3081
|
children: [
|
|
2988
|
-
label ? /* @__PURE__ */
|
|
3082
|
+
label ? /* @__PURE__ */ jsxs29("span", { className: "pire-field-label", children: [
|
|
2989
3083
|
label,
|
|
2990
|
-
isRequired ? /* @__PURE__ */
|
|
3084
|
+
isRequired ? /* @__PURE__ */ jsx39("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
2991
3085
|
] }) : null,
|
|
2992
|
-
/* @__PURE__ */
|
|
3086
|
+
/* @__PURE__ */ jsx39(
|
|
2993
3087
|
FileTrigger,
|
|
2994
3088
|
{
|
|
2995
3089
|
acceptedFileTypes,
|
|
2996
3090
|
allowsMultiple,
|
|
2997
3091
|
onSelect: accept,
|
|
2998
|
-
children: /* @__PURE__ */
|
|
3092
|
+
children: /* @__PURE__ */ jsx39(Button, { icon: "paperclip", isDisabled: isDisabled || isReadOnly, children: chooseLabel ?? msg.fileUploadChoose })
|
|
2999
3093
|
}
|
|
3000
3094
|
),
|
|
3001
|
-
files.length ? /* @__PURE__ */
|
|
3002
|
-
previewUrl ? /* @__PURE__ */
|
|
3003
|
-
/* @__PURE__ */
|
|
3004
|
-
/* @__PURE__ */
|
|
3005
|
-
isDisabled || isReadOnly ? null : /* @__PURE__ */
|
|
3095
|
+
files.length ? /* @__PURE__ */ jsx39("ul", { className: "pire-fileupload-list", children: files.map(({ file, previewUrl }) => /* @__PURE__ */ jsxs29("li", { className: "pire-fileupload-item", children: [
|
|
3096
|
+
previewUrl ? /* @__PURE__ */ jsx39("img", { className: "pire-fileupload-thumb", src: previewUrl, alt: "" }) : /* @__PURE__ */ jsx39(Icon, { name: "file-text", size: 16, className: "pire-fileupload-icon" }),
|
|
3097
|
+
/* @__PURE__ */ jsx39("span", { className: "pire-fileupload-name", children: file.name }),
|
|
3098
|
+
/* @__PURE__ */ jsx39("span", { className: "pire-fileupload-size", children: formatFileSize(file.size) }),
|
|
3099
|
+
isDisabled || isReadOnly ? null : /* @__PURE__ */ jsx39(
|
|
3006
3100
|
IconButton,
|
|
3007
3101
|
{
|
|
3008
3102
|
icon: "x",
|
|
@@ -3012,9 +3106,9 @@ function FileUpload({
|
|
|
3012
3106
|
}
|
|
3013
3107
|
)
|
|
3014
3108
|
] }, `${file.name}-${file.size}-${file.lastModified}`)) }) : null,
|
|
3015
|
-
uploadProgress != null ? /* @__PURE__ */
|
|
3016
|
-
description ? /* @__PURE__ */
|
|
3017
|
-
isInvalid && errorMessage ? /* @__PURE__ */
|
|
3109
|
+
uploadProgress != null ? /* @__PURE__ */ jsx39(ProgressBar, { value: uploadProgress, label: msg.fileUploadUploading }) : null,
|
|
3110
|
+
description ? /* @__PURE__ */ jsx39(Text5, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
3111
|
+
isInvalid && errorMessage ? /* @__PURE__ */ jsx39("span", { className: "pire-field-error", children: errorMessage }) : null
|
|
3018
3112
|
]
|
|
3019
3113
|
}
|
|
3020
3114
|
);
|
|
@@ -3022,7 +3116,7 @@ function FileUpload({
|
|
|
3022
3116
|
|
|
3023
3117
|
// src/components/navigation/ShellBar.tsx
|
|
3024
3118
|
import { MenuTrigger, Button as AriaButton11, Popover as Popover6 } from "react-aria-components";
|
|
3025
|
-
import { jsx as
|
|
3119
|
+
import { jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3026
3120
|
var initials2 = (name) => name.trim().split(/\s+/).slice(0, 2).map((p) => p[0]).join("").toUpperCase();
|
|
3027
3121
|
function ShellBar({
|
|
3028
3122
|
launcher,
|
|
@@ -3041,21 +3135,21 @@ function ShellBar({
|
|
|
3041
3135
|
...rest
|
|
3042
3136
|
}) {
|
|
3043
3137
|
const msg = usePireMessages();
|
|
3044
|
-
return /* @__PURE__ */
|
|
3138
|
+
return /* @__PURE__ */ jsxs30("header", { className: cx("pire-shellbar", className), ...rest, children: [
|
|
3045
3139
|
launcher,
|
|
3046
|
-
onMenu ? /* @__PURE__ */
|
|
3047
|
-
monogram ? /* @__PURE__ */
|
|
3048
|
-
product ? /* @__PURE__ */
|
|
3049
|
-
title ? /* @__PURE__ */
|
|
3050
|
-
/* @__PURE__ */
|
|
3051
|
-
onSearch ? /* @__PURE__ */
|
|
3140
|
+
onMenu ? /* @__PURE__ */ jsx40(IconButton, { icon: "menu", label: menuLabel, variant: "inverse", size: "sm", onPress: onMenu }) : null,
|
|
3141
|
+
monogram ? /* @__PURE__ */ jsx40("span", { className: "pire-shellbar-mono", "aria-hidden": "true", children: monogram }) : null,
|
|
3142
|
+
product ? /* @__PURE__ */ jsx40("span", { className: "pire-shellbar-product", children: product }) : null,
|
|
3143
|
+
title ? /* @__PURE__ */ jsx40("span", { className: "pire-shellbar-title", children: title }) : null,
|
|
3144
|
+
/* @__PURE__ */ jsx40("span", { className: "pire-shellbar-spacer" }),
|
|
3145
|
+
onSearch ? /* @__PURE__ */ jsx40(IconButton, { icon: "search", label: searchLabel, variant: "inverse", size: "sm", onPress: onSearch }) : null,
|
|
3052
3146
|
actions,
|
|
3053
3147
|
user && userMenu ? (
|
|
3054
3148
|
// A real button, not the img-role span: the avatar is where "my profile", "switch company"
|
|
3055
3149
|
// and "sign out" live in any ERP, and a span accepts neither focus nor onPress. Popover is
|
|
3056
3150
|
// rendered here rather than expected from the consumer so the panel keeps shell placement.
|
|
3057
|
-
/* @__PURE__ */
|
|
3058
|
-
/* @__PURE__ */
|
|
3151
|
+
/* @__PURE__ */ jsxs30(MenuTrigger, { children: [
|
|
3152
|
+
/* @__PURE__ */ jsx40(
|
|
3059
3153
|
AriaButton11,
|
|
3060
3154
|
{
|
|
3061
3155
|
className: "pire-avatar pire-avatar-trigger",
|
|
@@ -3063,14 +3157,14 @@ function ShellBar({
|
|
|
3063
3157
|
children: initials2(user)
|
|
3064
3158
|
}
|
|
3065
3159
|
),
|
|
3066
|
-
/* @__PURE__ */
|
|
3160
|
+
/* @__PURE__ */ jsx40(Popover6, { className: "pire-popover", children: userMenu })
|
|
3067
3161
|
] })
|
|
3068
|
-
) : user ? /* @__PURE__ */
|
|
3162
|
+
) : user ? /* @__PURE__ */ jsx40("span", { className: "pire-avatar", title: user, "aria-label": user, role: "img", children: initials2(user) }) : null
|
|
3069
3163
|
] });
|
|
3070
3164
|
}
|
|
3071
3165
|
|
|
3072
3166
|
// src/components/navigation/SideNav.tsx
|
|
3073
|
-
import * as
|
|
3167
|
+
import * as React23 from "react";
|
|
3074
3168
|
import {
|
|
3075
3169
|
Button as AriaButton12,
|
|
3076
3170
|
Disclosure,
|
|
@@ -3088,11 +3182,11 @@ import {
|
|
|
3088
3182
|
Separator as AriaSeparator2,
|
|
3089
3183
|
Header
|
|
3090
3184
|
} from "react-aria-components";
|
|
3091
|
-
import { jsx as
|
|
3185
|
+
import { jsx as jsx41, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3092
3186
|
function Menu({ minWidth, className, style, ...rest }) {
|
|
3093
3187
|
const width = typeof minWidth === "number" ? `${minWidth}px` : minWidth;
|
|
3094
3188
|
const menuStyle = width == null ? style : { ["--pire-menu-min-w"]: width, ...style };
|
|
3095
|
-
return /* @__PURE__ */
|
|
3189
|
+
return /* @__PURE__ */ jsx41(AriaMenu, { className: cx("pire-menu", className), style: menuStyle, ...rest });
|
|
3096
3190
|
}
|
|
3097
3191
|
var shortcutKeys = (shortcut) => {
|
|
3098
3192
|
if (shortcut == null) return [];
|
|
@@ -3109,19 +3203,19 @@ function MenuItem({
|
|
|
3109
3203
|
...rest
|
|
3110
3204
|
}) {
|
|
3111
3205
|
const keys = shortcutKeys(shortcut);
|
|
3112
|
-
return /* @__PURE__ */
|
|
3206
|
+
return /* @__PURE__ */ jsxs31(
|
|
3113
3207
|
AriaMenuItem,
|
|
3114
3208
|
{
|
|
3115
3209
|
className: cx("pire-menu-item", className),
|
|
3116
3210
|
"data-tone": tone === "danger" ? "danger" : void 0,
|
|
3117
3211
|
...rest,
|
|
3118
3212
|
children: [
|
|
3119
|
-
icon ? /* @__PURE__ */
|
|
3120
|
-
/* @__PURE__ */
|
|
3121
|
-
/* @__PURE__ */
|
|
3122
|
-
description ? /* @__PURE__ */
|
|
3213
|
+
icon ? /* @__PURE__ */ jsx41(Icon, { name: icon, size: 16, className: "pire-menu-item-icon" }) : null,
|
|
3214
|
+
/* @__PURE__ */ jsxs31("span", { className: "pire-menu-item-body", children: [
|
|
3215
|
+
/* @__PURE__ */ jsx41("span", { className: "pire-menu-item-label", children }),
|
|
3216
|
+
description ? /* @__PURE__ */ jsx41("span", { className: "pire-menu-item-desc", children: description }) : null
|
|
3123
3217
|
] }),
|
|
3124
|
-
keys.length ? /* @__PURE__ */
|
|
3218
|
+
keys.length ? /* @__PURE__ */ jsx41("span", { className: "pire-menu-item-shortcut", children: keys.map((cap, index) => /* @__PURE__ */ jsx41(
|
|
3125
3219
|
Kbd,
|
|
3126
3220
|
{
|
|
3127
3221
|
size: "sm",
|
|
@@ -3134,17 +3228,17 @@ function MenuItem({
|
|
|
3134
3228
|
);
|
|
3135
3229
|
}
|
|
3136
3230
|
function MenuSection({ title, children, className, ...rest }) {
|
|
3137
|
-
return /* @__PURE__ */
|
|
3138
|
-
title ? /* @__PURE__ */
|
|
3231
|
+
return /* @__PURE__ */ jsxs31(AriaMenuSection, { className: cx("pire-menu-section", className), ...rest, children: [
|
|
3232
|
+
title ? /* @__PURE__ */ jsx41(Header, { className: "pire-menu-section-title", children: title }) : null,
|
|
3139
3233
|
children
|
|
3140
3234
|
] });
|
|
3141
3235
|
}
|
|
3142
3236
|
function MenuSeparator({ className }) {
|
|
3143
|
-
return /* @__PURE__ */
|
|
3237
|
+
return /* @__PURE__ */ jsx41(AriaSeparator2, { className: cx("pire-menu-separator", className) });
|
|
3144
3238
|
}
|
|
3145
3239
|
|
|
3146
3240
|
// src/components/navigation/SideNav.tsx
|
|
3147
|
-
import { jsx as
|
|
3241
|
+
import { jsx as jsx42, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3148
3242
|
function findActiveParent(groups, value) {
|
|
3149
3243
|
if (value == null) return void 0;
|
|
3150
3244
|
for (const group of groups) {
|
|
@@ -3171,10 +3265,10 @@ function SideNav({
|
|
|
3171
3265
|
const msg = usePireMessages();
|
|
3172
3266
|
const activeParent = findActiveParent(groups, value);
|
|
3173
3267
|
const isControlled = expandedIds != null;
|
|
3174
|
-
const [ownExpanded, setOwnExpanded] =
|
|
3268
|
+
const [ownExpanded, setOwnExpanded] = React23.useState(
|
|
3175
3269
|
() => new Set(defaultExpandedIds ?? (activeParent ? [activeParent] : []))
|
|
3176
3270
|
);
|
|
3177
|
-
const [lastValue, setLastValue] =
|
|
3271
|
+
const [lastValue, setLastValue] = React23.useState(value);
|
|
3178
3272
|
if (value !== lastValue) {
|
|
3179
3273
|
setLastValue(value);
|
|
3180
3274
|
if (!isControlled && activeParent && !ownExpanded.has(activeParent)) {
|
|
@@ -3194,7 +3288,7 @@ function SideNav({
|
|
|
3194
3288
|
};
|
|
3195
3289
|
const renderRow = (item, onPress, isGroup) => {
|
|
3196
3290
|
const selected = !isGroup && item.id === value;
|
|
3197
|
-
const button = /* @__PURE__ */
|
|
3291
|
+
const button = /* @__PURE__ */ jsxs32(
|
|
3198
3292
|
AriaButton12,
|
|
3199
3293
|
{
|
|
3200
3294
|
className: "pire-sidenav-item",
|
|
@@ -3204,37 +3298,37 @@ function SideNav({
|
|
|
3204
3298
|
"aria-label": collapsed ? item.label : void 0,
|
|
3205
3299
|
onPress,
|
|
3206
3300
|
children: [
|
|
3207
|
-
item.icon ? /* @__PURE__ */
|
|
3208
|
-
collapsed ? null : /* @__PURE__ */
|
|
3209
|
-
item.count != null && !collapsed ? /* @__PURE__ */
|
|
3301
|
+
item.icon ? /* @__PURE__ */ jsx42(Icon, { name: item.icon, size: 16 }) : null,
|
|
3302
|
+
collapsed ? null : /* @__PURE__ */ jsx42("span", { children: item.label }),
|
|
3303
|
+
item.count != null && !collapsed ? /* @__PURE__ */ jsx42("span", { className: "pire-sidenav-count", children: item.count }) : null
|
|
3210
3304
|
]
|
|
3211
3305
|
},
|
|
3212
3306
|
item.id
|
|
3213
3307
|
);
|
|
3214
|
-
return collapsed ? /* @__PURE__ */
|
|
3308
|
+
return collapsed ? /* @__PURE__ */ jsx42(Tooltip, { label: item.label, placement: "right", children: button }, item.id) : button;
|
|
3215
3309
|
};
|
|
3216
|
-
const renderRailFlyout = (item) => /* @__PURE__ */
|
|
3217
|
-
/* @__PURE__ */
|
|
3310
|
+
const renderRailFlyout = (item) => /* @__PURE__ */ jsxs32(MenuTrigger2, { children: [
|
|
3311
|
+
/* @__PURE__ */ jsx42(
|
|
3218
3312
|
AriaButton12,
|
|
3219
3313
|
{
|
|
3220
3314
|
className: "pire-sidenav-item",
|
|
3221
3315
|
"aria-label": item.label,
|
|
3222
3316
|
"data-active-child": item.id === activeParent ? "true" : void 0,
|
|
3223
|
-
children: item.icon ? /* @__PURE__ */
|
|
3317
|
+
children: item.icon ? /* @__PURE__ */ jsx42(Icon, { name: item.icon, size: 16 }) : null
|
|
3224
3318
|
}
|
|
3225
3319
|
),
|
|
3226
|
-
/* @__PURE__ */
|
|
3320
|
+
/* @__PURE__ */ jsx42(Popover7, { className: "pire-popover", placement: "right top", offset: 4, children: /* @__PURE__ */ jsx42(
|
|
3227
3321
|
Menu,
|
|
3228
3322
|
{
|
|
3229
3323
|
"aria-label": item.label,
|
|
3230
3324
|
className: "pire-sidenav-flyout",
|
|
3231
3325
|
onAction: (key) => onChange?.(String(key)),
|
|
3232
|
-
children: (item.items ?? []).map((child) => /* @__PURE__ */
|
|
3326
|
+
children: (item.items ?? []).map((child) => /* @__PURE__ */ jsx42(MenuItem, { id: child.id, children: child.label }, child.id))
|
|
3233
3327
|
}
|
|
3234
3328
|
) })
|
|
3235
3329
|
] }, item.id);
|
|
3236
|
-
const renderSection = (item) => /* @__PURE__ */
|
|
3237
|
-
/* @__PURE__ */
|
|
3330
|
+
const renderSection = (item) => /* @__PURE__ */ jsxs32(Disclosure, { id: item.id, className: "pire-sidenav-section", children: [
|
|
3331
|
+
/* @__PURE__ */ jsxs32(
|
|
3238
3332
|
AriaButton12,
|
|
3239
3333
|
{
|
|
3240
3334
|
slot: "trigger",
|
|
@@ -3242,16 +3336,16 @@ function SideNav({
|
|
|
3242
3336
|
"data-kind": "group",
|
|
3243
3337
|
"data-active-child": item.id === activeParent ? "true" : void 0,
|
|
3244
3338
|
children: [
|
|
3245
|
-
item.icon ? /* @__PURE__ */
|
|
3246
|
-
/* @__PURE__ */
|
|
3247
|
-
item.count != null ? /* @__PURE__ */
|
|
3248
|
-
/* @__PURE__ */
|
|
3339
|
+
item.icon ? /* @__PURE__ */ jsx42(Icon, { name: item.icon, size: 16 }) : null,
|
|
3340
|
+
/* @__PURE__ */ jsx42("span", { children: item.label }),
|
|
3341
|
+
item.count != null ? /* @__PURE__ */ jsx42("span", { className: "pire-sidenav-count", children: item.count }) : null,
|
|
3342
|
+
/* @__PURE__ */ jsx42(Icon, { name: "chevron-down", size: 16, className: "pire-sidenav-chevron" })
|
|
3249
3343
|
]
|
|
3250
3344
|
}
|
|
3251
3345
|
),
|
|
3252
|
-
/* @__PURE__ */
|
|
3346
|
+
/* @__PURE__ */ jsx42(DisclosurePanel, { className: "pire-sidenav-subnav", children: item.items?.map((child) => {
|
|
3253
3347
|
const selected = child.id === value;
|
|
3254
|
-
return /* @__PURE__ */
|
|
3348
|
+
return /* @__PURE__ */ jsxs32(
|
|
3255
3349
|
AriaButton12,
|
|
3256
3350
|
{
|
|
3257
3351
|
className: "pire-sidenav-item pire-sidenav-subitem",
|
|
@@ -3259,15 +3353,15 @@ function SideNav({
|
|
|
3259
3353
|
"aria-current": selected ? "page" : void 0,
|
|
3260
3354
|
onPress: () => onChange?.(child.id),
|
|
3261
3355
|
children: [
|
|
3262
|
-
/* @__PURE__ */
|
|
3263
|
-
child.count != null ? /* @__PURE__ */
|
|
3356
|
+
/* @__PURE__ */ jsx42("span", { children: child.label }),
|
|
3357
|
+
child.count != null ? /* @__PURE__ */ jsx42("span", { className: "pire-sidenav-count", children: child.count }) : null
|
|
3264
3358
|
]
|
|
3265
3359
|
},
|
|
3266
3360
|
child.id
|
|
3267
3361
|
);
|
|
3268
3362
|
}) })
|
|
3269
3363
|
] }, item.id);
|
|
3270
|
-
return /* @__PURE__ */
|
|
3364
|
+
return /* @__PURE__ */ jsxs32(
|
|
3271
3365
|
"nav",
|
|
3272
3366
|
{
|
|
3273
3367
|
className: cx("pire-sidenav", className),
|
|
@@ -3284,9 +3378,9 @@ function SideNav({
|
|
|
3284
3378
|
if (isGroup && collapsed && railFlyout) return renderRailFlyout(item);
|
|
3285
3379
|
return renderRow(item, () => isGroup ? toggleExpanded(item.id) : onChange?.(item.id), isGroup);
|
|
3286
3380
|
});
|
|
3287
|
-
return /* @__PURE__ */
|
|
3288
|
-
group.label && !collapsed ? /* @__PURE__ */
|
|
3289
|
-
hasSections ? /* @__PURE__ */
|
|
3381
|
+
return /* @__PURE__ */ jsxs32("div", { className: "pire-sidenav-group", children: [
|
|
3382
|
+
group.label && !collapsed ? /* @__PURE__ */ jsx42("div", { className: "pire-sidenav-label", children: group.label }) : null,
|
|
3383
|
+
hasSections ? /* @__PURE__ */ jsx42(
|
|
3290
3384
|
DisclosureGroup,
|
|
3291
3385
|
{
|
|
3292
3386
|
className: "pire-sidenav-tree",
|
|
@@ -3298,24 +3392,24 @@ function SideNav({
|
|
|
3298
3392
|
) : rows
|
|
3299
3393
|
] }, group.label ?? gi);
|
|
3300
3394
|
}),
|
|
3301
|
-
footer ? /* @__PURE__ */
|
|
3395
|
+
footer ? /* @__PURE__ */ jsx42("div", { className: "pire-sidenav-footer", children: footer }) : null
|
|
3302
3396
|
]
|
|
3303
3397
|
}
|
|
3304
3398
|
);
|
|
3305
3399
|
}
|
|
3306
3400
|
|
|
3307
3401
|
// src/components/navigation/ShellRail.tsx
|
|
3308
|
-
import * as
|
|
3402
|
+
import * as React24 from "react";
|
|
3309
3403
|
import { Button as AriaButton13 } from "react-aria-components";
|
|
3310
|
-
import { jsx as
|
|
3404
|
+
import { jsx as jsx43, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3311
3405
|
function ShellRail({ groups, value, onChange, className, ...rest }) {
|
|
3312
3406
|
const msg = usePireMessages();
|
|
3313
|
-
return /* @__PURE__ */
|
|
3407
|
+
return /* @__PURE__ */ jsx43("nav", { className: cx("pire-shellrail", className), "aria-label": msg.shellRailLabel, ...rest, children: groups.map((group, gi) => (
|
|
3314
3408
|
// The divider is a sibling of the groups rather than a pseudo-element on one, because the
|
|
3315
3409
|
// scrolling zone would carry its own rule out of view on the first wheel event.
|
|
3316
|
-
/* @__PURE__ */
|
|
3317
|
-
gi > 0 ? /* @__PURE__ */
|
|
3318
|
-
/* @__PURE__ */
|
|
3410
|
+
/* @__PURE__ */ jsxs33(React24.Fragment, { children: [
|
|
3411
|
+
gi > 0 ? /* @__PURE__ */ jsx43("div", { className: "pire-shellrail-divider" }) : null,
|
|
3412
|
+
/* @__PURE__ */ jsx43("div", { className: "pire-shellrail-group", "data-scroll": group.isScrollable ? "true" : void 0, children: group.items.map((item) => /* @__PURE__ */ jsx43(Tooltip, { label: item.label, placement: "right", children: /* @__PURE__ */ jsx43(
|
|
3319
3413
|
AriaButton13,
|
|
3320
3414
|
{
|
|
3321
3415
|
className: "pire-shellrail-item",
|
|
@@ -3323,7 +3417,7 @@ function ShellRail({ groups, value, onChange, className, ...rest }) {
|
|
|
3323
3417
|
"data-selected": item.id === value ? "true" : void 0,
|
|
3324
3418
|
"aria-current": item.id === value ? "true" : void 0,
|
|
3325
3419
|
onPress: () => onChange?.(item.id),
|
|
3326
|
-
children: /* @__PURE__ */
|
|
3420
|
+
children: /* @__PURE__ */ jsx43("span", { className: "pire-shellrail-tile", children: /* @__PURE__ */ jsx43(Icon, { name: item.icon, size: 20 }) })
|
|
3327
3421
|
}
|
|
3328
3422
|
) }, item.id)) })
|
|
3329
3423
|
] }, group.items[0]?.id ?? gi)
|
|
@@ -3332,9 +3426,9 @@ function ShellRail({ groups, value, onChange, className, ...rest }) {
|
|
|
3332
3426
|
|
|
3333
3427
|
// src/components/navigation/Tabs.tsx
|
|
3334
3428
|
import { Tabs as AriaTabs, TabList, Tab as AriaTab, TabPanel } from "react-aria-components";
|
|
3335
|
-
import { jsx as
|
|
3429
|
+
import { jsx as jsx44, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3336
3430
|
function Tabs({ items, value, defaultValue, onChange, panels, className, style, ...rest }) {
|
|
3337
|
-
return /* @__PURE__ */
|
|
3431
|
+
return /* @__PURE__ */ jsxs34(
|
|
3338
3432
|
AriaTabs,
|
|
3339
3433
|
{
|
|
3340
3434
|
className,
|
|
@@ -3343,12 +3437,12 @@ function Tabs({ items, value, defaultValue, onChange, panels, className, style,
|
|
|
3343
3437
|
defaultSelectedKey: defaultValue,
|
|
3344
3438
|
onSelectionChange: (k) => onChange?.(String(k)),
|
|
3345
3439
|
children: [
|
|
3346
|
-
/* @__PURE__ */
|
|
3347
|
-
item.icon ? /* @__PURE__ */
|
|
3440
|
+
/* @__PURE__ */ jsx44(TabList, { className: "pire-tablist", items, "aria-label": rest["aria-label"] ?? "Views", children: (item) => /* @__PURE__ */ jsxs34(AriaTab, { className: cx("pire-tab"), id: item.id, isDisabled: item.isDisabled, children: [
|
|
3441
|
+
item.icon ? /* @__PURE__ */ jsx44(Icon, { name: item.icon, size: 16 }) : null,
|
|
3348
3442
|
item.label,
|
|
3349
|
-
item.count != null ? /* @__PURE__ */
|
|
3443
|
+
item.count != null ? /* @__PURE__ */ jsx44("span", { className: "pire-tab-count", children: item.count }) : null
|
|
3350
3444
|
] }) }),
|
|
3351
|
-
items.map((item) => /* @__PURE__ */
|
|
3445
|
+
items.map((item) => /* @__PURE__ */ jsx44(TabPanel, { id: item.id, className: panels ? "pire-tabpanel" : void 0, children: panels?.[item.id] }, item.id))
|
|
3352
3446
|
]
|
|
3353
3447
|
}
|
|
3354
3448
|
);
|
|
@@ -3356,9 +3450,9 @@ function Tabs({ items, value, defaultValue, onChange, panels, className, style,
|
|
|
3356
3450
|
|
|
3357
3451
|
// src/components/navigation/Breadcrumb.tsx
|
|
3358
3452
|
import { Breadcrumbs as AriaBreadcrumbs, Breadcrumb as AriaBreadcrumb, Link as Link2 } from "react-aria-components";
|
|
3359
|
-
import { jsx as
|
|
3453
|
+
import { jsx as jsx45, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3360
3454
|
function Breadcrumb({ items, onNavigate, className, style }) {
|
|
3361
|
-
return /* @__PURE__ */
|
|
3455
|
+
return /* @__PURE__ */ jsx45(
|
|
3362
3456
|
AriaBreadcrumbs,
|
|
3363
3457
|
{
|
|
3364
3458
|
className: cx("pire-breadcrumbs", className),
|
|
@@ -3367,9 +3461,9 @@ function Breadcrumb({ items, onNavigate, className, style }) {
|
|
|
3367
3461
|
onAction: (key) => onNavigate?.(String(key)),
|
|
3368
3462
|
children: (item) => {
|
|
3369
3463
|
const last = items[items.length - 1] === item;
|
|
3370
|
-
return /* @__PURE__ */
|
|
3371
|
-
last ? item.label : /* @__PURE__ */
|
|
3372
|
-
last ? null : /* @__PURE__ */
|
|
3464
|
+
return /* @__PURE__ */ jsxs35(AriaBreadcrumb, { className: "pire-breadcrumb", id: item.id ?? item.label, children: [
|
|
3465
|
+
last ? item.label : /* @__PURE__ */ jsx45(Link2, { href: item.href, children: item.label }),
|
|
3466
|
+
last ? null : /* @__PURE__ */ jsx45(Icon, { name: "chevron-right", size: 12, style: { color: "var(--text-tertiary)" } })
|
|
3373
3467
|
] });
|
|
3374
3468
|
}
|
|
3375
3469
|
}
|
|
@@ -3377,7 +3471,7 @@ function Breadcrumb({ items, onNavigate, className, style }) {
|
|
|
3377
3471
|
}
|
|
3378
3472
|
|
|
3379
3473
|
// src/components/navigation/Pagination.tsx
|
|
3380
|
-
import { jsx as
|
|
3474
|
+
import { jsx as jsx46, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3381
3475
|
function Pagination({
|
|
3382
3476
|
page = 1,
|
|
3383
3477
|
pageSize = 25,
|
|
@@ -3392,9 +3486,9 @@ function Pagination({
|
|
|
3392
3486
|
const pages = Math.max(1, Math.ceil(total / pageSize));
|
|
3393
3487
|
const from = total === 0 ? 0 : (page - 1) * pageSize + 1;
|
|
3394
3488
|
const to = Math.min(total, page * pageSize);
|
|
3395
|
-
return /* @__PURE__ */
|
|
3396
|
-
/* @__PURE__ */
|
|
3397
|
-
/* @__PURE__ */
|
|
3489
|
+
return /* @__PURE__ */ jsxs36("nav", { className: cx("pire-pagination", className), style, "aria-label": msg.paginationLabel, children: [
|
|
3490
|
+
/* @__PURE__ */ jsx46("span", { className: "pire-pagination-count", children: msg.paginationRange.replace("{from}", from.toLocaleString()).replace("{to}", to.toLocaleString()).replace("{total}", total.toLocaleString()) }),
|
|
3491
|
+
/* @__PURE__ */ jsx46(
|
|
3398
3492
|
IconButton,
|
|
3399
3493
|
{
|
|
3400
3494
|
icon: "chevron-left",
|
|
@@ -3405,8 +3499,8 @@ function Pagination({
|
|
|
3405
3499
|
onPress: () => onPageChange?.(page - 1)
|
|
3406
3500
|
}
|
|
3407
3501
|
),
|
|
3408
|
-
/* @__PURE__ */
|
|
3409
|
-
/* @__PURE__ */
|
|
3502
|
+
/* @__PURE__ */ jsx46("span", { className: "pire-pagination-count", "aria-live": "polite", children: msg.paginationPageOf.replace("{page}", String(page)).replace("{pages}", String(pages)) }),
|
|
3503
|
+
/* @__PURE__ */ jsx46(
|
|
3410
3504
|
IconButton,
|
|
3411
3505
|
{
|
|
3412
3506
|
icon: "chevron-right",
|
|
@@ -3417,7 +3511,7 @@ function Pagination({
|
|
|
3417
3511
|
onPress: () => onPageChange?.(page + 1)
|
|
3418
3512
|
}
|
|
3419
3513
|
),
|
|
3420
|
-
onPageSizeChange ? /* @__PURE__ */
|
|
3514
|
+
onPageSizeChange ? /* @__PURE__ */ jsx46(
|
|
3421
3515
|
Select,
|
|
3422
3516
|
{
|
|
3423
3517
|
"aria-label": msg.paginationRowsPerPage,
|
|
@@ -3433,9 +3527,9 @@ function Pagination({
|
|
|
3433
3527
|
}
|
|
3434
3528
|
|
|
3435
3529
|
// src/components/navigation/Ribbon.tsx
|
|
3436
|
-
import * as
|
|
3530
|
+
import * as React25 from "react";
|
|
3437
3531
|
import { Tabs as AriaTabs2, TabList as TabList2, Tab as AriaTab2, TabPanel as TabPanel2, Toolbar, Button as Button3 } from "react-aria-components";
|
|
3438
|
-
import { Fragment as Fragment6, jsx as
|
|
3532
|
+
import { Fragment as Fragment6, jsx as jsx47, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
3439
3533
|
var outside = (what, parent) => {
|
|
3440
3534
|
const Config = () => {
|
|
3441
3535
|
throw new Error(`[pire] ${what} must be a child of ${parent}.`);
|
|
@@ -3449,7 +3543,7 @@ var RibbonGroup = outside("Ribbon.Group", "Ribbon.Tab");
|
|
|
3449
3543
|
var RibbonCommand = outside("Ribbon.Command", "Ribbon.Group");
|
|
3450
3544
|
var CONFIG_ELEMENTS = /* @__PURE__ */ new Set([RibbonTab, RibbonGroup, RibbonCommand]);
|
|
3451
3545
|
function describe(child) {
|
|
3452
|
-
if (!
|
|
3546
|
+
if (!React25.isValidElement(child)) return JSON.stringify(child);
|
|
3453
3547
|
if (typeof child.type === "string") return `<${child.type}>`;
|
|
3454
3548
|
const type = child.type;
|
|
3455
3549
|
return type?.displayName || type?.name || "a component";
|
|
@@ -3457,13 +3551,13 @@ function describe(child) {
|
|
|
3457
3551
|
function childrenOfType(children, type, what, parent) {
|
|
3458
3552
|
const out = [];
|
|
3459
3553
|
const walk = (nodes, path) => {
|
|
3460
|
-
|
|
3554
|
+
React25.Children.forEach(nodes, (child, i) => {
|
|
3461
3555
|
if (child == null || typeof child === "boolean") return;
|
|
3462
|
-
if (
|
|
3556
|
+
if (React25.isValidElement(child) && child.type === React25.Fragment) {
|
|
3463
3557
|
return walk(child.props.children, `${path}${i}.`);
|
|
3464
3558
|
}
|
|
3465
|
-
if (!
|
|
3466
|
-
const isWrapper =
|
|
3559
|
+
if (!React25.isValidElement(child) || child.type !== type) {
|
|
3560
|
+
const isWrapper = React25.isValidElement(child) && typeof child.type !== "string" && !CONFIG_ELEMENTS.has(child.type);
|
|
3467
3561
|
throw new Error(
|
|
3468
3562
|
`[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
3563
|
);
|
|
@@ -3497,7 +3591,7 @@ function Command({
|
|
|
3497
3591
|
}) {
|
|
3498
3592
|
const size = inBar ? "sm" : command.size ?? "sm";
|
|
3499
3593
|
const isDisabled = command.isDisabled || command.requiresSelection === true && selectionCount === 0;
|
|
3500
|
-
return /* @__PURE__ */
|
|
3594
|
+
return /* @__PURE__ */ jsxs37(
|
|
3501
3595
|
Button3,
|
|
3502
3596
|
{
|
|
3503
3597
|
className: "pire-ribbon-command",
|
|
@@ -3505,8 +3599,8 @@ function Command({
|
|
|
3505
3599
|
isDisabled,
|
|
3506
3600
|
onPress: command.onPress,
|
|
3507
3601
|
children: [
|
|
3508
|
-
command.icon ? /* @__PURE__ */
|
|
3509
|
-
/* @__PURE__ */
|
|
3602
|
+
command.icon ? /* @__PURE__ */ jsx47(Icon, { name: command.icon, size: size === "lg" ? 20 : 16 }) : null,
|
|
3603
|
+
/* @__PURE__ */ jsx47("span", { className: "pire-ribbon-command-label", children: command.label })
|
|
3510
3604
|
]
|
|
3511
3605
|
}
|
|
3512
3606
|
);
|
|
@@ -3514,18 +3608,18 @@ function Command({
|
|
|
3514
3608
|
function Group8({ group, selectionCount }) {
|
|
3515
3609
|
const large = group.commands.filter((c) => (c.size ?? "sm") === "lg");
|
|
3516
3610
|
const small = group.commands.filter((c) => (c.size ?? "sm") !== "lg");
|
|
3517
|
-
return /* @__PURE__ */
|
|
3518
|
-
/* @__PURE__ */
|
|
3519
|
-
large.map((c) => /* @__PURE__ */
|
|
3520
|
-
small.length ? /* @__PURE__ */
|
|
3611
|
+
return /* @__PURE__ */ jsxs37("div", { className: "pire-ribbon-group", role: "group", "aria-label": group.caption, children: [
|
|
3612
|
+
/* @__PURE__ */ jsxs37("div", { className: "pire-ribbon-group-body", children: [
|
|
3613
|
+
large.map((c) => /* @__PURE__ */ jsx47(Command, { command: c, selectionCount }, c.key)),
|
|
3614
|
+
small.length ? /* @__PURE__ */ jsx47("div", { className: "pire-ribbon-stack", children: small.map((c) => /* @__PURE__ */ jsx47(Command, { command: c, selectionCount }, c.key)) }) : null
|
|
3521
3615
|
] }),
|
|
3522
|
-
/* @__PURE__ */
|
|
3616
|
+
/* @__PURE__ */ jsx47("div", { className: "pire-ribbon-caption", "aria-hidden": "true", children: group.caption })
|
|
3523
3617
|
] });
|
|
3524
3618
|
}
|
|
3525
3619
|
function useTrailingOverflow() {
|
|
3526
|
-
const ref =
|
|
3527
|
-
const [overflow, setOverflow] =
|
|
3528
|
-
|
|
3620
|
+
const ref = React25.useRef(null);
|
|
3621
|
+
const [overflow, setOverflow] = React25.useState(false);
|
|
3622
|
+
React25.useEffect(() => {
|
|
3529
3623
|
const node = ref.current;
|
|
3530
3624
|
if (!node) return;
|
|
3531
3625
|
const measure = () => setOverflow(node.scrollLeft + node.clientWidth < node.scrollWidth - 1);
|
|
@@ -3550,9 +3644,9 @@ function Surface({
|
|
|
3550
3644
|
}) {
|
|
3551
3645
|
const [scrollRef, overflow] = useTrailingOverflow();
|
|
3552
3646
|
const domId = id ? { id } : {};
|
|
3553
|
-
return /* @__PURE__ */
|
|
3554
|
-
/* @__PURE__ */
|
|
3555
|
-
/* @__PURE__ */
|
|
3647
|
+
return /* @__PURE__ */ jsxs37(Toolbar, { ...domId, className, "aria-label": label, children: [
|
|
3648
|
+
/* @__PURE__ */ jsx47("div", { className: "pire-ribbon-scroll", ref: scrollRef, children }),
|
|
3649
|
+
/* @__PURE__ */ jsx47("div", { className: "pire-ribbon-trail", "data-overflow": overflow ? "true" : void 0, children: trailing })
|
|
3556
3650
|
] });
|
|
3557
3651
|
}
|
|
3558
3652
|
function barBlocks(tabs) {
|
|
@@ -3585,18 +3679,18 @@ function Ribbon({
|
|
|
3585
3679
|
const count = selectionCount ?? 0;
|
|
3586
3680
|
const visible = tabs.filter((tab) => !tab.isContextual || count > 0);
|
|
3587
3681
|
const fallback = visible[0]?.id;
|
|
3588
|
-
const [ownTab, setOwnTab] =
|
|
3682
|
+
const [ownTab, setOwnTab] = React25.useState(defaultValue);
|
|
3589
3683
|
const requested = value ?? ownTab;
|
|
3590
3684
|
const selected = visible.some((tab) => tab.id === requested) ? requested : fallback;
|
|
3591
|
-
const select =
|
|
3685
|
+
const select = React25.useCallback(
|
|
3592
3686
|
(id) => {
|
|
3593
3687
|
setOwnTab(id);
|
|
3594
3688
|
onChange?.(id);
|
|
3595
3689
|
},
|
|
3596
3690
|
[onChange]
|
|
3597
3691
|
);
|
|
3598
|
-
const hadSelection =
|
|
3599
|
-
|
|
3692
|
+
const hadSelection = React25.useRef(false);
|
|
3693
|
+
React25.useEffect(() => {
|
|
3600
3694
|
const has = count > 0;
|
|
3601
3695
|
if (has === hadSelection.current) return;
|
|
3602
3696
|
hadSelection.current = has;
|
|
@@ -3605,17 +3699,17 @@ function Ribbon({
|
|
|
3605
3699
|
if (has) select(contextual.id);
|
|
3606
3700
|
else if (requested === contextual.id) select(tabs.find((tab) => !tab.isContextual)?.id ?? "");
|
|
3607
3701
|
}, [count, tabs, requested, select]);
|
|
3608
|
-
const [ownCollapsed, setOwnCollapsed] =
|
|
3702
|
+
const [ownCollapsed, setOwnCollapsed] = React25.useState(false);
|
|
3609
3703
|
const collapsed = isCollapsed ?? ownCollapsed;
|
|
3610
|
-
const toggleRef =
|
|
3611
|
-
const restoreFocus =
|
|
3612
|
-
|
|
3704
|
+
const toggleRef = React25.useRef(null);
|
|
3705
|
+
const restoreFocus = React25.useRef(false);
|
|
3706
|
+
React25.useLayoutEffect(() => {
|
|
3613
3707
|
if (!restoreFocus.current) return;
|
|
3614
3708
|
restoreFocus.current = false;
|
|
3615
3709
|
toggleRef.current?.focus();
|
|
3616
3710
|
});
|
|
3617
|
-
const bandId =
|
|
3618
|
-
const toggle = /* @__PURE__ */
|
|
3711
|
+
const bandId = React25.useId();
|
|
3712
|
+
const toggle = /* @__PURE__ */ jsx47(
|
|
3619
3713
|
Button3,
|
|
3620
3714
|
{
|
|
3621
3715
|
ref: toggleRef,
|
|
@@ -3628,32 +3722,32 @@ function Ribbon({
|
|
|
3628
3722
|
setOwnCollapsed(!collapsed);
|
|
3629
3723
|
onCollapsedChange?.(!collapsed);
|
|
3630
3724
|
},
|
|
3631
|
-
children: /* @__PURE__ */
|
|
3725
|
+
children: /* @__PURE__ */ jsx47(Icon, { name: collapsed ? "chevron-down" : "chevron-up", size: 16 })
|
|
3632
3726
|
}
|
|
3633
3727
|
);
|
|
3634
3728
|
if (collapsed) {
|
|
3635
3729
|
const blocks = barBlocks(tabs);
|
|
3636
|
-
return /* @__PURE__ */
|
|
3730
|
+
return /* @__PURE__ */ jsx47("div", { className: cx("pire-ribbon", className), style, children: /* @__PURE__ */ jsxs37(
|
|
3637
3731
|
Surface,
|
|
3638
3732
|
{
|
|
3639
3733
|
className: "pire-ribbon-bar",
|
|
3640
3734
|
label: rest["aria-label"],
|
|
3641
|
-
trailing: /* @__PURE__ */
|
|
3735
|
+
trailing: /* @__PURE__ */ jsxs37(Fragment6, { children: [
|
|
3642
3736
|
actions,
|
|
3643
3737
|
toggle
|
|
3644
3738
|
] }),
|
|
3645
3739
|
children: [
|
|
3646
|
-
leading ? /* @__PURE__ */
|
|
3647
|
-
blocks.map((block, i) => /* @__PURE__ */
|
|
3648
|
-
i > 0 || leading ? /* @__PURE__ */
|
|
3649
|
-
block.commands.map((c) => /* @__PURE__ */
|
|
3740
|
+
leading ? /* @__PURE__ */ jsx47("div", { className: "pire-ribbon-leading", children: leading }) : null,
|
|
3741
|
+
blocks.map((block, i) => /* @__PURE__ */ jsxs37(React25.Fragment, { children: [
|
|
3742
|
+
i > 0 || leading ? /* @__PURE__ */ jsx47("span", { className: "pire-ribbon-bar-sep" }) : null,
|
|
3743
|
+
block.commands.map((c) => /* @__PURE__ */ jsx47(Command, { command: c, selectionCount: count, inBar: true }, c.key))
|
|
3650
3744
|
] }, block.key))
|
|
3651
3745
|
]
|
|
3652
3746
|
}
|
|
3653
3747
|
) });
|
|
3654
3748
|
}
|
|
3655
|
-
return /* @__PURE__ */
|
|
3656
|
-
/* @__PURE__ */
|
|
3749
|
+
return /* @__PURE__ */ jsx47("div", { className: cx("pire-ribbon", className), style, children: /* @__PURE__ */ jsxs37(AriaTabs2, { selectedKey: selected, onSelectionChange: (k) => select(String(k)), children: [
|
|
3750
|
+
/* @__PURE__ */ jsx47(TabList2, { className: "pire-ribbon-tablist", "aria-label": rest["aria-label"], children: visible.map((tab) => /* @__PURE__ */ jsx47(
|
|
3657
3751
|
AriaTab2,
|
|
3658
3752
|
{
|
|
3659
3753
|
id: tab.id,
|
|
@@ -3663,17 +3757,17 @@ function Ribbon({
|
|
|
3663
3757
|
},
|
|
3664
3758
|
tab.key
|
|
3665
3759
|
)) }),
|
|
3666
|
-
visible.map((tab) => /* @__PURE__ */
|
|
3760
|
+
visible.map((tab) => /* @__PURE__ */ jsx47(TabPanel2, { id: tab.id, className: "pire-ribbon-panel", children: /* @__PURE__ */ jsx47(
|
|
3667
3761
|
Surface,
|
|
3668
3762
|
{
|
|
3669
3763
|
id: bandId,
|
|
3670
3764
|
className: "pire-ribbon-band",
|
|
3671
3765
|
label: msg.ribbonLabel,
|
|
3672
|
-
trailing: /* @__PURE__ */
|
|
3766
|
+
trailing: /* @__PURE__ */ jsxs37(Fragment6, { children: [
|
|
3673
3767
|
actions,
|
|
3674
3768
|
toggle
|
|
3675
3769
|
] }),
|
|
3676
|
-
children: tab.groups.map((group) => /* @__PURE__ */
|
|
3770
|
+
children: tab.groups.map((group) => /* @__PURE__ */ jsx47(Group8, { group, selectionCount: count }, group.key))
|
|
3677
3771
|
}
|
|
3678
3772
|
) }, tab.key))
|
|
3679
3773
|
] }) });
|
|
@@ -3683,7 +3777,7 @@ Ribbon.Group = RibbonGroup;
|
|
|
3683
3777
|
Ribbon.Command = RibbonCommand;
|
|
3684
3778
|
|
|
3685
3779
|
// src/components/feedback/InlineMessage.tsx
|
|
3686
|
-
import { jsx as
|
|
3780
|
+
import { jsx as jsx48, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
3687
3781
|
var KIND_ICON = {
|
|
3688
3782
|
info: "info",
|
|
3689
3783
|
success: "check-circle-2",
|
|
@@ -3701,7 +3795,7 @@ function InlineMessage({
|
|
|
3701
3795
|
}) {
|
|
3702
3796
|
const msg = usePireMessages();
|
|
3703
3797
|
const assertive = kind === "error" || kind === "warning";
|
|
3704
|
-
return /* @__PURE__ */
|
|
3798
|
+
return /* @__PURE__ */ jsxs38(
|
|
3705
3799
|
"div",
|
|
3706
3800
|
{
|
|
3707
3801
|
className: cx("pire-msg", className),
|
|
@@ -3710,21 +3804,21 @@ function InlineMessage({
|
|
|
3710
3804
|
"aria-live": assertive ? "assertive" : "polite",
|
|
3711
3805
|
...rest,
|
|
3712
3806
|
children: [
|
|
3713
|
-
/* @__PURE__ */
|
|
3714
|
-
/* @__PURE__ */
|
|
3715
|
-
title ? /* @__PURE__ */
|
|
3716
|
-
children ? /* @__PURE__ */
|
|
3807
|
+
/* @__PURE__ */ jsx48(Icon, { name: KIND_ICON[kind], size: 16, style: { marginTop: 2 } }),
|
|
3808
|
+
/* @__PURE__ */ jsxs38("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "var(--sp-1)" }, children: [
|
|
3809
|
+
title ? /* @__PURE__ */ jsx48("span", { className: "pire-msg-title", children: title }) : null,
|
|
3810
|
+
children ? /* @__PURE__ */ jsx48("span", { className: "pire-msg-body", children }) : null,
|
|
3717
3811
|
action
|
|
3718
3812
|
] }),
|
|
3719
|
-
onClose ? /* @__PURE__ */
|
|
3813
|
+
onClose ? /* @__PURE__ */ jsx48(IconButton, { icon: "x", label: msg.inlineMessageDismiss, size: "sm", onPress: onClose }) : null
|
|
3720
3814
|
]
|
|
3721
3815
|
}
|
|
3722
3816
|
);
|
|
3723
3817
|
}
|
|
3724
3818
|
|
|
3725
3819
|
// src/components/feedback/Toast.tsx
|
|
3726
|
-
import * as
|
|
3727
|
-
import { jsx as
|
|
3820
|
+
import * as React26 from "react";
|
|
3821
|
+
import { jsx as jsx49, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3728
3822
|
var KIND_ICON2 = {
|
|
3729
3823
|
info: "info",
|
|
3730
3824
|
success: "check-circle-2",
|
|
@@ -3740,7 +3834,7 @@ function Toast({
|
|
|
3740
3834
|
...rest
|
|
3741
3835
|
}) {
|
|
3742
3836
|
const msg = usePireMessages();
|
|
3743
|
-
return /* @__PURE__ */
|
|
3837
|
+
return /* @__PURE__ */ jsxs39(
|
|
3744
3838
|
"div",
|
|
3745
3839
|
{
|
|
3746
3840
|
className: cx("pire-toast", className),
|
|
@@ -3749,22 +3843,22 @@ function Toast({
|
|
|
3749
3843
|
"aria-live": kind === "error" ? "assertive" : "polite",
|
|
3750
3844
|
...rest,
|
|
3751
3845
|
children: [
|
|
3752
|
-
/* @__PURE__ */
|
|
3753
|
-
/* @__PURE__ */
|
|
3754
|
-
onClose ? /* @__PURE__ */
|
|
3846
|
+
/* @__PURE__ */ jsx49(Icon, { name: KIND_ICON2[kind], size: 16 }),
|
|
3847
|
+
/* @__PURE__ */ jsx49("span", { style: { flex: 1 }, children }),
|
|
3848
|
+
onClose ? /* @__PURE__ */ jsx49(IconButton, { icon: "x", label: msg.toastDismiss, size: "sm", variant: "inverse", onPress: onClose }) : null
|
|
3755
3849
|
]
|
|
3756
3850
|
}
|
|
3757
3851
|
);
|
|
3758
3852
|
}
|
|
3759
|
-
var ToastContext =
|
|
3853
|
+
var ToastContext = React26.createContext(null);
|
|
3760
3854
|
function ToastProvider({
|
|
3761
3855
|
children,
|
|
3762
3856
|
timeout = 6e3
|
|
3763
3857
|
}) {
|
|
3764
3858
|
const msg = usePireMessages();
|
|
3765
|
-
const [toasts, setToasts] =
|
|
3766
|
-
const close =
|
|
3767
|
-
const add =
|
|
3859
|
+
const [toasts, setToasts] = React26.useState([]);
|
|
3860
|
+
const close = React26.useCallback((id) => setToasts((t) => t.filter((x) => x.id !== id)), []);
|
|
3861
|
+
const add = React26.useCallback(
|
|
3768
3862
|
(toast) => {
|
|
3769
3863
|
const id = Math.random().toString(36).slice(2);
|
|
3770
3864
|
setToasts((t) => [...t, { ...toast, id }]);
|
|
@@ -3774,10 +3868,10 @@ function ToastProvider({
|
|
|
3774
3868
|
},
|
|
3775
3869
|
[close, timeout]
|
|
3776
3870
|
);
|
|
3777
|
-
const value =
|
|
3778
|
-
return /* @__PURE__ */
|
|
3871
|
+
const value = React26.useMemo(() => ({ add, close }), [add, close]);
|
|
3872
|
+
return /* @__PURE__ */ jsxs39(ToastContext.Provider, { value, children: [
|
|
3779
3873
|
children,
|
|
3780
|
-
/* @__PURE__ */
|
|
3874
|
+
/* @__PURE__ */ jsx49("div", { className: "pire-toast-region", role: "region", "aria-label": msg.toastRegionLabel, children: toasts.map((t) => /* @__PURE__ */ jsx49(
|
|
3781
3875
|
Toast,
|
|
3782
3876
|
{
|
|
3783
3877
|
kind: t.kind,
|
|
@@ -3790,14 +3884,14 @@ function ToastProvider({
|
|
|
3790
3884
|
] });
|
|
3791
3885
|
}
|
|
3792
3886
|
function useToast() {
|
|
3793
|
-
const ctx =
|
|
3887
|
+
const ctx = React26.useContext(ToastContext);
|
|
3794
3888
|
if (!ctx) throw new Error("useToast must be used inside <ToastProvider>");
|
|
3795
3889
|
return ctx;
|
|
3796
3890
|
}
|
|
3797
3891
|
|
|
3798
3892
|
// src/components/data/KpiTile.tsx
|
|
3799
3893
|
import { Button as AriaButton14 } from "react-aria-components";
|
|
3800
|
-
import { Fragment as Fragment7, jsx as
|
|
3894
|
+
import { Fragment as Fragment7, jsx as jsx50, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
3801
3895
|
function KpiTile({
|
|
3802
3896
|
label,
|
|
3803
3897
|
value,
|
|
@@ -3813,27 +3907,27 @@ function KpiTile({
|
|
|
3813
3907
|
style
|
|
3814
3908
|
}) {
|
|
3815
3909
|
const tone = deltaTone ?? (deltaDirection === "down" ? "negative" : "positive");
|
|
3816
|
-
const body = /* @__PURE__ */
|
|
3817
|
-
/* @__PURE__ */
|
|
3818
|
-
icon ? /* @__PURE__ */
|
|
3910
|
+
const body = /* @__PURE__ */ jsxs40(Fragment7, { children: [
|
|
3911
|
+
/* @__PURE__ */ jsxs40("span", { className: "pire-kpi-label", children: [
|
|
3912
|
+
icon ? /* @__PURE__ */ jsx50(Icon, { name: icon, size: 16 }) : null,
|
|
3819
3913
|
label
|
|
3820
3914
|
] }),
|
|
3821
|
-
/* @__PURE__ */
|
|
3915
|
+
/* @__PURE__ */ jsxs40("span", { className: "pire-kpi-value", children: [
|
|
3822
3916
|
value,
|
|
3823
|
-
unit ? /* @__PURE__ */
|
|
3917
|
+
unit ? /* @__PURE__ */ jsx50("span", { className: "pire-kpi-unit", children: unit }) : null
|
|
3824
3918
|
] }),
|
|
3825
|
-
delta ? /* @__PURE__ */
|
|
3826
|
-
deltaDirection ? /* @__PURE__ */
|
|
3919
|
+
delta ? /* @__PURE__ */ jsxs40("span", { className: "pire-kpi-delta", "data-tone": tone, children: [
|
|
3920
|
+
deltaDirection ? /* @__PURE__ */ jsx50(Icon, { name: deltaDirection === "up" ? "trending-up" : "trending-down", size: 12 }) : null,
|
|
3827
3921
|
delta
|
|
3828
3922
|
] }) : null,
|
|
3829
|
-
footnote ? /* @__PURE__ */
|
|
3923
|
+
footnote ? /* @__PURE__ */ jsx50("span", { className: "pire-kpi-foot", children: footnote }) : null
|
|
3830
3924
|
] });
|
|
3831
3925
|
const props = { className: cx("pire-kpi", className), "data-status": status, style };
|
|
3832
|
-
return onPress ? /* @__PURE__ */
|
|
3926
|
+
return onPress ? /* @__PURE__ */ jsx50(AriaButton14, { ...props, "data-pressable": "true", onPress, children: body }) : /* @__PURE__ */ jsx50("div", { ...props, children: body });
|
|
3833
3927
|
}
|
|
3834
3928
|
|
|
3835
3929
|
// src/components/data/ObjectHeader.tsx
|
|
3836
|
-
import { jsx as
|
|
3930
|
+
import { jsx as jsx51, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
3837
3931
|
function ObjectHeader({
|
|
3838
3932
|
title,
|
|
3839
3933
|
subtitle,
|
|
@@ -3845,22 +3939,22 @@ function ObjectHeader({
|
|
|
3845
3939
|
className,
|
|
3846
3940
|
...rest
|
|
3847
3941
|
}) {
|
|
3848
|
-
return /* @__PURE__ */
|
|
3942
|
+
return /* @__PURE__ */ jsxs41("header", { className: cx("pire-objheader", className), ...rest, children: [
|
|
3849
3943
|
breadcrumb,
|
|
3850
|
-
/* @__PURE__ */
|
|
3851
|
-
/* @__PURE__ */
|
|
3852
|
-
/* @__PURE__ */
|
|
3853
|
-
subtitle || id ? /* @__PURE__ */
|
|
3944
|
+
/* @__PURE__ */ jsxs41("div", { className: "pire-objheader-row", children: [
|
|
3945
|
+
/* @__PURE__ */ jsxs41("div", { style: { minWidth: 0 }, children: [
|
|
3946
|
+
/* @__PURE__ */ jsx51("h1", { className: "pire-objheader-title", children: title }),
|
|
3947
|
+
subtitle || id ? /* @__PURE__ */ jsxs41("div", { className: "pire-objheader-sub", children: [
|
|
3854
3948
|
subtitle,
|
|
3855
|
-
id ? /* @__PURE__ */
|
|
3949
|
+
id ? /* @__PURE__ */ jsx51("span", { className: "pire-objheader-id", children: id }) : null
|
|
3856
3950
|
] }) : null
|
|
3857
3951
|
] }),
|
|
3858
3952
|
badge,
|
|
3859
|
-
actions ? /* @__PURE__ */
|
|
3953
|
+
actions ? /* @__PURE__ */ jsx51("div", { className: "pire-objheader-actions", children: actions }) : null
|
|
3860
3954
|
] }),
|
|
3861
|
-
facts?.length ? /* @__PURE__ */
|
|
3862
|
-
/* @__PURE__ */
|
|
3863
|
-
/* @__PURE__ */
|
|
3955
|
+
facts?.length ? /* @__PURE__ */ jsx51("dl", { className: "pire-facts", style: { margin: 0 }, children: facts.map((fact) => /* @__PURE__ */ jsxs41("div", { children: [
|
|
3956
|
+
/* @__PURE__ */ jsx51("dt", { className: "pire-fact-label", children: fact.label }),
|
|
3957
|
+
/* @__PURE__ */ jsx51(
|
|
3864
3958
|
"dd",
|
|
3865
3959
|
{
|
|
3866
3960
|
className: "pire-fact-value",
|
|
@@ -3874,7 +3968,7 @@ function ObjectHeader({
|
|
|
3874
3968
|
}
|
|
3875
3969
|
|
|
3876
3970
|
// src/components/data/FilterBar.tsx
|
|
3877
|
-
import { jsx as
|
|
3971
|
+
import { jsx as jsx52, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
3878
3972
|
function FilterBar({
|
|
3879
3973
|
children,
|
|
3880
3974
|
activeFilters = [],
|
|
@@ -3891,22 +3985,22 @@ function FilterBar({
|
|
|
3891
3985
|
const label = useMessage("filterBarLabel", rest["aria-label"]);
|
|
3892
3986
|
const go = useMessage("filterBarGo", goLabel);
|
|
3893
3987
|
const clearAll = useMessage("filterBarClearAll", clearAllLabel);
|
|
3894
|
-
return /* @__PURE__ */
|
|
3895
|
-
/* @__PURE__ */
|
|
3988
|
+
return /* @__PURE__ */ jsxs42("section", { className: cx("pire-filterbar", className), ...rest, "aria-label": label, children: [
|
|
3989
|
+
/* @__PURE__ */ jsxs42("div", { className: "pire-filterbar-controls", children: [
|
|
3896
3990
|
children,
|
|
3897
|
-
onGo ? /* @__PURE__ */
|
|
3991
|
+
onGo ? /* @__PURE__ */ jsx52(Button, { variant: "primary", onPress: onGo, children: go }) : null
|
|
3898
3992
|
] }),
|
|
3899
|
-
activeFilters.length || resultLabel || actions ? /* @__PURE__ */
|
|
3900
|
-
activeFilters.map((filter) => /* @__PURE__ */
|
|
3901
|
-
activeFilters.length && onClear ? /* @__PURE__ */
|
|
3902
|
-
resultLabel ? /* @__PURE__ */
|
|
3903
|
-
actions ? /* @__PURE__ */
|
|
3993
|
+
activeFilters.length || resultLabel || actions ? /* @__PURE__ */ jsxs42("div", { className: "pire-filterbar-foot", children: [
|
|
3994
|
+
activeFilters.map((filter) => /* @__PURE__ */ jsx52(Tag, { onRemove: onRemoveFilter ? () => onRemoveFilter(filter.id) : void 0, children: filter.label }, filter.id)),
|
|
3995
|
+
activeFilters.length && onClear ? /* @__PURE__ */ jsx52(Button, { variant: "tertiary", size: "sm", onPress: onClear, children: clearAll }) : null,
|
|
3996
|
+
resultLabel ? /* @__PURE__ */ jsx52("span", { className: "pire-filterbar-result", "aria-live": "polite", children: resultLabel }) : null,
|
|
3997
|
+
actions ? /* @__PURE__ */ jsx52("div", { className: "pire-filterbar-actions", children: actions }) : null
|
|
3904
3998
|
] }) : null
|
|
3905
3999
|
] });
|
|
3906
4000
|
}
|
|
3907
4001
|
|
|
3908
4002
|
// src/components/data/DescriptionList.tsx
|
|
3909
|
-
import { jsx as
|
|
4003
|
+
import { jsx as jsx53, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
3910
4004
|
function DescriptionList({
|
|
3911
4005
|
items,
|
|
3912
4006
|
layout = "rows",
|
|
@@ -3915,32 +4009,32 @@ function DescriptionList({
|
|
|
3915
4009
|
style,
|
|
3916
4010
|
...rest
|
|
3917
4011
|
}) {
|
|
3918
|
-
return /* @__PURE__ */
|
|
4012
|
+
return /* @__PURE__ */ jsx53(
|
|
3919
4013
|
"dl",
|
|
3920
4014
|
{
|
|
3921
4015
|
className: cx("pire-dl", className),
|
|
3922
4016
|
"data-layout": layout,
|
|
3923
4017
|
style: { ...layout === "grid" ? { "--pire-dl-cols": columns } : null, ...style },
|
|
3924
4018
|
...rest,
|
|
3925
|
-
children: items.map((item, i) => /* @__PURE__ */
|
|
3926
|
-
/* @__PURE__ */
|
|
4019
|
+
children: items.map((item, i) => /* @__PURE__ */ jsxs43("div", { className: "pire-dl-row", "data-emphasis": item.emphasis ? "true" : void 0, children: [
|
|
4020
|
+
/* @__PURE__ */ jsxs43("dt", { className: "pire-dl-term", children: [
|
|
3927
4021
|
item.label,
|
|
3928
4022
|
item.hint
|
|
3929
4023
|
] }),
|
|
3930
|
-
/* @__PURE__ */
|
|
4024
|
+
/* @__PURE__ */ jsx53("dd", { className: "pire-dl-value", "data-numeric": item.numeric ? "true" : void 0, children: item.value })
|
|
3931
4025
|
] }, i))
|
|
3932
4026
|
}
|
|
3933
4027
|
);
|
|
3934
4028
|
}
|
|
3935
4029
|
|
|
3936
4030
|
// src/components/data/Timeline.tsx
|
|
3937
|
-
import { jsx as
|
|
4031
|
+
import { jsx as jsx54, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
3938
4032
|
function Timeline({ entries, reverse = false, className, ...rest }) {
|
|
3939
4033
|
const list = reverse ? [...entries].reverse() : entries;
|
|
3940
|
-
return /* @__PURE__ */
|
|
3941
|
-
/* @__PURE__ */
|
|
3942
|
-
/* @__PURE__ */
|
|
3943
|
-
entry.actor ? /* @__PURE__ */
|
|
4034
|
+
return /* @__PURE__ */ jsx54("ol", { className: cx("pire-timeline", className), ...rest, children: list.map((entry, i) => /* @__PURE__ */ jsxs44("li", { className: "pire-timeline-item", children: [
|
|
4035
|
+
/* @__PURE__ */ jsx54("span", { className: "pire-timeline-time", children: entry.time }),
|
|
4036
|
+
/* @__PURE__ */ jsx54("span", { className: "pire-timeline-text", children: entry.event }),
|
|
4037
|
+
entry.actor ? /* @__PURE__ */ jsx54("span", { className: "pire-timeline-actor", children: entry.actor }) : null
|
|
3944
4038
|
] }, entry.id ?? i)) });
|
|
3945
4039
|
}
|
|
3946
4040
|
|
|
@@ -3983,10 +4077,10 @@ function seriesColor(series, index) {
|
|
|
3983
4077
|
const slot = series.colorIndex ?? index + 1;
|
|
3984
4078
|
return slot >= 1 && slot <= VIZ_SLOT_COUNT ? `var(--viz-${slot})` : "var(--viz-other)";
|
|
3985
4079
|
}
|
|
3986
|
-
var
|
|
4080
|
+
var IS_DEV4 = process.env.NODE_ENV !== "production";
|
|
3987
4081
|
var warnedCharts = /* @__PURE__ */ new Set();
|
|
3988
4082
|
function warnOnSlotOverflow(series, chartLabel) {
|
|
3989
|
-
if (!
|
|
4083
|
+
if (!IS_DEV4 || warnedCharts.has(chartLabel)) return;
|
|
3990
4084
|
if (series.length <= VIZ_SLOT_COUNT) return;
|
|
3991
4085
|
warnedCharts.add(chartLabel);
|
|
3992
4086
|
console.warn(
|
|
@@ -3994,7 +4088,7 @@ function warnOnSlotOverflow(series, chartLabel) {
|
|
|
3994
4088
|
);
|
|
3995
4089
|
}
|
|
3996
4090
|
function warnOnDonutShape(series, categoryCount, chartLabel) {
|
|
3997
|
-
if (!
|
|
4091
|
+
if (!IS_DEV4 || warnedCharts.has(`donut:${chartLabel}`)) return;
|
|
3998
4092
|
const complaints = [];
|
|
3999
4093
|
if (series.length > 1) {
|
|
4000
4094
|
complaints.push(`it has ${series.length} series but a donut draws one \u2014 the rest are ignored`);
|
|
@@ -4026,7 +4120,7 @@ function alignToCategories(series, categoryCount) {
|
|
|
4026
4120
|
}
|
|
4027
4121
|
|
|
4028
4122
|
// src/components/data/ChartFrame.tsx
|
|
4029
|
-
import { jsx as
|
|
4123
|
+
import { jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
4030
4124
|
function seriesLegend(series) {
|
|
4031
4125
|
return series.map((one, index) => ({
|
|
4032
4126
|
key: one.id,
|
|
@@ -4049,29 +4143,29 @@ function ChartFrame({
|
|
|
4049
4143
|
children
|
|
4050
4144
|
}) {
|
|
4051
4145
|
const msg = usePireMessages();
|
|
4052
|
-
return /* @__PURE__ */
|
|
4053
|
-
title || description ? /* @__PURE__ */
|
|
4054
|
-
title ? /* @__PURE__ */
|
|
4055
|
-
description ? /* @__PURE__ */
|
|
4146
|
+
return /* @__PURE__ */ jsxs45("figure", { className: cx("pire-chart", className), style, children: [
|
|
4147
|
+
title || description ? /* @__PURE__ */ jsxs45("figcaption", { className: "pire-chart-head", children: [
|
|
4148
|
+
title ? /* @__PURE__ */ jsx55("span", { className: "pire-chart-title", children: title }) : null,
|
|
4149
|
+
description ? /* @__PURE__ */ jsx55("span", { className: "pire-chart-desc", children: description }) : null
|
|
4056
4150
|
] }) : null,
|
|
4057
|
-
legend && legend.length > 1 ? /* @__PURE__ */
|
|
4058
|
-
/* @__PURE__ */
|
|
4151
|
+
legend && legend.length > 1 ? /* @__PURE__ */ jsx55("ul", { className: "pire-chart-legend", children: legend.map((item) => /* @__PURE__ */ jsxs45("li", { className: "pire-chart-legend-item", children: [
|
|
4152
|
+
/* @__PURE__ */ jsx55("span", { className: "pire-chart-swatch", style: { background: item.color } }),
|
|
4059
4153
|
item.label
|
|
4060
4154
|
] }, item.key)) }) : null,
|
|
4061
|
-
/* @__PURE__ */
|
|
4062
|
-
/* @__PURE__ */
|
|
4063
|
-
/* @__PURE__ */
|
|
4064
|
-
/* @__PURE__ */
|
|
4065
|
-
/* @__PURE__ */
|
|
4066
|
-
series.map((one) => /* @__PURE__ */
|
|
4155
|
+
/* @__PURE__ */ jsx55("div", { className: "pire-chart-plot", "aria-hidden": "true", children }),
|
|
4156
|
+
/* @__PURE__ */ jsx55("div", { className: showDataTable ? "pire-chart-table" : "pire-sr-only", children: /* @__PURE__ */ jsxs45("table", { children: [
|
|
4157
|
+
/* @__PURE__ */ jsx55("caption", { children: label }),
|
|
4158
|
+
/* @__PURE__ */ jsx55("thead", { children: /* @__PURE__ */ jsxs45("tr", { children: [
|
|
4159
|
+
/* @__PURE__ */ jsx55("th", { scope: "col", children: msg.chartCategoryHeader }),
|
|
4160
|
+
series.map((one) => /* @__PURE__ */ jsx55("th", { scope: "col", children: one.label }, one.id))
|
|
4067
4161
|
] }) }),
|
|
4068
|
-
/* @__PURE__ */
|
|
4162
|
+
/* @__PURE__ */ jsx55("tbody", { children: categories.map((category, categoryIndex) => (
|
|
4069
4163
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
4070
|
-
/* @__PURE__ */
|
|
4071
|
-
/* @__PURE__ */
|
|
4164
|
+
/* @__PURE__ */ jsxs45("tr", { children: [
|
|
4165
|
+
/* @__PURE__ */ jsx55("th", { scope: "row", children: category }),
|
|
4072
4166
|
series.map((one) => {
|
|
4073
4167
|
const value = one.values[categoryIndex];
|
|
4074
|
-
return /* @__PURE__ */
|
|
4168
|
+
return /* @__PURE__ */ jsx55("td", { children: value == null ? msg.chartNoValue : formatValue(value) }, one.id);
|
|
4075
4169
|
})
|
|
4076
4170
|
] }, categoryIndex)
|
|
4077
4171
|
)) })
|
|
@@ -4080,7 +4174,7 @@ function ChartFrame({
|
|
|
4080
4174
|
}
|
|
4081
4175
|
|
|
4082
4176
|
// src/components/data/BarChart.tsx
|
|
4083
|
-
import { jsx as
|
|
4177
|
+
import { jsx as jsx56, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
4084
4178
|
function BarChart({
|
|
4085
4179
|
categories,
|
|
4086
4180
|
series: rawSeries,
|
|
@@ -4112,7 +4206,7 @@ function BarChart({
|
|
|
4112
4206
|
const value = series[0].values[categoryIndex];
|
|
4113
4207
|
return value == null ? msg.chartNoValue : formatValue(value);
|
|
4114
4208
|
};
|
|
4115
|
-
return /* @__PURE__ */
|
|
4209
|
+
return /* @__PURE__ */ jsx56(
|
|
4116
4210
|
ChartFrame,
|
|
4117
4211
|
{
|
|
4118
4212
|
label,
|
|
@@ -4125,7 +4219,7 @@ function BarChart({
|
|
|
4125
4219
|
showDataTable,
|
|
4126
4220
|
className,
|
|
4127
4221
|
style,
|
|
4128
|
-
children: !hasData ? /* @__PURE__ */
|
|
4222
|
+
children: !hasData ? /* @__PURE__ */ jsx56("div", { className: "pire-chart-empty", children: emptyState ?? msg.chartEmpty }) : /* @__PURE__ */ jsx56(
|
|
4129
4223
|
"div",
|
|
4130
4224
|
{
|
|
4131
4225
|
className: "pire-chart-bars",
|
|
@@ -4134,12 +4228,12 @@ function BarChart({
|
|
|
4134
4228
|
style: { "--pire-chart-height": `${height}px` },
|
|
4135
4229
|
children: categories.map((category, categoryIndex) => (
|
|
4136
4230
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
4137
|
-
/* @__PURE__ */
|
|
4138
|
-
/* @__PURE__ */
|
|
4139
|
-
/* @__PURE__ */
|
|
4231
|
+
/* @__PURE__ */ jsxs46("div", { className: "pire-chart-group", children: [
|
|
4232
|
+
/* @__PURE__ */ jsx56("span", { className: "pire-chart-cat", children: category }),
|
|
4233
|
+
/* @__PURE__ */ jsx56("div", { className: "pire-chart-track", children: series.map((one, seriesIndex) => {
|
|
4140
4234
|
const value = one.values[categoryIndex];
|
|
4141
4235
|
if (value == null) return null;
|
|
4142
|
-
return /* @__PURE__ */
|
|
4236
|
+
return /* @__PURE__ */ jsxs46(
|
|
4143
4237
|
"div",
|
|
4144
4238
|
{
|
|
4145
4239
|
className: "pire-chart-bar",
|
|
@@ -4148,8 +4242,8 @@ function BarChart({
|
|
|
4148
4242
|
"--pire-bar-color": seriesColor(one, seriesIndex)
|
|
4149
4243
|
},
|
|
4150
4244
|
children: [
|
|
4151
|
-
withValues && orientation === "vertical" ? /* @__PURE__ */
|
|
4152
|
-
/* @__PURE__ */
|
|
4245
|
+
withValues && orientation === "vertical" ? /* @__PURE__ */ jsx56("span", { className: "pire-chart-barval", children: formatValue(value) }) : null,
|
|
4246
|
+
/* @__PURE__ */ jsxs46("span", { className: "pire-chart-tip", role: "presentation", children: [
|
|
4153
4247
|
series.length > 1 ? `${one.label}: ` : "",
|
|
4154
4248
|
formatValue(value)
|
|
4155
4249
|
] })
|
|
@@ -4158,7 +4252,7 @@ function BarChart({
|
|
|
4158
4252
|
one.id
|
|
4159
4253
|
);
|
|
4160
4254
|
}) }),
|
|
4161
|
-
withValues && orientation === "horizontal" ? /* @__PURE__ */
|
|
4255
|
+
withValues && orientation === "horizontal" ? /* @__PURE__ */ jsx56("span", { className: "pire-chart-val", children: horizontalLabelFor(categoryIndex) }) : null
|
|
4162
4256
|
] }, categoryIndex)
|
|
4163
4257
|
))
|
|
4164
4258
|
}
|
|
@@ -4168,14 +4262,14 @@ function BarChart({
|
|
|
4168
4262
|
}
|
|
4169
4263
|
|
|
4170
4264
|
// src/components/data/LineChart.tsx
|
|
4171
|
-
import * as
|
|
4172
|
-
import { jsx as
|
|
4265
|
+
import * as React27 from "react";
|
|
4266
|
+
import { jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
4173
4267
|
var PLOT_INSET = { top: 10, right: 14, bottom: 24, left: 58 };
|
|
4174
4268
|
var MARKER_LIMIT = 20;
|
|
4175
|
-
var useIsomorphicLayoutEffect2 = typeof window === "undefined" ?
|
|
4269
|
+
var useIsomorphicLayoutEffect2 = typeof window === "undefined" ? React27.useEffect : React27.useLayoutEffect;
|
|
4176
4270
|
function useMeasuredWidth() {
|
|
4177
|
-
const ref =
|
|
4178
|
-
const [width, setWidth] =
|
|
4271
|
+
const ref = React27.useRef(null);
|
|
4272
|
+
const [width, setWidth] = React27.useState(0);
|
|
4179
4273
|
useIsomorphicLayoutEffect2(() => {
|
|
4180
4274
|
const element = ref.current;
|
|
4181
4275
|
if (!element) return;
|
|
@@ -4236,7 +4330,7 @@ function LineChart({
|
|
|
4236
4330
|
return `M${xAt(present[0].index)} ${baseline} L${line} L${xAt(last.index)} ${baseline} Z`;
|
|
4237
4331
|
};
|
|
4238
4332
|
const labelEvery = Math.max(1, Math.ceil(categories.length / Math.max(2, Math.floor(innerWidth / 64))));
|
|
4239
|
-
return /* @__PURE__ */
|
|
4333
|
+
return /* @__PURE__ */ jsx57(
|
|
4240
4334
|
ChartFrame,
|
|
4241
4335
|
{
|
|
4242
4336
|
label,
|
|
@@ -4249,8 +4343,8 @@ function LineChart({
|
|
|
4249
4343
|
showDataTable,
|
|
4250
4344
|
className,
|
|
4251
4345
|
style,
|
|
4252
|
-
children: !hasData ? /* @__PURE__ */
|
|
4253
|
-
width > 0 ? /* @__PURE__ */
|
|
4346
|
+
children: !hasData ? /* @__PURE__ */ jsx57("div", { className: "pire-chart-empty", children: emptyState ?? msg.chartEmpty }) : /* @__PURE__ */ jsxs47("div", { className: "pire-chart-lines", ref: plotRef, style: { height }, children: [
|
|
4347
|
+
width > 0 ? /* @__PURE__ */ jsxs47(
|
|
4254
4348
|
"svg",
|
|
4255
4349
|
{
|
|
4256
4350
|
width,
|
|
@@ -4259,7 +4353,7 @@ function LineChart({
|
|
|
4259
4353
|
"aria-hidden": "true",
|
|
4260
4354
|
focusable: "false",
|
|
4261
4355
|
children: [
|
|
4262
|
-
/* @__PURE__ */
|
|
4356
|
+
/* @__PURE__ */ jsx57("g", { className: "pire-chart-grid", children: scale.ticks.map((tick) => /* @__PURE__ */ jsx57(
|
|
4263
4357
|
"line",
|
|
4264
4358
|
{
|
|
4265
4359
|
x1: PLOT_INSET.left,
|
|
@@ -4269,8 +4363,8 @@ function LineChart({
|
|
|
4269
4363
|
},
|
|
4270
4364
|
tick
|
|
4271
4365
|
)) }),
|
|
4272
|
-
/* @__PURE__ */
|
|
4273
|
-
scale.ticks.map((tick) => /* @__PURE__ */
|
|
4366
|
+
/* @__PURE__ */ jsxs47("g", { className: "pire-chart-tick", children: [
|
|
4367
|
+
scale.ticks.map((tick) => /* @__PURE__ */ jsx57(
|
|
4274
4368
|
"text",
|
|
4275
4369
|
{
|
|
4276
4370
|
x: PLOT_INSET.left - 8,
|
|
@@ -4284,11 +4378,11 @@ function LineChart({
|
|
|
4284
4378
|
categories.map(
|
|
4285
4379
|
(category, index) => index % labelEvery === 0 ? (
|
|
4286
4380
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
4287
|
-
/* @__PURE__ */
|
|
4381
|
+
/* @__PURE__ */ jsx57("text", { x: xAt(index), y: height - 6, textAnchor: "middle", children: category }, index)
|
|
4288
4382
|
) : null
|
|
4289
4383
|
)
|
|
4290
4384
|
] }),
|
|
4291
|
-
showArea && series[0] ? /* @__PURE__ */
|
|
4385
|
+
showArea && series[0] ? /* @__PURE__ */ jsx57(
|
|
4292
4386
|
"path",
|
|
4293
4387
|
{
|
|
4294
4388
|
d: areaFor(series[0].values),
|
|
@@ -4296,10 +4390,10 @@ function LineChart({
|
|
|
4296
4390
|
style: { fill: seriesColor(series[0], 0) }
|
|
4297
4391
|
}
|
|
4298
4392
|
) : null,
|
|
4299
|
-
/* @__PURE__ */
|
|
4300
|
-
withMarkers ? /* @__PURE__ */
|
|
4393
|
+
/* @__PURE__ */ jsx57("g", { className: "pire-chart-line", fill: "none", children: series.map((one, index) => /* @__PURE__ */ jsx57("path", { d: pathFor(one.values), stroke: seriesColor(one, index) }, one.id)) }),
|
|
4394
|
+
withMarkers ? /* @__PURE__ */ jsx57("g", { className: "pire-chart-marker", children: series.map(
|
|
4301
4395
|
(one, seriesIndex) => one.values.map(
|
|
4302
|
-
(value, index) => value == null ? null : /* @__PURE__ */
|
|
4396
|
+
(value, index) => value == null ? null : /* @__PURE__ */ jsx57(
|
|
4303
4397
|
"circle",
|
|
4304
4398
|
{
|
|
4305
4399
|
cx: xAt(index),
|
|
@@ -4314,7 +4408,7 @@ function LineChart({
|
|
|
4314
4408
|
]
|
|
4315
4409
|
}
|
|
4316
4410
|
) : null,
|
|
4317
|
-
/* @__PURE__ */
|
|
4411
|
+
/* @__PURE__ */ jsx57(
|
|
4318
4412
|
"div",
|
|
4319
4413
|
{
|
|
4320
4414
|
className: "pire-chart-hover",
|
|
@@ -4323,11 +4417,11 @@ function LineChart({
|
|
|
4323
4417
|
},
|
|
4324
4418
|
children: categories.map((category, categoryIndex) => (
|
|
4325
4419
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
4326
|
-
/* @__PURE__ */
|
|
4327
|
-
/* @__PURE__ */
|
|
4420
|
+
/* @__PURE__ */ jsx57("div", { className: "pire-chart-band", children: /* @__PURE__ */ jsxs47("span", { className: "pire-chart-tip", role: "presentation", children: [
|
|
4421
|
+
/* @__PURE__ */ jsx57("strong", { children: category }),
|
|
4328
4422
|
series.map((one) => {
|
|
4329
4423
|
const value = one.values[categoryIndex];
|
|
4330
|
-
return /* @__PURE__ */
|
|
4424
|
+
return /* @__PURE__ */ jsxs47("span", { className: "pire-chart-tip-row", children: [
|
|
4331
4425
|
one.label,
|
|
4332
4426
|
": ",
|
|
4333
4427
|
value == null ? "No data" : formatValue(value)
|
|
@@ -4343,8 +4437,8 @@ function LineChart({
|
|
|
4343
4437
|
}
|
|
4344
4438
|
|
|
4345
4439
|
// src/components/data/DonutChart.tsx
|
|
4346
|
-
import * as
|
|
4347
|
-
import { jsx as
|
|
4440
|
+
import * as React28 from "react";
|
|
4441
|
+
import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
4348
4442
|
var SEGMENT_GAP_DEGREES = 1.5;
|
|
4349
4443
|
function DonutChart({
|
|
4350
4444
|
categories,
|
|
@@ -4364,7 +4458,7 @@ function DonutChart({
|
|
|
4364
4458
|
}) {
|
|
4365
4459
|
const label = rest["aria-label"];
|
|
4366
4460
|
const msg = usePireMessages();
|
|
4367
|
-
const [hoveredIndex, setHoveredIndex] =
|
|
4461
|
+
const [hoveredIndex, setHoveredIndex] = React28.useState(null);
|
|
4368
4462
|
warnOnDonutShape(series, categories.length, label);
|
|
4369
4463
|
const values = (series[0]?.values ?? []).slice(0, categories.length);
|
|
4370
4464
|
const segments = categories.map((category, index) => ({ category, index, value: values[index] ?? 0 })).filter((segment) => segment.value > 0);
|
|
@@ -4381,7 +4475,7 @@ function DonutChart({
|
|
|
4381
4475
|
}));
|
|
4382
4476
|
const hovered = hoveredIndex == null ? null : segments.find((segment) => segment.index === hoveredIndex) ?? null;
|
|
4383
4477
|
let arcStart = 0;
|
|
4384
|
-
return /* @__PURE__ */
|
|
4478
|
+
return /* @__PURE__ */ jsx58(
|
|
4385
4479
|
ChartFrame,
|
|
4386
4480
|
{
|
|
4387
4481
|
label,
|
|
@@ -4394,8 +4488,8 @@ function DonutChart({
|
|
|
4394
4488
|
showDataTable,
|
|
4395
4489
|
className,
|
|
4396
4490
|
style,
|
|
4397
|
-
children: !hasData ? /* @__PURE__ */
|
|
4398
|
-
/* @__PURE__ */
|
|
4491
|
+
children: !hasData ? /* @__PURE__ */ jsx58("div", { className: "pire-chart-empty", children: emptyState ?? msg.chartEmpty }) : /* @__PURE__ */ jsxs48("div", { className: "pire-chart-donut", style: { height: size }, children: [
|
|
4492
|
+
/* @__PURE__ */ jsx58(
|
|
4399
4493
|
"svg",
|
|
4400
4494
|
{
|
|
4401
4495
|
width: size,
|
|
@@ -4403,13 +4497,13 @@ function DonutChart({
|
|
|
4403
4497
|
"aria-hidden": "true",
|
|
4404
4498
|
focusable: "false",
|
|
4405
4499
|
onMouseLeave: () => setHoveredIndex(null),
|
|
4406
|
-
children: /* @__PURE__ */
|
|
4500
|
+
children: /* @__PURE__ */ jsx58("g", { transform: `rotate(-90 ${size / 2} ${size / 2})`, children: segments.map((segment) => {
|
|
4407
4501
|
const arcLength = segment.value / total * circumference;
|
|
4408
4502
|
const offset = arcStart;
|
|
4409
4503
|
arcStart += arcLength;
|
|
4410
4504
|
return (
|
|
4411
4505
|
// biome-ignore lint/a11y/noStaticElementInteractions: pointer-only enhancement inside an aria-hidden plot — the arcs carry nothing the data table does not, so there is nothing here for a keyboard to reach.
|
|
4412
|
-
/* @__PURE__ */
|
|
4506
|
+
/* @__PURE__ */ jsx58(
|
|
4413
4507
|
"circle",
|
|
4414
4508
|
{
|
|
4415
4509
|
className: "pire-chart-arc",
|
|
@@ -4429,9 +4523,9 @@ function DonutChart({
|
|
|
4429
4523
|
}) })
|
|
4430
4524
|
}
|
|
4431
4525
|
),
|
|
4432
|
-
/* @__PURE__ */
|
|
4433
|
-
/* @__PURE__ */
|
|
4434
|
-
/* @__PURE__ */
|
|
4526
|
+
/* @__PURE__ */ jsxs48("div", { className: "pire-chart-donut-center", style: { width: size - thickness * 2 - 8 }, children: [
|
|
4527
|
+
/* @__PURE__ */ jsx58("span", { className: "pire-chart-donut-value", children: hovered ? formatValue(hovered.value) : centerLabel ?? formatValue(total) }),
|
|
4528
|
+
/* @__PURE__ */ jsx58("span", { className: "pire-chart-donut-caption", children: hovered ? hovered.category : centerCaption })
|
|
4435
4529
|
] })
|
|
4436
4530
|
] })
|
|
4437
4531
|
}
|
|
@@ -4443,14 +4537,14 @@ function colorForSegment(index) {
|
|
|
4443
4537
|
|
|
4444
4538
|
// src/components/data/LinkList.tsx
|
|
4445
4539
|
import { Button as AriaButton15 } from "react-aria-components";
|
|
4446
|
-
import { jsx as
|
|
4540
|
+
import { jsx as jsx59, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
4447
4541
|
function LinkList({ items, onSelect, emphasis = "key", className, ...rest }) {
|
|
4448
|
-
return /* @__PURE__ */
|
|
4449
|
-
const keySlot = item.key ? /* @__PURE__ */
|
|
4450
|
-
const textSlot = item.text ? /* @__PURE__ */
|
|
4542
|
+
return /* @__PURE__ */ jsx59("div", { className: cx("pire-linklist", className), role: "list", "data-emphasis": emphasis, ...rest, children: items.map((item) => {
|
|
4543
|
+
const keySlot = item.key ? /* @__PURE__ */ jsx59("span", { className: "pire-linklist-key", children: item.key }) : null;
|
|
4544
|
+
const textSlot = item.text ? /* @__PURE__ */ jsx59("span", { className: "pire-linklist-text", children: item.text }) : null;
|
|
4451
4545
|
const [first, second] = emphasis === "text" ? [textSlot, keySlot] : [keySlot, textSlot];
|
|
4452
|
-
return /* @__PURE__ */
|
|
4453
|
-
item.icon ? /* @__PURE__ */
|
|
4546
|
+
return /* @__PURE__ */ jsx59("div", { role: "listitem", className: "pire-linklist-row", children: /* @__PURE__ */ jsxs49(AriaButton15, { className: "pire-linklist-item", onPress: () => onSelect?.(item.id), children: [
|
|
4547
|
+
item.icon ? /* @__PURE__ */ jsx59(Icon, { name: item.icon, size: 16, style: { color: "var(--text-secondary)" } }) : null,
|
|
4454
4548
|
first,
|
|
4455
4549
|
second,
|
|
4456
4550
|
item.trailing
|
|
@@ -4459,7 +4553,7 @@ function LinkList({ items, onSelect, emphasis = "key", className, ...rest }) {
|
|
|
4459
4553
|
}
|
|
4460
4554
|
|
|
4461
4555
|
// src/components/data/RecordCard.tsx
|
|
4462
|
-
import { jsx as
|
|
4556
|
+
import { jsx as jsx60, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
4463
4557
|
function RecordCard({
|
|
4464
4558
|
title,
|
|
4465
4559
|
subtitle,
|
|
@@ -4469,19 +4563,19 @@ function RecordCard({
|
|
|
4469
4563
|
className,
|
|
4470
4564
|
...rest
|
|
4471
4565
|
}) {
|
|
4472
|
-
return /* @__PURE__ */
|
|
4566
|
+
return /* @__PURE__ */ jsxs50(
|
|
4473
4567
|
"div",
|
|
4474
4568
|
{
|
|
4475
4569
|
className: cx("pire-recordcard", className),
|
|
4476
4570
|
"data-disabled": isDisabled ? "true" : void 0,
|
|
4477
4571
|
...rest,
|
|
4478
4572
|
children: [
|
|
4479
|
-
icon ? /* @__PURE__ */
|
|
4480
|
-
/* @__PURE__ */
|
|
4481
|
-
/* @__PURE__ */
|
|
4482
|
-
subtitle ? /* @__PURE__ */
|
|
4573
|
+
icon ? /* @__PURE__ */ jsx60("span", { className: "pire-recordcard-tile", "aria-hidden": "true", children: /* @__PURE__ */ jsx60(Icon, { name: icon, size: 20 }) }) : null,
|
|
4574
|
+
/* @__PURE__ */ jsxs50("span", { className: "pire-recordcard-body", children: [
|
|
4575
|
+
/* @__PURE__ */ jsx60("span", { className: "pire-recordcard-title", children: title }),
|
|
4576
|
+
subtitle ? /* @__PURE__ */ jsx60("span", { className: "pire-recordcard-sub", children: subtitle }) : null
|
|
4483
4577
|
] }),
|
|
4484
|
-
action ? /* @__PURE__ */
|
|
4578
|
+
action ? /* @__PURE__ */ jsx60("span", { className: "pire-recordcard-action", children: action }) : null
|
|
4485
4579
|
]
|
|
4486
4580
|
}
|
|
4487
4581
|
);
|
|
@@ -4489,7 +4583,7 @@ function RecordCard({
|
|
|
4489
4583
|
|
|
4490
4584
|
// src/components/data/ViewSwitcher.tsx
|
|
4491
4585
|
import { Button as AriaButton16 } from "react-aria-components";
|
|
4492
|
-
import { jsx as
|
|
4586
|
+
import { jsx as jsx61, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
4493
4587
|
function ViewSwitcher({
|
|
4494
4588
|
name,
|
|
4495
4589
|
isDirty,
|
|
@@ -4502,7 +4596,7 @@ function ViewSwitcher({
|
|
|
4502
4596
|
}) {
|
|
4503
4597
|
const msg = usePireMessages();
|
|
4504
4598
|
const label = ariaLabel ?? (isDirty ? msg.viewSwitcherNameModified.replace("{view}", name) : msg.viewSwitcherName.replace("{view}", name));
|
|
4505
|
-
return /* @__PURE__ */
|
|
4599
|
+
return /* @__PURE__ */ jsxs51(
|
|
4506
4600
|
AriaButton16,
|
|
4507
4601
|
{
|
|
4508
4602
|
className: cx("pire-viewswitcher", className),
|
|
@@ -4511,36 +4605,36 @@ function ViewSwitcher({
|
|
|
4511
4605
|
isDisabled,
|
|
4512
4606
|
onPress,
|
|
4513
4607
|
children: [
|
|
4514
|
-
/* @__PURE__ */
|
|
4515
|
-
/* @__PURE__ */
|
|
4516
|
-
isDirty ? /* @__PURE__ */
|
|
4517
|
-
/* @__PURE__ */
|
|
4608
|
+
/* @__PURE__ */ jsx61(Icon, { name: icon, size: 16 }),
|
|
4609
|
+
/* @__PURE__ */ jsx61("span", { className: "pire-viewswitcher-name", children: name }),
|
|
4610
|
+
isDirty ? /* @__PURE__ */ jsx61("span", { className: "pire-viewswitcher-dirty", "aria-hidden": "true", children: msg.viewSwitcherModifiedMark }) : null,
|
|
4611
|
+
/* @__PURE__ */ jsx61(Icon, { name: "chevron-down", size: 16 })
|
|
4518
4612
|
]
|
|
4519
4613
|
}
|
|
4520
4614
|
);
|
|
4521
4615
|
}
|
|
4522
4616
|
|
|
4523
4617
|
// src/components/data/BarList.tsx
|
|
4524
|
-
import { jsx as
|
|
4618
|
+
import { jsx as jsx62, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
4525
4619
|
function BarList({ items, max, className, ...rest }) {
|
|
4526
4620
|
const scale = max ?? Math.max(0, ...items.map((i) => i.value));
|
|
4527
|
-
return /* @__PURE__ */
|
|
4621
|
+
return /* @__PURE__ */ jsx62("ul", { ...rest, className: cx("pire-barlist", className), children: items.map((item) => {
|
|
4528
4622
|
const pct = scale > 0 ? Math.max(0, Math.min(100, item.value / scale * 100)) : 0;
|
|
4529
|
-
return /* @__PURE__ */
|
|
4530
|
-
/* @__PURE__ */
|
|
4531
|
-
/* @__PURE__ */
|
|
4532
|
-
/* @__PURE__ */
|
|
4623
|
+
return /* @__PURE__ */ jsxs52("li", { className: "pire-barlist-row", "data-tone": item.tone, children: [
|
|
4624
|
+
/* @__PURE__ */ jsxs52("span", { className: "pire-barlist-main", children: [
|
|
4625
|
+
/* @__PURE__ */ jsx62("span", { className: "pire-barlist-label", children: item.label }),
|
|
4626
|
+
/* @__PURE__ */ jsx62("span", { className: "pire-barlist-track", "aria-hidden": "true", children: /* @__PURE__ */ jsx62("span", { className: "pire-barlist-fill", style: { width: `${pct}%` } }) })
|
|
4533
4627
|
] }),
|
|
4534
|
-
/* @__PURE__ */
|
|
4535
|
-
/* @__PURE__ */
|
|
4536
|
-
item.hint ? /* @__PURE__ */
|
|
4628
|
+
/* @__PURE__ */ jsxs52("span", { className: "pire-barlist-figure", children: [
|
|
4629
|
+
/* @__PURE__ */ jsx62("span", { className: "pire-barlist-value", children: item.valueLabel ?? String(item.value) }),
|
|
4630
|
+
item.hint ? /* @__PURE__ */ jsx62("span", { className: "pire-barlist-hint", children: item.hint }) : null
|
|
4537
4631
|
] })
|
|
4538
4632
|
] }, item.id);
|
|
4539
4633
|
}) });
|
|
4540
4634
|
}
|
|
4541
4635
|
|
|
4542
4636
|
// src/components/layout/PageBand.tsx
|
|
4543
|
-
import { jsx as
|
|
4637
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
4544
4638
|
function PageBand({
|
|
4545
4639
|
surface = "card",
|
|
4546
4640
|
hasBorder = true,
|
|
@@ -4548,7 +4642,7 @@ function PageBand({
|
|
|
4548
4642
|
className,
|
|
4549
4643
|
...rest
|
|
4550
4644
|
}) {
|
|
4551
|
-
return /* @__PURE__ */
|
|
4645
|
+
return /* @__PURE__ */ jsx63(
|
|
4552
4646
|
"div",
|
|
4553
4647
|
{
|
|
4554
4648
|
className: cx("pire-pageband", className),
|
|
@@ -4561,29 +4655,29 @@ function PageBand({
|
|
|
4561
4655
|
}
|
|
4562
4656
|
|
|
4563
4657
|
// src/components/layout/PageHeader.tsx
|
|
4564
|
-
import { jsx as
|
|
4658
|
+
import { jsx as jsx64, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
4565
4659
|
function PageHeader({ title, subtitle, actions, className, ...rest }) {
|
|
4566
|
-
return /* @__PURE__ */
|
|
4567
|
-
/* @__PURE__ */
|
|
4568
|
-
/* @__PURE__ */
|
|
4569
|
-
subtitle ? /* @__PURE__ */
|
|
4660
|
+
return /* @__PURE__ */ jsxs53("header", { className: cx("pire-pageheader", className), ...rest, children: [
|
|
4661
|
+
/* @__PURE__ */ jsxs53("div", { style: { minWidth: 0 }, children: [
|
|
4662
|
+
/* @__PURE__ */ jsx64("h1", { className: "pire-pageheader-title", children: title }),
|
|
4663
|
+
subtitle ? /* @__PURE__ */ jsx64("p", { className: "pire-pageheader-sub", children: subtitle }) : null
|
|
4570
4664
|
] }),
|
|
4571
|
-
actions ? /* @__PURE__ */
|
|
4665
|
+
actions ? /* @__PURE__ */ jsx64("div", { className: "pire-pageheader-actions", children: actions }) : null
|
|
4572
4666
|
] });
|
|
4573
4667
|
}
|
|
4574
4668
|
|
|
4575
4669
|
// src/components/layout/SectionHeader.tsx
|
|
4576
|
-
import { jsx as
|
|
4670
|
+
import { jsx as jsx65, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
4577
4671
|
function SectionHeader({ title, meta, actions, className, ...rest }) {
|
|
4578
|
-
return /* @__PURE__ */
|
|
4579
|
-
/* @__PURE__ */
|
|
4580
|
-
meta ? /* @__PURE__ */
|
|
4581
|
-
actions ? /* @__PURE__ */
|
|
4672
|
+
return /* @__PURE__ */ jsxs54("div", { className: cx("pire-sectionhead", className), ...rest, children: [
|
|
4673
|
+
/* @__PURE__ */ jsx65("span", { className: "pire-eyebrow", children: title }),
|
|
4674
|
+
meta ? /* @__PURE__ */ jsx65("span", { style: { font: "var(--type-caption)", color: "var(--text-tertiary)" }, children: meta }) : null,
|
|
4675
|
+
actions ? /* @__PURE__ */ jsx65("div", { className: "pire-sectionhead-actions", children: actions }) : null
|
|
4582
4676
|
] });
|
|
4583
4677
|
}
|
|
4584
4678
|
|
|
4585
4679
|
// src/components/layout/SelectionBar.tsx
|
|
4586
|
-
import { jsx as
|
|
4680
|
+
import { jsx as jsx66, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
4587
4681
|
function SelectionBar({
|
|
4588
4682
|
count,
|
|
4589
4683
|
noun = "record",
|
|
@@ -4593,31 +4687,31 @@ function SelectionBar({
|
|
|
4593
4687
|
...rest
|
|
4594
4688
|
}) {
|
|
4595
4689
|
if (!count) return null;
|
|
4596
|
-
return /* @__PURE__ */
|
|
4597
|
-
/* @__PURE__ */
|
|
4690
|
+
return /* @__PURE__ */ jsxs55("div", { className: cx("pire-selectionbar", className), role: "status", "aria-live": "polite", ...rest, children: [
|
|
4691
|
+
/* @__PURE__ */ jsxs55("span", { className: "pire-selectionbar-count", children: [
|
|
4598
4692
|
count.toLocaleString(),
|
|
4599
4693
|
" ",
|
|
4600
4694
|
noun,
|
|
4601
4695
|
count === 1 ? "" : "s",
|
|
4602
4696
|
" selected"
|
|
4603
4697
|
] }),
|
|
4604
|
-
children ? /* @__PURE__ */
|
|
4605
|
-
actions ? /* @__PURE__ */
|
|
4698
|
+
children ? /* @__PURE__ */ jsx66("span", { style: { color: "var(--text-secondary)", font: "var(--type-caption)" }, children }) : null,
|
|
4699
|
+
actions ? /* @__PURE__ */ jsx66("div", { className: "pire-selectionbar-actions", children: actions }) : null
|
|
4606
4700
|
] });
|
|
4607
4701
|
}
|
|
4608
4702
|
|
|
4609
4703
|
// src/components/layout/FooterBar.tsx
|
|
4610
|
-
import { jsx as
|
|
4704
|
+
import { jsx as jsx67, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
4611
4705
|
function FooterBar({ note, actions, children, className, ...rest }) {
|
|
4612
|
-
return /* @__PURE__ */
|
|
4613
|
-
note ? /* @__PURE__ */
|
|
4706
|
+
return /* @__PURE__ */ jsxs56("footer", { className: cx("pire-footerbar", className), ...rest, children: [
|
|
4707
|
+
note ? /* @__PURE__ */ jsx67("span", { className: "pire-footerbar-note", children: note }) : null,
|
|
4614
4708
|
children,
|
|
4615
|
-
actions ? /* @__PURE__ */
|
|
4709
|
+
actions ? /* @__PURE__ */ jsx67("div", { className: "pire-footerbar-actions", children: actions }) : null
|
|
4616
4710
|
] });
|
|
4617
4711
|
}
|
|
4618
4712
|
|
|
4619
4713
|
// src/components/layout/SplitPane.tsx
|
|
4620
|
-
import { jsx as
|
|
4714
|
+
import { jsx as jsx68, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
4621
4715
|
function SplitPane({
|
|
4622
4716
|
list,
|
|
4623
4717
|
detail,
|
|
@@ -4633,7 +4727,7 @@ function SplitPane({
|
|
|
4633
4727
|
}) {
|
|
4634
4728
|
const msg = usePireMessages();
|
|
4635
4729
|
const width = typeof listWidth === "number" ? `${listWidth}px` : listWidth;
|
|
4636
|
-
return /* @__PURE__ */
|
|
4730
|
+
return /* @__PURE__ */ jsxs57(
|
|
4637
4731
|
"div",
|
|
4638
4732
|
{
|
|
4639
4733
|
className: cx("pire-split", className),
|
|
@@ -4641,10 +4735,10 @@ function SplitPane({
|
|
|
4641
4735
|
style: { ["--pire-split-list-w"]: width, ...style },
|
|
4642
4736
|
...rest,
|
|
4643
4737
|
children: [
|
|
4644
|
-
/* @__PURE__ */
|
|
4645
|
-
/* @__PURE__ */
|
|
4646
|
-
onBack ? /* @__PURE__ */
|
|
4647
|
-
detail ?? /* @__PURE__ */
|
|
4738
|
+
/* @__PURE__ */ jsx68("section", { className: "pire-split-list", "aria-label": listLabel ?? msg.splitPaneList, children: list }),
|
|
4739
|
+
/* @__PURE__ */ jsxs57("section", { className: "pire-split-detail", "aria-label": detailLabel ?? msg.splitPaneDetail, children: [
|
|
4740
|
+
onBack ? /* @__PURE__ */ jsx68("div", { className: "pire-split-back", children: /* @__PURE__ */ jsx68(Button, { variant: "tertiary", size: "sm", icon: "arrow-left", onPress: onBack, children: backLabel ?? msg.splitPaneBack }) }) : null,
|
|
4741
|
+
detail ?? /* @__PURE__ */ jsx68("div", { className: "pire-split-empty", children: emptyDetail })
|
|
4648
4742
|
] })
|
|
4649
4743
|
]
|
|
4650
4744
|
}
|
|
@@ -4652,7 +4746,7 @@ function SplitPane({
|
|
|
4652
4746
|
}
|
|
4653
4747
|
|
|
4654
4748
|
// src/components/patterns/ConfirmDialog.tsx
|
|
4655
|
-
import { Fragment as Fragment8, jsx as
|
|
4749
|
+
import { Fragment as Fragment8, jsx as jsx69, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
4656
4750
|
function ConfirmDialog({
|
|
4657
4751
|
isOpen,
|
|
4658
4752
|
title,
|
|
@@ -4668,7 +4762,7 @@ function ConfirmDialog({
|
|
|
4668
4762
|
onCancel
|
|
4669
4763
|
}) {
|
|
4670
4764
|
const msg = usePireMessages();
|
|
4671
|
-
return /* @__PURE__ */
|
|
4765
|
+
return /* @__PURE__ */ jsxs58(
|
|
4672
4766
|
Dialog,
|
|
4673
4767
|
{
|
|
4674
4768
|
isOpen,
|
|
@@ -4678,9 +4772,9 @@ function ConfirmDialog({
|
|
|
4678
4772
|
onClose: onCancel,
|
|
4679
4773
|
isDismissable: !isBusy,
|
|
4680
4774
|
showClose: false,
|
|
4681
|
-
footer: /* @__PURE__ */
|
|
4682
|
-
/* @__PURE__ */
|
|
4683
|
-
/* @__PURE__ */
|
|
4775
|
+
footer: /* @__PURE__ */ jsxs58(Fragment8, { children: [
|
|
4776
|
+
/* @__PURE__ */ jsx69(Button, { variant: "tertiary", isDisabled: isBusy, onPress: onCancel, children: cancelLabel }),
|
|
4777
|
+
/* @__PURE__ */ jsx69(Button, { variant: tone === "danger" ? "danger" : "primary", isDisabled: isBusy, onPress: onConfirm, children: isBusy ? "Working\u2026" : confirmLabel })
|
|
4684
4778
|
] }),
|
|
4685
4779
|
children: [
|
|
4686
4780
|
facts?.length ? (
|
|
@@ -4688,9 +4782,9 @@ function ConfirmDialog({
|
|
|
4688
4782
|
// *prohibits* `aria-label` — the label named nothing at all, and axe's
|
|
4689
4783
|
// `aria-prohibited-attr` fails it on sight. Every other labelled div/span in this library
|
|
4690
4784
|
// pairs with an explicit role for the same reason.
|
|
4691
|
-
/* @__PURE__ */
|
|
4785
|
+
/* @__PURE__ */ jsx69("div", { className: "pire-confirm-facts", role: "group", "aria-label": msg.confirmDialogFactsLabel, children: /* @__PURE__ */ jsx69(DescriptionList, { layout: "rows", items: facts }) })
|
|
4692
4786
|
) : null,
|
|
4693
|
-
consequence ? /* @__PURE__ */
|
|
4787
|
+
consequence ? /* @__PURE__ */ jsx69(
|
|
4694
4788
|
InlineMessage,
|
|
4695
4789
|
{
|
|
4696
4790
|
kind: tone === "danger" ? "error" : "warning",
|
|
@@ -4705,7 +4799,7 @@ function ConfirmDialog({
|
|
|
4705
4799
|
}
|
|
4706
4800
|
|
|
4707
4801
|
// src/components/patterns/CommandPalette.tsx
|
|
4708
|
-
import * as
|
|
4802
|
+
import * as React29 from "react";
|
|
4709
4803
|
import {
|
|
4710
4804
|
Autocomplete,
|
|
4711
4805
|
ModalOverlay as ModalOverlay2,
|
|
@@ -4718,7 +4812,7 @@ import {
|
|
|
4718
4812
|
Header as Header2,
|
|
4719
4813
|
useFilter
|
|
4720
4814
|
} from "react-aria-components";
|
|
4721
|
-
import { Fragment as Fragment9, jsx as
|
|
4815
|
+
import { Fragment as Fragment9, jsx as jsx70, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
4722
4816
|
var RESULTS_SECTION_KEY = "__pire_results__";
|
|
4723
4817
|
var searchableText = (item) => [item.label, item.description, item.keywords].filter(Boolean).join(" ");
|
|
4724
4818
|
function CommandPalette({
|
|
@@ -4739,17 +4833,17 @@ function CommandPalette({
|
|
|
4739
4833
|
style
|
|
4740
4834
|
}) {
|
|
4741
4835
|
const msg = usePireMessages();
|
|
4742
|
-
const [query, setQuery] =
|
|
4836
|
+
const [query, setQuery] = React29.useState("");
|
|
4743
4837
|
const { contains } = useFilter({ sensitivity: "base" });
|
|
4744
|
-
|
|
4838
|
+
React29.useEffect(() => {
|
|
4745
4839
|
if (isOpen) setQuery("");
|
|
4746
4840
|
}, [isOpen]);
|
|
4747
|
-
const searchableById =
|
|
4841
|
+
const searchableById = React29.useMemo(() => {
|
|
4748
4842
|
const byId = /* @__PURE__ */ new Map();
|
|
4749
4843
|
for (const group of groups) for (const item of group.items) byId.set(item.id, searchableText(item));
|
|
4750
4844
|
return byId;
|
|
4751
4845
|
}, [groups]);
|
|
4752
|
-
const filter =
|
|
4846
|
+
const filter = React29.useCallback(
|
|
4753
4847
|
(textValue, inputValue, node) => {
|
|
4754
4848
|
if (node.parentKey === RESULTS_SECTION_KEY) return true;
|
|
4755
4849
|
return contains(searchableById.get(String(node.key)) ?? textValue, inputValue);
|
|
@@ -4762,7 +4856,7 @@ function CommandPalette({
|
|
|
4762
4856
|
};
|
|
4763
4857
|
const sections = [...groups, ...resultsGroup ? [{ ...resultsGroup, id: RESULTS_SECTION_KEY }] : []];
|
|
4764
4858
|
const status = isLoading ? loadingLabel ?? msg.commandPaletteLoading : emptyLabel ?? msg.commandPaletteEmpty;
|
|
4765
|
-
return /* @__PURE__ */
|
|
4859
|
+
return /* @__PURE__ */ jsx70(
|
|
4766
4860
|
ModalOverlay2,
|
|
4767
4861
|
{
|
|
4768
4862
|
className: "pire-cp-overlay",
|
|
@@ -4771,11 +4865,11 @@ function CommandPalette({
|
|
|
4771
4865
|
onOpenChange: (open) => {
|
|
4772
4866
|
if (!open) onOpenChange?.(false);
|
|
4773
4867
|
},
|
|
4774
|
-
children: /* @__PURE__ */
|
|
4775
|
-
/* @__PURE__ */
|
|
4776
|
-
/* @__PURE__ */
|
|
4777
|
-
/* @__PURE__ */
|
|
4778
|
-
/* @__PURE__ */
|
|
4868
|
+
children: /* @__PURE__ */ jsx70(Modal2, { className: cx("pire-cp-modal", className), style, children: /* @__PURE__ */ jsxs59(AriaDialog4, { className: "pire-cp-dialog", "aria-label": ariaLabel ?? msg.commandPaletteLabel, children: [
|
|
4869
|
+
/* @__PURE__ */ jsxs59(Autocomplete, { filter, inputValue: query, onInputChange: handleInputChange, children: [
|
|
4870
|
+
/* @__PURE__ */ jsxs59(SearchField, { className: "pire-cp-search", "aria-label": msg.commandPaletteSearchLabel, children: [
|
|
4871
|
+
/* @__PURE__ */ jsx70(Icon, { name: "search", size: 18, className: "pire-cp-search-icon" }),
|
|
4872
|
+
/* @__PURE__ */ jsx70(
|
|
4779
4873
|
AriaInput5,
|
|
4780
4874
|
{
|
|
4781
4875
|
className: "pire-cp-input",
|
|
@@ -4784,16 +4878,16 @@ function CommandPalette({
|
|
|
4784
4878
|
}
|
|
4785
4879
|
)
|
|
4786
4880
|
] }),
|
|
4787
|
-
isLoading ? /* @__PURE__ */
|
|
4788
|
-
/* @__PURE__ */
|
|
4881
|
+
isLoading ? /* @__PURE__ */ jsx70("div", { className: "pire-cp-loading", role: "status", "aria-live": "polite", children: loadingLabel ?? msg.commandPaletteLoading }) : null,
|
|
4882
|
+
/* @__PURE__ */ jsx70(
|
|
4789
4883
|
AriaMenu2,
|
|
4790
4884
|
{
|
|
4791
4885
|
className: "pire-cp-list",
|
|
4792
4886
|
onAction: (key) => onAction?.(String(key)),
|
|
4793
|
-
renderEmptyState: () => /* @__PURE__ */
|
|
4794
|
-
children: sections.map((section) => /* @__PURE__ */
|
|
4795
|
-
section.label ? /* @__PURE__ */
|
|
4796
|
-
section.items.map((item) => /* @__PURE__ */
|
|
4887
|
+
renderEmptyState: () => /* @__PURE__ */ jsx70("div", { className: "pire-cp-status", children: status }),
|
|
4888
|
+
children: sections.map((section) => /* @__PURE__ */ jsxs59(AriaMenuSection2, { id: section.id, className: "pire-cp-section", children: [
|
|
4889
|
+
section.label ? /* @__PURE__ */ jsx70(Header2, { className: "pire-cp-section-title", children: section.label }) : null,
|
|
4890
|
+
section.items.map((item) => /* @__PURE__ */ jsx70(
|
|
4797
4891
|
MenuItem,
|
|
4798
4892
|
{
|
|
4799
4893
|
id: item.id,
|
|
@@ -4814,18 +4908,18 @@ function CommandPalette({
|
|
|
4814
4908
|
// aria-hidden: the glyphs are a sighted affordance for discovering the keys. A screen
|
|
4815
4909
|
// reader already announces the listbox semantics that make those keys work, so reading
|
|
4816
4910
|
// "up arrow down arrow navigate" out loud is noise on every open.
|
|
4817
|
-
/* @__PURE__ */
|
|
4818
|
-
/* @__PURE__ */
|
|
4819
|
-
/* @__PURE__ */
|
|
4820
|
-
/* @__PURE__ */
|
|
4911
|
+
/* @__PURE__ */ jsx70("div", { className: "pire-cp-foot", "aria-hidden": "true", children: footer ?? /* @__PURE__ */ jsxs59(Fragment9, { children: [
|
|
4912
|
+
/* @__PURE__ */ jsxs59("span", { className: "pire-cp-hint", children: [
|
|
4913
|
+
/* @__PURE__ */ jsx70(Kbd, { children: "\u2191" }),
|
|
4914
|
+
/* @__PURE__ */ jsx70(Kbd, { children: "\u2193" }),
|
|
4821
4915
|
msg.commandPaletteHintNavigate
|
|
4822
4916
|
] }),
|
|
4823
|
-
/* @__PURE__ */
|
|
4824
|
-
/* @__PURE__ */
|
|
4917
|
+
/* @__PURE__ */ jsxs59("span", { className: "pire-cp-hint", children: [
|
|
4918
|
+
/* @__PURE__ */ jsx70(Kbd, { children: "\u21B5" }),
|
|
4825
4919
|
msg.commandPaletteHintSelect
|
|
4826
4920
|
] }),
|
|
4827
|
-
/* @__PURE__ */
|
|
4828
|
-
/* @__PURE__ */
|
|
4921
|
+
/* @__PURE__ */ jsxs59("span", { className: "pire-cp-hint", children: [
|
|
4922
|
+
/* @__PURE__ */ jsx70(Kbd, { children: "esc" }),
|
|
4829
4923
|
msg.commandPaletteHintClose
|
|
4830
4924
|
] })
|
|
4831
4925
|
] }) })
|
|
@@ -4835,9 +4929,9 @@ function CommandPalette({
|
|
|
4835
4929
|
);
|
|
4836
4930
|
}
|
|
4837
4931
|
function useCommandPaletteShortcut(onTrigger, { key = "k", isDisabled } = {}) {
|
|
4838
|
-
const handler =
|
|
4932
|
+
const handler = React29.useRef(onTrigger);
|
|
4839
4933
|
handler.current = onTrigger;
|
|
4840
|
-
|
|
4934
|
+
React29.useEffect(() => {
|
|
4841
4935
|
if (isDisabled) return;
|
|
4842
4936
|
const onKeyDown = (event) => {
|
|
4843
4937
|
if (!(event.metaKey || event.ctrlKey) || event.altKey) return;
|
|
@@ -4851,7 +4945,7 @@ function useCommandPaletteShortcut(onTrigger, { key = "k", isDisabled } = {}) {
|
|
|
4851
4945
|
}
|
|
4852
4946
|
|
|
4853
4947
|
// src/components/patterns/AppLauncher.tsx
|
|
4854
|
-
import * as
|
|
4948
|
+
import * as React30 from "react";
|
|
4855
4949
|
import {
|
|
4856
4950
|
DialogTrigger,
|
|
4857
4951
|
Button as AriaButton17,
|
|
@@ -4859,7 +4953,7 @@ import {
|
|
|
4859
4953
|
Dialog as AriaDialog5,
|
|
4860
4954
|
useFilter as useFilter2
|
|
4861
4955
|
} from "react-aria-components";
|
|
4862
|
-
import { Fragment as Fragment10, jsx as
|
|
4956
|
+
import { Fragment as Fragment10, jsx as jsx71, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
4863
4957
|
var searchableText2 = (item) => [item.label, item.description, item.keywords].filter(Boolean).join(" ");
|
|
4864
4958
|
function AppLauncher({
|
|
4865
4959
|
sections,
|
|
@@ -4878,13 +4972,13 @@ function AppLauncher({
|
|
|
4878
4972
|
className
|
|
4879
4973
|
}) {
|
|
4880
4974
|
const msg = usePireMessages();
|
|
4881
|
-
const [query, setQuery] =
|
|
4975
|
+
const [query, setQuery] = React30.useState("");
|
|
4882
4976
|
const { contains } = useFilter2({ sensitivity: "base" });
|
|
4883
4977
|
const handleSearch = (next) => {
|
|
4884
4978
|
setQuery(next);
|
|
4885
4979
|
onSearchChange?.(next);
|
|
4886
4980
|
};
|
|
4887
|
-
const visible =
|
|
4981
|
+
const visible = React30.useMemo(() => {
|
|
4888
4982
|
if (isFilteredExternally) return sections;
|
|
4889
4983
|
const q = query.trim();
|
|
4890
4984
|
if (!q) return sections;
|
|
@@ -4895,9 +4989,9 @@ function AppLauncher({
|
|
|
4895
4989
|
}, [sections, query, isFilteredExternally, contains]);
|
|
4896
4990
|
const isEmpty = !isLoading && visible.length === 0;
|
|
4897
4991
|
const label = ariaLabel ?? msg.appLauncherLabel;
|
|
4898
|
-
return /* @__PURE__ */
|
|
4899
|
-
/* @__PURE__ */
|
|
4900
|
-
/* @__PURE__ */
|
|
4992
|
+
return /* @__PURE__ */ jsxs60(DialogTrigger, { children: [
|
|
4993
|
+
/* @__PURE__ */ jsx71(AriaButton17, { className: "pire-launcher-trigger", "aria-label": label, children: /* @__PURE__ */ jsx71(Icon, { name: icon, size: 20 }) }),
|
|
4994
|
+
/* @__PURE__ */ jsx71(
|
|
4901
4995
|
Popover8,
|
|
4902
4996
|
{
|
|
4903
4997
|
className: cx("pire-launcher-popover", className),
|
|
@@ -4905,15 +4999,15 @@ function AppLauncher({
|
|
|
4905
4999
|
offset: 0,
|
|
4906
5000
|
crossOffset: 0,
|
|
4907
5001
|
containerPadding: 0,
|
|
4908
|
-
children: /* @__PURE__ */
|
|
4909
|
-
/* @__PURE__ */
|
|
4910
|
-
/* @__PURE__ */
|
|
4911
|
-
meta ? /* @__PURE__ */
|
|
5002
|
+
children: /* @__PURE__ */ jsx71(AriaDialog5, { className: "pire-launcher", "aria-label": label, children: ({ close }) => /* @__PURE__ */ jsxs60(Fragment10, { children: [
|
|
5003
|
+
/* @__PURE__ */ jsxs60("div", { className: "pire-launcher-head", children: [
|
|
5004
|
+
/* @__PURE__ */ jsx71("span", { className: "pire-launcher-title", children: title ?? msg.appLauncherTitle }),
|
|
5005
|
+
meta ? /* @__PURE__ */ jsx71("span", { className: "pire-launcher-meta", children: meta }) : null
|
|
4912
5006
|
] }),
|
|
4913
5007
|
isSearchable ? (
|
|
4914
5008
|
// autoFocus is right here specifically: the panel exists to be searched, and the
|
|
4915
5009
|
// user just chose to open it, so taking the caret is what they asked for.
|
|
4916
|
-
/* @__PURE__ */
|
|
5010
|
+
/* @__PURE__ */ jsx71(
|
|
4917
5011
|
Input,
|
|
4918
5012
|
{
|
|
4919
5013
|
"aria-label": msg.appLauncherSearch,
|
|
@@ -4927,17 +5021,17 @@ function AppLauncher({
|
|
|
4927
5021
|
}
|
|
4928
5022
|
)
|
|
4929
5023
|
) : null,
|
|
4930
|
-
isLoading ? /* @__PURE__ */
|
|
4931
|
-
isEmpty ? /* @__PURE__ */
|
|
5024
|
+
isLoading ? /* @__PURE__ */ jsx71("div", { className: "pire-launcher-empty", role: "status", "aria-live": "polite", children: msg.appLauncherLoading }) : null,
|
|
5025
|
+
isEmpty ? /* @__PURE__ */ jsx71("div", { className: "pire-launcher-empty", children: emptyLabel ?? msg.appLauncherEmpty }) : null,
|
|
4932
5026
|
visible.map((section, si) => (
|
|
4933
5027
|
// Sections are positional zones with no record identity, so the heading is the key
|
|
4934
5028
|
// where there is one. Same reasoning as ShellRail's groups.
|
|
4935
|
-
/* @__PURE__ */
|
|
4936
|
-
section.label ? /* @__PURE__ */
|
|
4937
|
-
/* @__PURE__ */
|
|
5029
|
+
/* @__PURE__ */ jsxs60("div", { className: "pire-launcher-section", children: [
|
|
5030
|
+
section.label ? /* @__PURE__ */ jsx71("div", { className: "pire-eyebrow", children: section.label }) : null,
|
|
5031
|
+
/* @__PURE__ */ jsx71("div", { className: "pire-launcher-grid", "data-variant": section.variant ?? "tile", children: section.items.map((item) => {
|
|
4938
5032
|
const isCurrent = item.id === value;
|
|
4939
5033
|
const showsDescription = (section.variant ?? "tile") === "tile" && Boolean(item.description);
|
|
4940
|
-
return /* @__PURE__ */
|
|
5034
|
+
return /* @__PURE__ */ jsxs60(
|
|
4941
5035
|
AriaButton17,
|
|
4942
5036
|
{
|
|
4943
5037
|
className: "pire-launcher-item",
|
|
@@ -4948,16 +5042,16 @@ function AppLauncher({
|
|
|
4948
5042
|
onAction?.(item.id);
|
|
4949
5043
|
},
|
|
4950
5044
|
children: [
|
|
4951
|
-
item.icon ? /* @__PURE__ */
|
|
5045
|
+
item.icon ? /* @__PURE__ */ jsx71("span", { className: "pire-launcher-item-icon", children: /* @__PURE__ */ jsx71(
|
|
4952
5046
|
Icon,
|
|
4953
5047
|
{
|
|
4954
5048
|
name: item.icon,
|
|
4955
5049
|
size: (section.variant ?? "tile") === "tile" ? 20 : 16
|
|
4956
5050
|
}
|
|
4957
5051
|
) }) : null,
|
|
4958
|
-
/* @__PURE__ */
|
|
4959
|
-
/* @__PURE__ */
|
|
4960
|
-
showsDescription ? /* @__PURE__ */
|
|
5052
|
+
/* @__PURE__ */ jsxs60("span", { className: "pire-launcher-item-text", children: [
|
|
5053
|
+
/* @__PURE__ */ jsx71("span", { className: "pire-launcher-item-label", children: item.label }),
|
|
5054
|
+
showsDescription ? /* @__PURE__ */ jsx71("span", { className: "pire-launcher-item-desc", children: item.description }) : null
|
|
4961
5055
|
] })
|
|
4962
5056
|
]
|
|
4963
5057
|
},
|
|
@@ -4974,7 +5068,7 @@ function AppLauncher({
|
|
|
4974
5068
|
|
|
4975
5069
|
// src/components/patterns/SidePanel.tsx
|
|
4976
5070
|
import { ModalOverlay as ModalOverlay3, Modal as Modal3, Dialog as AriaDialog6, Heading as Heading5 } from "react-aria-components";
|
|
4977
|
-
import { jsx as
|
|
5071
|
+
import { jsx as jsx72, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
4978
5072
|
function SidePanel({
|
|
4979
5073
|
isOpen,
|
|
4980
5074
|
title,
|
|
@@ -4986,7 +5080,7 @@ function SidePanel({
|
|
|
4986
5080
|
className
|
|
4987
5081
|
}) {
|
|
4988
5082
|
const msg = usePireMessages();
|
|
4989
|
-
return /* @__PURE__ */
|
|
5083
|
+
return /* @__PURE__ */ jsx72(
|
|
4990
5084
|
ModalOverlay3,
|
|
4991
5085
|
{
|
|
4992
5086
|
className: "pire-sidepanel-overlay",
|
|
@@ -4995,23 +5089,23 @@ function SidePanel({
|
|
|
4995
5089
|
onOpenChange: (o) => {
|
|
4996
5090
|
if (!o) onClose?.();
|
|
4997
5091
|
},
|
|
4998
|
-
children: /* @__PURE__ */
|
|
4999
|
-
/* @__PURE__ */
|
|
5000
|
-
/* @__PURE__ */
|
|
5001
|
-
/* @__PURE__ */
|
|
5002
|
-
subtitle ? /* @__PURE__ */
|
|
5092
|
+
children: /* @__PURE__ */ jsx72(Modal3, { className: cx("pire-sidepanel", className), style: { width }, children: /* @__PURE__ */ jsxs61(AriaDialog6, { className: "pire-dialog", style: { height: "100%" }, children: [
|
|
5093
|
+
/* @__PURE__ */ jsxs61("header", { className: "pire-dialog-head", children: [
|
|
5094
|
+
/* @__PURE__ */ jsxs61("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
5095
|
+
/* @__PURE__ */ jsx72(Heading5, { slot: "title", className: "pire-dialog-title", children: title }),
|
|
5096
|
+
subtitle ? /* @__PURE__ */ jsx72("p", { className: "pire-dialog-sub", style: { margin: 0 }, children: subtitle }) : null
|
|
5003
5097
|
] }),
|
|
5004
|
-
/* @__PURE__ */
|
|
5098
|
+
/* @__PURE__ */ jsx72(IconButton, { icon: "x", label: msg.sidePanelClose, size: "sm", onPress: onClose })
|
|
5005
5099
|
] }),
|
|
5006
|
-
/* @__PURE__ */
|
|
5007
|
-
footer ? /* @__PURE__ */
|
|
5100
|
+
/* @__PURE__ */ jsx72("div", { className: "pire-dialog-body", style: { flex: 1 }, children }),
|
|
5101
|
+
footer ? /* @__PURE__ */ jsx72("footer", { className: "pire-dialog-foot", children: footer }) : null
|
|
5008
5102
|
] }) })
|
|
5009
5103
|
}
|
|
5010
5104
|
);
|
|
5011
5105
|
}
|
|
5012
5106
|
|
|
5013
5107
|
// src/components/patterns/EmptyState.tsx
|
|
5014
|
-
import { jsx as
|
|
5108
|
+
import { jsx as jsx73, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
5015
5109
|
function EmptyState({
|
|
5016
5110
|
icon = "file-text",
|
|
5017
5111
|
title,
|
|
@@ -5021,17 +5115,18 @@ function EmptyState({
|
|
|
5021
5115
|
className,
|
|
5022
5116
|
...rest
|
|
5023
5117
|
}) {
|
|
5024
|
-
return /* @__PURE__ */
|
|
5025
|
-
/* @__PURE__ */
|
|
5026
|
-
title ? /* @__PURE__ */
|
|
5027
|
-
children ? /* @__PURE__ */
|
|
5118
|
+
return /* @__PURE__ */ jsxs62("div", { className: cx("pire-empty", className), "data-compact": compact ? "true" : void 0, ...rest, children: [
|
|
5119
|
+
/* @__PURE__ */ jsx73(Icon, { name: icon, size: 24, className: "pire-empty-icon" }),
|
|
5120
|
+
title ? /* @__PURE__ */ jsx73("p", { className: "pire-empty-title", style: { margin: 0 }, children: title }) : null,
|
|
5121
|
+
children ? /* @__PURE__ */ jsx73("p", { className: "pire-empty-body", style: { margin: 0 }, children }) : null,
|
|
5028
5122
|
action
|
|
5029
5123
|
] });
|
|
5030
5124
|
}
|
|
5031
5125
|
|
|
5032
5126
|
// src/components/patterns/NumPad.tsx
|
|
5033
|
-
import * as
|
|
5034
|
-
import {
|
|
5127
|
+
import * as React31 from "react";
|
|
5128
|
+
import { useLocale as useLocale2 } from "react-aria-components";
|
|
5129
|
+
import { jsx as jsx74, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
5035
5130
|
var BASE_KEYS = [
|
|
5036
5131
|
{ value: "7" },
|
|
5037
5132
|
{ value: "8" },
|
|
@@ -5047,10 +5142,16 @@ var BASE_KEYS = [
|
|
|
5047
5142
|
{ value: "0" }
|
|
5048
5143
|
];
|
|
5049
5144
|
var isInsertable = (value) => /^[0-9]+$/.test(value);
|
|
5145
|
+
function fittingDigits(digits, buffer, separator, maxFractionDigits) {
|
|
5146
|
+
const separatorAt = buffer.indexOf(separator);
|
|
5147
|
+
if (separatorAt === -1) return digits;
|
|
5148
|
+
const room = maxFractionDigits - (buffer.length - separatorAt - 1);
|
|
5149
|
+
return room <= 0 ? "" : digits.slice(0, room);
|
|
5150
|
+
}
|
|
5050
5151
|
function useNumPadKeyboard(onKey, isDisabled, containerRef) {
|
|
5051
|
-
const handler =
|
|
5152
|
+
const handler = React31.useRef(onKey);
|
|
5052
5153
|
handler.current = onKey;
|
|
5053
|
-
|
|
5154
|
+
React31.useEffect(() => {
|
|
5054
5155
|
if (isDisabled) return;
|
|
5055
5156
|
const isEditingElsewhere = () => {
|
|
5056
5157
|
const el = document.activeElement;
|
|
@@ -5074,6 +5175,10 @@ function useNumPadKeyboard(onKey, isDisabled, containerRef) {
|
|
|
5074
5175
|
handler.current("clear");
|
|
5075
5176
|
return;
|
|
5076
5177
|
}
|
|
5178
|
+
if (event.key === "," || event.key === ".") {
|
|
5179
|
+
handler.current("decimal");
|
|
5180
|
+
return;
|
|
5181
|
+
}
|
|
5077
5182
|
};
|
|
5078
5183
|
document.addEventListener("keydown", onKeyDown);
|
|
5079
5184
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
@@ -5086,14 +5191,18 @@ function NumPad({
|
|
|
5086
5191
|
onChange,
|
|
5087
5192
|
extraKeys = [],
|
|
5088
5193
|
onAction,
|
|
5194
|
+
maxFractionDigits,
|
|
5089
5195
|
isDisabled,
|
|
5090
5196
|
size = "md",
|
|
5091
5197
|
className,
|
|
5092
5198
|
style
|
|
5093
5199
|
}) {
|
|
5094
5200
|
const msg = usePireMessages();
|
|
5095
|
-
const containerRef =
|
|
5096
|
-
const
|
|
5201
|
+
const containerRef = React31.useRef(null);
|
|
5202
|
+
const { locale } = useLocale2();
|
|
5203
|
+
const separator = decimalSeparatorFor(locale);
|
|
5204
|
+
const allowsDecimal = maxFractionDigits !== void 0 && maxFractionDigits > 0;
|
|
5205
|
+
const applyKey = React31.useCallback(
|
|
5097
5206
|
(key) => {
|
|
5098
5207
|
if (isDisabled) return;
|
|
5099
5208
|
if (key.value === "backspace") {
|
|
@@ -5104,17 +5213,28 @@ function NumPad({
|
|
|
5104
5213
|
onChange("");
|
|
5105
5214
|
return;
|
|
5106
5215
|
}
|
|
5216
|
+
if (key.value === "decimal") {
|
|
5217
|
+
if (!allowsDecimal || value.includes(separator)) return;
|
|
5218
|
+
onChange((value === "" ? "0" : value) + separator);
|
|
5219
|
+
return;
|
|
5220
|
+
}
|
|
5107
5221
|
if (isInsertable(key.value)) {
|
|
5108
|
-
onChange(
|
|
5222
|
+
onChange(
|
|
5223
|
+
value + (allowsDecimal ? fittingDigits(key.value, value, separator, maxFractionDigits) : key.value)
|
|
5224
|
+
);
|
|
5109
5225
|
return;
|
|
5110
5226
|
}
|
|
5111
5227
|
onAction?.(key.value);
|
|
5112
5228
|
},
|
|
5113
|
-
[isDisabled, value, onChange, onAction]
|
|
5229
|
+
[isDisabled, value, onChange, onAction, allowsDecimal, separator, maxFractionDigits]
|
|
5114
5230
|
);
|
|
5115
5231
|
useNumPadKeyboard((keyValue) => applyKey({ value: keyValue }), isDisabled, containerRef);
|
|
5116
|
-
const keys = [
|
|
5117
|
-
|
|
5232
|
+
const keys = [
|
|
5233
|
+
...BASE_KEYS,
|
|
5234
|
+
...allowsDecimal ? [{ value: "decimal", label: separator }] : [],
|
|
5235
|
+
...extraKeys
|
|
5236
|
+
];
|
|
5237
|
+
return /* @__PURE__ */ jsxs63(
|
|
5118
5238
|
"div",
|
|
5119
5239
|
{
|
|
5120
5240
|
ref: containerRef,
|
|
@@ -5123,10 +5243,10 @@ function NumPad({
|
|
|
5123
5243
|
"data-size": size,
|
|
5124
5244
|
"data-disabled": isDisabled ? "true" : void 0,
|
|
5125
5245
|
children: [
|
|
5126
|
-
target !== void 0 ? /* @__PURE__ */
|
|
5127
|
-
/* @__PURE__ */
|
|
5128
|
-
const accessibleLabel = key.value === "backspace" ? msg.numPadBackspace : key.value === "clear" ? msg.numPadClear : void 0;
|
|
5129
|
-
return /* @__PURE__ */
|
|
5246
|
+
target !== void 0 ? /* @__PURE__ */ jsx74("div", { className: "pire-numpad-target", role: "status", "aria-live": "polite", children: target }) : null,
|
|
5247
|
+
/* @__PURE__ */ jsx74("div", { className: "pire-numpad-grid", role: "group", "aria-label": ariaLabel, children: keys.map((key) => {
|
|
5248
|
+
const accessibleLabel = key.value === "backspace" ? msg.numPadBackspace : key.value === "clear" ? msg.numPadClear : key.value === "decimal" ? msg.numPadDecimal : void 0;
|
|
5249
|
+
return /* @__PURE__ */ jsx74(
|
|
5130
5250
|
Button,
|
|
5131
5251
|
{
|
|
5132
5252
|
variant: "secondary",
|
|
@@ -5134,6 +5254,7 @@ function NumPad({
|
|
|
5134
5254
|
fullWidth: true,
|
|
5135
5255
|
className: "pire-numpad-key",
|
|
5136
5256
|
"data-span": key.span === 2 ? "2" : void 0,
|
|
5257
|
+
"data-key": key.value === "decimal" ? "decimal" : void 0,
|
|
5137
5258
|
isDisabled,
|
|
5138
5259
|
"aria-label": accessibleLabel,
|
|
5139
5260
|
onPress: () => applyKey(key),
|
|
@@ -5148,9 +5269,9 @@ function NumPad({
|
|
|
5148
5269
|
}
|
|
5149
5270
|
|
|
5150
5271
|
// src/components/patterns/FileDropZone.tsx
|
|
5151
|
-
import * as
|
|
5272
|
+
import * as React32 from "react";
|
|
5152
5273
|
import { DropZone, FileTrigger as FileTrigger2, isFileDropItem } from "react-aria-components";
|
|
5153
|
-
import { jsx as
|
|
5274
|
+
import { jsx as jsx75, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
5154
5275
|
var isImage2 = (file) => file.type.startsWith("image/");
|
|
5155
5276
|
function FileDropZone({
|
|
5156
5277
|
label,
|
|
@@ -5178,10 +5299,10 @@ function FileDropZone({
|
|
|
5178
5299
|
...rest
|
|
5179
5300
|
}) {
|
|
5180
5301
|
const msg = usePireMessages();
|
|
5181
|
-
const [uncontrolled, setUncontrolled] =
|
|
5302
|
+
const [uncontrolled, setUncontrolled] = React32.useState(defaultValue ?? []);
|
|
5182
5303
|
const files = value ?? uncontrolled;
|
|
5183
|
-
const created =
|
|
5184
|
-
|
|
5304
|
+
const created = React32.useRef([]);
|
|
5305
|
+
React32.useEffect(
|
|
5185
5306
|
() => () => {
|
|
5186
5307
|
for (const url of created.current) URL.revokeObjectURL(url);
|
|
5187
5308
|
},
|
|
@@ -5204,12 +5325,12 @@ function FileDropZone({
|
|
|
5204
5325
|
commit(allowsMultiple ? [...files, ...wrapped] : wrapped.slice(0, 1));
|
|
5205
5326
|
};
|
|
5206
5327
|
const remove = (target) => commit(files.filter((f) => f.file !== target));
|
|
5207
|
-
return /* @__PURE__ */
|
|
5208
|
-
label ? /* @__PURE__ */
|
|
5328
|
+
return /* @__PURE__ */ jsxs64("div", { className: cx("pire-field", className), style, "data-full-width": String(fullWidth), ...rest, children: [
|
|
5329
|
+
label ? /* @__PURE__ */ jsxs64("span", { className: "pire-field-label", children: [
|
|
5209
5330
|
label,
|
|
5210
|
-
isRequired ? /* @__PURE__ */
|
|
5331
|
+
isRequired ? /* @__PURE__ */ jsx75("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
5211
5332
|
] }) : null,
|
|
5212
|
-
/* @__PURE__ */
|
|
5333
|
+
/* @__PURE__ */ jsxs64(
|
|
5213
5334
|
DropZone,
|
|
5214
5335
|
{
|
|
5215
5336
|
className: "pire-dropzone",
|
|
@@ -5221,25 +5342,25 @@ function FileDropZone({
|
|
|
5221
5342
|
accept(dropped);
|
|
5222
5343
|
},
|
|
5223
5344
|
children: [
|
|
5224
|
-
/* @__PURE__ */
|
|
5225
|
-
/* @__PURE__ */
|
|
5226
|
-
/* @__PURE__ */
|
|
5345
|
+
/* @__PURE__ */ jsx75(Icon, { name: "download", size: 24, className: "pire-dropzone-icon" }),
|
|
5346
|
+
/* @__PURE__ */ jsx75("span", { className: "pire-dropzone-prompt", children: promptLabel ?? msg.fileDropZonePrompt }),
|
|
5347
|
+
/* @__PURE__ */ jsx75(
|
|
5227
5348
|
FileTrigger2,
|
|
5228
5349
|
{
|
|
5229
5350
|
acceptedFileTypes,
|
|
5230
5351
|
allowsMultiple,
|
|
5231
5352
|
onSelect: (list) => accept(list ? [...list] : []),
|
|
5232
|
-
children: /* @__PURE__ */
|
|
5353
|
+
children: /* @__PURE__ */ jsx75(Button, { variant: "secondary", isDisabled: isDisabled || isReadOnly, children: msg.fileUploadChoose })
|
|
5233
5354
|
}
|
|
5234
5355
|
)
|
|
5235
5356
|
]
|
|
5236
5357
|
}
|
|
5237
5358
|
),
|
|
5238
|
-
files.length ? /* @__PURE__ */
|
|
5239
|
-
previewUrl ? /* @__PURE__ */
|
|
5240
|
-
/* @__PURE__ */
|
|
5241
|
-
/* @__PURE__ */
|
|
5242
|
-
isDisabled || isReadOnly ? null : /* @__PURE__ */
|
|
5359
|
+
files.length ? /* @__PURE__ */ jsx75("ul", { className: "pire-fileupload-list", children: files.map(({ file, previewUrl }) => /* @__PURE__ */ jsxs64("li", { className: "pire-fileupload-item", children: [
|
|
5360
|
+
previewUrl ? /* @__PURE__ */ jsx75("img", { className: "pire-fileupload-thumb", src: previewUrl, alt: "" }) : /* @__PURE__ */ jsx75(Icon, { name: "file-text", size: 16, className: "pire-fileupload-icon" }),
|
|
5361
|
+
/* @__PURE__ */ jsx75("span", { className: "pire-fileupload-name", children: file.name }),
|
|
5362
|
+
/* @__PURE__ */ jsx75("span", { className: "pire-fileupload-size", children: formatFileSize(file.size) }),
|
|
5363
|
+
isDisabled || isReadOnly ? null : /* @__PURE__ */ jsx75(
|
|
5243
5364
|
IconButton,
|
|
5244
5365
|
{
|
|
5245
5366
|
icon: "x",
|
|
@@ -5249,9 +5370,9 @@ function FileDropZone({
|
|
|
5249
5370
|
}
|
|
5250
5371
|
)
|
|
5251
5372
|
] }, `${file.name}-${file.size}-${file.lastModified}`)) }) : null,
|
|
5252
|
-
uploadProgress != null ? /* @__PURE__ */
|
|
5253
|
-
description ? /* @__PURE__ */
|
|
5254
|
-
isInvalid && errorMessage ? /* @__PURE__ */
|
|
5373
|
+
uploadProgress != null ? /* @__PURE__ */ jsx75(ProgressBar, { value: uploadProgress, label: msg.fileUploadUploading }) : null,
|
|
5374
|
+
description ? /* @__PURE__ */ jsx75("span", { className: "pire-field-hint", children: description }) : null,
|
|
5375
|
+
isInvalid && errorMessage ? /* @__PURE__ */ jsx75("span", { className: "pire-field-error", children: errorMessage }) : null
|
|
5255
5376
|
] });
|
|
5256
5377
|
}
|
|
5257
5378
|
|
|
@@ -5291,6 +5412,7 @@ export {
|
|
|
5291
5412
|
DialogTrigger2 as DialogTrigger,
|
|
5292
5413
|
DonutChart,
|
|
5293
5414
|
EmptyState,
|
|
5415
|
+
FieldHelp,
|
|
5294
5416
|
FileDropZone,
|
|
5295
5417
|
FileUpload,
|
|
5296
5418
|
FilterBar,
|