@orianatech/pire 1.4.1 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/core/Avatar.d.ts.map +1 -1
- package/dist/components/core/Badge.d.ts.map +1 -1
- package/dist/components/core/Button.d.ts.map +1 -1
- package/dist/components/core/Card.d.ts.map +1 -1
- package/dist/components/core/Heading.d.ts.map +1 -1
- package/dist/components/core/Icon.d.ts.map +1 -1
- package/dist/components/core/IconButton.d.ts.map +1 -1
- package/dist/components/core/Kbd.d.ts.map +1 -1
- package/dist/components/core/SegmentedControl.d.ts.map +1 -1
- package/dist/components/core/Separator.d.ts.map +1 -1
- package/dist/components/core/Tag.d.ts.map +1 -1
- package/dist/components/core/Text.d.ts.map +1 -1
- package/dist/components/core/icon-map.d.ts.map +1 -1
- package/dist/components/data/BarChart.d.ts.map +1 -1
- package/dist/components/data/ChartFrame.d.ts.map +1 -1
- package/dist/components/data/DataTable.d.ts.map +1 -1
- package/dist/components/data/DescriptionList.d.ts.map +1 -1
- package/dist/components/data/DonutChart.d.ts.map +1 -1
- package/dist/components/data/FilterBar.d.ts.map +1 -1
- package/dist/components/data/KpiTile.d.cts +1 -1
- package/dist/components/data/KpiTile.d.ts +1 -1
- package/dist/components/data/KpiTile.d.ts.map +1 -1
- package/dist/components/data/LineChart.d.ts.map +1 -1
- package/dist/components/data/LinkList.d.ts.map +1 -1
- package/dist/components/data/ObjectHeader.d.ts.map +1 -1
- package/dist/components/data/RecordCard.d.ts.map +1 -1
- package/dist/components/data/ViewSwitcher.d.cts +1 -1
- package/dist/components/data/ViewSwitcher.d.ts +1 -1
- package/dist/components/data/ViewSwitcher.d.ts.map +1 -1
- package/dist/components/data/chartGeometry.d.ts.map +1 -1
- package/dist/components/feedback/Dialog.d.cts +1 -1
- package/dist/components/feedback/Dialog.d.ts +1 -1
- package/dist/components/feedback/Dialog.d.ts.map +1 -1
- package/dist/components/feedback/InlineMessage.d.ts.map +1 -1
- package/dist/components/feedback/ProgressBar.d.cts +1 -1
- package/dist/components/feedback/ProgressBar.d.ts +1 -1
- package/dist/components/feedback/ProgressBar.d.ts.map +1 -1
- package/dist/components/feedback/Skeleton.d.ts.map +1 -1
- package/dist/components/feedback/Toast.d.cts +1 -1
- package/dist/components/feedback/Toast.d.ts +1 -1
- package/dist/components/feedback/Toast.d.ts.map +1 -1
- package/dist/components/feedback/Tooltip.d.ts.map +1 -1
- package/dist/components/forms/Checkbox.d.ts.map +1 -1
- package/dist/components/forms/ChoiceCardGroup.d.ts.map +1 -1
- package/dist/components/forms/ComboBox.d.ts.map +1 -1
- package/dist/components/forms/DatePicker.d.ts.map +1 -1
- package/dist/components/forms/DateRangePicker.d.ts.map +1 -1
- package/dist/components/forms/FileUpload.d.ts.map +1 -1
- package/dist/components/forms/FormField.d.ts.map +1 -1
- package/dist/components/forms/Input.d.ts.map +1 -1
- package/dist/components/forms/MultiComboBox.d.ts.map +1 -1
- package/dist/components/forms/NumberField.d.ts.map +1 -1
- package/dist/components/forms/QuantityStepper.d.ts.map +1 -1
- package/dist/components/forms/Radio.d.ts.map +1 -1
- package/dist/components/forms/Select.d.ts.map +1 -1
- package/dist/components/forms/Switch.d.ts.map +1 -1
- package/dist/components/forms/TextArea.d.ts.map +1 -1
- package/dist/components/forms/ValueHelpField.d.cts +1 -1
- package/dist/components/forms/ValueHelpField.d.ts +1 -1
- package/dist/components/forms/ValueHelpField.d.ts.map +1 -1
- package/dist/components/forms/dateValues.d.ts.map +1 -1
- package/dist/components/layout/PageBand.d.ts.map +1 -1
- package/dist/components/layout/SectionHeader.d.ts.map +1 -1
- package/dist/components/layout/SelectionBar.d.ts.map +1 -1
- package/dist/components/layout/SplitPane.d.ts.map +1 -1
- package/dist/components/navigation/Breadcrumb.d.ts.map +1 -1
- package/dist/components/navigation/Menu.d.ts.map +1 -1
- package/dist/components/navigation/Pagination.d.cts +1 -1
- package/dist/components/navigation/Pagination.d.ts +1 -1
- package/dist/components/navigation/Pagination.d.ts.map +1 -1
- package/dist/components/navigation/Ribbon.d.ts.map +1 -1
- package/dist/components/navigation/ShellBar.d.ts.map +1 -1
- package/dist/components/navigation/ShellRail.d.ts.map +1 -1
- package/dist/components/navigation/SideNav.d.cts +9 -1
- package/dist/components/navigation/SideNav.d.ts +9 -1
- package/dist/components/navigation/SideNav.d.ts.map +1 -1
- package/dist/components/navigation/Tabs.d.ts.map +1 -1
- package/dist/components/patterns/AppLauncher.d.cts +1 -1
- package/dist/components/patterns/AppLauncher.d.ts +1 -1
- package/dist/components/patterns/AppLauncher.d.ts.map +1 -1
- package/dist/components/patterns/CommandPalette.d.ts.map +1 -1
- package/dist/components/patterns/ConfirmDialog.d.cts +1 -1
- package/dist/components/patterns/ConfirmDialog.d.ts +1 -1
- package/dist/components/patterns/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/patterns/EmptyState.d.ts.map +1 -1
- package/dist/components/patterns/FileDropZone.d.ts.map +1 -1
- package/dist/components/patterns/NumPad.d.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/patterns/SidePanel.d.cts +1 -1
- package/dist/components/patterns/SidePanel.d.ts +1 -1
- package/dist/components/patterns/SidePanel.d.ts.map +1 -1
- package/dist/components/patterns/ValueHelpDialog.d.cts +1 -1
- package/dist/components/patterns/ValueHelpDialog.d.ts +1 -1
- package/dist/components/patterns/ValueHelpDialog.d.ts.map +1 -1
- package/dist/components/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.css +3661 -691
- package/dist/i18n/PireIntlProvider.d.ts.map +1 -1
- package/dist/i18n/messages.d.cts +3 -0
- package/dist/i18n/messages.d.ts +3 -0
- package/dist/i18n/messages.d.ts.map +1 -1
- package/dist/index.cjs +659 -263
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -17
- package/dist/index.d.ts +17 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +663 -254
- package/dist/index.js.map +1 -1
- package/dist/tokens/base.css +64 -13
- package/dist/tokens/colors.css +156 -78
- package/dist/tokens/elevation.css +20 -16
- package/dist/tokens/fonts.css +49 -7
- package/dist/tokens/motion.css +15 -12
- package/dist/tokens/spacing.css +41 -16
- package/dist/tokens/themes.css +88 -32
- package/dist/tokens/typography.css +43 -36
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -52,17 +52,17 @@ __export(src_exports, {
|
|
|
52
52
|
DialogBody: () => DialogBody,
|
|
53
53
|
DialogDescription: () => DialogDescription,
|
|
54
54
|
DialogTitle: () => DialogTitle,
|
|
55
|
-
DialogTrigger: () =>
|
|
55
|
+
DialogTrigger: () => import_react_aria_components40.DialogTrigger,
|
|
56
56
|
DonutChart: () => DonutChart,
|
|
57
57
|
EmptyState: () => EmptyState,
|
|
58
58
|
FileDropZone: () => FileDropZone,
|
|
59
59
|
FileUpload: () => FileUpload,
|
|
60
60
|
FilterBar: () => FilterBar,
|
|
61
|
-
Focusable: () =>
|
|
61
|
+
Focusable: () => import_react_aria_components41.Focusable,
|
|
62
62
|
FooterBar: () => FooterBar,
|
|
63
63
|
FormField: () => FormField,
|
|
64
64
|
Heading: () => Heading,
|
|
65
|
-
I18nProvider: () =>
|
|
65
|
+
I18nProvider: () => import_react_aria_components40.I18nProvider,
|
|
66
66
|
ICON_NAMES: () => ICON_NAMES,
|
|
67
67
|
Icon: () => Icon,
|
|
68
68
|
IconButton: () => IconButton,
|
|
@@ -77,7 +77,7 @@ __export(src_exports, {
|
|
|
77
77
|
MenuItem: () => MenuItem,
|
|
78
78
|
MenuSection: () => MenuSection,
|
|
79
79
|
MenuSeparator: () => MenuSeparator,
|
|
80
|
-
MenuTrigger: () =>
|
|
80
|
+
MenuTrigger: () => import_react_aria_components40.MenuTrigger,
|
|
81
81
|
MultiComboBox: () => MultiComboBox,
|
|
82
82
|
NumPad: () => NumPad,
|
|
83
83
|
NumberField: () => NumberField,
|
|
@@ -86,14 +86,14 @@ __export(src_exports, {
|
|
|
86
86
|
PageHeader: () => PageHeader,
|
|
87
87
|
Pagination: () => Pagination,
|
|
88
88
|
PireIntlProvider: () => PireIntlProvider,
|
|
89
|
-
Popover: () =>
|
|
89
|
+
Popover: () => import_react_aria_components40.Popover,
|
|
90
90
|
ProgressBar: () => ProgressBar,
|
|
91
91
|
QuantityStepper: () => QuantityStepper,
|
|
92
92
|
Radio: () => Radio,
|
|
93
93
|
RadioGroup: () => RadioGroup,
|
|
94
94
|
RecordCard: () => RecordCard,
|
|
95
95
|
Ribbon: () => Ribbon,
|
|
96
|
-
RouterProvider: () =>
|
|
96
|
+
RouterProvider: () => import_react_aria_components40.RouterProvider,
|
|
97
97
|
SectionHeader: () => SectionHeader,
|
|
98
98
|
SegmentedControl: () => SegmentedControl,
|
|
99
99
|
Select: () => Select,
|
|
@@ -107,7 +107,7 @@ __export(src_exports, {
|
|
|
107
107
|
SkeletonTableRow: () => SkeletonTableRow,
|
|
108
108
|
SplitPane: () => SplitPane,
|
|
109
109
|
Strong: () => Strong,
|
|
110
|
-
SubmenuTrigger: () =>
|
|
110
|
+
SubmenuTrigger: () => import_react_aria_components40.SubmenuTrigger,
|
|
111
111
|
Switch: () => Switch,
|
|
112
112
|
Tabs: () => Tabs,
|
|
113
113
|
Tag: () => Tag,
|
|
@@ -557,9 +557,26 @@ var import_react_aria_components3 = require("react-aria-components");
|
|
|
557
557
|
// src/components/feedback/Tooltip.tsx
|
|
558
558
|
var React2 = __toESM(require("react"), 1);
|
|
559
559
|
var import_react_aria_components2 = require("react-aria-components");
|
|
560
|
-
var import_jsx_runtime3 =
|
|
560
|
+
var import_jsx_runtime3 = (
|
|
561
|
+
// `Focusable` also dev-warns when the element it clones onto has neither a native
|
|
562
|
+
// interactive tag nor an ARIA widget role — a bare `<span>` is neither. Every disabled
|
|
563
|
+
// control this wraps (`IconButton`, `Button`, …) is button-shaped, so `role="button"` plus
|
|
564
|
+
// `aria-disabled` describes the wrapper the same way its disabled child already describes
|
|
565
|
+
// itself, and is what lets the accessible name (from the child's own text or `aria-label`)
|
|
566
|
+
// reach the element that actually holds focus. No static `tabIndex` here on purpose: it
|
|
567
|
+
// would win over the one `Focusable` computes at clone time (react-aria's `mergeProps` lets
|
|
568
|
+
// a prop already on this element beat the one it supplies), silently making the span
|
|
569
|
+
// unfocusable again and reintroducing the defect this file exists to fix. A real `<button>`
|
|
570
|
+
// is not an option either: `children` is very often a button itself (`IconButton`), and a
|
|
571
|
+
// button nested in a button is invalid HTML that browsers repair by breaking the DOM tree.
|
|
572
|
+
// biome-ignore lint/a11y/useFocusableInteractive: tabIndex is added by Focusable's clone, not statically — see above.
|
|
573
|
+
// biome-ignore lint/a11y/useSemanticElements: a real <button> would nest inside the disabled child, which is often one itself — see above.
|
|
574
|
+
require("react/jsx-runtime")
|
|
575
|
+
);
|
|
561
576
|
function Tooltip({ label, placement = "top", delay = 500, children }) {
|
|
562
|
-
const props = React2.isValidElement(
|
|
577
|
+
const props = React2.isValidElement(
|
|
578
|
+
children
|
|
579
|
+
) ? children.props : void 0;
|
|
563
580
|
const isDisabledChild = props?.isDisabled === true || props?.disabled === true;
|
|
564
581
|
const target = React2.isValidElement(children) && !isDisabledChild ? React2.cloneElement(children, { className: cx(children.props.className, "pire-tooltip-target") }) : isDisabledChild ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "pire-tooltip-target", role: "button", "aria-disabled": "true", children }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "pire-tooltip-target", children });
|
|
565
582
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_aria_components2.TooltipTrigger, { delay, closeDelay: 0, children: [
|
|
@@ -701,6 +718,7 @@ var enMessages = {
|
|
|
701
718
|
chartEmpty: "No data for this period",
|
|
702
719
|
numPadClear: "Clear",
|
|
703
720
|
numPadBackspace: "Remove last digit",
|
|
721
|
+
numPadDecimal: "Decimal separator",
|
|
704
722
|
viewSwitcherName: "Saved views: {view}",
|
|
705
723
|
viewSwitcherNameModified: "Saved views: {view}, modified",
|
|
706
724
|
viewSwitcherModifiedMark: "\xB7 modified",
|
|
@@ -785,6 +803,7 @@ var esMessages = {
|
|
|
785
803
|
chartEmpty: "Sin datos para este per\xEDodo",
|
|
786
804
|
numPadClear: "Limpiar",
|
|
787
805
|
numPadBackspace: "Borrar \xFAltimo d\xEDgito",
|
|
806
|
+
numPadDecimal: "Separador decimal",
|
|
788
807
|
viewSwitcherName: "Vistas guardadas: {view}",
|
|
789
808
|
viewSwitcherNameModified: "Vistas guardadas: {view}, modificada",
|
|
790
809
|
viewSwitcherModifiedMark: "\xB7 modificada",
|
|
@@ -806,10 +825,7 @@ var esMessages = {
|
|
|
806
825
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
807
826
|
var MessagesContext = React5.createContext(enMessages);
|
|
808
827
|
function PireIntlProvider({ messages, children }) {
|
|
809
|
-
const value = React5.useMemo(
|
|
810
|
-
() => messages ? { ...enMessages, ...messages } : enMessages,
|
|
811
|
-
[messages]
|
|
812
|
-
);
|
|
828
|
+
const value = React5.useMemo(() => messages ? { ...enMessages, ...messages } : enMessages, [messages]);
|
|
813
829
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MessagesContext.Provider, { value, children });
|
|
814
830
|
}
|
|
815
831
|
function usePireMessages() {
|
|
@@ -824,37 +840,64 @@ function useMessage(key, override) {
|
|
|
824
840
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
825
841
|
var Tag = React6.forwardRef(function Tag2({ children, onRemove, isDisabled, category, className, ...rest }, ref) {
|
|
826
842
|
const msg = usePireMessages();
|
|
827
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
844
|
+
"span",
|
|
845
|
+
{
|
|
846
|
+
ref,
|
|
847
|
+
className: cx("pire-tag", className),
|
|
848
|
+
"data-disabled": isDisabled ? "true" : void 0,
|
|
849
|
+
...rest,
|
|
850
|
+
children: [
|
|
851
|
+
category ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "pire-tag-swatch", "data-category": category, "aria-hidden": "true" }) : null,
|
|
852
|
+
children,
|
|
853
|
+
onRemove ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
854
|
+
import_react_aria_components4.Button,
|
|
855
|
+
{
|
|
856
|
+
className: "pire-tag-remove",
|
|
857
|
+
isDisabled,
|
|
858
|
+
onPress: onRemove,
|
|
859
|
+
"aria-label": typeof children === "string" ? msg.tagRemoveNamed.replace("{name}", children) : msg.tagRemove,
|
|
860
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "x", size: 12 })
|
|
861
|
+
}
|
|
862
|
+
) : null
|
|
863
|
+
]
|
|
864
|
+
}
|
|
865
|
+
);
|
|
841
866
|
});
|
|
842
867
|
|
|
843
868
|
// src/components/core/Card.tsx
|
|
844
869
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
845
|
-
function Card({
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
870
|
+
function Card({
|
|
871
|
+
title,
|
|
872
|
+
subtitle,
|
|
873
|
+
icon,
|
|
874
|
+
actions,
|
|
875
|
+
footer,
|
|
876
|
+
interactive,
|
|
877
|
+
children,
|
|
878
|
+
className,
|
|
879
|
+
...rest
|
|
880
|
+
}) {
|
|
881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
882
|
+
"section",
|
|
883
|
+
{
|
|
884
|
+
className: cx("pire-card", className),
|
|
885
|
+
"data-interactive": interactive ? "true" : void 0,
|
|
886
|
+
...rest,
|
|
887
|
+
children: [
|
|
888
|
+
title || actions ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("header", { className: "pire-card-head", children: [
|
|
889
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: icon, size: 20, style: { color: "var(--text-secondary)" } }) : null,
|
|
890
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
891
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { className: "pire-card-title", children: title }),
|
|
892
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "pire-card-sub", style: { margin: 0 }, children: subtitle }) : null
|
|
893
|
+
] }),
|
|
894
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { display: "flex", gap: "var(--sp-1)" }, children: actions }) : null
|
|
895
|
+
] }) : null,
|
|
896
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "pire-card-body", children }) : null,
|
|
897
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("footer", { className: "pire-card-foot", children: footer }) : null
|
|
898
|
+
]
|
|
899
|
+
}
|
|
900
|
+
);
|
|
858
901
|
}
|
|
859
902
|
|
|
860
903
|
// src/components/core/Avatar.tsx
|
|
@@ -889,7 +932,10 @@ function SegmentedControl({
|
|
|
889
932
|
style,
|
|
890
933
|
...rest
|
|
891
934
|
}) {
|
|
892
|
-
const selected = React8.useMemo(
|
|
935
|
+
const selected = React8.useMemo(
|
|
936
|
+
() => new Set(value ? [value] : defaultValue ? [defaultValue] : []),
|
|
937
|
+
[value, defaultValue]
|
|
938
|
+
);
|
|
893
939
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
894
940
|
import_react_aria_components5.ToggleButtonGroup,
|
|
895
941
|
{
|
|
@@ -1038,7 +1084,17 @@ function Kbd({ children, size = "md", className, ...rest }) {
|
|
|
1038
1084
|
|
|
1039
1085
|
// src/components/forms/FormField.tsx
|
|
1040
1086
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1041
|
-
function FormField({
|
|
1087
|
+
function FormField({
|
|
1088
|
+
label,
|
|
1089
|
+
htmlFor,
|
|
1090
|
+
isRequired,
|
|
1091
|
+
hint,
|
|
1092
|
+
error,
|
|
1093
|
+
layout = "stacked",
|
|
1094
|
+
children,
|
|
1095
|
+
className,
|
|
1096
|
+
...rest
|
|
1097
|
+
}) {
|
|
1042
1098
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: cx("pire-field", className), "data-layout": layout, ...rest, children: [
|
|
1043
1099
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { className: "pire-field-label", htmlFor, children: [
|
|
1044
1100
|
label,
|
|
@@ -1160,11 +1216,14 @@ function TextArea({
|
|
|
1160
1216
|
...rest
|
|
1161
1217
|
}) {
|
|
1162
1218
|
const innerRef = React11.useRef(null);
|
|
1163
|
-
const ref = React11.useCallback(
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1219
|
+
const ref = React11.useCallback(
|
|
1220
|
+
(node) => {
|
|
1221
|
+
innerRef.current = node;
|
|
1222
|
+
if (typeof textAreaRef === "function") textAreaRef(node);
|
|
1223
|
+
else if (textAreaRef) textAreaRef.current = node;
|
|
1224
|
+
},
|
|
1225
|
+
[textAreaRef]
|
|
1226
|
+
);
|
|
1168
1227
|
const grow = React11.useCallback(() => {
|
|
1169
1228
|
const el = innerRef.current;
|
|
1170
1229
|
if (!el || !autoGrow) return;
|
|
@@ -1284,7 +1343,16 @@ function Select({
|
|
|
1284
1343
|
className: "pire-listbox",
|
|
1285
1344
|
items,
|
|
1286
1345
|
renderEmptyState: () => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "pire-listbox-status", role: "status", "aria-live": "polite", children: emptyLabel ?? msg.selectEmpty }),
|
|
1287
|
-
children: (item) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1346
|
+
children: (item) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1347
|
+
import_react_aria_components11.ListBoxItem,
|
|
1348
|
+
{
|
|
1349
|
+
className: "pire-option",
|
|
1350
|
+
id: item.value,
|
|
1351
|
+
textValue: item.label,
|
|
1352
|
+
isDisabled: item.isDisabled,
|
|
1353
|
+
children: item.label
|
|
1354
|
+
}
|
|
1355
|
+
)
|
|
1288
1356
|
}
|
|
1289
1357
|
) })
|
|
1290
1358
|
]
|
|
@@ -1308,7 +1376,14 @@ function Checkbox({ label, hint, children, className, ...rest }) {
|
|
|
1308
1376
|
// src/components/forms/Radio.tsx
|
|
1309
1377
|
var import_react_aria_components13 = require("react-aria-components");
|
|
1310
1378
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1311
|
-
function RadioGroup({
|
|
1379
|
+
function RadioGroup({
|
|
1380
|
+
label,
|
|
1381
|
+
description,
|
|
1382
|
+
errorMessage,
|
|
1383
|
+
children,
|
|
1384
|
+
className,
|
|
1385
|
+
...rest
|
|
1386
|
+
}) {
|
|
1312
1387
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_aria_components13.RadioGroup, { className: cx("pire-field", className), validationBehavior: "aria", ...rest, children: [
|
|
1313
1388
|
label ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components13.Label, { className: "pire-field-label", children: label }) : null,
|
|
1314
1389
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "pire-radiogroup", children }),
|
|
@@ -1371,12 +1446,21 @@ function ChoiceCardGroup({
|
|
|
1371
1446
|
label,
|
|
1372
1447
|
isRequired ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1373
1448
|
] }) : null,
|
|
1374
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "pire-choicecards", style: { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }, children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1449
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "pire-choicecards", style: { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }, children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1450
|
+
import_react_aria_components15.Radio,
|
|
1451
|
+
{
|
|
1452
|
+
value: option.id,
|
|
1453
|
+
className: "pire-choicecard",
|
|
1454
|
+
isDisabled: option.isDisabled,
|
|
1455
|
+
children: [
|
|
1456
|
+
option.icon ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { name: option.icon, size: 20 }) : null,
|
|
1457
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "pire-choicecard-label", children: option.label }),
|
|
1458
|
+
option.description ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "pire-choicecard-desc", children: option.description }) : null,
|
|
1459
|
+
option.preview ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "pire-choicecard-preview", "aria-hidden": "true", children: option.preview }) : null
|
|
1460
|
+
]
|
|
1461
|
+
},
|
|
1462
|
+
option.id
|
|
1463
|
+
)) }),
|
|
1380
1464
|
description ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components15.Text, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
1381
1465
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components15.FieldError, { className: "pire-field-error", children: errorMessage })
|
|
1382
1466
|
]
|
|
@@ -1480,7 +1564,16 @@ function ComboBox({
|
|
|
1480
1564
|
children: clearLabel ?? msg.inputClear
|
|
1481
1565
|
}
|
|
1482
1566
|
) : null,
|
|
1483
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1567
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1568
|
+
import_react_aria_components16.Button,
|
|
1569
|
+
{
|
|
1570
|
+
className: "pire-iconbtn",
|
|
1571
|
+
"data-size": "sm",
|
|
1572
|
+
"aria-label": msg.comboBoxShowSuggestions,
|
|
1573
|
+
style: { width: 20, height: 20 },
|
|
1574
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Icon, { name: "chevron-down", size: 16 })
|
|
1575
|
+
}
|
|
1576
|
+
)
|
|
1484
1577
|
]
|
|
1485
1578
|
}
|
|
1486
1579
|
),
|
|
@@ -1495,10 +1588,19 @@ function ComboBox({
|
|
|
1495
1588
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 48) onLoadMore();
|
|
1496
1589
|
} : void 0,
|
|
1497
1590
|
renderEmptyState: showsStatus ? () => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "pire-listbox-status", role: "status", "aria-live": "polite", children: isLoading ? loadingLabel ?? msg.comboBoxLoading : emptyLabel }) : void 0,
|
|
1498
|
-
children: (item) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1591
|
+
children: (item) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1592
|
+
import_react_aria_components16.ListBoxItem,
|
|
1593
|
+
{
|
|
1594
|
+
className: "pire-option",
|
|
1595
|
+
id: item.value,
|
|
1596
|
+
textValue: item.label,
|
|
1597
|
+
isDisabled: item.isDisabled,
|
|
1598
|
+
children: [
|
|
1599
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "pire-option-label", children: item.label }),
|
|
1600
|
+
item.secondary ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "pire-option-secondary", children: item.secondary }) : null
|
|
1601
|
+
]
|
|
1602
|
+
}
|
|
1603
|
+
)
|
|
1502
1604
|
}
|
|
1503
1605
|
) })
|
|
1504
1606
|
]
|
|
@@ -1622,7 +1724,16 @@ function MultiComboBox({
|
|
|
1622
1724
|
}
|
|
1623
1725
|
)
|
|
1624
1726
|
] }),
|
|
1625
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1727
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1728
|
+
import_react_aria_components17.Button,
|
|
1729
|
+
{
|
|
1730
|
+
className: "pire-iconbtn",
|
|
1731
|
+
"data-size": "sm",
|
|
1732
|
+
"aria-label": msg.comboBoxShowSuggestions,
|
|
1733
|
+
style: { width: 20, height: 20 },
|
|
1734
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { name: "chevron-down", size: 16 })
|
|
1735
|
+
}
|
|
1736
|
+
)
|
|
1626
1737
|
]
|
|
1627
1738
|
}
|
|
1628
1739
|
),
|
|
@@ -1638,10 +1749,19 @@ function MultiComboBox({
|
|
|
1638
1749
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 48) onLoadMore();
|
|
1639
1750
|
} : void 0,
|
|
1640
1751
|
renderEmptyState: showsStatus ? () => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "pire-listbox-status", role: "status", "aria-live": "polite", children: isLoading ? loadingLabel ?? msg.comboBoxLoading : emptyLabel }) : void 0,
|
|
1641
|
-
children: (item) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1752
|
+
children: (item) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1753
|
+
import_react_aria_components17.ListBoxItem,
|
|
1754
|
+
{
|
|
1755
|
+
className: "pire-option",
|
|
1756
|
+
id: item.value,
|
|
1757
|
+
textValue: item.label,
|
|
1758
|
+
isDisabled: item.isDisabled,
|
|
1759
|
+
children: [
|
|
1760
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "pire-option-label", children: item.label }),
|
|
1761
|
+
item.secondary ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "pire-option-secondary", children: item.secondary }) : null
|
|
1762
|
+
]
|
|
1763
|
+
}
|
|
1764
|
+
)
|
|
1645
1765
|
}
|
|
1646
1766
|
) })
|
|
1647
1767
|
]
|
|
@@ -1652,10 +1772,14 @@ function MultiComboBox({
|
|
|
1652
1772
|
// src/components/forms/NumberField.tsx
|
|
1653
1773
|
var React14 = __toESM(require("react"), 1);
|
|
1654
1774
|
var import_react_aria_components18 = require("react-aria-components");
|
|
1655
|
-
|
|
1775
|
+
|
|
1776
|
+
// src/components/utils/decimalSeparator.ts
|
|
1656
1777
|
function decimalSeparatorFor(locale) {
|
|
1657
1778
|
return new Intl.NumberFormat(locale).formatToParts(1.1).find((part) => part.type === "decimal")?.value ?? ".";
|
|
1658
1779
|
}
|
|
1780
|
+
|
|
1781
|
+
// src/components/forms/NumberField.tsx
|
|
1782
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1659
1783
|
function typeIntoInput(el, text) {
|
|
1660
1784
|
const start = el.selectionStart ?? el.value.length;
|
|
1661
1785
|
const end = el.selectionEnd ?? start;
|
|
@@ -1801,7 +1925,15 @@ function NumberField({
|
|
|
1801
1925
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1802
1926
|
"data-stepper": stepperLayout,
|
|
1803
1927
|
children: [
|
|
1804
|
-
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1928
|
+
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1929
|
+
import_react_aria_components18.Button,
|
|
1930
|
+
{
|
|
1931
|
+
slot: "decrement",
|
|
1932
|
+
className: "pire-qty-btn",
|
|
1933
|
+
"aria-label": decrementLabel ?? msg.numberFieldDecrease,
|
|
1934
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "minus", size: 16 })
|
|
1935
|
+
}
|
|
1936
|
+
) : null,
|
|
1805
1937
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1806
1938
|
import_react_aria_components18.Input,
|
|
1807
1939
|
{
|
|
@@ -1813,10 +1945,34 @@ function NumberField({
|
|
|
1813
1945
|
),
|
|
1814
1946
|
suffix ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "pire-affix", children: suffix }) : null,
|
|
1815
1947
|
showsClear ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ClearButton, { label: clearLabel ?? msg.inputClear, onClear: () => handleChange(NaN) }) : null,
|
|
1816
|
-
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1948
|
+
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1949
|
+
import_react_aria_components18.Button,
|
|
1950
|
+
{
|
|
1951
|
+
slot: "increment",
|
|
1952
|
+
className: "pire-qty-btn",
|
|
1953
|
+
"aria-label": incrementLabel ?? msg.numberFieldIncrease,
|
|
1954
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "plus", size: 16 })
|
|
1955
|
+
}
|
|
1956
|
+
) : null,
|
|
1817
1957
|
hideStepper ? null : stepperLayout === "inline" ? null : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "pire-stepper", children: [
|
|
1818
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1819
|
-
|
|
1958
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1959
|
+
import_react_aria_components18.Button,
|
|
1960
|
+
{
|
|
1961
|
+
slot: "increment",
|
|
1962
|
+
className: "pire-stepper-btn",
|
|
1963
|
+
"aria-label": incrementLabel ?? msg.numberFieldIncrease,
|
|
1964
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "plus", size: 10 })
|
|
1965
|
+
}
|
|
1966
|
+
),
|
|
1967
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1968
|
+
import_react_aria_components18.Button,
|
|
1969
|
+
{
|
|
1970
|
+
slot: "decrement",
|
|
1971
|
+
className: "pire-stepper-btn",
|
|
1972
|
+
"aria-label": decrementLabel ?? msg.numberFieldDecrease,
|
|
1973
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "minus", size: 10 })
|
|
1974
|
+
}
|
|
1975
|
+
)
|
|
1820
1976
|
] })
|
|
1821
1977
|
]
|
|
1822
1978
|
}
|
|
@@ -1947,7 +2103,16 @@ function DatePicker({
|
|
|
1947
2103
|
children: [
|
|
1948
2104
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.DateInput, { className: "pire-datefield", children: (segment) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.DateSegment, { segment, className: "pire-datesegment" }) }),
|
|
1949
2105
|
showsClear ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ClearButton2, { label: clearLabel ?? msg.inputClear }) : null,
|
|
1950
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2106
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2107
|
+
import_react_aria_components19.Button,
|
|
2108
|
+
{
|
|
2109
|
+
className: "pire-iconbtn",
|
|
2110
|
+
"data-size": "sm",
|
|
2111
|
+
"aria-label": msg.datePickerOpenCalendar,
|
|
2112
|
+
style: { width: 24, height: 24 },
|
|
2113
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { name: "calendar", size: 16 })
|
|
2114
|
+
}
|
|
2115
|
+
)
|
|
1951
2116
|
]
|
|
1952
2117
|
}
|
|
1953
2118
|
),
|
|
@@ -1955,9 +2120,27 @@ function DatePicker({
|
|
|
1955
2120
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.FieldError, { className: "pire-field-error", children: errorMessage }),
|
|
1956
2121
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.Popover, { className: "pire-popover", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.Dialog, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react_aria_components19.Calendar, { className: "pire-calendar", children: [
|
|
1957
2122
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("header", { className: "pire-calendar-head", children: [
|
|
1958
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2123
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2124
|
+
import_react_aria_components19.Button,
|
|
2125
|
+
{
|
|
2126
|
+
slot: "previous",
|
|
2127
|
+
className: "pire-iconbtn",
|
|
2128
|
+
"data-size": "sm",
|
|
2129
|
+
"aria-label": msg.datePickerPreviousMonth,
|
|
2130
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { name: "chevron-left", size: 16 })
|
|
2131
|
+
}
|
|
2132
|
+
),
|
|
1959
2133
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.Heading, { className: "pire-calendar-title" }),
|
|
1960
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2134
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2135
|
+
import_react_aria_components19.Button,
|
|
2136
|
+
{
|
|
2137
|
+
slot: "next",
|
|
2138
|
+
className: "pire-iconbtn",
|
|
2139
|
+
"data-size": "sm",
|
|
2140
|
+
"aria-label": msg.datePickerNextMonth,
|
|
2141
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { name: "chevron-right", size: 16 })
|
|
2142
|
+
}
|
|
2143
|
+
)
|
|
1961
2144
|
] }),
|
|
1962
2145
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react_aria_components19.CalendarGrid, { className: "pire-calendar-grid", children: [
|
|
1963
2146
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.CalendarGridHeader, { children: (day) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.CalendarHeaderCell, { children: day }) }),
|
|
@@ -2044,7 +2227,9 @@ function DateRangePicker({
|
|
|
2044
2227
|
onChange(null);
|
|
2045
2228
|
return;
|
|
2046
2229
|
}
|
|
2047
|
-
onChange(
|
|
2230
|
+
onChange(
|
|
2231
|
+
valueFormat === "iso" ? { start: next.start.toString(), end: next.end.toString() } : { start: next.start, end: next.end }
|
|
2232
|
+
);
|
|
2048
2233
|
};
|
|
2049
2234
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
2050
2235
|
import_react_aria_components20.DateRangePicker,
|
|
@@ -2239,7 +2424,13 @@ function Skeleton({ shape = "text", width, height, className, style, ...rest })
|
|
|
2239
2424
|
);
|
|
2240
2425
|
}
|
|
2241
2426
|
var BAR_WIDTHS = ["72%", "54%", "86%", "63%"];
|
|
2242
|
-
function SkeletonTableRow({
|
|
2427
|
+
function SkeletonTableRow({
|
|
2428
|
+
columns,
|
|
2429
|
+
density = "regular",
|
|
2430
|
+
className,
|
|
2431
|
+
style,
|
|
2432
|
+
...rest
|
|
2433
|
+
}) {
|
|
2243
2434
|
const cells = typeof columns === "number" ? Array.from({ length: columns }, () => ({})) : columns;
|
|
2244
2435
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2245
2436
|
"div",
|
|
@@ -2251,18 +2442,15 @@ function SkeletonTableRow({ columns, density = "regular", className, style, ...r
|
|
|
2251
2442
|
...rest,
|
|
2252
2443
|
children: cells.map((c, i) => {
|
|
2253
2444
|
const align = c.numeric ? "right" : c.align ?? "left";
|
|
2254
|
-
return (
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
"
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
},
|
|
2264
|
-
i
|
|
2265
|
-
)
|
|
2445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2446
|
+
"div",
|
|
2447
|
+
{
|
|
2448
|
+
className: "pire-skeleton-cell",
|
|
2449
|
+
"data-align": align,
|
|
2450
|
+
style: { width: c.width, flex: c.width ? "0 0 auto" : void 0 },
|
|
2451
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Skeleton, { width: BAR_WIDTHS[i % BAR_WIDTHS.length] })
|
|
2452
|
+
},
|
|
2453
|
+
i
|
|
2266
2454
|
);
|
|
2267
2455
|
})
|
|
2268
2456
|
}
|
|
@@ -2316,10 +2504,11 @@ function DataTable({
|
|
|
2316
2504
|
break;
|
|
2317
2505
|
}
|
|
2318
2506
|
if (typeof column.width !== "number") {
|
|
2319
|
-
if (IS_DEV2)
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2507
|
+
if (IS_DEV2)
|
|
2508
|
+
warnOnce2(
|
|
2509
|
+
`pin-width:${column.key}`,
|
|
2510
|
+
`DataTable column "${column.key}" is pinned but has no numeric width, so its offset cannot be computed. It will scroll.`
|
|
2511
|
+
);
|
|
2323
2512
|
broke = "width";
|
|
2324
2513
|
break;
|
|
2325
2514
|
}
|
|
@@ -2423,7 +2612,9 @@ function DataTable({
|
|
|
2423
2612
|
{
|
|
2424
2613
|
size: 12,
|
|
2425
2614
|
name: sort?.key === c.key ? sort.dir === "asc" ? "arrow-up" : "arrow-down" : "chevrons-up-down",
|
|
2426
|
-
style: {
|
|
2615
|
+
style: {
|
|
2616
|
+
color: sort?.key === c.key ? "var(--accent-subtle-fg)" : "var(--text-tertiary)"
|
|
2617
|
+
}
|
|
2427
2618
|
}
|
|
2428
2619
|
) : null
|
|
2429
2620
|
] })
|
|
@@ -2432,44 +2623,53 @@ function DataTable({
|
|
|
2432
2623
|
)
|
|
2433
2624
|
))
|
|
2434
2625
|
] }),
|
|
2435
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
{
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
import_react_aria_components22.Cell,
|
|
2455
|
-
{
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2626
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2627
|
+
import_react_aria_components22.TableBody,
|
|
2628
|
+
{
|
|
2629
|
+
renderEmptyState: () => isLoading ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "pire-table-loading", role: "status", "aria-live": "polite", children: [
|
|
2630
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "pire-sr-only", children: loadingLabel ?? msg.dataTableLoading }),
|
|
2631
|
+
Array.from({ length: skeletonRows }, (_, i) => (
|
|
2632
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: placeholder rows are positional.
|
|
2633
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SkeletonTableRow, { columns: skeletonColumns, density }, i)
|
|
2634
|
+
))
|
|
2635
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "pire-table-empty", children: emptyLabel ?? msg.dataTableEmpty }),
|
|
2636
|
+
children: body.flatMap((row) => {
|
|
2637
|
+
const rowIsDisabled = presentation.get(row.id)?.isDisabled;
|
|
2638
|
+
const record = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
2639
|
+
import_react_aria_components22.Row,
|
|
2640
|
+
{
|
|
2641
|
+
id: row.id,
|
|
2642
|
+
className: cx("pire-tr", presentation.get(row.id)?.className),
|
|
2643
|
+
"data-pressable": onRowAction && !rowIsDisabled ? "true" : void 0,
|
|
2644
|
+
children: [
|
|
2645
|
+
hasCheckboxColumn ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_aria_components22.Cell, { className: "pire-td", ...pinProps(null), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Checkbox, { slot: "selection", "aria-label": msg.dataTableSelectRow }) }) : null,
|
|
2646
|
+
columns.map((c) => {
|
|
2647
|
+
const pin = pinProps(c.key);
|
|
2648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2649
|
+
import_react_aria_components22.Cell,
|
|
2650
|
+
{
|
|
2651
|
+
className: "pire-td",
|
|
2652
|
+
"data-numeric": c.numeric ? "true" : void 0,
|
|
2653
|
+
"data-tone": c.tone?.(row) ?? void 0,
|
|
2654
|
+
...pin,
|
|
2655
|
+
style: { ...pin.style, textAlign: c.align && !c.numeric ? c.align : void 0 },
|
|
2656
|
+
children: c.render ? c.render(row) : row[c.key]
|
|
2657
|
+
},
|
|
2658
|
+
c.key
|
|
2659
|
+
);
|
|
2660
|
+
})
|
|
2661
|
+
]
|
|
2662
|
+
},
|
|
2663
|
+
row.id
|
|
2664
|
+
);
|
|
2665
|
+
if (!renderExpanded || !expanded.has(String(row.id))) return [record];
|
|
2666
|
+
return [
|
|
2667
|
+
record,
|
|
2668
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_aria_components22.Row, { id: expandedKey(row.id), className: "pire-tr-expanded", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_aria_components22.Cell, { className: "pire-td-expanded", colSpan: spanAll, children: renderExpanded(row) }) }, expandedKey(row.id))
|
|
2669
|
+
];
|
|
2670
|
+
})
|
|
2671
|
+
}
|
|
2672
|
+
),
|
|
2473
2673
|
footer && !isLoading ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_aria_components22.TableFooter, { className: "pire-tfoot", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react_aria_components22.Row, { id: "__pire_footer__", className: "pire-tr-footer", children: [
|
|
2474
2674
|
hasCheckboxColumn ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_aria_components22.Cell, { className: "pire-tf", ...pinProps(null) }) : null,
|
|
2475
2675
|
columns.map((c, i) => {
|
|
@@ -2539,10 +2739,17 @@ function ValueHelpDialog({
|
|
|
2539
2739
|
onClose,
|
|
2540
2740
|
footer: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
2541
2741
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Button, { variant: "tertiary", onPress: onClose, children: msg.valueHelpDialogCancel }),
|
|
2542
|
-
isMultiple ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2742
|
+
isMultiple ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2743
|
+
Button,
|
|
2744
|
+
{
|
|
2745
|
+
variant: "primary",
|
|
2746
|
+
onPress: () => {
|
|
2747
|
+
onConfirm?.(selectedKeys ?? []);
|
|
2748
|
+
onClose?.();
|
|
2749
|
+
},
|
|
2750
|
+
children: msg.valueHelpConfirm
|
|
2751
|
+
}
|
|
2752
|
+
) : null
|
|
2546
2753
|
] }),
|
|
2547
2754
|
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "var(--sp-3)" }, children: [
|
|
2548
2755
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
@@ -2563,28 +2770,35 @@ function ValueHelpDialog({
|
|
|
2563
2770
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Button, { size: "sm", variant: "tertiary", onPress: () => onSelectionChange?.([]), children: msg.valueHelpClearSelection }),
|
|
2564
2771
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "pire-valuehelp-count", children: msg.valueHelpSelectedCount.replace("{count}", String(selectedKeys?.length ?? 0)) })
|
|
2565
2772
|
] }) : null,
|
|
2566
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2567
|
-
|
|
2568
|
-
if (el.scrollHeight - el.scrollTop - el.clientHeight < 64) onLoadMore();
|
|
2569
|
-
} : void 0, style: { overflow: "auto", maxHeight: "48vh" }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2570
|
-
DataTable,
|
|
2773
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2774
|
+
"div",
|
|
2571
2775
|
{
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2776
|
+
onScroll: onLoadMore ? (event) => {
|
|
2777
|
+
const el = event.currentTarget;
|
|
2778
|
+
if (el.scrollHeight - el.scrollTop - el.clientHeight < 64) onLoadMore();
|
|
2779
|
+
} : void 0,
|
|
2780
|
+
style: { overflow: "auto", maxHeight: "48vh" },
|
|
2781
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2782
|
+
DataTable,
|
|
2783
|
+
{
|
|
2784
|
+
"aria-label": typeof title === "string" ? title : msg.valueHelpDialogTitle,
|
|
2785
|
+
density: "condensed",
|
|
2786
|
+
columns,
|
|
2787
|
+
rows: filtered,
|
|
2788
|
+
isLoading,
|
|
2789
|
+
emptyLabel: emptyLabel ?? msg.valueHelpDialogEmpty,
|
|
2790
|
+
selectable: isMultiple ? "multiple" : void 0,
|
|
2791
|
+
hideSelectAll: isMultiple,
|
|
2792
|
+
selected: isMultiple ? selectedKeys : void 0,
|
|
2793
|
+
onSelectionChange: isMultiple ? onSelectionChange : void 0,
|
|
2794
|
+
onRowAction: isMultiple ? void 0 : (row) => {
|
|
2795
|
+
onSelect?.(row);
|
|
2796
|
+
onClose?.();
|
|
2797
|
+
}
|
|
2798
|
+
}
|
|
2799
|
+
)
|
|
2586
2800
|
}
|
|
2587
|
-
)
|
|
2801
|
+
)
|
|
2588
2802
|
] })
|
|
2589
2803
|
}
|
|
2590
2804
|
);
|
|
@@ -2730,7 +2944,9 @@ function screenFiles(files, { maxSize, acceptedFileTypes }) {
|
|
|
2730
2944
|
continue;
|
|
2731
2945
|
}
|
|
2732
2946
|
if (acceptedFileTypes?.length) {
|
|
2733
|
-
const ok = acceptedFileTypes.some(
|
|
2947
|
+
const ok = acceptedFileTypes.some(
|
|
2948
|
+
(t) => t.startsWith(".") ? file.name.toLowerCase().endsWith(t.toLowerCase()) : t.endsWith("/*") ? file.type.startsWith(t.slice(0, -1)) : file.type === t
|
|
2949
|
+
);
|
|
2734
2950
|
if (!ok) {
|
|
2735
2951
|
rejected.push({ file, reason: "type" });
|
|
2736
2952
|
continue;
|
|
@@ -2767,9 +2983,12 @@ function FileUpload({
|
|
|
2767
2983
|
const [uncontrolled, setUncontrolled] = React21.useState(defaultValue ?? []);
|
|
2768
2984
|
const files = value ?? uncontrolled;
|
|
2769
2985
|
const created = React21.useRef([]);
|
|
2770
|
-
React21.useEffect(
|
|
2771
|
-
|
|
2772
|
-
|
|
2986
|
+
React21.useEffect(
|
|
2987
|
+
() => () => {
|
|
2988
|
+
for (const url of created.current) URL.revokeObjectURL(url);
|
|
2989
|
+
},
|
|
2990
|
+
[]
|
|
2991
|
+
);
|
|
2773
2992
|
const commit = (next) => {
|
|
2774
2993
|
if (value === void 0) setUncontrolled(next);
|
|
2775
2994
|
onChange?.(next);
|
|
@@ -2890,14 +3109,7 @@ var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
|
2890
3109
|
function Menu({ minWidth, className, style, ...rest }) {
|
|
2891
3110
|
const width = typeof minWidth === "number" ? `${minWidth}px` : minWidth;
|
|
2892
3111
|
const menuStyle = width == null ? style : { ["--pire-menu-min-w"]: width, ...style };
|
|
2893
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2894
|
-
import_react_aria_components26.Menu,
|
|
2895
|
-
{
|
|
2896
|
-
className: cx("pire-menu", className),
|
|
2897
|
-
style: menuStyle,
|
|
2898
|
-
...rest
|
|
2899
|
-
}
|
|
2900
|
-
);
|
|
3112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_aria_components26.Menu, { className: cx("pire-menu", className), style: menuStyle, ...rest });
|
|
2901
3113
|
}
|
|
2902
3114
|
var shortcutKeys = (shortcut) => {
|
|
2903
3115
|
if (shortcut == null) return [];
|
|
@@ -2926,7 +3138,14 @@ function MenuItem({
|
|
|
2926
3138
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "pire-menu-item-label", children }),
|
|
2927
3139
|
description ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "pire-menu-item-desc", children: description }) : null
|
|
2928
3140
|
] }),
|
|
2929
|
-
keys.length ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "pire-menu-item-shortcut", children: keys.map((cap, index) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3141
|
+
keys.length ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "pire-menu-item-shortcut", children: keys.map((cap, index) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3142
|
+
Kbd,
|
|
3143
|
+
{
|
|
3144
|
+
size: "sm",
|
|
3145
|
+
children: cap
|
|
3146
|
+
},
|
|
3147
|
+
`${cap}-${index}`
|
|
3148
|
+
)) }) : null
|
|
2930
3149
|
]
|
|
2931
3150
|
}
|
|
2932
3151
|
);
|
|
@@ -2961,6 +3180,7 @@ function SideNav({
|
|
|
2961
3180
|
onExpandedChange,
|
|
2962
3181
|
collapsed,
|
|
2963
3182
|
railFlyout = true,
|
|
3183
|
+
bordered = true,
|
|
2964
3184
|
footer,
|
|
2965
3185
|
className,
|
|
2966
3186
|
...rest
|
|
@@ -3069,6 +3289,7 @@ function SideNav({
|
|
|
3069
3289
|
{
|
|
3070
3290
|
className: cx("pire-sidenav", className),
|
|
3071
3291
|
"data-collapsed": collapsed ? "true" : void 0,
|
|
3292
|
+
"data-bordered": bordered ? void 0 : "false",
|
|
3072
3293
|
"aria-label": msg.sideNavLabel,
|
|
3073
3294
|
...rest,
|
|
3074
3295
|
children: [
|
|
@@ -3260,7 +3481,9 @@ function childrenOfType(children, type, what, parent) {
|
|
|
3260
3481
|
}
|
|
3261
3482
|
if (!React24.isValidElement(child) || child.type !== type) {
|
|
3262
3483
|
const isWrapper = React24.isValidElement(child) && typeof child.type !== "string" && !CONFIG_ELEMENTS.has(child.type);
|
|
3263
|
-
throw new Error(
|
|
3484
|
+
throw new Error(
|
|
3485
|
+
`[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.` : "")
|
|
3486
|
+
);
|
|
3264
3487
|
}
|
|
3265
3488
|
out.push({ ...child.props, key: child.key != null ? String(child.key) : `${path}${i}` });
|
|
3266
3489
|
});
|
|
@@ -3271,13 +3494,24 @@ function childrenOfType(children, type, what, parent) {
|
|
|
3271
3494
|
function readTabs(children) {
|
|
3272
3495
|
return childrenOfType(children, RibbonTab, "Ribbon.Tab", "Ribbon").map((tab) => ({
|
|
3273
3496
|
...tab,
|
|
3274
|
-
groups: childrenOfType(tab.children, RibbonGroup, "Ribbon.Group", "Ribbon.Tab").map(
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3497
|
+
groups: childrenOfType(tab.children, RibbonGroup, "Ribbon.Group", "Ribbon.Tab").map(
|
|
3498
|
+
(group) => ({
|
|
3499
|
+
...group,
|
|
3500
|
+
commands: childrenOfType(
|
|
3501
|
+
group.children,
|
|
3502
|
+
RibbonCommand,
|
|
3503
|
+
"Ribbon.Command",
|
|
3504
|
+
"Ribbon.Group"
|
|
3505
|
+
)
|
|
3506
|
+
})
|
|
3507
|
+
)
|
|
3278
3508
|
}));
|
|
3279
3509
|
}
|
|
3280
|
-
function Command({
|
|
3510
|
+
function Command({
|
|
3511
|
+
command,
|
|
3512
|
+
selectionCount,
|
|
3513
|
+
inBar
|
|
3514
|
+
}) {
|
|
3281
3515
|
const size = inBar ? "sm" : command.size ?? "sm";
|
|
3282
3516
|
const isDisabled = command.isDisabled || command.requiresSelection === true && selectionCount === 0;
|
|
3283
3517
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
@@ -3324,7 +3558,13 @@ function useTrailingOverflow() {
|
|
|
3324
3558
|
}, []);
|
|
3325
3559
|
return [ref, overflow];
|
|
3326
3560
|
}
|
|
3327
|
-
function Surface({
|
|
3561
|
+
function Surface({
|
|
3562
|
+
className,
|
|
3563
|
+
id,
|
|
3564
|
+
label,
|
|
3565
|
+
trailing,
|
|
3566
|
+
children
|
|
3567
|
+
}) {
|
|
3328
3568
|
const [scrollRef, overflow] = useTrailingOverflow();
|
|
3329
3569
|
const domId = id ? { id } : {};
|
|
3330
3570
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react_aria_components31.Toolbar, { ...domId, className, "aria-label": label, children: [
|
|
@@ -3365,10 +3605,13 @@ function Ribbon({
|
|
|
3365
3605
|
const [ownTab, setOwnTab] = React24.useState(defaultValue);
|
|
3366
3606
|
const requested = value ?? ownTab;
|
|
3367
3607
|
const selected = visible.some((tab) => tab.id === requested) ? requested : fallback;
|
|
3368
|
-
const select = React24.useCallback(
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3608
|
+
const select = React24.useCallback(
|
|
3609
|
+
(id) => {
|
|
3610
|
+
setOwnTab(id);
|
|
3611
|
+
onChange?.(id);
|
|
3612
|
+
},
|
|
3613
|
+
[onChange]
|
|
3614
|
+
);
|
|
3372
3615
|
const hadSelection = React24.useRef(false);
|
|
3373
3616
|
React24.useEffect(() => {
|
|
3374
3617
|
const has = count > 0;
|
|
@@ -3464,7 +3707,15 @@ var KIND_ICON = {
|
|
|
3464
3707
|
warning: "alert-triangle",
|
|
3465
3708
|
error: "alert-octagon"
|
|
3466
3709
|
};
|
|
3467
|
-
function InlineMessage({
|
|
3710
|
+
function InlineMessage({
|
|
3711
|
+
kind = "info",
|
|
3712
|
+
title,
|
|
3713
|
+
action,
|
|
3714
|
+
onClose,
|
|
3715
|
+
children,
|
|
3716
|
+
className,
|
|
3717
|
+
...rest
|
|
3718
|
+
}) {
|
|
3468
3719
|
const msg = usePireMessages();
|
|
3469
3720
|
const assertive = kind === "error" || kind === "warning";
|
|
3470
3721
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
@@ -3497,7 +3748,14 @@ var KIND_ICON2 = {
|
|
|
3497
3748
|
warning: "alert-triangle",
|
|
3498
3749
|
error: "alert-octagon"
|
|
3499
3750
|
};
|
|
3500
|
-
function Toast({
|
|
3751
|
+
function Toast({
|
|
3752
|
+
kind = "success",
|
|
3753
|
+
onClose,
|
|
3754
|
+
position = "bottom-center",
|
|
3755
|
+
children,
|
|
3756
|
+
className,
|
|
3757
|
+
...rest
|
|
3758
|
+
}) {
|
|
3501
3759
|
const msg = usePireMessages();
|
|
3502
3760
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
3503
3761
|
"div",
|
|
@@ -3516,21 +3774,36 @@ function Toast({ kind = "success", onClose, position = "bottom-center", children
|
|
|
3516
3774
|
);
|
|
3517
3775
|
}
|
|
3518
3776
|
var ToastContext = React25.createContext(null);
|
|
3519
|
-
function ToastProvider({
|
|
3777
|
+
function ToastProvider({
|
|
3778
|
+
children,
|
|
3779
|
+
timeout = 6e3
|
|
3780
|
+
}) {
|
|
3520
3781
|
const msg = usePireMessages();
|
|
3521
3782
|
const [toasts, setToasts] = React25.useState([]);
|
|
3522
3783
|
const close = React25.useCallback((id) => setToasts((t) => t.filter((x) => x.id !== id)), []);
|
|
3523
|
-
const add = React25.useCallback(
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3784
|
+
const add = React25.useCallback(
|
|
3785
|
+
(toast) => {
|
|
3786
|
+
const id = Math.random().toString(36).slice(2);
|
|
3787
|
+
setToasts((t) => [...t, { ...toast, id }]);
|
|
3788
|
+
const ms = toast.timeout ?? timeout;
|
|
3789
|
+
if (ms > 0) setTimeout(() => close(id), ms);
|
|
3790
|
+
return id;
|
|
3791
|
+
},
|
|
3792
|
+
[close, timeout]
|
|
3793
|
+
);
|
|
3530
3794
|
const value = React25.useMemo(() => ({ add, close }), [add, close]);
|
|
3531
3795
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(ToastContext.Provider, { value, children: [
|
|
3532
3796
|
children,
|
|
3533
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "pire-toast-region", role: "region", "aria-label": msg.toastRegionLabel, children: toasts.map((t) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3797
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "pire-toast-region", role: "region", "aria-label": msg.toastRegionLabel, children: toasts.map((t) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3798
|
+
Toast,
|
|
3799
|
+
{
|
|
3800
|
+
kind: t.kind,
|
|
3801
|
+
onClose: () => close(t.id),
|
|
3802
|
+
style: { position: "static", transform: "none" },
|
|
3803
|
+
children: t.message
|
|
3804
|
+
},
|
|
3805
|
+
t.id
|
|
3806
|
+
)) })
|
|
3534
3807
|
] });
|
|
3535
3808
|
}
|
|
3536
3809
|
function useToast() {
|
|
@@ -3578,7 +3851,17 @@ function KpiTile({
|
|
|
3578
3851
|
|
|
3579
3852
|
// src/components/data/ObjectHeader.tsx
|
|
3580
3853
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3581
|
-
function ObjectHeader({
|
|
3854
|
+
function ObjectHeader({
|
|
3855
|
+
title,
|
|
3856
|
+
subtitle,
|
|
3857
|
+
id,
|
|
3858
|
+
breadcrumb,
|
|
3859
|
+
badge,
|
|
3860
|
+
facts,
|
|
3861
|
+
actions,
|
|
3862
|
+
className,
|
|
3863
|
+
...rest
|
|
3864
|
+
}) {
|
|
3582
3865
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("header", { className: cx("pire-objheader", className), ...rest, children: [
|
|
3583
3866
|
breadcrumb,
|
|
3584
3867
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "pire-objheader-row", children: [
|
|
@@ -3594,7 +3877,15 @@ function ObjectHeader({ title, subtitle, id, breadcrumb, badge, facts, actions,
|
|
|
3594
3877
|
] }),
|
|
3595
3878
|
facts?.length ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("dl", { className: "pire-facts", style: { margin: 0 }, children: facts.map((fact) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { children: [
|
|
3596
3879
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("dt", { className: "pire-fact-label", children: fact.label }),
|
|
3597
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3880
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3881
|
+
"dd",
|
|
3882
|
+
{
|
|
3883
|
+
className: "pire-fact-value",
|
|
3884
|
+
"data-numeric": fact.numeric ? "true" : void 0,
|
|
3885
|
+
style: { margin: 0 },
|
|
3886
|
+
children: fact.value
|
|
3887
|
+
}
|
|
3888
|
+
)
|
|
3598
3889
|
] }, fact.label)) }) : null
|
|
3599
3890
|
] });
|
|
3600
3891
|
}
|
|
@@ -3633,7 +3924,14 @@ function FilterBar({
|
|
|
3633
3924
|
|
|
3634
3925
|
// src/components/data/DescriptionList.tsx
|
|
3635
3926
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3636
|
-
function DescriptionList({
|
|
3927
|
+
function DescriptionList({
|
|
3928
|
+
items,
|
|
3929
|
+
layout = "rows",
|
|
3930
|
+
columns = 3,
|
|
3931
|
+
className,
|
|
3932
|
+
style,
|
|
3933
|
+
...rest
|
|
3934
|
+
}) {
|
|
3637
3935
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3638
3936
|
"dl",
|
|
3639
3937
|
{
|
|
@@ -3691,10 +3989,7 @@ function linearScale(values, tickCount = 4, startAtZero = true) {
|
|
|
3691
3989
|
const min = toStepPrecision(Math.floor(low / step + EDGE_TOLERANCE) * step);
|
|
3692
3990
|
const max = toStepPrecision(Math.ceil(high / step - EDGE_TOLERANCE) * step);
|
|
3693
3991
|
const stepCount = Math.round((max - min) / step);
|
|
3694
|
-
const ticks = Array.from(
|
|
3695
|
-
{ length: stepCount + 1 },
|
|
3696
|
-
(_, index) => toStepPrecision(min + index * step)
|
|
3697
|
-
);
|
|
3992
|
+
const ticks = Array.from({ length: stepCount + 1 }, (_, index) => toStepPrecision(min + index * step));
|
|
3698
3993
|
return { min, max, ticks };
|
|
3699
3994
|
}
|
|
3700
3995
|
function scalePosition(value, scale) {
|
|
@@ -3722,10 +4017,14 @@ function warnOnDonutShape(series, categoryCount, chartLabel) {
|
|
|
3722
4017
|
complaints.push(`it has ${series.length} series but a donut draws one \u2014 the rest are ignored`);
|
|
3723
4018
|
}
|
|
3724
4019
|
if (categoryCount > VIZ_SLOT_COUNT) {
|
|
3725
|
-
complaints.push(
|
|
4020
|
+
complaints.push(
|
|
4021
|
+
`it has ${categoryCount} segments and the palette defines ${VIZ_SLOT_COUNT}; past about four, slices stop being readable at all \u2014 group the tail into "Other"`
|
|
4022
|
+
);
|
|
3726
4023
|
}
|
|
3727
4024
|
if (series[0]?.values.some((value) => value != null && value < 0)) {
|
|
3728
|
-
complaints.push(
|
|
4025
|
+
complaints.push(
|
|
4026
|
+
"it contains negative values, which have no part-to-whole meaning \u2014 a signed measure belongs in a bar chart"
|
|
4027
|
+
);
|
|
3729
4028
|
}
|
|
3730
4029
|
if (complaints.length === 0) return;
|
|
3731
4030
|
warnedCharts.add(`donut:${chartLabel}`);
|
|
@@ -3738,7 +4037,9 @@ function flatValues(series) {
|
|
|
3738
4037
|
return series.flatMap((one) => one.values);
|
|
3739
4038
|
}
|
|
3740
4039
|
function alignToCategories(series, categoryCount) {
|
|
3741
|
-
return series.map(
|
|
4040
|
+
return series.map(
|
|
4041
|
+
(one) => one.values.length <= categoryCount ? one : { ...one, values: one.values.slice(0, categoryCount) }
|
|
4042
|
+
);
|
|
3742
4043
|
}
|
|
3743
4044
|
|
|
3744
4045
|
// src/components/data/ChartFrame.tsx
|
|
@@ -3997,10 +4298,12 @@ function LineChart({
|
|
|
3997
4298
|
},
|
|
3998
4299
|
tick
|
|
3999
4300
|
)),
|
|
4000
|
-
categories.map(
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4301
|
+
categories.map(
|
|
4302
|
+
(category, index) => index % labelEvery === 0 ? (
|
|
4303
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
4304
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("text", { x: xAt(index), y: height - 6, textAnchor: "middle", children: category }, index)
|
|
4305
|
+
) : null
|
|
4306
|
+
)
|
|
4004
4307
|
] }),
|
|
4005
4308
|
showArea && series[0] ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4006
4309
|
"path",
|
|
@@ -4011,19 +4314,20 @@ function LineChart({
|
|
|
4011
4314
|
}
|
|
4012
4315
|
) : null,
|
|
4013
4316
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("g", { className: "pire-chart-line", fill: "none", children: series.map((one, index) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("path", { d: pathFor(one.values), stroke: seriesColor(one, index) }, one.id)) }),
|
|
4014
|
-
withMarkers ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("g", { className: "pire-chart-marker", children: series.map(
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4317
|
+
withMarkers ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("g", { className: "pire-chart-marker", children: series.map(
|
|
4318
|
+
(one, seriesIndex) => one.values.map(
|
|
4319
|
+
(value, index) => value == null ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4320
|
+
"circle",
|
|
4321
|
+
{
|
|
4322
|
+
cx: xAt(index),
|
|
4323
|
+
cy: yAt(value),
|
|
4324
|
+
r: 4,
|
|
4325
|
+
fill: seriesColor(one, seriesIndex)
|
|
4326
|
+
},
|
|
4327
|
+
`${one.id}-${index}`
|
|
4328
|
+
)
|
|
4025
4329
|
)
|
|
4026
|
-
)
|
|
4330
|
+
) }) : null
|
|
4027
4331
|
]
|
|
4028
4332
|
}
|
|
4029
4333
|
) : null,
|
|
@@ -4031,7 +4335,9 @@ function LineChart({
|
|
|
4031
4335
|
"div",
|
|
4032
4336
|
{
|
|
4033
4337
|
className: "pire-chart-hover",
|
|
4034
|
-
style: {
|
|
4338
|
+
style: {
|
|
4339
|
+
inset: `${PLOT_INSET.top}px ${PLOT_INSET.right}px ${PLOT_INSET.bottom}px ${PLOT_INSET.left}px`
|
|
4340
|
+
},
|
|
4035
4341
|
children: categories.map((category, categoryIndex) => (
|
|
4036
4342
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
4037
4343
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "pire-chart-band", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "pire-chart-tip", role: "presentation", children: [
|
|
@@ -4171,15 +4477,31 @@ function LinkList({ items, onSelect, emphasis = "key", className, ...rest }) {
|
|
|
4171
4477
|
|
|
4172
4478
|
// src/components/data/RecordCard.tsx
|
|
4173
4479
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4174
|
-
function RecordCard({
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4480
|
+
function RecordCard({
|
|
4481
|
+
title,
|
|
4482
|
+
subtitle,
|
|
4483
|
+
icon,
|
|
4484
|
+
action,
|
|
4485
|
+
isDisabled,
|
|
4486
|
+
className,
|
|
4487
|
+
...rest
|
|
4488
|
+
}) {
|
|
4489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
4490
|
+
"div",
|
|
4491
|
+
{
|
|
4492
|
+
className: cx("pire-recordcard", className),
|
|
4493
|
+
"data-disabled": isDisabled ? "true" : void 0,
|
|
4494
|
+
...rest,
|
|
4495
|
+
children: [
|
|
4496
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "pire-recordcard-tile", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Icon, { name: icon, size: 20 }) }) : null,
|
|
4497
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "pire-recordcard-body", children: [
|
|
4498
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "pire-recordcard-title", children: title }),
|
|
4499
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "pire-recordcard-sub", children: subtitle }) : null
|
|
4500
|
+
] }),
|
|
4501
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "pire-recordcard-action", children: action }) : null
|
|
4502
|
+
]
|
|
4503
|
+
}
|
|
4504
|
+
);
|
|
4183
4505
|
}
|
|
4184
4506
|
|
|
4185
4507
|
// src/components/data/ViewSwitcher.tsx
|
|
@@ -4279,7 +4601,14 @@ function SectionHeader({ title, meta, actions, className, ...rest }) {
|
|
|
4279
4601
|
|
|
4280
4602
|
// src/components/layout/SelectionBar.tsx
|
|
4281
4603
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
4282
|
-
function SelectionBar({
|
|
4604
|
+
function SelectionBar({
|
|
4605
|
+
count,
|
|
4606
|
+
noun = "record",
|
|
4607
|
+
children,
|
|
4608
|
+
actions,
|
|
4609
|
+
className,
|
|
4610
|
+
...rest
|
|
4611
|
+
}) {
|
|
4283
4612
|
if (!count) return null;
|
|
4284
4613
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: cx("pire-selectionbar", className), role: "status", "aria-live": "polite", ...rest, children: [
|
|
4285
4614
|
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "pire-selectionbar-count", children: [
|
|
@@ -4378,7 +4707,14 @@ function ConfirmDialog({
|
|
|
4378
4707
|
// pairs with an explicit role for the same reason.
|
|
4379
4708
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "pire-confirm-facts", role: "group", "aria-label": msg.confirmDialogFactsLabel, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DescriptionList, { layout: "rows", items: facts }) })
|
|
4380
4709
|
) : null,
|
|
4381
|
-
consequence ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4710
|
+
consequence ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4711
|
+
InlineMessage,
|
|
4712
|
+
{
|
|
4713
|
+
kind: tone === "danger" ? "error" : "warning",
|
|
4714
|
+
style: { marginBottom: children ? "var(--sp-3)" : 0 },
|
|
4715
|
+
children: consequence
|
|
4716
|
+
}
|
|
4717
|
+
) : null,
|
|
4382
4718
|
children
|
|
4383
4719
|
]
|
|
4384
4720
|
}
|
|
@@ -4419,10 +4755,13 @@ function CommandPalette({
|
|
|
4419
4755
|
for (const group of groups) for (const item of group.items) byId.set(item.id, searchableText(item));
|
|
4420
4756
|
return byId;
|
|
4421
4757
|
}, [groups]);
|
|
4422
|
-
const filter = React28.useCallback(
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4758
|
+
const filter = React28.useCallback(
|
|
4759
|
+
(textValue, inputValue, node) => {
|
|
4760
|
+
if (node.parentKey === RESULTS_SECTION_KEY) return true;
|
|
4761
|
+
return contains(searchableById.get(String(node.key)) ?? textValue, inputValue);
|
|
4762
|
+
},
|
|
4763
|
+
[contains, searchableById]
|
|
4764
|
+
);
|
|
4426
4765
|
const handleInputChange = (value) => {
|
|
4427
4766
|
setQuery(value);
|
|
4428
4767
|
onSearch?.(value);
|
|
@@ -4549,7 +4888,10 @@ function AppLauncher({
|
|
|
4549
4888
|
if (isFilteredExternally) return sections;
|
|
4550
4889
|
const q = query.trim();
|
|
4551
4890
|
if (!q) return sections;
|
|
4552
|
-
return sections.map((section) => ({
|
|
4891
|
+
return sections.map((section) => ({
|
|
4892
|
+
...section,
|
|
4893
|
+
items: section.items.filter((i) => contains(searchableText2(i), q))
|
|
4894
|
+
})).filter((section) => section.items.length > 0);
|
|
4553
4895
|
}, [sections, query, isFilteredExternally, contains]);
|
|
4554
4896
|
const isEmpty = !isLoading && visible.length === 0;
|
|
4555
4897
|
const label = ariaLabel ?? msg.appLauncherLabel;
|
|
@@ -4606,7 +4948,13 @@ function AppLauncher({
|
|
|
4606
4948
|
onAction?.(item.id);
|
|
4607
4949
|
},
|
|
4608
4950
|
children: [
|
|
4609
|
-
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-item-icon", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4951
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-item-icon", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4952
|
+
Icon,
|
|
4953
|
+
{
|
|
4954
|
+
name: item.icon,
|
|
4955
|
+
size: (section.variant ?? "tile") === "tile" ? 20 : 16
|
|
4956
|
+
}
|
|
4957
|
+
) }) : null,
|
|
4610
4958
|
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("span", { className: "pire-launcher-item-text", children: [
|
|
4611
4959
|
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-item-label", children: item.label }),
|
|
4612
4960
|
showsDescription ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-item-desc", children: item.description }) : null
|
|
@@ -4627,7 +4975,16 @@ function AppLauncher({
|
|
|
4627
4975
|
// src/components/patterns/SidePanel.tsx
|
|
4628
4976
|
var import_react_aria_components37 = require("react-aria-components");
|
|
4629
4977
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
4630
|
-
function SidePanel({
|
|
4978
|
+
function SidePanel({
|
|
4979
|
+
isOpen,
|
|
4980
|
+
title,
|
|
4981
|
+
subtitle,
|
|
4982
|
+
width = 400,
|
|
4983
|
+
children,
|
|
4984
|
+
footer,
|
|
4985
|
+
onClose,
|
|
4986
|
+
className
|
|
4987
|
+
}) {
|
|
4631
4988
|
const msg = usePireMessages();
|
|
4632
4989
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
4633
4990
|
import_react_aria_components37.ModalOverlay,
|
|
@@ -4655,7 +5012,15 @@ function SidePanel({ isOpen, title, subtitle, width = 400, children, footer, onC
|
|
|
4655
5012
|
|
|
4656
5013
|
// src/components/patterns/EmptyState.tsx
|
|
4657
5014
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
4658
|
-
function EmptyState({
|
|
5015
|
+
function EmptyState({
|
|
5016
|
+
icon = "file-text",
|
|
5017
|
+
title,
|
|
5018
|
+
action,
|
|
5019
|
+
compact,
|
|
5020
|
+
children,
|
|
5021
|
+
className,
|
|
5022
|
+
...rest
|
|
5023
|
+
}) {
|
|
4659
5024
|
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: cx("pire-empty", className), "data-compact": compact ? "true" : void 0, ...rest, children: [
|
|
4660
5025
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Icon, { name: icon, size: 24, className: "pire-empty-icon" }),
|
|
4661
5026
|
title ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: "pire-empty-title", style: { margin: 0 }, children: title }) : null,
|
|
@@ -4666,6 +5031,7 @@ function EmptyState({ icon = "file-text", title, action, compact, children, clas
|
|
|
4666
5031
|
|
|
4667
5032
|
// src/components/patterns/NumPad.tsx
|
|
4668
5033
|
var React30 = __toESM(require("react"), 1);
|
|
5034
|
+
var import_react_aria_components38 = require("react-aria-components");
|
|
4669
5035
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
4670
5036
|
var BASE_KEYS = [
|
|
4671
5037
|
{ value: "7" },
|
|
@@ -4682,6 +5048,12 @@ var BASE_KEYS = [
|
|
|
4682
5048
|
{ value: "0" }
|
|
4683
5049
|
];
|
|
4684
5050
|
var isInsertable = (value) => /^[0-9]+$/.test(value);
|
|
5051
|
+
function fittingDigits(digits, buffer, separator, maxFractionDigits) {
|
|
5052
|
+
const separatorAt = buffer.indexOf(separator);
|
|
5053
|
+
if (separatorAt === -1) return digits;
|
|
5054
|
+
const room = maxFractionDigits - (buffer.length - separatorAt - 1);
|
|
5055
|
+
return room <= 0 ? "" : digits.slice(0, room);
|
|
5056
|
+
}
|
|
4685
5057
|
function useNumPadKeyboard(onKey, isDisabled, containerRef) {
|
|
4686
5058
|
const handler = React30.useRef(onKey);
|
|
4687
5059
|
handler.current = onKey;
|
|
@@ -4709,6 +5081,10 @@ function useNumPadKeyboard(onKey, isDisabled, containerRef) {
|
|
|
4709
5081
|
handler.current("clear");
|
|
4710
5082
|
return;
|
|
4711
5083
|
}
|
|
5084
|
+
if (event.key === "," || event.key === ".") {
|
|
5085
|
+
handler.current("decimal");
|
|
5086
|
+
return;
|
|
5087
|
+
}
|
|
4712
5088
|
};
|
|
4713
5089
|
document.addEventListener("keydown", onKeyDown);
|
|
4714
5090
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
@@ -4721,6 +5097,7 @@ function NumPad({
|
|
|
4721
5097
|
onChange,
|
|
4722
5098
|
extraKeys = [],
|
|
4723
5099
|
onAction,
|
|
5100
|
+
maxFractionDigits,
|
|
4724
5101
|
isDisabled,
|
|
4725
5102
|
size = "md",
|
|
4726
5103
|
className,
|
|
@@ -4728,24 +5105,41 @@ function NumPad({
|
|
|
4728
5105
|
}) {
|
|
4729
5106
|
const msg = usePireMessages();
|
|
4730
5107
|
const containerRef = React30.useRef(null);
|
|
4731
|
-
const
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
5108
|
+
const { locale } = (0, import_react_aria_components38.useLocale)();
|
|
5109
|
+
const separator = decimalSeparatorFor(locale);
|
|
5110
|
+
const allowsDecimal = maxFractionDigits !== void 0 && maxFractionDigits > 0;
|
|
5111
|
+
const applyKey = React30.useCallback(
|
|
5112
|
+
(key) => {
|
|
5113
|
+
if (isDisabled) return;
|
|
5114
|
+
if (key.value === "backspace") {
|
|
5115
|
+
onChange(value.slice(0, -1));
|
|
5116
|
+
return;
|
|
5117
|
+
}
|
|
5118
|
+
if (key.value === "clear") {
|
|
5119
|
+
onChange("");
|
|
5120
|
+
return;
|
|
5121
|
+
}
|
|
5122
|
+
if (key.value === "decimal") {
|
|
5123
|
+
if (!allowsDecimal || value.includes(separator)) return;
|
|
5124
|
+
onChange((value === "" ? "0" : value) + separator);
|
|
5125
|
+
return;
|
|
5126
|
+
}
|
|
5127
|
+
if (isInsertable(key.value)) {
|
|
5128
|
+
onChange(
|
|
5129
|
+
value + (allowsDecimal ? fittingDigits(key.value, value, separator, maxFractionDigits) : key.value)
|
|
5130
|
+
);
|
|
5131
|
+
return;
|
|
5132
|
+
}
|
|
5133
|
+
onAction?.(key.value);
|
|
5134
|
+
},
|
|
5135
|
+
[isDisabled, value, onChange, onAction, allowsDecimal, separator, maxFractionDigits]
|
|
5136
|
+
);
|
|
4747
5137
|
useNumPadKeyboard((keyValue) => applyKey({ value: keyValue }), isDisabled, containerRef);
|
|
4748
|
-
const keys = [
|
|
5138
|
+
const keys = [
|
|
5139
|
+
...BASE_KEYS,
|
|
5140
|
+
...allowsDecimal ? [{ value: "decimal", label: separator }] : [],
|
|
5141
|
+
...extraKeys
|
|
5142
|
+
];
|
|
4749
5143
|
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
4750
5144
|
"div",
|
|
4751
5145
|
{
|
|
@@ -4757,7 +5151,7 @@ function NumPad({
|
|
|
4757
5151
|
children: [
|
|
4758
5152
|
target !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "pire-numpad-target", role: "status", "aria-live": "polite", children: target }) : null,
|
|
4759
5153
|
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "pire-numpad-grid", role: "group", "aria-label": ariaLabel, children: keys.map((key) => {
|
|
4760
|
-
const accessibleLabel = key.value === "backspace" ? msg.numPadBackspace : key.value === "clear" ? msg.numPadClear : void 0;
|
|
5154
|
+
const accessibleLabel = key.value === "backspace" ? msg.numPadBackspace : key.value === "clear" ? msg.numPadClear : key.value === "decimal" ? msg.numPadDecimal : void 0;
|
|
4761
5155
|
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
4762
5156
|
Button,
|
|
4763
5157
|
{
|
|
@@ -4766,6 +5160,7 @@ function NumPad({
|
|
|
4766
5160
|
fullWidth: true,
|
|
4767
5161
|
className: "pire-numpad-key",
|
|
4768
5162
|
"data-span": key.span === 2 ? "2" : void 0,
|
|
5163
|
+
"data-key": key.value === "decimal" ? "decimal" : void 0,
|
|
4769
5164
|
isDisabled,
|
|
4770
5165
|
"aria-label": accessibleLabel,
|
|
4771
5166
|
onPress: () => applyKey(key),
|
|
@@ -4781,7 +5176,7 @@ function NumPad({
|
|
|
4781
5176
|
|
|
4782
5177
|
// src/components/patterns/FileDropZone.tsx
|
|
4783
5178
|
var React31 = __toESM(require("react"), 1);
|
|
4784
|
-
var
|
|
5179
|
+
var import_react_aria_components39 = require("react-aria-components");
|
|
4785
5180
|
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
4786
5181
|
var isImage2 = (file) => file.type.startsWith("image/");
|
|
4787
5182
|
function FileDropZone({
|
|
@@ -4813,9 +5208,12 @@ function FileDropZone({
|
|
|
4813
5208
|
const [uncontrolled, setUncontrolled] = React31.useState(defaultValue ?? []);
|
|
4814
5209
|
const files = value ?? uncontrolled;
|
|
4815
5210
|
const created = React31.useRef([]);
|
|
4816
|
-
React31.useEffect(
|
|
4817
|
-
|
|
4818
|
-
|
|
5211
|
+
React31.useEffect(
|
|
5212
|
+
() => () => {
|
|
5213
|
+
for (const url of created.current) URL.revokeObjectURL(url);
|
|
5214
|
+
},
|
|
5215
|
+
[]
|
|
5216
|
+
);
|
|
4819
5217
|
const commit = (next) => {
|
|
4820
5218
|
if (value === void 0) setUncontrolled(next);
|
|
4821
5219
|
onChange?.(next);
|
|
@@ -4839,23 +5237,21 @@ function FileDropZone({
|
|
|
4839
5237
|
isRequired ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
4840
5238
|
] }) : null,
|
|
4841
5239
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
4842
|
-
|
|
5240
|
+
import_react_aria_components39.DropZone,
|
|
4843
5241
|
{
|
|
4844
5242
|
className: "pire-dropzone",
|
|
4845
5243
|
"aria-label": ariaLabel,
|
|
4846
5244
|
"data-height": height,
|
|
4847
5245
|
isDisabled: isDisabled || isReadOnly,
|
|
4848
5246
|
onDrop: async (e) => {
|
|
4849
|
-
const dropped = await Promise.all(
|
|
4850
|
-
e.items.filter(import_react_aria_components38.isFileDropItem).map((item) => item.getFile())
|
|
4851
|
-
);
|
|
5247
|
+
const dropped = await Promise.all(e.items.filter(import_react_aria_components39.isFileDropItem).map((item) => item.getFile()));
|
|
4852
5248
|
accept(dropped);
|
|
4853
5249
|
},
|
|
4854
5250
|
children: [
|
|
4855
5251
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Icon, { name: "download", size: 24, className: "pire-dropzone-icon" }),
|
|
4856
5252
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "pire-dropzone-prompt", children: promptLabel ?? msg.fileDropZonePrompt }),
|
|
4857
5253
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
4858
|
-
|
|
5254
|
+
import_react_aria_components39.FileTrigger,
|
|
4859
5255
|
{
|
|
4860
5256
|
acceptedFileTypes,
|
|
4861
5257
|
allowsMultiple,
|
|
@@ -4887,8 +5283,8 @@ function FileDropZone({
|
|
|
4887
5283
|
}
|
|
4888
5284
|
|
|
4889
5285
|
// src/index.ts
|
|
4890
|
-
var import_react_aria_components39 = require("react-aria-components");
|
|
4891
5286
|
var import_react_aria_components40 = require("react-aria-components");
|
|
5287
|
+
var import_react_aria_components41 = require("react-aria-components");
|
|
4892
5288
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4893
5289
|
0 && (module.exports = {
|
|
4894
5290
|
AppLauncher,
|