@paubox/ui 3.2.1 → 3.4.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/index.esm.js
CHANGED
|
@@ -1994,7 +1994,7 @@ function _templateObject4$e() {
|
|
|
1994
1994
|
};
|
|
1995
1995
|
return data;
|
|
1996
1996
|
}
|
|
1997
|
-
function _templateObject5$
|
|
1997
|
+
function _templateObject5$8() {
|
|
1998
1998
|
var data = _tagged_template_literal$v([
|
|
1999
1999
|
"\n ",
|
|
2000
2000
|
"\n font-size: ",
|
|
@@ -2002,7 +2002,7 @@ function _templateObject5$7() {
|
|
|
2002
2002
|
"rem;\n letter-spacing: ",
|
|
2003
2003
|
"px;\n font-weight: 400;\n"
|
|
2004
2004
|
]);
|
|
2005
|
-
_templateObject5$
|
|
2005
|
+
_templateObject5$8 = function _templateObject() {
|
|
2006
2006
|
return data;
|
|
2007
2007
|
};
|
|
2008
2008
|
return data;
|
|
@@ -2273,7 +2273,7 @@ var $headline100Regular = css(_templateObject1$l(), commonStyles, headline100Fon
|
|
|
2273
2273
|
var $headline100Semibold = css(_templateObject2$l(), commonStyles, headline100FontSize / BASE_FONT_SIZE, headline100LineHeight / BASE_FONT_SIZE, headline100LetterSpacing);
|
|
2274
2274
|
var $headline200Regular = css(_templateObject3$h(), commonStyles, headline200FontSize / BASE_FONT_SIZE, headline200LineHeight / BASE_FONT_SIZE, headline200LetterSpacing);
|
|
2275
2275
|
var $headline200Semibold = css(_templateObject4$e(), commonStyles, headline200FontSize / BASE_FONT_SIZE, headline200LineHeight / BASE_FONT_SIZE, headline200LetterSpacing);
|
|
2276
|
-
var $headline300Regular = css(_templateObject5$
|
|
2276
|
+
var $headline300Regular = css(_templateObject5$8(), commonStyles, headline300FontSize / BASE_FONT_SIZE, headline300LineHeight / BASE_FONT_SIZE, headline300LetterSpacing);
|
|
2277
2277
|
var $headline300Semibold = css(_templateObject6$4(), commonStyles, headline300FontSize / BASE_FONT_SIZE, headline300LineHeight / BASE_FONT_SIZE, headline300LetterSpacing);
|
|
2278
2278
|
// PARAGRAPH
|
|
2279
2279
|
var $paragraph100Regular = css(_templateObject7$3(), commonStyles, paragraph100FontSize / BASE_FONT_SIZE, paragraph100LineHeight / BASE_FONT_SIZE, paragraph100LetterSpacing);
|
|
@@ -2461,13 +2461,13 @@ function _templateObject4$d() {
|
|
|
2461
2461
|
};
|
|
2462
2462
|
return data;
|
|
2463
2463
|
}
|
|
2464
|
-
function _templateObject5$
|
|
2464
|
+
function _templateObject5$7() {
|
|
2465
2465
|
var data = _tagged_template_literal$u([
|
|
2466
2466
|
"\n background-color: transparent;\n border: none;\n color: ",
|
|
2467
2467
|
";\n cursor: pointer;\n padding: 0.25rem;\n font-size: 0.75rem;\n margin-left: ",
|
|
2468
2468
|
";\n"
|
|
2469
2469
|
]);
|
|
2470
|
-
_templateObject5$
|
|
2470
|
+
_templateObject5$7 = function _templateObject() {
|
|
2471
2471
|
return data;
|
|
2472
2472
|
};
|
|
2473
2473
|
return data;
|
|
@@ -2489,7 +2489,7 @@ var StyledIcon = styled.div(_templateObject3$g(), function(param) {
|
|
|
2489
2489
|
return type === 'info' ? primary700$1 : type === 'error' ? danger700$1 : type === 'success' ? success700$1 : warning700$1;
|
|
2490
2490
|
});
|
|
2491
2491
|
var TextWrapper = styled.div(_templateObject4$d());
|
|
2492
|
-
var TruncaterButton = styled.button(_templateObject5$
|
|
2492
|
+
var TruncaterButton = styled.button(_templateObject5$7(), primary700$1, function(param) {
|
|
2493
2493
|
var isExpanded = param.isExpanded;
|
|
2494
2494
|
return !isExpanded ? '0' : '0.25rem';
|
|
2495
2495
|
});
|
|
@@ -22851,6 +22851,10 @@ var DatePicker = function(_param) {
|
|
|
22851
22851
|
style: {
|
|
22852
22852
|
width: rangeSelect ? 200 : 107
|
|
22853
22853
|
},
|
|
22854
|
+
// Analytics autocapture hooks (@paubox/tracking). The trigger is a native
|
|
22855
|
+
// button; tag it so the captured click is identifiable as a date picker.
|
|
22856
|
+
"data-pb-component": "DatePicker",
|
|
22857
|
+
"data-pb-name": rangeSelect ? 'date_range' : 'date',
|
|
22854
22858
|
children: [
|
|
22855
22859
|
dateString,
|
|
22856
22860
|
/*#__PURE__*/ jsx("div", {
|
|
@@ -23024,7 +23028,7 @@ var ArrowIcon = styled(ChevronDown)(_templateObject$m(), spacing(1), function(pa
|
|
|
23024
23028
|
var DropdownMenu = function(param) {
|
|
23025
23029
|
var label = param.label, items = param.items, children = param.children, openProp = param.open, onOpenChange = param.onOpenChange, iconLeft = param.iconLeft, _param_size = param.size, size = _param_size === void 0 ? 'small' : _param_size, align = param.align, _param_buttonProps = param.buttonProps, buttonProps = _param_buttonProps === void 0 ? {
|
|
23026
23030
|
color: 'primary'
|
|
23027
|
-
} : _param_buttonProps, _param_testId = param.testId, testId = _param_testId === void 0 ? 'dropdown' : _param_testId, childContainerRefs = param.childContainerRefs, disabled = param.disabled;
|
|
23031
|
+
} : _param_buttonProps, _param_testId = param.testId, testId = _param_testId === void 0 ? 'dropdown' : _param_testId, childContainerRefs = param.childContainerRefs, disabled = param.disabled, _param_detectEdges = param.detectEdges, detectEdges = _param_detectEdges === void 0 ? true : _param_detectEdges;
|
|
23028
23032
|
var _useState = _sliced_to_array$g(useState(false), 2), open = _useState[0], setOpen = _useState[1];
|
|
23029
23033
|
var buttonRef = useRef(null);
|
|
23030
23034
|
var isControlled = openProp !== undefined && onOpenChange;
|
|
@@ -23070,7 +23074,7 @@ var DropdownMenu = function(param) {
|
|
|
23070
23074
|
anchorRef: buttonRef,
|
|
23071
23075
|
align: align === 'center' ? 'middle' : align === 'right' ? 'end' : 'start',
|
|
23072
23076
|
offset: 4,
|
|
23073
|
-
detectEdges:
|
|
23077
|
+
detectEdges: detectEdges,
|
|
23074
23078
|
style: {
|
|
23075
23079
|
padding: "".concat(spacing(1), "px 0")
|
|
23076
23080
|
},
|
|
@@ -23437,11 +23441,11 @@ function _templateObject4$c() {
|
|
|
23437
23441
|
};
|
|
23438
23442
|
return data;
|
|
23439
23443
|
}
|
|
23440
|
-
function _templateObject5$
|
|
23444
|
+
function _templateObject5$6() {
|
|
23441
23445
|
var data = _tagged_template_literal$k([
|
|
23442
23446
|
"\n display: flex;\n flex-direction: row;\n gap: 0.5rem;\n"
|
|
23443
23447
|
]);
|
|
23444
|
-
_templateObject5$
|
|
23448
|
+
_templateObject5$6 = function _templateObject() {
|
|
23445
23449
|
return data;
|
|
23446
23450
|
};
|
|
23447
23451
|
return data;
|
|
@@ -23466,7 +23470,7 @@ var FilterGroup = styled.div(_templateObject1$h(), function(param) {
|
|
|
23466
23470
|
var CloseButton$1 = styled.button(_templateObject2$h());
|
|
23467
23471
|
var FilterRowsContainer = styled.div(_templateObject3$e());
|
|
23468
23472
|
var OrButton = styled.button(_templateObject4$c(), neutral100$1);
|
|
23469
|
-
var ButtonGroup = styled.div(_templateObject5$
|
|
23473
|
+
var ButtonGroup = styled.div(_templateObject5$6());
|
|
23470
23474
|
var AndButtonContainer = styled.div(_templateObject6$3());
|
|
23471
23475
|
var FilterForm = function(param) {
|
|
23472
23476
|
var values = param.values, fieldOptions = param.fieldOptions, operatorOptions = param.operatorOptions, onSubmit = param.onSubmit, onClear = param.onClear, onChange = param.onChange, errors = param.errors, touched = param.touched;
|
|
@@ -24120,11 +24124,11 @@ function _templateObject4$a() {
|
|
|
24120
24124
|
};
|
|
24121
24125
|
return data;
|
|
24122
24126
|
}
|
|
24123
|
-
function _templateObject5$
|
|
24127
|
+
function _templateObject5$5() {
|
|
24124
24128
|
var data = _tagged_template_literal$i([
|
|
24125
24129
|
'\n /* role="option" wrapper — visual state is delegated to inner MenuItem */\n'
|
|
24126
24130
|
]);
|
|
24127
|
-
_templateObject5$
|
|
24131
|
+
_templateObject5$5 = function _templateObject() {
|
|
24128
24132
|
return data;
|
|
24129
24133
|
};
|
|
24130
24134
|
return data;
|
|
@@ -24155,7 +24159,7 @@ var BaseInput$2 = styled.input(_templateObject1$f(), textPrimary$1, neutral500$1
|
|
|
24155
24159
|
var Chip$2 = styled.button(_templateObject2$f(), neutral100$1, $label200Medium, primary600$1, surfaceRaised, textPrimaryWhite, primary500);
|
|
24156
24160
|
var RightIconWrapper = styled.div(_templateObject3$c(), neutral600$1, surfaceMuted);
|
|
24157
24161
|
var EmptyState = styled.div(_templateObject4$a(), neutral500$1, $paragraph200Regular, surfaceMuted);
|
|
24158
|
-
var OptionWrapper = styled.div(_templateObject5$
|
|
24162
|
+
var OptionWrapper = styled.div(_templateObject5$5());
|
|
24159
24163
|
/**
|
|
24160
24164
|
* AutoComplete: single-line input that filters a closed list of options as
|
|
24161
24165
|
* the user types. Selected items render as removable chips. Multi-select.
|
|
@@ -24376,6 +24380,10 @@ var OptionWrapper = styled.div(_templateObject5$4());
|
|
|
24376
24380
|
"aria-activedescendant": open ? activeOptionId : undefined,
|
|
24377
24381
|
"aria-haspopup": "listbox",
|
|
24378
24382
|
"aria-label": ariaLabel,
|
|
24383
|
+
// Analytics autocapture hooks (@paubox/tracking). The input is native, so
|
|
24384
|
+
// field_interaction works out of the box; tag the component for clarity.
|
|
24385
|
+
"data-pb-component": "AutoComplete",
|
|
24386
|
+
"data-pb-name": ariaLabel || inputProps.name || undefined,
|
|
24379
24387
|
onChange: handleInputChange,
|
|
24380
24388
|
onFocus: function() {
|
|
24381
24389
|
return setIsFocused(true);
|
|
@@ -24882,12 +24890,12 @@ function _templateObject4$9() {
|
|
|
24882
24890
|
};
|
|
24883
24891
|
return data;
|
|
24884
24892
|
}
|
|
24885
|
-
function _templateObject5$
|
|
24893
|
+
function _templateObject5$4() {
|
|
24886
24894
|
var data = _tagged_template_literal$g([
|
|
24887
24895
|
"\n position: absolute;\n right: 0rem;\n width: 2rem;\n background-color: inherit;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 0;\n border: none;\n cursor: pointer;\n z-index: 0;\n transition: all 150ms ease-in-out;\n transform: ",
|
|
24888
24896
|
";\n"
|
|
24889
24897
|
]);
|
|
24890
|
-
_templateObject5$
|
|
24898
|
+
_templateObject5$4 = function _templateObject() {
|
|
24891
24899
|
return data;
|
|
24892
24900
|
};
|
|
24893
24901
|
return data;
|
|
@@ -24973,7 +24981,7 @@ var MultiSelectChip = function(option) {
|
|
|
24973
24981
|
});
|
|
24974
24982
|
};
|
|
24975
24983
|
// Style for the Icons
|
|
24976
|
-
var IconWrapper$2 = styled.div(_templateObject5$
|
|
24984
|
+
var IconWrapper$2 = styled.div(_templateObject5$4(), function(param) {
|
|
24977
24985
|
var open = param.open;
|
|
24978
24986
|
return open ? 'rotate(180deg)' : 'rotate(0deg)';
|
|
24979
24987
|
});
|
|
@@ -25017,6 +25025,10 @@ var MultiSelect = function(_param) {
|
|
|
25017
25025
|
return !prev;
|
|
25018
25026
|
});
|
|
25019
25027
|
},
|
|
25028
|
+
// Analytics autocapture hooks (@paubox/tracking). The interactive node is
|
|
25029
|
+
// this wrapper div (the inner <select> is inert), so identify it here.
|
|
25030
|
+
"data-pb-component": "MultiSelect",
|
|
25031
|
+
"data-pb-name": props['aria-label'] || props.name || label || undefined,
|
|
25020
25032
|
children: [
|
|
25021
25033
|
/*#__PURE__*/ jsxs(InputWrapper$2, {
|
|
25022
25034
|
children: [
|
|
@@ -25722,6 +25734,10 @@ var Select = function(_param) {
|
|
|
25722
25734
|
return !prev;
|
|
25723
25735
|
});
|
|
25724
25736
|
},
|
|
25737
|
+
// Analytics autocapture hooks (@paubox/tracking). The interactive node is
|
|
25738
|
+
// this wrapper div (the inner <select> is inert), so identify it here.
|
|
25739
|
+
"data-pb-component": "Select",
|
|
25740
|
+
"data-pb-name": props['aria-label'] || props.name || undefined,
|
|
25725
25741
|
children: [
|
|
25726
25742
|
/*#__PURE__*/ jsxs(InputWrapper, {
|
|
25727
25743
|
children: [
|
|
@@ -30879,11 +30895,11 @@ function _templateObject4$5() {
|
|
|
30879
30895
|
};
|
|
30880
30896
|
return data;
|
|
30881
30897
|
}
|
|
30882
|
-
function _templateObject5$
|
|
30898
|
+
function _templateObject5$3() {
|
|
30883
30899
|
var data = _tagged_template_literal$6([
|
|
30884
30900
|
"\n width: 100%;\n max-height: 420px;\n overflow-y: auto;\n"
|
|
30885
30901
|
]);
|
|
30886
|
-
_templateObject5$
|
|
30902
|
+
_templateObject5$3 = function _templateObject() {
|
|
30887
30903
|
return data;
|
|
30888
30904
|
};
|
|
30889
30905
|
return data;
|
|
@@ -30982,7 +30998,7 @@ var ClearButton = styled(IconButton)(_templateObject3$5(), spacing(1));
|
|
|
30982
30998
|
* Inner content of the dropdown. Popper provides the outer container
|
|
30983
30999
|
* (positioning, portal, elevation, dark-mode background). We just lay out
|
|
30984
31000
|
* the rows full-width inside it, with our own max-height + scroll behavior.
|
|
30985
|
-
*/ var DropdownContent = styled.div(_templateObject5$
|
|
31001
|
+
*/ var DropdownContent = styled.div(_templateObject5$3());
|
|
30986
31002
|
var DropdownRow = styled.button(_templateObject6$1(), spacing(1), spacing(1), spacing(2), function(param) {
|
|
30987
31003
|
var highlighted = param.highlighted;
|
|
30988
31004
|
return highlighted ? neutral100$1 : 'transparent';
|
|
@@ -32003,6 +32019,17 @@ function _templateObject4$4() {
|
|
|
32003
32019
|
};
|
|
32004
32020
|
return data;
|
|
32005
32021
|
}
|
|
32022
|
+
function _templateObject5$2() {
|
|
32023
|
+
var data = _tagged_template_literal$5([
|
|
32024
|
+
"\n color: ",
|
|
32025
|
+
";\n font-size: 12px;\n line-height: 1.2;\n font-family: 'Roboto', sans-serif;\n\n html.dark & {\n color: ",
|
|
32026
|
+
";\n }\n"
|
|
32027
|
+
]);
|
|
32028
|
+
_templateObject5$2 = function _templateObject() {
|
|
32029
|
+
return data;
|
|
32030
|
+
};
|
|
32031
|
+
return data;
|
|
32032
|
+
}
|
|
32006
32033
|
var variantMap = {
|
|
32007
32034
|
blue: {
|
|
32008
32035
|
bg: primary100$1,
|
|
@@ -32028,8 +32055,9 @@ var IconBadge = styled.div(_templateObject1$5(), function(param) {
|
|
|
32028
32055
|
var TextBlock = styled.div(_templateObject2$5());
|
|
32029
32056
|
var Label = styled.div(_templateObject3$4(), neutral500$1, neutral400$1);
|
|
32030
32057
|
var Value = styled.div(_templateObject4$4(), neutral900$1, neutral100$1);
|
|
32058
|
+
var Caption = styled.div(_templateObject5$2(), neutral400$1, neutral500$1);
|
|
32031
32059
|
var StatCard = function(param) {
|
|
32032
|
-
var label = param.label, value = param.value, icon = param.icon, _param_variant = param.variant, variant = _param_variant === void 0 ? 'blue' : _param_variant, className = param.className;
|
|
32060
|
+
var label = param.label, value = param.value, icon = param.icon, _param_variant = param.variant, variant = _param_variant === void 0 ? 'blue' : _param_variant, className = param.className, caption = param.caption;
|
|
32033
32061
|
var _variantMap_variant = variantMap[variant], bg = _variantMap_variant.bg, color = _variantMap_variant.color;
|
|
32034
32062
|
return /*#__PURE__*/ jsxs(Card, {
|
|
32035
32063
|
className: className,
|
|
@@ -32046,6 +32074,9 @@ var StatCard = function(param) {
|
|
|
32046
32074
|
}),
|
|
32047
32075
|
/*#__PURE__*/ jsx(Value, {
|
|
32048
32076
|
children: typeof value === 'number' ? value.toLocaleString() : value
|
|
32077
|
+
}),
|
|
32078
|
+
caption && /*#__PURE__*/ jsx(Caption, {
|
|
32079
|
+
children: caption
|
|
32049
32080
|
})
|
|
32050
32081
|
]
|
|
32051
32082
|
})
|
package/package.json
CHANGED
|
@@ -13,5 +13,10 @@ export interface DropdownMenuProps {
|
|
|
13
13
|
size?: 'small' | 'large';
|
|
14
14
|
childContainerRefs?: RefObject<HTMLElement>[];
|
|
15
15
|
disabled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Keep the menu within the viewport, shifting it away from the window edge
|
|
18
|
+
* when it would otherwise be clipped. Defaults to `true`.
|
|
19
|
+
*/
|
|
20
|
+
detectEdges?: boolean;
|
|
16
21
|
}
|
|
17
|
-
export declare const DropdownMenu: ({ label, items, children, open: openProp, onOpenChange, iconLeft, size, align, buttonProps, testId, childContainerRefs, disabled, }: DropdownMenuProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const DropdownMenu: ({ label, items, children, open: openProp, onOpenChange, iconLeft, size, align, buttonProps, testId, childContainerRefs, disabled, detectEdges, }: DropdownMenuProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -6,5 +6,10 @@ export interface StatCardProps {
|
|
|
6
6
|
icon: React.ReactNode;
|
|
7
7
|
variant?: StatCardVariant;
|
|
8
8
|
className?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Optional third line rendered as a smaller, muted label beneath the value
|
|
11
|
+
* (e.g. a time window like "Last 24 hours").
|
|
12
|
+
*/
|
|
13
|
+
caption?: string;
|
|
9
14
|
}
|
|
10
|
-
export declare const StatCard: ({ label, value, icon, variant, className, }: StatCardProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const StatCard: ({ label, value, icon, variant, className, caption, }: StatCardProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|