myoperator-ui 0.0.182 → 0.0.184
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/index.js +22 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2228,6 +2228,19 @@ const SelectField = React.forwardRef<HTMLButtonElement, SelectFieldProps>(
|
|
|
2228
2228
|
[onValueChange, onSelect, interceptValue, options]
|
|
2229
2229
|
);
|
|
2230
2230
|
|
|
2231
|
+
// Support re-selection: fire onSelect when clicking the already-selected
|
|
2232
|
+
// item. Radix only fires onValueChange for *new* values, so without this
|
|
2233
|
+
// clicking an action item like "Add custom date" a second time would be a
|
|
2234
|
+
// no-op.
|
|
2235
|
+
const handleItemClick = React.useCallback(
|
|
2236
|
+
(option: SelectOption) => {
|
|
2237
|
+
if (option.value === value && onSelect) {
|
|
2238
|
+
onSelect(option);
|
|
2239
|
+
}
|
|
2240
|
+
},
|
|
2241
|
+
[value, onSelect]
|
|
2242
|
+
);
|
|
2243
|
+
|
|
2231
2244
|
// Derive state from props
|
|
2232
2245
|
const derivedState = error ? "error" : "default";
|
|
2233
2246
|
|
|
@@ -2343,6 +2356,7 @@ const SelectField = React.forwardRef<HTMLButtonElement, SelectFieldProps>(
|
|
|
2343
2356
|
key={option.value}
|
|
2344
2357
|
value={option.value}
|
|
2345
2358
|
disabled={option.disabled}
|
|
2359
|
+
onClick={() => handleItemClick(option)}
|
|
2346
2360
|
>
|
|
2347
2361
|
{option.label}
|
|
2348
2362
|
</SelectItem>
|
|
@@ -2359,7 +2373,8 @@ const SelectField = React.forwardRef<HTMLButtonElement, SelectFieldProps>(
|
|
|
2359
2373
|
key={option.value}
|
|
2360
2374
|
value={option.value}
|
|
2361
2375
|
disabled={option.disabled}
|
|
2362
|
-
|
|
2376
|
+
onClick={() => handleItemClick(option)}
|
|
2377
|
+
>
|
|
2363
2378
|
{option.label}
|
|
2364
2379
|
</SelectItem>
|
|
2365
2380
|
))}
|
|
@@ -9773,6 +9788,11 @@ const PricingCard = React.forwardRef<HTMLDivElement, PricingCardProps>(
|
|
|
9773
9788
|
const buttonText =
|
|
9774
9789
|
ctaText || (isCurrentPlan ? "Current plan" : "Select plan");
|
|
9775
9790
|
|
|
9791
|
+
// Strip trailing decimal zeros: "500000000.000" \u2192 "500000000", "5,000.50" \u2192 "5,000.5"
|
|
9792
|
+
const cleanPrice = price.includes(".")
|
|
9793
|
+
? price.replace(/0+$/, "").replace(/\\.$/, "")
|
|
9794
|
+
: price;
|
|
9795
|
+
|
|
9776
9796
|
return (
|
|
9777
9797
|
<div
|
|
9778
9798
|
ref={ref}
|
|
@@ -9808,7 +9828,7 @@ const PricingCard = React.forwardRef<HTMLDivElement, PricingCardProps>(
|
|
|
9808
9828
|
<div className="flex flex-col gap-2.5">
|
|
9809
9829
|
<div className="flex items-end gap-1">
|
|
9810
9830
|
<span className="text-4xl leading-[44px] text-semantic-text-primary">
|
|
9811
|
-
\u20B9{
|
|
9831
|
+
\u20B9{cleanPrice}
|
|
9812
9832
|
</span>
|
|
9813
9833
|
<span className="text-sm text-semantic-text-muted tracking-[0.035px]">
|
|
9814
9834
|
{period}
|