@ingredient-icons/core 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/README.md +9 -6
- package/dist/data.d.ts +1 -1
- package/dist/data.js +3 -3
- package/dist/index.d.ts +12 -5
- package/dist/index.js +12 -4
- package/icons/webp/128/en_balsamic-vinegar.webp +0 -0
- package/icons/webp/128/en_beef-broth.webp +0 -0
- package/icons/webp/128/en_bulgur.webp +0 -0
- package/icons/webp/128/en_camembert.webp +0 -0
- package/icons/webp/128/en_cashew-nuts.webp +0 -0
- package/icons/webp/128/en_cheese.webp +0 -0
- package/icons/webp/128/en_cherry-tomato.webp +0 -0
- package/icons/webp/128/en_chicken-fillet.webp +0 -0
- package/icons/webp/128/en_chicken-thigh.webp +0 -0
- package/icons/webp/128/en_chopped-tomato.webp +0 -0
- package/icons/webp/128/en_chorizo.webp +0 -0
- package/icons/webp/128/en_coconut.webp +0 -0
- package/icons/webp/128/en_coriander-seed.webp +0 -0
- package/icons/webp/128/en_corn.webp +0 -0
- package/icons/webp/128/en_cream-cheese.webp +0 -0
- package/icons/webp/128/en_curry-powder.webp +0 -0
- package/icons/webp/128/en_dill.webp +0 -0
- package/icons/webp/128/en_dough.webp +0 -0
- package/icons/webp/128/en_dried-thyme.webp +0 -0
- package/icons/webp/128/en_dried-tomatoes.webp +0 -0
- package/icons/webp/128/en_fish-sauce.webp +0 -0
- package/icons/webp/128/en_fish.webp +0 -0
- package/icons/webp/128/en_fruit.webp +0 -0
- package/icons/webp/128/en_green-olive.webp +0 -0
- package/icons/webp/128/en_harissa.webp +0 -0
- package/icons/webp/128/en_herb.webp +0 -0
- package/icons/webp/128/en_honey.webp +0 -0
- package/icons/webp/128/en_hummus.webp +0 -0
- package/icons/webp/128/en_kale.webp +0 -0
- package/icons/webp/128/en_ketchup.webp +0 -0
- package/icons/webp/128/en_kiwifruit.webp +0 -0
- package/icons/webp/128/en_nut.webp +0 -0
- package/icons/webp/128/en_oregano.webp +0 -0
- package/icons/webp/128/en_pak-choi.webp +0 -0
- package/icons/webp/128/en_pastry.webp +0 -0
- package/icons/webp/128/en_peanut.webp +0 -0
- package/icons/webp/128/en_pecorino.webp +0 -0
- package/icons/webp/128/en_pepper.webp +0 -0
- package/icons/webp/128/en_pesto.webp +0 -0
- package/icons/webp/128/en_pine-nuts.webp +0 -0
- package/icons/webp/128/en_pistachio-nuts.webp +0 -0
- package/icons/webp/128/en_pork.webp +0 -0
- package/icons/webp/128/en_poultry-broth.webp +0 -0
- package/icons/webp/128/en_pulse.webp +0 -0
- package/icons/webp/128/en_red-bean.webp +0 -0
- package/icons/webp/128/en_red-wine-vinegar.webp +0 -0
- package/icons/webp/128/en_rice-vinegar.webp +0 -0
- package/icons/webp/128/en_romaine-lettuce.webp +0 -0
- package/icons/webp/128/en_salad.webp +0 -0
- package/icons/webp/128/en_sauce.webp +0 -0
- package/icons/webp/128/en_sausage.webp +0 -0
- package/icons/webp/128/en_seed.webp +0 -0
- package/icons/webp/128/en_semolina.webp +0 -0
- package/icons/webp/128/en_sesame-oil.webp +0 -0
- package/icons/webp/128/en_sesame.webp +0 -0
- package/icons/webp/128/en_spice.webp +0 -0
- package/icons/webp/128/en_tortilla.webp +0 -0
- package/icons/webp/128/en_turmeric.webp +0 -0
- package/icons/webp/128/en_white-beans.webp +0 -0
- package/icons/webp/128/generic.webp +0 -0
- package/icons/webp/256/en_balsamic-vinegar.webp +0 -0
- package/icons/webp/256/en_beef-broth.webp +0 -0
- package/icons/webp/256/en_bulgur.webp +0 -0
- package/icons/webp/256/en_camembert.webp +0 -0
- package/icons/webp/256/en_cashew-nuts.webp +0 -0
- package/icons/webp/256/en_cheese.webp +0 -0
- package/icons/webp/256/en_cherry-tomato.webp +0 -0
- package/icons/webp/256/en_chicken-fillet.webp +0 -0
- package/icons/webp/256/en_chicken-thigh.webp +0 -0
- package/icons/webp/256/en_chopped-tomato.webp +0 -0
- package/icons/webp/256/en_chorizo.webp +0 -0
- package/icons/webp/256/en_coconut.webp +0 -0
- package/icons/webp/256/en_coriander-seed.webp +0 -0
- package/icons/webp/256/en_corn.webp +0 -0
- package/icons/webp/256/en_cream-cheese.webp +0 -0
- package/icons/webp/256/en_curry-powder.webp +0 -0
- package/icons/webp/256/en_dill.webp +0 -0
- package/icons/webp/256/en_dough.webp +0 -0
- package/icons/webp/256/en_dried-thyme.webp +0 -0
- package/icons/webp/256/en_dried-tomatoes.webp +0 -0
- package/icons/webp/256/en_fish-sauce.webp +0 -0
- package/icons/webp/256/en_fish.webp +0 -0
- package/icons/webp/256/en_fruit.webp +0 -0
- package/icons/webp/256/en_green-olive.webp +0 -0
- package/icons/webp/256/en_harissa.webp +0 -0
- package/icons/webp/256/en_herb.webp +0 -0
- package/icons/webp/256/en_honey.webp +0 -0
- package/icons/webp/256/en_hummus.webp +0 -0
- package/icons/webp/256/en_kale.webp +0 -0
- package/icons/webp/256/en_ketchup.webp +0 -0
- package/icons/webp/256/en_kiwifruit.webp +0 -0
- package/icons/webp/256/en_nut.webp +0 -0
- package/icons/webp/256/en_oregano.webp +0 -0
- package/icons/webp/256/en_pak-choi.webp +0 -0
- package/icons/webp/256/en_pastry.webp +0 -0
- package/icons/webp/256/en_peanut.webp +0 -0
- package/icons/webp/256/en_pecorino.webp +0 -0
- package/icons/webp/256/en_pepper.webp +0 -0
- package/icons/webp/256/en_pesto.webp +0 -0
- package/icons/webp/256/en_pine-nuts.webp +0 -0
- package/icons/webp/256/en_pistachio-nuts.webp +0 -0
- package/icons/webp/256/en_pork.webp +0 -0
- package/icons/webp/256/en_poultry-broth.webp +0 -0
- package/icons/webp/256/en_pulse.webp +0 -0
- package/icons/webp/256/en_red-bean.webp +0 -0
- package/icons/webp/256/en_red-wine-vinegar.webp +0 -0
- package/icons/webp/256/en_rice-vinegar.webp +0 -0
- package/icons/webp/256/en_romaine-lettuce.webp +0 -0
- package/icons/webp/256/en_salad.webp +0 -0
- package/icons/webp/256/en_sauce.webp +0 -0
- package/icons/webp/256/en_sausage.webp +0 -0
- package/icons/webp/256/en_seed.webp +0 -0
- package/icons/webp/256/en_semolina.webp +0 -0
- package/icons/webp/256/en_sesame-oil.webp +0 -0
- package/icons/webp/256/en_sesame.webp +0 -0
- package/icons/webp/256/en_spice.webp +0 -0
- package/icons/webp/256/en_tortilla.webp +0 -0
- package/icons/webp/256/en_turmeric.webp +0 -0
- package/icons/webp/256/en_white-beans.webp +0 -0
- package/icons/webp/256/generic.webp +0 -0
- package/icons/webp/64/en_balsamic-vinegar.webp +0 -0
- package/icons/webp/64/en_beef-broth.webp +0 -0
- package/icons/webp/64/en_bulgur.webp +0 -0
- package/icons/webp/64/en_camembert.webp +0 -0
- package/icons/webp/64/en_cashew-nuts.webp +0 -0
- package/icons/webp/64/en_cheese.webp +0 -0
- package/icons/webp/64/en_cherry-tomato.webp +0 -0
- package/icons/webp/64/en_chicken-fillet.webp +0 -0
- package/icons/webp/64/en_chicken-thigh.webp +0 -0
- package/icons/webp/64/en_chopped-tomato.webp +0 -0
- package/icons/webp/64/en_chorizo.webp +0 -0
- package/icons/webp/64/en_coconut.webp +0 -0
- package/icons/webp/64/en_coriander-seed.webp +0 -0
- package/icons/webp/64/en_corn.webp +0 -0
- package/icons/webp/64/en_cream-cheese.webp +0 -0
- package/icons/webp/64/en_curry-powder.webp +0 -0
- package/icons/webp/64/en_dill.webp +0 -0
- package/icons/webp/64/en_dough.webp +0 -0
- package/icons/webp/64/en_dried-thyme.webp +0 -0
- package/icons/webp/64/en_dried-tomatoes.webp +0 -0
- package/icons/webp/64/en_fish-sauce.webp +0 -0
- package/icons/webp/64/en_fish.webp +0 -0
- package/icons/webp/64/en_fruit.webp +0 -0
- package/icons/webp/64/en_green-olive.webp +0 -0
- package/icons/webp/64/en_harissa.webp +0 -0
- package/icons/webp/64/en_herb.webp +0 -0
- package/icons/webp/64/en_honey.webp +0 -0
- package/icons/webp/64/en_hummus.webp +0 -0
- package/icons/webp/64/en_kale.webp +0 -0
- package/icons/webp/64/en_ketchup.webp +0 -0
- package/icons/webp/64/en_kiwifruit.webp +0 -0
- package/icons/webp/64/en_nut.webp +0 -0
- package/icons/webp/64/en_oregano.webp +0 -0
- package/icons/webp/64/en_pak-choi.webp +0 -0
- package/icons/webp/64/en_pastry.webp +0 -0
- package/icons/webp/64/en_peanut.webp +0 -0
- package/icons/webp/64/en_pecorino.webp +0 -0
- package/icons/webp/64/en_pepper.webp +0 -0
- package/icons/webp/64/en_pesto.webp +0 -0
- package/icons/webp/64/en_pine-nuts.webp +0 -0
- package/icons/webp/64/en_pistachio-nuts.webp +0 -0
- package/icons/webp/64/en_pork.webp +0 -0
- package/icons/webp/64/en_poultry-broth.webp +0 -0
- package/icons/webp/64/en_pulse.webp +0 -0
- package/icons/webp/64/en_red-bean.webp +0 -0
- package/icons/webp/64/en_red-wine-vinegar.webp +0 -0
- package/icons/webp/64/en_rice-vinegar.webp +0 -0
- package/icons/webp/64/en_romaine-lettuce.webp +0 -0
- package/icons/webp/64/en_salad.webp +0 -0
- package/icons/webp/64/en_sauce.webp +0 -0
- package/icons/webp/64/en_sausage.webp +0 -0
- package/icons/webp/64/en_seed.webp +0 -0
- package/icons/webp/64/en_semolina.webp +0 -0
- package/icons/webp/64/en_sesame-oil.webp +0 -0
- package/icons/webp/64/en_sesame.webp +0 -0
- package/icons/webp/64/en_spice.webp +0 -0
- package/icons/webp/64/en_tortilla.webp +0 -0
- package/icons/webp/64/en_turmeric.webp +0 -0
- package/icons/webp/64/en_white-beans.webp +0 -0
- package/icons/webp/64/generic.webp +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
<b>
|
|
8
|
+
<b>324 soft 3D icons for recipe apps, keyed by the Open Food Facts taxonomy.</b><br>
|
|
9
9
|
Shallots, crème fraîche, salt and pepper each get their own, and anything else borrows its closest parent's.
|
|
10
10
|
</p>
|
|
11
11
|
|
|
@@ -53,25 +53,28 @@ export function Ingredient({ id, quantity, name }) {
|
|
|
53
53
|
URLs point to the exact release you installed on jsDelivr, so icons never change under you. Pass `baseUrl` to serve them from your own CDN or app bundle. Works in React, React Native, Node, Bun, Deno and anything else that shows images, with TypeScript types included.
|
|
54
54
|
|
|
55
55
|
```ts
|
|
56
|
-
import { findIcon, iconName, iconUrl } from "@ingredient-icons/core"
|
|
56
|
+
import { findIcon, GENERIC_ID, iconName, iconUrl } from "@ingredient-icons/core"
|
|
57
57
|
|
|
58
58
|
iconUrl("en:shallot", { size: 256 })
|
|
59
59
|
// https://cdn.jsdelivr.net/npm/@ingredient-icons/core@<version>/icons/webp/256/en_shallot.webp
|
|
60
60
|
|
|
61
|
-
findIcon("en:
|
|
61
|
+
findIcon("en:peeled-tomatoes") // { id: "en:tomato", file: "en_tomato", exact: false }
|
|
62
62
|
iconName("en:shallot", "fr") // "échalote"
|
|
63
|
-
findIcon("en:unicorn-steak") // undefined:
|
|
63
|
+
findIcon("en:unicorn-steak") // undefined: the fallback is yours
|
|
64
|
+
iconUrl("en:unicorn-steak") ?? iconUrl(GENERIC_ID) // the generic icon, a cluster of fresh ingredients
|
|
64
65
|
```
|
|
65
66
|
|
|
67
|
+
`GENERIC_ID` (`"generic"`) is a reserved id, not an Open Food Facts one: the icon to show when `findIcon` returns `undefined`, for an ingredient the taxonomy cannot place at all.
|
|
68
|
+
|
|
66
69
|
[React](https://ingredient-icons.vercel.app/docs/guides/react) · [React Native](https://ingredient-icons.vercel.app/docs/guides/react-native) · [Next.js](https://ingredient-icons.vercel.app/docs/guides/nextjs) · [Self-hosting](https://ingredient-icons.vercel.app/docs/guides/self-hosting) · [Without npm](https://ingredient-icons.vercel.app/docs/guides/without-npm) · [API reference](https://ingredient-icons.vercel.app/docs/reference/api)
|
|
67
70
|
|
|
68
71
|
## No icon of its own? It borrows its parent's
|
|
69
72
|
|
|
70
|
-
Ids follow the Open Food Facts taxonomy, which knows that fleur de sel is a sea salt and sea salt is a salt. When an ingredient has no icon, `findIcon` walks up its parents and takes the first one that has. That's how **
|
|
73
|
+
Ids follow the Open Food Facts taxonomy, which knows that fleur de sel is a sea salt and sea salt is a salt. When an ingredient has no icon, `findIcon` walks up its parents and takes the first one that has. That's how **324 icons cover 3,817 ingredients**.
|
|
71
74
|
|
|
72
75
|
<p>
|
|
73
76
|
<code>en:fleur-de-sel</code> → <code>en:sea-salt</code> → <img src="https://raw.githubusercontent.com/EBf-Studio/ingredient-icons/main/icons/png/128/en_salt.png" width="40" alt="" align="center"> <code>en:salt</code><br>
|
|
74
|
-
<code>en:
|
|
77
|
+
<code>en:peeled-tomatoes</code> → <img src="https://raw.githubusercontent.com/EBf-Studio/ingredient-icons/main/icons/png/128/en_tomato.png" width="40" alt="" align="center"> <code>en:tomato</code>
|
|
75
78
|
</p>
|
|
76
79
|
|
|
77
80
|
Try it with any ingredient [on the website](https://ingredient-icons.vercel.app).
|
package/dist/data.d.ts
CHANGED