@simpleapps-com/augur-web 2.4.0 → 2026.11.2
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-DCXYO3RB.js → chunk-C6K7FZNX.js} +7 -3
- package/dist/chunk-C6K7FZNX.js.map +1 -0
- package/dist/{chunk-AE4GLYJE.cjs → chunk-DMWSWL4B.cjs} +7 -3
- package/dist/chunk-DMWSWL4B.cjs.map +1 -0
- package/dist/chunk-GSR6SMQ2.cjs.map +1 -1
- package/dist/chunk-IO77MGHW.js +220 -0
- package/dist/chunk-IO77MGHW.js.map +1 -0
- package/dist/chunk-JXW4XE2P.cjs.map +1 -1
- package/dist/{chunk-OJ5G4BLS.js → chunk-KVHOMD4T.js} +15 -18
- package/dist/chunk-KVHOMD4T.js.map +1 -0
- package/dist/chunk-MAENILZP.cjs.map +1 -1
- package/dist/chunk-NEY26NNF.cjs.map +1 -1
- package/dist/chunk-QKWXJM4Q.cjs +220 -0
- package/dist/chunk-QKWXJM4Q.cjs.map +1 -0
- package/dist/chunk-T52J3SHP.cjs.map +1 -1
- package/dist/{chunk-I5NVZORX.cjs → chunk-TFP5RICB.cjs} +15 -18
- package/dist/chunk-TFP5RICB.cjs.map +1 -0
- package/dist/chunk-UFL6PVLI.cjs.map +1 -1
- 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-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/stock-label.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client";
|
|
3
|
+
import {
|
|
4
|
+
showStockQuantity,
|
|
5
|
+
stockViewOf
|
|
6
|
+
} from "./chunk-IO77MGHW.js";
|
|
3
7
|
|
|
4
8
|
// src/stock-label.tsx
|
|
5
9
|
import { cn } from "@simpleapps-com/augur-utils/web";
|
|
@@ -54,26 +58,24 @@ function createStockLabel(config = {}) {
|
|
|
54
58
|
classNames: instanceClassNames
|
|
55
59
|
} = props;
|
|
56
60
|
const slots = mergeClassNames(instanceClassNames);
|
|
57
|
-
|
|
61
|
+
const view = stockViewOf(false, isInStock, isLowStock);
|
|
62
|
+
if (view === "out-of-stock") {
|
|
58
63
|
return /* @__PURE__ */ jsx("span", { className: cn("text-red-600", slots.outOfStock, className), children: outOfStockLabel });
|
|
59
64
|
}
|
|
60
|
-
|
|
65
|
+
const quantity = showStockQuantity(view, displayQuantity != null) && /* @__PURE__ */ jsxs("span", { className: cn("ml-1", slots.quantity), children: [
|
|
66
|
+
"(",
|
|
67
|
+
displayQuantity,
|
|
68
|
+
")"
|
|
69
|
+
] });
|
|
70
|
+
if (view === "low-stock") {
|
|
61
71
|
return /* @__PURE__ */ jsxs("span", { className: cn("text-orange-500", slots.lowStock, className), children: [
|
|
62
72
|
lowStockLabel,
|
|
63
|
-
|
|
64
|
-
"(",
|
|
65
|
-
displayQuantity,
|
|
66
|
-
")"
|
|
67
|
-
] })
|
|
73
|
+
quantity
|
|
68
74
|
] });
|
|
69
75
|
}
|
|
70
76
|
return /* @__PURE__ */ jsxs("span", { className: cn("text-green-600", slots.inStock, className), children: [
|
|
71
77
|
inStockLabel,
|
|
72
|
-
|
|
73
|
-
"(",
|
|
74
|
-
displayQuantity,
|
|
75
|
-
")"
|
|
76
|
-
] })
|
|
78
|
+
quantity
|
|
77
79
|
] });
|
|
78
80
|
}
|
|
79
81
|
StockLabel.displayName = "StockLabel";
|
package/dist/stock-label.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/stock-label.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"@simpleapps-com/augur-utils/web\";\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface StockLabelClassNames {\n /** In-stock text. */\n inStock?: string;\n /** Low-stock text. */\n lowStock?: string;\n /** Out-of-stock text. */\n outOfStock?: string;\n /** The loading skeleton. */\n skeleton?: string;\n /** The quantity parenthetical. */\n quantity?: string;\n}\n\nexport interface StockLabelConfig {\n /** Label for in-stock state. Default: `\"In stock\"`. */\n inStockLabel?: string;\n /** Label for low-stock state. Default: `\"Low stock\"`. */\n lowStockLabel?: string;\n /** Label for out-of-stock state. Default: `\"Out of stock\"`. */\n outOfStockLabel?: string;\n /** Default class names for sub-elements. */\n classNames?: StockLabelClassNames;\n}\n\ntype StockLabelPropsBase = {\n /** Whether the item is in stock. */\n isInStock: boolean;\n /** Whether the item has low stock. */\n isLowStock?: boolean;\n /** Quantity to display in parentheses (shown only when in stock or low stock). */\n displayQuantity?: number | null;\n /** Additional class names for the root element. */\n className?: string;\n /** Class names for sub-elements, merged with factory defaults. */\n classNames?: StockLabelClassNames;\n};\n\nexport type StockLabelProps =\n | (StockLabelPropsBase & { loading?: false })\n | { loading: true; className?: string; classNames?: StockLabelClassNames };\n\nexport interface CreateStockLabelResult {\n StockLabel: React.FC<StockLabelProps>;\n}\n\n// ---------------------------------------------------------------------------\n// Factory\n// ---------------------------------------------------------------------------\n\nconst defaults = {\n inStockLabel: \"In stock\",\n lowStockLabel: \"Low stock\",\n outOfStockLabel: \"Out of stock\",\n} as const;\n\nexport function createStockLabel(config: StockLabelConfig = {}): CreateStockLabelResult {\n const {\n inStockLabel,\n lowStockLabel,\n outOfStockLabel,\n classNames: factoryClassNames,\n } = { ...defaults, ...config };\n\n const slotKeys: (keyof StockLabelClassNames)[] = [\n \"inStock\",\n \"lowStock\",\n \"outOfStock\",\n \"skeleton\",\n \"quantity\",\n ];\n\n function mergeClassNames(instance?: StockLabelClassNames): StockLabelClassNames {\n if (!factoryClassNames && !instance) return {};\n const result: StockLabelClassNames = {};\n for (const key of slotKeys) {\n const merged = cn(factoryClassNames?.[key], instance?.[key]);\n if (merged) result[key] = merged;\n }\n return result;\n }\n\n function StockLabel(props: StockLabelProps) {\n if (\"loading\" in props && props.loading) {\n const slots = mergeClassNames(props.classNames);\n return (\n <span\n className={cn(\n \"bg-muted inline-block h-4 w-16 animate-pulse rounded\",\n slots.skeleton,\n props.className,\n )}\n />\n );\n }\n\n const {\n isInStock,\n isLowStock = false,\n displayQuantity,\n className,\n classNames: instanceClassNames,\n } = props as StockLabelPropsBase;\n\n const slots = mergeClassNames(instanceClassNames);\n\n
|
|
1
|
+
{"version":3,"sources":["../src/stock-label.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"@simpleapps-com/augur-utils/web\";\nimport { showStockQuantity, stockViewOf } from \"./rules\";\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface StockLabelClassNames {\n /** In-stock text. */\n inStock?: string;\n /** Low-stock text. */\n lowStock?: string;\n /** Out-of-stock text. */\n outOfStock?: string;\n /** The loading skeleton. */\n skeleton?: string;\n /** The quantity parenthetical. */\n quantity?: string;\n}\n\nexport interface StockLabelConfig {\n /** Label for in-stock state. Default: `\"In stock\"`. */\n inStockLabel?: string;\n /** Label for low-stock state. Default: `\"Low stock\"`. */\n lowStockLabel?: string;\n /** Label for out-of-stock state. Default: `\"Out of stock\"`. */\n outOfStockLabel?: string;\n /** Default class names for sub-elements. */\n classNames?: StockLabelClassNames;\n}\n\ntype StockLabelPropsBase = {\n /** Whether the item is in stock. */\n isInStock: boolean;\n /** Whether the item has low stock. */\n isLowStock?: boolean;\n /** Quantity to display in parentheses (shown only when in stock or low stock). */\n displayQuantity?: number | null;\n /** Additional class names for the root element. */\n className?: string;\n /** Class names for sub-elements, merged with factory defaults. */\n classNames?: StockLabelClassNames;\n};\n\nexport type StockLabelProps =\n | (StockLabelPropsBase & { loading?: false })\n | { loading: true; className?: string; classNames?: StockLabelClassNames };\n\nexport interface CreateStockLabelResult {\n StockLabel: React.FC<StockLabelProps>;\n}\n\n// ---------------------------------------------------------------------------\n// Factory\n// ---------------------------------------------------------------------------\n\nconst defaults = {\n inStockLabel: \"In stock\",\n lowStockLabel: \"Low stock\",\n outOfStockLabel: \"Out of stock\",\n} as const;\n\nexport function createStockLabel(config: StockLabelConfig = {}): CreateStockLabelResult {\n const {\n inStockLabel,\n lowStockLabel,\n outOfStockLabel,\n classNames: factoryClassNames,\n } = { ...defaults, ...config };\n\n const slotKeys: (keyof StockLabelClassNames)[] = [\n \"inStock\",\n \"lowStock\",\n \"outOfStock\",\n \"skeleton\",\n \"quantity\",\n ];\n\n function mergeClassNames(instance?: StockLabelClassNames): StockLabelClassNames {\n if (!factoryClassNames && !instance) return {};\n const result: StockLabelClassNames = {};\n for (const key of slotKeys) {\n const merged = cn(factoryClassNames?.[key], instance?.[key]);\n if (merged) result[key] = merged;\n }\n return result;\n }\n\n function StockLabel(props: StockLabelProps) {\n if (\"loading\" in props && props.loading) {\n const slots = mergeClassNames(props.classNames);\n return (\n <span\n className={cn(\n \"bg-muted inline-block h-4 w-16 animate-pulse rounded\",\n slots.skeleton,\n props.className,\n )}\n />\n );\n }\n\n const {\n isInStock,\n isLowStock = false,\n displayQuantity,\n className,\n classNames: instanceClassNames,\n } = props as StockLabelPropsBase;\n\n const slots = mergeClassNames(instanceClassNames);\n // The loading skeleton is rendered above, so the view here is never \"loading\".\n const view = stockViewOf(false, isInStock, isLowStock);\n\n if (view === \"out-of-stock\") {\n return (\n <span className={cn(\"text-red-600\", slots.outOfStock, className)}>{outOfStockLabel}</span>\n );\n }\n\n const quantity = showStockQuantity(view, displayQuantity != null) && (\n <span className={cn(\"ml-1\", slots.quantity)}>({displayQuantity})</span>\n );\n\n if (view === \"low-stock\") {\n return (\n <span className={cn(\"text-orange-500\", slots.lowStock, className)}>\n {lowStockLabel}\n {quantity}\n </span>\n );\n }\n\n return (\n <span className={cn(\"text-green-600\", slots.inStock, className)}>\n {inStockLabel}\n {quantity}\n </span>\n );\n }\n\n StockLabel.displayName = \"StockLabel\";\n\n return { StockLabel };\n}\n"],"mappings":";;;;;;;;AAEA,SAAS,UAAU;AA4FX,cA6BF,YA7BE;AApCR,IAAM,WAAW;AAAA,EACf,cAAc;AAAA,EACd,eAAe;AAAA,EACf,iBAAiB;AACnB;AAEO,SAAS,iBAAiB,SAA2B,CAAC,GAA2B;AACtF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,EACd,IAAI,EAAE,GAAG,UAAU,GAAG,OAAO;AAE7B,QAAM,WAA2C;AAAA,IAC/C;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,WAAS,gBAAgB,UAAuD;AAC9E,QAAI,CAAC,qBAAqB,CAAC,SAAU,QAAO,CAAC;AAC7C,UAAM,SAA+B,CAAC;AACtC,eAAW,OAAO,UAAU;AAC1B,YAAM,SAAS,GAAG,oBAAoB,GAAG,GAAG,WAAW,GAAG,CAAC;AAC3D,UAAI,OAAQ,QAAO,GAAG,IAAI;AAAA,IAC5B;AACA,WAAO;AAAA,EACT;AAEA,WAAS,WAAW,OAAwB;AAC1C,QAAI,aAAa,SAAS,MAAM,SAAS;AACvC,YAAMA,SAAQ,gBAAgB,MAAM,UAAU;AAC9C,aACE;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACAA,OAAM;AAAA,YACN,MAAM;AAAA,UACR;AAAA;AAAA,MACF;AAAA,IAEJ;AAEA,UAAM;AAAA,MACJ;AAAA,MACA,aAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA,YAAY;AAAA,IACd,IAAI;AAEJ,UAAM,QAAQ,gBAAgB,kBAAkB;AAEhD,UAAM,OAAO,YAAY,OAAO,WAAW,UAAU;AAErD,QAAI,SAAS,gBAAgB;AAC3B,aACE,oBAAC,UAAK,WAAW,GAAG,gBAAgB,MAAM,YAAY,SAAS,GAAI,2BAAgB;AAAA,IAEvF;AAEA,UAAM,WAAW,kBAAkB,MAAM,mBAAmB,IAAI,KAC9D,qBAAC,UAAK,WAAW,GAAG,QAAQ,MAAM,QAAQ,GAAG;AAAA;AAAA,MAAE;AAAA,MAAgB;AAAA,OAAC;AAGlE,QAAI,SAAS,aAAa;AACxB,aACE,qBAAC,UAAK,WAAW,GAAG,mBAAmB,MAAM,UAAU,SAAS,GAC7D;AAAA;AAAA,QACA;AAAA,SACH;AAAA,IAEJ;AAEA,WACE,qBAAC,UAAK,WAAW,GAAG,kBAAkB,MAAM,SAAS,SAAS,GAC3D;AAAA;AAAA,MACA;AAAA,OACH;AAAA,EAEJ;AAEA,aAAW,cAAc;AAEzB,SAAO,EAAE,WAAW;AACtB;","names":["slots"]}
|
package/dist/table.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/table.cjs"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,2YAAC","file":"/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/table.cjs"}
|
package/dist/table.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
|
|
1
|
+
import * as React from "react";
|
|
3
2
|
declare const Table: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
|
|
4
3
|
declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
5
4
|
declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
@@ -8,5 +7,5 @@ declare const TableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTM
|
|
|
8
7
|
declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
9
8
|
declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
10
9
|
declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
|
|
11
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../src/table.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,QAAA,MAAM,KAAK,iHAMV,CAAC;AAGF,QAAA,MAAM,WAAW,+HAKf,CAAC;AAGH,QAAA,MAAM,SAAS,+HAKb,CAAC;AAGH,QAAA,MAAM,WAAW,+HASf,CAAC;AAGH,QAAA,MAAM,QAAQ,uHAWb,CAAC;AAGF,QAAA,MAAM,SAAS,2HAYb,CAAC;AAGH,QAAA,MAAM,SAAS,2HAYb,CAAC;AAGH,QAAA,MAAM,YAAY,+HAKhB,CAAC;AAGH,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC"}
|
package/dist/tabs.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/tabs.cjs"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY;AACZ;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACF,+LAAC","file":"/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/tabs.cjs"}
|
package/dist/tabs.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as TabsPrimitive from
|
|
3
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
4
3
|
declare const Tabs: React.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
4
|
declare const TabsList: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
5
|
declare const TabsTrigger: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
7
6
|
declare const TabsContent: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
8
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../src/tabs.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,aAAa,MAAM,sBAAsB,CAAC;AAGtD,QAAA,MAAM,IAAI,gGAAqB,CAAC;AAEhC,QAAA,MAAM,QAAQ,uJAYZ,CAAC;AAGH,QAAA,MAAM,WAAW,gKAYf,CAAC;AAGH,QAAA,MAAM,WAAW,0JAYf,CAAC;AAGH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/textarea.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/textarea.cjs"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,8CAAC","file":"/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/textarea.cjs"}
|
package/dist/textarea.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
|
|
3
|
-
type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
4
3
|
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export { Textarea };
|
|
5
|
+
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../src/textarea.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,CAAC;AAE9E,QAAA,MAAM,QAAQ,2FAab,CAAC;AAGF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/llms.txt
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
# Augur Platform Packages
|
|
2
2
|
|
|
3
3
|
This package is part of the @simpleapps-com/augur-* platform.
|
|
4
|
-
|
|
5
|
-
The
|
|
6
|
-
Pure transform utilities bridge user-facing types to SDK params without breaking proxy type safety.
|
|
4
|
+
Each package releases on its own CalVer version; nothing requires them to share one.
|
|
5
|
+
The docs are at https://augur.build/docs/packages (the API reference lists every export).
|
|
7
6
|
|
|
8
7
|
## Sibling packages
|
|
9
8
|
|
|
10
|
-
- @simpleapps-com/augur-config - Shared tooling configuration presets for Augur ecommerce sites
|
|
11
9
|
- @simpleapps-com/augur-core - Universal foundation for Augur packages — proxy infrastructure, cache keys, method classification, shared types
|
|
10
|
+
- @simpleapps-com/augur-utils - Shared types, cache configuration, and utility functions for Augur ecommerce sites
|
|
12
11
|
- @simpleapps-com/augur-hooks - Cross-platform React Query hooks and Zustand stores for Augur ecommerce sites
|
|
13
|
-
- @simpleapps-com/augur-mobile - React Native/Expo adapters for Augur ecommerce apps (offline sync, biometrics, push)
|
|
14
12
|
- @simpleapps-com/augur-server - Server-side utilities for Augur ecommerce sites (Redis caching, SDK helpers, auth)
|
|
15
|
-
- @simpleapps-com/augur-tailwind - Shared Tailwind CSS v4 theme with HSL variables for Augur ecommerce sites
|
|
16
|
-
- @simpleapps-com/augur-utils - Shared types, cache configuration, and utility functions for Augur ecommerce sites
|
|
17
13
|
- @simpleapps-com/augur-web (this package) - Shared React UI components for Augur ecommerce sites (Radix + Tailwind)
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
- @simpleapps-com/augur-mobile - React Native/Expo adapters for Augur ecommerce apps (offline sync, biometrics, push)
|
|
15
|
+
- @simpleapps-com/augur-tailwind - Shared Tailwind CSS v4 theme with HSL variables for Augur ecommerce sites
|
|
16
|
+
- @simpleapps-com/augur-config - Shared tooling configuration presets for Augur ecommerce sites
|
|
20
17
|
|
|
21
18
|
---
|
|
22
19
|
|
|
@@ -24,8 +21,6 @@ Each package ships its own llms.txt with exports and usage patterns.
|
|
|
24
21
|
|
|
25
22
|
> Shared React UI components for Augur ecommerce sites (Radix + Tailwind)
|
|
26
23
|
|
|
27
|
-
Version: 2.2.29
|
|
28
|
-
|
|
29
24
|
## @simpleapps-com/augur-web/accordion
|
|
30
25
|
|
|
31
26
|
- component: Accordion
|
|
@@ -66,11 +61,10 @@ import Link from "next/link";
|
|
|
66
61
|
/>
|
|
67
62
|
```
|
|
68
63
|
|
|
69
|
-
|
|
70
64
|
## @simpleapps-com/augur-web/button
|
|
71
65
|
|
|
72
66
|
- component: Button - Styled button with variant/size props. Supports polymorphism via `asChild`.
|
|
73
|
-
- const: buttonVariants - CVA variants for the Button. Variants: default, destructive, outline,
|
|
67
|
+
- const: buttonVariants - CVA variants for the Button. Variants: default, destructive, outline, secondary, ghost, link. Sizes: default, sm, lg, icon.
|
|
74
68
|
- type: ButtonProps
|
|
75
69
|
|
|
76
70
|
### Examples
|
|
@@ -81,7 +75,6 @@ Button:
|
|
|
81
75
|
<Button asChild><Link href="/shop">Browse</Link></Button>
|
|
82
76
|
```
|
|
83
77
|
|
|
84
|
-
|
|
85
78
|
## @simpleapps-com/augur-web/card
|
|
86
79
|
|
|
87
80
|
- component: Card
|
|
@@ -110,6 +103,7 @@ Button:
|
|
|
110
103
|
|
|
111
104
|
## @simpleapps-com/augur-web/pagination
|
|
112
105
|
|
|
106
|
+
- function: getPageNumbers - Build an array of page numbers and ellipsis markers for pagination UI.
|
|
113
107
|
- const: ListPagination
|
|
114
108
|
- const: Pagination
|
|
115
109
|
- component: PaginationContent
|
|
@@ -118,16 +112,15 @@ Button:
|
|
|
118
112
|
- const: PaginationLink
|
|
119
113
|
- const: PaginationNext
|
|
120
114
|
- const: PaginationPrevious
|
|
121
|
-
- function: getPageNumbers - Build an array of page numbers and ellipsis markers for pagination UI.
|
|
122
115
|
|
|
123
116
|
## @simpleapps-com/augur-web/price
|
|
124
117
|
|
|
125
|
-
-
|
|
126
|
-
- value: PriceFormatConfig
|
|
127
|
-
- function: createPrice - Factory that creates a `Price` component and a `formatPrice` function
|
|
118
|
+
- function: createPrice - Factory that creates a `Price` component and a `formatPrice` function pre-configured with site-level currency/locale/precision.
|
|
128
119
|
- type: CreatePriceResult
|
|
120
|
+
- type: FormatPriceOptions
|
|
129
121
|
- type: PriceClassNames
|
|
130
122
|
- type: PriceConfig
|
|
123
|
+
- type: PriceFormatConfig
|
|
131
124
|
- type: PriceProps
|
|
132
125
|
|
|
133
126
|
### Examples
|
|
@@ -145,10 +138,9 @@ export const { Price, formatPrice } = createPrice({
|
|
|
145
138
|
<Price value={item.price1} uom={item.default_selling_unit} />
|
|
146
139
|
```
|
|
147
140
|
|
|
148
|
-
|
|
149
141
|
## @simpleapps-com/augur-web/price-format
|
|
150
142
|
|
|
151
|
-
- function: createFormatPrice - Create a pure price-formatting function. Server-safe (no React dependency).
|
|
143
|
+
- function: createFormatPrice - Create a pure price-formatting function. Server-safe (no React dependency). Use {@link createPrice} in client components for the full Price component.
|
|
152
144
|
- type: FormatPriceOptions
|
|
153
145
|
- type: PriceFormatConfig
|
|
154
146
|
|
|
@@ -175,7 +167,6 @@ ResourceTabs:
|
|
|
175
167
|
/>
|
|
176
168
|
```
|
|
177
169
|
|
|
178
|
-
|
|
179
170
|
## @simpleapps-com/augur-web/select
|
|
180
171
|
|
|
181
172
|
- component: Select
|
|
@@ -248,20 +239,19 @@ ConfirmDialog:
|
|
|
248
239
|
/>
|
|
249
240
|
```
|
|
250
241
|
|
|
251
|
-
|
|
252
242
|
## @simpleapps-com/augur-web/data-table
|
|
253
243
|
|
|
254
244
|
- function: DataTable
|
|
255
|
-
- value: RowSelectionState
|
|
256
|
-
- value: SortingState
|
|
257
|
-
- value: VisibilityState
|
|
258
245
|
- type: ColumnDef
|
|
259
246
|
- type: DataTablePagination
|
|
260
247
|
- type: DataTableProps
|
|
248
|
+
- type: RowSelectionState
|
|
249
|
+
- type: SortingState
|
|
250
|
+
- type: VisibilityState
|
|
261
251
|
|
|
262
252
|
## @simpleapps-com/augur-web/detail-panel
|
|
263
253
|
|
|
264
|
-
- function: DetailPanel - Read/edit toggle panel for a single record. Renders field values in read
|
|
254
|
+
- function: DetailPanel - Read/edit toggle panel for a single record. Renders field values in read mode, and form inputs in edit mode based on field definitions.
|
|
265
255
|
- type: DetailPanelProps
|
|
266
256
|
- type: FieldDef
|
|
267
257
|
|
|
@@ -278,7 +268,6 @@ const fields: FieldDef<Brand>[] = [
|
|
|
278
268
|
<DetailPanel fields={fields} data={brand} onSave={handleSave} />
|
|
279
269
|
```
|
|
280
270
|
|
|
281
|
-
|
|
282
271
|
## @simpleapps-com/augur-web/dialog
|
|
283
272
|
|
|
284
273
|
- component: Dialog
|
|
@@ -319,8 +308,8 @@ const fields: FieldDef<Brand>[] = [
|
|
|
319
308
|
- component: NavigationMenuLink
|
|
320
309
|
- component: NavigationMenuList
|
|
321
310
|
- component: NavigationMenuTrigger
|
|
322
|
-
- component: NavigationMenuViewport
|
|
323
311
|
- const: navigationMenuTriggerStyle
|
|
312
|
+
- component: NavigationMenuViewport
|
|
324
313
|
|
|
325
314
|
## @simpleapps-com/augur-web/popover
|
|
326
315
|
|
|
@@ -354,7 +343,6 @@ FormInput:
|
|
|
354
343
|
<FormInput label="Email" name="email" type="email" required error={errors.email} />
|
|
355
344
|
```
|
|
356
345
|
|
|
357
|
-
|
|
358
346
|
## @simpleapps-com/augur-web/form-select
|
|
359
347
|
|
|
360
348
|
- component: FormSelect - Labeled select dropdown with error display. Composes FormField + Select.
|
|
@@ -373,7 +361,6 @@ FormSelect:
|
|
|
373
361
|
/>
|
|
374
362
|
```
|
|
375
363
|
|
|
376
|
-
|
|
377
364
|
## @simpleapps-com/augur-web/form-textarea
|
|
378
365
|
|
|
379
366
|
- component: FormTextarea - Labeled textarea with error display. Composes FormField + Textarea.
|
|
@@ -381,7 +368,7 @@ FormSelect:
|
|
|
381
368
|
|
|
382
369
|
## @simpleapps-com/augur-web/financing-widget
|
|
383
370
|
|
|
384
|
-
- function: FinancingWidget - Loads a financing widget script on the pages where it's needed.
|
|
371
|
+
- function: FinancingWidget - Loads a financing widget script on the pages where it's needed. Renders nothing — this is a side-effect-only leaf component.
|
|
385
372
|
- type: FinancingProvider
|
|
386
373
|
- type: FinancingWidgetProps
|
|
387
374
|
- type: UseFinancingResult
|
|
@@ -401,7 +388,6 @@ FinancingWidget:
|
|
|
401
388
|
/>
|
|
402
389
|
```
|
|
403
390
|
|
|
404
|
-
|
|
405
391
|
## @simpleapps-com/augur-web/gtm
|
|
406
392
|
|
|
407
393
|
- function: AnalyticsNoscript
|
|
@@ -417,12 +403,13 @@ FinancingWidget:
|
|
|
417
403
|
|
|
418
404
|
## @simpleapps-com/augur-web/mdx-components
|
|
419
405
|
|
|
420
|
-
- function: getMDXComponents - Returns a map of HTML element names to styled React components
|
|
406
|
+
- function: getMDXComponents - Returns a map of HTML element names to styled React components for use with MDX content rendering.
|
|
407
|
+
- type: HtmlComponents
|
|
421
408
|
|
|
422
409
|
## @simpleapps-com/augur-web/payment-modal
|
|
423
410
|
|
|
411
|
+
- function: extractBin - Extract a card BIN from a postMessage payload. Handles multiple formats returned by Element/Unified iframes: - URL-encoded string with Bin= parameter - Object with Bin, bin, CardBIN, or cardBin property - Nested data.Bin structure
|
|
424
412
|
- function: PaymentModal
|
|
425
|
-
- function: extractBin - Extract a card BIN from a postMessage payload.
|
|
426
413
|
- type: PaymentModalProps
|
|
427
414
|
|
|
428
415
|
## @simpleapps-com/augur-web/quantity-input
|
|
@@ -437,10 +424,9 @@ QuantityInput:
|
|
|
437
424
|
<QuantityInput value={qty} onChange={setQty} min={1} step={1} />
|
|
438
425
|
```
|
|
439
426
|
|
|
440
|
-
|
|
441
427
|
## @simpleapps-com/augur-web/session-replay
|
|
442
428
|
|
|
443
|
-
- function: SessionReplayScript - Loads a session replay script with `lazyOnload` behavior.
|
|
429
|
+
- function: SessionReplayScript - Loads a session replay script with `lazyOnload` behavior. Renders nothing — this is a side-effect-only leaf component.
|
|
444
430
|
- type: SessionReplayProvider
|
|
445
431
|
- type: SessionReplayScriptProps
|
|
446
432
|
|
|
@@ -458,7 +444,6 @@ SessionReplayScript:
|
|
|
458
444
|
<SessionReplayScript provider="hotjar" siteId="..." disabled={isDev} />
|
|
459
445
|
```
|
|
460
446
|
|
|
461
|
-
|
|
462
447
|
## @simpleapps-com/augur-web/stock-label
|
|
463
448
|
|
|
464
449
|
- function: createStockLabel
|
|
@@ -469,5 +454,5 @@ SessionReplayScript:
|
|
|
469
454
|
|
|
470
455
|
## @simpleapps-com/augur-web/provider
|
|
471
456
|
|
|
472
|
-
- function: AugurSiteProvider - Unified site provider that composes AugurHooksProvider with analytics
|
|
457
|
+
- function: AugurSiteProvider - Unified site provider that composes AugurHooksProvider with analytics based on the site config.
|
|
473
458
|
- type: AugurSiteProviderProps
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simpleapps-com/augur-web",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2026.11.2",
|
|
4
4
|
"description": "Shared React UI components for Augur ecommerce sites (Radix + Tailwind)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "https://github.com/simpleapps-com/
|
|
8
|
+
"url": "https://github.com/simpleapps-com/atlas.git",
|
|
9
9
|
"directory": "packages/augur-web"
|
|
10
10
|
},
|
|
11
11
|
"type": "module",
|
|
@@ -228,9 +228,9 @@
|
|
|
228
228
|
"llms.txt"
|
|
229
229
|
],
|
|
230
230
|
"dependencies": {
|
|
231
|
-
"@simpleapps-com/augur-core": "
|
|
232
|
-
"@simpleapps-com/augur-hooks": "
|
|
233
|
-
"@simpleapps-com/augur-utils": "
|
|
231
|
+
"@simpleapps-com/augur-core": "^2026.11.2",
|
|
232
|
+
"@simpleapps-com/augur-hooks": "^2026.11.2",
|
|
233
|
+
"@simpleapps-com/augur-utils": "^2026.11.3"
|
|
234
234
|
},
|
|
235
235
|
"peerDependencies": {
|
|
236
236
|
"@radix-ui/react-accordion": "^1.2.0",
|
|
@@ -270,27 +270,36 @@
|
|
|
270
270
|
"@tanstack/react-table": "^8.21.3",
|
|
271
271
|
"@testing-library/jest-dom": "^6.9.1",
|
|
272
272
|
"@testing-library/react": "^16.3.2",
|
|
273
|
+
"@types/node": "^26.6.6",
|
|
273
274
|
"@types/react": "^19.0.0",
|
|
274
275
|
"@types/react-dom": "^19.0.0",
|
|
275
|
-
"@vitest/coverage-v8": "
|
|
276
|
+
"@vitest/coverage-v8": "~5.0.3",
|
|
276
277
|
"class-variance-authority": "^0.7.0",
|
|
277
278
|
"cmdk": "^1.0.0",
|
|
279
|
+
"eslint": "^10.12.0",
|
|
278
280
|
"jsdom": "^28.1.0",
|
|
281
|
+
"lemmascript": "0.6.5",
|
|
279
282
|
"react": "^19.0.0",
|
|
280
283
|
"react-dom": "^19.0.0",
|
|
281
284
|
"react-icons": "^5.4.0",
|
|
282
|
-
"tsup": "^
|
|
283
|
-
"
|
|
284
|
-
"
|
|
285
|
-
"@
|
|
286
|
-
"@
|
|
285
|
+
"tsup": "^9.0.0",
|
|
286
|
+
"typescript": "~6.0.3",
|
|
287
|
+
"vitest": "~5.0.3",
|
|
288
|
+
"@atlas/eslint-config": "0.0.0",
|
|
289
|
+
"@atlas/tsconfig": "0.0.0",
|
|
290
|
+
"@atlas/tsup-config": "0.0.0",
|
|
291
|
+
"@atlas/utils": "0.0.0",
|
|
292
|
+
"@atlas/vitest-config": "0.0.0",
|
|
293
|
+
"@simpleapps-com/augur-api": "2026.11.3"
|
|
294
|
+
},
|
|
295
|
+
"engines": {
|
|
296
|
+
"node": ">=22.0.0"
|
|
287
297
|
},
|
|
288
298
|
"scripts": {
|
|
289
|
-
"build": "tsup",
|
|
290
|
-
"
|
|
291
|
-
"
|
|
292
|
-
"test": "vitest run --coverage
|
|
293
|
-
"typecheck": "tsc --noEmit"
|
|
294
|
-
"check-exports": "publint"
|
|
299
|
+
"build": "tsup && tsc -p tsconfig.build.json",
|
|
300
|
+
"lint": "eslint .",
|
|
301
|
+
"proofs": "lsc gen-check --backend=dafny && node ../../models/lsc-check.mjs",
|
|
302
|
+
"test": "vitest run --coverage",
|
|
303
|
+
"typecheck": "tsc --noEmit"
|
|
295
304
|
}
|
|
296
305
|
}
|
package/dist/accordion.d.cts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
3
|
-
|
|
4
|
-
declare const Accordion: React.ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
-
declare const AccordionItem: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
-
declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
-
declare const AccordionContent: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
-
|
|
9
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ButtonProps } from './button.cjs';
|
|
3
|
-
import 'class-variance-authority/types';
|
|
4
|
-
import 'class-variance-authority';
|
|
5
|
-
|
|
6
|
-
interface AddToCartButtonProps extends Pick<ButtonProps, "variant" | "size" | "disabled" | "className" | "onClick"> {
|
|
7
|
-
loading?: boolean;
|
|
8
|
-
label?: string;
|
|
9
|
-
showIcon?: boolean;
|
|
10
|
-
children?: React.ReactNode;
|
|
11
|
-
}
|
|
12
|
-
declare const AddToCartButton: React.NamedExoticComponent<AddToCartButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
13
|
-
|
|
14
|
-
export { AddToCartButton, type AddToCartButtonProps };
|
package/dist/breadcrumb.d.cts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
declare const Breadcrumb: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
|
|
5
|
-
separator?: React.ReactNode;
|
|
6
|
-
} & React.RefAttributes<HTMLElement>>;
|
|
7
|
-
declare const BreadcrumbList: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
|
|
8
|
-
declare const BreadcrumbItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
9
|
-
declare const BreadcrumbLink: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
10
|
-
asChild?: boolean;
|
|
11
|
-
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
12
|
-
declare const BreadcrumbPage: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
13
|
-
declare const BreadcrumbSeparator: {
|
|
14
|
-
({ children, className, ...props }: React.ComponentProps<"li">): react_jsx_runtime.JSX.Element;
|
|
15
|
-
displayName: string;
|
|
16
|
-
};
|
|
17
|
-
declare const BreadcrumbEllipsis: {
|
|
18
|
-
({ className, ...props }: React.ComponentProps<"span">): react_jsx_runtime.JSX.Element;
|
|
19
|
-
displayName: string;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator };
|
package/dist/breadcrumbs.d.cts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
interface BreadCrumbsProps {
|
|
4
|
-
title?: string;
|
|
5
|
-
links: {
|
|
6
|
-
href: string;
|
|
7
|
-
text: string;
|
|
8
|
-
}[];
|
|
9
|
-
activeBreadcrumb: string;
|
|
10
|
-
linkComponent?: React.ElementType;
|
|
11
|
-
className?: string;
|
|
12
|
-
titleClassName?: string;
|
|
13
|
-
baseUrl?: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Breadcrumb navigation with optional JSON-LD structured data.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```tsx
|
|
20
|
-
* import Link from "next/link";
|
|
21
|
-
* <BreadCrumbs
|
|
22
|
-
* links={[{ href: "/", text: "Home" }, { href: "/shop", text: "Shop" }]}
|
|
23
|
-
* activeBreadcrumb="Widget"
|
|
24
|
-
* linkComponent={Link}
|
|
25
|
-
* baseUrl="https://example.com"
|
|
26
|
-
* />
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
declare const BreadCrumbs: React.ForwardRefExoticComponent<BreadCrumbsProps & React.RefAttributes<HTMLElement>>;
|
|
30
|
-
|
|
31
|
-
export { BreadCrumbs, type BreadCrumbsProps };
|
package/dist/button.d.cts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { VariantProps } from 'class-variance-authority';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* CVA variants for the Button. Variants: default, destructive, outline,
|
|
7
|
-
* secondary, ghost, link. Sizes: default, sm, lg, icon.
|
|
8
|
-
*/
|
|
9
|
-
declare const buttonVariants: (props?: ({
|
|
10
|
-
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
11
|
-
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
12
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
13
|
-
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
14
|
-
asChild?: boolean;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Styled button with variant/size props. Supports polymorphism via `asChild`.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```tsx
|
|
21
|
-
* <Button variant="outline" size="sm">Cancel</Button>
|
|
22
|
-
* <Button asChild><Link href="/shop">Browse</Link></Button>
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
26
|
-
|
|
27
|
-
export { Button, type ButtonProps, buttonVariants };
|
package/dist/card.d.cts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
-
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
-
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
6
|
-
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
7
|
-
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
-
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
-
|
|
10
|
-
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
package/dist/checkbox.d.cts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
3
|
-
|
|
4
|
-
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
-
|
|
6
|
-
export { Checkbox };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/augur-packages/augur-packages/packages/augur-web/dist/chunk-AE4GLYJE.cjs","../src/gtm.tsx"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACA;ACAA,8BAAkF;AAmNzE,+CAAA;AAnIT,IAAM,iBAAA,EAAmB,kCAAA,IAAgD,CAAA;AAYzE,SAAS,YAAA,CAAA,EAA0C;AAEjD,EAAA,GAAA,CAAI,OAAO,OAAA,IAAW,WAAA,EAAa,OAAO,CAAC,CAAA;AAC3C,EAAA,GAAA,CAAI,CAAC,MAAA,CAAO,SAAA,EAAW,MAAA,CAAO,UAAA,EAAY,CAAC,CAAA;AAC3C,EAAA,OAAO,MAAA,CAAO,SAAA;AAChB;AAEA,SAAS,eAAA,CAAgB,KAAA,EAAe,QAAA,EAAmC;AAEzE,EAAA,GAAA,CAAI,OAAO,SAAA,IAAa,WAAA,EAAa,MAAA;AAGrC,EAAA,GAAA,CAAI,QAAA,CAAS,cAAA,CAAe,YAAY,CAAA,EAAG,MAAA;AAE3C,EAAA,MAAM,UAAA,EAAY,YAAA,CAAa,CAAA;AAC/B,EAAA,SAAA,CAAU,IAAA,CAAK,EAAE,WAAA,EAAA,iBAAa,IAAI,IAAA,CAAK,CAAA,CAAA,CAAE,OAAA,CAAQ,CAAA,EAAG,KAAA,EAAO,SAAS,CAAC,CAAA;AAErE,EAAA,MAAM,OAAA,EAAS,QAAA,CAAS,aAAA,CAAc,QAAQ,CAAA;AAC9C,EAAA,MAAA,CAAO,GAAA,EAAK,YAAA;AACZ,EAAA,MAAA,CAAO,IAAA,EAAM,CAAA,2CAAA,EAA8C,kBAAA,CAAmB,KAAK,CAAC,CAAA,CAAA;AAErD,EAAA;AACd,IAAA;AACA,IAAA;AACV,EAAA;AAEU,IAAA;AACjB,EAAA;AAEgC,EAAA;AAClC;AAMkC;AAChC,EAAA;AACW,EAAA;AACO,EAAA;AACV,EAAA;AACR,EAAA;AACyB;AACoC,EAAA;AACf,EAAA;AACd,EAAA;AAEE,EAAA;AACP,IAAA;AACH,IAAA;AAEsD,IAAA;AAChD,MAAA;AACO,QAAA;AACf,QAAA;AACjB,MAAA;AACyC,IAAA;AAEzB,MAAA;AACgB,QAAA;AACf,QAAA;AACd,MAAA;AACC,IAAA;AAC0B,MAAA;AACf,MAAA;AAClB,IAAA;AACkB,EAAA;AAIqD,EAAA;AAC/D,IAAA;AACV,EAAA;AAEmB,EAAA;AACoC,IAAA;AAClB,MAAA;AACtB,MAAA;AACuB,QAAA;AAClC,MAAA;AACyB,MAAA;AAC3B,IAAA;AACM,IAAA;AACR,EAAA;AAE4B,EAAA;AAC0B,IAAA;AAEX,MAAA;AACE,MAAA;AAC9B,MAAA;AACiC,QAAA;AAC5C,MAAA;AACyB,MAAA;AAC3B,IAAA;AACM,IAAA;AACR,EAAA;AAEuC,EAAA;AACnB,IAAA;AACV,IAAA;AACE,EAAA;AAE4B,EAAA;AACnB,IAAA;AAChB,EAAA;AAES,EAAA;AACL,IAAA;AACL,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACF,IAAA;AACmF,IAAA;AACrF,EAAA;AAE0D,EAAA;AAC5D;AAMsD;AACT,EAAA;AAC7B,EAAA;AAC6D,IAAA;AAC3E,EAAA;AACO,EAAA;AACT;AAWqE;AAG/D,EAAA;AAAC,IAAA;AAAA,IAAA;AAC8E,MAAA;AACtE,MAAA;AACD,MAAA;AACyC,MAAA;AACzC,MAAA;AAAA,IAAA;AAEV,EAAA;AAEJ;ADnIuF;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/augur-packages/augur-packages/packages/augur-web/dist/chunk-AE4GLYJE.cjs","sourcesContent":[null,"\"use client\";\n\nimport { createContext, useCallback, useContext, useMemo, useRef, useState } from \"react\";\nimport type { ReactNode } from \"react\";\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/** Script loading strategy. */\nexport type AnalyticsStrategy = \"default\" | \"afterInteractive\" | \"lazyOnload\";\n\n/** GA4 standard e-commerce event names. */\nexport type EcommerceEvent =\n | \"view_item\"\n | \"view_item_list\"\n | \"select_item\"\n | \"add_to_cart\"\n | \"remove_from_cart\"\n | \"view_cart\"\n | \"begin_checkout\"\n | \"add_shipping_info\"\n | \"add_payment_info\"\n | \"purchase\"\n | \"refund\";\n\n/** GA4 e-commerce item shape. */\nexport interface EcommerceItem {\n item_id: string;\n item_name?: string;\n item_brand?: string;\n item_category?: string;\n item_variant?: string;\n price?: number;\n quantity?: number;\n index?: number;\n [key: string]: unknown;\n}\n\n/** Parameters for e-commerce events. */\nexport interface EcommerceParams {\n currency?: string;\n value?: number;\n items?: EcommerceItem[];\n transaction_id?: string;\n shipping?: number;\n tax?: number;\n coupon?: string;\n [key: string]: unknown;\n}\n\nexport interface AnalyticsProviderProps {\n /** GTM container ID (e.g. \"GTM-XXXXX\"). */\n gtmId: string;\n /** Script loading strategy. Default: \"afterInteractive\". */\n strategy?: AnalyticsStrategy;\n /** Delay GTM loading until consent is granted. Default: false. */\n consentRequired?: boolean;\n /** Log dataLayer pushes to console. Default: false. */\n debug?: boolean;\n children: ReactNode;\n}\n\nexport interface AnalyticsContextValue {\n /** Push a custom event to the dataLayer. */\n trackEvent: (event: string, params?: Record<string, unknown>) => void;\n /** Push a GA4 e-commerce event to the dataLayer. */\n trackEcommerceEvent: (event: EcommerceEvent, params: EcommerceParams) => void;\n /** Grant consent — loads GTM if consentRequired was true. */\n grantConsent: () => void;\n /** Revoke consent. Does not unload GTM (scripts can't be unloaded). */\n revokeConsent: () => void;\n /** Whether consent has been granted. */\n hasConsent: boolean;\n /** Whether the GTM script has been injected. */\n isLoaded: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Context\n// ---------------------------------------------------------------------------\n\nconst AnalyticsContext = createContext<AnalyticsContextValue | null>(null);\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\ndeclare global {\n interface Window {\n dataLayer?: Record<string, unknown>[];\n }\n}\n\nfunction getDataLayer(): Record<string, unknown>[] {\n /* v8 ignore next */\n if (typeof window === \"undefined\") return [];\n if (!window.dataLayer) window.dataLayer = [];\n return window.dataLayer;\n}\n\nfunction injectGtmScript(gtmId: string, strategy: AnalyticsStrategy): void {\n /* v8 ignore next */\n if (typeof document === \"undefined\") return;\n\n // Prevent double-injection\n if (document.getElementById(\"gtm-script\")) return;\n\n const dataLayer = getDataLayer();\n dataLayer.push({ \"gtm.start\": new Date().getTime(), event: \"gtm.js\" });\n\n const script = document.createElement(\"script\");\n script.id = \"gtm-script\";\n script.src = `https://www.googletagmanager.com/gtm.js?id=${encodeURIComponent(gtmId)}`;\n\n if (strategy === \"lazyOnload\") {\n script.async = true;\n script.defer = true;\n } else {\n // \"default\" and \"afterInteractive\"\n script.async = true;\n }\n\n document.head.appendChild(script);\n}\n\n// ---------------------------------------------------------------------------\n// Provider\n// ---------------------------------------------------------------------------\n\nexport function AnalyticsProvider({\n gtmId,\n strategy = \"afterInteractive\",\n consentRequired = false,\n debug = false,\n children,\n}: AnalyticsProviderProps) {\n const [hasConsent, setHasConsent] = useState(!consentRequired);\n const [isLoaded, setIsLoaded] = useState(false);\n const injectedRef = useRef(false);\n\n const loadGtm = useCallback(() => {\n if (injectedRef.current) return;\n injectedRef.current = true;\n\n if (strategy === \"lazyOnload\" && typeof requestIdleCallback === \"function\") {\n requestIdleCallback(() => {\n injectGtmScript(gtmId, strategy);\n setIsLoaded(true);\n });\n } else if (strategy === \"afterInteractive\") {\n // Defer to after hydration\n setTimeout(() => {\n injectGtmScript(gtmId, strategy);\n setIsLoaded(true);\n }, 0);\n } else {\n injectGtmScript(gtmId, strategy);\n setIsLoaded(true);\n }\n }, [gtmId, strategy]);\n\n // Auto-load when consent is not required or already granted\n /* v8 ignore next */\n if (hasConsent && !injectedRef.current && typeof window !== \"undefined\") {\n loadGtm();\n }\n\n const trackEvent = useCallback(\n (event: string, params?: Record<string, unknown>) => {\n const entry = { event, ...params };\n if (debug) {\n console.log(\"[Analytics]\", entry);\n }\n getDataLayer().push(entry);\n },\n [debug],\n );\n\n const trackEcommerceEvent = useCallback(\n (event: EcommerceEvent, params: EcommerceParams) => {\n // Clear previous ecommerce data per GA4 best practices\n getDataLayer().push({ ecommerce: null });\n const entry = { event, ecommerce: params };\n if (debug) {\n console.log(\"[Analytics ecommerce]\", entry);\n }\n getDataLayer().push(entry);\n },\n [debug],\n );\n\n const grantConsent = useCallback(() => {\n setHasConsent(true);\n loadGtm();\n }, [loadGtm]);\n\n const revokeConsent = useCallback(() => {\n setHasConsent(false);\n }, []);\n\n const value = useMemo<AnalyticsContextValue>(\n () => ({\n trackEvent,\n trackEcommerceEvent,\n grantConsent,\n revokeConsent,\n hasConsent,\n isLoaded,\n }),\n [trackEvent, trackEcommerceEvent, grantConsent, revokeConsent, hasConsent, isLoaded],\n );\n\n return <AnalyticsContext.Provider value={value}>{children}</AnalyticsContext.Provider>;\n}\n\n// ---------------------------------------------------------------------------\n// Hook\n// ---------------------------------------------------------------------------\n\nexport function useAnalytics(): AnalyticsContextValue {\n const context = useContext(AnalyticsContext);\n if (!context) {\n throw new Error(\"useAnalytics must be used within an <AnalyticsProvider>\");\n }\n return context;\n}\n\n// ---------------------------------------------------------------------------\n// Noscript\n// ---------------------------------------------------------------------------\n\nexport interface AnalyticsNoscriptProps {\n /** GTM container ID (must match AnalyticsProvider). */\n gtmId: string;\n}\n\nexport function AnalyticsNoscript({ gtmId }: AnalyticsNoscriptProps) {\n return (\n <noscript>\n <iframe\n src={`https://www.googletagmanager.com/ns.html?id=${encodeURIComponent(gtmId)}`}\n height=\"0\"\n width=\"0\"\n style={{ display: \"none\", visibility: \"hidden\" }}\n title=\"Google Tag Manager\"\n />\n </noscript>\n );\n}\n"]}
|