@ssj4kyuubi/recipe-ui-lib 0.1.4
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 +128 -0
- package/dist/cjs/index-CJNMpFY7.js +1609 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +12 -0
- package/dist/cjs/rui-button.cjs.entry.js +31 -0
- package/dist/cjs/rui-filter-chips.cjs.entry.js +30 -0
- package/dist/cjs/rui-meal-planner.cjs.entry.js +52 -0
- package/dist/cjs/rui-modal.cjs.entry.js +52 -0
- package/dist/cjs/rui-recipe-card.cjs.entry.js +29 -0
- package/dist/cjs/rui-recipe-detail.cjs.entry.js +34 -0
- package/dist/cjs/rui-recipe-list.cjs.entry.js +44 -0
- package/dist/cjs/rui-search-bar.cjs.entry.js +39 -0
- package/dist/cjs/rui.cjs.js +24 -0
- package/dist/collection/collection-manifest.json +20 -0
- package/dist/collection/components/index.js +8 -0
- package/dist/collection/components/rui-button/rui-button.css +72 -0
- package/dist/collection/components/rui-button/rui-button.js +140 -0
- package/dist/collection/components/rui-filter-chips/rui-filter-chips.css +30 -0
- package/dist/collection/components/rui-filter-chips/rui-filter-chips.js +96 -0
- package/dist/collection/components/rui-meal-planner/rui-meal-planner.css +130 -0
- package/dist/collection/components/rui-meal-planner/rui-meal-planner.js +174 -0
- package/dist/collection/components/rui-modal/rui-modal.css +79 -0
- package/dist/collection/components/rui-modal/rui-modal.js +137 -0
- package/dist/collection/components/rui-recipe-card/rui-recipe-card.css +100 -0
- package/dist/collection/components/rui-recipe-card/rui-recipe-card.js +122 -0
- package/dist/collection/components/rui-recipe-detail/rui-recipe-detail.css +197 -0
- package/dist/collection/components/rui-recipe-detail/rui-recipe-detail.js +127 -0
- package/dist/collection/components/rui-recipe-list/rui-recipe-list.css +16 -0
- package/dist/collection/components/rui-recipe-list/rui-recipe-list.js +160 -0
- package/dist/collection/components/rui-search-bar/rui-search-bar.css +45 -0
- package/dist/collection/components/rui-search-bar/rui-search-bar.js +137 -0
- package/dist/collection/index.js +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/rui-button.d.ts +11 -0
- package/dist/components/rui-button.js +1 -0
- package/dist/components/rui-filter-chips.d.ts +11 -0
- package/dist/components/rui-filter-chips.js +1 -0
- package/dist/components/rui-meal-planner.d.ts +11 -0
- package/dist/components/rui-meal-planner.js +1 -0
- package/dist/components/rui-modal.d.ts +11 -0
- package/dist/components/rui-modal.js +1 -0
- package/dist/components/rui-recipe-card.d.ts +11 -0
- package/dist/components/rui-recipe-card.js +1 -0
- package/dist/components/rui-recipe-card2.js +1 -0
- package/dist/components/rui-recipe-detail.d.ts +11 -0
- package/dist/components/rui-recipe-detail.js +1 -0
- package/dist/components/rui-recipe-list.d.ts +11 -0
- package/dist/components/rui-recipe-list.js +1 -0
- package/dist/components/rui-search-bar.d.ts +11 -0
- package/dist/components/rui-search-bar.js +1 -0
- package/dist/esm/index-Cye74XUb.js +1599 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +10 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/rui-button.entry.js +29 -0
- package/dist/esm/rui-filter-chips.entry.js +28 -0
- package/dist/esm/rui-meal-planner.entry.js +50 -0
- package/dist/esm/rui-modal.entry.js +50 -0
- package/dist/esm/rui-recipe-card.entry.js +27 -0
- package/dist/esm/rui-recipe-detail.entry.js +32 -0
- package/dist/esm/rui-recipe-list.entry.js +42 -0
- package/dist/esm/rui-search-bar.entry.js +37 -0
- package/dist/esm/rui.js +20 -0
- package/dist/esm-es5/index-Cye74XUb.js +64 -0
- package/dist/esm-es5/index.js +0 -0
- package/dist/esm-es5/loader.js +1 -0
- package/dist/esm-es5/rui-button.entry.js +1 -0
- package/dist/esm-es5/rui-filter-chips.entry.js +1 -0
- package/dist/esm-es5/rui-meal-planner.entry.js +1 -0
- package/dist/esm-es5/rui-modal.entry.js +1 -0
- package/dist/esm-es5/rui-recipe-card.entry.js +1 -0
- package/dist/esm-es5/rui-recipe-detail.entry.js +1 -0
- package/dist/esm-es5/rui-recipe-list.entry.js +1 -0
- package/dist/esm-es5/rui-search-bar.entry.js +1 -0
- package/dist/esm-es5/rui.js +4 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/rui/index.esm.js +0 -0
- package/dist/rui/p-044c45e5.entry.js +1 -0
- package/dist/rui/p-0eda7928.system.entry.js +1 -0
- package/dist/rui/p-1a89ad3e.system.entry.js +1 -0
- package/dist/rui/p-1b310317.system.entry.js +1 -0
- package/dist/rui/p-2fc25e59.system.entry.js +1 -0
- package/dist/rui/p-40bf8db2.entry.js +1 -0
- package/dist/rui/p-72d787e7.system.entry.js +1 -0
- package/dist/rui/p-89d06840.system.entry.js +1 -0
- package/dist/rui/p-9e0ffa92.entry.js +1 -0
- package/dist/rui/p-Chuy7yuu.system.js +5 -0
- package/dist/rui/p-Cye74XUb.js +3 -0
- package/dist/rui/p-DMa34l4T.system.js +64 -0
- package/dist/rui/p-YWpyar7R.system.js +1 -0
- package/dist/rui/p-a25c8161.entry.js +1 -0
- package/dist/rui/p-ad0253ac.entry.js +1 -0
- package/dist/rui/p-b5196c19.system.entry.js +1 -0
- package/dist/rui/p-b5d6b297.system.entry.js +1 -0
- package/dist/rui/p-d04fa46b.entry.js +1 -0
- package/dist/rui/p-d34e0888.entry.js +1 -0
- package/dist/rui/p-eac80bd7.entry.js +1 -0
- package/dist/rui/rui.css +1 -0
- package/dist/rui/rui.esm.js +1 -0
- package/dist/rui/rui.js +127 -0
- package/dist/types/components/index.d.ts +8 -0
- package/dist/types/components/rui-button/rui-button.d.ts +11 -0
- package/dist/types/components/rui-filter-chips/rui-filter-chips.d.ts +12 -0
- package/dist/types/components/rui-meal-planner/rui-meal-planner.d.ts +29 -0
- package/dist/types/components/rui-modal/rui-modal.d.ts +13 -0
- package/dist/types/components/rui-recipe-card/rui-recipe-card.d.ts +20 -0
- package/dist/types/components/rui-recipe-detail/rui-recipe-detail.d.ts +28 -0
- package/dist/types/components/rui-recipe-list/rui-recipe-list.d.ts +16 -0
- package/dist/types/components/rui-search-bar/rui-search-bar.d.ts +14 -0
- package/dist/types/components.d.ts +654 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1873 -0
- package/loader/cdn.js +2 -0
- package/loader/index.cjs.js +2 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +2 -0
- package/loader/index.js +3 -0
- package/package.json +58 -0
package/README.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# recipe-ui-lib
|
|
2
|
+
|
|
3
|
+
A reusable **StencilJS** web-component library for the Recipe Finder & Meal Planner application. Built with Stencil 4, ships framework-agnostic custom elements that can be consumed by Svelte, React, Vue, or plain HTML.
|
|
4
|
+
|
|
5
|
+
## Components
|
|
6
|
+
|
|
7
|
+
| Tag | Description | Props | Events | Slots |
|
|
8
|
+
| --- | --- | --- | --- | --- |
|
|
9
|
+
| `<rui-button>` | Button primitive | `variant`, `disabled`, `loading`, `type` | `ruiClick` | default (label) |
|
|
10
|
+
| `<rui-modal>` | Modal dialog | `open`, `modalTitle`, `closeOnBackdrop` | `ruiClose` | default (body), `footer` |
|
|
11
|
+
| `<rui-search-bar>` | Debounced search input | `value`, `placeholder`, `debounceMs` | `ruiSearchInput`, `ruiSearchSubmit` | `leading` |
|
|
12
|
+
| `<rui-filter-chips>` | Multi-select category chips | `categories`, `selected` | `ruiFilterChange` | — |
|
|
13
|
+
| `<rui-recipe-card>` | Recipe summary card | `recipe`, `isFavorite` | `ruiCardClick`, `ruiFavoriteToggle` | default (footer actions) |
|
|
14
|
+
| `<rui-recipe-list>` | Responsive recipe grid | `recipes`, `favorites`, `emptyMessage` | `ruiSelectRecipe`, `ruiFavoriteToggle` | — |
|
|
15
|
+
| `<rui-recipe-detail>` | Full recipe view | `recipe`, `isFavorite` | `ruiAddToPlan`, `ruiFavoriteToggle` | `actions`, `ingredients-extra` |
|
|
16
|
+
| `<rui-meal-planner>` | Weekly meal planner | `plan`, `days` | `ruiAssignMeal`, `ruiRemoveMeal`, `ruiClearDay` | — |
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install recipe-ui-lib
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
### Option 1 — Lazy loader (recommended)
|
|
27
|
+
|
|
28
|
+
Registers all `<rui-*>` custom elements on the page:
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { defineCustomElements } from 'recipe-ui-lib/loader';
|
|
32
|
+
defineCustomElements();
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Option 2 — Per-component imports
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import { defineCustomElement as defineRuiButton } from 'recipe-ui-lib/components/rui-button';
|
|
39
|
+
defineRuiButton();
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### In HTML / any framework
|
|
43
|
+
|
|
44
|
+
```html
|
|
45
|
+
<rui-search-bar placeholder="Search recipes..."></rui-search-bar>
|
|
46
|
+
<rui-recipe-list recipes="..." favorites="..."></rui-recipe-list>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### In Svelte 5
|
|
50
|
+
|
|
51
|
+
```svelte
|
|
52
|
+
<rui-recipe-card
|
|
53
|
+
recipe={myRecipe}
|
|
54
|
+
isFavorite={false}
|
|
55
|
+
onruiCardClick={(e) => console.log(e.detail)}
|
|
56
|
+
onruiFavoriteToggle={(e) => toggleFav(e.detail)}
|
|
57
|
+
/>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
> **Note on events:** Stencil emits `ruiFavoriteToggle`-style custom events. In Svelte 5 use the `onruiFavoriteToggle` attribute syntax (lowercase, no colon). In plain JS use `element.addEventListener('ruiFavoriteToggle', handler)`.
|
|
61
|
+
|
|
62
|
+
## Development
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# install deps
|
|
66
|
+
npm install
|
|
67
|
+
|
|
68
|
+
# build the library (outputs dist/ + loader/)
|
|
69
|
+
npm run build
|
|
70
|
+
|
|
71
|
+
# watch mode
|
|
72
|
+
npm run build:watch
|
|
73
|
+
|
|
74
|
+
# run unit tests
|
|
75
|
+
npm test
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Packaging & npm publish
|
|
79
|
+
|
|
80
|
+
The library is configured for npm publishing with a proper `exports` map, TypeScript types, and a lazy loader.
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# build
|
|
84
|
+
npm run build
|
|
85
|
+
|
|
86
|
+
# verify the tarball locally
|
|
87
|
+
npm pack
|
|
88
|
+
|
|
89
|
+
# publish (requires npm login)
|
|
90
|
+
npm login
|
|
91
|
+
npm publish
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Versioning
|
|
95
|
+
|
|
96
|
+
Follows [semver](https://semver.org/). Current version: `0.1.0`. Bump with `npm version patch|minor|major` before publishing a new release.
|
|
97
|
+
|
|
98
|
+
## npm package
|
|
99
|
+
|
|
100
|
+
> **Replace this with your published npm link after running `npm publish`:**
|
|
101
|
+
>
|
|
102
|
+
> https://www.npmjs.com/package/recipe-ui-lib
|
|
103
|
+
|
|
104
|
+
## Project structure
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
recipe-ui-lib/
|
|
108
|
+
├── src/
|
|
109
|
+
│ ├── components/
|
|
110
|
+
│ │ ├── rui-button/
|
|
111
|
+
│ │ ├── rui-modal/
|
|
112
|
+
│ │ ├── rui-search-bar/
|
|
113
|
+
│ │ ├── rui-filter-chips/
|
|
114
|
+
│ │ ├── rui-recipe-card/
|
|
115
|
+
│ │ ├── rui-recipe-list/
|
|
116
|
+
│ │ ├── rui-recipe-detail/
|
|
117
|
+
│ │ └── rui-meal-planner/
|
|
118
|
+
│ ├── global/
|
|
119
|
+
│ │ └── styles.css # shared CSS custom properties / theme tokens
|
|
120
|
+
│ └── index.ts
|
|
121
|
+
├── stencil.config.ts
|
|
122
|
+
├── package.json
|
|
123
|
+
└── tsconfig.json
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## License
|
|
127
|
+
|
|
128
|
+
MIT
|