@uniformdev/context-ui 14.2.1-alpha.177
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 +188 -0
- package/dist/index.esm.js +1 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/dist/tailwind/plugin.d.ts +3 -0
- package/dist/tailwind/plugin.js +6 -0
- package/dist/tailwind/plugin.mjs +6 -0
- package/package.json +85 -0
- package/readme.md +34 -0
package/package.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@uniformdev/context-ui",
|
|
3
|
+
"version": "14.2.1-alpha.177+e3102741f",
|
|
4
|
+
"description": "React-based functionality and components for Uniform Context",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.esm.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"node": "./dist/index.mjs",
|
|
12
|
+
"default": "./dist/index.esm.js"
|
|
13
|
+
},
|
|
14
|
+
"require": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./tailwind": {
|
|
17
|
+
"import": {
|
|
18
|
+
"node": "./dist/tailwind/plugin.mjs"
|
|
19
|
+
},
|
|
20
|
+
"require": "./dist/tailwind/plugin.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"typesVersions": {
|
|
24
|
+
"*": {
|
|
25
|
+
"*": [
|
|
26
|
+
"./dist/index.d.ts"
|
|
27
|
+
],
|
|
28
|
+
"tailwind": [
|
|
29
|
+
"./dist/tailwind/plugin.d.ts"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"sideEffects": false,
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "run-s build:icons build:esm",
|
|
36
|
+
"build:esm": "tsup --minify",
|
|
37
|
+
"build:icons": "svgr -d ./src/assets ./src/assets --typescript --icon",
|
|
38
|
+
"dev": "tsup --watch",
|
|
39
|
+
"clean": "rimraf dist",
|
|
40
|
+
"test": "jest --maxWorkers=1 --passWithNoTests",
|
|
41
|
+
"lint": "eslint \"src/**/*.{js,ts,tsx}\"",
|
|
42
|
+
"format": "prettier --write \"src/**/*.{js,ts,tsx}\"",
|
|
43
|
+
"storybook": "pnpm build && start-storybook -p 9011 -c ./.storybook",
|
|
44
|
+
"storybook:publish": "pnpm build && pnpm build-storybook -o ./out"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@uniformdev/context": "^14.2.1-alpha.177+e3102741f",
|
|
48
|
+
"immer": "9.0.12",
|
|
49
|
+
"react-beautiful-dnd": "13.1.0",
|
|
50
|
+
"react-select": "5.2.2",
|
|
51
|
+
"react-use": "17.3.2",
|
|
52
|
+
"reakit": "1.3.11",
|
|
53
|
+
"timeago.js": "4.0.2",
|
|
54
|
+
"uuid": "8.3.2"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"react": ">=16.8"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@babel/core": "7.17.5",
|
|
61
|
+
"@storybook/addon-controls": "6.4.19",
|
|
62
|
+
"@storybook/addon-essentials": "6.4.19",
|
|
63
|
+
"@storybook/addon-postcss": "2.0.0",
|
|
64
|
+
"@storybook/builder-webpack5": "^6.5.0-alpha.48",
|
|
65
|
+
"@storybook/manager-webpack5": "^6.5.0-alpha.48",
|
|
66
|
+
"@storybook/react": "6.4.19",
|
|
67
|
+
"@svgr/cli": "6.2.1",
|
|
68
|
+
"@tailwindcss/forms": "0.5.0",
|
|
69
|
+
"@types/react-beautiful-dnd": "13.1.2",
|
|
70
|
+
"autoprefixer": "10.4.2",
|
|
71
|
+
"postcss": "8.4.8",
|
|
72
|
+
"postcss-import": "14.0.2",
|
|
73
|
+
"react": "17.0.2",
|
|
74
|
+
"react-dom": "17.0.2",
|
|
75
|
+
"tailwindcss": "3.0.23",
|
|
76
|
+
"webpack": "5"
|
|
77
|
+
},
|
|
78
|
+
"files": [
|
|
79
|
+
"/dist"
|
|
80
|
+
],
|
|
81
|
+
"publishConfig": {
|
|
82
|
+
"access": "public"
|
|
83
|
+
},
|
|
84
|
+
"gitHead": "e3102741f79fa495dba2796f59e3b2a6734c3c7e"
|
|
85
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Development notes
|
|
2
|
+
|
|
3
|
+
## Developing
|
|
4
|
+
* Copy/past `.env.example` and rename to `.env`, set up your project id, host, and API key.
|
|
5
|
+
* `pnpm storybook` - run storybook app on http://localhost:9011/, is used for creating and editing components.
|
|
6
|
+
|
|
7
|
+
## Icon component
|
|
8
|
+
Icon component can be is used only as a child of IconsProvider component.
|
|
9
|
+
|
|
10
|
+
## Build
|
|
11
|
+
* `pnpm build` - builds icons, JS modules, and CSS.
|
|
12
|
+
|
|
13
|
+
## CSS
|
|
14
|
+
This package uses Tailwind CSS. Run `pnpm build:css` to compile the CSS file, which will run PostCSS with the Tailwind plugin against all `.css` files in the `assets` folder. The compiled CSS will be output to `dist/assets/[filename].css`.
|
|
15
|
+
|
|
16
|
+
When Sanity Studio imports the JS modules exported by our plugin, the Sanity Studio bundler will also automatically import any CSS files that our code imports, e.g. `import '../dist/assets/optimize.css';`
|
|
17
|
+
|
|
18
|
+
> NOTE: be sure to set NODE_ENV=production if you want PostCSS to purge unused CSS.
|
|
19
|
+
|
|
20
|
+
## Icons
|
|
21
|
+
If you want to import SVG icons as components in your code, do the following:
|
|
22
|
+
|
|
23
|
+
* Add the the SVG icon to the `src/assets` folder
|
|
24
|
+
* Run `pnpm build:icons`
|
|
25
|
+
|
|
26
|
+
This will generate React components for every SVG icon in the `src/assets` folder. You can then import the icons in other React components, e.g. `import MyIcon from '../assets/MyIcon';`.
|
|
27
|
+
|
|
28
|
+
Ideally, we could have `import MyIcon from '../assets/my-icon.svg` in our code and the SVG icon would automatically be converted to a React component at build time and our source code would be transformed to import the component. However, we're not using a bundler so it becomes challenging because we can't "hook" into the TypeScript build/transpile process. We could introduce a build tool like `ESBuild` or `@babel/typescript` and stop using `tsc`, but those options more tooling/overhead. We could also potentially use something like `ttypescript` (https://github.com/cevek/ttypescript) to create babel-esque plugins for TypeScript, but who knows how reliable that is and if we'd run into any issues in CI/testing.
|
|
29
|
+
|
|
30
|
+
So, for now, icons are somewhat of a manual process.
|
|
31
|
+
|
|
32
|
+
## CommonJS
|
|
33
|
+
|
|
34
|
+
No CommonJS modules are exported from this package as the package is intended to be consumed by Sanity Studio and not used during SSR.
|