@simpleapps-com/augur-web 2.4.0 → 2026.11.1
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/EXPORTS.md +18 -189
- package/README.md +18 -364
- package/dist/accordion.cjs.map +1 -1
- package/dist/accordion.d.ts +4 -5
- package/dist/accordion.d.ts.map +1 -0
- package/dist/add-to-cart-button.cjs.map +1 -1
- package/dist/add-to-cart-button.d.ts +5 -8
- package/dist/add-to-cart-button.d.ts.map +1 -0
- package/dist/breadcrumb.cjs.map +1 -1
- package/dist/breadcrumb.d.ts +5 -7
- package/dist/breadcrumb.d.ts.map +1 -0
- package/dist/breadcrumbs.cjs.map +1 -1
- package/dist/breadcrumbs.d.ts +4 -4
- package/dist/breadcrumbs.d.ts.map +1 -0
- package/dist/button.cjs.map +1 -1
- package/dist/button.d.ts +7 -9
- package/dist/button.d.ts.map +1 -0
- package/dist/card.cjs.map +1 -1
- package/dist/card.d.ts +3 -4
- package/dist/card.d.ts.map +1 -0
- package/dist/checkbox.cjs.map +1 -1
- package/dist/checkbox.d.ts +3 -4
- package/dist/checkbox.d.ts.map +1 -0
- package/dist/chunk-32XB3REY.cjs.map +1 -1
- package/dist/chunk-5VMEEKZ5.cjs.map +1 -1
- package/dist/chunk-5ZITWMV4.cjs.map +1 -1
- package/dist/chunk-76RSVRGB.cjs.map +1 -1
- package/dist/chunk-7EXXNELX.cjs.map +1 -1
- package/dist/chunk-BXMTQGKV.cjs.map +1 -1
- package/dist/chunk-EEJYDSXR.cjs +220 -0
- package/dist/chunk-EEJYDSXR.cjs.map +1 -0
- package/dist/chunk-GSR6SMQ2.cjs.map +1 -1
- package/dist/{chunk-OJ5G4BLS.js → chunk-JWTTXZDS.js} +15 -18
- package/dist/chunk-JWTTXZDS.js.map +1 -0
- package/dist/chunk-JXW4XE2P.cjs.map +1 -1
- package/dist/chunk-MAENILZP.cjs.map +1 -1
- package/dist/chunk-NEY26NNF.cjs.map +1 -1
- package/dist/{chunk-I5NVZORX.cjs → chunk-OQV27VC5.cjs} +15 -18
- package/dist/chunk-OQV27VC5.cjs.map +1 -0
- package/dist/{chunk-DCXYO3RB.js → chunk-PFEPE5UE.js} +7 -3
- package/dist/chunk-PFEPE5UE.js.map +1 -0
- package/dist/chunk-T52J3SHP.cjs.map +1 -1
- package/dist/chunk-UFL6PVLI.cjs.map +1 -1
- package/dist/chunk-VI2IE6RC.js +220 -0
- package/dist/chunk-VI2IE6RC.js.map +1 -0
- package/dist/chunk-VL6L4GDA.cjs.map +1 -1
- package/dist/chunk-WJUDOEVB.cjs.map +1 -1
- package/dist/chunk-XGKBDPGD.cjs.map +1 -1
- package/dist/{chunk-AE4GLYJE.cjs → chunk-YTBB63IE.cjs} +7 -3
- package/dist/chunk-YTBB63IE.cjs.map +1 -0
- package/dist/chunk-Z57QBVUC.cjs.map +1 -1
- package/dist/command.cjs +1 -0
- package/dist/command.cjs.map +1 -1
- package/dist/command.d.ts +13 -15
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +1 -0
- package/dist/command.js.map +1 -1
- package/dist/confirm-dialog.cjs.map +1 -1
- package/dist/confirm-dialog.d.ts +4 -6
- package/dist/confirm-dialog.d.ts.map +1 -0
- package/dist/data-table.cjs +35 -23
- package/dist/data-table.cjs.map +1 -1
- package/dist/data-table.d.ts +9 -11
- package/dist/data-table.d.ts.map +1 -0
- package/dist/data-table.js +34 -22
- package/dist/data-table.js.map +1 -1
- package/dist/detail-panel.cjs.map +1 -1
- package/dist/detail-panel.d.ts +6 -8
- package/dist/detail-panel.d.ts.map +1 -0
- package/dist/dialog.cjs.map +1 -1
- package/dist/dialog.d.ts +6 -8
- package/dist/dialog.d.ts.map +1 -0
- package/dist/dropdown-menu.cjs.map +1 -1
- package/dist/dropdown-menu.d.ts +5 -7
- package/dist/dropdown-menu.d.ts.map +1 -0
- package/dist/financing-widget.cjs +1 -3
- package/dist/financing-widget.cjs.map +1 -1
- package/dist/financing-widget.d.ts +5 -6
- package/dist/financing-widget.d.ts.map +1 -0
- package/dist/financing-widget.js +1 -3
- package/dist/financing-widget.js.map +1 -1
- package/dist/form-field.cjs.map +1 -1
- package/dist/form-field.d.ts +4 -5
- package/dist/form-field.d.ts.map +1 -0
- package/dist/form-input.cjs.map +1 -1
- package/dist/form-input.d.ts +4 -5
- package/dist/form-input.d.ts.map +1 -0
- package/dist/form-select.cjs.map +1 -1
- package/dist/form-select.d.ts +4 -5
- package/dist/form-select.d.ts.map +1 -0
- package/dist/form-textarea.cjs.map +1 -1
- package/dist/form-textarea.d.ts +4 -5
- package/dist/form-textarea.d.ts.map +1 -0
- package/dist/gtm.cjs +3 -2
- package/dist/gtm.cjs.map +1 -1
- package/dist/gtm.d.ts +12 -15
- package/dist/gtm.d.ts.map +1 -0
- package/dist/gtm.js +2 -1
- package/dist/input.cjs.map +1 -1
- package/dist/input.d.ts +4 -5
- package/dist/input.d.ts.map +1 -0
- package/dist/label.cjs.map +1 -1
- package/dist/label.d.ts +5 -7
- package/dist/label.d.ts.map +1 -0
- package/dist/list-view.cjs.map +1 -1
- package/dist/list-view.d.ts +5 -7
- package/dist/list-view.d.ts.map +1 -0
- package/dist/mdx-components.cjs +5 -2
- package/dist/mdx-components.cjs.map +1 -1
- package/dist/mdx-components.d.ts +11 -6
- package/dist/mdx-components.d.ts.map +1 -0
- package/dist/mdx-components.js +5 -2
- package/dist/mdx-components.js.map +1 -1
- package/dist/navigation-menu.cjs.map +1 -1
- package/dist/navigation-menu.d.ts +5 -7
- package/dist/navigation-menu.d.ts.map +1 -0
- package/dist/pagination.cjs +3 -2
- package/dist/pagination.cjs.map +1 -1
- package/dist/pagination.d.ts +10 -14
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +2 -1
- package/dist/payment-modal.cjs +20 -19
- package/dist/payment-modal.cjs.map +1 -1
- package/dist/payment-modal.d.ts +5 -7
- package/dist/payment-modal.d.ts.map +1 -0
- package/dist/payment-modal.js +19 -18
- package/dist/payment-modal.js.map +1 -1
- package/dist/popover.cjs.map +1 -1
- package/dist/popover.d.ts +4 -5
- package/dist/popover.d.ts.map +1 -0
- package/dist/price-format.cjs.map +1 -1
- package/dist/price-format.d.ts +4 -5
- package/dist/price-format.d.ts.map +1 -0
- package/dist/price.cjs +4 -1
- package/dist/price.cjs.map +1 -1
- package/dist/price.d.ts +8 -22
- package/dist/price.d.ts.map +1 -0
- package/dist/price.js +4 -1
- package/dist/price.js.map +1 -1
- package/dist/provider.cjs +4 -2
- package/dist/provider.cjs.map +1 -1
- package/dist/provider.d.ts +7 -10
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +3 -1
- package/dist/provider.js.map +1 -1
- package/dist/quantity-input.cjs +27 -40
- package/dist/quantity-input.cjs.map +1 -1
- package/dist/quantity-input.d.ts +4 -5
- package/dist/quantity-input.d.ts.map +1 -0
- package/dist/quantity-input.js +27 -40
- package/dist/quantity-input.js.map +1 -1
- package/dist/radio-group.cjs.map +1 -1
- package/dist/radio-group.d.ts +3 -4
- package/dist/radio-group.d.ts.map +1 -0
- package/dist/resource-tabs.cjs +1 -0
- package/dist/resource-tabs.cjs.map +1 -1
- package/dist/resource-tabs.d.ts +6 -8
- package/dist/resource-tabs.d.ts.map +1 -0
- package/dist/resource-tabs.js +1 -0
- package/dist/resource-tabs.js.map +1 -1
- package/dist/rules.d.ts +210 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/select.cjs.map +1 -1
- package/dist/select.d.ts +4 -5
- package/dist/select.d.ts.map +1 -0
- package/dist/separator.cjs.map +1 -1
- package/dist/separator.d.ts +3 -4
- package/dist/separator.d.ts.map +1 -0
- package/dist/session-replay.cjs +4 -2
- package/dist/session-replay.cjs.map +1 -1
- package/dist/session-replay.d.ts +4 -5
- package/dist/session-replay.d.ts.map +1 -0
- package/dist/session-replay.js +4 -2
- package/dist/session-replay.js.map +1 -1
- package/dist/skeleton.cjs.map +1 -1
- package/dist/skeleton.d.ts +2 -4
- package/dist/skeleton.d.ts.map +1 -0
- package/dist/spinner.cjs.map +1 -1
- package/dist/spinner.d.ts +2 -4
- package/dist/spinner.d.ts.map +1 -0
- package/dist/stock-label.cjs +14 -12
- package/dist/stock-label.cjs.map +1 -1
- package/dist/stock-label.d.ts +7 -7
- package/dist/stock-label.d.ts.map +1 -0
- package/dist/stock-label.js +14 -12
- package/dist/stock-label.js.map +1 -1
- package/dist/table.cjs.map +1 -1
- package/dist/table.d.ts +3 -4
- package/dist/table.d.ts.map +1 -0
- package/dist/tabs.cjs.map +1 -1
- package/dist/tabs.d.ts +4 -5
- package/dist/tabs.d.ts.map +1 -0
- package/dist/textarea.cjs.map +1 -1
- package/dist/textarea.d.ts +4 -5
- package/dist/textarea.d.ts.map +1 -0
- package/llms.txt +23 -38
- package/package.json +26 -17
- package/dist/accordion.d.cts +0 -9
- package/dist/add-to-cart-button.d.cts +0 -14
- package/dist/breadcrumb.d.cts +0 -22
- package/dist/breadcrumbs.d.cts +0 -31
- package/dist/button.d.cts +0 -27
- package/dist/card.d.cts +0 -10
- package/dist/checkbox.d.cts +0 -6
- package/dist/chunk-AE4GLYJE.cjs.map +0 -1
- package/dist/chunk-DCXYO3RB.js.map +0 -1
- package/dist/chunk-I5NVZORX.cjs.map +0 -1
- package/dist/chunk-OJ5G4BLS.js.map +0 -1
- package/dist/command.d.cts +0 -87
- package/dist/confirm-dialog.d.cts +0 -35
- package/dist/data-table.d.cts +0 -55
- package/dist/detail-panel.d.cts +0 -59
- package/dist/dialog.d.cts +0 -22
- package/dist/dropdown-menu.d.cts +0 -30
- package/dist/financing-widget.d.cts +0 -45
- package/dist/form-field.d.cts +0 -14
- package/dist/form-input.d.cts +0 -19
- package/dist/form-select.d.cts +0 -34
- package/dist/form-textarea.d.cts +0 -12
- package/dist/gtm.d.cts +0 -69
- package/dist/input.d.cts +0 -6
- package/dist/label.d.cts +0 -8
- package/dist/list-view.d.cts +0 -18
- package/dist/mdx-components.d.cts +0 -20
- package/dist/navigation-menu.d.cts +0 -15
- package/dist/pagination.d.cts +0 -50
- package/dist/payment-modal.d.cts +0 -30
- package/dist/popover.d.cts +0 -9
- package/dist/price-format.d.cts +0 -21
- package/dist/price.d.cts +0 -90
- package/dist/provider.d.cts +0 -47
- package/dist/quantity-input.d.cts +0 -33
- package/dist/radio-group.d.cts +0 -7
- package/dist/resource-tabs.d.cts +0 -33
- package/dist/select.d.cts +0 -15
- package/dist/separator.d.cts +0 -6
- package/dist/session-replay.d.cts +0 -44
- package/dist/skeleton.d.cts +0 -5
- package/dist/spinner.d.cts +0 -10
- package/dist/stock-label.d.cts +0 -47
- package/dist/table.d.cts +0 -12
- package/dist/tabs.d.cts +0 -9
- package/dist/textarea.d.cts +0 -6
package/dist/quantity-input.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client";
|
|
3
|
+
import {
|
|
4
|
+
clampQuantity,
|
|
5
|
+
cleanQtyFrom,
|
|
6
|
+
decreaseDisabled,
|
|
7
|
+
increaseDisabled,
|
|
8
|
+
keyAllowed,
|
|
9
|
+
stepDown,
|
|
10
|
+
stepUp
|
|
11
|
+
} from "./chunk-VI2IE6RC.js";
|
|
3
12
|
|
|
4
13
|
// src/quantity-input.tsx
|
|
5
14
|
import * as React from "react";
|
|
@@ -10,6 +19,13 @@ function roundToStep(value, step) {
|
|
|
10
19
|
if (step <= 1) return value;
|
|
11
20
|
return Math.ceil(value / step) * step;
|
|
12
21
|
}
|
|
22
|
+
function committedQuantity(raw, min, max, step, decimals) {
|
|
23
|
+
if (raw.trim() === "") return min;
|
|
24
|
+
let parsed = parseFloat(raw);
|
|
25
|
+
if (isNaN(parsed)) parsed = min;
|
|
26
|
+
parsed = clampQuantity(roundToStep(parsed, step), min, max);
|
|
27
|
+
return parseFloat(parsed.toFixed(decimals));
|
|
28
|
+
}
|
|
13
29
|
var QuantityInput = React.memo(
|
|
14
30
|
React.forwardRef(
|
|
15
31
|
({
|
|
@@ -31,52 +47,25 @@ var QuantityInput = React.memo(
|
|
|
31
47
|
}, [value, decimals]);
|
|
32
48
|
const commit = React.useCallback(
|
|
33
49
|
(raw) => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
let parsed = parseFloat(raw);
|
|
40
|
-
if (isNaN(parsed)) parsed = min;
|
|
41
|
-
parsed = roundToStep(parsed, step);
|
|
42
|
-
if (parsed < min) parsed = min;
|
|
43
|
-
if (max !== void 0 && parsed > max) parsed = max;
|
|
44
|
-
const rounded = parseFloat(parsed.toFixed(decimals));
|
|
45
|
-
setQtyStr(rounded.toFixed(decimals));
|
|
46
|
-
onChange(rounded);
|
|
50
|
+
const quantity = committedQuantity(raw, min, max, step, decimals);
|
|
51
|
+
setQtyStr(quantity.toFixed(decimals));
|
|
52
|
+
onChange(quantity);
|
|
47
53
|
},
|
|
48
54
|
[min, max, step, decimals, onChange]
|
|
49
55
|
);
|
|
50
56
|
const handleKeyDown = React.useCallback(
|
|
51
57
|
(e) => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (e.key === "Enter") {
|
|
55
|
-
commit(qtyStr);
|
|
56
|
-
}
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
if (decimals > 0 && e.key === "." && !qtyStr.includes(".")) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
if (e.key >= "0" && e.key <= "9") {
|
|
58
|
+
if (e.key === "Enter") {
|
|
59
|
+
commit(qtyStr);
|
|
63
60
|
return;
|
|
64
61
|
}
|
|
65
|
-
e.preventDefault();
|
|
62
|
+
if (!keyAllowed(e.key, decimals, qtyStr.includes("."))) e.preventDefault();
|
|
66
63
|
},
|
|
67
64
|
[decimals, qtyStr, commit]
|
|
68
65
|
);
|
|
69
66
|
const handleChange = React.useCallback(
|
|
70
67
|
(e) => {
|
|
71
|
-
|
|
72
|
-
let cleaned = e.target.value.replace(pattern, "");
|
|
73
|
-
if (decimals > 0) {
|
|
74
|
-
const parts = cleaned.split(".");
|
|
75
|
-
if (parts.length > 2) {
|
|
76
|
-
cleaned = parts[0] + "." + parts.slice(1).join("");
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
setQtyStr(cleaned);
|
|
68
|
+
setQtyStr(cleanQtyFrom(e.target.value, decimals > 0, false, 0));
|
|
80
69
|
},
|
|
81
70
|
[decimals]
|
|
82
71
|
);
|
|
@@ -84,15 +73,13 @@ var QuantityInput = React.memo(
|
|
|
84
73
|
commit(qtyStr);
|
|
85
74
|
}, [commit, qtyStr]);
|
|
86
75
|
const handleDecrement = React.useCallback(() => {
|
|
87
|
-
|
|
88
|
-
onChange(next);
|
|
76
|
+
onChange(stepDown(value, step, min));
|
|
89
77
|
}, [value, step, min, onChange]);
|
|
90
78
|
const handleIncrement = React.useCallback(() => {
|
|
91
|
-
|
|
92
|
-
onChange(max !== void 0 ? Math.min(next, max) : next);
|
|
79
|
+
onChange(stepUp(value, step, max));
|
|
93
80
|
}, [value, step, max, onChange]);
|
|
94
|
-
const minDisabled = disabled
|
|
95
|
-
const maxDisabled = disabled
|
|
81
|
+
const minDisabled = decreaseDisabled(disabled, value, min);
|
|
82
|
+
const maxDisabled = increaseDisabled(disabled, value, max);
|
|
96
83
|
return /* @__PURE__ */ jsxs("div", { className: cn("bg-background inline-flex items-center rounded-md border", className), children: [
|
|
97
84
|
showStepper && /* @__PURE__ */ jsx(
|
|
98
85
|
"button",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/quantity-input.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"@simpleapps-com/augur-utils/web\";\nimport { LuMinus, LuPlus } from \"react-icons/lu\";\n\nexport interface QuantityInputProps {\n /** Current quantity value (controlled). */\n value: number;\n /** Called with the new quantity after validation and rounding. */\n onChange: (value: number) => void;\n /** Minimum allowed quantity. Default: `0`. */\n min?: number;\n /** Maximum allowed quantity. */\n max?: number;\n /** Increment/decrement step size. Values are rounded up to the nearest step. Default: `1`. */\n step?: number;\n /** Number of decimal places to display. Default: `0`. */\n decimals?: number;\n /** Show +/- stepper buttons. Default: `true`. */\n showStepper?: boolean;\n disabled?: boolean;\n className?: string;\n inputClassName?: string;\n buttonClassName?: string;\n}\n\nfunction roundToStep(value: number, step: number): number {\n if (step <= 1) return value;\n return Math.ceil(value / step) * step;\n}\n\n/**\n * Numeric input with optional +/- stepper buttons for cart quantities.\n *\n * @example\n * ```tsx\n * <QuantityInput value={qty} onChange={setQty} min={1} step={1} />\n * ```\n */\nconst QuantityInput = React.memo(\n React.forwardRef<HTMLInputElement, QuantityInputProps>(\n (\n {\n value,\n onChange,\n min = 0,\n max,\n step = 1,\n decimals = 0,\n showStepper = true,\n disabled = false,\n className,\n inputClassName,\n buttonClassName,\n },\n ref,\n ) => {\n const [qtyStr, setQtyStr] = React.useState(() => value.toFixed(decimals));\n\n React.useEffect(() => {\n setQtyStr(value.toFixed(decimals));\n }, [value, decimals]);\n\n const commit = React.useCallback(\n (raw: string) => {\n
|
|
1
|
+
{"version":3,"sources":["../src/quantity-input.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"@simpleapps-com/augur-utils/web\";\nimport { LuMinus, LuPlus } from \"react-icons/lu\";\nimport {\n clampQuantity,\n cleanQtyFrom,\n decreaseDisabled,\n increaseDisabled,\n keyAllowed,\n stepDown,\n stepUp,\n} from \"./rules\";\n\nexport interface QuantityInputProps {\n /** Current quantity value (controlled). */\n value: number;\n /** Called with the new quantity after validation and rounding. */\n onChange: (value: number) => void;\n /** Minimum allowed quantity. Default: `0`. */\n min?: number;\n /** Maximum allowed quantity. */\n max?: number;\n /** Increment/decrement step size. Values are rounded up to the nearest step. Default: `1`. */\n step?: number;\n /** Number of decimal places to display. Default: `0`. */\n decimals?: number;\n /** Show +/- stepper buttons. Default: `true`. */\n showStepper?: boolean;\n disabled?: boolean;\n className?: string;\n inputClassName?: string;\n buttonClassName?: string;\n}\n\nfunction roundToStep(value: number, step: number): number {\n if (step <= 1) return value;\n return Math.ceil(value / step) * step;\n}\n\n/**\n * The quantity a typed string commits to: `min` when blank, else the number (or `min` when it\n * is not one) rounded up to the step, clamped to [min, max] and to `decimals` places.\n */\nfunction committedQuantity(\n raw: string,\n min: number,\n max: number | undefined,\n step: number,\n decimals: number,\n): number {\n if (raw.trim() === \"\") return min;\n\n let parsed = parseFloat(raw);\n if (isNaN(parsed)) parsed = min;\n\n // roundToStep stays here: Math.ceil over fractional quantities has no lsc form.\n parsed = clampQuantity(roundToStep(parsed, step), min, max);\n\n return parseFloat(parsed.toFixed(decimals));\n}\n\n/**\n * Numeric input with optional +/- stepper buttons for cart quantities.\n *\n * @example\n * ```tsx\n * <QuantityInput value={qty} onChange={setQty} min={1} step={1} />\n * ```\n */\nconst QuantityInput = React.memo(\n React.forwardRef<HTMLInputElement, QuantityInputProps>(\n (\n {\n value,\n onChange,\n min = 0,\n max,\n step = 1,\n decimals = 0,\n showStepper = true,\n disabled = false,\n className,\n inputClassName,\n buttonClassName,\n },\n ref,\n ) => {\n const [qtyStr, setQtyStr] = React.useState(() => value.toFixed(decimals));\n\n React.useEffect(() => {\n setQtyStr(value.toFixed(decimals));\n }, [value, decimals]);\n\n const commit = React.useCallback(\n (raw: string) => {\n const quantity = committedQuantity(raw, min, max, step, decimals);\n setQtyStr(quantity.toFixed(decimals));\n onChange(quantity);\n },\n [min, max, step, decimals, onChange],\n );\n\n const handleKeyDown = React.useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"Enter\") {\n commit(qtyStr);\n return;\n }\n if (!keyAllowed(e.key, decimals, qtyStr.includes(\".\"))) e.preventDefault();\n },\n [decimals, qtyStr, commit],\n );\n\n const handleChange = React.useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setQtyStr(cleanQtyFrom(e.target.value, decimals > 0, false, 0));\n },\n [decimals],\n );\n\n const handleBlur = React.useCallback(() => {\n commit(qtyStr);\n }, [commit, qtyStr]);\n\n const handleDecrement = React.useCallback(() => {\n onChange(stepDown(value, step, min));\n }, [value, step, min, onChange]);\n\n const handleIncrement = React.useCallback(() => {\n onChange(stepUp(value, step, max));\n }, [value, step, max, onChange]);\n\n const minDisabled = decreaseDisabled(disabled, value, min);\n const maxDisabled = increaseDisabled(disabled, value, max);\n\n return (\n <div className={cn(\"bg-background inline-flex items-center rounded-md border\", className)}>\n {showStepper && (\n <button\n type=\"button\"\n aria-label=\"Decrease quantity\"\n disabled={minDisabled}\n onClick={handleDecrement}\n className={cn(\n \"hover:bg-accent flex h-10 w-10 items-center justify-center disabled:opacity-50\",\n buttonClassName,\n )}\n >\n <LuMinus />\n </button>\n )}\n <input\n ref={ref}\n type=\"text\"\n inputMode={decimals > 0 ? \"decimal\" : \"numeric\"}\n value={qtyStr}\n disabled={disabled}\n onKeyDown={handleKeyDown}\n onChange={handleChange}\n onBlur={handleBlur}\n className={cn(\n \"h-10 w-16 bg-transparent text-center focus:outline-none\",\n inputClassName,\n )}\n />\n {showStepper && (\n <button\n type=\"button\"\n aria-label=\"Increase quantity\"\n disabled={maxDisabled}\n onClick={handleIncrement}\n className={cn(\n \"hover:bg-accent flex h-10 w-10 items-center justify-center disabled:opacity-50\",\n buttonClassName,\n )}\n >\n <LuPlus />\n </button>\n )}\n </div>\n );\n },\n ),\n);\nQuantityInput.displayName = \"QuantityInput\";\n\nexport { QuantityInput };\n"],"mappings":";;;;;;;;;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,UAAU;AACnB,SAAS,SAAS,cAAc;AAsIxB,SAYM,KAZN;AAtGR,SAAS,YAAY,OAAe,MAAsB;AACxD,MAAI,QAAQ,EAAG,QAAO;AACtB,SAAO,KAAK,KAAK,QAAQ,IAAI,IAAI;AACnC;AAMA,SAAS,kBACP,KACA,KACA,KACA,MACA,UACQ;AACR,MAAI,IAAI,KAAK,MAAM,GAAI,QAAO;AAE9B,MAAI,SAAS,WAAW,GAAG;AAC3B,MAAI,MAAM,MAAM,EAAG,UAAS;AAG5B,WA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artjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/radio-group.cjs","../src/radio-group.tsx"],"names":[],"mappings":"AAAA,uWAAY;AACZ,YAAY;AACZ;AACA;ACAA,2EAAuB;AACvB,oCAAwB;AACxB,mIAAqC;AACrC,sDAAmB;AAMV,+CAAA;AAJT,IAAM,WAAA,EAAmB,KAAA,CAAA,UAAA,CAGvB,CAAC,EAAE,SAAA,EAAW,GAAG,MAAM,CAAA,EAAG,GAAA,EAAA,GAAQ;AAClC,EAAA,uBAAO,6BAAA,mBAAqB,CAAA,IAAA,EAApB,EAAyB,SAAA,EAAW,qBAAA,YAAG,EAAc,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,IAAA,CAAU,CAAA;AAChG,CAAC,CAAA;AACD,UAAA,CAAW,YAAA,EAAkC,mBAAA,CAAA,IAAA,CAAK,WAAA;AAElD,IAAM,eAAA,EAAuB,KAAA,CAAA,UAAA,CAG3B,CAAC,EAAE,SAAA,EAAW,GAAG,MAAM,CAAA,EAAG,GAAA,EAAA,GAAQ;AAClC,EAAA,uBACE,6BAAA;AAAA,IAAqB,mBAAA,CAAA,IAAA;AAAA,IAApB;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,qBAAA;AAAA,QACT,8LAAA;AAAA,QACA;AAAA,MACF,CAAA;AAAA,MACC,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAA,6BAAA,mBAAqB,CAAA,SAAA,EAApB,EAA8B,SAAA,EAAU,kCAAA,EACvC,QAAA,kBAAA,6BAAA,WAAC,EAAA,EAAQ,SAAA,EAAU,2BAAA,CAA2B,EAAA,CAChD;AAAA,IAAA;AAAA,EACF,CAAA;AAEJ,CAAC,CAAA;AACD,cAAA,CAAe,YAAA,EAAkC,mBAAA,CAAA,IAAA,CAAK,WAAA;ADPtD;AACE;AACA;AACF,yEAAC","file":"/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/radio-group.cjs","sourcesContent":[null,"/** Styled wrapper around @radix-ui/react-radio-group. See https://www.radix-ui.com/primitives/docs/components/radio-group */\n\"use client\";\n\nimport * as React from \"react\";\nimport { LuCheck } from \"react-icons/lu\";\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport { cn } from \"@simpleapps-com/augur-utils/web\";\n\nconst RadioGroup = React.forwardRef<\n React.ComponentRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => {\n return <RadioGroupPrimitive.Root className={cn(\"grid gap-2\", className)} {...props} ref={ref} />;\n});\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\n\nconst RadioGroupItem = React.forwardRef<\n React.ComponentRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n \"border-primary text-primary focus-visible:ring-ring aspect-square h-4 w-4 rounded-full border shadow focus:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n <LuCheck className=\"fill-primary h-3.5 w-3.5\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n );\n});\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\nexport { RadioGroup, RadioGroupItem };\n"]}
|
package/dist/radio-group.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as RadioGroupPrimitive from
|
|
3
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
4
3
|
declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
4
|
declare const RadioGroupItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
-
|
|
7
5
|
export { RadioGroup, RadioGroupItem };
|
|
6
|
+
//# sourceMappingURL=radio-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../src/radio-group.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAC;AAGnE,QAAA,MAAM,UAAU,+JAKd,CAAC;AAGH,QAAA,MAAM,cAAc,yKAkBlB,CAAC;AAGH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/resource-tabs.cjs
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
var _chunkUFL6PVLIcjs = require('./chunk-UFL6PVLI.cjs');
|
|
9
9
|
|
|
10
10
|
// src/resource-tabs.tsx
|
|
11
|
+
require('react');
|
|
11
12
|
var _web = require('@simpleapps-com/augur-utils/web');
|
|
12
13
|
var _jsxruntime = require('react/jsx-runtime');
|
|
13
14
|
function ResourceTabs({ tabs, defaultTab, className }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/resource-tabs.cjs","../src/resource-tabs.tsx"],"names":[],"mappings":"AAAA,yLAAY;AACZ,YAAY;AACZ;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACNA,iBAAuB;AACvB,sDAAmB;AAmCf,+CAAA;AANJ,SAAS,YAAA,CAAa,EAAE,IAAA,EAAM,UAAA,EAAY,UAAU,CAAA,EAAsB;AACxE,EAAA,GAAA,CAAI,IAAA,CAAK,OAAA,IAAW,CAAA,EAAG,OAAO,IAAA;AAE9B,EAAA,MAAM,gBAAA,mBAAkB,UAAA,UAAc,IAAA,CAAK,CAAC,CAAA,CAAG,OAAA;AAE/C,EAAA,uBACE,8BAAA,sBAAC,EAAA,EAAK,YAAA,EAAc,eAAA,EAAiB,SAAA,EAAW,qBAAA,SAAY,CAAA,EAC1D,QAAA,EAAA;AAAA,oBAAA,6BAAA,0BAAC,EAAA,EACE,QAAA,EAAA,IAAA,CAAK,GAAA,CAAI,CAAC,GAAA,EAAA,mBACT,6BAAA,6BAAC,EAAA,EAA4B,KAAA,EAAO,GAAA,CAAI,KAAA,EAAO,QAAA,EAAU,GAAA,CAAI,QAAA,EAC1D,QAAA,EAAA,GAAA,CAAI,MAAA,CAAA,EADW,GAAA,CAAI,KAEtB,CACD,EAAA,CACH,CAAA;AAAA,IACC,IAAA,CAAK,GAAA,CAAI,CAAC,GAAA,EAAA,mBACT,6BAAA,6BAAC,EAAA,EAA4B,KAAA,EAAO,GAAA,CAAI,KAAA,EACrC,QAAA,EAAA,GAAA,CAAI,QAAA,CAAA,EADW,GAAA,CAAI,KAEtB,CACD;AAAA,EAAA,EAAA,CACH,CAAA;AAEJ;AACA,YAAA,CAAa,YAAA,EAAc,cAAA;ADjC3B;AACE;AACF,oCAAC","file":"/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/resource-tabs.cjs","sourcesContent":[null,"/** Sub-resource tab layout composing Tabs. */\n\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"@simpleapps-com/augur-utils/web\";\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from \"./tabs\";\n\nexport interface TabDef {\n value: string;\n label: string;\n content: React.ReactNode;\n disabled?: boolean;\n}\n\nexport interface ResourceTabsProps {\n tabs: TabDef[];\n defaultTab?: string;\n className?: string;\n}\n\n/**\n * Standardized sub-resource tab layout for detail pages.\n *\n * @example\n * ```tsx\n * <ResourceTabs\n * tabs={[\n * { value: \"attributes\", label: \"Attributes\", content: <AttributesList /> },\n * { value: \"items\", label: \"Items\", content: <ItemsList /> },\n * ]}\n * />\n * ```\n */\nfunction ResourceTabs({ tabs, defaultTab, className }: ResourceTabsProps) {\n if (tabs.length === 0) return null;\n\n const resolvedDefault = defaultTab ?? tabs[0]!.value;\n\n return (\n <Tabs defaultValue={resolvedDefault} className={cn(className)}>\n <TabsList>\n {tabs.map((tab) => (\n <TabsTrigger key={tab.value} value={tab.value} disabled={tab.disabled}>\n {tab.label}\n </TabsTrigger>\n ))}\n </TabsList>\n {tabs.map((tab) => (\n <TabsContent key={tab.value} value={tab.value}>\n {tab.content}\n </TabsContent>\n ))}\n </Tabs>\n );\n}\nResourceTabs.displayName = \"ResourceTabs\";\n\nexport { ResourceTabs };\n"]}
|
package/dist/resource-tabs.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
interface TabDef {
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface TabDef {
|
|
5
3
|
value: string;
|
|
6
4
|
label: string;
|
|
7
5
|
content: React.ReactNode;
|
|
8
6
|
disabled?: boolean;
|
|
9
7
|
}
|
|
10
|
-
interface ResourceTabsProps {
|
|
8
|
+
export interface ResourceTabsProps {
|
|
11
9
|
tabs: TabDef[];
|
|
12
10
|
defaultTab?: string;
|
|
13
11
|
className?: string;
|
|
@@ -25,9 +23,9 @@ interface ResourceTabsProps {
|
|
|
25
23
|
* />
|
|
26
24
|
* ```
|
|
27
25
|
*/
|
|
28
|
-
declare function ResourceTabs({ tabs, defaultTab, className }: ResourceTabsProps):
|
|
26
|
+
declare function ResourceTabs({ tabs, defaultTab, className }: ResourceTabsProps): React.JSX.Element | null;
|
|
29
27
|
declare namespace ResourceTabs {
|
|
30
28
|
var displayName: string;
|
|
31
29
|
}
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
export { ResourceTabs };
|
|
31
|
+
//# sourceMappingURL=resource-tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-tabs.d.ts","sourceRoot":"","sources":["../src/resource-tabs.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,iBAAS,YAAY,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,iBAAiB,4BAqBvE;kBArBQ,YAAY;;;AAwBrB,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
package/dist/resource-tabs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource-tabs.tsx"],"sourcesContent":["/** Sub-resource tab layout composing Tabs. */\n\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"@simpleapps-com/augur-utils/web\";\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from \"./tabs\";\n\nexport interface TabDef {\n value: string;\n label: string;\n content: React.ReactNode;\n disabled?: boolean;\n}\n\nexport interface ResourceTabsProps {\n tabs: TabDef[];\n defaultTab?: string;\n className?: string;\n}\n\n/**\n * Standardized sub-resource tab layout for detail pages.\n *\n * @example\n * ```tsx\n * <ResourceTabs\n * tabs={[\n * { value: \"attributes\", label: \"Attributes\", content: <AttributesList /> },\n * { value: \"items\", label: \"Items\", content: <ItemsList /> },\n * ]}\n * />\n * ```\n */\nfunction ResourceTabs({ tabs, defaultTab, className }: ResourceTabsProps) {\n if (tabs.length === 0) return null;\n\n const resolvedDefault = defaultTab ?? tabs[0]!.value;\n\n return (\n <Tabs defaultValue={resolvedDefault} className={cn(className)}>\n <TabsList>\n {tabs.map((tab) => (\n <TabsTrigger key={tab.value} value={tab.value} disabled={tab.disabled}>\n {tab.label}\n </TabsTrigger>\n ))}\n </TabsList>\n {tabs.map((tab) => (\n <TabsContent key={tab.value} value={tab.value}>\n {tab.content}\n </TabsContent>\n ))}\n </Tabs>\n );\n}\nResourceTabs.displayName = \"ResourceTabs\";\n\nexport { ResourceTabs };\n"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../src/resource-tabs.tsx"],"sourcesContent":["/** Sub-resource tab layout composing Tabs. */\n\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"@simpleapps-com/augur-utils/web\";\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from \"./tabs\";\n\nexport interface TabDef {\n value: string;\n label: string;\n content: React.ReactNode;\n disabled?: boolean;\n}\n\nexport interface ResourceTabsProps {\n tabs: TabDef[];\n defaultTab?: string;\n className?: string;\n}\n\n/**\n * Standardized sub-resource tab layout for detail pages.\n *\n * @example\n * ```tsx\n * <ResourceTabs\n * tabs={[\n * { value: \"attributes\", label: \"Attributes\", content: <AttributesList /> },\n * { value: \"items\", label: \"Items\", content: <ItemsList /> },\n * ]}\n * />\n * ```\n */\nfunction ResourceTabs({ tabs, defaultTab, className }: ResourceTabsProps) {\n if (tabs.length === 0) return null;\n\n const resolvedDefault = defaultTab ?? tabs[0]!.value;\n\n return (\n <Tabs defaultValue={resolvedDefault} className={cn(className)}>\n <TabsList>\n {tabs.map((tab) => (\n <TabsTrigger key={tab.value} value={tab.value} disabled={tab.disabled}>\n {tab.label}\n </TabsTrigger>\n ))}\n </TabsList>\n {tabs.map((tab) => (\n <TabsContent key={tab.value} value={tab.value}>\n {tab.content}\n </TabsContent>\n ))}\n </Tabs>\n );\n}\nResourceTabs.displayName = \"ResourceTabs\";\n\nexport { ResourceTabs };\n"],"mappings":";;;;;;;;;;AAGA,OAAuB;AACvB,SAAS,UAAU;AAmCf,SAGM,KAHN;AANJ,SAAS,aAAa,EAAE,MAAM,YAAY,UAAU,GAAsB;AACxE,MAAI,KAAK,WAAW,EAAG,QAAO;AAE9B,QAAM,kBAAkB,cAAc,KAAK,CAAC,EAAG;AAE/C,SACE,qBAAC,QAAK,cAAc,iBAAiB,WAAW,GAAG,SAAS,GAC1D;AAAA,wBAAC,YACE,eAAK,IAAI,CAAC,QACT,oBAAC,eAA4B,OAAO,IAAI,OAAO,UAAU,IAAI,UAC1D,cAAI,SADW,IAAI,KAEtB,CACD,GACH;AAAA,IACC,KAAK,IAAI,CAAC,QACT,oBAAC,eAA4B,OAAO,IAAI,OACrC,cAAI,WADW,IAAI,KAEtB,CACD;AAAA,KACH;AAEJ;AACA,aAAa,cAAc;","names":[]}
|
package/dist/rules.d.ts
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/** One entry of a pagination bar: a page number or an ellipsis. */
|
|
2
|
+
export type PageEntry = {
|
|
3
|
+
kind: "page";
|
|
4
|
+
n: number;
|
|
5
|
+
} | {
|
|
6
|
+
kind: "ellipsis";
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Pages i + 1 … total, in order.
|
|
10
|
+
*
|
|
11
|
+
* @ensures exactly the model's Range1
|
|
12
|
+
*/
|
|
13
|
+
export declare function pageRangeFrom(total: number, i: number): PageEntry[];
|
|
14
|
+
/**
|
|
15
|
+
* getPageNumbers: none for no pages; all of them up to 5; else the first, the last, and a window
|
|
16
|
+
* around the (clamped) current page with ellipses.
|
|
17
|
+
*
|
|
18
|
+
* @ensures exactly the model's PageNumbers
|
|
19
|
+
*/
|
|
20
|
+
export declare function pageNumbersOf(current: number, total: number): PageEntry[];
|
|
21
|
+
/**
|
|
22
|
+
* The current page clamped to [1, total] (`Math.max(1, Math.min(current, total))`).
|
|
23
|
+
*
|
|
24
|
+
* @ensures result = 1 below 1, total above it, else current
|
|
25
|
+
*/
|
|
26
|
+
export declare function clampPage(current: number, total: number): number;
|
|
27
|
+
/**
|
|
28
|
+
* ListPagination's first page: at or before page 1 (on the unclamped page).
|
|
29
|
+
*
|
|
30
|
+
* @ensures exactly the model's IsFirstPage
|
|
31
|
+
*/
|
|
32
|
+
export declare function isFirstPage(page: number): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* ListPagination's last page: at or past the total (on the unclamped page).
|
|
35
|
+
*
|
|
36
|
+
* @ensures exactly the model's IsLastPage
|
|
37
|
+
*/
|
|
38
|
+
export declare function isLastPage(page: number, totalPages: number): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The Prev link's target: page 1 on the first page, else the one before.
|
|
41
|
+
*
|
|
42
|
+
* @ensures exactly the model's PrevTarget
|
|
43
|
+
*/
|
|
44
|
+
export declare function prevTarget(page: number): number;
|
|
45
|
+
/**
|
|
46
|
+
* The Next link's target: the last page on it, else the one after.
|
|
47
|
+
*
|
|
48
|
+
* @ensures exactly the model's NextTarget
|
|
49
|
+
*/
|
|
50
|
+
export declare function nextTarget(page: number, totalPages: number): number;
|
|
51
|
+
/**
|
|
52
|
+
* commit's clamp: at least min, then at most max when there is one (max wins if max < min).
|
|
53
|
+
*
|
|
54
|
+
* @ensures exactly the model's Clamp
|
|
55
|
+
*/
|
|
56
|
+
export declare function clampQuantity(value: number, min: number, max: number | undefined): number;
|
|
57
|
+
/**
|
|
58
|
+
* The decrease stepper: one step down, not below min (`Math.max(value - step, min)`).
|
|
59
|
+
*
|
|
60
|
+
* @ensures exactly the model's StepDown
|
|
61
|
+
*/
|
|
62
|
+
export declare function stepDown(value: number, step: number, min: number): number;
|
|
63
|
+
/**
|
|
64
|
+
* The increase stepper: one step up, not above max when there is one.
|
|
65
|
+
*
|
|
66
|
+
* @ensures exactly the model's StepUp
|
|
67
|
+
*/
|
|
68
|
+
export declare function stepUp(value: number, step: number, max: number | undefined): number;
|
|
69
|
+
/**
|
|
70
|
+
* The decrease button is off when the input is, or the value is already at the minimum.
|
|
71
|
+
*
|
|
72
|
+
* @ensures exactly the model's MinDisabled
|
|
73
|
+
*/
|
|
74
|
+
export declare function decreaseDisabled(disabled: boolean, value: number, min: number): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* The increase button is off when the input is, or the value is already at the maximum.
|
|
77
|
+
*
|
|
78
|
+
* @ensures exactly the model's MaxDisabled
|
|
79
|
+
*/
|
|
80
|
+
export declare function increaseDisabled(disabled: boolean, value: number, max: number | undefined): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* The quantity input's digit test, JS's `key >= "0" && key <= "9"` (string order): a first code
|
|
83
|
+
* unit 0–8 with anything after it, or exactly "9".
|
|
84
|
+
*
|
|
85
|
+
* @ensures exactly the model's KeyAllowed digit clause
|
|
86
|
+
*/
|
|
87
|
+
export declare function digitKey(key: string): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* The editing and navigation keys the input always lets through.
|
|
90
|
+
*
|
|
91
|
+
* @ensures result ⟺ key ∈ {Backspace, Delete, ArrowLeft, ArrowRight, Tab, Enter}
|
|
92
|
+
*/
|
|
93
|
+
export declare function editingKey(key: string): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* A keypress is allowed: an editing key, one "." when decimals are allowed, or a digit.
|
|
96
|
+
*
|
|
97
|
+
* @ensures exactly the model's KeyAllowed
|
|
98
|
+
*/
|
|
99
|
+
export declare function keyAllowed(key: string, decimals: number, hasDot: boolean): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* handleChange from index `i`: digits only, plus the first "." when decimals are allowed.
|
|
102
|
+
*
|
|
103
|
+
* @ensures exactly the model's CleanQtyFrom
|
|
104
|
+
*/
|
|
105
|
+
export declare function cleanQtyFrom(raw: string, allowDot: boolean, seenDot: boolean, i: number): string;
|
|
106
|
+
/** What a stock label shows. */
|
|
107
|
+
export type StockView = "loading" | "out-of-stock" | "low-stock" | "in-stock";
|
|
108
|
+
/**
|
|
109
|
+
* Loading first; out of stock overrides low stock.
|
|
110
|
+
*
|
|
111
|
+
* @ensures exactly the model's StockViewOf
|
|
112
|
+
*/
|
|
113
|
+
export declare function stockViewOf(loading: boolean, isInStock: boolean, isLowStock: boolean): StockView;
|
|
114
|
+
/**
|
|
115
|
+
* The quantity shows only when given and the item is in stock (low or not).
|
|
116
|
+
*
|
|
117
|
+
* @ensures exactly the model's ShowStockQuantity
|
|
118
|
+
*/
|
|
119
|
+
export declare function showStockQuantity(view: StockView, hasQuantity: boolean): boolean;
|
|
120
|
+
/** What a price shows. */
|
|
121
|
+
export type PriceView = "skeleton" | "zero-label" | "amount";
|
|
122
|
+
/**
|
|
123
|
+
* Loading first; a 0 value with no original price shows the zero label ("Call for Price").
|
|
124
|
+
*
|
|
125
|
+
* @ensures exactly the model's PriceViewOf
|
|
126
|
+
*/
|
|
127
|
+
export declare function priceViewOf(loading: boolean, valueIsZero: boolean, hasOriginal: boolean): PriceView;
|
|
128
|
+
/**
|
|
129
|
+
* A CSV field needs quotes iff it holds a comma, a quote or a line feed (a carriage return alone
|
|
130
|
+
* does not).
|
|
131
|
+
*
|
|
132
|
+
* @ensures exactly the model's NeedsQuotes
|
|
133
|
+
*/
|
|
134
|
+
export declare function needsQuotes(s: string): boolean;
|
|
135
|
+
/**
|
|
136
|
+
* A CSV field: quoted, with quotes doubled, when it needs quotes; else as is.
|
|
137
|
+
*
|
|
138
|
+
* @ensures exactly the model's CsvField
|
|
139
|
+
*/
|
|
140
|
+
export declare function csvField(s: string): string;
|
|
141
|
+
/** A column's sort direction. */
|
|
142
|
+
export type SortDir = "asc" | "desc" | "unsorted";
|
|
143
|
+
/**
|
|
144
|
+
* aria-sort: only on a sortable column, naming its direction. A string, not a literal union:
|
|
145
|
+
* lsc names a `"none"` literal `None`, which clashes with Option's (models/LSC-GAPS.md).
|
|
146
|
+
*
|
|
147
|
+
* @ensures exactly the model's AriaSort
|
|
148
|
+
*/
|
|
149
|
+
export declare function ariaSortOf(sortable: boolean, dir: SortDir): string | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* A column's cell alignment class from its meta's `align` ("left" when it has none); any other
|
|
152
|
+
* value has none.
|
|
153
|
+
*
|
|
154
|
+
* @ensures exactly the model's AlignClass
|
|
155
|
+
*/
|
|
156
|
+
export declare function alignClass(align: string): string;
|
|
157
|
+
/** What the table body shows. */
|
|
158
|
+
export type BodyView = "loading" | "empty" | "rows";
|
|
159
|
+
/**
|
|
160
|
+
* Loading first, then the empty message for no rows.
|
|
161
|
+
*
|
|
162
|
+
* @ensures exactly the model's BodyViewOf
|
|
163
|
+
*/
|
|
164
|
+
export declare function bodyViewOf(loading: boolean, rowCount: number): BodyView;
|
|
165
|
+
/** When GTM loads. */
|
|
166
|
+
export type LoadTiming = "idle" | "next-tick" | "now";
|
|
167
|
+
/**
|
|
168
|
+
* GTM loads at idle for lazyOnload when the browser has requestIdleCallback, on the next tick for
|
|
169
|
+
* afterInteractive, else at once.
|
|
170
|
+
*
|
|
171
|
+
* @ensures exactly the model's GtmTiming
|
|
172
|
+
*/
|
|
173
|
+
export declare function gtmTiming(strategy: string, hasIdleCallback: boolean): LoadTiming;
|
|
174
|
+
/**
|
|
175
|
+
* Session replay is injected unless disabled or already there, and, under a rate below 1, only
|
|
176
|
+
* when the draw is at or under it.
|
|
177
|
+
*
|
|
178
|
+
* @ensures exactly the model's ReplaySampled
|
|
179
|
+
*/
|
|
180
|
+
export declare function replaySampled(disabled: boolean, injected: boolean, rate: number, draw: number): boolean;
|
|
181
|
+
/**
|
|
182
|
+
* A "?" or "&" at `k`, "Bin=" right after it, and a value character (not "&") after that: what
|
|
183
|
+
* `[?&]Bin=[^&]` matches there.
|
|
184
|
+
*
|
|
185
|
+
* @ensures result ⟺ s[k] ∈ {?, &} ∧ s[k+1 ..] starts with "Bin=" ∧ s[k+5] is a char ≠ "&"
|
|
186
|
+
*/
|
|
187
|
+
export declare function binMarkAt(s: string, k: number): boolean;
|
|
188
|
+
/**
|
|
189
|
+
* The first "?Bin=" or "&Bin=" from index `i` with a value after it, or −1 (the regex skips a
|
|
190
|
+
* mark with an empty value and keeps searching).
|
|
191
|
+
*
|
|
192
|
+
* @ensures result is the first k ≥ i with k + 6 ≤ |s| where `binMarkAt(s, k)`, else −1 —
|
|
193
|
+
* exactly the model's BinAt
|
|
194
|
+
*/
|
|
195
|
+
export declare function binAt(s: string, i: number): number;
|
|
196
|
+
/**
|
|
197
|
+
* extractBin from a message string (`/[?&]Bin=([^&]+)/`): the first mark's value up to the next
|
|
198
|
+
* "&" (never empty), or undefined.
|
|
199
|
+
*
|
|
200
|
+
* @ensures exactly the model's BinFromString
|
|
201
|
+
*/
|
|
202
|
+
export declare function binFromString(s: string): string | undefined;
|
|
203
|
+
/**
|
|
204
|
+
* The text after a "?Bin=" mark at `k`, or "" when no mark fits there (`binAt` never gives
|
|
205
|
+
* such a k; the guard keeps the slice in range for the proof).
|
|
206
|
+
*
|
|
207
|
+
* @ensures result = s[k + 5 ..] when 0 ≤ k ∧ k + 5 ≤ |s|, else ""
|
|
208
|
+
*/
|
|
209
|
+
export declare function afterBinMark(s: string, k: number): string;
|
|
210
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../src/rules.ts"],"names":[],"mappings":"AAQA,mEAAmE;AACnE,MAAM,MAAM,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3E;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,CASnE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,CAwCzE;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,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AAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAOvE;AAED,sBAAsB;AACtB,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,WAAW,GAAG,KAAK,CAAC;AAEtD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,GAAG,UAAU,CAOhF;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,OAAO,EACjB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,OAAO,CAMT;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAQvD;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAYlD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAO3D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAMzD"}
|
package/dist/select.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/select.cjs"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,6jBAAC","file":"/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/select.cjs"}
|
package/dist/select.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as SelectPrimitive from
|
|
3
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
4
3
|
declare const Select: React.FC<SelectPrimitive.SelectProps>;
|
|
5
4
|
declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
5
|
declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -11,5 +10,5 @@ declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitiv
|
|
|
11
10
|
declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
11
|
declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
12
|
declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
|
|
14
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../src/select.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAG1D,QAAA,MAAM,MAAM,uCAAuB,CAAC;AACpC,QAAA,MAAM,WAAW,yGAAwB,CAAC;AAC1C,QAAA,MAAM,WAAW,0GAAwB,CAAC;AAE1C,QAAA,MAAM,aAAa,oKAiBjB,CAAC;AAGH,QAAA,MAAM,oBAAoB,qKAWxB,CAAC;AAGH,QAAA,MAAM,sBAAsB,uKAW1B,CAAC;AAGH,QAAA,MAAM,aAAa,8JA6BjB,CAAC;AAGH,QAAA,MAAM,WAAW,4JASf,CAAC;AAGH,QAAA,MAAM,UAAU,2JAmBd,CAAC;AAGH,QAAA,MAAM,eAAe,gKASnB,CAAC;AAGH,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,CAAC"}
|
package/dist/separator.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/separator.cjs","../src/separator.tsx"],"names":[],"mappings":"AAAA,uWAAY;AACZ,YAAY;AACZ;AACA;ACAA,2EAAuB;AACvB,8HAAoC;AACpC,sDAAmB;AAMjB,+CAAA;AAJF,IAAM,UAAA,EAAkB,KAAA,CAAA,UAAA,CAGtB,CAAC,EAAE,SAAA,EAAW,YAAA,EAAc,YAAA,EAAc,WAAA,EAAa,IAAA,EAAM,GAAG,MAAM,CAAA,EAAG,GAAA,EAAA,mBACzE,6BAAA;AAAA,EAAoB,kBAAA,CAAA,IAAA;AAAA,EAAnB;AAAA,IACC,GAAA;AAAA,IACA,UAAA;AAAA,IACA,WAAA;AAAA,IACA,SAAA,EAAW,qBAAA;AAAA,MACT,oBAAA;AAAA,MACA,YAAA,IAAgB,aAAA,EAAe,iBAAA,EAAmB,gBAAA;AAAA,MAClD;AAAA,IACF,CAAA;AAAA,IACC,GAAG;AAAA,EAAA;AACN,CACD,CAAA;AACD,SAAA,CAAU,YAAA,EAAiC,kBAAA,CAAA,IAAA,CAAK,WAAA;ADAhD;AACE;AACF,8BAAC","file":"/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/separator.cjs","sourcesContent":[null,"/** Styled wrapper around @radix-ui/react-separator. See https://www.radix-ui.com/primitives/docs/components/separator */\n\"use client\";\n\nimport * as React from \"react\";\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\";\nimport { cn } from \"@simpleapps-com/augur-utils/web\";\n\nconst Separator = React.forwardRef<\n React.ComponentRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = \"horizontal\", decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"bg-border shrink-0\",\n orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n className,\n )}\n {...props}\n />\n));\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\nexport { Separator };\n"]}
|
package/dist/separator.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as SeparatorPrimitive from
|
|
3
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
4
3
|
declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
-
|
|
6
4
|
export { Separator };
|
|
5
|
+
//# sourceMappingURL=separator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../src/separator.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAGhE,QAAA,MAAM,SAAS,6JAeb,CAAC;AAGH,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
package/dist/session-replay.cjs
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
"use client";
|
|
3
3
|
|
|
4
|
+
|
|
5
|
+
var _chunkEEJYDSXRcjs = require('./chunk-EEJYDSXR.cjs');
|
|
6
|
+
|
|
4
7
|
// src/session-replay.tsx
|
|
5
8
|
var _react = require('react');
|
|
6
9
|
function injectMouseflow(siteId) {
|
|
@@ -41,8 +44,7 @@ function SessionReplayScript({
|
|
|
41
44
|
}) {
|
|
42
45
|
const injectedRef = _react.useRef.call(void 0, false);
|
|
43
46
|
_react.useEffect.call(void 0, () => {
|
|
44
|
-
if (disabled
|
|
45
|
-
if (sampleRate < 1 && Math.random() > sampleRate) return;
|
|
47
|
+
if (!_chunkEEJYDSXRcjs.replaySampled.call(void 0, disabled, injectedRef.current, sampleRate, Math.random())) return;
|
|
46
48
|
injectedRef.current = true;
|
|
47
49
|
const inject = injectors[provider];
|
|
48
50
|
if (typeof requestIdleCallback === "function") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/session-replay.cjs","../src/session-replay.tsx"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACA;ACJA,8BAAkC;AAsClC,SAAS,eAAA,CAAgB,MAAA,EAAsB;AAC7C,EAAA,GAAA,CAAI,OAAO,SAAA,IAAa,WAAA,EAAa,MAAA;AACrC,EAAA,GAAA,CAAI,QAAA,CAAS,cAAA,CAAe,kBAAkB,CAAA,EAAG,MAAA;AAEjD,EAAA,MAAA,CAAO,KAAA,EAAO,MAAA,CAAO,KAAA,GAAQ,CAAC,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AAA,CAAS,IAAA,CAAK,WAAA,CAAY,MAAM,CAAA;AAClC;AAEA,IAAM,UAAA,EAAqE;AAAA,EACzE,SAAA,EAAW,eAAA;AAAA,EACX,MAAA,EAAQ;AACV,CAAA;AAyBO,SAAS,mBAAA,CAAoB;AAAA,EAClC,QAAA;AAAA,EACA,MAAA;AAAA,EACA,WAAA,EAAa,CAAA;AAAA,EACb,SAAA,EAAW;AACb,CAAA,EAA6B;AAC3B,EAAA,MAAM,YAAA,EAAc,2BAAA,KAAY,CAAA;AAEhC,EAAA,8BAAA,CAAU,EAAA,GAAM;AACd,IAAA,GAAA,CAAI,CAAC,6CAAA,QAAc,EAAU,WAAA,CAAY,OAAA,EAAS,UAAA,EAAY,IAAA,CAAK,MAAA,CAAO,CAAC,CAAA,EAAG,MAAA;AAE9E,IAAA,WAAA,CAAY,QAAA,EAAU,IAAA;AAEtB,IAAA,MAAM,OAAA,EAAS,SAAA,CAAU,QAAQ,CAAA;AAGjC,IAAA,GAAA,CAAI,OAAO,oBAAA,IAAwB,UAAA,EAAY;AAC7C,MAAA,mBAAA,CAAoB,CAAA,EAAA,GAAM,MAAA,CAAO,MAAM,CAAC,CAAA;AAAA,IAC1C,EAAA,KAAO;AACL,MAAA,UAAA,CAAW,CAAA,EAAA,GAAM,MAAA,CAAO,MAAM,CAAA,EAAG,CAAC,CAAA;AAAA,IACpC;AAAA,EACF,CAAA,EAAG,CAAC,QAAA,EAAU,MAAA,EAAQ,UAAA,EAAY,QAAQ,CAAC,CAAA;AAE3C,EAAA,OAAO,IAAA;AACT;ADtEA;AACE;AACF,kDAAC","file":"/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/session-replay.cjs","sourcesContent":[null,"\"use client\";\n\nimport { useEffect, useRef } from \"react\";\nimport { replaySampled } from \"./rules\";\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/** Supported session replay providers. */\nexport type SessionReplayProvider = \"mouseflow\" | \"hotjar\";\n\nexport interface SessionReplayScriptProps {\n /** Session replay provider. */\n provider: SessionReplayProvider;\n /** Project/site ID from the provider. */\n siteId: string;\n /** Sampling rate (0-1). 1 = all sessions, 0.5 = 50%. Default: 1. */\n sampleRate?: number;\n /** Disable in development. Default: false. */\n disabled?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Globals\n// ---------------------------------------------------------------------------\n\ndeclare global {\n interface Window {\n _mfq?: unknown[];\n hj?: (...args: unknown[]) => void;\n _hjSettings?: { hjid: string; hjsv: number };\n }\n}\n\n// ---------------------------------------------------------------------------\n// Script injectors\n// ---------------------------------------------------------------------------\n\n// The injectors run from an idle callback or timer, by which time the page may have gone.\nfunction injectMouseflow(siteId: string): void {\n if (typeof document === \"undefined\") return;\n if (document.getElementById(\"mouseflow-script\")) return;\n\n window._mfq = window._mfq || [];\n\n const script = document.createElement(\"script\");\n script.id = \"mouseflow-script\";\n script.src = `https://cdn.mouseflow.com/projects/${encodeURIComponent(siteId)}.js`;\n script.async = true;\n script.defer = true;\n document.head.appendChild(script);\n}\n\nfunction injectHotjar(siteId: string): void {\n if (typeof document === \"undefined\") return;\n if (document.getElementById(\"hotjar-script\")) return;\n\n window._hjSettings = { hjid: siteId, hjsv: 6 };\n window.hj =\n window.hj ||\n function hjQueue(...args: unknown[]) {\n (window.hj as unknown as { q: unknown[] }).q =\n (window.hj as unknown as { q: unknown[] }).q || [];\n (window.hj as unknown as { q: unknown[] }).q.push(args);\n };\n\n const script = document.createElement(\"script\");\n script.id = \"hotjar-script\";\n script.src = `https://static.hotjar.com/c/hotjar-${encodeURIComponent(siteId)}.js?sv=6`;\n script.async = true;\n script.defer = true;\n document.head.appendChild(script);\n}\n\nconst injectors: Record<SessionReplayProvider, (siteId: string) => void> = {\n mouseflow: injectMouseflow,\n hotjar: injectHotjar,\n};\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\n/**\n * Loads a session replay script with `lazyOnload` behavior.\n * Renders nothing — this is a side-effect-only leaf component.\n *\n * Session replay tools require main thread DOM access (MutationObserver)\n * and cannot run in web workers.\n *\n * @example\n * ```tsx\n * // In layout.tsx\n * <SessionReplayScript provider=\"mouseflow\" siteId=\"88d79cd5-...\" />\n *\n * // With 50% sampling\n * <SessionReplayScript provider=\"mouseflow\" siteId=\"...\" sampleRate={0.5} />\n *\n * // Disabled in dev\n * <SessionReplayScript provider=\"hotjar\" siteId=\"...\" disabled={isDev} />\n * ```\n */\nexport function SessionReplayScript({\n provider,\n siteId,\n sampleRate = 1,\n disabled = false,\n}: SessionReplayScriptProps) {\n const injectedRef = useRef(false);\n\n useEffect(() => {\n if (!replaySampled(disabled, injectedRef.current, sampleRate, Math.random())) return;\n\n injectedRef.current = true;\n\n const inject = injectors[provider];\n\n // Load during idle time (lazyOnload behavior)\n if (typeof requestIdleCallback === \"function\") {\n requestIdleCallback(() => inject(siteId));\n } else {\n setTimeout(() => inject(siteId), 0);\n }\n }, [provider, siteId, sampleRate, disabled]);\n\n return null;\n}\n"]}
|
package/dist/session-replay.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Supported session replay providers. */
|
|
2
|
-
type SessionReplayProvider = "mouseflow" | "hotjar";
|
|
3
|
-
interface SessionReplayScriptProps {
|
|
2
|
+
export type SessionReplayProvider = "mouseflow" | "hotjar";
|
|
3
|
+
export interface SessionReplayScriptProps {
|
|
4
4
|
/** Session replay provider. */
|
|
5
5
|
provider: SessionReplayProvider;
|
|
6
6
|
/** Project/site ID from the provider. */
|
|
@@ -39,6 +39,5 @@ declare global {
|
|
|
39
39
|
* <SessionReplayScript provider="hotjar" siteId="..." disabled={isDev} />
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
|
-
declare function SessionReplayScript({ provider, siteId, sampleRate, disabled, }: SessionReplayScriptProps): null;
|
|
43
|
-
|
|
44
|
-
export { type SessionReplayProvider, SessionReplayScript, type SessionReplayScriptProps };
|
|
42
|
+
export declare function SessionReplayScript({ provider, siteId, sampleRate, disabled, }: SessionReplayScriptProps): null;
|
|
43
|
+
//# sourceMappingURL=session-replay.d.ts.map
|