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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@risalabs_frontend_org/oasis-ui-kit

v0.223.0

Published

RISA Oasis UI

Readme

RISA Oasis UI Kit

A comprehensive React UI component library built with TypeScript and SCSS, featuring 35+ production-ready components for building modern web applications.

Installation

npm install @risalabs_frontend_org/oasis-ui-kit

⚠️ Important Notes

  • DO NOT increase build number in package.json
  • DO NOT publish manually - the CI/CD pipeline handles publishing

Development

Prerequisites

  • Node.js (v18 or higher recommended)
  • npm

Getting Started

# Install dependencies
npm install

# Start Storybook development server
npm run storybook

Open http://localhost:6006 to view the component library in your browser.

Available Scripts

| Command | Description | |---------|-------------| | npm run storybook | Start Storybook dev server on port 6006 | | npm run build-storybook | Build static Storybook site | | npm run build | Build the library for production | | npm run test | Run unit tests with Jest | | npm run chromatic | Run visual regression tests with Chromatic |


Components

Form Controls

Button

A versatile button component with multiple variants and sizes.

import { Button } from '@risalabs_frontend_org/oasis-ui-kit';

<Button
  buttonType="primary" // "primary" | "secondary" | "tertiary" | "danger"
  size="medium"        // "small" | "medium" | "large"
  disabled={false}
  onClick={() => {}}
>
  Click Me
</Button>

ButtonWithDropdown

A split button with dropdown menu functionality.

import { ButtonWithDropdown } from '@risalabs_frontend_org/oasis-ui-kit';

<ButtonWithDropdown
  buttonType="primary"
  size="medium"
  disabled={false}
  menuData={[
    { label: 'Option 1', onClick: (item) => console.log(item) },
    { label: 'Option 2', onClick: (item) => console.log(item), color: '#ff0000' }
  ]}
  alwaysOpenDropdown={false} // If false, content and chevron act independently
  onButtonClick={() => {}}   // Called when content area is clicked (split mode)
>
  Actions
</ButtonWithDropdown>

TextInput

A flexible text input with label, validation, formatting, and password visibility toggle.

import { TextInput } from '@risalabs_frontend_org/oasis-ui-kit';

<TextInput
  id="username"
  label="Username"
  placeholder="Enter username"
  required={true}
  type="text"              // "text" | "number"
  textHidden={false}       // Enable password mode
  error="Invalid username"
  onChange={(data) => console.log(data)}
  onBlur={(data) => console.log(data)}
  formatInput={(value) => value.toUpperCase()} // Custom formatting
/>

Select

A custom dropdown select component with search and validation.

import { Select } from '@risalabs_frontend_org/oasis-ui-kit';

<Select
  id="country"
  label="Country"
  placeholder="Select a country"
  options={[
    { value: 'us', label: 'United States' },
    { value: 'uk', label: 'United Kingdom' }
  ]}
  required={true}
  onOptionChange={(data) => console.log(data)}
/>

CheckBox

A styled checkbox component.

import { CheckBox } from '@risalabs_frontend_org/oasis-ui-kit';

<CheckBox
  id="terms"
  label="I agree to the terms"
  defaultValue={false}
  isDisabled={false}
  onCheckBoxValueChange={(data) => console.log(data)}
/>

Toggle & ToggleSwitch

Toggle switch components for boolean settings.

import { Toggle, ToggleSwitch } from '@risalabs_frontend_org/oasis-ui-kit';

// Toggle with label
<Toggle
  id="notifications"
  label="Enable Notifications"
  defaultValue={true}
  onChange={(data) => console.log(data)}
/>

// Standalone toggle switch
<ToggleSwitch
  id="darkMode"
  defaultChecked={false}
  onChangeEmit={(data) => console.log(data)}
/>

RadioButton

A radio button group supporting vertical/horizontal layout with customizable selected color.

import { RadioButton } from '@risalabs_frontend_org/oasis-ui-kit';

<RadioButton
  name="plan"
  options={[
    { label: 'Basic', value: 'basic' },
    { label: 'Premium', value: 'premium' },
    { label: 'Enterprise', value: 'enterprise', disabled: true }
  ]}
  value="basic"
  onChange={(value) => console.log(value)}
  direction="vertical"    // "vertical" | "horizontal"
  gap="0.75rem"           // Custom gap between options
  selectedColor="#1e69da"  // Custom selection color
/>

SelectInput

A lightweight select component using the native <select> element with custom styling.

