storybook-vrhythm 0.1.0 → 0.3.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.
@@ -0,0 +1,66 @@
1
+ import { DecoratorFunction, Renderer } from 'storybook/internal/types';
2
+
3
+ interface StyleProps {
4
+ color?: string;
5
+ lineHeight?: string | number;
6
+ offset?: string | number;
7
+ opacity?: number;
8
+ zIndex?: number;
9
+ columnWidth?: string | number;
10
+ columnColor?: string;
11
+ }
12
+ interface ConfigProps {
13
+ hide?: boolean;
14
+ preset?: string;
15
+ container?: string;
16
+ }
17
+
18
+ declare module 'storybook/internal/types' {
19
+ interface StorybookParameters {
20
+ /** Vertical rhythm overlay options (storybook-vrhythm). */
21
+ vrhythm?: StyleProps & ConfigProps;
22
+ }
23
+ }
24
+ declare module 'storybook/internal/csf' {
25
+ interface Globals {
26
+ /** Toolbar toggle for the vertical rhythm overlay (`'true'` | `'false'` or boolean). */
27
+ vrhythm?: string | boolean;
28
+ }
29
+ }
30
+
31
+ declare const presets: {
32
+ readonly '4px': {
33
+ readonly lineHeight: "4px";
34
+ readonly color: "rgba(0, 150, 255, 0.15)";
35
+ };
36
+ readonly '8px': {
37
+ readonly lineHeight: "8px";
38
+ readonly color: "rgba(0, 150, 255, 0.2)";
39
+ };
40
+ readonly '16px': {
41
+ readonly lineHeight: "16px";
42
+ readonly color: "rgba(204, 204, 204, 0.5)";
43
+ };
44
+ readonly '24px': {
45
+ readonly lineHeight: "24px";
46
+ readonly color: "rgba(204, 204, 204, 0.5)";
47
+ };
48
+ readonly material: {
49
+ readonly lineHeight: "4px";
50
+ readonly color: "rgba(244, 67, 54, 0.15)";
51
+ };
52
+ readonly tailwind: {
53
+ readonly lineHeight: "4px";
54
+ readonly color: "rgba(99, 102, 241, 0.15)";
55
+ };
56
+ readonly bootstrap: {
57
+ readonly lineHeight: "8px";
58
+ readonly color: "rgba(13, 110, 253, 0.2)";
59
+ };
60
+ };
61
+ type PresetName = keyof typeof presets;
62
+
63
+ type VRhythmParams = StyleProps & ConfigProps;
64
+ declare const withVRhythm: DecoratorFunction<Renderer>;
65
+
66
+ export { type ConfigProps, type PresetName, type StyleProps, type VRhythmParams, presets, withVRhythm };
package/dist/index.js ADDED
@@ -0,0 +1,108 @@
1
+ // src/constants.ts
2
+ var DEFAULT_COLOR = "rgb(204, 204, 204)";
3
+ var DEFAULT_LINE_HEIGHT = "16px";
4
+ var DEFAULT_OFFSET = 0;
5
+ var DEFAULT_OPACITY = 1;
6
+ var DEFAULT_Z_INDEX = 9999;
7
+ var PARENT_SELECTOR = "body";
8
+ var DIV_ID = "storybook-rhythm";
9
+
10
+ // src/getStyle.ts
11
+ var getStyle = ({
12
+ color = DEFAULT_COLOR,
13
+ lineHeight = DEFAULT_LINE_HEIGHT,
14
+ offset = DEFAULT_OFFSET,
15
+ opacity = DEFAULT_OPACITY,
16
+ zIndex = DEFAULT_Z_INDEX,
17
+ columnWidth,
18
+ columnColor
19
+ }) => {
20
+ const horizontal = `linear-gradient(${color} 1px, transparent 1px) left top / 1px ${lineHeight}`;
21
+ const background = columnWidth != null ? `${horizontal}, linear-gradient(90deg, ${columnColor ?? color} 1px, transparent 1px) left top / ${columnWidth} 1px` : horizontal;
22
+ return {
23
+ position: "absolute",
24
+ top: offset,
25
+ left: 0,
26
+ right: 0,
27
+ bottom: 0,
28
+ background,
29
+ pointerEvents: "none",
30
+ opacity,
31
+ zIndex
32
+ };
33
+ };
34
+
35
+ // src/presets.ts
36
+ var presets = {
37
+ "4px": { lineHeight: "4px", color: "rgba(0, 150, 255, 0.15)" },
38
+ "8px": { lineHeight: "8px", color: "rgba(0, 150, 255, 0.2)" },
39
+ "16px": { lineHeight: "16px", color: "rgba(204, 204, 204, 0.5)" },
40
+ "24px": { lineHeight: "24px", color: "rgba(204, 204, 204, 0.5)" },
41
+ material: { lineHeight: "4px", color: "rgba(244, 67, 54, 0.15)" },
42
+ tailwind: { lineHeight: "4px", color: "rgba(99, 102, 241, 0.15)" },
43
+ bootstrap: { lineHeight: "8px", color: "rgba(13, 110, 253, 0.2)" }
44
+ };
45
+
46
+ // src/utils.ts
47
+ function createElement() {
48
+ const element = document.createElement("div");
49
+ element.setAttribute("id", DIV_ID);
50
+ return element;
51
+ }
52
+ function getOrCreateElement() {
53
+ const existing = document.getElementById(DIV_ID);
54
+ if (existing) {
55
+ return existing;
56
+ }
57
+ return createElement();
58
+ }
59
+ function removeElement() {
60
+ const element = document.getElementById(DIV_ID);
61
+ if (element) {
62
+ element.remove();
63
+ }
64
+ }
65
+ function injectStyle(style, container) {
66
+ const element = getOrCreateElement();
67
+ Object.assign(element.style, style);
68
+ if (!element.parentNode) {
69
+ const parent = document.querySelector(container ?? PARENT_SELECTOR);
70
+ if (parent) {
71
+ parent.append(element);
72
+ }
73
+ }
74
+ }
75
+
76
+ // src/index.ts
77
+ var DEFAULT_PARAMS = {
78
+ hide: false,
79
+ preset: "",
80
+ container: "",
81
+ color: DEFAULT_COLOR,
82
+ lineHeight: DEFAULT_LINE_HEIGHT,
83
+ offset: DEFAULT_OFFSET,
84
+ opacity: DEFAULT_OPACITY,
85
+ zIndex: DEFAULT_Z_INDEX
86
+ };
87
+ var withVRhythm = (storyFn, context) => {
88
+ const raw = context.parameters?.vrhythm;
89
+ const presetStyles = raw?.preset && raw.preset in presets ? presets[raw.preset] : {};
90
+ const params = {
91
+ ...DEFAULT_PARAMS,
92
+ ...presetStyles,
93
+ ...raw
94
+ };
95
+ const globalsVrhythm = context.globals?.vrhythm;
96
+ const isHidden = !!params.hide || globalsVrhythm === false || globalsVrhythm === "false";
97
+ if (isHidden) {
98
+ removeElement();
99
+ } else {
100
+ const style = getStyle(params);
101
+ injectStyle(style, params.container || void 0);
102
+ }
103
+ return storyFn(context);
104
+ };
105
+
106
+ export { presets, withVRhythm };
107
+ //# sourceMappingURL=index.js.map
108
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/constants.ts","../src/getStyle.ts","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B;AAAA,EACF;AACF;;;AChBA,IAAM,cAAA,GAAgC;AAAA,EACpC,IAAA,EAAM,KAAA;AAAA,EACN,MAAA,EAAQ,EAAA;AAAA,EACR,SAAA,EAAW,EAAA;AAAA,EACX,KAAA,EAAO,aAAA;AAAA,EACP,UAAA,EAAY,mBAAA;AAAA,EACZ,MAAA,EAAQ,cAAA;AAAA,EACR,OAAA,EAAS,eAAA;AAAA,EACT,MAAA,EAAQ;AACV,CAAA;AAEO,IAAM,WAAA,GAA2C,CAAC,OAAA,EAAS,OAAA,KAAY;AAC5E,EAAA,MAAM,GAAA,GAAO,QAAQ,UAAA,EACjB,OAAA;AACJ,EAAA,MAAM,YAAA,GACJ,GAAA,EAAK,MAAA,IAAU,GAAA,CAAI,MAAA,IAAU,UACzB,OAAA,CAAQ,GAAA,CAAI,MAAoB,CAAA,GAChC,EAAC;AACP,EAAA,MAAM,MAAA,GAAwB;AAAA,IAC5B,GAAG,cAAA;AAAA,IACH,GAAG,YAAA;AAAA,IACH,GAAG;AAAA,GACL;AAEA,EAAA,MAAM,cAAA,GACJ,QAAQ,OAAA,EACP,OAAA;AACH,EAAA,MAAM,WACJ,CAAC,CAAC,OAAO,IAAA,IAAQ,cAAA,KAAmB,SAAS,cAAA,KAAmB,OAAA;AAElE,EAAA,IAAI,QAAA,EAAU;AACZ,IAAA,aAAA,EAAc;AAAA,EAChB,CAAA,MAAO;AACL,IAAA,MAAM,KAAA,GAAQ,SAAS,MAAM,CAAA;AAC7B,IAAA,WAAA,CAAY,KAAA,EAAO,MAAA,CAAO,SAAA,IAAa,MAAS,CAAA;AAAA,EAClD;AAEA,EAAA,OAAO,QAAQ,OAAO,CAAA;AACxB","file":"index.js","sourcesContent":["export const DEFAULT_COLOR = 'rgb(204, 204, 204)';\nexport const DEFAULT_LINE_HEIGHT = '16px';\nexport const DEFAULT_OFFSET = 0;\nexport const DEFAULT_OPACITY = 1;\nexport const DEFAULT_Z_INDEX = 9999;\nexport const PARENT_SELECTOR = 'body';\nexport const DIV_ID = 'storybook-rhythm';\n","import { StyleObj, StyleProps } from './types';\nimport {\n DEFAULT_COLOR,\n DEFAULT_LINE_HEIGHT,\n DEFAULT_OFFSET,\n DEFAULT_OPACITY,\n DEFAULT_Z_INDEX,\n} from './constants';\n\nexport const getStyle = ({\n color = DEFAULT_COLOR,\n lineHeight = DEFAULT_LINE_HEIGHT,\n offset = DEFAULT_OFFSET,\n opacity = DEFAULT_OPACITY,\n zIndex = DEFAULT_Z_INDEX,\n columnWidth,\n columnColor,\n}: StyleProps): StyleObj => {\n const horizontal = `linear-gradient(${color} 1px, transparent 1px) left top / 1px ${lineHeight}`;\n\n const background =\n columnWidth != null\n ? `${horizontal}, linear-gradient(90deg, ${columnColor ?? color} 1px, transparent 1px) left top / ${columnWidth} 1px`\n : horizontal;\n\n return {\n position: 'absolute',\n top: offset,\n left: 0,\n right: 0,\n bottom: 0,\n background,\n pointerEvents: 'none',\n opacity,\n zIndex,\n };\n};\n","import type { StyleProps } from './types';\n\nexport const presets = {\n '4px': { lineHeight: '4px', color: 'rgba(0, 150, 255, 0.15)' },\n '8px': { lineHeight: '8px', color: 'rgba(0, 150, 255, 0.2)' },\n '16px': { lineHeight: '16px', color: 'rgba(204, 204, 204, 0.5)' },\n '24px': { lineHeight: '24px', color: 'rgba(204, 204, 204, 0.5)' },\n material: { lineHeight: '4px', color: 'rgba(244, 67, 54, 0.15)' },\n tailwind: { lineHeight: '4px', color: 'rgba(99, 102, 241, 0.15)' },\n bootstrap: { lineHeight: '8px', color: 'rgba(13, 110, 253, 0.2)' },\n} as const satisfies Record<string, StyleProps>;\n\nexport type PresetName = keyof typeof presets;\n","import { PARENT_SELECTOR, DIV_ID } from './constants';\nimport { StyleObj } from './types';\n\nfunction createElement(): HTMLDivElement {\n const element = document.createElement('div');\n element.setAttribute('id', DIV_ID);\n return element;\n}\n\nfunction getOrCreateElement(): HTMLDivElement {\n const existing = document.getElementById(DIV_ID) as HTMLDivElement | null;\n if (existing) {\n return existing;\n }\n return createElement();\n}\n\nexport function removeElement(): void {\n const element = document.getElementById(DIV_ID);\n if (element) {\n element.remove();\n }\n}\n\nexport function injectStyle(style: StyleObj, container?: string): void {\n const element = getOrCreateElement();\n Object.assign(element.style, style);\n\n if (!element.parentNode) {\n const parent = document.querySelector(container ?? PARENT_SELECTOR);\n if (parent) {\n parent.append(element);\n }\n }\n}\n","import './storybook-parameter-augmentation';\n\nimport type { DecoratorFunction, Renderer } from 'storybook/internal/types';\n\nimport { getStyle } from './getStyle';\nimport { StyleProps, ConfigProps } from './types';\nimport { presets, PresetName } from './presets';\nimport { injectStyle, removeElement } from './utils';\nimport {\n DEFAULT_COLOR,\n DEFAULT_LINE_HEIGHT,\n DEFAULT_OFFSET,\n DEFAULT_OPACITY,\n DEFAULT_Z_INDEX,\n} from './constants';\n\nexport type VRhythmParams = StyleProps & ConfigProps;\n\nconst DEFAULT_PARAMS: VRhythmParams = {\n hide: false,\n preset: '',\n container: '',\n color: DEFAULT_COLOR,\n lineHeight: DEFAULT_LINE_HEIGHT,\n offset: DEFAULT_OFFSET,\n opacity: DEFAULT_OPACITY,\n zIndex: DEFAULT_Z_INDEX,\n};\n\nexport const withVRhythm: DecoratorFunction<Renderer> = (storyFn, context) => {\n const raw = (context.parameters as { vrhythm?: VRhythmParams } | undefined)\n ?.vrhythm;\n const presetStyles =\n raw?.preset && raw.preset in presets\n ? presets[raw.preset as PresetName]\n : {};\n const params: VRhythmParams = {\n ...DEFAULT_PARAMS,\n ...presetStyles,\n ...raw,\n };\n\n const globalsVrhythm = (\n context.globals as { vrhythm?: string | boolean } | undefined\n )?.vrhythm;\n const isHidden =\n !!params.hide || globalsVrhythm === false || globalsVrhythm === 'false';\n\n if (isHidden) {\n removeElement();\n } else {\n const style = getStyle(params);\n injectStyle(style, params.container || undefined);\n }\n\n return storyFn(context);\n};\n\nexport { presets } from './presets';\nexport type { PresetName } from './presets';\nexport type { StyleProps, ConfigProps } from './types';\n"]}
package/dist/preset.js ADDED
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=preset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,14 @@
1
+ import * as storybook_internal_csf from 'storybook/internal/csf';
2
+ import { VRhythmParams } from './index.js';
3
+ import 'storybook/internal/types';
4
+
5
+ declare const _default: storybook_internal_csf.PreviewAddon<{
6
+ parameters: {
7
+ vrhythm?: VRhythmParams;
8
+ };
9
+ globals: {
10
+ vrhythm?: string | boolean;
11
+ };
12
+ }>;
13
+
14
+ export { _default as default };
@@ -0,0 +1,134 @@
1
+ import { definePreviewAddon } from 'storybook/internal/csf';
2
+
3
+ // src/preview.ts
4
+
5
+ // src/constants.ts
6
+ var DEFAULT_COLOR = "rgb(204, 204, 204)";
7
+ var DEFAULT_LINE_HEIGHT = "16px";
8
+ var DEFAULT_OFFSET = 0;
9
+ var DEFAULT_OPACITY = 1;
10
+ var DEFAULT_Z_INDEX = 9999;
11
+ var PARENT_SELECTOR = "body";
12
+ var DIV_ID = "storybook-rhythm";
13
+
14
+ // src/getStyle.ts
15
+ var getStyle = ({
16
+ color = DEFAULT_COLOR,
17
+ lineHeight = DEFAULT_LINE_HEIGHT,
18
+ offset = DEFAULT_OFFSET,
19
+ opacity = DEFAULT_OPACITY,
20
+ zIndex = DEFAULT_Z_INDEX,
21
+ columnWidth,
22
+ columnColor
23
+ }) => {
24
+ const horizontal = `linear-gradient(${color} 1px, transparent 1px) left top / 1px ${lineHeight}`;
25
+ const background = columnWidth != null ? `${horizontal}, linear-gradient(90deg, ${columnColor ?? color} 1px, transparent 1px) left top / ${columnWidth} 1px` : horizontal;
26
+ return {
27
+ position: "absolute",
28
+ top: offset,
29
+ left: 0,
30
+ right: 0,
31
+ bottom: 0,
32
+ background,
33
+ pointerEvents: "none",
34
+ opacity,
35
+ zIndex
36
+ };
37
+ };
38
+
39
+ // src/presets.ts
40
+ var presets = {
41
+ "4px": { lineHeight: "4px", color: "rgba(0, 150, 255, 0.15)" },
42
+ "8px": { lineHeight: "8px", color: "rgba(0, 150, 255, 0.2)" },
43
+ "16px": { lineHeight: "16px", color: "rgba(204, 204, 204, 0.5)" },
44
+ "24px": { lineHeight: "24px", color: "rgba(204, 204, 204, 0.5)" },
45
+ material: { lineHeight: "4px", color: "rgba(244, 67, 54, 0.15)" },
46
+ tailwind: { lineHeight: "4px", color: "rgba(99, 102, 241, 0.15)" },
47
+ bootstrap: { lineHeight: "8px", color: "rgba(13, 110, 253, 0.2)" }
48
+ };
49
+
50
+ // src/utils.ts
51
+ function createElement() {
52
+ const element = document.createElement("div");
53
+ element.setAttribute("id", DIV_ID);
54
+ return element;
55
+ }
56
+ function getOrCreateElement() {
57
+ const existing = document.getElementById(DIV_ID);
58
+ if (existing) {
59
+ return existing;
60
+ }
61
+ return createElement();
62
+ }
63
+ function removeElement() {
64
+ const element = document.getElementById(DIV_ID);
65
+ if (element) {
66
+ element.remove();
67
+ }
68
+ }
69
+ function injectStyle(style, container) {
70
+ const element = getOrCreateElement();
71
+ Object.assign(element.style, style);
72
+ if (!element.parentNode) {
73
+ const parent = document.querySelector(container ?? PARENT_SELECTOR);
74
+ if (parent) {
75
+ parent.append(element);
76
+ }
77
+ }
78
+ }
79
+
80
+ // src/index.ts
81
+ var DEFAULT_PARAMS = {
82
+ hide: false,
83
+ preset: "",
84
+ container: "",
85
+ color: DEFAULT_COLOR,
86
+ lineHeight: DEFAULT_LINE_HEIGHT,
87
+ offset: DEFAULT_OFFSET,
88
+ opacity: DEFAULT_OPACITY,
89
+ zIndex: DEFAULT_Z_INDEX
90
+ };
91
+ var withVRhythm = (storyFn, context) => {
92
+ const raw = context.parameters?.vrhythm;
93
+ const presetStyles = raw?.preset && raw.preset in presets ? presets[raw.preset] : {};
94
+ const params = {
95
+ ...DEFAULT_PARAMS,
96
+ ...presetStyles,
97
+ ...raw
98
+ };
99
+ const globalsVrhythm = context.globals?.vrhythm;
100
+ const isHidden = !!params.hide || globalsVrhythm === false || globalsVrhythm === "false";
101
+ if (isHidden) {
102
+ removeElement();
103
+ } else {
104
+ const style = getStyle(params);
105
+ injectStyle(style, params.container || void 0);
106
+ }
107
+ return storyFn(context);
108
+ };
109
+
110
+ // src/preview.ts
111
+ var preview_default = definePreviewAddon({
112
+ decorators: [withVRhythm],
113
+ globalTypes: {
114
+ vrhythm: {
115
+ description: "Toggle vertical rhythm grid overlay",
116
+ toolbar: {
117
+ title: "V-Rhythm",
118
+ icon: "grid",
119
+ items: [
120
+ { value: "true", title: "Show grid", icon: "eye" },
121
+ { value: "false", title: "Hide grid", icon: "eyeclose" }
122
+ ],
123
+ dynamicTitle: true
124
+ }
125
+ }
126
+ },
127
+ initialGlobals: {
128
+ vrhythm: "true"
129
+ }
130
+ });
131
+
132
+ export { preview_default as default };
133
+ //# sourceMappingURL=preview.js.map
134
+ //# sourceMappingURL=preview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/constants.ts","../src/getStyle.ts","../src/presets.ts","../src/utils.ts","../src/index.ts","../src/preview.ts"],"names":[],"mappings":";;;;;AAAO,IAAM,aAAA,GAAgB,oBAAA;AACtB,IAAM,mBAAA,GAAsB,MAAA;AAC5B,IAAM,cAAA,GAAiB,CAAA;AACvB,IAAM,eAAA,GAAkB,CAAA;AACxB,IAAM,eAAA,GAAkB,IAAA;AACxB,IAAM,eAAA,GAAkB,MAAA;AACxB,IAAM,MAAA,GAAS,kBAAA;;;ACGf,IAAM,WAAW,CAAC;AAAA,EACvB,KAAA,GAAQ,aAAA;AAAA,EACR,UAAA,GAAa,mBAAA;AAAA,EACb,MAAA,GAAS,cAAA;AAAA,EACT,OAAA,GAAU,eAAA;AAAA,EACV,MAAA,GAAS,eAAA;AAAA,EACT,WAAA;AAAA,EACA;AACF,CAAA,KAA4B;AAC1B,EAAA,MAAM,UAAA,GAAa,CAAA,gBAAA,EAAmB,KAAK,CAAA,sCAAA,EAAyC,UAAU,CAAA,CAAA;AAE9F,EAAA,MAAM,UAAA,GACJ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YAAA;AAAA,IACH,GAAG;AAAA,GACL;AAEA,EAAA,MAAM,cAAA,GACJ,QAAQ,OAAA,EACP,OAAA;AACH,EAAA,MAAM,WACJ,CAAC,CAAC,OAAO,IAAA,IAAQ,cAAA,KAAmB,SAAS,cAAA,KAAmB,OAAA;AAElE,EAAA,IAAI,QAAA,EAAU;AACZ,IAAA,aAAA,EAAc;AAAA,EAChB,CAAA,MAAO;AACL,IAAA,MAAM,KAAA,GAAQ,SAAS,MAAM,CAAA;AAC7B,IAAA,WAAA,CAAY,KAAA,EAAO,MAAA,CAAO,SAAA,IAAa,MAAS,CAAA;AAAA,EAClD;AAEA,EAAA,OAAO,QAAQ,OAAO,CAAA;AACxB,CAAA;;;ACpDA,IAAO,kBAAQ,kBAAA,CAGZ;AAAA,EACD,UAAA,EAAY,CAAC,WAAW,CAAA;AAAA,EACxB,WAAA,EAAa;AAAA,IACX,OAAA,EAAS;AAAA,MACP,WAAA,EAAa,qCAAA;AAAA,MACb,OAAA,EAAS;AAAA,QACP,KAAA,EAAO,UAAA;AAAA,QACP,IAAA,EAAM,MAAA;AAAA,QACN,KAAA,EAAO;AAAA,UACL,EAAE,KAAA,EAAO,MAAA,EAAQ,KAAA,EAAO,WAAA,EAAa,MAAM,KAAA,EAAM;AAAA,UACjD,EAAE,KAAA,EAAO,OAAA,EAAS,KAAA,EAAO,WAAA,EAAa,MAAM,UAAA;AAAW,SACzD;AAAA,QACA,YAAA,EAAc;AAAA;AAChB;AACF,GACF;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,OAAA,EAAS;AAAA;AAEb,CAAC","file":"preview.js","sourcesContent":["export const DEFAULT_COLOR = 'rgb(204, 204, 204)';\nexport const DEFAULT_LINE_HEIGHT = '16px';\nexport const DEFAULT_OFFSET = 0;\nexport const DEFAULT_OPACITY = 1;\nexport const DEFAULT_Z_INDEX = 9999;\nexport const PARENT_SELECTOR = 'body';\nexport const DIV_ID = 'storybook-rhythm';\n","import { StyleObj, StyleProps } from './types';\nimport {\n DEFAULT_COLOR,\n DEFAULT_LINE_HEIGHT,\n DEFAULT_OFFSET,\n DEFAULT_OPACITY,\n DEFAULT_Z_INDEX,\n} from './constants';\n\nexport const getStyle = ({\n color = DEFAULT_COLOR,\n lineHeight = DEFAULT_LINE_HEIGHT,\n offset = DEFAULT_OFFSET,\n opacity = DEFAULT_OPACITY,\n zIndex = DEFAULT_Z_INDEX,\n columnWidth,\n columnColor,\n}: StyleProps): StyleObj => {\n const horizontal = `linear-gradient(${color} 1px, transparent 1px) left top / 1px ${lineHeight}`;\n\n const background =\n columnWidth != null\n ? `${horizontal}, linear-gradient(90deg, ${columnColor ?? color} 1px, transparent 1px) left top / ${columnWidth} 1px`\n : horizontal;\n\n return {\n position: 'absolute',\n top: offset,\n left: 0,\n right: 0,\n bottom: 0,\n background,\n pointerEvents: 'none',\n opacity,\n zIndex,\n };\n};\n","import type { StyleProps } from './types';\n\nexport const presets = {\n '4px': { lineHeight: '4px', color: 'rgba(0, 150, 255, 0.15)' },\n '8px': { lineHeight: '8px', color: 'rgba(0, 150, 255, 0.2)' },\n '16px': { lineHeight: '16px', color: 'rgba(204, 204, 204, 0.5)' },\n '24px': { lineHeight: '24px', color: 'rgba(204, 204, 204, 0.5)' },\n material: { lineHeight: '4px', color: 'rgba(244, 67, 54, 0.15)' },\n tailwind: { lineHeight: '4px', color: 'rgba(99, 102, 241, 0.15)' },\n bootstrap: { lineHeight: '8px', color: 'rgba(13, 110, 253, 0.2)' },\n} as const satisfies Record<string, StyleProps>;\n\nexport type PresetName = keyof typeof presets;\n","import { PARENT_SELECTOR, DIV_ID } from './constants';\nimport { StyleObj } from './types';\n\nfunction createElement(): HTMLDivElement {\n const element = document.createElement('div');\n element.setAttribute('id', DIV_ID);\n return element;\n}\n\nfunction getOrCreateElement(): HTMLDivElement {\n const existing = document.getElementById(DIV_ID) as HTMLDivElement | null;\n if (existing) {\n return existing;\n }\n return createElement();\n}\n\nexport function removeElement(): void {\n const element = document.getElementById(DIV_ID);\n if (element) {\n element.remove();\n }\n}\n\nexport function injectStyle(style: StyleObj, container?: string): void {\n const element = getOrCreateElement();\n Object.assign(element.style, style);\n\n if (!element.parentNode) {\n const parent = document.querySelector(container ?? PARENT_SELECTOR);\n if (parent) {\n parent.append(element);\n }\n }\n}\n","import './storybook-parameter-augmentation';\n\nimport type { DecoratorFunction, Renderer } from 'storybook/internal/types';\n\nimport { getStyle } from './getStyle';\nimport { StyleProps, ConfigProps } from './types';\nimport { presets, PresetName } from './presets';\nimport { injectStyle, removeElement } from './utils';\nimport {\n DEFAULT_COLOR,\n DEFAULT_LINE_HEIGHT,\n DEFAULT_OFFSET,\n DEFAULT_OPACITY,\n DEFAULT_Z_INDEX,\n} from './constants';\n\nexport type VRhythmParams = StyleProps & ConfigProps;\n\nconst DEFAULT_PARAMS: VRhythmParams = {\n hide: false,\n preset: '',\n container: '',\n color: DEFAULT_COLOR,\n lineHeight: DEFAULT_LINE_HEIGHT,\n offset: DEFAULT_OFFSET,\n opacity: DEFAULT_OPACITY,\n zIndex: DEFAULT_Z_INDEX,\n};\n\nexport const withVRhythm: DecoratorFunction<Renderer> = (storyFn, context) => {\n const raw = (context.parameters as { vrhythm?: VRhythmParams } | undefined)\n ?.vrhythm;\n const presetStyles =\n raw?.preset && raw.preset in presets\n ? presets[raw.preset as PresetName]\n : {};\n const params: VRhythmParams = {\n ...DEFAULT_PARAMS,\n ...presetStyles,\n ...raw,\n };\n\n const globalsVrhythm = (\n context.globals as { vrhythm?: string | boolean } | undefined\n )?.vrhythm;\n const isHidden =\n !!params.hide || globalsVrhythm === false || globalsVrhythm === 'false';\n\n if (isHidden) {\n removeElement();\n } else {\n const style = getStyle(params);\n injectStyle(style, params.container || undefined);\n }\n\n return storyFn(context);\n};\n\nexport { presets } from './presets';\nexport type { PresetName } from './presets';\nexport type { StyleProps, ConfigProps } from './types';\n","import { definePreviewAddon } from 'storybook/internal/csf';\n\nimport { withVRhythm, type VRhythmParams } from './index';\n\nexport default definePreviewAddon<{\n parameters: { vrhythm?: VRhythmParams };\n globals: { vrhythm?: string | boolean };\n}>({\n decorators: [withVRhythm],\n globalTypes: {\n vrhythm: {\n description: 'Toggle vertical rhythm grid overlay',\n toolbar: {\n title: 'V-Rhythm',\n icon: 'grid',\n items: [\n { value: 'true', title: 'Show grid', icon: 'eye' },\n { value: 'false', title: 'Hide grid', icon: 'eyeclose' },\n ],\n dynamicTitle: true,\n },\n },\n },\n initialGlobals: {\n vrhythm: 'true',\n },\n});\n"]}
package/package.json CHANGED
@@ -1,27 +1,80 @@
1
1
  {
2
2
  "name": "storybook-vrhythm",
3
- "version": "0.1.0",
4
- "description": "Storybook Vertical Rhythm Decorator",
3
+ "version": "0.3.0",
4
+ "description": "Baseline grid overlay for Storybook — see your vertical rhythm while you build",
5
+ "license": "MIT",
6
+ "author": "jmlweb",
5
7
  "homepage": "https://github.com/jmlweb/storybook-vrhythm",
6
- "main": "dist/index.js",
7
- "umd:main": "dist/storybook-vrhythm.umd.production.js",
8
- "module": "dist/storybook-vrhythm.es.production.js",
9
- "typings": "dist/index.d.ts",
10
- "engines": {
11
- "node": ">=10"
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/jmlweb/storybook-vrhythm.git"
11
+ },
12
+ "keywords": [
13
+ "storybook-addon",
14
+ "storybook",
15
+ "vertical-rhythm",
16
+ "baseline-grid",
17
+ "typography",
18
+ "layout",
19
+ "design-system",
20
+ "css-grid",
21
+ "decorator",
22
+ "debug",
23
+ "spacing",
24
+ "material-design",
25
+ "tailwind"
26
+ ],
27
+ "type": "module",
28
+ "main": "./dist/index.js",
29
+ "module": "./dist/index.js",
30
+ "types": "./dist/index.d.ts",
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist/index.d.ts",
34
+ "import": "./dist/index.js",
35
+ "default": "./dist/index.js"
36
+ },
37
+ "./preview": {
38
+ "types": "./dist/preview.d.ts",
39
+ "import": "./dist/preview.js",
40
+ "default": "./dist/preview.js"
41
+ },
42
+ "./preset": {
43
+ "import": "./dist/preset.js",
44
+ "default": "./dist/preset.js"
45
+ },
46
+ "./package.json": "./package.json"
12
47
  },
