@telegraph/helpers 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @telegraph/helpers
2
+
3
+ ## 0.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#73](https://github.com/knocklabs/telegraph/pull/73) [`0aa9613`](https://github.com/knocklabs/telegraph/commit/0aa9613512ac4fa6073bcf2542b3f67216ad1e7e) Thanks [@kylemcd](https://github.com/kylemcd)! - tag types fixes + helper types
package/README.md ADDED
@@ -0,0 +1,8 @@
1
+ ![Telegraph by Knock](https://github.com/knocklabs/telegraph/assets/29106675/9b5022e3-b02c-4582-ba57-3d6171e45e44)
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@telegraph/helpers.svg)](https://www.npmjs.com/package/@telegraph/helpers)
4
+
5
+ # @telegraph/helpers
6
+ > Internal helpers for use in telegraph
7
+
8
+
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export type { Required, AsProp, PropsWithAs, Optional } from "./types/utility";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ export type Required<T, K = Record<string, unknown>> = K extends keyof T ? Omit<T, K> & Required<Pick<T, K>> : {
3
+ [P in keyof T]-?: T[P];
4
+ };
5
+ export type Optional<T, K extends keyof T> = K extends keyof T ? Omit<T, K> & Partial<Pick<T, K>> : {
6
+ [P in keyof T]?: T[P];
7
+ };
8
+ export type AsProp<C extends React.ElementType> = {
9
+ as?: C;
10
+ };
11
+ export type PropsWithAs<C extends React.ElementType, P> = AsProp<C> & Omit<React.ComponentProps<C>, keyof AsProp<C>> & P;
12
+ //# sourceMappingURL=utility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utility.d.ts","sourceRoot":"","sources":["../../../src/types/utility.ts"],"names":[],"mappings":";AACA,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,GACpE,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GACjC;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAG/B,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,GAC1D,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAChC;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAK9B,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,IAAI;IAChD,EAAE,CAAC,EAAE,CAAC,CAAC;CACR,CAAC;AASF,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GACjE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,MAAM,MAAM,CAAC,CAAC,CAAC,CAAC,GAC9C,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@telegraph/helpers",
3
+ "version": "0.0.1",
4
+ "repository": "https://github.com/knocklabs/telegraph/tree/main/packages/helpers",
5
+ "author": "@knocklabs",
6
+ "license": "MIT",
7
+ "main": "./dist/cjs/index.js",
8
+ "module": "./dist/esm/index.mjs",
9
+ "types": "./dist/types/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "import": "./dist/esm/index.mjs",
13
+ "require": "./dist/cjs/index.js",
14
+ "types": "./dist/types/index.d.ts"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "README.md"
20
+ ],
21
+ "prettier": "@telegraph/prettier-config",
22
+ "scripts": {
23
+ "clean": "rm -rf dist",
24
+ "dev": "vite build --watch --emptyOutDir false",
25
+ "build": "yarn clean && vite build",
26
+ "coverage": "vitest run --coverage",
27
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
28
+ "format": "prettier \"src/**/*.{js,ts,tsx}\" --write",
29
+ "format:check": "prettier \"src/**/*.{js,ts,tsx}\" --check",
30
+ "preview": "vite preview"
31
+ },
32
+ "devDependencies": {
33
+ "@knocklabs/eslint-config": "^0.0.3",
34
+ "@knocklabs/typescript-config": "^0.0.2",
35
+ "@telegraph/prettier-config": "^0.0.6",
36
+ "@telegraph/vite-config": "^0.0.8",
37
+ "@types/react": "^18.2.48",
38
+ "eslint": "^8.56.0",
39
+ "react": "^18.2.0",
40
+ "react-dom": "^18.2.0",
41
+ "typescript": "^5.3.3",
42
+ "vite": "^5.0.12"
43
+ },
44
+ "peerDependencies": {
45
+ "react": "^18.2.0",
46
+ "react-dom": "^18.2.0"
47
+ }
48
+ }