@asteby/metacore-lib 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -6,4 +6,5 @@ export { formatCurrency, getCurrencySymbol, parseCurrency, SPANISH_SYMBOLS, } fr
6
6
  export type { CurrencyInfo } from './currency';
7
7
  export { handleServerError } from './errors';
8
8
  export type { ErrorLabels, ToastLike, LoggerLike } from './errors';
9
+ export { showSubmittedData } from './show-submitted-data';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,QAAQ,CAAA;AACf,YAAY,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAE1C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAEnD,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,eAAe,GAChB,MAAM,YAAY,CAAA;AACnB,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5C,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,QAAQ,CAAA;AACf,YAAY,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAE1C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAEnD,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,eAAe,GAChB,MAAM,YAAY,CAAA;AACnB,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5C,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAElE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA"}
package/dist/index.js CHANGED
@@ -2,4 +2,5 @@ export { formatDate, formatDistance, formatRelative, getAllTimezones, } from './
2
2
  export { formatNumber, formatPercentage, truncate } from './format';
3
3
  export { formatCurrency, getCurrencySymbol, parseCurrency, SPANISH_SYMBOLS, } from './currency';
4
4
  export { handleServerError } from './errors';
5
+ export { showSubmittedData } from './show-submitted-data';
5
6
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,QAAQ,CAAA;AAGf,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAGnE,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,eAAe,GAChB,MAAM,YAAY,CAAA;AAGnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,QAAQ,CAAA;AAGf,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAGnE,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,eAAe,GAChB,MAAM,YAAY,CAAA;AAGnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAG5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Render a sonner toast that pretty-prints the submitted form payload as
3
+ * JSON. Convenience helper used by demo / showcase forms; production flows
4
+ * should issue a real success toast rather than dumping the data.
5
+ *
6
+ * Requires `sonner` to be installed in the consuming app (it's an optional
7
+ * peer dependency of `@asteby/metacore-lib`).
8
+ */
9
+ export declare function showSubmittedData(data: unknown, title?: string): void;
10
+ //# sourceMappingURL=show-submitted-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"show-submitted-data.d.ts","sourceRoot":"","sources":["../src/show-submitted-data.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,OAAO,EACb,KAAK,GAAE,MAA8C,QAStD"}
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { toast } from 'sonner';
3
+ /**
4
+ * Render a sonner toast that pretty-prints the submitted form payload as
5
+ * JSON. Convenience helper used by demo / showcase forms; production flows
6
+ * should issue a real success toast rather than dumping the data.
7
+ *
8
+ * Requires `sonner` to be installed in the consuming app (it's an optional
9
+ * peer dependency of `@asteby/metacore-lib`).
10
+ */
11
+ export function showSubmittedData(data, title = 'You submitted the following values:') {
12
+ toast.message(title, {
13
+ description: (_jsx("pre", { className: 'mt-2 w-full overflow-x-auto rounded-md bg-slate-950 p-4', children: _jsx("code", { className: 'text-white', children: JSON.stringify(data, null, 2) }) })),
14
+ });
15
+ }
16
+ //# sourceMappingURL=show-submitted-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"show-submitted-data.js","sourceRoot":"","sources":["../src/show-submitted-data.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAE9B;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAAa,EACb,QAAgB,qCAAqC;IAErD,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE;QACnB,WAAW,EAAE,CACX,cAAK,SAAS,EAAC,yDAAyD,YACtE,eAAM,SAAS,EAAC,YAAY,YAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAQ,GAC/D,CACP;KACF,CAAC,CAAA;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asteby/metacore-lib",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Metacore utilities — date/currency/number formatting, error handling, cookies",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -35,21 +35,31 @@
35
35
  "./errors": {
36
36
  "types": "./dist/errors.d.ts",
37
37
  "import": "./dist/errors.js"
38
+ },
39
+ "./show-submitted-data": {
40
+ "types": "./dist/show-submitted-data.d.ts",
41
+ "import": "./dist/show-submitted-data.js"
38
42
  }
39
43
  },
40
44
  "peerDependencies": {
41
45
  "date-fns": ">=3",
46
+ "react": ">=18",
42
47
  "sonner": ">=1.7"
43
48
  },
44
49
  "peerDependenciesMeta": {
50
+ "react": {
51
+ "optional": true
52
+ },
45
53
  "sonner": {
46
54
  "optional": true
47
55
  }
48
56
  },
49
57
  "dependencies": {},
50
58
  "devDependencies": {
59
+ "@types/react": "^19.2.14",
51
60
  "date-fns": "^4.1.0",
52
- "sonner": "^1.7.0",
61
+ "react": "^19.2.4",
62
+ "sonner": "^2.0.0",
53
63
  "typescript": "^5.6.0"
54
64
  },
55
65
  "publishConfig": {