@openpawlabs/diy-guides-ui 1.0.0 → 1.2.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 +1 -0
- package/dist/components/GuideStep/GuideStep.d.ts +48 -5
- package/dist/components/GuideStep/GuideStep.d.ts.map +1 -1
- package/dist/components/GuideStep/GuideStep.stories.d.ts +4 -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/LinkButton/LinkButton.d.ts +63 -0
- package/dist/components/LinkButton/LinkButton.d.ts.map +1 -0
- package/dist/components/LinkButton/LinkButton.stories.d.ts +37 -0
- package/dist/components/LinkButton/LinkButton.stories.d.ts.map +1 -0
- package/dist/components/LinkButton/LinkButton.test.d.ts +2 -0
- package/dist/components/LinkButton/LinkButton.test.d.ts.map +1 -0
- package/dist/components/LinkButton/index.d.ts +3 -0
- package/dist/components/LinkButton/index.d.ts.map +1 -0
- package/dist/components/MediaFigure/MediaFigureModel.d.ts.map +1 -1
- package/dist/diy-guides-ui.cjs +10 -5
- package/dist/diy-guides-ui.cjs.map +1 -1
- package/dist/diy-guides-ui.js +8923 -3429
- package/dist/diy-guides-ui.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +12 -11
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@ Active development. The core guide component set is implemented, tested, and doc
|
|
|
13
13
|
| `GuideStep` | A single step — number badge, completion checkbox, media, and bulleted instructions |
|
|
14
14
|
| `MediaFigure` | Image/video with percentage-positioned annotation markers |
|
|
15
15
|
| `ToolList` | Titled card of required tools and parts |
|
|
16
|
+
| `LinkButton` | Download / link button with an optional dropdown of file variants |
|
|
16
17
|
| `Callout` | Safety / informational callout (`note` → `danger` types) |
|
|
17
18
|
| `DifficultyBadge` | Color-coded difficulty pill (easy / moderate / difficult) |
|
|
18
19
|
|
|
@@ -1,5 +1,31 @@
|
|
|
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, a "+" tile to append, and (with `onReorderImage`)
|
|
7
|
+
* drag-to-reorder thumbnails. All members are intent callbacks — the library
|
|
8
|
+
* performs no file or menu logic. Omit entirely 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
|
+
/**
|
|
18
|
+
* Move the image from `from` to `to`. When set, edit-mode thumbnails become
|
|
19
|
+
* drag-reorderable (the library only reports the move; the consumer reorders).
|
|
20
|
+
*/
|
|
21
|
+
onReorderImage?: (from: number, to: number) => void;
|
|
22
|
+
/** Selection changed to `index` (in edit mode thumbnails select on click). */
|
|
23
|
+
onSelectImage?: (index: number) => void;
|
|
24
|
+
/** Controlled active image index. */
|
|
25
|
+
activeIndex?: number;
|
|
26
|
+
/** Show the "+" add tile while below the three-image limit. @default true */
|
|
27
|
+
canAddImage?: boolean;
|
|
28
|
+
}
|
|
3
29
|
export interface GuideStepProps {
|
|
4
30
|
/** Step number shown in the badge. Auto-assigned when inside `GuideStepList`. */
|
|
5
31
|
number?: number;
|
|
@@ -13,16 +39,26 @@ export interface GuideStepProps {
|
|
|
13
39
|
onCompletedChange?: (completed: boolean) => void;
|
|
14
40
|
/** Render the "mark complete" checkbox. @default true */
|
|
15
41
|
completable?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Editor-only media affordances. When provided, the media area becomes
|
|
44
|
+
* editable (add / replace / remove / select). Leave undefined for readers.
|
|
45
|
+
*/
|
|
46
|
+
mediaEditing?: GuideStepMediaEditing;
|
|
16
47
|
/** Step body — requires `GuideStep.Media` (≥1 image) and `GuideStep.Bullets` (≥1 bullet). */
|
|
17
48
|
children?: ReactNode;
|
|
18
49
|
className?: string;
|
|
19
50
|
}
|
|
20
|
-
/**
|
|
21
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Bullet presentation — `dot` uses a colored dot; `caution` / `reminder` / `note`
|
|
53
|
+
* use semantic icons and labels; `button` renders its children (e.g. a `LinkButton`)
|
|
54
|
+
* as a standalone action with no marker.
|
|
55
|
+
*/
|
|
56
|
+
export type GuideStepBulletVariant = "dot" | "caution" | "reminder" | "note" | "button";
|
|
22
57
|
export interface GuideStepBulletProps {
|
|
23
58
|
/**
|
|
24
59
|
* Bullet style. `dot` renders a colored dot (link to `MediaFigure`
|
|
25
|
-
* annotations); `caution`, `reminder`, and `note` render iFixit-style semantic bullets
|
|
60
|
+
* annotations); `caution`, `reminder`, and `note` render iFixit-style semantic bullets;
|
|
61
|
+
* `button` renders its children (typically a `LinkButton`) with no marker.
|
|
26
62
|
* @default "dot"
|
|
27
63
|
*/
|
|
28
64
|
variant?: GuideStepBulletVariant;
|
|
@@ -32,6 +68,13 @@ export interface GuideStepBulletProps {
|
|
|
32
68
|
label?: ReactNode;
|
|
33
69
|
/** Hide the auto-generated label for `caution`, `reminder`, and `note` bullets. */
|
|
34
70
|
hideLabel?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Editor-only: when set, the marker (dot or semantic icon) renders as a button
|
|
73
|
+
* that fires this on press — e.g. to open a color / variant picker. Omit for readers.
|
|
74
|
+
*/
|
|
75
|
+
onMarkerPress?: () => void;
|
|
76
|
+
/** Accessible label for the marker button when `onMarkerPress` is set. */
|
|
77
|
+
markerAriaLabel?: string;
|
|
35
78
|
children: ReactNode;
|
|
36
79
|
className?: string;
|
|
37
80
|
}
|
|
@@ -45,8 +88,8 @@ declare function GuideStepBullets({ children, className, }: {
|
|
|
45
88
|
className?: string;
|
|
46
89
|
}): import("react").JSX.Element;
|
|
47
90
|
/** 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;
|
|
91
|
+
declare function GuideStepBullet({ variant, color, label, hideLabel, onMarkerPress, markerAriaLabel, children, className, }: GuideStepBulletProps): import("react").JSX.Element;
|
|
92
|
+
declare function GuideStepRoot({ number, title, isCompleted, defaultCompleted, onCompletedChange, completable, mediaEditing, children, className, }: GuideStepProps): import("react").JSX.Element;
|
|
50
93
|
/**
|
|
51
94
|
* A single numbered guide step: header with number badge and optional completion
|
|
52
95
|
* 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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,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: {
|
|
@@ -31,6 +31,8 @@ export declare const Anatomy: Story;
|
|
|
31
31
|
export declare const MultipleImages: Story;
|
|
32
32
|
export declare const DotBullets: Story;
|
|
33
33
|
export declare const SemanticBullets: Story;
|
|
34
|
+
export declare const ButtonBullet: Story;
|
|
34
35
|
export declare const Completed: Story;
|
|
36
|
+
export declare const EditingAffordances: Story;
|
|
35
37
|
export declare const WithoutCompletion: Story;
|
|
36
38
|
//# 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;AAqE5D,QAAA,MAAM,IAAI;;;;oBAgLR,CAAA;;;;qBAMQ,CAAN;;;;;;;;;;;;;;;;;CA1K8B,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,YAAY,EAAE,KAsC1B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAwBvB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KA8EhC,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"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type ButtonVariants } from "@heroui/react";
|
|
3
|
+
/** HeroUI button look applied to the button. @default "primary" */
|
|
4
|
+
export type LinkButtonVariant = NonNullable<ButtonVariants["variant"]>;
|
|
5
|
+
/** HeroUI button size. @default "md" */
|
|
6
|
+
export type LinkButtonSize = NonNullable<ButtonVariants["size"]>;
|
|
7
|
+
export interface LinkButtonItemProps {
|
|
8
|
+
/** Destination — a URL to navigate to, or a (relative) file path to download. */
|
|
9
|
+
href: string;
|
|
10
|
+
/** Download instead of navigate. `true` keeps the file name; a string renames it. */
|
|
11
|
+
download?: boolean | string;
|
|
12
|
+
/** Open in a new tab (sets `target="_blank"` + safe `rel`). */
|
|
13
|
+
external?: boolean;
|
|
14
|
+
/** The visible label. Kept as children so editors can edit it in place. */
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Optional, editor-only affordances. Presence switches `LinkButton` into edit
|
|
19
|
+
* mode: the primary action stops navigating, its label becomes editable in place,
|
|
20
|
+
* and a chevron reveals an options panel for managing the other links. Every
|
|
21
|
+
* member is an intent callback — the library performs no file or menu logic.
|
|
22
|
+
* Omit entirely for the read-only reader experience.
|
|
23
|
+
*/
|
|
24
|
+
export interface LinkButtonEditing {
|
|
25
|
+
/** Append a new option (e.g. seed a blank link). Drives the "Add option" control. */
|
|
26
|
+
onAddItem?: () => void;
|
|
27
|
+
/** Remove the option at `index`. */
|
|
28
|
+
onRemoveItem?: (index: number) => void;
|
|
29
|
+
/** Move the option from `from` to `to` (drag-reorder + "make default"). */
|
|
30
|
+
onReorderItem?: (from: number, to: number) => void;
|
|
31
|
+
/** Edit the option at `index` — e.g. open a link / upload picker for its href. */
|
|
32
|
+
onSelectItem?: (index: number) => void;
|
|
33
|
+
}
|
|
34
|
+
export interface LinkButtonProps {
|
|
35
|
+
/** HeroUI button variant for theming. @default "primary" */
|
|
36
|
+
variant?: LinkButtonVariant;
|
|
37
|
+
/** HeroUI button size. @default "md" */
|
|
38
|
+
size?: LinkButtonSize;
|
|
39
|
+
/** Optional leading icon on the primary action. */
|
|
40
|
+
icon?: ReactNode;
|
|
41
|
+
/** Accessible label for the dropdown trigger. @default "More download options" */
|
|
42
|
+
menuLabel?: string;
|
|
43
|
+
/** Opt-in editor affordances; presence enables edit mode. Omit for readers. */
|
|
44
|
+
editing?: LinkButtonEditing;
|
|
45
|
+
/** `LinkButton.Item` children — the first is the primary action, the rest fill the menu. */
|
|
46
|
+
children: ReactNode;
|
|
47
|
+
className?: string;
|
|
48
|
+
}
|
|
49
|
+
/** Data-only carrier; `LinkButton` reads its props and places the label itself. */
|
|
50
|
+
declare function LinkButtonItem(_props: LinkButtonItemProps): null;
|
|
51
|
+
declare function LinkButtonRoot({ variant, size, icon, menuLabel, editing, children, className, }: LinkButtonProps): import("react").JSX.Element | null;
|
|
52
|
+
/**
|
|
53
|
+
* A download / navigation button with an optional dropdown of alternatives. With a
|
|
54
|
+
* single `LinkButton.Item` it renders one button that links or downloads; with more,
|
|
55
|
+
* it becomes a split button — the first item is the primary action and the rest sit
|
|
56
|
+
* behind a chevron. Provide `editing` to drive it from an authoring tool without
|
|
57
|
+
* changing the reader output.
|
|
58
|
+
*/
|
|
59
|
+
export declare const LinkButton: typeof LinkButtonRoot & {
|
|
60
|
+
Item: typeof LinkButtonItem;
|
|
61
|
+
};
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=LinkButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinkButton.d.ts","sourceRoot":"","sources":["../../../src/components/LinkButton/LinkButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AAEvB,mEAAmE;AACnE,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC;AACvE,wCAAwC;AACxC,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC,MA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;;;;;;GAMG;AACH,eAAO,MAAM,UAAU;;CAA0D,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: (({ variant, size, icon, menuLabel, editing, children, className, }: import("./LinkButton").LinkButtonProps) => import("react").JSX.Element | null) & {
|
|
5
|
+
Item: (_props: import("./LinkButton").LinkButtonItemProps) => null;
|
|
6
|
+
};
|
|
7
|
+
tags: string[];
|
|
8
|
+
parameters: {
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
argTypes: {
|
|
16
|
+
variant: {
|
|
17
|
+
control: "select";
|
|
18
|
+
options: string[];
|
|
19
|
+
};
|
|
20
|
+
size: {
|
|
21
|
+
control: "inline-radio";
|
|
22
|
+
options: string[];
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
args: {
|
|
26
|
+
variant: "primary";
|
|
27
|
+
size: "md";
|
|
28
|
+
children: import("react").JSX.Element;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export default meta;
|
|
32
|
+
type Story = StoryObj<typeof meta>;
|
|
33
|
+
export declare const Single: Story;
|
|
34
|
+
export declare const Split: Story;
|
|
35
|
+
export declare const Navigation: Story;
|
|
36
|
+
export declare const EditingAffordances: Story;
|
|
37
|
+
//# sourceMappingURL=LinkButton.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinkButton.stories.d.ts","sourceRoot":"","sources":["../../../src/components/LinkButton/LinkButton.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AA2C5D,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCyB,CAAC;AAEpC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,MAAM,EAAE,KAiBpB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAuBnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAoBxB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAwDhC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinkButton.test.d.ts","sourceRoot":"","sources":["../../../src/components/LinkButton/LinkButton.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/LinkButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,GACf,MAAM,cAAc,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"}
|