@ssejal8/recipe-ui-kit 0.1.0 → 0.1.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.
Files changed (191) hide show
  1. package/README.md +108 -277
  2. package/dist/cjs/index-BEr8BsSA.js +1712 -0
  3. package/dist/cjs/index-BEr8BsSA.js.map +1 -0
  4. package/dist/cjs/index.cjs.js +5 -0
  5. package/dist/cjs/index.cjs.js.map +1 -0
  6. package/dist/cjs/loader.cjs.js +15 -0
  7. package/dist/cjs/loader.cjs.js.map +1 -0
  8. package/dist/cjs/recipe-kit.cjs.js +27 -0
  9. package/dist/cjs/recipe-kit.cjs.js.map +1 -0
  10. package/dist/cjs/rk-badge_10.cjs.entry.js +638 -0
  11. package/dist/cjs/rk-badge_10.cjs.entry.js.map +1 -0
  12. package/dist/collection/collection-manifest.json +22 -0
  13. package/dist/collection/components/rk-badge/rk-badge.js +97 -0
  14. package/dist/collection/components/rk-badge/rk-badge.js.map +1 -0
  15. package/dist/collection/components/rk-chip/rk-chip.js +245 -0
  16. package/dist/collection/components/rk-chip/rk-chip.js.map +1 -0
  17. package/dist/collection/components/rk-empty-state/rk-empty-state.js +138 -0
  18. package/dist/collection/components/rk-empty-state/rk-empty-state.js.map +1 -0
  19. package/dist/collection/components/rk-meal-slot/rk-meal-slot.js +312 -0
  20. package/dist/collection/components/rk-meal-slot/rk-meal-slot.js.map +1 -0
  21. package/dist/collection/components/rk-modal/rk-modal.js +256 -0
  22. package/dist/collection/components/rk-modal/rk-modal.js.map +1 -0
  23. package/dist/collection/components/rk-rating/rk-rating.js +228 -0
  24. package/dist/collection/components/rk-rating/rk-rating.js.map +1 -0
  25. package/dist/collection/components/rk-recipe-card/rk-recipe-card.js +366 -0
  26. package/dist/collection/components/rk-recipe-card/rk-recipe-card.js.map +1 -0
  27. package/dist/collection/components/rk-search-bar/rk-search-bar.js +291 -0
  28. package/dist/collection/components/rk-search-bar/rk-search-bar.js.map +1 -0
  29. package/dist/collection/components/rk-segmented-control/rk-segmented-control.js +196 -0
  30. package/dist/collection/components/rk-segmented-control/rk-segmented-control.js.map +1 -0
  31. package/dist/collection/components/rk-tag-input/rk-tag-input.js +264 -0
  32. package/dist/collection/components/rk-tag-input/rk-tag-input.js.map +1 -0
  33. package/dist/collection/index.js +2 -0
  34. package/dist/collection/index.js.map +1 -0
  35. package/dist/components/index.d.ts +35 -0
  36. package/dist/components/index.js +2 -0
  37. package/dist/components/index.js.map +1 -0
  38. package/dist/components/rk-badge.d.ts +11 -0
  39. package/dist/components/rk-badge.js +2 -0
  40. package/dist/components/rk-badge.js.map +1 -0
  41. package/dist/components/rk-chip.d.ts +11 -0
  42. package/dist/components/rk-chip.js +2 -0
  43. package/dist/components/rk-chip.js.map +1 -0
  44. package/dist/components/rk-empty-state.d.ts +11 -0
  45. package/dist/components/rk-empty-state.js +2 -0
  46. package/dist/components/rk-empty-state.js.map +1 -0
  47. package/dist/components/rk-meal-slot.d.ts +11 -0
  48. package/dist/components/rk-meal-slot.js +2 -0
  49. package/dist/components/rk-meal-slot.js.map +1 -0
  50. package/dist/components/rk-modal.d.ts +11 -0
  51. package/dist/components/rk-modal.js +2 -0
  52. package/dist/components/rk-modal.js.map +1 -0
  53. package/dist/components/rk-rating.d.ts +11 -0
  54. package/dist/components/rk-rating.js +2 -0
  55. package/dist/components/rk-rating.js.map +1 -0
  56. package/dist/components/rk-recipe-card.d.ts +11 -0
  57. package/dist/components/rk-recipe-card.js +2 -0
  58. package/dist/components/rk-recipe-card.js.map +1 -0
  59. package/dist/components/rk-search-bar.d.ts +11 -0
  60. package/dist/components/rk-search-bar.js +2 -0
  61. package/dist/components/rk-search-bar.js.map +1 -0
  62. package/dist/components/rk-segmented-control.d.ts +11 -0
  63. package/dist/components/rk-segmented-control.js +2 -0
  64. package/dist/components/rk-segmented-control.js.map +1 -0
  65. package/dist/components/rk-tag-input.d.ts +11 -0
  66. package/dist/components/rk-tag-input.js +2 -0
  67. package/dist/components/rk-tag-input.js.map +1 -0
  68. package/dist/esm/index-Bxo0C8lB.js +1684 -0
  69. package/dist/esm/index-Bxo0C8lB.js.map +1 -0
  70. package/dist/esm/index.js +4 -0
  71. package/dist/esm/index.js.map +1 -0
  72. package/dist/esm/loader.js +13 -0
  73. package/dist/esm/loader.js.map +1 -0
  74. package/dist/esm/recipe-kit.js +23 -0
  75. package/dist/esm/recipe-kit.js.map +1 -0
  76. package/dist/esm/rk-badge_10.entry.js +627 -0
  77. package/dist/esm/rk-badge_10.entry.js.map +1 -0
  78. package/dist/index.cjs.js +1 -0
  79. package/dist/index.js +1 -0
  80. package/dist/recipe-kit/index.esm.js +2 -0
  81. package/dist/recipe-kit/index.esm.js.map +1 -0
  82. package/dist/recipe-kit/p-Bxo0C8lB.js +3 -0
  83. package/dist/recipe-kit/p-Bxo0C8lB.js.map +1 -0
  84. package/dist/recipe-kit/p-fcb955c7.entry.js +2 -0
  85. package/dist/recipe-kit/p-fcb955c7.entry.js.map +1 -0
  86. package/dist/recipe-kit/recipe-kit.css +1 -0
  87. package/dist/recipe-kit/recipe-kit.esm.js +2 -0
  88. package/dist/recipe-kit/recipe-kit.esm.js.map +1 -0
  89. package/dist/recipe-kit/rk-global.css +104 -0
  90. package/dist/types/components/rk-badge/rk-badge.d.ts +15 -0
  91. package/dist/types/components/rk-chip/rk-chip.d.ts +37 -0
  92. package/dist/types/components/rk-empty-state/rk-empty-state.d.ts +19 -0
  93. package/dist/types/components/rk-meal-slot/rk-meal-slot.d.ts +53 -0
  94. package/dist/types/components/rk-modal/rk-modal.d.ts +41 -0
  95. package/dist/types/components/rk-rating/rk-rating.d.ts +26 -0
  96. package/dist/types/components/rk-recipe-card/rk-recipe-card.d.ts +67 -0
  97. package/dist/types/components/rk-search-bar/rk-search-bar.d.ts +39 -0
  98. package/dist/types/components/rk-segmented-control/rk-segmented-control.d.ts +37 -0
  99. package/dist/types/components/rk-tag-input/rk-tag-input.d.ts +35 -0
  100. package/{packages/recipe-kit-stencil/src → dist/types}/components.d.ts +1 -1
  101. package/{packages/recipe-kit-stencil/src/index.ts → dist/types/index.d.ts} +0 -2
  102. package/dist/types/stencil-public-runtime.d.ts +1873 -0
  103. package/loader/cdn.js +1 -0
  104. package/loader/index.cjs.js +1 -0
  105. package/loader/index.d.ts +24 -0
  106. package/loader/index.es2017.js +1 -0
  107. package/loader/index.js +2 -0
  108. package/package.json +84 -22
  109. package/.claude/settings.local.json +0 -10
  110. package/.npmr +0 -1
  111. package/apps/recipe-web/package.json +0 -31
  112. package/apps/recipe-web/src/app.css +0 -418
  113. package/apps/recipe-web/src/app.d.ts +0 -32
  114. package/apps/recipe-web/src/app.html +0 -25
  115. package/apps/recipe-web/src/lib/api/mealdb.ts +0 -240
  116. package/apps/recipe-web/src/lib/components/AppHeader.svelte +0 -290
  117. package/apps/recipe-web/src/lib/components/ConfirmDialog.svelte +0 -46
  118. package/apps/recipe-web/src/lib/components/Modal.svelte +0 -33
  119. package/apps/recipe-web/src/lib/components/RecipeCard.svelte +0 -100
  120. package/apps/recipe-web/src/lib/components/RecipeForm.svelte +0 -560
  121. package/apps/recipe-web/src/lib/components/RecipeGrid.svelte +0 -77
  122. package/apps/recipe-web/src/lib/components/RecipePickerDialog.svelte +0 -185
  123. package/apps/recipe-web/src/lib/components/Toaster.svelte +0 -111
  124. package/apps/recipe-web/src/lib/domain/recipe.ts +0 -130
  125. package/apps/recipe-web/src/lib/domain/validation.ts +0 -189
  126. package/apps/recipe-web/src/lib/stencil/WebComponent.svelte +0 -145
  127. package/apps/recipe-web/src/lib/stencil/register.ts +0 -28
  128. package/apps/recipe-web/src/lib/stores/favorites.svelte.ts +0 -81
  129. package/apps/recipe-web/src/lib/stores/myRecipes.svelte.ts +0 -98
  130. package/apps/recipe-web/src/lib/stores/persisted.svelte.ts +0 -73
  131. package/apps/recipe-web/src/lib/stores/planner.svelte.ts +0 -275
  132. package/apps/recipe-web/src/lib/stores/theme.svelte.ts +0 -67
  133. package/apps/recipe-web/src/lib/stores/toast.svelte.ts +0 -66
  134. package/apps/recipe-web/src/routes/+error.svelte +0 -36
  135. package/apps/recipe-web/src/routes/+layout.svelte +0 -62
  136. package/apps/recipe-web/src/routes/+page.svelte +0 -352
  137. package/apps/recipe-web/src/routes/+page.ts +0 -107
  138. package/apps/recipe-web/src/routes/favorites/+page.svelte +0 -170
  139. package/apps/recipe-web/src/routes/my-recipes/+layout.ts +0 -55
  140. package/apps/recipe-web/src/routes/my-recipes/+page.svelte +0 -180
  141. package/apps/recipe-web/src/routes/my-recipes/[id]/edit/+page.svelte +0 -104
  142. package/apps/recipe-web/src/routes/my-recipes/new/+page.svelte +0 -67
  143. package/apps/recipe-web/src/routes/planner/+page.svelte +0 -422
  144. package/apps/recipe-web/src/routes/recipes/[id]/+page.svelte +0 -538
  145. package/apps/recipe-web/src/routes/recipes/[id]/+page.ts +0 -24
  146. package/apps/recipe-web/static/favicon.svg +0 -8
  147. package/apps/recipe-web/static/robots.txt +0 -2
  148. package/apps/recipe-web/svelte.config.js +0 -35
  149. package/apps/recipe-web/tsconfig.json +0 -14
  150. package/apps/recipe-web/vite.config.ts +0 -23
  151. package/packages/recipe-kit-stencil/README.md +0 -185
  152. package/packages/recipe-kit-stencil/package-lock.json +0 -4772
  153. package/packages/recipe-kit-stencil/package.json +0 -91
  154. package/packages/recipe-kit-stencil/src/components/rk-badge/readme.md +0 -38
  155. package/packages/recipe-kit-stencil/src/components/rk-badge/rk-badge.tsx +0 -31
  156. package/packages/recipe-kit-stencil/src/components/rk-chip/readme.md +0 -52
  157. package/packages/recipe-kit-stencil/src/components/rk-chip/rk-chip.tsx +0 -105
  158. package/packages/recipe-kit-stencil/src/components/rk-empty-state/readme.md +0 -44
  159. package/packages/recipe-kit-stencil/src/components/rk-empty-state/rk-empty-state.tsx +0 -50
  160. package/packages/recipe-kit-stencil/src/components/rk-meal-slot/readme.md +0 -58
  161. package/packages/recipe-kit-stencil/src/components/rk-meal-slot/rk-meal-slot.tsx +0 -182
  162. package/packages/recipe-kit-stencil/src/components/rk-modal/readme.md +0 -57
  163. package/packages/recipe-kit-stencil/src/components/rk-modal/rk-modal.tsx +0 -176
  164. package/packages/recipe-kit-stencil/src/components/rk-rating/readme.md +0 -42
  165. package/packages/recipe-kit-stencil/src/components/rk-rating/rk-rating.tsx +0 -114
  166. package/packages/recipe-kit-stencil/src/components/rk-recipe-card/readme.md +0 -66
  167. package/packages/recipe-kit-stencil/src/components/rk-recipe-card/rk-recipe-card.tsx +0 -179
  168. package/packages/recipe-kit-stencil/src/components/rk-recipe-card/test/rk-recipe-card.spec.tsx +0 -70
  169. package/packages/recipe-kit-stencil/src/components/rk-search-bar/readme.md +0 -67
  170. package/packages/recipe-kit-stencil/src/components/rk-search-bar/rk-search-bar.tsx +0 -152
  171. package/packages/recipe-kit-stencil/src/components/rk-search-bar/test/rk-search-bar.spec.tsx +0 -93
  172. package/packages/recipe-kit-stencil/src/components/rk-segmented-control/readme.md +0 -41
  173. package/packages/recipe-kit-stencil/src/components/rk-segmented-control/rk-segmented-control.tsx +0 -115
  174. package/packages/recipe-kit-stencil/src/components/rk-tag-input/readme.md +0 -47
  175. package/packages/recipe-kit-stencil/src/components/rk-tag-input/rk-tag-input.tsx +0 -181
  176. package/packages/recipe-kit-stencil/src/components/rk-tag-input/test/rk-tag-input.spec.tsx +0 -76
  177. package/packages/recipe-kit-stencil/src/index.html +0 -259
  178. package/packages/recipe-kit-stencil/stencil.config.ts +0 -41
  179. package/packages/recipe-kit-stencil/tsconfig.json +0 -24
  180. /package/{packages/recipe-kit-stencil/LICENSE → LICENSE} +0 -0
  181. /package/{packages/recipe-kit-stencil/src → dist/collection}/components/rk-badge/rk-badge.css +0 -0
  182. /package/{packages/recipe-kit-stencil/src → dist/collection}/components/rk-chip/rk-chip.css +0 -0
  183. /package/{packages/recipe-kit-stencil/src → dist/collection}/components/rk-empty-state/rk-empty-state.css +0 -0
  184. /package/{packages/recipe-kit-stencil/src → dist/collection}/components/rk-meal-slot/rk-meal-slot.css +0 -0
  185. /package/{packages/recipe-kit-stencil/src → dist/collection}/components/rk-modal/rk-modal.css +0 -0
  186. /package/{packages/recipe-kit-stencil/src → dist/collection}/components/rk-rating/rk-rating.css +0 -0
  187. /package/{packages/recipe-kit-stencil/src → dist/collection}/components/rk-recipe-card/rk-recipe-card.css +0 -0
  188. /package/{packages/recipe-kit-stencil/src → dist/collection}/components/rk-search-bar/rk-search-bar.css +0 -0
  189. /package/{packages/recipe-kit-stencil/src → dist/collection}/components/rk-segmented-control/rk-segmented-control.css +0 -0
  190. /package/{packages/recipe-kit-stencil/src → dist/collection}/components/rk-tag-input/rk-tag-input.css +0 -0
  191. /package/{packages/recipe-kit-stencil/src/global → dist/collection}/rk-global.css +0 -0
