@k8o/arte-odyssey 1.3.0 → 1.4.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.
@@ -1,2 +1,4 @@
1
- import type { FC } from 'react';
2
- export declare const ScrollLinked: FC;
1
+ import type { FC, RefObject } from 'react';
2
+ export declare const ScrollLinked: FC<{
3
+ container?: RefObject<HTMLElement | null>;
4
+ }>;
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { motion, useScroll, useSpring } from "motion/react";
4
- const ScrollLinked = () => {
5
- const { scrollYProgress } = useScroll();
4
+ const ScrollLinked = ({ container }) => {
5
+ const { scrollYProgress } = useScroll({ container });
6
6
  const scaleX = useSpring(scrollYProgress, {
7
7
  stiffness: 100,
8
8
  damping: 30,
@@ -1,4 +1,5 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useRef } from "react";
2
3
  import { ScrollLinked } from "./scroll-linked";
3
4
  const meta = {
4
5
  title: "components/scroll-linked",
@@ -11,8 +12,40 @@ const Scroll = {
11
12
  (Story) => /* @__PURE__ */ jsx("div", { className: "h-lvh overflow-y-scroll", children: /* @__PURE__ */ jsx(Story, {}) })
12
13
  ]
13
14
  };
15
+ const WithContainer = {
16
+ decorators: [
17
+ (Story) => {
18
+ const containerRef = useRef(null);
19
+ return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
20
+ "section",
21
+ {
22
+ "aria-label": "Scrollable container example",
23
+ className: "relative h-96 overflow-y-scroll rounded border border-gray-300",
24
+ ref: containerRef,
25
+ tabIndex: 0,
26
+ children: [
27
+ /* @__PURE__ */ jsx(Story, { args: { container: containerRef } }),
28
+ /* @__PURE__ */ jsxs("div", { className: "h-[200vh] p-4", children: [
29
+ /* @__PURE__ */ jsx("h2", { className: "mb-4 font-bold text-xl", children: "Container Scroll Example" }),
30
+ /* @__PURE__ */ jsx("p", { className: "mb-4", children: "Scroll within this container to see the progress bar at the top." }),
31
+ /* @__PURE__ */ jsx("p", { className: "mb-4", children: "The progress bar tracks this container's scroll position, not the window's scroll." }),
32
+ /* @__PURE__ */ jsx("div", { className: "mt-8 space-y-4", children: Array.from({ length: 20 }, (_, i) => (
33
+ // biome-ignore lint/suspicious/noArrayIndexKey: Static demo content
34
+ /* @__PURE__ */ jsxs("p", { className: "rounded bg-gray-100 p-4", children: [
35
+ "Content block ",
36
+ i + 1
37
+ ] }, `content-${i}`)
38
+ )) })
39
+ ] })
40
+ ]
41
+ }
42
+ ) });
43
+ }
44
+ ]
45
+ };
14
46
  export {
15
47
  NoScroll,
16
48
  Scroll,
49
+ WithContainer,
17
50
  scroll_linked_stories_default as default
18
51
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k8o/arte-odyssey",
3
- "version": "1.3.0",
3
+ "version": "1.4.1",
4
4
  "description": "k8o's react ui library",
5
5
  "author": "k8o <kosakanoki@gmail.com>",
6
6
  "keywords": [
@@ -55,32 +55,32 @@
55
55
  "@floating-ui/react": "0.27.16",
56
56
  "baseline-status": "1.0.11",
57
57
  "clsx": "2.1.1",
58
- "esbuild": "0.25.12",
59
- "lucide-react": "0.552.0",
58
+ "esbuild": "0.27.0",
59
+ "lucide-react": "0.555.0",
60
60
  "motion": "12.23.24",
61
61
  "react-error-boundary": "6.0.0",
62
- "tailwind-merge": "3.3.1"
62
+ "tailwind-merge": "3.4.0"
63
63
  },
64
64
  "devDependencies": {
65
- "@chromatic-com/storybook": "4.1.2",
66
- "@storybook/addon-a11y": "10.0.2",
67
- "@storybook/addon-docs": "10.0.2",
68
- "@storybook/addon-vitest": "10.0.2",
69
- "@storybook/react-vite": "10.0.2",
70
- "@tailwindcss/postcss": "4.1.16",
71
- "@types/react": "19.2.2",
72
- "@types/react-dom": "19.2.2",
73
- "@vitejs/plugin-react-swc": "4.2.0",
74
- "@vitest/browser-playwright": "4.0.6",
75
- "@vitest/ui": "4.0.6",
65
+ "@chromatic-com/storybook": "4.1.3",
66
+ "@storybook/addon-a11y": "10.1.2",
67
+ "@storybook/addon-docs": "10.1.2",
68
+ "@storybook/addon-vitest": "10.1.2",
69
+ "@storybook/react-vite": "10.1.2",
70
+ "@tailwindcss/postcss": "4.1.17",
71
+ "@types/react": "19.2.7",
72
+ "@types/react-dom": "19.2.3",
73
+ "@vitejs/plugin-react-swc": "4.2.2",
74
+ "@vitest/browser-playwright": "4.0.14",
75
+ "@vitest/ui": "4.0.14",
76
76
  "postcss": "8.5.6",
77
- "react": "19.2.0",
78
- "react-dom": "19.2.0",
79
- "storybook": "10.0.2",
77
+ "react": "19.2.1",
78
+ "react-dom": "19.2.1",
79
+ "storybook": "10.1.2",
80
80
  "storybook-addon-mock-date": "1.0.2",
81
- "tailwindcss": "4.1.16",
82
- "vite": "7.1.12",
83
- "vitest": "4.0.6",
81
+ "tailwindcss": "4.1.17",
82
+ "vite": "7.2.4",
83
+ "vitest": "4.0.14",
84
84
  "vitest-browser-react": "2.0.2"
85
85
  },
86
86
  "peerDependencies": {