@fluid-app/portal-sdk 0.1.715 → 0.1.716

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.
Files changed (52) hide show
  1. package/dist/{FluidProvider-DKSOq7gg.cjs → FluidProvider-C0t5JIXa.cjs} +3 -3
  2. package/dist/{FluidProvider-DKSOq7gg.cjs.map → FluidProvider-C0t5JIXa.cjs.map} +1 -1
  3. package/dist/{FluidProvider-BXRxiCKk.mjs → FluidProvider-roDWPHfR.mjs} +3 -3
  4. package/dist/{FluidProvider-BXRxiCKk.mjs.map → FluidProvider-roDWPHfR.mjs.map} +1 -1
  5. package/dist/{MessagingScreen-BVDVGBL8.mjs → MessagingScreen-BBV7Ut_o.mjs} +2 -2
  6. package/dist/{MessagingScreen-BVDVGBL8.mjs.map → MessagingScreen-BBV7Ut_o.mjs.map} +1 -1
  7. package/dist/{MessagingScreen-DjeBEe3V.cjs → MessagingScreen-BEGktpTA.cjs} +4 -4
  8. package/dist/{MessagingScreen-b1jGzJhe.mjs → MessagingScreen-ChT4E5jk.mjs} +4 -4
  9. package/dist/{MessagingScreen-Das2UTNx.cjs → MessagingScreen-Rj7lamrd.cjs} +2 -2
  10. package/dist/{MessagingScreen-Das2UTNx.cjs.map → MessagingScreen-Rj7lamrd.cjs.map} +1 -1
  11. package/dist/{OrdersScreen-6sDc2NJZ.cjs → OrdersScreen-BYzYw-1c.cjs} +4 -4
  12. package/dist/{OrdersScreen-6sDc2NJZ.cjs.map → OrdersScreen-BYzYw-1c.cjs.map} +1 -1
  13. package/dist/{OrdersScreen-p8-lfl3L.mjs → OrdersScreen-Bm2FPBzc.mjs} +4 -4
  14. package/dist/{OrdersScreen-p8-lfl3L.mjs.map → OrdersScreen-Bm2FPBzc.mjs.map} +1 -1
  15. package/dist/{OrdersScreen-CA6B0ILp.cjs → OrdersScreen-CwknCE8D.cjs} +4 -4
  16. package/dist/{OrdersScreen-Cm5LmBju.mjs → OrdersScreen-CxO-9ZQm.mjs} +4 -4
  17. package/dist/{PointsWidget-C_Nrg0KI.mjs → PointsWidget-BE6o4vk3.mjs} +2 -2
  18. package/dist/PointsWidget-BE6o4vk3.mjs.map +1 -0
  19. package/dist/{PointsWidget-Cd0PNY-J.cjs → PointsWidget-BWbvk1uz.cjs} +2 -2
  20. package/dist/PointsWidget-BWbvk1uz.cjs.map +1 -0
  21. package/dist/{PointsWidget-PBQ-oaI4.cjs → PointsWidget-bxSjPmby.cjs} +1 -1
  22. package/dist/{PointsWidget-BvDMiGEw.mjs → PointsWidget-wVWlaXvw.mjs} +1 -1
  23. package/dist/{ProfileScreen-kFQwMGrf.cjs → ProfileScreen-Bcj6y4w0.cjs} +5 -5
  24. package/dist/{ProfileScreen-DCmlaOMl.cjs → ProfileScreen-Ccl8RKvr.cjs} +4 -4
  25. package/dist/{ProfileScreen-DCmlaOMl.cjs.map → ProfileScreen-Ccl8RKvr.cjs.map} +1 -1
  26. package/dist/{ProfileScreen-BCa252ry.mjs → ProfileScreen-Co9cZ64C.mjs} +4 -4
  27. package/dist/{ProfileScreen-BCa252ry.mjs.map → ProfileScreen-Co9cZ64C.mjs.map} +1 -1
  28. package/dist/{ProfileScreen-pPhSQ849.mjs → ProfileScreen-hKWBMMfq.mjs} +5 -5
  29. package/dist/{SubscriptionsScreen-B7moTt_U.mjs → SubscriptionsScreen-Bf6rFFC7.mjs} +4 -4
  30. package/dist/{SubscriptionsScreen-B7moTt_U.mjs.map → SubscriptionsScreen-Bf6rFFC7.mjs.map} +1 -1
  31. package/dist/{SubscriptionsScreen-WYPiwg-A.cjs → SubscriptionsScreen-Bju88wd6.cjs} +4 -4
  32. package/dist/{SubscriptionsScreen-WYPiwg-A.cjs.map → SubscriptionsScreen-Bju88wd6.cjs.map} +1 -1
  33. package/dist/{SubscriptionsScreen-nGPyj1A1.cjs → SubscriptionsScreen-DDLOLgpn.cjs} +5 -5
  34. package/dist/{SubscriptionsScreen-d5p2XQpq.mjs → SubscriptionsScreen-N8fPasLD.mjs} +5 -5
  35. package/dist/{build-widget-registry-BJMynstH.mjs → build-widget-registry-CuBfK5ZQ.mjs} +3 -3
  36. package/dist/{build-widget-registry-BJMynstH.mjs.map → build-widget-registry-CuBfK5ZQ.mjs.map} +1 -1
  37. package/dist/{build-widget-registry-DQVZgEBF.cjs → build-widget-registry-DDrEy2rk.cjs} +3 -3
  38. package/dist/{build-widget-registry-DQVZgEBF.cjs.map → build-widget-registry-DDrEy2rk.cjs.map} +1 -1
  39. package/dist/index.cjs +16 -16
  40. package/dist/index.mjs +16 -16
  41. package/dist/styles/remote-widget-shadow.css +2 -2
  42. package/dist/{use-portal-card-add-3ds-flow-vdNfvTwO.cjs → use-portal-card-add-3ds-flow-CrQ40crw.cjs} +3 -3
  43. package/dist/{use-portal-card-add-3ds-flow-vdNfvTwO.cjs.map → use-portal-card-add-3ds-flow-CrQ40crw.cjs.map} +1 -1
  44. package/dist/{use-portal-card-add-3ds-flow-B1kAunAk.mjs → use-portal-card-add-3ds-flow-Cz0iMmsZ.mjs} +3 -3
  45. package/dist/{use-portal-card-add-3ds-flow-B1kAunAk.mjs.map → use-portal-card-add-3ds-flow-Cz0iMmsZ.mjs.map} +1 -1
  46. package/dist/utils/build-remote-widget-plugin-manifests.cjs +2 -2
  47. package/dist/utils/build-remote-widget-plugin-manifests.mjs +2 -2
  48. package/dist/utils/build-widget-registry.cjs +2 -2
  49. package/dist/utils/build-widget-registry.mjs +2 -2
  50. package/package.json +3 -3
  51. package/dist/PointsWidget-C_Nrg0KI.mjs.map +0 -1
  52. package/dist/PointsWidget-Cd0PNY-J.cjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  require("../chunk-9hOWP6kD.cjs");
