npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@bernierllc/workflow-ui

v0.1.2

Published

Workflow management interface with approval queues and state visualization

Downloads

237

Readme

@bernierllc/workflow-ui

Workflow management interface with approval queues and state visualization.

Installation

npm install @bernierllc/workflow-ui

Features

  • Workflow Dashboard - Overview of all workflows by status
  • Approval Queue - Organized queue of pending approvals with bulk actions
  • Visual State Flow - Interactive workflow state diagrams
  • Workflow Builder - Drag-and-drop workflow creation
  • Workflow History - Complete event timeline display
  • Real-time Updates - Live status changes via optional refresh
  • Role-based UI - Permission-based feature access
  • Mobile-responsive - Optimized for all screen sizes

Components

WorkflowDashboard

Main dashboard showing workflow overview and metrics.

import { WorkflowDashboard } from '@bernierllc/workflow-ui';

<WorkflowDashboard
  workflows={workflows}
  userId="user123"
  role="editor"
  onWorkflowSelect={(workflow) => console.log('Selected:', workflow)}
  showMetrics={true}
  refreshInterval={30000}
  onRefresh={async () => await fetchWorkflows()}
/>

ApprovalQueue

Queue of pending approvals with bulk actions.

import { ApprovalQueue } from '@bernierllc/workflow-ui';

<ApprovalQueue
  approver="user123"
  approvals={approvals}
  onApprove={async (id, notes) => await approveWorkflow(id, notes)}
  onReject={async (id, reason) => await rejectWorkflow(id, reason)}
  onBulkAction={async (ids, action) => await bulkAction(ids, action)}
  sortBy="priority"
/>

WorkflowStateVisualizer

Visual representation of workflow state flow.

import { WorkflowStateVisualizer } from '@bernierllc/workflow-ui';

<WorkflowStateVisualizer
  workflow={workflow}
  interactive={true}
  onStateClick={(state) => console.log('Clicked:', state)}
  showTimestamps={true}
  showActors={true}
  layout="horizontal"
/>

WorkflowBuilder

Interactive workflow creation and editing.

import { WorkflowBuilder } from '@bernierllc/workflow-ui';

<WorkflowBuilder
  initialWorkflow={template}
  onSave={async (workflow) => await saveWorkflow(workflow)}
  onPreview={(workflow) => console.log('Preview:', workflow)}
  availableStates={['draft', 'pending_review', 'approved', 'published']}
  availableActions={actions}
  readOnly={false}
/>

WorkflowHistory

Event timeline for workflow changes.

import { WorkflowHistory } from '@bernierllc/workflow-ui';

<WorkflowHistory
  workflowId="w123"
  showDetails={true}
  maxEvents={50}
  onEventClick={(event) => console.log('Event:', event)}
  onLoadHistory={async (id) => await fetchHistory(id)}
/>

ApprovalRequestCard

Individual approval request card.

import { ApprovalRequestCard } from '@bernierllc/workflow-ui';

<ApprovalRequestCard
  request={approval}
  onApprove={(notes) => handleApprove(notes)}
  onReject={(reason) => handleReject(reason)}
  onView={() => viewWorkflow()}
  showActions={true}
  compact={false}
/>

Hooks

useWorkflowDashboard

Manage workflow dashboard state.

import { useWorkflowDashboard } from '@bernierllc/workflow-ui';

const {
  workflows,
  filteredWorkflows,
  metrics,
  isLoading,
  error,
  refresh,
  setFilters,
} = useWorkflowDashboard({
  workflows: initialWorkflows,
  filters: { status: ['active'] },
  refreshInterval: 30000,
  onRefresh: async () => await fetchWorkflows(),
});

useApprovalQueue

Manage approval queue state.

import { useApprovalQueue } from '@bernierllc/workflow-ui';

const {
  filteredApprovals,
  selectedIds,
  isProcessing,
  approve,
  reject,
  bulkApprove,
  bulkReject,
  toggleSelection,
  selectAll,
  clearSelection,
} = useApprovalQueue({
  approvals,
  onApprove: async (id, notes) => await approveWorkflow(id, notes),
  onReject: async (id, reason) => await rejectWorkflow(id, reason),
});

useWorkflowBuilder

Manage workflow builder state.

import { useWorkflowBuilder } from '@bernierllc/workflow-ui';

const {
  workflow,
  isDirty,
  isValid,
  errors,
  updateName,
  addState,
  addTransition,
  save,
  preview,
  reset,
} = useWorkflowBuilder({
  initialWorkflow: template,
  onSave: async (workflow) => await saveWorkflow(workflow),
});

useWorkflowHistory

Manage workflow history state.

import { useWorkflowHistory } from '@bernierllc/workflow-ui';

const { events, isLoading, error, refresh } = useWorkflowHistory({
  workflowId: 'w123',
  maxEvents: 50,
  onLoadHistory: async (id) => await fetchHistory(id),
});

Utilities

import {
  formatDate,
  formatRelativeTime,
  isWorkflowOverdue,
  getPriorityColor,
  getStateColor,
  sortByPriority,
  filterWorkflows,
} from '@bernierllc/workflow-ui';

// Format dates
const formatted = formatDate(new Date());
const relative = formatRelativeTime(new Date());

// Check overdue status
const overdue = isWorkflowOverdue(workflow);

// Get colors
const color = getPriorityColor('urgent');
const stateColor = getStateColor('approved');

// Sort workflows
const sorted = sortByPriority(workflows);

// Filter workflows
const filtered = filterWorkflows(workflows, {
  status: ['active'],
  priority: ['high', 'urgent'],
});

Types

import type {
  Workflow,
  WorkflowTemplate,
  WorkflowEvent,
  ApprovalRequest,
  ContentState,
  WorkflowStatus,
  WorkflowFilters,
  WorkflowMetrics,
} from '@bernierllc/workflow-ui';

Content States

The workflow system supports the following states:

  • draft - Initial content creation
  • pending_review - Waiting for review
  • approved - Approved for publishing
  • published - Live content
  • archived - Archived content

Integration with State Machine

This package integrates with @bernierllc/state-machine for state transition logic:

import { StateMachine } from '@bernierllc/state-machine';
import { WorkflowStateVisualizer } from '@bernierllc/workflow-ui';

const stateMachine = new StateMachine({
  initial: 'draft',
  states: ['draft', 'pending_review', 'approved', 'published'],
  transitions: {
    draft: ['pending_review'],
    pending_review: ['draft', 'approved'],
    approved: ['published'],
    published: [],
  },
});

// Use with visualizer
<WorkflowStateVisualizer
  workflow={workflow}
  interactive={true}
  onStateClick={async (state) => {
    await stateMachine.transition(state);
  }}
/>

Styling

This package uses Tamagui for styling. All components are fully themed and responsive.

Custom Theme

import { TamaguiProvider } from 'tamagui';
import config from '@tamagui/config/v3';

<TamaguiProvider config={config}>
  <WorkflowDashboard workflows={workflows} />
</TamaguiProvider>

License

Copyright (c) 2025 Bernier LLC. All rights reserved.

This file is licensed to the client under a limited-use license. The client may use and modify this code only within the scope of the project it was delivered for. Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.