datocms-plugin-untitledui-icon-picker 0.0.2
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/LICENSE.txt +21 -0
- package/README.md +59 -0
- package/dist/assets/index-PU6S9dAw.js +9 -0
- package/dist/assets/index-XxcJWoqZ.css +1 -0
- package/dist/index.html +13 -0
- package/docs/.gitkeep +0 -0
- package/docs/cover.png +0 -0
- package/package.json +70 -0
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 November Five
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# DatoCMS plugin: Untitled UI icon picker
|
|
2
|
+
|
|
3
|
+
A DatoCMS field editor plugin that lets editors pick an icon from the [Untitled UI](https://www.untitledui.com/) icon set and stores the icon name as a plain string. Pair it with a frontend that looks the chosen name up against `@untitledui/icons` to render the matching component.
|
|
4
|
+
|
|
5
|
+
## Head ups
|
|
6
|
+
|
|
7
|
+
- The plugin stores **the icon name as a string** (e.g. `Star01`). It does not store SVG markup, props, or sizing. Your frontend is responsible for resolving the name to a React component.
|
|
8
|
+
- Designed for **single-string fields** only (`fieldTypes: ['string']`).
|
|
9
|
+
- Bundled icon list is generated from `@untitledui/icons` at build time. If your frontend is pinned to a different version of `@untitledui/icons`, picked names may not exist there — keep the versions in lockstep.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
Install via the DatoCMS marketplace:
|
|
14
|
+
|
|
15
|
+
1. In your DatoCMS project, go to **Settings → Plugins → Add new plugin**.
|
|
16
|
+
2. Search for `Untitled UI icon picker` and install it.
|
|
17
|
+
|
|
18
|
+
Then, on any **single-line string** field where you want the picker:
|
|
19
|
+
|
|
20
|
+
1. Open the field's settings.
|
|
21
|
+
2. Under **Presentation**, set the editor to **Untitled UI icon picker**.
|
|
22
|
+
3. Save.
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
In your frontend, resolve the stored name back to an icon component:
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import * as Icons from '@untitledui/icons';
|
|
30
|
+
import type { FC, SVGProps } from 'react';
|
|
31
|
+
|
|
32
|
+
type IconComponent = FC<SVGProps<SVGSVGElement> & { size?: number }>;
|
|
33
|
+
const registry = Icons as unknown as Record<string, IconComponent>;
|
|
34
|
+
|
|
35
|
+
export const Icon = ({ name, size = 24 }: { name: string; size?: number }) => {
|
|
36
|
+
const Cmp = registry[name];
|
|
37
|
+
if (!Cmp) return null;
|
|
38
|
+
return <Cmp size={size} />;
|
|
39
|
+
};
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Contributing
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
nvm use
|
|
46
|
+
npm install
|
|
47
|
+
npm run dev # vite dev server on :5173
|
|
48
|
+
npm run build # builds dist/ — what gets shipped to the marketplace
|
|
49
|
+
npm run lint
|
|
50
|
+
npm run typecheck
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
To test the plugin against a real DatoCMS project before publishing, add it as a **private plugin** in that project's settings pointing at your local dev server URL.
|
|
54
|
+
|
|
55
|
+
Releases are cut from `main` via the **Release** GitHub Action (`workflow_dispatch`), which uses `release-it` to bump the version, generate `CHANGELOG.md`, tag, and `npm publish`. The DatoCMS marketplace picks up new versions automatically within an hour.
|
|
56
|
+
|
|
57
|
+
## License
|
|
58
|
+
|
|
59
|
+
[MIT](./LICENSE.txt) © November Five
|