import { SelectInput } from '@risalabs_frontend_org/oasis-ui-kit';

<SelectInput
  label="Organization"
  options={[
    { label: 'Acme Corp', value: 'acme' },
    { label: 'Globex Inc', value: 'globex' }
  ]}
  defaultValue="acme"
  placeholder="Select..."
  onChange={(value, option) => console.log(value, option)}
  focusBorderWidth="2px"
/>

CustomDropdown

A fully custom dropdown with viewport-aware positioning, portal support, validation, and keyboard navigation.

import { CustomDropdown } from '@risalabs_frontend_org/oasis-ui-kit';

<CustomDropdown
  label="Organization"
  options={[
    { label: 'Acme Corp', value: 'acme' },
    { label: 'Globex Inc', value: 'globex' }
  ]}
  defaultValue="acme"
  placeholder="Select..."
  onChange={(value, option) => console.log(value, option)}
  required={true}
  error="This field is required" // Shows red border and error message
  hint="Choose your organization"
  shouldUsePortal={false}        // Render via React portal to escape overflow:hidden
  focusBorderWidth="1px"
/>

ActionInput

A text input with an adjacent action button and dirty-state detection. The icon color changes when the value differs from the initial value.

import { ActionInput } from '@risalabs_frontend_org/oasis-ui-kit';

<ActionInput
  value="BMKYUTS8"
  onChange={(value) => console.log(value)}
  onAction={(value) => console.log('Submitted:', value)}
  placeholder="Enter code..."
  readOnly={false}
  disabled={false}
  iconColor="#6B6B6B"   // Default icon color
  iconSize={16}         // Icon size in px
  height="2rem"         // Container height
  dirtyColor="#0056D6"  // Icon color when value is modified
/>

Date & Time Components

DateInput

A date input with custom format support using moment.js.

import { DateInput } from '@risalabs_frontend_org/oasis-ui-kit';

<DateInput
  id="birthdate"
  label="Date of Birth"
  placeholder="Select date"
  format="DD/MM/YYYY"    // Custom display format
  required={true}
  onChange={(data) => console.log(data)}
  onBlur={(data) => console.log(data)}
/>

DatePicker

A calendar-based date picker component.

import { DatePicker } from '@risalabs_frontend_org/oasis-ui-kit';

<DatePicker
  initialDate={new Date()}
  onDateChange={(date) => console.log(date)}
/>

DateRangeCalendar

A calendar for selecting date ranges with month/year selectors.

import { DateRangeCalendar } from '@risalabs_frontend_org/oasis-ui-kit';

<DateRangeCalendar
  initialStartDate={new Date()}
  initialEndDate={new Date()}
  onDateRangeChange={(startDate, endDate) => console.log(startDate, endDate)}
  resetSelection={false}
/>

TimeDue

Component for displaying time-related information.

import { TimeDue } from '@risalabs_frontend_org/oasis-ui-kit';

<TimeDue {...props} />

File Handling

FileUpload

A file upload component with preview and delete functionality.

import { FileUpload } from '@risalabs_frontend_org/oasis-ui-kit';

<FileUpload
  id="documents"
  deleteUploadedFile={() => {}}
/>

AttachmentCard

Display uploaded files with upload progress indicator.

import { AttachmentCard } from '@risalabs_frontend_org/oasis-ui-kit';

<AttachmentCard
  title="document.pdf"
  isUploading={true}
  uploadProgress={65}
  onDelete={() => {}}
/>

UploadedFileBanner

Banner display for uploaded files.

import { UploadedFileBanner } from '@risalabs_frontend_org/oasis-ui-kit';

<UploadedFileBanner {...props} />

Navigation

SideNavigation

A vertical side navigation with tab-style content switching.

import { SideNavigation } from '@risalabs_frontend_org/oasis-ui-kit';

<SideNavigation
  sideTabContent={[
    { id: 'profile', label: 'Profile', sideNavContent: ProfileComponent },
    { id: 'settings', label: 'Settings', sideNavContent: SettingsComponent }
  ]}
/>

HorizontalNavigationTab

A horizontal tab navigation bar with active indicator, custom colors, and keyboard navigation.

import { HorizontalNavigationTab } from '@risalabs_frontend_org/oasis-ui-kit';

<HorizontalNavigationTab
  tabs={[
    { label: 'Overview', value: 'overview' },
    { label: 'Details', value: 'details' },
    { label: 'History', value: 'history', disabled: true }
  ]}
  value="overview"
  onChange={(value) => console.log(value)}
  activeColor="#1E69DA"          // Active tab text & border color
  backgroundColor="#F5F5F5"     // Tab background
  activeBackgroundColor="#FFF"  // Active tab background
  rounded={true}                // Rounded top corners