@@ -1,91 +0,0 @@
1
- {
2
- "name": "recipe-kit-stencil",
3
- "version": "0.1.0",
4
- "description": "Framework-agnostic web component library (StencilJS) for recipe discovery, favorites and meal planning UIs.",
5
- "license": "MIT",
6
- "author": "Sejal Sharma",
7
- "keywords": [
8
- "stencil",
9
- "stenciljs",
10
- "web-components",
11
- "custom-elements",
12
- "design-system",
13
- "recipe",
14
- "meal-planner",
15
- "svelte",
16
- "sveltekit"
17
- ],
18
- "type": "module",
19
- "main": "dist/index.cjs.js",
20
- "module": "dist/index.js",
21
- "types": "dist/types/index.d.ts",
22
- "collection": "dist/collection/collection-manifest.json",
23
- "collection:main": "dist/collection/index.js",
24
- "unpkg": "dist/recipe-kit/recipe-kit.esm.js",
25
- "exports": {
26
- ".": {
27
- "types": "./dist/types/index.d.ts",
28
- "import": "./dist/index.js",
29
- "require": "./dist/index.cjs.js"
30
- },
31
- "./loader": {
32
- "types": "./loader/index.d.ts",
33
- "import": "./loader/index.js",
34
- "require": "./loader/index.cjs.js"
35
- },
36
- "./components/*": {
37
- "types": "./dist/components/*.d.ts",
38
- "import": "./dist/components/*.js"
39
- },
40
- "./dist/recipe-kit/recipe-kit.css": "./dist/recipe-kit/recipe-kit.css",
41
- "./styles": "./dist/recipe-kit/recipe-kit.css",
42
- "./dist/*": "./dist/*",
43
- "./package.json": "./package.json"
44
- },
45
- "files": [
46
- "dist/",
47
- "loader/",
48
- "README.md",
49
- "LICENSE"
50
- ],
51
- "sideEffects": [
52
- "dist/**/*.css",
53
- "dist/esm/polyfills/*"
54
- ],
55
- "publishConfig": {
56
- "access": "public",
57
- "registry": "https://registry.npmjs.org/"
58
- },
59
- "scripts": {
60
- "build": "stencil build --docs",
61
- "start": "stencil build --dev --watch --serve",
62
- "test": "stencil test --spec",
63
- "test:watch": "stencil test --spec --watchAll",
64
- "generate": "stencil generate",
65
- "clean": "rimraf dist loader www .stencil",
66
- "prepare": "stencil build",
67
- "prepublishOnly": "npm run clean && npm run build",
68
- "release:patch": "npm version patch && npm publish",
69
- "release:minor": "npm version minor && npm publish",
70
- "release:major": "npm version major && npm publish"
71
- },
72
- "dependencies": {
73
- "@stencil/core": "^4.44.1"
74
- },
75
- "devDependencies": {
76
- "@types/jest": "^29.5.14",
77
- "jest": "^29.7.0",
78
- "jest-cli": "^29.7.0",
79
- "puppeteer": "^24.10.2",
80
- "rimraf": "^6.0.1"
81
- },
82
- "repository": {
83
- "type": "git",
84
- "url": "git+https://github.com/sejal-sharma/recipe-ui.git",
85
- "directory": "packages/recipe-kit-stencil"
86
- },
87
- "bugs": {
88
- "url": "https://github.com/sejal-sharma/recipe-ui/issues"
89
- },
90
- "homepage": "https://github.com/sejal-sharma/recipe-ui/tree/main/packages/recipe-kit-stencil#readme"
91
- }
@@ -1,38 +0,0 @@
1
- # rk-badge
2
-
3
-
4
-
5
- <!-- Auto Generated Below -->
6
-
7
-
8
- ## Overview
9
-
10
- A small, non-interactive label. Purely slot-driven so hosts can put icons,
11
- text or counts inside it.
12
-
13
- ## Properties
14
-
15
- | Property | Attribute | Description | Type | Default |
16
- | --------- | --------- | ---------------------------------------------------------------- | -------------------------------------------------------------------------- | ----------- |
17
- | `small` | `small` | Compact sizing for dense layouts. | `boolean` | `false` |
18
- | `tone` | `tone` | Color treatment. | `"accent" \| "danger" \| "neutral" \| "primary" \| "success" \| "warning"` | `'neutral'` |
19
- | `variant` | `variant` | `soft` is tinted, `solid` is filled, `outline` is bordered only. | `"outline" \| "soft" \| "solid"` | `'soft'` |
20
-
21
-
22
- ## Slots
23
-
24
- | Slot | Description |
25
- | ---- | -------------- |
26
- | | Badge content. |
27
-
28
-
29
- ## Shadow Parts
30
-
31
- | Part | Description |
32
- | --------- | ----------- |
33
- | `"badge"` | |
34
-
35
-
36
- ----------------------------------------------
37
-
38
- *Built with [StencilJS](https://stenciljs.com/)*
@@ -1,31 +0,0 @@
1
- import { Component, h, Prop } from '@stencil/core';
2
-
3
- /**
4
- * A small, non-interactive label. Purely slot-driven so hosts can put icons,
5
- * text or counts inside it.
6
- *
7
- * @slot - Badge content.
8
- */
9
- @Component({
10
- tag: 'rk-badge',
11
- styleUrl: 'rk-badge.css',
12
- shadow: true,
13
- })
14
- export class RkBadge {
15
- /** Color treatment. */
16
- @Prop() tone: 'neutral' | 'primary' | 'accent' | 'success' | 'warning' | 'danger' = 'neutral';
17
-
18
- /** `soft` is tinted, `solid` is filled, `outline` is bordered only. */
19
- @Prop() variant: 'soft' | 'solid' | 'outline' = 'soft';
20
-
21
- /** Compact sizing for dense layouts. */
22
- @Prop() small = false;
23
-
24
- render() {
25
- return (
26
- <span class={{ badge: true, [`tone-${this.tone}`]: true, [`variant-${this.variant}`]: true, 'is-small': this.small }} part="badge">
27
- <slot />
28
- </span>
29
- );
30
- }
31
- }
@@ -1,52 +0,0 @@
1
- # rk-chip
2
-
3
-
4
-
5
- <!-- Auto Generated Below -->
6
-
7
-
8
- ## Overview
9
-
10
- A selectable / dismissible filter chip.
11
-
12
- ## Properties
13
-
14
- | Property | Attribute | Description | Type | Default |
15
- | ------------- | ------------- | --------------------------------------------------------------------- | ------------------------------------ | ----------- |
16
- | `count` | `count` | Optional trailing count badge (e.g. number of matching recipes). | `number` | `undefined` |
17
- | `disabled` | `disabled` | Disables interaction. | `boolean` | `false` |
18
- | `dismissible` | `dismissible` | Renders an "x" button that emits `rkChipDismiss` instead of toggling. | `boolean` | `false` |
19
- | `label` | `label` | Visible text. | `string` | `''` |
20
- | `selected` | `selected` | Whether the chip is currently active. | `boolean` | `false` |
21
- | `tone` | `tone` | Visual treatment. | `"accent" \| "neutral" \| "primary"` | `'neutral'` |
22
- | `value` | `value` | Value reported back to the host application in event payloads. | `string` | `undefined` |
23
-
24
-
25
- ## Events
26
-
27
- | Event | Description | Type |
28
- | --------------- | ----------------------------------------------------------- | ------------------------------------------------------------------- |
29
- | `rkChipDismiss` | Emitted when a dismissible chip's remove button is pressed. | `CustomEvent<{ value: string; label: string; }>` |
30
- | `rkChipToggle` | Emitted when the chip is toggled. | `CustomEvent<{ value: string; label: string; selected: boolean; }>` |
31
-
32
-
33
- ## Slots
34
-
35
- | Slot | Description |
36
- | ---- | ------------------------------------------------------------------------- |
37
- | | Optional leading content (icon, emoji, avatar) rendered before the label. |
38
-
39
-
40
- ## Shadow Parts
41
-
42
- | Part | Description |
43
- | ----------- | ----------- |
44
- | `"chip"` | |
45
- | `"count"` | |
46
- | `"dismiss"` | |
47
- | `"label"` | |
48
-
49
-
50
- ----------------------------------------------
51
-
52
- *Built with [StencilJS](https://stenciljs.com/)*
@@ -1,105 +0,0 @@
1
- import { Component, Event, EventEmitter, h, Prop } from '@stencil/core';
2
-
3
- /**
4
- * A selectable / dismissible filter chip.
5
- *
6
- * @slot - Optional leading content (icon, emoji, avatar) rendered before the label.
7
- */
8
- @Component({
9
- tag: 'rk-chip',
10
- styleUrl: 'rk-chip.css',
11
- shadow: true,
12
- })
13
- export class RkChip {
14
- /** Visible text. */
15
- @Prop() label = '';
16
-
17
- /** Value reported back to the host application in event payloads. */
18
- @Prop() value?: string;
19
-
20
- /** Whether the chip is currently active. */
21
- @Prop() selected = false;
22
-
23
- /** Optional trailing count badge (e.g. number of matching recipes). */
24
- @Prop() count?: number;
25
-
26
- /** Renders an "x" button that emits `rkChipDismiss` instead of toggling. */
27
- @Prop() dismissible = false;
28
-
29
- /** Disables interaction. */
30
- @Prop() disabled = false;
31
-
32
- /** Visual treatment. */
33
- @Prop() tone: 'neutral' | 'primary' | 'accent' = 'neutral';
34
-
35
- /** Emitted when the chip is toggled. */
36
- @Event({ eventName: 'rkChipToggle' }) rkChipToggle!: EventEmitter<{ value: string; label: string; selected: boolean }>;
37
-
38
- /** Emitted when a dismissible chip's remove button is pressed. */
39
- @Event({ eventName: 'rkChipDismiss' }) rkChipDismiss!: EventEmitter<{ value: string; label: string }>;
40
-
41
- private get resolvedValue() {
42
- return this.value ?? this.label;
43
- }
44
-
45
- private handleClick = () => {
46
- if (this.disabled) return;
47
- this.rkChipToggle.emit({
48
- value: this.resolvedValue,
49
- label: this.label,
50
- selected: !this.selected,
51
- });
52
- };
53
-
54
- private handleDismiss = (event: MouseEvent) => {
55
- event.stopPropagation();
56
- if (this.disabled) return;
57
- this.rkChipDismiss.emit({ value: this.resolvedValue, label: this.label });
58
- };
59
-
60
- render() {
61
- const body = [
62
- <span class="lead">
63
- <slot />
64
- </span>,
65
- <span class="label" part="label">
66
- {this.label}
67
- </span>,
68
- typeof this.count === 'number' && (
69
- <span class="count" part="count">
70
- {this.count}
71
- </span>
72
- ),
73
- ];
74
-
75
- const classes = {
76
- chip: true,
77
- 'is-selected': this.selected,
78
- 'is-dismissible': this.dismissible,
79
- [`tone-${this.tone}`]: true,
80
- };
81
-
82
- // A dismissible chip needs two independent controls, so the shell becomes a
83
- // plain element to avoid nesting buttons inside a button.
84
- if (this.dismissible) {
85
- return (
86
- <span class={classes} part="chip">
87
- <button class="body" type="button" disabled={this.disabled} onClick={this.handleClick}>
88
- {body}
89
- </button>
90
- <button class="dismiss" part="dismiss" type="button" disabled={this.disabled} aria-label={`Remove ${this.label}`} onClick={this.handleDismiss}>
91
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" aria-hidden="true">
92
- <path d="M6 6l12 12M18 6 6 18" />
93
- </svg>
94
- </button>
95
- </span>
96
- );
97
- }
98
-
99
- return (
100
- <button class={classes} part="chip" type="button" aria-pressed={String(this.selected)} disabled={this.disabled} onClick={this.handleClick}>
101
- {body}
102
- </button>
103
- );
104
- }
105
- }
@@ -1,44 +0,0 @@
1
- # rk-empty-state
2
-
3
-
4
-
5
- <!-- Auto Generated Below -->
6
-
7
-
8
- ## Overview
9
-
10
- Placeholder shown when a list has no items, a search returns nothing, or a
11
- request fails.
12
-
13
- ## Properties
14
-
15
- | Property | Attribute | Description | Type | Default |
16
- | --------- | --------- | -------------------------------------------------------------- | ---------------------- | -------------------- |
17
- | `bare` | `bare` | Removes the dashed border and reduces padding, for inline use. | `boolean` | `false` |
18
- | `heading` | `heading` | Bold headline. | `string` | `'Nothing here yet'` |
19
- | `icon` | `icon` | Emoji or short glyph shown above the heading. | `string` | `'🍳'` |
20
- | `message` | `message` | Supporting sentence. | `string` | `undefined` |
21
- | `tone` | `tone` | `error` swaps to a warning treatment. | `"error" \| "neutral"` | `'neutral'` |
22
-
23
-
24
- ## Slots
25
-
26
- | Slot | Description |
27
- | ---- | ------------------------------------------------------------------- |
28
- | | Call-to-action content rendered under the message (buttons, links). |
29
-
30
-
31
- ## Shadow Parts
32
-
33
- | Part | Description |
34
- | ------------- | ----------- |
35
- | `"actions"` | |
36
- | `"container"` | |
37
- | `"heading"` | |
38
- | `"icon"` | |
39
- | `"message"` | |
40
-
41
-
42
- ----------------------------------------------
43
-
44
- *Built with [StencilJS](https://stenciljs.com/)*
@@ -1,50 +0,0 @@
1
- import { Component, h, Prop } from '@stencil/core';
2
-
3
- /**
4
- * Placeholder shown when a list has no items, a search returns nothing, or a
5
- * request fails.
6
- *
7
- * @slot - Call-to-action content rendered under the message (buttons, links).
8
- */
9
- @Component({
10
- tag: 'rk-empty-state',
11
- styleUrl: 'rk-empty-state.css',
12
- shadow: true,
13
- })
14
- export class RkEmptyState {
15
- /** Emoji or short glyph shown above the heading. */
16
- @Prop() icon = '🍳';
17
-
18
- /** Bold headline. */
19
- @Prop() heading = 'Nothing here yet';
20
-
21
- /** Supporting sentence. */
22
- @Prop() message?: string;
23
-
24
- /** `error` swaps to a warning treatment. */
25
- @Prop() tone: 'neutral' | 'error' = 'neutral';
26
-
27
- /** Removes the dashed border and reduces padding, for inline use. */
28
- @Prop() bare = false;
29
-
30
- render() {
31
- return (
32
- <div class={{ empty: true, [`tone-${this.tone}`]: true, 'is-bare': this.bare }} part="container" role={this.tone === 'error' ? 'alert' : null}>
33
- <span class="icon" part="icon" aria-hidden="true">
34
- {this.icon}
35
- </span>
36
- <h3 class="heading" part="heading">
37
- {this.heading}
38
- </h3>
39
- {this.message && (
40
- <p class="message" part="message">
41
- {this.message}
42
- </p>
43
- )}
44
- <div class="actions" part="actions">
45
- <slot />
46
- </div>
47
- </div>
48
- );
49
- }
50
- }
@@ -1,58 +0,0 @@
1
- # rk-meal-slot
2
-
3
-
4
-
5
- <!-- Auto Generated Below -->
6
-
7
-
8
- ## Overview
9
-
10
- One cell of the weekly planner grid: either an empty "add" target or a filled
11
- slot showing the planned recipe. Doubles as a drop zone for drag-and-drop
12
- planning.
13
-
14
- ## Properties
15
-
16
- | Property | Attribute | Description | Type | Default |
17
- | ----------------------- | -------------- | ---------------------------------------------------------------------- | --------- | ----------- |
18
- | `day` _(required)_ | `day` | Day key this slot belongs to, e.g. `monday`. Echoed in event payloads. | `string` | `undefined` |
19
- | `disabled` | `disabled` | Disables interaction. | `boolean` | `false` |
20
- | `mealLabel` | `meal-label` | Human-readable meal label shown as the slot caption. | `string` | `undefined` |
21
- | `mealType` _(required)_ | `meal-type` | Meal type key, e.g. `breakfast`. Echoed in event payloads. | `string` | `undefined` |
22
- | `recipeId` | `recipe-id` | Id of the planned recipe. Empty means the slot is free. | `string` | `undefined` |
23
- | `recipeImage` | `recipe-image` | Thumbnail of the planned recipe. | `string` | `undefined` |
24
- | `recipeName` | `recipe-name` | Title of the planned recipe. | `string` | `undefined` |
25
-
26
-
27
- ## Events
28
-
29
- | Event | Description | Type |
30
- | -------------- | ------------------------------------------------------------------------- | --------------------------------- |
31
- | `rkMealAdd` | Emitted when an empty slot is activated — the host opens a recipe picker. | `CustomEvent<RkMealSlotDetail>` |
32
- | `rkMealDrop` | Emitted when a recipe is dropped onto this slot. | `CustomEvent<RkMealDropDetail>` |
33
- | `rkMealOpen` | Emitted when the planned recipe is activated — the host navigates. | `CustomEvent<RkMealRecipeDetail>` |
34
- | `rkMealRemove` | Emitted when the planned recipe should be cleared. | `CustomEvent<RkMealRecipeDetail>` |
35
- | `rkMealSwap` | Emitted when the planned recipe should be replaced. | `CustomEvent<RkMealRecipeDetail>` |
36
-
37
-
38
- ## Slots
39
-
40
- | Slot | Description |
41
- | ---- | ------------------------------------------------------------------ |
42
- | | Extra content rendered under the recipe name (e.g. serving notes). |
43
-
44
-
45
- ## Shadow Parts
46
-
47
- | Part | Description |
48
- | ------------ | ----------- |
49
- | `"caption"` | |
50
- | `"controls"` | |
51
- | `"main"` | |
52
- | `"name"` | |
53
- | `"slot"` | |
54
-
55
-
56
- ----------------------------------------------
57
-
58
- *Built with [StencilJS](https://stenciljs.com/)*
@@ -1,182 +0,0 @@
1
- import { Component, Event, EventEmitter, h, Prop, State } from '@stencil/core';
2
-
3
- export interface RkMealSlotDetail {
4
- day: string;
5
- mealType: string;
6
- }
7
-
8
- export interface RkMealRecipeDetail extends RkMealSlotDetail {
9
- recipeId: string;
10
- recipeName: string;
11
- }
12
-
13
- export interface RkMealDropDetail extends RkMealSlotDetail {
14
- /** Raw `text/plain` payload from the drag operation. */
15
- payload: string;
16
- }
17
-
18
- /**
19
- * One cell of the weekly planner grid: either an empty "add" target or a filled
20
- * slot showing the planned recipe. Doubles as a drop zone for drag-and-drop
21
- * planning.
22
- *
23
- * @slot - Extra content rendered under the recipe name (e.g. serving notes).
24
- */
25
- @Component({
26
- tag: 'rk-meal-slot',
27
- styleUrl: 'rk-meal-slot.css',
28
- shadow: true,
29
- })
30
- export class RkMealSlot {
31
- /** Day key this slot belongs to, e.g. `monday`. Echoed in event payloads. */
32
- @Prop() day!: string;
33
-
34
- /** Meal type key, e.g. `breakfast`. Echoed in event payloads. */
35
- @Prop() mealType!: string;
36
-
37
- /** Human-readable meal label shown as the slot caption. */
38
- @Prop() mealLabel?: string;
39
-
40
- /** Id of the planned recipe. Empty means the slot is free. */
41
- @Prop() recipeId?: string;
42
-
43
- /** Title of the planned recipe. */
44
- @Prop() recipeName?: string;
45
-
46
- /** Thumbnail of the planned recipe. */
47
- @Prop() recipeImage?: string;
48
-
49
- /** Disables interaction. */
50
- @Prop() disabled = false;
51
-
52
- /** Emitted when an empty slot is activated — the host opens a recipe picker. */
53
- @Event({ eventName: 'rkMealAdd' }) rkMealAdd!: EventEmitter<RkMealSlotDetail>;
54
-
55
- /** Emitted when the planned recipe should be replaced. */
56
- @Event({ eventName: 'rkMealSwap' }) rkMealSwap!: EventEmitter<RkMealRecipeDetail>;
57
-
58
- /** Emitted when the planned recipe should be cleared. */
59
- @Event({ eventName: 'rkMealRemove' }) rkMealRemove!: EventEmitter<RkMealRecipeDetail>;
60
-
61
- /** Emitted when the planned recipe is activated — the host navigates. */
62
- @Event({ eventName: 'rkMealOpen' }) rkMealOpen!: EventEmitter<RkMealRecipeDetail>;
63
-
64
- /** Emitted when a recipe is dropped onto this slot. */
65
- @Event({ eventName: 'rkMealDrop' }) rkMealDrop!: EventEmitter<RkMealDropDetail>;
66
-
67
- @State() private dragOver = false;
68
-
69
- private get filled() {
70
- return !!this.recipeId;
71
- }
72
-
73
- private get slotDetail(): RkMealSlotDetail {
74
- return { day: this.day, mealType: this.mealType };
75
- }
76
-
77
- private get recipeDetail(): RkMealRecipeDetail {
78
- return { ...this.slotDetail, recipeId: this.recipeId ?? '', recipeName: this.recipeName ?? '' };
79
- }
80
-
81
- private handleDragOver = (event: DragEvent) => {
82
- if (this.disabled) return;
83
- // Preventing default is what marks this element as a valid drop target.
84
- event.preventDefault();
85
- if (event.dataTransfer) event.dataTransfer.dropEffect = 'copy';
86
- this.dragOver = true;
87
- };
88
-
89
- private handleDrop = (event: DragEvent) => {
90
- event.preventDefault();
91
- this.dragOver = false;
92
- if (this.disabled) return;
93
- const payload = event.dataTransfer?.getData('text/plain') ?? '';
94
- if (payload) this.rkMealDrop.emit({ ...this.slotDetail, payload });
95
- };
96
-
97
- render() {
98
- if (!this.filled) {
99
- return (
100
- <button
101
- class={{ slot: true, 'is-empty': true, 'is-drag-over': this.dragOver }}
102
- part="slot"
103
- type="button"
104
- disabled={this.disabled}
105
- aria-label={`Add a recipe for ${this.mealLabel ?? this.mealType} on ${this.day}`}
106
- onClick={() => this.rkMealAdd.emit(this.slotDetail)}
107
- onDragOver={this.handleDragOver}
108
- onDragLeave={() => (this.dragOver = false)}
109
- onDrop={this.handleDrop}
110
- >
111
- <span class="plus" aria-hidden="true">
112
- +
113
- </span>
114
- <span class="empty-label">{this.mealLabel ?? this.mealType}</span>
115
- </button>
116
- );
117
- }
118
-
119
- return (
120
- <div
121
- class={{ slot: true, 'is-filled': true, 'is-drag-over': this.dragOver }}
122
- part="slot"
123
- onDragOver={this.handleDragOver}
124
- onDragLeave={() => (this.dragOver = false)}
125
- onDrop={this.handleDrop}
126
- >
127
- {this.mealLabel && (
128
- <span class="caption" part="caption">
129
- {this.mealLabel}
130
- </span>
131
- )}
132
-
133
- <button
134
- class="main"
135
- part="main"
136
- type="button"
137
- disabled={this.disabled}
138
- title={this.recipeName}
139
- onClick={() => this.rkMealOpen.emit(this.recipeDetail)}
140
- >
141
- {this.recipeImage ? (
142
- <img class="thumb" src={this.recipeImage} alt="" loading="lazy" decoding="async" />
143
- ) : (
144
- <span class="thumb thumb-fallback" aria-hidden="true">
145
- 🍽️
146
- </span>
147
- )}
148
- <span class="name" part="name">
149
- {this.recipeName}
150
- </span>
151
- </button>
152
-
153
- <div class="extra">
154
- <slot />
155
- </div>
156
-
157
- <div class="controls" part="controls">
158
- <button class="ctrl" type="button" disabled={this.disabled} aria-label={`Replace ${this.recipeName}`} title="Replace" onClick={() => this.rkMealSwap.emit(this.recipeDetail)}>
159
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
160
- <path d="M3 12a9 9 0 0 1 15.3-6.4L21 8" />
161
- <path d="M21 3v5h-5" />
162
- <path d="M21 12a9 9 0 0 1-15.3 6.4L3 16" />
163
- <path d="M3 21v-5h5" />
164
- </svg>
165
- </button>
166
- <button
167
- class="ctrl is-danger"
168
- type="button"
169
- disabled={this.disabled}
170
- aria-label={`Remove ${this.recipeName} from ${this.mealLabel ?? this.mealType}`}
171
- title="Remove"
172
- onClick={() => this.rkMealRemove.emit(this.recipeDetail)}
173
- >
174
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true">
175
- <path d="M6 6l12 12M18 6 6 18" />
176
- </svg>
177
- </button>
178
- </div>
179
- </div>
180
- );
181
- }
182
- }