@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.
- package/README.md +108 -277
- package/dist/cjs/index-BEr8BsSA.js +1712 -0
- package/dist/cjs/index-BEr8BsSA.js.map +1 -0
- package/dist/cjs/index.cjs.js +5 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/recipe-kit.cjs.js +27 -0
- package/dist/cjs/recipe-kit.cjs.js.map +1 -0
- package/dist/cjs/rk-badge_10.cjs.entry.js +638 -0
- package/dist/cjs/rk-badge_10.cjs.entry.js.map +1 -0
- package/dist/collection/collection-manifest.json +22 -0
- package/dist/collection/components/rk-badge/rk-badge.js +97 -0
- package/dist/collection/components/rk-badge/rk-badge.js.map +1 -0
- package/dist/collection/components/rk-chip/rk-chip.js +245 -0
- package/dist/collection/components/rk-chip/rk-chip.js.map +1 -0
- package/dist/collection/components/rk-empty-state/rk-empty-state.js +138 -0
- package/dist/collection/components/rk-empty-state/rk-empty-state.js.map +1 -0
- package/dist/collection/components/rk-meal-slot/rk-meal-slot.js +312 -0
- package/dist/collection/components/rk-meal-slot/rk-meal-slot.js.map +1 -0
- package/dist/collection/components/rk-modal/rk-modal.js +256 -0
- package/dist/collection/components/rk-modal/rk-modal.js.map +1 -0
- package/dist/collection/components/rk-rating/rk-rating.js +228 -0
- package/dist/collection/components/rk-rating/rk-rating.js.map +1 -0
- package/dist/collection/components/rk-recipe-card/rk-recipe-card.js +366 -0
- package/dist/collection/components/rk-recipe-card/rk-recipe-card.js.map +1 -0
- package/dist/collection/components/rk-search-bar/rk-search-bar.js +291 -0
- package/dist/collection/components/rk-search-bar/rk-search-bar.js.map +1 -0
- package/dist/collection/components/rk-segmented-control/rk-segmented-control.js +196 -0
- package/dist/collection/components/rk-segmented-control/rk-segmented-control.js.map +1 -0
- package/dist/collection/components/rk-tag-input/rk-tag-input.js +264 -0
- package/dist/collection/components/rk-tag-input/rk-tag-input.js.map +1 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/rk-badge.d.ts +11 -0
- package/dist/components/rk-badge.js +2 -0
- package/dist/components/rk-badge.js.map +1 -0
- package/dist/components/rk-chip.d.ts +11 -0
- package/dist/components/rk-chip.js +2 -0
- package/dist/components/rk-chip.js.map +1 -0
- package/dist/components/rk-empty-state.d.ts +11 -0
- package/dist/components/rk-empty-state.js +2 -0
- package/dist/components/rk-empty-state.js.map +1 -0
- package/dist/components/rk-meal-slot.d.ts +11 -0
- package/dist/components/rk-meal-slot.js +2 -0
- package/dist/components/rk-meal-slot.js.map +1 -0
- package/dist/components/rk-modal.d.ts +11 -0
- package/dist/components/rk-modal.js +2 -0
- package/dist/components/rk-modal.js.map +1 -0
- package/dist/components/rk-rating.d.ts +11 -0
- package/dist/components/rk-rating.js +2 -0
- package/dist/components/rk-rating.js.map +1 -0
- package/dist/components/rk-recipe-card.d.ts +11 -0
- package/dist/components/rk-recipe-card.js +2 -0
- package/dist/components/rk-recipe-card.js.map +1 -0
- package/dist/components/rk-search-bar.d.ts +11 -0
- package/dist/components/rk-search-bar.js +2 -0
- package/dist/components/rk-search-bar.js.map +1 -0
- package/dist/components/rk-segmented-control.d.ts +11 -0
- package/dist/components/rk-segmented-control.js +2 -0
- package/dist/components/rk-segmented-control.js.map +1 -0
- package/dist/components/rk-tag-input.d.ts +11 -0
- package/dist/components/rk-tag-input.js +2 -0
- package/dist/components/rk-tag-input.js.map +1 -0
- package/dist/esm/index-Bxo0C8lB.js +1684 -0
- package/dist/esm/index-Bxo0C8lB.js.map +1 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/recipe-kit.js +23 -0
- package/dist/esm/recipe-kit.js.map +1 -0
- package/dist/esm/rk-badge_10.entry.js +627 -0
- package/dist/esm/rk-badge_10.entry.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/recipe-kit/index.esm.js +2 -0
- package/dist/recipe-kit/index.esm.js.map +1 -0
- package/dist/recipe-kit/p-Bxo0C8lB.js +3 -0
- package/dist/recipe-kit/p-Bxo0C8lB.js.map +1 -0
- package/dist/recipe-kit/p-fcb955c7.entry.js +2 -0
- package/dist/recipe-kit/p-fcb955c7.entry.js.map +1 -0
- package/dist/recipe-kit/recipe-kit.css +1 -0
- package/dist/recipe-kit/recipe-kit.esm.js +2 -0
- package/dist/recipe-kit/recipe-kit.esm.js.map +1 -0
- package/dist/recipe-kit/rk-global.css +104 -0
- package/dist/types/components/rk-badge/rk-badge.d.ts +15 -0
- package/dist/types/components/rk-chip/rk-chip.d.ts +37 -0
- package/dist/types/components/rk-empty-state/rk-empty-state.d.ts +19 -0
- package/dist/types/components/rk-meal-slot/rk-meal-slot.d.ts +53 -0
- package/dist/types/components/rk-modal/rk-modal.d.ts +41 -0
- package/dist/types/components/rk-rating/rk-rating.d.ts +26 -0
- package/dist/types/components/rk-recipe-card/rk-recipe-card.d.ts +67 -0
- package/dist/types/components/rk-search-bar/rk-search-bar.d.ts +39 -0
- package/dist/types/components/rk-segmented-control/rk-segmented-control.d.ts +37 -0
- package/dist/types/components/rk-tag-input/rk-tag-input.d.ts +35 -0
- package/{packages/recipe-kit-stencil/src → dist/types}/components.d.ts +1 -1
- package/{packages/recipe-kit-stencil/src/index.ts → dist/types/index.d.ts} +0 -2
- package/dist/types/stencil-public-runtime.d.ts +1873 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +84 -22
- package/.claude/settings.local.json +0 -10
- package/.npmr +0 -1
- package/apps/recipe-web/package.json +0 -31
- package/apps/recipe-web/src/app.css +0 -418
- package/apps/recipe-web/src/app.d.ts +0 -32
- package/apps/recipe-web/src/app.html +0 -25
- package/apps/recipe-web/src/lib/api/mealdb.ts +0 -240
- package/apps/recipe-web/src/lib/components/AppHeader.svelte +0 -290
- package/apps/recipe-web/src/lib/components/ConfirmDialog.svelte +0 -46
- package/apps/recipe-web/src/lib/components/Modal.svelte +0 -33
- package/apps/recipe-web/src/lib/components/RecipeCard.svelte +0 -100
- package/apps/recipe-web/src/lib/components/RecipeForm.svelte +0 -560
- package/apps/recipe-web/src/lib/components/RecipeGrid.svelte +0 -77
- package/apps/recipe-web/src/lib/components/RecipePickerDialog.svelte +0 -185
- package/apps/recipe-web/src/lib/components/Toaster.svelte +0 -111
- package/apps/recipe-web/src/lib/domain/recipe.ts +0 -130
- package/apps/recipe-web/src/lib/domain/validation.ts +0 -189
- package/apps/recipe-web/src/lib/stencil/WebComponent.svelte +0 -145
- package/apps/recipe-web/src/lib/stencil/register.ts +0 -28
- package/apps/recipe-web/src/lib/stores/favorites.svelte.ts +0 -81
- package/apps/recipe-web/src/lib/stores/myRecipes.svelte.ts +0 -98
- package/apps/recipe-web/src/lib/stores/persisted.svelte.ts +0 -73
- package/apps/recipe-web/src/lib/stores/planner.svelte.ts +0 -275
- package/apps/recipe-web/src/lib/stores/theme.svelte.ts +0 -67
- package/apps/recipe-web/src/lib/stores/toast.svelte.ts +0 -66
- package/apps/recipe-web/src/routes/+error.svelte +0 -36
- package/apps/recipe-web/src/routes/+layout.svelte +0 -62
- package/apps/recipe-web/src/routes/+page.svelte +0 -352
- package/apps/recipe-web/src/routes/+page.ts +0 -107
- package/apps/recipe-web/src/routes/favorites/+page.svelte +0 -170
- package/apps/recipe-web/src/routes/my-recipes/+layout.ts +0 -55
- package/apps/recipe-web/src/routes/my-recipes/+page.svelte +0 -180
- package/apps/recipe-web/src/routes/my-recipes/[id]/edit/+page.svelte +0 -104
- package/apps/recipe-web/src/routes/my-recipes/new/+page.svelte +0 -67
- package/apps/recipe-web/src/routes/planner/+page.svelte +0 -422
- package/apps/recipe-web/src/routes/recipes/[id]/+page.svelte +0 -538
- package/apps/recipe-web/src/routes/recipes/[id]/+page.ts +0 -24
- package/apps/recipe-web/static/favicon.svg +0 -8
- package/apps/recipe-web/static/robots.txt +0 -2
- package/apps/recipe-web/svelte.config.js +0 -35
- package/apps/recipe-web/tsconfig.json +0 -14
- package/apps/recipe-web/vite.config.ts +0 -23
- package/packages/recipe-kit-stencil/README.md +0 -185
- package/packages/recipe-kit-stencil/package-lock.json +0 -4772
- package/packages/recipe-kit-stencil/package.json +0 -91
- package/packages/recipe-kit-stencil/src/components/rk-badge/readme.md +0 -38
- package/packages/recipe-kit-stencil/src/components/rk-badge/rk-badge.tsx +0 -31
- package/packages/recipe-kit-stencil/src/components/rk-chip/readme.md +0 -52
- package/packages/recipe-kit-stencil/src/components/rk-chip/rk-chip.tsx +0 -105
- package/packages/recipe-kit-stencil/src/components/rk-empty-state/readme.md +0 -44
- package/packages/recipe-kit-stencil/src/components/rk-empty-state/rk-empty-state.tsx +0 -50
- package/packages/recipe-kit-stencil/src/components/rk-meal-slot/readme.md +0 -58
- package/packages/recipe-kit-stencil/src/components/rk-meal-slot/rk-meal-slot.tsx +0 -182
- package/packages/recipe-kit-stencil/src/components/rk-modal/readme.md +0 -57
- package/packages/recipe-kit-stencil/src/components/rk-modal/rk-modal.tsx +0 -176
- package/packages/recipe-kit-stencil/src/components/rk-rating/readme.md +0 -42
- package/packages/recipe-kit-stencil/src/components/rk-rating/rk-rating.tsx +0 -114
- package/packages/recipe-kit-stencil/src/components/rk-recipe-card/readme.md +0 -66
- package/packages/recipe-kit-stencil/src/components/rk-recipe-card/rk-recipe-card.tsx +0 -179
- package/packages/recipe-kit-stencil/src/components/rk-recipe-card/test/rk-recipe-card.spec.tsx +0 -70
- package/packages/recipe-kit-stencil/src/components/rk-search-bar/readme.md +0 -67
- package/packages/recipe-kit-stencil/src/components/rk-search-bar/rk-search-bar.tsx +0 -152
- package/packages/recipe-kit-stencil/src/components/rk-search-bar/test/rk-search-bar.spec.tsx +0 -93
- package/packages/recipe-kit-stencil/src/components/rk-segmented-control/readme.md +0 -41
- package/packages/recipe-kit-stencil/src/components/rk-segmented-control/rk-segmented-control.tsx +0 -115
- package/packages/recipe-kit-stencil/src/components/rk-tag-input/readme.md +0 -47
- package/packages/recipe-kit-stencil/src/components/rk-tag-input/rk-tag-input.tsx +0 -181
- package/packages/recipe-kit-stencil/src/components/rk-tag-input/test/rk-tag-input.spec.tsx +0 -76
- package/packages/recipe-kit-stencil/src/index.html +0 -259
- package/packages/recipe-kit-stencil/stencil.config.ts +0 -41
- package/packages/recipe-kit-stencil/tsconfig.json +0 -24
- /package/{packages/recipe-kit-stencil/LICENSE → LICENSE} +0 -0
- /package/{packages/recipe-kit-stencil/src → dist/collection}/components/rk-badge/rk-badge.css +0 -0
- /package/{packages/recipe-kit-stencil/src → dist/collection}/components/rk-chip/rk-chip.css +0 -0
- /package/{packages/recipe-kit-stencil/src → dist/collection}/components/rk-empty-state/rk-empty-state.css +0 -0
- /package/{packages/recipe-kit-stencil/src → dist/collection}/components/rk-meal-slot/rk-meal-slot.css +0 -0
- /package/{packages/recipe-kit-stencil/src → dist/collection}/components/rk-modal/rk-modal.css +0 -0
- /package/{packages/recipe-kit-stencil/src → dist/collection}/components/rk-rating/rk-rating.css +0 -0
- /package/{packages/recipe-kit-stencil/src → dist/collection}/components/rk-recipe-card/rk-recipe-card.css +0 -0
- /package/{packages/recipe-kit-stencil/src → dist/collection}/components/rk-search-bar/rk-search-bar.css +0 -0
- /package/{packages/recipe-kit-stencil/src → dist/collection}/components/rk-segmented-control/rk-segmented-control.css +0 -0
- /package/{packages/recipe-kit-stencil/src → dist/collection}/components/rk-tag-input/rk-tag-input.css +0 -0
- /package/{packages/recipe-kit-stencil/src/global → dist/collection}/rk-global.css +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
/**
|
|
3
|
+
* An accessible dialog with a backdrop, Escape handling and focus restoration.
|
|
4
|
+
*
|
|
5
|
+
* The component is presentational: it emits `rkModalClose` and lets the host
|
|
6
|
+
* application own the `open` state.
|
|
7
|
+
*
|
|
8
|
+
* @slot - Dialog body.
|
|
9
|
+
* @slot header - Replaces the default heading row entirely.
|
|
10
|
+
* @slot footer - Action row pinned to the bottom of the dialog.
|
|
11
|
+
*/
|
|
12
|
+
export declare class RkModal {
|
|
13
|
+
host: HTMLElement;
|
|
14
|
+
/** Controls visibility. */
|
|
15
|
+
open: boolean;
|
|
16
|
+
/** Heading text for the default header. */
|
|
17
|
+
heading: string;
|
|
18
|
+
/** Optional supporting line under the heading. */
|
|
19
|
+
subheading?: string;
|
|
20
|
+
/** Dialog width preset. */
|
|
21
|
+
size: 'sm' | 'md' | 'lg';
|
|
22
|
+
/** Set to false to require an explicit action to dismiss. */
|
|
23
|
+
dismissible: boolean;
|
|
24
|
+
/** Emitted when the user requests dismissal (X, backdrop or Escape). */
|
|
25
|
+
rkModalClose: EventEmitter<void>;
|
|
26
|
+
private hasFooter;
|
|
27
|
+
private previouslyFocused?;
|
|
28
|
+
private panelEl?;
|
|
29
|
+
/** Collapses the footer region when no action row was projected into it. */
|
|
30
|
+
private syncFooterSlot;
|
|
31
|
+
protected onOpenChange(isOpen: boolean, wasOpen: boolean): void;
|
|
32
|
+
componentWillLoad(): void;
|
|
33
|
+
componentDidLoad(): void;
|
|
34
|
+
disconnectedCallback(): void;
|
|
35
|
+
private lockScroll;
|
|
36
|
+
private focusableElements;
|
|
37
|
+
private focusFirst;
|
|
38
|
+
private handleGlobalKeyDown;
|
|
39
|
+
private handleBackdrop;
|
|
40
|
+
render(): any;
|
|
41
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
/**
|
|
3
|
+
* A star rating that works as a read-only display or an interactive input.
|
|
4
|
+
*/
|
|
5
|
+
export declare class RkRating {
|
|
6
|
+
/** Current rating. Supports halves when `readonly`. */
|
|
7
|
+
value: number;
|
|
8
|
+
/** Number of stars. */
|
|
9
|
+
max: number;
|
|
10
|
+
/** When true the stars are display-only and not focusable. */
|
|
11
|
+
readonly: boolean;
|
|
12
|
+
/** Star size in pixels. */
|
|
13
|
+
size: number;
|
|
14
|
+
/** Accessible label for the group. */
|
|
15
|
+
label: string;
|
|
16
|
+
/** Renders the numeric value next to the stars. */
|
|
17
|
+
showValue: boolean;
|
|
18
|
+
/** Optional count of ratings, rendered as "(24)". */
|
|
19
|
+
count?: number;
|
|
20
|
+
/** Emitted when the user picks a new rating. */
|
|
21
|
+
rkRatingChange: EventEmitter<number>;
|
|
22
|
+
private hovered;
|
|
23
|
+
private select;
|
|
24
|
+
private handleKeyDown;
|
|
25
|
+
render(): any;
|
|
26
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export interface RkRecipeCardSelectDetail {
|
|
3
|
+
recipeId: string;
|
|
4
|
+
name: string;
|
|
5
|
+
origin: 'api' | 'custom';
|
|
6
|
+
}
|
|
7
|
+
export interface RkFavoriteToggleDetail {
|
|
8
|
+
recipeId: string;
|
|
9
|
+
name: string;
|
|
10
|
+
origin: 'api' | 'custom';
|
|
11
|
+
/** The state the host app should move *to*. */
|
|
12
|
+
favorite: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The primary recipe tile used across discovery, favorites and search results.
|
|
16
|
+
*
|
|
17
|
+
* All data arrives as individual primitive properties rather than one object
|
|
18
|
+
* prop, so the component works with plain HTML attributes in any framework.
|
|
19
|
+
*
|
|
20
|
+
* @slot - Extra metadata rendered under the title (badges, tags, ratings).
|
|
21
|
+
* @slot actions - Buttons rendered in the card footer (e.g. "Add to plan").
|
|
22
|
+
*/
|
|
23
|
+
export declare class RkRecipeCard {
|
|
24
|
+
host: HTMLElement;
|
|
25
|
+
/** Stable identifier echoed back in every event payload. */
|
|
26
|
+
recipeId: string;
|
|
27
|
+
/** Recipe title. */
|
|
28
|
+
name: string;
|
|
29
|
+
/** Thumbnail URL. */
|
|
30
|
+
image?: string;
|
|
31
|
+
/** Category, e.g. "Dessert". */
|
|
32
|
+
category?: string;
|
|
33
|
+
/** Cuisine / region, e.g. "Italian". */
|
|
34
|
+
area?: string;
|
|
35
|
+
/** Total time in minutes. Hidden when omitted. */
|
|
36
|
+
minutes?: number;
|
|
37
|
+
/** Number of servings. Hidden when omitted. */
|
|
38
|
+
servings?: number;
|
|
39
|
+
/** Whether this recipe is currently favorited. */
|
|
40
|
+
favorite: boolean;
|
|
41
|
+
/** `custom` recipes are user-authored and get an "Owned" badge. */
|
|
42
|
+
origin: 'api' | 'custom';
|
|
43
|
+
/** Real href used for accessibility, SEO and middle-click / open-in-new-tab. */
|
|
44
|
+
href?: string;
|
|
45
|
+
/** Renders a compact horizontal layout, for dense lists and the planner. */
|
|
46
|
+
compact: boolean;
|
|
47
|
+
/** Hides the favorite button entirely (e.g. inside the planner). */
|
|
48
|
+
hideFavorite: boolean;
|
|
49
|
+
/** Emitted on primary activation. The host app performs the navigation. */
|
|
50
|
+
rkCardSelect: EventEmitter<RkRecipeCardSelectDetail>;
|
|
51
|
+
/** Emitted when the favorite button is pressed. */
|
|
52
|
+
rkFavoriteToggle: EventEmitter<RkFavoriteToggleDetail>;
|
|
53
|
+
private imageFailed;
|
|
54
|
+
private hasExtra;
|
|
55
|
+
private hasActions;
|
|
56
|
+
componentWillLoad(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Slot content is optional, and an empty wrapper would still paint padding and
|
|
59
|
+
* a border. Tracking what was actually projected lets the card collapse those
|
|
60
|
+
* regions instead. Re-run on `slotchange` so framework-driven updates count.
|
|
61
|
+
*/
|
|
62
|
+
private syncSlots;
|
|
63
|
+
private get detail();
|
|
64
|
+
private handleSelect;
|
|
65
|
+
private handleFavorite;
|
|
66
|
+
render(): any;
|
|
67
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
/**
|
|
3
|
+
* A debounced search input with a clear affordance and a slot for extra controls.
|
|
4
|
+
*
|
|
5
|
+
* @slot actions - Rendered to the right of the input, inside the field shell.
|
|
6
|
+
* Useful for a "filters" toggle or a sort control.
|
|
7
|
+
*/
|
|
8
|
+
export declare class RkSearchBar {
|
|
9
|
+
/** Current text in the field. Two-way: updated as the user types. */
|
|
10
|
+
value: string;
|
|
11
|
+
/** Placeholder shown when the field is empty. */
|
|
12
|
+
placeholder: string;
|
|
13
|
+
/** Accessible label for the input. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** Milliseconds to wait after the last keystroke before emitting `rkSearch`. */
|
|
16
|
+
debounce: number;
|
|
17
|
+
/** Disables the whole control. */
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
/** Shows a busy indicator (e.g. while the app is fetching results). */
|
|
20
|
+
loading: boolean;
|
|
21
|
+
/** Optional helper text rendered under the field. */
|
|
22
|
+
hint?: string;
|
|
23
|
+
/** Emitted with the (trimmed) query after the debounce window, or on submit. */
|
|
24
|
+
rkSearch: EventEmitter<string>;
|
|
25
|
+
/** Emitted when the user clears the field with the clear button or Escape. */
|
|
26
|
+
rkClear: EventEmitter<void>;
|
|
27
|
+
private focused;
|
|
28
|
+
private inputEl?;
|
|
29
|
+
private timer?;
|
|
30
|
+
protected onValueChange(next: string, prev: string): void;
|
|
31
|
+
disconnectedCallback(): void;
|
|
32
|
+
/** Programmatically focus the input. */
|
|
33
|
+
setFocus(): Promise<void>;
|
|
34
|
+
private emit;
|
|
35
|
+
private handleInput;
|
|
36
|
+
private handleKeyDown;
|
|
37
|
+
private handleClear;
|
|
38
|
+
render(): any;
|
|
39
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export interface RkSegmentOption {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
/** Optional trailing count, e.g. number of items in that segment. */
|
|
6
|
+
count?: number;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A single-select segmented control, used for sorting and view switching.
|
|
11
|
+
*
|
|
12
|
+
* `options` is a complex property. Frameworks should assign it as a DOM
|
|
13
|
+
* property; for plain HTML it also accepts a JSON string attribute.
|
|
14
|
+
*/
|
|
15
|
+
export declare class RkSegmentedControl {
|
|
16
|
+
/** The available segments. Accepts an array or a JSON-encoded string. */
|
|
17
|
+
options: RkSegmentOption[] | string;
|
|
18
|
+
/** The value of the selected segment. */
|
|
19
|
+
value?: string;
|
|
20
|
+
/** Accessible label for the group. */
|
|
21
|
+
label: string;
|
|
22
|
+
/** Stretches the control to fill its container. */
|
|
23
|
+
stretch: boolean;
|
|
24
|
+
/** Emitted with the newly selected value. */
|
|
25
|
+
rkSegmentChange: EventEmitter<string>;
|
|
26
|
+
private parsed;
|
|
27
|
+
protected onOptionsChange(): void;
|
|
28
|
+
componentWillLoad(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Attributes can only carry strings, so a JSON payload is accepted as a
|
|
31
|
+
* fallback for consumers that cannot set DOM properties.
|
|
32
|
+
*/
|
|
33
|
+
private parseOptions;
|
|
34
|
+
private select;
|
|
35
|
+
private handleKeyDown;
|
|
36
|
+
render(): any;
|
|
37
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
/**
|
|
3
|
+
* A tag / token editor used for recipe tags and free-form ingredient lists.
|
|
4
|
+
*
|
|
5
|
+
* `values` is an array property — the SvelteKit app assigns it as a DOM
|
|
6
|
+
* property. A JSON-encoded or comma-separated string attribute also works.
|
|
7
|
+
*/
|
|
8
|
+
export declare class RkTagInput {
|
|
9
|
+
/** Current tags. Array, JSON string, or comma-separated string. */
|
|
10
|
+
values: string[] | string;
|
|
11
|
+
/** Placeholder for the entry field. */
|
|
12
|
+
placeholder: string;
|
|
13
|
+
/** Visible field label. */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** Maximum number of tags. `0` means unlimited. */
|
|
16
|
+
maxTags: number;
|
|
17
|
+
/** Prevent editing. */
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
/** Validation message rendered under the field. */
|
|
20
|
+
error?: string;
|
|
21
|
+
/** Emitted with the full, updated list whenever tags change. */
|
|
22
|
+
rkTagsChange: EventEmitter<string[]>;
|
|
23
|
+
private draft;
|
|
24
|
+
private tags;
|
|
25
|
+
private inputEl?;
|
|
26
|
+
protected onValuesChange(): void;
|
|
27
|
+
componentWillLoad(): void;
|
|
28
|
+
private syncTags;
|
|
29
|
+
private get atCapacity();
|
|
30
|
+
private commit;
|
|
31
|
+
private addDraft;
|
|
32
|
+
private removeAt;
|
|
33
|
+
private handleKeyDown;
|
|
34
|
+
render(): any;
|
|
35
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This is an autogenerated file created by the Stencil compiler.
|
|
5
5
|
* It contains typing information for all components that exist in this project.
|
|
6
6
|
*/
|
|
7
|
-
import { HTMLStencilElement, JSXBase } from "
|
|
7
|
+
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
8
|
import { RkMealDropDetail, RkMealRecipeDetail, RkMealSlotDetail } from "./components/rk-meal-slot/rk-meal-slot";
|
|
9
9
|
import { RkFavoriteToggleDetail, RkRecipeCardSelectDetail } from "./components/rk-recipe-card/rk-recipe-card";
|
|
10
10
|
import { RkSegmentOption } from "./components/rk-segmented-control/rk-segmented-control";
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export { Components, JSX } from './components';
|
|
2
|
-
|
|
3
|
-
// Event payload contracts, re-exported so consumers can type their handlers.
|
|
4
2
|
export type { RkRecipeCardSelectDetail, RkFavoriteToggleDetail } from './components/rk-recipe-card/rk-recipe-card';
|
|
5
3
|
export type { RkSegmentOption } from './components/rk-segmented-control/rk-segmented-control';
|
|
6
4
|
export type { RkMealSlotDetail, RkMealRecipeDetail, RkMealDropDetail } from './components/rk-meal-slot/rk-meal-slot';
|