@molecule/app-settings-panel-react 1.0.2 → 1.0.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationsSection.d.ts","sourceRoot":"","sources":["../src/NotificationsSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAchC;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,IAAI,GAAG,CAAC,OAAO,CAiGlD"}
1
+ {"version":3,"file":"NotificationsSection.d.ts","sourceRoot":"","sources":["../src/NotificationsSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAchC;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,IAAI,GAAG,CAAC,OAAO,CAoGlD"}
@@ -89,5 +89,5 @@ export function NotificationsSection() {
89
89
  setBusy(false);
90
90
  }
91
91
  };
92
- return (_jsxs("section", { children: [_jsx("h3", { className: cm.cn(cm.sectionHeading, cm.sp('mb', 3)), children: t('settings.notifications') }), _jsxs(Flex, { align: "center", justify: "between", children: [_jsx("span", { className: cm.textSize('sm'), children: t('settings.pushNotifications') }), _jsx(Switch, { checked: enabled, disabled: busy, onChange: (e) => handleToggle(e.target.checked), size: "sm", "data-mol-id": "settings-push-toggle" })] }), error ? (_jsx("p", { className: cm.cn(cm.textSize('xs'), cm.textError, cm.sp('mt', 1)), role: "alert", "data-mol-id": "settings-push-error", children: error })) : null] }));
92
+ return (_jsxs("section", { children: [_jsx("h3", { className: cm.cn(cm.sectionHeading, cm.sp('mb', 3)), children: t('settings.notifications') }), _jsxs(Flex, { align: "center", justify: "between", children: [_jsx("span", { className: cm.textSize('sm'), children: t('settings.pushNotifications') }), _jsx(Switch, { checked: enabled, disabled: busy, "aria-label": t('settings.pushNotifications'), onChange: (e) => handleToggle(e.target.checked), size: "sm", "data-mol-id": "settings-push-toggle" })] }), error ? (_jsx("p", { className: cm.cn(cm.textSize('xs'), cm.textError, cm.sp('mt', 1)), role: "alert", "data-mol-id": "settings-push-error", children: error })) : null] }));
93
93
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TiersUpgradeSection.d.ts","sourceRoot":"","sources":["../src/TiersUpgradeSection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAuB,MAAM,OAAO,CAAA;AAkBrD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,IAAI,GAAG,CAAC,OAAO,CA4LjD"}
1
+ {"version":3,"file":"TiersUpgradeSection.d.ts","sourceRoot":"","sources":["../src/TiersUpgradeSection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAuB,MAAM,OAAO,CAAA;AAkBrD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,IAAI,GAAG,CAAC,OAAO,CA2LjD"}
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { useEffect, useState } from 'react';
3
3
  import { useHttpClient, useTranslation } from '@molecule/app-react';
4
4
  import { getClassMap } from '@molecule/app-ui';
5
- import { Alert, Button, Flex, Modal } from '@molecule/app-ui-react';
5
+ import { Alert, Button, ConfirmButton, Flex, Modal } from '@molecule/app-ui-react';
6
6
  /**
7
7
  * Billing section with full multi-tier upgrade flow.
8
8
  *
@@ -89,10 +89,6 @@ export function TiersUpgradeSection() {
89
89
  }
90
90
  };
91
91
  const handleCancelSubscription = async () => {
92
- if (!window.confirm(t('settings.billing.cancelConfirm', undefined, {
93
- defaultValue: 'Cancel your subscription?',
94
- })))
95
- return;
96
92
  setUpgradeError('');
97
93
  try {
98
94
  await http.post('/api/billing/cancel', {});
@@ -107,7 +103,9 @@ export function TiersUpgradeSection() {
107
103
  }));
108
104
  }
109
105
  };
110
- return (_jsxs(_Fragment, { children: [_jsxs("section", { children: [_jsx("h3", { className: cm.cn(cm.sectionHeading, cm.sp('mb', 3)), children: t('settings.billing', undefined, { defaultValue: 'Billing' }) }), _jsxs(Flex, { align: "center", justify: "between", children: [_jsxs("span", { className: cm.textSize('sm'), children: [t('settings.plan', undefined, { defaultValue: 'Plan' }), _jsx("strong", { children: plan })] }), planKey === 'free' ? (_jsx(Button, { variant: "outline", size: "sm", onClick: () => setShowUpgrade(true), children: t('settings.upgrade', undefined, { defaultValue: 'Upgrade' }) })) : (_jsx(Button, { variant: "outline", size: "sm", onClick: handleCancelSubscription, children: t('settings.billing.cancel', undefined, { defaultValue: 'Cancel' }) }))] })] }), _jsxs(Modal, { open: showUpgrade, onClose: () => setShowUpgrade(false), title: t('settings.billing.upgradeTitle', undefined, {
106
+ return (_jsxs(_Fragment, { children: [_jsxs("section", { children: [_jsx("h3", { className: cm.cn(cm.sectionHeading, cm.sp('mb', 3)), children: t('settings.billing', undefined, { defaultValue: 'Billing' }) }), _jsxs(Flex, { align: "center", justify: "between", children: [_jsxs("span", { className: cm.textSize('sm'), children: [t('settings.plan', undefined, { defaultValue: 'Plan' }), _jsx("strong", { children: plan })] }), planKey === 'free' ? (_jsx(Button, { variant: "outline", size: "sm", onClick: () => setShowUpgrade(true), children: t('settings.upgrade', undefined, { defaultValue: 'Upgrade' }) })) : (_jsx(ConfirmButton, { variant: "outline", size: "sm", label: t('settings.billing.cancel', undefined, { defaultValue: 'Cancel' }), confirmLabel: t('settings.billing.cancelConfirm', undefined, {
107
+ defaultValue: 'Cancel your subscription?',
108
+ }), onConfirm: handleCancelSubscription, "data-mol-id": "billing-cancel-subscription" }))] })] }), _jsxs(Modal, { open: showUpgrade, onClose: () => setShowUpgrade(false), title: t('settings.billing.upgradeTitle', undefined, {
111
109
  defaultValue: 'Upgrade your plan',
112
110
  }), children: [upgradeError ? (_jsx(Alert, { status: "error", className: cm.sp('mb', 4), children: upgradeError })) : null, tiers.length === 0 ? (_jsx("p", { className: cm.cn(cm.textSize('sm'), cm.textMuted), children: t('settings.billing.noTiers', undefined, {
113
111
  defaultValue: 'No paid plans configured.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-settings-panel-react",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Composable settings panel — a SettingsContainer + family of section sub-components (Account, Auth, Notifications, Billing, Devices, ThisDevice, LogOutDelete). Apps compose via JSX children, picking which sections to include and what order.",
5
5
  "homepage": "https://www.molecule.dev/packages/app-settings-panel-react",
6
6
  "type": "module",
@@ -38,9 +38,9 @@
38
38
  "typescript": "6.0.3",
39
39
  "vitest": "4.1.11",
40
40
  "@molecule/app-auth": "1.1.1",
41
- "@molecule/app-react": "1.5.1",
42
- "@molecule/app-ui": "1.1.1",
43
- "@molecule/app-ui-react": "1.0.2",
41
+ "@molecule/app-react": "1.6.0",
42
+ "@molecule/app-ui": "1.2.0",
43
+ "@molecule/app-ui-react": "1.2.0",
44
44
  "@types/react": "19.2.17",
45
45
  "react": "19.2.8",
46
46
  "react-router": "8.3.0"