Changelog
What each version changes, in plain words. The technical list is in CHANGELOG.md in the repository.
0.26.2
LatestActionDialog: ad blockers no longer hide the typed-name field; the field is back above the buttons.
- FixedActionDialog: ad blockers hid the typed-name field (`confirmName`). The field had the attribute `data-ad-name`, and the common block lists (EasyList, AdGuard Base) hide every element with that attribute on every site. With a blocker, a person could not type the name, so the action stayed refused. The internal attributes of the dialog now start with `data-dialog-`, and a test keeps every `data-ad` attribute out of the dialog.
- FixedActionDialog: the typed-name field is back in the body, above the buttons, as in 0.26.0. The 0.26.1 change did not fix the cause (above).
0.26.1
ActionDialog: the typed-name field is with the buttons, so a phone never hides it.
- FixedActionDialog: the typed-name field (`confirmName`) is now in the bottom area with the buttons. Before, on a phone, a long dialog showed the line "Type <name> to confirm." just above the buttons and kept the field under them until the person scrolled to the very end, so the field looked missing.
0.26.0
SegmentedControl and RecordSummary wrap forms; DataTable card title; focus target on ActionDialog, Dialog, AlertDialog and Sheet; TimeText sentence form; DataTable row names, PageHeader phone focus return and StatusDot text fixed.
- BetterSegmentedControl: `wrap` lets the options go to more rows when the row is too narrow, for a filter with many options on a phone. The fill moves to the chosen option on any row.
- BetterRecordSummary: an item with `wrap` shows its whole value, not cut at 2 lines, for a state sentence that a person must read on a phone.
- BetterDataTable: `cardTitle` gives each card its own title, for example the order and the customer when the customer column is hidden on cards. The table view keeps the title cell.
- BetterActionDialog: `returnFocusTo` names the element that gets the focus when the dialog closes, for example a section heading after a link in the dialog moved the person there. Without it, the focus goes back to the element that had the focus when the dialog opened. `Dialog`, `AlertDialog` and `Sheet` take the same prop when they have no `trigger`. `FormSheet` and `FieldsSheet` take it too.
- BetterTimeText: `inSentence` writes "today", "yesterday" and "tomorrow" in lower case, for a time inside a sentence ("until tomorrow 3:45 PM"). `formatDateTime` takes the same option. Arabic does not change.
- BetterParts without the new props render as before.
- FixedDataTable: with `rowLabel`, the row checkbox and the row menu take their names from that text only. Before, the name joined that text and the title cell text. Without `rowHref`, `rowLabel` did not name them before. The hidden text is in the title cell, so the cell's text content now holds it too.
- FixedPageHeader: below 768 px, a dialog that opens from a "More actions" item gives the focus back to "More actions". Before, the focus went to the page.
- FixedStatusDot: the text after the dot is now inside one `<span>`, so text with a link or a time inside stays one text, with no wide gap. A style that selects the direct children of StatusDot now finds the dot and this span.
0.25.0
TimeText clock-only form; OnceValueDialog focus target; ActionDialog reason length; FieldsSheet input mode; SecretRow second action and sheet button word; DataTable card description block; AttentionList items without a link.
- BetterTimeText: `kind="time"` shows the clock only ("14:02" or "2:02 PM"), for lists grouped by day; the full date and time show on hover, focus or tap. With `ago`, `kind="time"` has no effect.
- BetterOnceValueDialog: `returnFocusTo` names the element that gets the focus when the dialog closes, for a dialog that opens after another dialog closed. Without it, the focus goes back to the element that had the focus when the dialog opened.
- BetterActionDialog: `reason.maxLength` sets the longest reason, in characters.
- BetterFieldsSheet: a field takes `inputMode`, the keyboard that a phone shows (for example `numeric`).
- BetterSecretRow: `action` adds a second action to the row, after the Set or Change button and before the "⋯" menu, only when the row can be edited.
- BetterDataTable: the title column takes `cardDescription`; with `"block"`, a card shows the title column's `description` as a full-width block after the meta line (default `"title"`: under the title, as before).
- BetterAttentionList: the item `href` is optional; an item without it has a plain-text title and no row link. The action and the menu stay.
- BetterParts without the new props render as before.
- FixedSecretRow: the sheet button says "Set" or "Change", the same word as the row button, not "Save".
0.24.0
ActionDialog cancel label; DataTable title column and row label; SecretRow sheet texts and file input; UsageMeter hidden label; controlled ExpandableText; focus return from menus, phone row actions, times in linked rows and rail badge dots fixed.
- BetterActionDialog: `cancelLabel` names the cancel button ("Keep running"). Without it, the built-in word "Cancel".
- BetterDataTable: `titleColumn` sets the column that holds the row link and is the card title (default: the first column); the row checkbox and the row menu take their names from it. With `rowLabel`, the row link is an empty link named by that text, and the title cell keeps its own content and links (a title that is a sentence with links).
- BetterSecretRow: the sheet title is "Set <label>" or "Change <label>"; new `sheetDescription` (under the title), `hint` (under the field), `file` (a button that reads a chosen text file of up to 1 MB into the field; another type or a larger file is refused) and `removeLabel` (the menu item and the confirm action). New built-in string for a file that cannot be read, in English and Arabic.
- BetterUsageMeter: `hideLabel` keeps the label for screen readers only, for a meter that is the value of a fact with its own visible label.
- BetterExpandableText: `open` and `onOpenChange` make it controlled, so another control can open it.
- BetterParts without the new props render as before.
- FixedA dialog, sheet or command palette that opens from a DropdownMenu item gives the focus back to the menu trigger; from a ContextMenu item, to the element that had the focus when the menu opened. Before, the focus went to the page.
- FixedAttentionList: below 768 px the action of a row and its button are full width.
- FixedA TimeText in a linked row or card (Card, DataTable, List) is above the row link: a hover or a tap shows the exact time and does not open the row.
- FixedThe badge dot of an icon rail item (Sidebar rail, SideNav `iconOnly`) is 8 px with a 2 px ring, so it is easy to see. The ring takes `--p-dot-ring` (the page colour by default; the Sidebar sets its own background and the current and hover backgrounds of an item).
0.23.0
New UsageMeter, ChangeList, OnceValueDialog and SecretRow; Timeline steps with state; FilterBar toggles and search suggestions; 24-hour times; phone fixes for tabs, dialogs, sheets and notices.
- NewUsageMeter: how much of a limit is in use, with a limit line, stacked parts (used and held) and an old-data state. Above the limit the value shows in the warning colour with the words "Above limit".
- NewChangeList: values before and after a change, with groups, hidden secret values ("Changed (value hidden)") and a one-line form for a save bar.
- NewOnceValueDialog: shows a new value one time, for example a token, with Copy. It closes only with Done. SecretRow: a secret setting that shows only if it is set and when it changed, with a sheet for a new value and an optional Remove.
- NewNew built-in strings, in English and Arabic.
- BetterTimeline: new step states `running`, `failed`, `warning`, `skipped` and `waiting`, each with a word, not only a colour; `duration`; `detail` that opens with a button (open at the start for a failed step); `time` is optional; `onSelect` makes each step title a button.
- BetterActionDialog: `stays` lists what does not change ("What stays"); `confirmLabel` replaces the typed-name line. Dialog: `fullScreenOnPhone` fills the screen below 768 px, as ActionDialog does. Popover: `label` names the popover for screen readers.
- BetterFormSheet: `side="auto"` opens at the end from 768 px and at the bottom below. FieldsSheet uses it, and a function child gets the draft values.
- BetterFilterBar: a filter with `kind: "toggle"` is one chip that is pressed or not ("Clear filters" turns it off); `search` gets `onSubmit` (Enter), `suggestions` and `maxLength`. Autocomplete: `start` puts an icon before the text; the list has the width of the whole field.
- BetterCopyButton: `label` names the button ("Copy host"); ConnectionCard rows take `copyLabel`. MaskedValue: `open` and `onOpenChange` control the confirm dialog (with `confirm`), so a row menu can open it; `confirm.action` sets the confirm button text.
- Better`hourCycle="h23"` gives 24-hour times (15:05) in `formatDateTime`, `formatTimeOfDay`, TimeText, TimeInput (hours 00–23, no AM/PM; the value does not change) and `PercentProvider`. `agoForm="short"` gives "5 min ago" in `formatRelative`, TimeText and `PercentProvider`. A prop wins over the provider.
- BetterAlert: `collapsible` shows only the icon, the title and a Show button below 768 px; the text and the action open on press, at full width below the title row. It uses CSS only, so the server page is the same.
- BetterLogViewer: keyboard use. The line list is one tab stop; the arrow keys, Home and End move the current line; Shift+F10 or the menu key opens the line menu; Ctrl+C or Cmd+C copies the current line. CodeEditor: `errorList={false}` keeps the line marks and draws no list under the editor.
- BetterLineChart and AreaChart: on touch, the first tap on a point shows its value and a second tap on the same point calls `onSelectPoint`. The limit label has a halo in `--p-chart-surface` (the page colour by default; Card sets its surface).
- BetterRouteTabs: `className` is now on a new wrapper element. The tabs take the full width of their parent. In a flex row, give the other items `shrink-0`.
- Better`useMediaQuery` returns false when `matchMedia` is missing (test set-ups without it).
- BetterParts without the new props render as before.
- FixedSidebar: folding section titles are in capitals, as the plain titles are.
- FixedTabs and RouteTabs: the focus ring is drawn inside the tab, so the scroll row never cuts it; each tab has 4 px inline padding and the gap between tabs is 8 px less, so the text spacing does not change. On phones RouteTabs measures the row: the tabs that fit stay in list order, the current one is always there, and the rest go into More.
- FixedRouteTabs: after a resize to a wide screen, the current tab scrolls into view.
- FixedTooltip: a tooltip that opens on keyboard focus stays open while the focus scrolls the page (also a smooth scroll, up to 1.5 s); a click, a press on the trigger, Escape or a blur closes it.
- FixedLogViewer: the line list shows a focus ring when it gets the focus before a line is current.
- FixedChangeList, UsageMeter and the chart limit label: values with a unit keep their order in Arabic; the chart limit label always grows into the plot.
- FixedDataTable: with `viewKey` and no `toolbar`, phones show no empty toolbar row.
- FixedButton: a `blocked` button keeps the caller's `aria-describedby` and adds its reason.
0.22.0
New AttentionList, RouteTabs, ActionDialog, MaskedValue, ConnectionCard, LogViewer, ExpandableText, ValueRow and FieldsSheet; DataTable switches between a table and cards; Sidebar sections fold; Tabs and DataTable can shrink in a grid.
- NewAttentionList: the items that need a person, with level, title link, area, age and one action. `compact` is the form for a popover; it also shows the level as a word, not only as a colour.
- NewRouteTabs: tabs that are links, with `count`. Phones show three tabs and More.
- NewActionDialog: asks before an action with an effect. It shows the record, "What happens", an optional reason and an optional typed name. It is full screen on phones.
- NewMaskedValue: a secret shown as dots, with Reveal, Copy and Hide. ConnectionCard: how to reach a service, in rows ready to copy.
- NewLogViewer: log lines with time, source and text. It follows new lines only when the reader is at the end. Search with next and previous, `jumpTo`, and copy a line from the context menu.
- NewExpandableText: a long text cut at `lines` lines. A click, tap, Enter or Space opens it with its `details`. A text that fits stays plain text.
- NewValueRow: a setting shown as text, with copy and an action. FieldsSheet: an edit sheet for one to three text fields.
- NewNew built-in strings, in English and Arabic.
- BetterDataTable: `viewKey` adds a Table and Cards switch at the end of the `toolbar` row, kept for each list; `defaultView` sets the first view. The cards view puts as many cards in a row as fit, each at least 18rem wide; group headers and totals take the full row. Phones show one card in a row, as before (new variant `p-cards` in `styles.css`). In the cards view on a desktop, the header controls (select all, sort) leave the Tab order; screen readers keep them.
- BetterSegmentedControl: the arrow keys select the option they move to, as in a radio group (left and right mirror in Arabic). Keys with Alt, Ctrl, Meta or Shift do not select.
- BetterSidebar: sections can fold (`collapsible`, `defaultOpen`, `badge`, `id`). Items can show a `status` dot with `statusLabel`.
- BetterCommandPalette: `onSearchChange` and `loading` for server results; `anchor` opens it next to an element; `description` can be a node, which is not searched. When it closes, the focus goes back to the element that opened it only if the focus is lost; a command that moves the focus keeps it there.
- BetterPageHeader: `back` also takes a list of links ("Client / Project").
- BetterRecordSummary: an item can have `status` (dot and word), and `value` is optional (new type `StatusDotStatus`). SettingsSection: `action` at the end of the heading. Button: `blocked` refuses the press and shows the reason.
- BetterLineChart and AreaChart: `limit` draws a dashed line with its label, and values at 90 % of it or more show in the warning colour. `onSelectPoint(x, index)` runs on a click or Enter.
- BetterParts without the new props render as before.
- Action needed`registry.json`: short names (`shadcn add @percentsa/<name>`) are only for the public exports of each package entry. The short names of 14 internal parts go away: `above_stretched_link`, `axes`, `backdrop`, `close`, `consent_cookie`, `flag_sa`, `key-grid`, `marker`, `panel`, `print_paper`, `sidebar-in-sheet`, `stretched_link`, `swatch`, `theme_key`. Add their files by the file name.
- FixedDataTable: the root can shrink in a grid (`min-w-0`).
- FixedTabs: the tabs and their panels can shrink in a grid (`min-w-0`).
- FixedLineChart, AreaChart and BarChart: an axis label that mixes Arabic with numbers or Latin text keeps its word order.
- FixedDialog and Sheet: when one opens without `trigger` (from a menu item, or from a button with `open` state), the focus goes back to the element that opened it after it closes, as in AlertDialog. Before, the focus went to the page.
- FixedDataTable: below 768 px a table with `cards` takes the controls of its hidden header row (select all, sort) out of the Tab order, as the cards view does at every width. Screen readers keep them.
0.21.0
New CodeEditor, CodeDiff and UnitInput; CommandPalette rows can have a description, a badge and a disabled reason.
- NewCodeEditor and CodeDiff: an editor for code and settings files, with line numbers, search and errors on their lines, and two versions of a text side by side. They have their own entry, `@percentsa/ui/code-editor`, because CodeMirror is large: the root entry does not load it.
- NewStrings for the search and the diff of CodeEditor and CodeDiff, in English and Arabic.
- NewUnitInput: a number with its unit (a time, a size) in one box. `onValueChange` gets the number and the unit.
- BetterCommandPalette: a command can have `description` (one line under the label, searched too), `badge` (short text at the end of the row) and `disabled` (the reason it cannot run now; the row stays in the list and cannot be chosen). Commands without these fields work as before.
0.20.0
New Autocomplete: a text input with suggestions.
- NewAutocomplete: a text input with suggestions. The typed text is always the value; a suggestion only fills it in. Rows can show a detail, a server search can show loading and unavailable rows, and `token` suggests for one part of the text, such as one item of a comma list.
- NewStrings noSuggestions, suggestionsUnavailable and suggestionCount, in English and Arabic.
0.19.1
The hidden data table of a chart no longer makes the page longer.
- FixedCharts: the screen reader table sat in the page with the sr-only class on the table itself. A table ignores height 1px and overflow hidden, so a chart with many points (for example 24 hours of metrics) kept its full table height, invisible, and the page scrolled far below its content. The class is now on a wrapper around the table. Screen readers read the same table; nothing changes on screen.
0.19.0
Sidebar items can be plain rows without a link.
- NewSidebar: href is now optional. An item without href is a plain row for a status such as 'Loading clients…'. It is not a link and not focusable, never the current page (current is ignored), has no hover style, and ignores children. It has the same size and layout as a link row, in a quieter colour, so the list does not move when links replace it. The icon rail shows its icon, with the label for screen readers only. A child without href is a plain row too. The app gives the label role='status' so screen readers announce a change of the text. Before, a loading row had to be a link: a tab stop that the router could mark as the current page. Link rows are unchanged.
0.18.0
Sidebar items can fold open to a list of links.
- NewSidebar: an item can have children, links that fold under it. The item stays a link to its own address; a chevron button beside it folds and unfolds the children. One level only. A group starts open when it or a child is the current page, and opens when the current page moves into it; defaultOpen opens it at first. The icon rail shows no children. The button's name includes the group label ('Show Al Noor links'). The strings showSubItems and hideSubItems are functions of the label, so an app that overrides them must pass functions. defaultOpen={false} keeps a group folded even when the current page is inside it. A folded group (or the rail) whose child is current shows the selected look on the parent, without aria-current. Item hrefs must be unique within a sidebar. A sidebar without children looks the same as before.
0.17.1
SideNav hides its scrollbar when it scrolls on its own; scrollbar-none also hides the WebKit scrollbar.
- Newscrollbar-none now also hides the WebKit scrollbar. Tailwind's own scrollbar-none sets only scrollbar-width: none; @percentsa/ui/styles.css adds the ::-webkit-scrollbar rule to it, for every app that imports the file. Wheel, touch, trackpad and keyboard scrolling still work.
- BetterSideNav: with sticky, the column that scrolls on its own now hides its scrollbar. No new prop. An app that wants the visible scrollbar can put scrollbar-auto in className (cn removes scrollbar-none).
0.17.0
The Sidebar collapse button shows its words, and SideNav can be an icon column.
- NewSidebar: the collapse button shows its words beside the icon while the sidebar is expanded. In the rail it is the icon alone, with the words as tooltip and accessible name. The words are the provider strings collapseSidebar and expandSidebar. New prop toggleLabel (default true); false keeps the icon only.
- NewSideNav: new prop iconOnly for variant column. Each item is its icon in a touch-sized box, with the label as tooltip and accessible name; group headings are for screen readers only; a badge is a small dot; an item without an icon shows the first letter of its label. No effect on variant list. The docs show an icon column from 768 px and the full column from 1280 px.
0.16.4
A segmented choice whose label wraps keeps space around the text.
- FixedSegmentedControl and ToggleGroup: a choice whose label wraps to two lines keeps space above and below the text and shows as a rounded box. Before, the text touched the edges. A choice of one line looks the same as before.
0.16.3
A toggle group that wraps stays a rounded box.
- FixedToggleGroup: the choices wrap to more rows when they do not fit, and the group stays a rounded box. Before, a group that wrapped showed as an ellipse. A group of one row looks the same as before.
0.16.2
A form sheet's footer reaches the bottom edge of the sheet, and the step buttons of a time field follow the page direction.
- FixedFormSheet: the footer now reaches the bottom edge of the sheet. Before, it stopped 24 px above the edge, and a long form showed its fields in that gap.
- FixedTimeInput: the step buttons of each box follow the page direction, as in every NumberInput (in Arabic, minus on the right). The boxes stay in clock order, hour first.
0.16.1
An image field can show a whole logo, and a white logo on a dark surface.
- NewImageField: `fit` ("contain" shows the whole image, for a logo; the default "cover" is unchanged) and `previewTheme` ("dark" shows the preview on a dark surface in both page themes, for a white logo).
0.16.0
A side navigation for settings areas and other areas with many sections.
- NewSideNav: in-page navigation in groups with headings. A compact column (sticky if you want, under the AppShell header) or, with variant list, a full-width list with a description under each label and a chevron: the settings home on a phone.
0.15.1
Fields in one row stay aligned when one of them is taller.
- FixedField and PhoneInput: next to a taller field in a grid row, the label and the control stay at the top of the cell. Before, the field stretched and its label and control moved apart.
0.15.0
Settings rows show errors and a saved state, a form settings row for react-hook-form, and move buttons for ordered lists.
- NewSettingsSection: status, a short state at the start of the footer (Unsaved changes, Changes saved.), read politely. It shows with footer and wraps above the buttons below 640 px.
- NewSettingsRow: error, required and optional. The error shows under the control; with controlId the control gets aria-invalid and the error in aria-describedby, as in Field.
- NewFormSettingsRow: a react-hook-form field in a SettingsRow, as FormField is for Field (group for a Switch or Checkbox). Import it from @percentsa/ui/react-hook-form.
- NewListItem: move, with move up and move down buttons for an ordered list. The focus stays on the moved row's button and the new place is announced in the page language.
0.14.4
A comma in an amount is the decimal mark, the keypad replaces a prefilled amount, and the line editor puts the focus in the right place.
- FixedMoneyInput and NumberInput: a comma in a number without a "." is now the decimal mark (10,5 is 10.5, before it read as 105). Next to a "." a comma still groups thousands and is dropped (1,250.50 is 1250.50).
- FixedKeypad: a prefilled value is replaced by the first key, as on a calculator; backspace clears it. Before, a digit was added to the end of the prefilled value.
- FixedLineItemsEditor: a focus move (Enter, a new line, a removed line) goes to the text input of the cell, not to the "−" button of a NumberInput, and selects the text, so a typed value replaces the old one.
- BetterLineItemsEditor: with disabled, the add button shows disabled instead of hidden; the table is no longer an extra tab stop.
- NewTable: scrolls={false} for a table that never scrolls sideways; its region is then no tab stop.
- BetterCard and ListItem with onSelect: the press button is described by the description and the body or the trailing part, so a screen reader hears the price, the state or the phone with the name.
0.14.3
A chosen link button shows, and phone cards stay inside their box.
0.14.2
The phone field looks the same in Arabic and English.
- FixedPhoneInput: in Arabic the country code now sits on the left of the number, as in English, because a phone number reads left to right. Labels and messages keep the page direction.
0.14.1
Description lists in columns fit narrower cards.
- BetterDescriptionList with cols: a column of stacked pairs is now at least 8rem (was 9rem), so a card in a three-column record grid shows its short money rows in 2 columns. Lists with the term beside its details are unchanged.
0.14.0
Two layout options for record pages: a grid where cards move up into the free space, and description lists in two or three columns. Nothing changes for existing projects.
- NewGrid has a masonry option. On a record page with a long details card next to a short refunds card, each card moves up into the free space of its column, so there are no big gaps between rows. The reading and tab order stay the page order. The server sends a normal grid and the browser arranges the cards after the page loads. Use the grid gap for the space, not margins. Cards keep the height of their content, and a printed page shows a normal grid.
- NewDescriptionList can flow in two or three columns (cols), with the term above its details: good for short money rows such as a cash summary. A column is at least 9rem of the list itself, so the same list in a narrow card or on a phone shows fewer columns, down to one. The lines run across each row, and it works with compact density. The layout option still sets each pair: term above its details, beside them (in wider columns), or beside them when there is room.
- NewRecordSection passes cols to its list, and can show its facts stacked (layout stack).
0.13.0
Parts for tills, work boards and counter tablets: an action bar, a digit keypad, a Kanban that works as a status board with server counts and pages, and a touch density. One visible change for existing projects: a Kanban column with no cards now says "No items".
- NewActionBar is the bottom bar of a till, a kiosk or a picking tool: equal tiles with an icon, a label and a key hint such as F2 (hidden on a touch screen). When any tile has a key hint, all tiles are taller so the key never touches the edge. A danger item can sit after a separator. When the bar is narrow the last tiles go into a More menu. The app binds the keys; the bar only shows them.
- NewKeypad puts digit keys on a touch screen for an amount or a PIN, so the system keyboard does not cover a dialog. An amount keypad has a point, 00 and backspace and refuses a third decimal; a PIN keypad has the digits and backspace. The keys read left to right in Arabic, like a phone, and a hardware keyboard works only while the focus is on the page or inside the keypad.
- BetterPinPad now shares its key grid with the keypad. It looks and works as before.
- BetterKanban can be a work board. Leave out onMove and there is no drag and no Move menu; the card actions are yours. Each column can show a count from the server, a loading state, an error with Try again (the loaded cards stay), its own empty text, and pages: a Load more button that also loads the next page by itself when you reach the end. The board can fill the height of its parent with each column scrolling alone, share the width, show one column with a switch on a phone, and use compact cards.
- BetterA Kanban column with no cards now shows "No items" (before, nothing).
- NewTouch density: put data-density="touch" on a counter tablet screen or on AppShell (density="touch"). On a touch screen the controls grow to 44 to 48 px; with a mouse they keep the compact sizes. The small Button, Toggle, segmented control items, number steps and menu rows follow the new --p-control-h-xs token, which is 32 px everywhere else, so nothing changes without it.
- NewAppShell can fill the screen (fill): the page box takes the height that is left and scrolls inside its own regions, so a till, a board or a calendar needs no calc() for the header.
- NewListItem and Card can be one button (onSelect, disabled) for a pickable row or tile, and a card can carry an image above its header (media) with a full-width Thumbnail (size="fill").
- NewText has a danger tone for a shortfall or a refused state.
0.12.0
Parts for form pages and small phone tools: a line editor, a form action bar, a PIN pad, an app frame without a sidebar, and a wider sheet. One visible change for existing projects: a form sheet from the bottom now shows its two buttons in two equal columns, large.
- NewLineItemsEditor is for the lines of a quote, order, invoice or stocktake in a form. Your inputs sit in the cells, with add, remove, a menu and details for each line, and totals below. Enter moves to the next cell and the next line, and from the last cell it adds a line; it never sends the form. After an add or a remove the focus goes to the right place and a screen reader hears what changed. On a narrow width the rows become cards.
- NewFormBar is the bar at the end of a form page: a short live summary (a total, a count) at the start and the buttons at the end. It stays at the bottom of the scroll area. On a phone the summary has its own line and the buttons share the row.
- NewPinPad is for a short code on large keys, such as a device lock or a cashier switch. The dots hide the digits, a screen reader hears only how many were typed, and a hardware keyboard works. The keys stop while the code is checked.
- NewAppShell works without a sidebar: no menu button, and the header row shows at every width. Use it for a driver app, a partner portal or a kiosk.
- NewSheet can be wide (size="lg", 56rem) for a document made from another document.
- NewFormSheet can say why the submit is refused (blocked): the reason shows above the buttons, announced, and the button stays visible but off. It also takes size, danger (a red submit button) and cancelLabel.
- BetterA FormSheet from the bottom now shows its two buttons in two equal columns, large. Before, they were small and at the end.
0.11.0
Parts for reports and dashboards. Two visible changes for existing projects: a Stat tile now sizes its value by its own width, and a row header in a table now looks like a normal cell.
- NewPeriodPicker can show preset buttons in its custom range (today, yesterday, last 7 days…), start the week on Saturday, and go back to a period you choose when the custom range is cleared.
- NewDataTable has density="print" for a printed report: small cells, headers that wrap, no scroll box and no cards, so a wide table fits the page. Total and group rows follow.
- NewTable column headers can wrap onto more lines (wrap).
- BetterA Stat tile now sizes its value and padding by its own width, not the screen. A wide tile looks as before; narrower tiles use smaller text, so an amount with decimals fits four tiles in a row or two on a phone. The tile takes its width from its parent (a grid cell, flex-1 or a width); in a parent that sizes to its content it is 9rem wide. Padding set with className on the tile no longer changes the inner padding.
- BetterA row header in a Table (TableHead with scope="row") now looks like a normal cell: normal weight, regular text size and colour, and it wraps. Before, it looked like a column header.
- NewThe RecordSummary page has a report example: the totals of a period.
0.10.0
Parts for lists in an admin app. Nothing changes for existing projects, except that the first cell of a row that opens a record is now medium weight on wide screens too.
- NewDataTable columns can show a muted second line under the value (a phone under a name), and, on phones, place a cell on the card: at the end of the title line, in one line under the title, or full width for long text. A new compact density makes dense lists tighter.
- NewFilterBar has collapseOnPhone: on a phone the filter menus fold into one “Filters” button with the number of chosen values. It opens a sheet from the bottom with one group per filter and a “Clear filters” button. On wide screens the bar is the same.
- NewEmptyState has variant="plain": no dashed frame, for an empty state inside a table, a card or a sheet. DataTable now uses it for its own empty state.
- BetterThe first cell of a DataTable row that opens a record (rowHref) is now medium weight at all widths. Before, only the phone cards had it.
0.9.0
Parts for the pages of a record in an admin app. Nothing changes for existing projects.
- NewRecordSummary shows the 1 to 6 key facts of a record in one dense strip under its header: a label, a value and a hint per cell, and an optional picture at the start. It fits the width it is given: one row when wide, three per row in the middle, two per row on a phone. An empty value shows “Not set”, long text is cut at two lines, and a value can be a link.
- NewThumbnail is a small square picture in three sizes, with an icon when there is no picture or it does not load, an optional caption, and an optional link around the whole picture.
- NewLineItemsTable lines can show a small picture, muted description lines, the parts of a kit and more content (such as chips) under the name. The table can show the document totals under it and a text when there are no lines. On phones the same details show in each card.
- NewDescriptionList and RecordSection have layout="auto": the term and its details sit side by side only when the list itself is wide enough, so one in a narrow column stays stacked. The existing layouts do not change.
- NewCard, DescriptionList and RecordSection have density="compact" for dense records: less padding and a smaller title.
0.8.2
A layout fix for phones. Nothing else changes.
- FixedOn phones, Pagination and a DataTable with pages show the current page without its neighbours, so a long list no longer pushes the page past the edge of the screen.
0.8.1
A layout fix for phones. Nothing else changes.
- FixedInput with start or end content, and the parts built on it, no longer push an Arabic page past the edge of a phone.
0.8.0
Parts for documents, records, forms and reports. Nothing changes for existing projects.
- NewThe parts in the Sidebar header and footer can ask useSidebarRail() whether the sidebar is an icon rail. In the phone sheet it is always expanded, so a user menu there shows the name and role.
- NewDetailLayout puts a record page in two columns: the main part and a side column with details and totals. A wide table scrolls inside its column, so the page never gets wider. On phones the columns stack, main part first. TotalsList shows a document's totals with the amounts under each other.
- NewLineItemsTable shows the lines of an order or invoice: product and SKU, quantity, unit price, discount, VAT and total. The headers say whether prices include VAT, a chip shows a returned quantity, and on phones each line is a card.
- NewDataTable can show a total row at the foot, and can put the rows of a report in groups, each with a header and a subtotal. A sort works inside each group, and a printed total row stays in one piece after the last row.
- NewFormField connects a react-hook-form field to Field: the label, the hint and the field's error message, with the ids screen readers need. It comes from its own import, @percentsa/ui/react-hook-form. Projects that do not use react-hook-form do not need to install it.
- NewFormSheet is an edit form in a sheet. Save and Cancel stay at the bottom, Save shows a spinner while the form saves, and closing the sheet with unsaved changes asks first. RecordSection shows a record's facts with an Edit button, and "Not set" where a value is empty.
- FixedAn AlertDialog opened without a trigger (from a menu or a sheet) gives focus back to where it was when it closes.
- NewImageField uploads an image, for example a logo or a product photo. It shows a preview with Replace and Remove, refuses a wrong file type or a file that is too large before the upload, and keeps the old image if the upload fails.
- NewFileDrop can be disabled.
- NewCombobox can search on the server: it passes each typed query to the app and shows the results with a "Searching" row while they load. A long list shows its first matches and how many more there are. An "Add" option at the end lets people add a value that is not in the list.
- NewPeriodPicker chooses the period of a report: a month, a quarter, a year or a custom date range. Switching from a month to a quarter or a year keeps the same end, so September becomes the third quarter and then the whole year. With the Hijri calendar the periods are Hijri months, quarters and years (for example "1448 AH"), and the value is still the first and last Gregorian day.
- NewTimeInput chooses a time of day on the 12-hour clock: hour, minute and AM/PM (ص/م in Arabic). Going from 11 to 12 crosses noon or midnight, as on a clock. DateTimePicker puts a date and a time together, and sends a value only when both are set.
- NewNumberInput can format the number it shows, for example a minute as "05".
- NewSaudiPlate draws a Saudi car plate with its Arabic and Latin rows, and the emblem, «السعودية» and KSA in the middle. PlateInput takes a plate as one text, in any order and in Arabic or English, and shows the plate under the field as you type, or what to fix. parsePlate reads the text on the server too.
- BetterCalendar, DatePicker and DateRangePicker have a month list and a year list, so a date years away takes two choices, not many clicks. Months outside the allowed dates cannot be chosen.
- BetterDateRangePicker can open on the Hijri calendar.
- NewAn app can give its own words for every built-in text. The phone country names now come from the strings, and an invoice takes the app's labels for its second language. The Language page shows how.
- FixedIbanInput shows the app's placeholder when the app gives one.
0.7.0
Parts for app screens and lists. Nothing changes for existing projects.
- NewTimeText shows a date or time the short way, in Riyadh time: "3:45 PM" today, "Yesterday 3:45 PM", "12 September, 3:45 PM" this year. Hover, focus or tap shows the exact value. formatDateTime, formatRelative and formatTimeOfDay give the same text for tables, exports and printouts.
- NewMoney and formatMoney can keep up to 6 decimals for unit prices, and can put negative amounts in brackets: (1,234.50).
- FixedformatMoney never shows -0.00, and shows "—" for an amount that is not a number, so a broken value does not look like zero.
- NewPhoneText shows a phone number as a call link ("+966 55 000 0999"), with an optional WhatsApp link. formatPhone and phoneLinks give the text and the links.
- NewStatusBadge shows a status (Paid, Overdue) with a coloured dot in five tones. The colour is on the dot only, so the text stays readable.
- NewEmptyState can show a load error with a "Try again" button. NotFound and Forbidden are ready pages for a missing record and for a page the user may not open.
- NewPageHeader is the top of a list or record page: the title with status badges, a back link to the list, one primary action, and the other actions in a "⋯" menu. On phones the primary action is full width and "More actions" opens the rest.
- NewMenu items can show a second line under the label, for example why an item is disabled.
- NewDateRangePicker chooses a date range for a list filter, with the presets today, yesterday, last 7 days, last 30 days, this week, this month and last month. Calendar can choose a range too. The small size fits a list toolbar.
- NewDataTable rows can open their record: the whole row is one link, and the checkbox and the "⋯" row menu still work. On phones, the rows can show as cards.
- NewColumnsMenu lets people show and hide table columns. DataTable can offer a rows-per-page choice and keep its header row in view while the rows scroll. FilterBar takes the list's other controls (date range, columns, refresh) at its end, so one bar is the whole list toolbar.
- NewPrintArea and usePrint print one part of a page, such as a list, on A4 paper, black on white in any theme. The title repeats on every page, page numbers are at the bottom, and nothing else on the page prints.
- NewLinks react at once: give PercentProvider the router's location, and a clicked link in the sidebar, a menu, the breadcrumbs, a card or a table row shows a thin bar until the new page is there.
0.6.0
The Percent logo on a grid: one square is 100 units, so every size is a round number. The logo keeps its shapes and motion; its sizes change.
- BetterThe icon is 3 by 3 squares, the English name is as high as the icon, and the Arabic name is as wide as the English, with a long س.
- Action neededMARK_PATH and SLASH_RUN change: the icon is 292 units square, and the slash wipes are a little steeper (0.6667). Check pages that draw the mark themselves.
- Action neededThe loader is wider for its height (view box -620 -50 1240 400), and the stacked logo needs at least 48 px.
- NewThe sizes of the previous logo stay in the code (LOGO_SIZES_0_5), so it can come back if needed.
- BetterThe Brand page draws the logo on its grid. The SVG downloads are new.
0.5.1
The packages now work in React Server Components, for example the Next.js App Router. Nothing changes for existing projects.
- NewWorks with React Server Components: interactive components are marked as client components, and functions such as formatMoney and buttonClass can run on the server.
- BetterTypeScript finds the types with every module setting, including nodenext.
- NewA Server components page in the docs shows what works on the server, how to set up the provider in a Next.js app, and how to handle events.
- BetterPublished straight from GitHub with npm provenance, so you can check where each version came from.
0.5.0
First public release: open source (MIT) and on npm, with no token needed to install. The new Percent logo: the % icon with the Arabic and English names, in seven versions, and a loader that moves between them. Includes the 0.4.1 changes.
- NewOne logo component draws all seven versions: the icon, each name alone, the icon with one name, both names in a row, and both names stacked.
- NewA loader turns the icon into the Arabic name, back, into the English name and back. It moves only while you can see it, and stays still if you ask your device for less motion.
- NewA Brand page in the docs: clear space, smallest sizes, colours, what not to do, the loader and SVG downloads of every version.
- Action neededThe old wordmark (the % with "Percent" in a font) is gone. Use the logo component; headers and sign-in pages now show the icon with the name in the page language.
- Action neededFonts are yours now: the packages ship no font files. Load your fonts, set --p-font-sans, --p-font-sans-ar and --p-font-mono, and remove the fonts.css import. Without them, text uses the device's fonts.
- Action neededInstall from npm: remove the @percentsa registry line from your .npmrc.
- NewThe code is open source under the MIT license. The Percent name and logos are not part of the license: set your own logo with the brand setting.
- NewEach package has its own page on npm, with a README.
0.4.1
The site header and footer fit more page layouts. Nothing changes for existing projects. Not published alone: these changes came out in 0.5.0.
- NewThe site header can stay at the top, stick while you scroll, or scroll away with the page.
- NewThe header and footer can follow a page with a maximum width (for example 1440 px). Backgrounds and borders still go from edge to edge.
- BetterA header without links shows its buttons on phones too, and has no empty menu.
0.4.0
Brands: any project can use its own colors, fonts, corner radius and logo. Percent projects look the same as before.
- NewOne brand file sets a project's colors, fonts, corner radius and logo. You do not need your own copy of the design system.
- NewDark, light and system modes (system follows the device), with a ready switch that remembers the choice.
- NewA check lists the brand color pairs that are hard to read (WCAG AA).
- NewThe site footer takes link columns, social links, contact details, a notice and your own content.
- BetterSelected items (choices, tabs, sliders, steps, progress) use the brand's main color.
- BetterCharts use the brand's colors and keep their patterns, so you can tell series apart without color too.
- NewA confirm dialog can wait until a save is done. Notifications can have an Undo button. Menu items can be links.
0.3.1
Bug fixes from a review of every component.
- FixedTyping a letter in the one-time code boxes no longer jumps to the next box.
- FixedIn Arabic, the Riyal sign is on the left of the amount again.
- FixedA full ID, CR, VAT, IBAN or money field refuses an extra key. Before, it dropped the last character.
- FixedCharts show a gap for a missing value, not a zero.
- FixedAn invoice whose QR code cannot be made no longer breaks the page.
- BetterTables, lists and animations do less work, so pages stay fast.
0.3.0
Motion: new animations for text, numbers and navigation. All of them respect the reduced-motion setting.
- NewHeadings can rise in word by word. Arabic words are never split.
- NewNumbers can roll to a new value (prices, totals).
- NewTabs and the sidebar slide one indicator to the active item. Items in boards and lists glide to their new place.
- NewPage changes can fade, or wipe in at the slash angle.
- NewOn phones, you can drag a sheet to close it.
- NewA check tells a Saudi national ID from an iqama number.
0.2.1
Fixes and a public docs site. Not published alone: these changes came out in 0.3.0.
- BetterThe docs site is public. Anyone can copy single components with the shadcn command.
- BetterA phone field sends the country with the form, also without JavaScript.
- FixedTyping in the middle of a formatted number (IBAN, money, ID) keeps the cursor in place.
- BetterThe browser's find (Ctrl+F) finds text in closed accordion panels and opens them.
- Action neededPut one Toaster in the root layout. A notification sent while no Toaster is on the page is dropped.
0.2.0
Data, boards, charts, app layouts and invoices.
- NewCards, tables (sort, select, pages), lists, stats, timeline, accordion, tree, avatars and code blocks.
- NewA drag-and-drop board that also works with the keyboard, and a month calendar (Gregorian and Hijri).
- NewLine, area, bar and donut charts. They mirror in Arabic and have a hidden table for screen readers.
- NewApp layouts: shell, sidebar, command palette (Ctrl+K), filter bar, settings rows and a sign-in page.
- NewA bilingual tax invoice with the ZATCA QR code, and a support ticket view.
0.1.1
Easier to read and to use with the keyboard.
- FixedGrey text in menus, dialogs and notifications is easier to read (WCAG AA).
- FixedIn the date picker, keyboard focus starts on a day you can choose.
- FixedA combobox in a dialog: Escape closes only the list, and the list is not cut off.
- BetterA loading button keeps focus and tells screen readers that it is loading.
- NewMoving text (marquee) has a pause button.
0.1.0
First release.
- NewColors, type, spacing and fonts, in dark and light.
- NewText, layout, buttons, forms, dialogs, menus, notifications and navigation, in English and Arabic.
- NewSaudi kit: phone, national ID, CR, VAT, IBAN, national address, money with the Riyal sign, and Hijri dates.
- NewPercent motion: text scramble, reveal, slash wipe and marquee.