13
48
  "files": [
14
- "dist"
49
+ "dist",
50
+ "preset.js"
15
51
  ],
16
- "scripts": {
17
- "start": "tsdx watch",
18
- "build": "tsdx build",
19
- "test": "tsdx test --env=jsdom"
52
+ "engines": {
53
+ "node": ">=20"
20
54
  },
21
- "husky": {
22
- "hooks": {
23
- "pre-commit": "pretty-quick --staged"
24
- }
55
+ "peerDependencies": {
56
+ "storybook": "^10.0.0 || ^11.0.0"
57
+ },
58
+ "storybook": {
59
+ "displayName": "Vertical Rhythm Grid",
60
+ "supportedFrameworks": [
61
+ "react",
62
+ "vue",
63
+ "angular",
64
+ "web-components",
65
+ "html-vite",
66
+ "svelte"
67
+ ]
68
+ },
69
+ "scripts": {
70
+ "build": "tsup",
71
+ "dev": "tsup --watch",
72
+ "test": "vitest run",
73
+ "test:watch": "vitest",
74
+ "test:coverage": "vitest run --coverage",
75
+ "lint": "tsc --noEmit",
76
+ "format": "prettier --write 'src/**/*.ts' 'test/**/*.ts'",
77
+ "format:check": "prettier --check 'src/**/*.ts' 'test/**/*.ts'"
25
78
  },
26
79
  "prettier": {
27
80
  "printWidth": 80,
@@ -30,14 +83,13 @@
30
83
  "trailingComma": "es5"
31
84
  },
32
85
  "devDependencies": {
33
- "@types/jest": "^25.1.2",
34
- "husky": "^4.2.3",
35
- "prettier": "^1.19.1",
36
- "pretty-quick": "^2.0.1",
37
- "react": "^16.12.0",
38
- "tsdx": "^0.12.3",
39
- "tslib": "^1.10.0",
40
- "typescript": "^3.7.5"
41
- },
42
- "dependencies": {}
86
+ "@types/node": "^25.5.0",
87
+ "@vitest/coverage-v8": "^4.1.2",
88
+ "jsdom": "^29.0.1",
89
+ "prettier": "^3.5.3",
90
+ "storybook": "^10.0.0",
91
+ "tsup": "^8.5.1",
92
+ "typescript": "^5.9.3",
93
+ "vitest": "^4.1.2"
94
+ }
43
95
  }
