@openpawlabs/diy-guides-ui 1.0.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/LICENSE +661 -0
- package/README.md +126 -0
- package/dist/components/Callout/Callout.d.ts +21 -0
- package/dist/components/Callout/Callout.d.ts.map +1 -0
- package/dist/components/Callout/Callout.stories.d.ts +31 -0
- package/dist/components/Callout/Callout.stories.d.ts.map +1 -0
- package/dist/components/Callout/Callout.test.d.ts +2 -0
- package/dist/components/Callout/Callout.test.d.ts.map +1 -0
- package/dist/components/Callout/index.d.ts +3 -0
- package/dist/components/Callout/index.d.ts.map +1 -0
- package/dist/components/DifficultyBadge/DifficultyBadge.d.ts +20 -0
- package/dist/components/DifficultyBadge/DifficultyBadge.d.ts.map +1 -0
- package/dist/components/DifficultyBadge/DifficultyBadge.stories.d.ts +37 -0
- package/dist/components/DifficultyBadge/DifficultyBadge.stories.d.ts.map +1 -0
- package/dist/components/DifficultyBadge/DifficultyBadge.test.d.ts +2 -0
- package/dist/components/DifficultyBadge/DifficultyBadge.test.d.ts.map +1 -0
- package/dist/components/DifficultyBadge/index.d.ts +3 -0
- package/dist/components/DifficultyBadge/index.d.ts.map +1 -0
- package/dist/components/GuideLayout/GuideLayout.d.ts +49 -0
- package/dist/components/GuideLayout/GuideLayout.d.ts.map +1 -0
- package/dist/components/GuideLayout/GuideLayout.stories.d.ts +33 -0
- package/dist/components/GuideLayout/GuideLayout.stories.d.ts.map +1 -0
- package/dist/components/GuideLayout/GuideLayout.test.d.ts +2 -0
- package/dist/components/GuideLayout/GuideLayout.test.d.ts.map +1 -0
- package/dist/components/GuideLayout/index.d.ts +3 -0
- package/dist/components/GuideLayout/index.d.ts.map +1 -0
- package/dist/components/GuideStep/GuideStep.d.ts +62 -0
- package/dist/components/GuideStep/GuideStep.d.ts.map +1 -0
- package/dist/components/GuideStep/GuideStep.stories.d.ts +36 -0
- package/dist/components/GuideStep/GuideStep.stories.d.ts.map +1 -0
- package/dist/components/GuideStep/GuideStep.test.d.ts +2 -0
- package/dist/components/GuideStep/GuideStep.test.d.ts.map +1 -0
- package/dist/components/GuideStep/index.d.ts +3 -0
- package/dist/components/GuideStep/index.d.ts.map +1 -0
- package/dist/components/GuideStepList/GuideStepList.d.ts +21 -0
- package/dist/components/GuideStepList/GuideStepList.d.ts.map +1 -0
- package/dist/components/GuideStepList/GuideStepList.stories.d.ts +23 -0
- package/dist/components/GuideStepList/GuideStepList.stories.d.ts.map +1 -0
- package/dist/components/GuideStepList/GuideStepList.test.d.ts +2 -0
- package/dist/components/GuideStepList/GuideStepList.test.d.ts.map +1 -0
- package/dist/components/GuideStepList/index.d.ts +3 -0
- package/dist/components/GuideStepList/index.d.ts.map +1 -0
- package/dist/components/MediaFigure/MediaFigure.d.ts +70 -0
- package/dist/components/MediaFigure/MediaFigure.d.ts.map +1 -0
- package/dist/components/MediaFigure/MediaFigure.stories.d.ts +33 -0
- package/dist/components/MediaFigure/MediaFigure.stories.d.ts.map +1 -0
- package/dist/components/MediaFigure/MediaFigure.test.d.ts +2 -0
- package/dist/components/MediaFigure/MediaFigure.test.d.ts.map +1 -0
- package/dist/components/MediaFigure/MediaFigureMedia.d.ts +8 -0
- package/dist/components/MediaFigure/MediaFigureMedia.d.ts.map +1 -0
- package/dist/components/MediaFigure/MediaFigureModel.d.ts +5 -0
- package/dist/components/MediaFigure/MediaFigureModel.d.ts.map +1 -0
- package/dist/components/MediaFigure/index.d.ts +3 -0
- package/dist/components/MediaFigure/index.d.ts.map +1 -0
- package/dist/components/ToolList/ToolList.d.ts +34 -0
- package/dist/components/ToolList/ToolList.d.ts.map +1 -0
- package/dist/components/ToolList/ToolList.stories.d.ts +24 -0
- package/dist/components/ToolList/ToolList.stories.d.ts.map +1 -0
- package/dist/components/ToolList/ToolList.test.d.ts +2 -0
- package/dist/components/ToolList/ToolList.test.d.ts.map +1 -0
- package/dist/components/ToolList/index.d.ts +3 -0
- package/dist/components/ToolList/index.d.ts.map +1 -0
- package/dist/diy-guides-ui.cjs +24 -0
- package/dist/diy-guides-ui.cjs.map +1 -0
- package/dist/diy-guides-ui.js +7749 -0
- package/dist/diy-guides-ui.js.map +1 -0
- package/dist/hooks/useControlledState.d.ts +7 -0
- package/dist/hooks/useControlledState.d.ts.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/stories/Welcome.stories.d.ts +21 -0
- package/dist/stories/Welcome.stories.d.ts.map +1 -0
- package/dist/style.css +1 -0
- package/dist/test/setup.d.ts +2 -0
- package/dist/test/setup.d.ts.map +1 -0
- package/dist/test/smoke.test.d.ts +2 -0
- package/dist/test/smoke.test.d.ts.map +1 -0
- package/dist/types/callout.d.ts +13 -0
- package/dist/types/callout.d.ts.map +1 -0
- package/dist/types/callout.test.d.ts +2 -0
- package/dist/types/callout.test.d.ts.map +1 -0
- package/dist/types/colors.d.ts +20 -0
- package/dist/types/colors.d.ts.map +1 -0
- package/dist/types/colors.test.d.ts +2 -0
- package/dist/types/colors.test.d.ts.map +1 -0
- package/dist/utils/mediaCrop.d.ts +19 -0
- package/dist/utils/mediaCrop.d.ts.map +1 -0
- package/dist/utils/mediaCrop.test.d.ts +2 -0
- package/dist/utils/mediaCrop.test.d.ts.map +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/test/setup.ts"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smoke.test.d.ts","sourceRoot":"","sources":["../../src/test/smoke.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type GuideColor } from "./colors";
|
|
2
|
+
/**
|
|
3
|
+
* Callout types express safety and informational tone for {@link Callout}.
|
|
4
|
+
* Each type maps to a {@link GuideColor} accent from the shared palette.
|
|
5
|
+
*/
|
|
6
|
+
export type CalloutType = "note" | "info" | "tip" | "caution" | "danger";
|
|
7
|
+
/** Callout type → guide palette accent (drives border, background tint, and icon). */
|
|
8
|
+
export declare const calloutTypeColor: Record<CalloutType, GuideColor>;
|
|
9
|
+
/** Resolved hex accent for a callout type. */
|
|
10
|
+
export declare function calloutTypeHex(type: CalloutType): string;
|
|
11
|
+
/** Callout type → default human-readable title. */
|
|
12
|
+
export declare const calloutTypeLabel: Record<CalloutType, string>;
|
|
13
|
+
//# sourceMappingURL=callout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callout.d.ts","sourceRoot":"","sources":["../../src/types/callout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAEnD;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEzE,sFAAsF;AACtF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,WAAW,EAAE,UAAU,CAM5D,CAAC;AAEF,8CAA8C;AAC9C,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAExD;AAED,mDAAmD;AACnD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAMxD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callout.test.d.ts","sourceRoot":"","sources":["../../src/types/callout.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fixed palette for visually linking step bullet dots to image annotation markers.
|
|
3
|
+
* Each name maps to a hex value applied directly via inline styles.
|
|
4
|
+
*/
|
|
5
|
+
export declare const COLORS: {
|
|
6
|
+
readonly GREY: "#7A8090";
|
|
7
|
+
readonly RED: "#E7320D";
|
|
8
|
+
readonly ORANGE: "#FF850A";
|
|
9
|
+
readonly YELLOW: "#F5E429";
|
|
10
|
+
readonly GREEN: "#14CC76";
|
|
11
|
+
readonly LIGHT_BLUE: "#20B3E9";
|
|
12
|
+
readonly BLUE: "#1738DE";
|
|
13
|
+
readonly MAGENTA: "#D945B1";
|
|
14
|
+
};
|
|
15
|
+
export type GuideColor = keyof typeof COLORS;
|
|
16
|
+
/** Convert a `#rrggbb` hex string to `rgba(r, g, b, alpha)`. */
|
|
17
|
+
export declare function hexToRgba(hex: string, alpha: number): string;
|
|
18
|
+
/** Pick a readable foreground for a solid-color marker pin. */
|
|
19
|
+
export declare function markerTextColor(hex: string): string;
|
|
20
|
+
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/types/colors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,MAAM;;;;;;;;;CAST,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,MAAM,CAAC;AAE7C,gEAAgE;AAChE,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAM5D;AAED,+DAA+D;AAC/D,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.test.d.ts","sourceRoot":"","sources":["../../src/types/colors.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
/** Top-left and width of a 4:3 crop rect in intrinsic source pixels. Height is derived. */
|
|
3
|
+
export interface MediaDisplayRegion {
|
|
4
|
+
/** Left edge in pixels from the source left. */
|
|
5
|
+
x: number;
|
|
6
|
+
/** Top edge in pixels from the source top. */
|
|
7
|
+
y: number;
|
|
8
|
+
/** Width in source pixels; height is computed as `round(width × 3 / 4)`. */
|
|
9
|
+
width: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const DISPLAY_REGION_ASPECT: number;
|
|
12
|
+
/** Height in source pixels for a 4:3 region with the given width. */
|
|
13
|
+
export declare function displayRegionHeight(width: number): number;
|
|
14
|
+
/**
|
|
15
|
+
* CSS styles to show a 4:3 source-pixel region scaled to fill a 4:3 frame.
|
|
16
|
+
* Returns `null` when the region is invalid for the given source dimensions.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getDisplayRegionStyles(region: MediaDisplayRegion, sourceWidth: number, sourceHeight: number, frameWidth: number, frameHeight: number): CSSProperties | null;
|
|
19
|
+
//# sourceMappingURL=mediaCrop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mediaCrop.d.ts","sourceRoot":"","sources":["../../src/utils/mediaCrop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,2FAA2F;AAC3F,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,CAAC,EAAE,MAAM,CAAC;IACV,8CAA8C;IAC9C,CAAC,EAAE,MAAM,CAAC;IACV,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,qBAAqB,QAAQ,CAAC;AAE3C,qEAAqE;AACrE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAgBD;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,kBAAkB,EAC1B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,aAAa,GAAG,IAAI,CAqBtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mediaCrop.test.d.ts","sourceRoot":"","sources":["../../src/utils/mediaCrop.test.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openpawlabs/diy-guides-ui",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "React UI library for building open-source, iFixit-style step-by-step diy guides",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/diy-guides-ui.cjs",
|
|
8
|
+
"module": "./dist/diy-guides-ui.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"default": "./dist/diy-guides-ui.js"
|
|
15
|
+
},
|
|
16
|
+
"require": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"default": "./dist/diy-guides-ui.cjs"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"./styles": "./dist/style.css"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"sideEffects": [
|
|
27
|
+
"**/*.css"
|
|
28
|
+
],
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"online-3d-viewer": "^0.18.0",
|
|
31
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
32
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@eslint/js": "^9.28.0",
|
|
36
|
+
"@heroui/react": "^3.0.0",
|
|
37
|
+
"@heroui/styles": "^3.0.0",
|
|
38
|
+
"@storybook/addon-docs": "^9.0.0",
|
|
39
|
+
"@storybook/addon-links": "^9.1.20",
|
|
40
|
+
"@storybook/addon-themes": "^9.0.0",
|
|
41
|
+
"@storybook/react-vite": "^9.0.0",
|
|
42
|
+
"@tailwindcss/postcss": "^4.1.8",
|
|
43
|
+
"@tailwindcss/vite": "^4.1.8",
|
|
44
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
45
|
+
"@testing-library/react": "^16.3.0",
|
|
46
|
+
"@testing-library/user-event": "^14.6.1",
|
|
47
|
+
"@types/node": "^26.0.0",
|
|
48
|
+
"@types/react": "^19.1.6",
|
|
49
|
+
"@types/react-dom": "^19.1.5",
|
|
50
|
+
"@vitejs/plugin-react": "^4.5.2",
|
|
51
|
+
"eslint": "^9.28.0",
|
|
52
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
53
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
54
|
+
"eslint-plugin-storybook": "^9.0.0",
|
|
55
|
+
"globals": "^16.2.0",
|
|
56
|
+
"jsdom": "^26.1.0",
|
|
57
|
+
"react": "^19.1.0",
|
|
58
|
+
"react-dom": "^19.1.0",
|
|
59
|
+
"storybook": "^9.0.0",
|
|
60
|
+
"tailwindcss": "^4.1.8",
|
|
61
|
+
"typescript": "^5.8.3",
|
|
62
|
+
"typescript-eslint": "^8.34.0",
|
|
63
|
+
"vite": "^6.3.5",
|
|
64
|
+
"vitest": "^3.2.3"
|
|
65
|
+
},
|
|
66
|
+
"publishConfig": {
|
|
67
|
+
"access": "public"
|
|
68
|
+
},
|
|
69
|
+
"dependencies": {
|
|
70
|
+
"online-3d-viewer": "^0.18.0"
|
|
71
|
+
},
|
|
72
|
+
"scripts": {
|
|
73
|
+
"dev": "storybook dev -p 6006",
|
|
74
|
+
"build": "vite build && tsc -b tsconfig.app.json",
|
|
75
|
+
"build:storybook": "storybook build -o storybook-static",
|
|
76
|
+
"test": "vitest run",
|
|
77
|
+
"test:watch": "vitest",
|
|
78
|
+
"typecheck": "tsc -b --noEmit",
|
|
79
|
+
"lint": "eslint ."
|
|
80
|
+
}
|
|
81
|
+
}
|