/>

TabContainer & SingleTab

Horizontal tab navigation components.

import { TabContainer, SingleTab } from '@risalabs_frontend_org/oasis-ui-kit';

<TabContainer {...props} />

Pagination

A pagination control with prev/next buttons.

import { Pagination } from '@risalabs_frontend_org/oasis-ui-kit';

<Pagination
  currentPage={1}
  totalPages={10}
  onPrevious={() => {}}
  onNext={() => {}}
  disabled={false}
/>

Stepper

A vertical stepper for multi-step processes.

import { Stepper } from '@risalabs_frontend_org/oasis-ui-kit';

<Stepper
  id={0}
  currentActiveIndex={1}
  label="Step 1: Personal Info"
  stepperText="1"
  showDashedLine={true}
/>

Feedback & Overlays

Modal

A customizable modal dialog with header, body, and footer.

import { Modal, openModal, closeModal } from '@risalabs_frontend_org/oasis-ui-kit';

<Modal
  dialogId="myModal"
  title="Confirm Action"
  saveButtonText="Confirm"
  cancelText="Cancel"
  onSave={() => {}}
  onCancel={() => {}}
  onClose={() => {}}
  showSingleButton={false}
  hideFooter={false}
  disableSave={false}
>
  <p>Are you sure you want to continue?</p>
</Modal>

// Control modal visibility
openModal('myModal');
closeModal('myModal');

Toast

Notification toast for success/error messages. Uses a simple imperative API.

import { ToastContainer, toast } from '@risalabs_frontend_org/oasis-ui-kit';

// 1. Add ToastContainer once in your app root (e.g., App.tsx)
function App() {
  return (
    <>
      <ToastContainer />
      {/* rest of your app */}
    </>
  );
}

// 2. Call toast.success or toast.error anywhere in your app
toast.success("Changes saved!");
toast.error("Something went wrong");

// With optional header
toast.success("Your file has been uploaded", "Upload Complete");

// With custom duration (default: 3000ms)
toast.error("Connection failed", "Network Error", 5000);

API: | Method | Parameters | Description | |--------|------------|-------------| | toast.success(message, header?, duration?) | message: string, header?: string, duration?: number | Show success toast | | toast.error(message, header?, duration?) | message: string, header?: string, duration?: number | Show error toast |

InfoIconWithTooltip

An info icon with popover tooltip.

import { InfoIconWithTooltip } from '@risalabs_frontend_org/oasis-ui-kit';

<InfoIconWithTooltip
  content={<p>This is helpful information</p>}
  directionToDisplay="bottom" // "left" | "right" | "top" | "bottom"
  maxWidth={20}  // in rem
  maxHeight={10} // in rem
/>

Layout & Display

HeaderCard

A card component for headers/titles.

import { HeaderCard } from '@risalabs_frontend_org/oasis-ui-kit';

<HeaderCard {...props} />

Footer

A footer component.

import { Footer } from '@risalabs_frontend_org/oasis-ui-kit';

<Footer {...props} />

NotificationCard

A card for displaying notifications.

import { NotificationCard } from '@risalabs_frontend_org/oasis-ui-kit';

<NotificationCard {...props} />

StatusText

Display status text with styling.

import { StatusText } from '@risalabs_frontend_org/oasis-ui-kit';

<StatusText {...props} />

Tags

A styled tag component with optional dropdown selection. Options are displayed as styled tags. Supports portal rendering for overflow-hidden containers.

import { Tags } from '@risalabs_frontend_org/oasis-ui-kit';

<Tags
  label="Financial"
  backgroundColor="#FFFCD6"
  textColor="#665D00"
  showBorder={false}
  shouldUsePortal={false}
  options={[
    { label: 'Financial', value: 'financial', backgroundColor: '#FFFCD6', textColor: '#665D00' },
    { label: 'Medical', value: 'medical', backgroundColor: '#eefcf4', textColor: '#007028' },
    { label: 'Clinical', value: 'clinical', backgroundColor: '#eaf2ff', textColor: '#002152' }
  ]}
  onSelect={(option) => console.log(option)}
/>

Badge

A styled badge with optional left/right icons, tooltip, and customizable colors.

import { Badge } from '@risalabs_frontend_org/oasis-ui-kit';