package/preset.js ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/preset.js';
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2019 José Manuel Lucas
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/README.md DELETED
@@ -1,121 +0,0 @@
1
- # 📐 storybook-vrhythm
2
-
3
- [![npm package][npm-badge]][npm]
4
- [![License: MIT][license-badge]][license]
5
- [![Bundle Size](https://img.shields.io/bundlephobia/minzip/storybook-vrhythm)](https://bundlephobia.com/package/storybook-vrhythm)
6
-
7
- **A Storybook decorator that overlays vertical rhythm guide lines on your stories.**
8
- Verify that your components align to a baseline grid — with zero effort.
9
-
10
- ![Vertical rhythm overlay example](storybook-vrhythm.jpg)
11
-
12
- ## ✨ Features
13
-
14
- - 🎯 **Framework agnostic** — Works with React, Vue, Angular, Svelte, and any Storybook-supported framework
15
- - 🎨 **Fully customizable** — Color, line height, offset, and visibility per story
16
- - 🪶 **Lightweight** — Pure CSS overlay using `linear-gradient` (no images, no canvas)
17
- - 🖱️ **Non-intrusive** — Overlay doesn't interfere with pointer events
18
- - ⚡ **Zero config** — Works out of the box with sensible defaults
19
-
20
- ## 📦 Installation
21
-
22
- <details open>
23
- <summary><strong>pnpm</strong></summary>
24
-
25
- ```bash
26
- pnpm add -D storybook-vrhythm
27
- ```
28
-
29
- </details>
30
-
31
- <details>
32
- <summary><strong>npm</strong></summary>
33
-
34
- ```bash
35
- npm install --save-dev storybook-vrhythm
36
- ```
37
-
38
- </details>
39
-
40
- <details>
41
- <summary><strong>yarn</strong></summary>
42
-
43
- ```bash
44
- yarn add -D storybook-vrhythm
45
- ```
46
-
47
- </details>
48
-
49
- ## 🚀 Usage
50
-
51
- ### Global decorator
52
-
53
- Add it to your `.storybook/preview.ts` to enable it across all stories:
54
-
55
- ```typescript
56
- import { withVRhythm } from 'storybook-vrhythm';
57
-
58
- export const decorators = [withVRhythm];
59
-
60
- export const parameters = {
61
- vrhythm: {
62
- color: 'rgba(178, 86, 18, 0.5)',
63
- lineHeight: '16px',
64
- offset: 0,
65
- },
66
- };
67
- ```
68
-
69
- ### Per-story configuration
70
-
71
- Override or hide the overlay on individual stories:
72
-
73
- ```typescript
74
- export const MyStory = {
75
- parameters: {
76
- vrhythm: {
77
- hide: true,
78
- },
79
- },
80
- };
81
- ```
82
-
83
- ## ⚙️ Options
84
-
85
- | Option | Type | Default | Description |
86
- | ------------ | ------------------ | ---------------------- | ------------------------------------------ |
87
- | `color` | `string` | `'rgb(204, 204, 204)'` | Any valid CSS color for the guide lines |
88
- | `lineHeight` | `string \| number` | `'16px'` | Baseline grid height (e.g. `16px`, `1rem`) |
89
- | `offset` | `string \| number` | `0` | Vertical offset from the top |
90
- | `hide` | `boolean` | `false` | Hide the overlay for specific stories |
91
-
92
- ## 💡 Why vertical rhythm?
93
-
94
- Vertical rhythm is the practice of spacing elements on a page based on a consistent baseline grid. It improves readability and creates a sense of visual harmony. This decorator lets you **see** the grid while developing, so you can catch alignment issues before they reach production.
95
-
96
- ## 🛠️ Development
97
-
98
- ```bash
99
- pnpm install # Install dependencies
100
- pnpm build # Build the package
101
- pnpm test # Run tests
102
- pnpm lint # Lint source code
103
- pnpm format # Format with Prettier
104
- ```
105
-
106
- ## 🤝 Contributing
107
-
108
- Contributions are welcome! Feel free to open an [issue](https://github.com/jmlweb/storybook-vrhythm/issues) or submit a pull request.
109
-
110
- ## 🙏 Inspiration
111
-
112
- [Baseliner](https://jpedroribeiro.com/2015/08/baseliner-my-first-chrome-extension/) — a Chrome extension by JP Ribeiro for overlaying baseline grids.
113
-
114
- ## 📄 License
115
-
116
- [MIT](LICENSE)
117
-
118
- [npm-badge]: https://img.shields.io/npm/v/storybook-vrhythm.svg
119
- [npm]: https://www.npmjs.org/package/storybook-vrhythm
120
- [license-badge]: https://img.shields.io/badge/license-MIT-blue.svg
121
- [license]: https://github.com/jmlweb/storybook-vrhythm/blob/master/LICENSE