@openpawlabs/diy-guides-ui 1.0.0 → 1.1.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/dist/components/GuideStep/GuideStep.d.ts +35 -2
- package/dist/components/GuideStep/GuideStep.d.ts.map +1 -1
- package/dist/components/GuideStep/GuideStep.stories.d.ts +3 -2
- package/dist/components/GuideStep/GuideStep.stories.d.ts.map +1 -1
- package/dist/components/GuideStep/index.d.ts +1 -1
- package/dist/components/GuideStep/index.d.ts.map +1 -1
- package/dist/components/GuideStepList/GuideStepList.stories.d.ts.map +1 -1
- package/dist/components/MediaFigure/MediaFigureModel.d.ts.map +1 -1
- package/dist/diy-guides-ui.cjs +5 -5
- package/dist/diy-guides-ui.cjs.map +1 -1
- package/dist/diy-guides-ui.js +2172 -2007
- package/dist/diy-guides-ui.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +12 -11
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import { type GuideColor } from "../../types/colors";
|
|
3
|
+
/**
|
|
4
|
+
* Optional, editor-only media affordances. Presence switches `GuideStep.Media`
|
|
5
|
+
* into edit mode: an empty-state add target, click-to-replace on the main image,
|
|
6
|
+
* a remove control per thumbnail, and a "+" tile to append. All members are
|
|
7
|
+
* intent callbacks — the library performs no file or menu logic. Omit entirely
|
|
8
|
+
* for the read-only reader experience.
|
|
9
|
+
*/
|
|
10
|
+
export interface GuideStepMediaEditing {
|
|
11
|
+
/** Append a new image (e.g. open a file picker). Drives the empty target and "+" tile. */
|
|
12
|
+
onAddImage?: () => void;
|
|
13
|
+
/** Replace the image at `index` (fired by clicking the main image). */
|
|
14
|
+
onReplaceImage?: (index: number) => void;
|
|
15
|
+
/** Remove the image at `index` (fired by a thumbnail's remove control). */
|
|
16
|
+
onRemoveImage?: (index: number) => void;
|
|
17
|
+
/** Selection changed to `index` (in edit mode thumbnails select on click). */
|
|
18
|
+
onSelectImage?: (index: number) => void;
|
|
19
|
+
/** Controlled active image index. */
|
|
20
|
+
activeIndex?: number;
|
|
21
|
+
/** Show the "+" add tile while below the three-image limit. @default true */
|
|
22
|
+
canAddImage?: boolean;
|
|
23
|
+
}
|
|
3
24
|
export interface GuideStepProps {
|
|
4
25
|
/** Step number shown in the badge. Auto-assigned when inside `GuideStepList`. */
|
|
5
26
|
number?: number;
|
|
@@ -13,6 +34,11 @@ export interface GuideStepProps {
|
|
|
13
34
|
onCompletedChange?: (completed: boolean) => void;
|
|
14
35
|
/** Render the "mark complete" checkbox. @default true */
|
|
15
36
|
completable?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Editor-only media affordances. When provided, the media area becomes
|
|
39
|
+
* editable (add / replace / remove / select). Leave undefined for readers.
|
|
40
|
+
*/
|
|
41
|
+
mediaEditing?: GuideStepMediaEditing;
|
|
16
42
|
/** Step body — requires `GuideStep.Media` (≥1 image) and `GuideStep.Bullets` (≥1 bullet). */
|
|
17
43
|
children?: ReactNode;
|
|
18
44
|
className?: string;
|
|
@@ -32,6 +58,13 @@ export interface GuideStepBulletProps {
|
|
|
32
58
|
label?: ReactNode;
|
|
33
59
|
/** Hide the auto-generated label for `caution`, `reminder`, and `note` bullets. */
|
|
34
60
|
hideLabel?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Editor-only: when set, the marker (dot or semantic icon) renders as a button
|
|
63
|
+
* that fires this on press — e.g. to open a color / variant picker. Omit for readers.
|
|
64
|
+
*/
|
|
65
|
+
onMarkerPress?: () => void;
|
|
66
|
+
/** Accessible label for the marker button when `onMarkerPress` is set. */
|
|
67
|
+
markerAriaLabel?: string;
|
|
35
68
|
children: ReactNode;
|
|
36
69
|
className?: string;
|
|
37
70
|
}
|
|
@@ -45,8 +78,8 @@ declare function GuideStepBullets({ children, className, }: {
|
|
|
45
78
|
className?: string;
|
|
46
79
|
}): import("react").JSX.Element;
|
|
47
80
|
/** A single instruction line — dot bullets or semantic caution / reminder / note bullets. */
|
|
48
|
-
declare function GuideStepBullet({ variant, color, label, hideLabel, children, className, }: GuideStepBulletProps): import("react").JSX.Element;
|
|
49
|
-
declare function GuideStepRoot({ number, title, isCompleted, defaultCompleted, onCompletedChange, completable, children, className, }: GuideStepProps): import("react").JSX.Element;
|
|
81
|
+
declare function GuideStepBullet({ variant, color, label, hideLabel, onMarkerPress, markerAriaLabel, children, className, }: GuideStepBulletProps): import("react").JSX.Element;
|
|
82
|
+
declare function GuideStepRoot({ number, title, isCompleted, defaultCompleted, onCompletedChange, completable, mediaEditing, children, className, }: GuideStepProps): import("react").JSX.Element;
|
|
50
83
|
/**
|
|
51
84
|
* A single numbered guide step: header with number badge and optional completion
|
|
52
85
|
* checkbox, plus a two-column body (main image left, thumbnails + bullets right).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuideStep.d.ts","sourceRoot":"","sources":["../../../src/components/GuideStep/GuideStep.tsx"],"names":[],"mappings":"AAEA,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,EAAU,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAW7D,MAAM,WAAW,cAAc;IAC7B,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,mCAAmC;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,6DAA6D;IAC7D,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,yDAAyD;IACzD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,4FAA4F;AAC5F,MAA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oB,+BAgEtB;AA6KD,iBAAS,aAAa,CAAC,EACrB,MAAM,EACN,KAAK,EACL,WAAW,EACX,gBAAwB,EACxB,iBAAiB,EACjB,WAAkB,EAClB,YAAY,EACZ,QAAQ,EACR,SAAS,GACV,EAAE,cAAc,+BAsFhB;AAED;;;;;GAKG;AACH,eAAO,MAAM,SAAS;;;;CAIpB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { StoryObj } from "@storybook/react-vite";
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: (({ number, title, isCompleted, defaultCompleted, onCompletedChange, completable, children, className, }: import("./GuideStep").GuideStepProps) => import("react").JSX.Element) & {
|
|
4
|
+
component: (({ number, title, isCompleted, defaultCompleted, onCompletedChange, completable, mediaEditing, children, className, }: import("./GuideStep").GuideStepProps) => import("react").JSX.Element) & {
|
|
5
5
|
Media: (_props: {
|
|
6
6
|
children?: import("react").ReactNode;
|
|
7
7
|
}) => null;
|
|
@@ -9,7 +9,7 @@ declare const meta: {
|
|
|
9
9
|
children: import("react").ReactNode;
|
|
10
10
|
className?: string;
|
|
11
11
|
}) => import("react").JSX.Element;
|
|
12
|
-
Bullet: ({ variant, color, label, hideLabel, children, className, }: import("./GuideStep").GuideStepBulletProps) => import("react").JSX.Element;
|
|
12
|
+
Bullet: ({ variant, color, label, hideLabel, onMarkerPress, markerAriaLabel, children, className, }: import("./GuideStep").GuideStepBulletProps) => import("react").JSX.Element;
|
|
13
13
|
};
|
|
14
14
|
tags: string[];
|
|
15
15
|
parameters: {
|
|
@@ -32,5 +32,6 @@ export declare const MultipleImages: Story;
|
|
|
32
32
|
export declare const DotBullets: Story;
|
|
33
33
|
export declare const SemanticBullets: Story;
|
|
34
34
|
export declare const Completed: Story;
|
|
35
|
+
export declare const EditingAffordances: Story;
|
|
35
36
|
export declare const WithoutCompletion: Story;
|
|
36
37
|
//# sourceMappingURL=GuideStep.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuideStep.stories.d.ts","sourceRoot":"","sources":["../../../src/components/GuideStep/GuideStep.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GuideStep.stories.d.ts","sourceRoot":"","sources":["../../../src/components/GuideStep/GuideStep.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AA+D5D,QAAA,MAAM,IAAI;;;;oBA4KoD,CAAC;;;;qBAMnD,CAAC;;;;;;;;;;;;;;;;;CAtKqB,CAAC;AAEnC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAgCrB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAmC5B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAsCxB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAoC7B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAwBvB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAuEhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KA0B/B,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { GuideStep } from "./GuideStep";
|
|
2
|
-
export type { GuideStepProps, GuideStepBulletProps, GuideStepBulletVariant } from "./GuideStep";
|
|
2
|
+
export type { GuideStepProps, GuideStepBulletProps, GuideStepBulletVariant, GuideStepMediaEditing, } from "./GuideStep";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/GuideStep/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/GuideStep/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EACV,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuideStepList.stories.d.ts","sourceRoot":"","sources":["../../../src/components/GuideStepList/GuideStepList.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAkBhD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;CAQ4B,CAAC;AAEvC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"GuideStepList.stories.d.ts","sourceRoot":"","sources":["../../../src/components/GuideStepList/GuideStepList.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAkBhD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;CAQ4B,CAAC;AAEvC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAyDrB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAmClC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAmChC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaFigureModel.d.ts","sourceRoot":"","sources":["../../../src/components/MediaFigure/MediaFigureModel.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,EAAE,qBAAqB,+
|
|
1
|
+
{"version":3,"file":"MediaFigureModel.d.ts","sourceRoot":"","sources":["../../../src/components/MediaFigure/MediaFigureModel.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,EAAE,qBAAqB,+BAyD9D"}
|