<Badge
  text="Active"
  backgroundColor="#eefcf4"
  textColor="#007028"
  size="medium"         // "small" | "medium" | "large"
  maxWidth="200px"
  borderColor="#007028"
  showTooltip={true}
  leftIcon={<SomeIcon />}
  onLeftIconClick={(e) => {}}
/>

BadgeGroup

Displays a collection of badges with overflow handling, showing a "+N more" indicator for hidden items.

import { BadgeGroup } from '@risalabs_frontend_org/oasis-ui-kit';

<BadgeGroup
  badges={[
    { text: 'React', backgroundColor: '#e0f2fe', textColor: '#0369a1' },
    { text: 'TypeScript', backgroundColor: '#ede9fe', textColor: '#6d28d9' },
    { text: 'SCSS', backgroundColor: '#fce7f3', textColor: '#be185d' }
  ]}
  maxVisible={2}
  size="medium"
  showBadgeTooltips={true}
  showOverflowTooltip={true}
  onOverflowClick={(hiddenBadges) => console.log(hiddenBadges)}
/>

RuleCard

A card for displaying text rules with optional numbered index and edit/delete action buttons.

import { RuleCard } from '@risalabs_frontend_org/oasis-ui-kit';

<RuleCard
  content="Patient must have a valid prescription before dispensing."
  index={1}                      // Optional numbered badge
  onEdit={() => console.log('edit')}
  onDelete={() => console.log('delete')}
  editIconColor="#0056D6"
  deleteIconColor="#F50400"
  iconSize={12}
  contentClassName="custom-text"
/>

MultiLineTextWithCopy

Displays primary and secondary text with a copy-to-clipboard button for the secondary value.

import { MultiLineTextWithCopy } from '@risalabs_frontend_org/oasis-ui-kit';

<MultiLineTextWithCopy
  primaryText="John Doe"
  secondaryText="NPI-1234567890"
  copyValue="1234567890"      // Optional: overrides secondaryText for clipboard
  onCopy={(value) => console.log('Copied:', value)}
  copyIconColor="#0056D6"
  copyIconSize={16}
  shouldTruncate={false}      // Truncate primary text with ellipsis
/>

ThreeDotButton

A three-dot (kebab) menu button with a dropdown options list and viewport-aware positioning.

import { ThreeDotButton } from '@risalabs_frontend_org/oasis-ui-kit';

<ThreeDotButton
  options={[
    { id: 'edit', text: 'Edit' },
    { id: 'delete', text: 'Delete' },
    { id: 'archive', text: 'Archive' }
  ]}
  onOptionClick={(optionId) => console.log(optionId)}
/>

PopOverWithClickableOptions

A popover menu displaying a list of clickable options with optional icons.

import { PopOverWithClickableOptions } from '@risalabs_frontend_org/oasis-ui-kit';

<PopOverWithClickableOptions
  options={[
    { id: 'view', text: 'View Details', icon: <ViewIcon /> },
    { id: 'download', text: 'Download' }
  ]}
  onClick={(id) => console.log(id)}
/>

ProfileButton

A user profile button with avatar and dropdown indicator.

import { ProfileButton } from '@risalabs_frontend_org/oasis-ui-kit';

<ProfileButton
  name="John Doe"
  initials="JD"
  imageUrl="/avatar.jpg"        // Optional: use image instead of initials
  avatarBackgroundColor="#007028"
  onClick={() => {}}
/>

Loaders

SpinningLoader

A simple spinning loading indicator.

import { SpinningLoader } from '@risalabs_frontend_org/oasis-ui-kit';

<SpinningLoader />

ProgressLoaderWithText

A loader with text description.

import { ProgressLoaderWithText } from '@risalabs_frontend_org/oasis-ui-kit';

<ProgressLoaderWithText {...props} />

Search

SearchComponent

A search input with button.

import { SearchComponent } from '@risalabs_frontend_org/oasis-ui-kit';

<SearchComponent
  placeholder="Search..."
  onSearch={(query) => console.log(query)}
/>

Criteria Tree Builder

CriteriaTreeBuilder

A visual, nested AND/OR builder for free-text statements. Renders a tree of statement rows grouped under AND/OR conjunctions, with support for arbitrarily nested groups. The statement input for each row is supplied by you via renderStatementInput; the resulting tree is JSON-serializable.

import { CriteriaTreeBuilder, CriteriaTreeBuilderValue } from '@risalabs_frontend_org/oasis-ui-kit';