3
- const require_build_widget_registry = require("../build-widget-registry-DQVZgEBF.cjs");
3
+ const require_build_widget_registry = require("../build-widget-registry-DDrEy2rk.cjs");
4
4
  require("../ScreenRenderer-CLT0DgZh.cjs");
5
5
  require("../account-api-context-BAC-rNdx.cjs");
6
6
  require("../use-optional-store-DiiiefyO.cjs");
@@ -19,7 +19,7 @@ require("../translation-api-context-factory-RBUJOiM_.cjs");
19
19
  require("../shell-translation-api-context-BszNxj99.cjs");
20
20
  require("../widgets-api-context-BXem4OTe.cjs");
21
21
  require("../EmbedWidget-DaKESsip.cjs");
22
- require("../PointsWidget-Cd0PNY-J.cjs");
22
+ require("../PointsWidget-BWbvk1uz.cjs");
23
23
  require("../task-composer-form-DSzvWPfZ.cjs");
24
24
  require("../LayoutWidget-CKMDRIZ-.cjs");
25
25
  const require_registries = require("../registries-Y3AChwzx.cjs");
@@ -1,5 +1,5 @@
1
1
  import "../src-8ihOpuAU.mjs";
2
- import { a as createRemoteWidgetCapabilityGrants, i as projectRemoteWidgetPackages } from "../build-widget-registry-BJMynstH.mjs";
2
+ import { a as createRemoteWidgetCapabilityGrants, i as projectRemoteWidgetPackages } from "../build-widget-registry-CuBfK5ZQ.mjs";
3
3
  import "../ScreenRenderer-DJnHvFb-.mjs";
4
4
  import "../account-api-context-DCEDXtbM.mjs";
5
5
  import "../use-optional-store-D6XsdB-j.mjs";
@@ -18,7 +18,7 @@ import "../translation-api-context-factory-CEC_UpZg.mjs";
18
18
  import "../shell-translation-api-context-C8bj8XHf.mjs";
19
19
  import "../widgets-api-context-CLw35iC_.mjs";
20
20
  import "../EmbedWidget-C4xIr6S7.mjs";
21
- import "../PointsWidget-C_Nrg0KI.mjs";
21
+ import "../PointsWidget-BE6o4vk3.mjs";
22
22
  import "../task-composer-form-DZ5bGOj2.mjs";
23
23
  import "../LayoutWidget-B6461Gji.mjs";
24
24
  import { y as isPropertyFieldType } from "../registries-DJe9dUTb.mjs";
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  require("../chunk-9hOWP6kD.cjs");
3
- const require_build_widget_registry = require("../build-widget-registry-DQVZgEBF.cjs");
3
+ const require_build_widget_registry = require("../build-widget-registry-DDrEy2rk.cjs");
4
4
  require("../ScreenRenderer-CLT0DgZh.cjs");
5
5
  require("../account-api-context-BAC-rNdx.cjs");
6
6
  require("../use-optional-store-DiiiefyO.cjs");
@@ -19,7 +19,7 @@ require("../translation-api-context-factory-RBUJOiM_.cjs");
19
19
  require("../shell-translation-api-context-BszNxj99.cjs");
20
20
  require("../widgets-api-context-BXem4OTe.cjs");
21
21
  require("../EmbedWidget-DaKESsip.cjs");
22
- require("../PointsWidget-Cd0PNY-J.cjs");
22
+ require("../PointsWidget-BWbvk1uz.cjs");
23
23
  require("../task-composer-form-DSzvWPfZ.cjs");
24
24
  require("../LayoutWidget-CKMDRIZ-.cjs");
25
25
  require("../registries-Y3AChwzx.cjs");
@@ -1,5 +1,5 @@
1
1
  import "../src-8ihOpuAU.mjs";
2
- import { i as projectRemoteWidgetPackages, n as buildRemoteWidgetRegistry, r as isBuiltInWidgetType, t as buildNavigateHandler } from "../build-widget-registry-BJMynstH.mjs";
2
+ import { i as projectRemoteWidgetPackages, n as buildRemoteWidgetRegistry, r as isBuiltInWidgetType, t as buildNavigateHandler } from "../build-widget-registry-CuBfK5ZQ.mjs";
3
3
  import "../ScreenRenderer-DJnHvFb-.mjs";
4
4
  import "../account-api-context-DCEDXtbM.mjs";
5
5
  import "../use-optional-store-D6XsdB-j.mjs";
@@ -18,7 +18,7 @@ import "../translation-api-context-factory-CEC_UpZg.mjs";
18
18
  import "../shell-translation-api-context-C8bj8XHf.mjs";
19
19
  import "../widgets-api-context-CLw35iC_.mjs";
20
20
  import "../EmbedWidget-C4xIr6S7.mjs";