const [tree, setTree] = useState<CriteriaTreeBuilderValue>({
  type: 'group',
  id: 'root',
  conjunction: 'OR',
  children: [
    { type: 'statement', id: 's1', value: 'Absolute iron deficiency – ferritin < 30 ng/mL' },
  ],
});

<CriteriaTreeBuilder
  value={tree}
  onChange={setTree}
  renderStatementInput={({ statement, onStatementChange }) => (
    <input
      type="text"
      defaultValue={statement.value}
      onChange={(e) => onStatementChange(e.target.value)}
    />
  )}
/>

Key props:

  • renderStatementInput — required — renders the statement input for every condition row
  • disabled — render read-only (inputs inert, add/remove hidden)
  • allowNestedGroups / maxNestingDepth — control nesting
  • labels — override default labels (i18n)

The component is fully controlled via value/onChange. The data model and tree helpers are also exported (CriteriaTreeBuilderValue, createEmptyStatement, createEmptyGroup, updateNodeById, etc.) so dashboards can build, inspect, or serialize the tree to their own persistence format.

Mapping to the backend persistence tree

The builder value (CriteriaGroup / CriteriaStatement) is the visual shape. The guideline is persisted as a list of ChecklistItems (the guideline's tree) — a different shape. Two exported mappers convert between them:

  • criteriaTreeBuilderValueToChecklistTree(value) → CriteriaChecklistNode[] — serialize on save / the JSON tab.
  • criteriaChecklistTreeToCriteriaTreeBuilderValue(tree) → CriteriaTreeBuilderValue — load a persisted tree into the builder.

Backend node fields:

| Field | Meaning | | --------- | ------- | | index | 1-based position within the current level (1, 2, 3…). Regenerated on save; the builder doesn't manage it. | | statement | The node's text. Leaves are the free-text criteria evaluated by the LLM; internal nodes usually carry a grouping label (often empty). | | operator | How this node joins its next sibling: and / or / none. For a level of N items, items[0..N-2].operator joins item i to item i+1; the last item's operator is ignored by the left-associative fold (write none). |

Conversion rules:

  • To backend (save): the single root group is wrapped in a one-element root item (statement: "", operator: "none"). A group's conjunction becomes operator on every child except the last (lowercased); the last child gets none. A statement's value becomes statement; a group's label becomes its statement. index is assigned 1-based per level.
  • To builder (load): a single-element wrapper (empty statement, operator: "none") is unwrapped so its id/children become the root group. A list with no wrapper (or several top-level items) is folded under a synthetic root so nothing is dropped. A group's conjunction is the first child operator that isn't none (defaults to AND). A childless node's statement becomes a leaf's value; a node with children becomes a group and its statement becomes the group's label.
import {
  criteriaTreeBuilderValueToChecklistTree,
  criteriaChecklistTreeToCriteriaTreeBuilderValue,
} from '@risalabs_frontend_org/oasis-ui-kit';

// Load a persisted guideline tree into the builder:
const value = criteriaChecklistTreeToCriteriaTreeBuilderValue(guideline.tree);

// Serialize the edited tree back for saving:
const tree = criteriaTreeBuilderValueToChecklistTree(value);

Id stability is load-bearing. The review flow re-collates stored evaluation items by matching items_by_id against the persisted tree. Node ids must stay stable across edits — an upsert or a JSON-tab paste that re-issues ids silently orphans the stored items, and re-collation treats everything as Undetermined. The builder assigns ids only on create and preserves them through every mutation; keep ids intact when you paste or upsert a tree.

Root operators are honored. The evaluator folds the top level just like any other level, so the builder's root AND/OR is distributed to the first root item (last = none). It is not ignored.


PdfRenderer image editing and export

Enable local PNG/JPEG image placement with features={{ imageEditing: true }}. The ref and custom toolbar context expose image commands, undo/redo, dirty state, and exportPdf({ pageIndices, flattenImages }), which returns PDF bytes and a Blob without downloading. Editing permissions and exported source pages are configured separately, so clinical reference pages can stay visible while only fax pages are exported. Acknowledge a successful upload with imageEditor.markSaved(result.saveToken); exporting alone does not clear dirty.

See the public API, page conventions, and fax-only consumer example and Components / PdfRenderer / Image editing in Storybook.

PdfFormRenderer

A controlled PDF form editor built on the existing EmbedPDF-based PdfRenderer. It displays supplied text answers and checkbox states directly over the PDF and supports adding, selecting, moving, resizing, and deleting field boxes. The sidebar edits the question, answer format, answer, checkbox export values, and rectangle. Fields retain their IDs when labels change.

import { useState } from 'react';
import { PdfFormRenderer, PdfFormField } from '@risalabs_frontend_org/oasis-ui-kit';

function FormEditor() {
  const [fields, setFields] = useState<PdfFormField[]>([{
    id: 'patient-name',
    pageIndex: 0,
    type: 'text',
    label: 'Full name of patient',
    rect: [48, 624, 354, 650],
    value: 'Alex Example',
    answerFormat: null,
  }]);

  return <PdfFormRenderer
    src="/template.pdf"
    fields={fields}
    onFieldsChange={(next, change) => {
      setFields(next);
      // Persist change.type ('add', 'update', 'delete') in your application.
    }}
    height={700}
    wasmUrl="/pdfium/pdfium.wasm"
  />;
}
  • pageIndex is zero-based. rect is [x0, y0, x1, y1] in PDF points, independent of zoom. coordinateOrigin defaults to "bottom-left"; set it to "top-left" for top-left API coordinates. Callbacks retain the chosen origin.
  • Pass the resolved answer as value. An empty string stays empty; the component never falls back to an older answer. When mapping an answers API response, check for the presence of a resolved value rather than using value || answer: Object.prototype.hasOwnProperty.call(values, id) ? values[id] : answer.answer. Resolve reviewer edits in the consuming application before passing fields.
  • Checkbox options are the checked export values. A matching string checks the box; boolean values are used directly. Without options, yes, true, 1, on, checked, and x are recognized. Empty and nonmatching values stay unchecked.
  • Accept onFieldsChange into your own state. The callback receives the next array and the changed field; updates also contain previousField. No API calls or persistence are performed by the library. Missing onFieldsChange or readOnly={true} prevents changes while retaining selection and navigation.
  • Selection can be controlled with selectedFieldId and onSelectionChange. Click a listed field or its PDF box to select it. The add buttons toggle their drawing mode on and off; selecting a field, adding a box, or pressing Escape returns to normal selection. Hide the field list and details with showFieldEditor={false} (editable tools remain in the sidebar), or replace its detail editor with renderFieldEditor. createFieldId can supply your own unique IDs.
  • Arrow keys move a focused field; Shift + arrows resize; Alt changes the step from 1 to 10 points. Delete/Backspace removes a field. Escape cancels a gesture or exits add mode. In add mode, Tab to a page and press Enter to add a field at its center. The rectangle inputs provide an additional keyboard editing path.
  • Viewer source types, zoom/search/navigation, loading/error renderers, custom page overlays, and the PdfRendererHandle ref remain available. Text selection is disabled during editing so dragging operates on the form fields. Each page reveals its field overlay after the PDF page image has loaded, so fields do not appear over a blank page during initial rendering.

These are visual overlays and controlled field data; they do not write answers into the PDF bytes. Exporting a filled PDF and persisting template changes belong to the consuming application. Geometry uses page-local coordinates for the document orientation displayed by PdfRenderer.

Storybook includes editable, read-only, empty, top-left-coordinate, and error examples with a two-page local synthetic form and locally served PDFium WASM.


Types & Utilities

The library exports a comprehensive color palette and types:

import { Colors, productWidgetColors, WidgetType } from '@risalabs_frontend_org/oasis-ui-kit';

// Color palette includes:
// - Primary Green (primaryGreen1-11)
// - Primary Gray (primaryGray1-16)
// - Secondary Purple, Yellow, Orange
// - Tertiary Red, Magenta, Cyan, Lime, Blue
// - Grayscale Black

Tech Stack

  • React 18.x
  • TypeScript 5.x
  • SCSS for styling
  • Storybook 7.x for component documentation
  • Jest + React Testing Library for testing
  • Webpack for bundling
  • Moment.js & date-fns for date handling
  • Ant Design Icons for icons
  • React Feather for additional icons

Project Structure

oasis-ui/
├── src/
│   ├── components/       # All UI components
│   ├── shared/           # Shared styles, types, and utilities
│   ├── stories/          # Additional Storybook stories
│   └── SVG/              # SVG icon components
├── stories/              # Main Storybook stories
├── public/
│   └── icons/            # Static SVG icons
├── index.ts              # Main entry point (exports)
└── index.d.ts            # TypeScript declarations

Contributing

  1. Create a feature branch from main
  2. Make your changes
  3. Add/update Storybook stories for your components
  4. Add/update unit tests
  5. Submit a pull request

License

Proprietary - RISA Labs