21
- import "../PointsWidget-C_Nrg0KI.mjs";
21
+ import "../PointsWidget-BE6o4vk3.mjs";
22
22
  import "../task-composer-form-DZ5bGOj2.mjs";
23
23
  import "../LayoutWidget-B6461Gji.mjs";
24
24
  import "../registries-DJe9dUTb.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-app/portal-sdk",
3
- "version": "0.1.715",
3
+ "version": "0.1.716",
4
4
  "description": "SDK for building custom Fluid portals",
5
5
  "files": [
6
6
  "authoring",
@@ -54,7 +54,7 @@
54
54
  "access": "public"
55
55
  },
56
56
  "dependencies": {
57
- "@fluid-app/widget-runtime": "0.1.125",
57
+ "@fluid-app/widget-runtime": "0.1.126",
58
58
  "@radix-ui/react-slot": "^1.1.2",
59
59
  "@remote-dom/react": "^1.2.2",
60
60
  "class-variance-authority": "^0.7.1",
@@ -72,7 +72,7 @@
72
72
  "@fluid-app/address-fields": "0.1.0",
73
73
  "@fluid-app/api-client-core": "0.1.0",
74
74
  "@fluid-app/auth": "0.1.0",
75
- "@fluid-app/cart-ui": "0.1.76",
75
+ "@fluid-app/cart-ui": "0.1.77",
76
76
  "@fluid-app/company-switcher-ui": "0.1.0",
77
77
  "@fluid-app/contacts-core": "0.1.0",
78
78
  "@fluid-app/contacts-ui": "0.1.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"PointsWidget-C_Nrg0KI.mjs","names":[],"sources":["../../core/src/format/title-case.ts","../../widgets/src/hooks/use-points-ledger.preview.ts","../../widgets/src/hooks/use-points-ledger.ts","../../react/src/hooks/use-points-label.ts","../../widgets/src/widgets/PointsWidget.tsx"],"sourcesContent":["/**\n * Turn a snake_case value into Title Case words, e.g. `order_redemption` ->\n * `Order Redemption`. Only the first character of each word is upper-cased; the\n * rest is left verbatim.\n *\n * Shared by the portal points-history surfaces (PointsWidget, ProfileLayout) so\n * they render labels like points-ledger transaction types identically. The\n * standalone apps (fluid-pay, fluid-checkout) and profile-ui intentionally keep\n * their own transaction-type formatters — they live in separate translation\n * domains and aren't consolidated here.\n */\nexport function titleCaseFromSnake(value: string): string {\n return value\n .split(\"_\")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n}\n","import type { PointsData } from \"@fluid-app/portal-core/widgets-api-types\";\n\nconst now = new Date();\n\nfunction daysAgo(days: number): string {\n return new Date(now.getTime() - days * 86_400_000).toISOString();\n}\n\nexport const PREVIEW_DATA: PointsData = {\n balance: 25,\n entries: [\n {\n id: 1,\n amount: 20,\n createdAt: daysAgo(3),\n transactionType: \"new_order\",\n hasSource: true,\n },\n {\n id: 2,\n amount: 50,\n createdAt: daysAgo(14),\n transactionType: \"referral_bonus\",\n hasSource: true,\n },\n {\n id: 3,\n amount: -75,\n createdAt: daysAgo(60),\n transactionType: null,\n hasSource: true,\n },\n {\n id: 4,\n amount: 30,\n createdAt: daysAgo(90),\n transactionType: \"welcome_reward\",\n hasSource: true,\n },\n ],\n};\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useWidgetsApi } from \"@fluid-app/portal-core/widgets-api-context\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-react/data-sources/preview-context\";\nimport { useDataSourceRegistryConfig } from \"@fluid-app/portal-react/data-sources/registry-context\";\nimport { PREVIEW_DATA } from \"./use-points-ledger.preview\";\nimport type { PointsData } from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport type {\n PointsData,\n PointsEntry,\n} from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport const POINTS_LEDGER_QUERY_KEY = \"points-ledger\" as const;\n\nexport function usePointsLedger(): UseQueryResult<PointsData, Error> {\n const widgetsApi = useWidgetsApi();\n const { isPreview } = useWidgetPreviewContext();\n const registryConfig = useDataSourceRegistryConfig();\n const { baseUrl } = registryConfig;\n const customerId = registryConfig.variables?.customer_id;\n\n // Contract: the BFF adapter (portal app, composite factory spreads BFF over\n // legacy) ignores customerId and infers the customer from the JWT, so the\n // portal renders this widget with no registry-variable plumbing. The legacy\n // adapter (fluid-admin) builds /v202506/customers/{customerId}/points_ledgers\n // and MUST receive a real id; that consumer always supplies one via registry\n // variables, so empty string never reaches the legacy URL in practice. If a\n // future caller wires this hook to a legacy-only adapter, configure\n // registry variables.customer_id at the provider — otherwise the request\n // would 404 on /customers//points_ledgers.\n return useQuery({\n queryKey: [\n \"portal-widget-use\",\n POINTS_LEDGER_QUERY_KEY,\n isPreview ? \"preview\" : baseUrl,\n customerId ?? null,\n ] as const,\n queryFn: ({ signal }) =>\n widgetsApi.fetchPointsLedger(customerId ?? \"\", signal),\n enabled: !isPreview,\n ...(isPreview && { placeholderData: PREVIEW_DATA }),\n });\n}\n","import { useMemo } from \"react\";\nimport { useOptionalStore } from \"./use-optional-store\";\n\nexport interface PointsLabel {\n singular: string;\n plural: string;\n}\n\n/**\n * Platform defaults, mirroring the backend column defaults. Used whenever the\n * store is unavailable (preview/builder) or a company hasn't overridden the\n * label.\n */\nexport const DEFAULT_POINTS_LABEL: PointsLabel = {\n singular: \"point\",\n plural: \"points\",\n};\n\n/**\n * Resolves the per-company reward-points label for use across portal surfaces\n * (widgets, order details, etc.).\n *\n * Reads the store via `useOptionalStore()`, which is preview-safe: the widget\n * palette / drag-preview mounts widgets without a StoreApiProvider, so the\n * underlying query is disabled and we fall back to the platform defaults. The\n * shared hook reuses `useStore()`'s cache key, so the result is deduped with\n * the rest of the app's store cache.\n */\nexport function usePointsLabel(): PointsLabel {\n const { data } = useOptionalStore();\n\n // `.trim() ||` (not `??`) so a blank/whitespace-only tenant label falls back\n // to the platform default instead of rendering an empty string — matching the\n // fluid-pay / fluid-checkout points-label helpers.\n const singular =\n data?.reward_points_label_singular?.trim() || DEFAULT_POINTS_LABEL.singular;\n const plural =\n data?.reward_points_label_plural?.trim() || DEFAULT_POINTS_LABEL.plural;\n\n return useMemo(() => ({ singular, plural }), [singular, plural]);\n}\n","import { useId, useState, type ComponentProps } from \"react\";\nimport type React from \"react\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport { titleCaseFromSnake } from \"@fluid-app/portal-core/format/title-case\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n getColorField,\n getFontSizeField,\n getPaddingField,\n borderWidthClasses,\n borderColorClasses,\n} from \"../core/fields\";\nimport { usePointsLedger, type PointsEntry } from \"../hooks/use-points-ledger\";\nimport { usePointsLabel } from \"@fluid-app/portal-react/hooks/use-points-label\";\nimport { ErrorState } from \"../components/error-state\";\nimport { WidgetLoadingSkeleton } from \"../components/WidgetLoadingSkeleton\";\nimport { ChevronDown, Coins } from \"lucide-react\";\n\nconst formatBalance = (balance: number): string => {\n return balance.toLocaleString(\"en-US\");\n};\n\n/** Capitalize the first letter for display in headings / sentence-leading copy. */\nconst capitalize = (value: string): string =>\n value.charAt(0).toUpperCase() + value.slice(1);\n\nexport function formatTransactionType(\n entry: PointsEntry,\n pluralLabel: string,\n): string {\n // Rails stamps \"order_credit\" on an order's points accrual. That is the same\n // event the hasSource branch below renders, so it keeps the company's own\n // points label instead of falling through to the generic type name.\n //\n // Handled directly rather than by falling through, matching the profile,\n // checkout and pay formatters. hasSource is set only when metadata.source is\n // present, and the public ledger endpoint passes client metadata through\n // verbatim, so a typed entry can arrive without one and must still be\n // branded rather than read \"Transaction\".\n if (entry.transactionType === \"order_credit\") {\n return entry.amount > 0\n ? `${pluralLabel} Awarded`\n : `${pluralLabel} Redeemed`;\n }\n if (entry.transactionType) {\n return titleCaseFromSnake(entry.transactionType);\n }\n if (entry.hasSource) {\n return entry.amount > 0\n ? `${pluralLabel} Awarded`\n : `${pluralLabel} Redeemed`;\n }\n return \"Transaction\";\n}\n\nfunction formatEntryDate(dateString: string): string {\n if (!dateString) return \"\";\n const date = new Date(dateString);\n return date.toLocaleDateString(undefined, {\n month: \"short\",\n day: \"numeric\",\n year: \"numeric\",\n });\n}\n\ntype PointsWidgetProps = ComponentProps<\"div\"> & {\n // Title\n titleEnabled?: boolean;\n title?: string;\n titleFontSize?: FontSizeOptions;\n titleColor?: ColorOptions;\n\n // Balance\n balanceColor?: ColorOptions;\n\n // History\n historyEnabled?: boolean;\n historyTitle?: string;\n\n // Styling\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n};\n\nfunction PointsEntryRow({\n entry,\n isLast,\n textColor,\n accentColor,\n backgroundColor,\n pointsLabelPlural,\n}: {\n entry: PointsEntry;\n isLast: boolean;\n textColor: ColorOptions;\n accentColor: ColorOptions;\n backgroundColor: ColorOptions;\n pointsLabelPlural: string;\n}) {\n const isPositive = entry.amount >= 0;\n const prefix = isPositive ? \"+\" : \"\";\n return (\n <div className=\"flex flex-row items-stretch gap-3\">\n <div className=\"relative flex w-2 flex-col items-center\">\n {!isLast && (\n <div\n className={`bg-${textColor}/40 absolute top-3 -bottom-3 left-1/2 w-px -translate-x-1/2`}\n />\n )}\n <div\n className={`border-${textColor}/60 bg-${backgroundColor} relative mt-3 h-2 w-2 shrink-0 rounded-full border`}\n />\n </div>\n <div className=\"flex flex-1 flex-row items-start justify-between py-1.5\">\n <div className=\"flex min-w-0 flex-col\">\n <div className={`text-sm font-medium text-${textColor} truncate`}>\n {formatTransactionType(entry, pointsLabelPlural)}\n </div>\n <div className={`text-sm text-${textColor} opacity-70`}>\n {formatEntryDate(entry.createdAt)}\n </div>\n </div>\n <div\n className={`text-sm font-medium ${isPositive ? `text-${accentColor}` : \"text-destructive\"}`}\n >\n {prefix}\n {entry.amount.toLocaleString(\"en-US\")}\n </div>\n </div>\n </div>\n );\n}\n\nexport function PointsWidget({\n // Title\n titleEnabled = true,\n title,\n titleFontSize = \"md\",\n titleColor = \"foreground\",\n\n // Balance\n balanceColor = \"primary\",\n\n // History\n historyEnabled = true,\n historyTitle = \"History\",\n\n // Styling\n background = { type: \"solid\", color: \"background\" },\n textColor = \"foreground\",\n accentColor = \"primary\",\n padding = 4,\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n\n className,\n ...props\n}: PointsWidgetProps): React.JSX.Element {\n const [historyOpen, setHistoryOpen] = useState(false);\n const historyPanelId = useId();\n\n // Per-company reward-points label (falls back to \"points\"). Used as the\n // default heading and in empty/transaction copy when the admin hasn't set a\n // custom title.\n const { plural } = usePointsLabel();\n const pointsLabelPlural = capitalize(plural);\n\n const backgroundColor = background.color || \"background\";\n const backgroundImage =\n (background.resource?.image_url || background.resource?.imageUrl) &&\n background.type === \"image\"\n ? `url(${background.resource.image_url || background.resource.imageUrl})`\n : \"none\";\n\n const { data, isLoading, isError } = usePointsLedger();\n\n return (\n <div\n className={`@container overflow-hidden rounded-${borderRadius} bg-${backgroundColor} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${className ?? \"\"}`}\n style={{ backgroundImage }}\n {...props}\n >\n <div className={`p-${padding} flex flex-col gap-2.5`}>\n {/* Header: Title + Balance */}\n {titleEnabled && (\n <h2\n className={`text-${titleFontSize} font-header font-bold text-${titleColor}`}\n >\n {title?.trim() ? title : pointsLabelPlural}\n </h2>\n )}\n {!isLoading && data && (\n <span\n className={`text-3xl font-semibold text-${balanceColor} font-header leading-snug`}\n >\n {formatBalance(data.balance)}\n </span>\n )}\n\n {/* Loading */}\n {isLoading ? (\n <WidgetLoadingSkeleton minHeight={60} rows={1} />\n ) : isError ? (\n <ErrorState />\n ) : historyEnabled && (!data || data.entries.length === 0) ? (\n /* Empty state — only shown when history is enabled but no entries */\n <div className=\"flex min-h-[60px] flex-col items-center justify-center gap-2\">\n <Coins className={`size-10 text-${textColor} opacity-30`} />\n <p className={`text-sm font-semibold text-${textColor} opacity-50`}>\n No {pointsLabelPlural} Activity\n </p>\n </div>\n ) : historyEnabled && data && data.entries.length > 0 ? (\n /* History dropdown */\n <div className=\"flex flex-col gap-2\">\n {/* Dropdown toggle */}\n <button\n type=\"button\"\n aria-expanded={historyOpen}\n aria-controls={historyPanelId}\n onClick={() => setHistoryOpen((prev) => !prev)}\n className={`flex w-full items-center text-xs font-semibold text-${textColor} cursor-pointer`}\n >\n <span className=\"flex-1 text-left\">{historyTitle}</span>\n <ChevronDown\n className={`size-4 transition-transform duration-200 ${historyOpen ? \"rotate-180\" : \"\"}`}\n />\n </button>\n <div className={`bg-${textColor}/20 h-px w-full`} />\n\n {/* Collapsible entries */}\n <div\n id={historyPanelId}\n className={`flex flex-col ${!historyOpen ? \"hidden\" : \"\"}`}\n >\n {data.entries.map((entry, index) => (\n <PointsEntryRow\n key={entry.id}\n entry={entry}\n isLast={index === data.entries.length - 1}\n textColor={textColor}\n accentColor={accentColor}\n backgroundColor={backgroundColor}\n pointsLabelPlural={pointsLabelPlural}\n />\n ))}\n </div>\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n\nexport const pointsWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"PointsWidget\",\n displayName: \"Points\",\n fields: [\n // Title group\n {\n key: \"titleEnabled\",\n label: \"Show Title\",\n type: \"boolean\",\n description: \"Toggle title visibility\",\n defaultValue: true,\n\n group: \"Title\",\n },\n {\n key: \"title\",\n label: \"Title\",\n type: \"text\",\n description:\n \"Title text displayed above the balance. Leave blank to use the company's configured points label.\",\n defaultValue: \"\",\n\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n getFontSizeField({\n key: \"titleFontSize\",\n label: \"Title Font Size\",\n description: \"Font size for the title\",\n defaultValue: \"md\",\n\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getColorField({\n key: \"titleColor\",\n label: \"Title Color\",\n description: \"Color for the title\",\n defaultValue: \"foreground\",\n\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n\n // Balance group\n getColorField({\n key: \"balanceColor\",\n label: \"Balance Color\",\n description: \"Color for the points balance number\",\n defaultValue: \"primary\",\n\n group: \"Balance\",\n }),\n\n // History group\n {\n key: \"historyEnabled\",\n label: \"Show History\",\n type: \"boolean\",\n description: \"Show a collapsible history dropdown below the balance\",\n defaultValue: true,\n\n group: \"History\",\n },\n {\n key: \"historyTitle\",\n label: \"History Title\",\n type: \"text\",\n description: \"Title for the history dropdown\",\n defaultValue: \"History\",\n\n group: \"History\",\n requiresKeyToBeTrue: \"historyEnabled\",\n },\n\n // Design group\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the widget\",\n defaultValue: { type: \"solid\", color: \"background\" },\n\n group: \"Design\",\n },\n getColorField({\n key: \"textColor\",\n label: \"Text Color\",\n description: \"Default text color\",\n defaultValue: \"foreground\",\n\n group: \"Design\",\n }),\n getColorField({\n key: \"accentColor\",\n label: \"Accent Color\",\n description: \"Color for positive points amounts\",\n defaultValue: \"primary\",\n\n group: \"Design\",\n }),\n {\n key: \"separator\",\n type: \"separator\",\n label: \"Separator\",\n\n group: \"Design\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Widget padding\",\n defaultValue: 4,\n\n group: \"Design\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Widget border radius\",\n defaultValue: \"md\",\n\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Widget border width\",\n defaultValue: \"none\",\n\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Widget border color\",\n defaultValue: \"muted\",\n\n group: \"Design\",\n }),\n ],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAWA,SAAgB,mBAAmB,OAAuB;AACxD,QAAO,MACJ,MAAM,IAAI,CACV,KAAK,SAAS,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE,CAAC,CAC3D,KAAK,IAAI;;;;ACbd,MAAM,sBAAM,IAAI,MAAM;AAEtB,SAAS,QAAQ,MAAsB;AACrC,yBAAO,IAAI,KAAK,IAAI,SAAS,GAAG,OAAO,MAAW,EAAC,aAAa;;AAGlE,MAAa,eAA2B;CACtC,SAAS;CACT,SAAS;EACP;GACE,IAAI;GACJ,QAAQ;GACR,WAAW,QAAQ,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AO;GACP,aAAa;GACb,cAAc;IAAE,MAAM;IAAS,OAAO;IAAc;GAEpD,OAAO;GACR;EACD,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GAEd,OAAO;GACR,CAAC;EACF,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GAEd,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,MAAM;GACN,OAAO;GAEP,OAAO;GACR;EACD,gBAAgB;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GAEd,OAAO;GACR,CAAC;EACF,qBAAqB;GACnB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GAEd,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GAEd,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GAEd,OAAO;GACR,CAAC;EACH;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PointsWidget-Cd0PNY-J.cjs","names":["useWidgetsApi","useWidgetPreviewContext","useDataSourceRegistryConfig","useOptionalStore","borderWidthClasses","borderColorClasses","WidgetLoadingSkeleton","ErrorState","Coins","ChevronDown","getFontSizeField","getColorField","getPaddingField","getBorderRadiusField","getBorderWidthField","getBorderColorField"],"sources":["../../core/src/format/title-case.ts","../../widgets/src/hooks/use-points-ledger.preview.ts","../../widgets/src/hooks/use-points-ledger.ts","../../react/src/hooks/use-points-label.ts","../../widgets/src/widgets/PointsWidget.tsx"],"sourcesContent":["/**\n * Turn a snake_case value into Title Case words, e.g. `order_redemption` ->\n * `Order Redemption`. Only the first character of each word is upper-cased; the\n * rest is left verbatim.\n *\n * Shared by the portal points-history surfaces (PointsWidget, ProfileLayout) so\n * they render labels like points-ledger transaction types identically. The\n * standalone apps (fluid-pay, fluid-checkout) and profile-ui intentionally keep\n * their own transaction-type formatters — they live in separate translation\n * domains and aren't consolidated here.\n */\nexport function titleCaseFromSnake(value: string): string {\n return value\n .split(\"_\")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n}\n","import type { PointsData } from \"@fluid-app/portal-core/widgets-api-types\";\n\nconst now = new Date();\n\nfunction daysAgo(days: number): string {\n return new Date(now.getTime() - days * 86_400_000).toISOString();\n}\n\nexport const PREVIEW_DATA: PointsData = {\n balance: 25,\n entries: [\n {\n id: 1,\n amount: 20,\n createdAt: daysAgo(3),\n transactionType: \"new_order\",\n hasSource: true,\n },\n {\n id: 2,\n amount: 50,\n createdAt: daysAgo(14),\n transactionType: \"referral_bonus\",\n hasSource: true,\n },\n {\n id: 3,\n amount: -75,\n createdAt: daysAgo(60),\n transactionType: null,\n hasSource: true,\n },\n {\n id: 4,\n amount: 30,\n createdAt: daysAgo(90),\n transactionType: \"welcome_reward\",\n hasSource: true,\n },\n ],\n};\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useWidgetsApi } from \"@fluid-app/portal-core/widgets-api-context\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-react/data-sources/preview-context\";\nimport { useDataSourceRegistryConfig } from \"@fluid-app/portal-react/data-sources/registry-context\";\nimport { PREVIEW_DATA } from \"./use-points-ledger.preview\";\nimport type { PointsData } from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport type {\n PointsData,\n PointsEntry,\n} from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport const POINTS_LEDGER_QUERY_KEY = \"points-ledger\" as const;\n\nexport function usePointsLedger(): UseQueryResult<PointsData, Error> {\n const widgetsApi = useWidgetsApi();\n const { isPreview } = useWidgetPreviewContext();\n const registryConfig = useDataSourceRegistryConfig();\n const { baseUrl } = registryConfig;\n const customerId = registryConfig.variables?.customer_id;\n\n // Contract: the BFF adapter (portal app, composite factory spreads BFF over\n // legacy) ignores customerId and infers the customer from the JWT, so the\n // portal renders this widget with no registry-variable plumbing. The legacy\n // adapter (fluid-admin) builds /v202506/customers/{customerId}/points_ledgers\n // and MUST receive a real id; that consumer always supplies one via registry\n // variables, so empty string never reaches the legacy URL in practice. If a\n // future caller wires this hook to a legacy-only adapter, configure\n // registry variables.customer_id at the provider — otherwise the request\n // would 404 on /customers//points_ledgers.\n return useQuery({\n queryKey: [\n \"portal-widget-use\",\n POINTS_LEDGER_QUERY_KEY,\n isPreview ? \"preview\" : baseUrl,\n customerId ?? null,\n ] as const,\n queryFn: ({ signal }) =>\n widgetsApi.fetchPointsLedger(customerId ?? \"\", signal),\n enabled: !isPreview,\n ...(isPreview && { placeholderData: PREVIEW_DATA }),\n });\n}\n","import { useMemo } from \"react\";\nimport { useOptionalStore } from \"./use-optional-store\";\n\nexport interface PointsLabel {\n singular: string;\n plural: string;\n}\n\n/**\n * Platform defaults, mirroring the backend column defaults. Used whenever the\n * store is unavailable (preview/builder) or a company hasn't overridden the\n * label.\n */\nexport const DEFAULT_POINTS_LABEL: PointsLabel = {\n singular: \"point\",\n plural: \"points\",\n};\n\n/**\n * Resolves the per-company reward-points label for use across portal surfaces\n * (widgets, order details, etc.).\n *\n * Reads the store via `useOptionalStore()`, which is preview-safe: the widget\n * palette / drag-preview mounts widgets without a StoreApiProvider, so the\n * underlying query is disabled and we fall back to the platform defaults. The\n * shared hook reuses `useStore()`'s cache key, so the result is deduped with\n * the rest of the app's store cache.\n */\nexport function usePointsLabel(): PointsLabel {\n const { data } = useOptionalStore();\n\n // `.trim() ||` (not `??`) so a blank/whitespace-only tenant label falls back\n // to the platform default instead of rendering an empty string — matching the\n // fluid-pay / fluid-checkout points-label helpers.\n const singular =\n data?.reward_points_label_singular?.trim() || DEFAULT_POINTS_LABEL.singular;\n const plural =\n data?.reward_points_label_plural?.trim() || DEFAULT_POINTS_LABEL.plural;\n\n return useMemo(() => ({ singular, plural }), [singular, plural]);\n}\n","import { useId, useState, type ComponentProps } from \"react\";\nimport type React from \"react\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport { titleCaseFromSnake } from \"@fluid-app/portal-core/format/title-case\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n getColorField,\n getFontSizeField,\n getPaddingField,\n borderWidthClasses,\n borderColorClasses,\n} from \"../core/fields\";\nimport { usePointsLedger, type PointsEntry } from \"../hooks/use-points-ledger\";\nimport { usePointsLabel } from \"@fluid-app/portal-react/hooks/use-points-label\";\nimport { ErrorState } from \"../components/error-state\";\nimport { WidgetLoadingSkeleton } from \"../components/WidgetLoadingSkeleton\";\nimport { ChevronDown, Coins } from \"lucide-react\";\n\nconst formatBalance = (balance: number): string => {\n return balance.toLocaleString(\"en-US\");\n};\n\n/** Capitalize the first letter for display in headings / sentence-leading copy. */\nconst capitalize = (value: string): string =>\n value.charAt(0).toUpperCase() + value.slice(1);\n\nexport function formatTransactionType(\n entry: PointsEntry,\n pluralLabel: string,\n): string {\n // Rails stamps \"order_credit\" on an order's points accrual. That is the same\n // event the hasSource branch below renders, so it keeps the company's own\n // points label instead of falling through to the generic type name.\n //\n // Handled directly rather than by falling through, matching the profile,\n // checkout and pay formatters. hasSource is set only when metadata.source is\n // present, and the public ledger endpoint passes client metadata through\n // verbatim, so a typed entry can arrive without one and must still be\n // branded rather than read \"Transaction\".\n if (entry.transactionType === \"order_credit\") {\n return entry.amount > 0\n ? `${pluralLabel} Awarded`\n : `${pluralLabel} Redeemed`;\n }\n if (entry.transactionType) {\n return titleCaseFromSnake(entry.transactionType);\n }\n if (entry.hasSource) {\n return entry.amount > 0\n ? `${pluralLabel} Awarded`\n : `${pluralLabel} Redeemed`;\n }\n return \"Transaction\";\n}\n\nfunction formatEntryDate(dateString: string): string {\n if (!dateString) return \"\";\n const date = new Date(dateString);\n return date.toLocaleDateString(undefined, {\n month: \"short\",\n day: \"numeric\",\n year: \"numeric\",\n });\n}\n\ntype PointsWidgetProps = ComponentProps<\"div\"> & {\n // Title\n titleEnabled?: boolean;\n title?: string;\n titleFontSize?: FontSizeOptions;\n titleColor?: ColorOptions;\n\n // Balance\n balanceColor?: ColorOptions;\n\n // History\n historyEnabled?: boolean;\n historyTitle?: string;\n\n // Styling\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n};\n\nfunction PointsEntryRow({\n entry,\n isLast,\n textColor,\n accentColor,\n backgroundColor,\n pointsLabelPlural,\n}: {\n entry: PointsEntry;\n isLast: boolean;\n textColor: ColorOptions;\n accentColor: ColorOptions;\n backgroundColor: ColorOptions;\n pointsLabelPlural: string;\n}) {\n const isPositive = entry.amount >= 0;\n const prefix = isPositive ? \"+\" : \"\";\n return (\n <div className=\"flex flex-row items-stretch gap-3\">\n <div className=\"relative flex w-2 flex-col items-center\">\n {!isLast && (\n <div\n className={`bg-${textColor}/40 absolute top-3 -bottom-3 left-1/2 w-px -translate-x-1/2`}\n />\n )}\n <div\n className={`border-${textColor}/60 bg-${backgroundColor} relative mt-3 h-2 w-2 shrink-0 rounded-full border`}\n />\n </div>\n <div className=\"flex flex-1 flex-row items-start justify-between py-1.5\">\n <div className=\"flex min-w-0 flex-col\">\n <div className={`text-sm font-medium text-${textColor} truncate`}>\n {formatTransactionType(entry, pointsLabelPlural)}\n </div>\n <div className={`text-sm text-${textColor} opacity-70`}>\n {formatEntryDate(entry.createdAt)}\n </div>\n </div>\n <div\n className={`text-sm font-medium ${isPositive ? `text-${accentColor}` : \"text-destructive\"}`}\n >\n {prefix}\n {entry.amount.toLocaleString(\"en-US\")}\n </div>\n </div>\n </div>\n );\n}\n\nexport function PointsWidget({\n // Title\n titleEnabled = true,\n title,\n titleFontSize = \"md\",\n titleColor = \"foreground\",\n\n // Balance\n balanceColor = \"primary\",\n\n // History\n historyEnabled = true,\n historyTitle = \"History\",\n\n // Styling\n background = { type: \"solid\", color: \"background\" },\n textColor = \"foreground\",\n accentColor = \"primary\",\n padding = 4,\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n\n className,\n ...props\n}: PointsWidgetProps): React.JSX.Element {\n const [historyOpen, setHistoryOpen] = useState(false);\n const historyPanelId = useId();\n\n // Per-company reward-points label (falls back to \"points\"). Used as the\n // default heading and in empty/transaction copy when the admin hasn't set a\n // custom title.\n const { plural } = usePointsLabel();\n const pointsLabelPlural = capitalize(plural);\n\n const backgroundColor = background.color || \"background\";\n const backgroundImage =\n (background.resource?.image_url || background.resource?.imageUrl) &&\n background.type === \"image\"\n ? `url(${background.resource.image_url || background.resource.imageUrl})`\n : \"none\";\n\n const { data, isLoading, isError } = usePointsLedger();\n\n return (\n <div\n className={`@container overflow-hidden rounded-${borderRadius} bg-${backgroundColor} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${className ?? \"\"}`}\n style={{ backgroundImage }}\n {...props}\n >\n <div className={`p-${padding} flex flex-col gap-2.5`}>\n {/* Header: Title + Balance */}\n {titleEnabled && (\n <h2\n className={`text-${titleFontSize} font-header font-bold text-${titleColor}`}\n >\n {title?.trim() ? title : pointsLabelPlural}\n </h2>\n )}\n {!isLoading && data && (\n <span\n className={`text-3xl font-semibold text-${balanceColor} font-header leading-snug`}\n >\n {formatBalance(data.balance)}\n </span>\n )}\n\n {/* Loading */}\n {isLoading ? (\n <WidgetLoadingSkeleton minHeight={60} rows={1} />\n ) : isError ? (\n <ErrorState />\n ) : historyEnabled && (!data || data.entries.length === 0) ? (\n /* Empty state — only shown when history is enabled but no entries */\n <div className=\"flex min-h-[60px] flex-col items-center justify-center gap-2\">\n <Coins className={`size-10 text-${textColor} opacity-30`} />\n <p className={`text-sm font-semibold text-${textColor} opacity-50`}>\n No {pointsLabelPlural} Activity\n </p>\n </div>\n ) : historyEnabled && data && data.entries.length > 0 ? (\n /* History dropdown */\n <div className=\"flex flex-col gap-2\">\n {/* Dropdown toggle */}\n <button\n type=\"button\"\n aria-expanded={historyOpen}\n aria-controls={historyPanelId}\n onClick={() => setHistoryOpen((prev) => !prev)}\n className={`flex w-full items-center text-xs font-semibold text-${textColor} cursor-pointer`}\n >\n <span className=\"flex-1 text-left\">{historyTitle}</span>\n <ChevronDown\n className={`size-4 transition-transform duration-200 ${historyOpen ? \"rotate-180\" : \"\"}`}\n />\n </button>\n <div className={`bg-${textColor}/20 h-px w-full`} />\n\n {/* Collapsible entries */}\n <div\n id={historyPanelId}\n className={`flex flex-col ${!historyOpen ? \"hidden\" : \"\"}`}\n >\n {data.entries.map((entry, index) => (\n <PointsEntryRow\n key={entry.id}\n entry={entry}\n isLast={index === data.entries.length - 1}\n textColor={textColor}\n accentColor={accentColor}\n backgroundColor={backgroundColor}\n pointsLabelPlural={pointsLabelPlural}\n />\n ))}\n </div>\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n\nexport const pointsWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"PointsWidget\",\n displayName: \"Points\",\n fields: [\n // Title group\n {\n key: \"titleEnabled\",\n label: \"Show Title\",\n type: \"boolean\",\n description: \"Toggle title visibility\",\n defaultValue: true,\n\n group: \"Title\",\n },\n {\n key: \"title\",\n label: \"Title\",\n type: \"text\",\n description:\n \"Title text displayed above the balance. Leave blank to use the company's configured points label.\",\n defaultValue: \"\",\n\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n getFontSizeField({\n key: \"titleFontSize\",\n label: \"Title Font Size\",\n description: \"Font size for the title\",\n defaultValue: \"md\",\n\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getColorField({\n key: \"titleColor\",\n label: \"Title Color\",\n description: \"Color for the title\",\n defaultValue: \"foreground\",\n\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n\n // Balance group\n getColorField({\n key: \"balanceColor\",\n label: \"Balance Color\",\n description: \"Color for the points balance number\",\n defaultValue: \"primary\",\n\n group: \"Balance\",\n }),\n\n // History group\n {\n key: \"historyEnabled\",\n label: \"Show History\",\n type: \"boolean\",\n description: \"Show a collapsible history dropdown below the balance\",\n defaultValue: true,\n\n group: \"History\",\n },\n {\n key: \"historyTitle\",\n label: \"History Title\",\n type: \"text\",\n description: \"Title for the history dropdown\",\n defaultValue: \"History\",\n\n group: \"History\",\n requiresKeyToBeTrue: \"historyEnabled\",\n },\n\n // Design group\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the widget\",\n defaultValue: { type: \"solid\", color: \"background\" },\n\n group: \"Design\",\n },\n getColorField({\n key: \"textColor\",\n label: \"Text Color\",\n description: \"Default text color\",\n defaultValue: \"foreground\",\n\n group: \"Design\",\n }),\n getColorField({\n key: \"accentColor\",\n label: \"Accent Color\",\n description: \"Color for positive points amounts\",\n defaultValue: \"primary\",\n\n group: \"Design\",\n }),\n {\n key: \"separator\",\n type: \"separator\",\n label: \"Separator\",\n\n group: \"Design\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Widget padding\",\n defaultValue: 4,\n\n group: \"Design\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Widget border radius\",\n defaultValue: \"md\",\n\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Widget border width\",\n defaultValue: \"none\",\n\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Widget border color\",\n defaultValue: \"muted\",\n\n group: \"Design\",\n }),\n ],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAWA,SAAgB,mBAAmB,OAAuB;AACxD,QAAO,MACJ,MAAM,IAAI,CACV,KAAK,SAAS,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE,CAAC,CAC3D,KA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