@idyeah/diya
Changelog
Every release of DIYA, newest first. Breaking changes only come with a new major version, and each one is listed here with what to change.
- Maintainer
- Vishal Mehta, at IDYeah Studio. I read every issue and every request.
- Cadence
- A minor release about every four weeks; regressions fixed within 72 hours.
- CI
- Every pull request and every commit to main is type-checked, built and tested.
- Bundle size
- What DIYA adds to your bundle.
- npm provenance
- Each release on npm links back to the commit and the workflow that built it.
All notable changes to @idyeah/diya are documented here. The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.3.0
What an existing app will notice
- A Dialog can't be dismissed while its confirm action runs. This is on by default. While
loadingis true, or a Promise fromonConfirmhasn't settled, Escape, the close button, Cancel and a click outside do nothing. The close button and Cancel stay focusable, and look and announce as unavailable (aria-disabled="true"). Before, they closed the dialog while the action went on, and its result or error was lost. To let people cancel work in progress, passdismissibleand abort the work inonDismiss.open={false}andref.current.close()still close it. A request that never settles keeps it open, so give requests a timeout, such asAbortSignal.timeout(15000), and throw on failure so the error shows. - A Button with
aria-disabled(trueor"true") now acts unavailable, as it already looked: clicks, Enter and Space do nothing, and it keeps focus, withhrefandasChildtoo. Before, Enter and Space still ran itsonClick, a link Button followed its link from the keyboard, and withasChildanaria-disabledon the Button was dropped. - Form's Cancel and Wizard's Back are unavailable, not disabled, while
loading(aria-disabled="true"), so focus stays on them. Back on the first step is stilldisabled. - Your
aria-describedbyon a Dialog or Drawer is now read, after the description. Before, DIYA replaced it with its own. - The close button sits in the title row only, in Dialog and Drawer, and the description runs the full width below it. A Dialog with a close button and no description sits 6px tighter under the title, as one with
showClose={false}does. A Drawer's close button sits 8px higher, centered on the title's line, so a title-only Drawer header is 16px shorter. - A long Dialog scrolls inside, between a pinned title row and pinned buttons. The
<dialog>element no longer scrolls, so setting itsscrollTopdoes nothing. A Dialog that fits measures as before. - Types: Dialog's
descriptionwidens fromstringtoReactNode, so code that reads it as a string needs a cast. A translation typed asDiyaMessagesneeds the new keydialog.working; one typed asDiyaMessagesInputdoesn't.
Added
- Dialog
dismissible. Leave it out and the dialog can be dismissed except while its confirm action runs.trueallows it even then (the result is ignored);falsekeeps it open until your code changesopen. - Dialog
loadingLabeland the messagedialog.working("Working…"). If the confirm action is still running at 400ms, as the spinner appears, screen readers hear it once, politely. An empty string says nothing. - Drawer
dismissible(defaulttrue).dismissible={!saving}keeps it open while your footer's work runs, with its close button unavailable. - Dialog's
descriptiontakes block content, such as two paragraphs, like Drawer's; all of it is read. Text renders ap, anything else adiv, with 12px between paragraphs. api.json: the three props withsince: "1.3.0", Dialog'sdescriptionslot anddialog.working. Additive;schemaVersionstays 1.
Changed
- While a Dialog or Drawer can't be dismissed, Escape's keydown is stopped at the window, which holds in Chromium, WebKit and Firefox (a
cancelhandler alone lets Chromium's second Escape through). A popup open inside, such as a Menu or Select, still closes first. YouronCancelruns first, and itspreventDefault()is honored. If the browser closes it anyway, it opens again with focus where it was. - The close button and Cancel dim on the confirm button's 400ms beat, as its spinner arrives, so a quick save doesn't flicker; under
motion="off", at once on the beat. A Drawer's close button and unavailable footer Buttons do the same while a footer Button isloading. A Button that was already unavailable stays dim. In forced colors the close button turnsGrayText. - Focused from the keyboard, an unavailable Button in DIYA's colors keeps a full-strength focus ring and dims its words to 40%. One with your own classes or inline colors dims as a whole, ring included.
- A long Dialog: hairlines show where content is out of sight (
dividedkeeps its line). It opens at its title every time. AnonConfirmerror shows right above the buttons. An alert your code adds in the body is scrolled into view without moving focus. A body that overflows with nothing focusable in it becomes a Tab stop, so the keyboard can scroll it. - Dialog and Drawer keep clear of a phone's notch and home indicator when your page uses
viewport-fit=cover. A Dialog 480px tall or less takes the 24px phone padding. Fitting above the on-screen keyboard isn't in this release. - The description's first line keeps clear of the close button's focus ring, and descriptions avoid a lone last word (
text-wrap: pretty). Dialog's close button is centered on the title's line, 2px higher.
Fixed
- A Drawer
descriptionholding paragraphs rendered apinside ap. - Dialog and Drawer dropped your
aria-describedby, and Button'saria-disableddidn't stop Enter, Space or a link (both above).
For your tests
- jest-dom's
toBeDisabled()checks onlydisabled, so it now fails on Form's Cancel and Wizard's Back whileloading. UsetoHaveAttribute('aria-disabled', 'true'). Playwright'stoBeDisabled()countsaria-disabled. - Dismissing a working Dialog now leaves it open: settle the work first, or pass
dismissible.fireEvent.clickon a Button witharia-disableddoesn't callonClick. - DOM (not covered by semver): Dialog's description and body sit in
.diya-dialog-scroll; the title and Drawer's header lose their wrappingdiv; Drawer's description has the classdiya-drawer-description.
Screens
- AI, API keys, Profile, Task list and Resource table lock while they save. The last three use Drawer
dismissible, so they need 1.3.0.
1.2.1
Security
- The starters
npm create diyamakes now use Next.js 16.4.6. The Dashboard starter pinned 16.4.2, which is affected by two moderate Next.js advisories (GHSA-mfr8-8qww-v76h and GHSA-vc7v-qv4w-wrv8); the minimal Next.js starter now asks for at least 16.4.6. If you made an app with an earlier starter, update itsnextto 16.4.6 or later. @idyeah/diyaitself is unchanged. It moves to 1.2.1 because the two packages release together.
1.2.0
Added
toast(): show a toast from any client code, with no state of your own. Call it in an event handler or your data code, such astoast({ tone: 'success', title: 'Draft saved' }). It returns the toast's id.- Options:
title(required),description,tone('info'by default),action,duration(8000ms by default;0keeps it until closed),urgentandid. - Every toast has a close button named for it.
- A toast with an
actionnever times out and is never pushed out to make room. - Call again with the same
idto update a toast in place, such as "Saving…" then "Saved". It restarts its time. toast.dismiss(id)closes one toast.toast.dismiss()closes every toasttoast()showed, shown and waiting. A<Toast>closes when you stop rendering it.- Ids that
toast()makes look likediya-toast-1. Ids that start withdiya-are DIYA's, so don't use that prefix for your own. - It shows in the first-mounted outermost
DiyaProvider, in that provider's theme. With no provider mounted yet, it waits and shows when one mounts. On the server it does nothing. - Types:
ToastOptions.
- Options:
- One stack of toasts per page. Toasts sit in one column in the corner, newest nearest the corner and 12px apart. At most 3 show, or 2 on screens under 600px wide. A new toast always shows: the oldest toast without an action leaves early to make room. If every shown toast has an action, the new one waits and appears when one goes.
- Toasts and the keyboard:
- F8 moves focus to the newest toast's first button. While a toast shows, F8 is handled at the document level, unless your app already handled it (
defaultPrevented). - Toasts sit after your app in the page's Tab order, oldest first.
- After F8, Tab goes from the newest toast to the oldest, then back to where you pressed F8. Shift+Tab goes the other way. Once focus is back, or leaves the toasts, Tab follows the page again.
- Escape on a toast, or running its action, closes it and returns focus: to where you pressed F8; else, for a
<Toast>, to where focus was when it appeared; else to the last place you were outside the toasts. Never to the page's body. - A close button moves focus to the toast beside it.
- Toasts never take focus on their own.
- F8 moves focus to the newest toast's first button. While a toast shows, F8 is handled at the document level, unless your app already handled it (
Field: a label, helper text and error around a control DIYA doesn't make, such as your own input, a native one DIYA doesn't wrap (type="time"), or a third-party control. Pass one element, or a function that receives the ids and states (FieldControlProps).frameddraws DIYA's field box around a control that has none, such as a payment provider's card iframe. It gives a child iframecolor-scheme: light, so hosted fields don't turn into white boxes in Dark.- For a hosted iframe, a label click moves focus into it, and its error is spoken when focus arrives, since ids can't reach inside a frame.
- A child's own
idwins over Field'sid. In development Field warns when the two differ. - Types:
FieldPropsandFieldControlProps.
Checkbox: a lone yes or no that's sent with a form, such as agreeing to terms. It has Switch's API:checkedwithonCheckedChange,defaultChecked,name,required,helperText,error,hideLabel,disabledandsize.indeterminateshows a dash and is announced as mixed. Itslabelcan hold inlineTextLinks. Enter submits the form, where Switch toggles.- Left without a
value, it renders novalueattribute: a plain form post sends"on", and react-hook-form'sregister()givestrueorfalse. Passvalueto send something else. - Switch acts now. Checkbox is a yes or no you send with a form. Choice picks from a list.
- Types:
CheckboxProps.
- Left without a
Spinner: a small ring in the text color for one busy part of a page.sizeissmall,medium(the default) orlarge: 16, 20 or 24px.labelsays what's loading, once, politely, when it appears.showLabelshows those words beside the ring.- It waits 400ms before it shows, so a quick load shows nothing. The wait is the same at every
--diya-duration-scale; the scale changes only how it fades in and turns. - Under Reduce Motion it breathes in place, like Progress.
- Types:
SpinnerProps.
- It waits 400ms before it shows, so a quick load shows nothing. The wait is the same at every
VisuallyHidden: words that screen readers read and the screen doesn't show. It's a utility, not a component: it isn't counted, and it needs no provider. To name a control that has no text, usearia-labelinstead. Types:VisuallyHiddenProps.useDiyaPortalContainer(): where a popup from another library should render. Inside an open Dialog or Drawer it returns that modal's element; anywhere else, the nearest provider's portal. Pass it as the library's portal container (container,portalContainer,menuPortalTargetorgetPopupContainer). It'snulloutside a provider and before the provider mounts.- Nine theming tokens. Each one defaults to today's look, so nothing changes until you set it:
--diya-color-focus: every focus ring. It needs 3:1 against the surfaces; in Light, at least 5.1:1 against white, so it holds over Glass.--diya-color-heading: component titles (Card, Dialog, Drawer, Page Header, Table, Form, Wizard, Content State, Data Viz and Prose headings).--diya-color-fieldand--diya-color-field-line: the fill and edge of every field. An invalid field keeps the error border. Under Glass, a field stays see-through at your color.--diya-height-control-small,-mediumand-large: 32, 40 and 48px. The heights of Buttons, every field, Tabs and calendar days. Set the three together. Combobox can't go below 26px (32px at large).--diya-radius-popup: Menu, Popover and the Combobox and Date Picker popups (16px × the corner scale).--diya-radius-modal: Dialog and the Drawer's open edge (22px × the corner scale).
- Message keys:
toast.dismiss("Dismiss: Draft saved"),toast.actionHint("Press F8 to reach Undo.") and a newfieldnamespace witherrorAnnouncement("Email: Enter a valid email"). - Development warnings. In development only, DIYA writes "DIYA: …" messages to the console when something won't work as you expect. Examples: a popup from another library opened outside an open Dialog or Drawer,
toast()called on the server or with no provider mounted, a Field wrapped around one of DIYA's own fields, and a Spinner withshowLabelbut nolabel. Production builds don't include them. api.json: thefield,checkboxandspinneritems, andvisually-hiddenwith the new kindutility. The nine tokens, each with adescription. Thefieldmessages. Token kinds andsinceas before. All of it is additive:schemaVersionstays 1.- 33 components now (Field, Checkbox and Spinner are new). Still 13 patterns.
Changed
Two entries change documented screen-reader and keyboard behavior, to fix a toast that was read twice and an Escape that closed the Dialog under a toast: "Screen readers" and "Escape on a focused toast" below.
- Toasts stack. Several toasts no longer cover each other. Every provider's
<Toast>s and everytoast()share the one column, in the outermost provider's corner.- Each toast keeps its own provider's look and motion: a
<Toast>in a nested Dark provider still looks Dark. - A
<Toast>always shows, and it counts toward the limit, so atoast()toast makes room for it or waits. - In 1.1, each provider drew its own toasts, and a nested provider's toasts covered the page's.
- Each toast keeps its own provider's look and motion: a
- A nested provider's
<Toast>s render in the page's one stack, not inside that provider's element. They sit in a stand-in element that carries the provider's class, style,data-themeanddata-motion, so your brand file and itsclassNamestill reach them. CSS that finds them through the provider'sid, its other attributes or its ancestors doesn't. A query for the provider's class finds two elements. - Screen readers. Inside the stack, a
<Toast>'s message no longer hasrole="status"orrole="alert". The stack reads each toast once, from its own live region, tone first: "Success: Draft saved." With an action, it adds "Press F8 to reach Undo."urgentstill interrupts.- Toasts raised together are read together, in the order they arrived.
- The stack's name and the words read for each toast come from the outermost provider's
messages. A nested provider'smessagesstill name its own toasts' close buttons.
- The toast region is a
regionlandmark named "Notifications (F8)" while it holds a toast. Thetoast.labeldefault changed from "Notification" to "Notifications (F8)". If you translated it, translate the new meaning: the whole list, and the key that reaches it. - Close buttons are named for their toast: "Dismiss: Draft saved". A
<Toast>without a title keeps "Dismiss alert". - Pausing. Pointing at or focusing any toast pauses every toast on the page. In 1.1 only that toast paused. A hidden tab still pauses them all.
- Escape on a focused toast closes only that toast. It goes no further: a Dialog or Drawer around it stays open, and it doesn't bubble up to your own key handlers either, so an app-wide Escape handler doesn't receive it.
- Toasts inside modals. While a Dialog or Drawer is open, the toasts show inside the topmost one, above the dim and clickable, and move back when it closes. The same goes for your own
<dialog>opened withshowModal(), if it holds focus when a toast arrives. Inside a modal, toasts take its theme. - When other toasts are showing, a new one arrives in about 350ms: they make room, then it arrives. A toast on its own arrives as before.
- Under Glass, the page behind a toast is now evenly frosted. In 1.1.1, text behind it showed faintly through on a phone.
- DIYA's own fields announce an error that appears after you leave them. TextInput, Search, TextArea, Select, Combobox, DatePicker, Switch, Choice and Checkbox say it once, politely: "Email: Enter a valid email." Errors that appear together, as on submit, aren't announced; the field that gets focus reads its own. If focus is already in the invalid field when you submit, as with Enter, its error is read once.
- An error that appears when you leave a field by pressing elsewhere shows once the press ends, so the button you pressed doesn't move under the pointer or your finger.
- Button
loadingshows a small spinner instead of "···". The cursor turns toprogressat once. After 400ms the spinner takes the place of the icon before the label, and the words stay. Without such an icon it takes the label's place: the words turn transparent but keep their width, so the button keeps its exact size and nothing moves. An icon-only button swaps its icon for the spinner. When loading ends, the label, or the icon, fades back. Edge cases are under "Buttonloading: edge cases" below.- Any single
<svg>rendered first counts as the icon: icons from lucide-react or any other library, your own icon and logo components, an<svg>in a Fragment. An<img>, an icon font, or an icon inside your own wrapper counts as label, as does every icon in browsers without CSS:has(). Space the icon with the Button'sgap(orcolumn-gapon the Button), not a margin on the icon: a margin shifts the spinner by half its width. - A loading Button looks busy, not disabled: full color and a
progresscursor. Clicks, Enter and Space still do nothing;aria-busyandaria-disabledare unchanged. - A Button that is both
disabledandloadinglooks disabled (dimmed, with thenot-allowedcursor), with its spinner showing.
- Any single
- The Drawer's open edge is rounded like Dialog: 22px × the corner scale, where it was 16px. A Drawer that fills a phone screen (440px or narrower) is square, so no dim shows in wedges at the screen's edge.
- Choice and Checkbox boxes. The small box sits 1px lower, so it centers on its line. The large box draws a 5×10 tick and a 10×2 bar, where they were 4×8 and 8×2. Small and medium marks don't change.
- Table's progress bars scale their corners with
--diya-corner-scale(no change at the default scale). - Combobox follows the control-height tokens like the other fields (
--diya-height-control-*). Its lowest height is 26px (32px at large). - Bundle size. Every app with a
DiyaProvidernow carries the toast stack: about 5 KB gzip.
Fixed
- In Safari, closing a Dialog or Drawer that was opened with the mouse returns focus to the control that opened it, not to the page (since 1.0.1). This covers a Dialog or Drawer mounted by its opener's click too.
- Closing a toast, or running its Undo, while you're typing elsewhere keeps your place: the next keystroke goes where you were typing.
- A Button with
hrefkeeps its link while it loads. It used to drop itshref, so focus fell off it; now focus stays, asloadingalways promised. The link getsaria-disabled="true", and clicks, middle clicks and Enter do nothing until loading ends. Your ownonKeyDownstill runs, with Enter stopped. A disabledhrefButton still drops itshref. If yourlinkComponentis a wrapper, pass every prop through to the anchor; that's how the clicks are blocked. - A disabled or loading Button with
asChildblocks middle clicks too, so it can't open in a new tab. - A loading Button with
asChildon an<input>or<img>no longer crashes. - In forced colors (such as Windows high contrast), a Destructive Button's words and icon show in the system's button text color, or its disabled color when disabled. Before, they were invisible.
Not breaking, but worth a line
- The focus rings, component titles, field fill and edge, control heights, and popup and modal corners now read the new tokens. With the tokens unset, not a pixel changes.
- A nested provider resets the nine new tokens, so a value set in an outer provider's
stylestays there, as the 1.0 tokens always have. A brand file still reaches every provider. .diya-sr-only, Table's and Chatbot's hidden-text rules are now one rule. Class names aren't covered by semver; nothing looks different.
Button loading: edge cases
- A loading Button with
hrefstays a link, with itshref, and keeps focus. Clicks (modified and middle clicks too) and Enter do nothing; "Open in new tab" from the context menu still works. See Fixed. - With
asChildon an<input>, an<img>or another element that can't hold children, there's no spinner: a loading submit input keeps its words, turns its cursor toprogressand ignores clicks. A component that ignores its children, such as one that renders alabelprop, keeps its words while loading, as in 1.1.1, but shows no spinner. WithasChild, your element must render its children for the spinner to show. - Dialog's confirm button, Form's Submit and Wizard's forward button show it too.
- Under Reduce Motion the spinner breathes in place.
- In forced colors (such as Windows high contrast), a busy Button hides its words too and, on the beat, draws the system's button colors and border (the system's disabled color if it's also disabled), with no background image or shadow, over any colors you set on the Button without
!important. Until the beat it looks as it did at rest. When loading ends, the words come back at once, without a fade. In forced colors a Button transitions only opacity, scale, translate, rotate and transform. - The button's text no longer includes "···".
- On the beat, the words' fill turns transparent, with any text shadow, stroke or underline you gave them, and elements in the label fade out. One thing stays drawn: put a gradient made with
background-clip: texton an element inside the label, not on the Button itself; on the Button it stays drawn under the spinner while it loads. - The fade back animates the Button's
color, so a border or ring you draw incurrentColoron the Button (Tailwind'sborder-currentorring-current) goes out with the words and fades back with them. - While it loads, a Button runs its own animation. One you set on the Button itself stops when loading starts and starts over when the label is back, so an entrance animation (such as
animate-in) plays again after each load, and a loop (such asanimate-pulse) jumps back to its start once. Put entrance animations on an element around the Button. Pulsing only while saving is fine: DIYA's spinner takes its place. - An animation on the Button can't change how a Button loads, and neither can a Reduce Motion reset that is unlayered or in a layer after
diya. One in@layer base(beforediyain the Tailwind layer order) wins: the spinner shows at once on every load and the words come back without a fade, though nothing overlaps or goes blank. Keep the reset unlayered, or in a layer afterdiya, to keep the 400ms wait. If you use such a reset, includeanimation-iteration-count: 1; without it, every looping animation flickers, DIYA's spinner included. - A part of the label with its own CSS animation stops while the Button is busy and starts over after each load. A Spinner you put in the label keeps its own wait and turn.
- Don't put a Spinner in a Button you give
loading: the Button shows its own, and after an icon you'd see two rings. - Style your own elements in a label, not the Button's inner spans: CSS that restyles those spans on hover garbles the Button's accessible name in Safari while it's hovered.
- If a Button's label holds an element, such as an icon or
<strong>, passloadingfrom the start:loading={false}until it's busy. Then nothing in the label starts over when loading begins, and a page the browser has translated keeps working. (loading={undefined}counts as not passed.) A label of plain text is safe either way. Two things on a translated page work as in 1.1.1: without aloadingprop, a label that swaps from plain text to elements crashes, and a plain label that changes its words ('Save'to'Saved') keeps its old translation.
For your tests
- Find a toast by its region, not its role. A
<Toast>inside the stack has norole="status"orrole="alert", sogetByRole('status')no longer finds it. UsegetByRole('region', { name: 'Notifications (F8)' }), or find the toast by its text. - The stack's name is now "Notifications (F8)". A query for "Notification" finds nothing. Use the new name, or a regular expression such as
/Notifications/. - Close buttons: a toast with a title is now "Dismiss: {title}". A
<Toast>without a title is still "Dismiss alert". - Clear toasts between tests:
afterEach(() => toast.dismiss()), next tomotion="off"in your test setup. It closes every toasttoast()showed; a<Toast>goes when its test unmounts it. - A regular expression can find a fresh toast or field error twice. A toast's words, and a field error that appears after you leave the field, are also read from a live region. They stay there for up to 5 seconds, or until the toast closes or the error clears. While they're there, a regular-expression text query (
getByText(/valid email/),findByText(/changes are live/), Playwright'sgetByTextwith a pattern) finds two matches. Exact-text queries are unaffected: Testing Library'sgetByText('Enter a valid email'), or Playwright'sgetByText('Enter a valid email', { exact: true }). Playwright'sgetByTextwith a plain string matches substrings, so it finds two as well. Pick one:- look inside the form or the stack:
within(form).getByText(/valid email/), orwithin(screen.getByRole('region', { name: 'Notifications (F8)' })).getByText(/Draft/); - query the field by its description:
expect(screen.getByLabelText('Email')).toHaveAccessibleDescription(/valid email/); - use exact text:
getByText('Enter a valid email'), or in PlaywrightgetByText('Enter a valid email', { exact: true }).
- look inside the form or the stack:
- Live-region copies under fake timers: the copy appears one frame after the toast or error and leaves after 5 seconds. Advance timers by a frame to hear it, or past 5 seconds before a regular-expression query.
- An effect that calls
toast()shows it twice in development under StrictMode, since StrictMode runs effects twice. Pass anid, and the second call updates the first. Better still, calltoast()from the handler that did the work. - Pausing in tests:
fireEvent.mouseEnterandmouseLeave, andfireEvent.focusandblur, on a toast pause and resume it, as in 1.1. They now hold every toast's timer, not only that toast's. - Errors after a press: an error that appears when you leave a field by clicking elsewhere shows once the press ends. With user-event, use
findBy…after the click. Under fake timers, advance timers after it. - Spinner waits 400ms. Use
findBy…(or advance fake timers) to see it or hear its label. - Checkbox with react-hook-form:
register('terms')givestrueorfalse, as a native checkbox does. With avalue, it gives that value, orfalse. - DOM snapshots of anything inside a provider change. Every outermost
DiyaProvideradds a toast host to its portal when it mounts: two empty live regions and apopoverelement..diya-toast-regionnow wraps the whole stack, and each toast is a.diya-toastin it. Class names and DOM aren't covered by semver; a placement override on.diya-toast-regionstill applies. - Button
loadingchanges markup, not names. The accessible name, the text and the layout are the same as in 1.1.1. A Button without aloadingprop renders as in 1.1.1 until it first loads. A plain-text label renders as in 1.1.1 at rest, in the client and in server HTML (React's<!-- -->separators included), and its text is never moved or replaced. What changes:- A plain-text label while loading keeps its words where they are. A hidden spinner is added after them, where 1.1.1 put "···" before them, so
lastChild,:last-childand snapshots change. The text is the words alone, so Playwright's exactgetByText('Save')now finds the Button, where 1.1.1 found nothing ("···Save").getByTextfinds the Button, as at rest. - A label holding an element is wrapped from the first render if the Button has a
loadingprop, evenloading={false}. That counts an icon,<strong>, or a component that renders text, such as a translation component. The label sits inspan.diya-button-label, the first element of a label with several parts inspan.diya-button-leading > span.diya-button-leading-content, and a hidden spinner is added. A space after the first element is a text node between the two spans. Without aloadingprop at first, the wrappers appear when it first loads, what's inside mounts once more, and they stay. - Find that Button by its role:
getByRole('button', { name: 'Save', busy: true }).getByText('Save')finds the wrapper span, not the button, soexpect(getByText('Save')).toHaveAttribute('aria-busy', 'true')fails. A click on the span reaches the button'sonClick, but in happy-dom it doesn't submit a form (browsers and jsdom do). In Playwright,getByTextfinds a span with no box of its own: clicks, hovers andtoBeVisible()work, but in Chromium itsboundingBox()isnulland a screenshot of it throws. - An icon-only Button given
loadinghas a hidden spinner before its icon from the first render, so:first-childselectors and snapshots change. While it loads, its icon stays in the page, hidden. - CSS on a Button's direct children, such as
.diya-button > svgor> *, misses the wrapped parts. Use.diya-button svg. The wrappers have no box, so gaps,justify-contentand auto margins work as before. - The Button's own spinner is
span.diya-spinner.diya-button-spinner,aria-hidden, and not displayed until it's needed. The.diya-button-progresselement is gone. A<Spinner>you put in a Button is yours: it sits where an icon would. Don't also give that Buttonloading. - While loading, a Button carries
data-busy-turn(anddata-busy-disabledif it's also disabled); while its label fades back,data-returning. Snapshots taken then change. These attributes and the classes above are DIYA's own, not covered by semver: don't style or select by them. - An
hrefButton keeps itshrefwhile it loads, witharia-disabled="true"and noroleattribute. A test that expected nohrefnow fails; expect thehref. It also keepstarget,relanddownload, stays a Tab stop, and can be dragged; the status bar shows its URL on hover. YouronKeyDownstill runs, with Enter stopped.
- A plain-text label while loading keeps its words where they are. A hidden spinner is added after them, where 1.1.1 put "···" before them, so
- Development warnings: test setups that fail on
console.warnmay see DIYA's new "DIYA: …" warnings. Each says what to do instead. - Translations typed as
DiyaMessagesneed the new keys (toast.dismiss,toast.actionHintandfield.errorAnnouncement). Type a partial translation asDiyaMessagesInput, which accepts any subset. These keys are the only change that can break a 1.1 app's types.
1.1.1
Fixed
DialogandDrawer: aMenu,PopoverorTooltipinside an openDraweropens on screen again. In 1.1.0 it opened off screen and couldn't be clicked, in every browser. The open panel kept a restingscaleandtranslate, which made it the frame that fixed-position popups are placed against. It now rests with none, and its open motion is unchanged.Dialog,FormandWizard: theloadingdocs no longer promise a spinner. The confirm, Submit and forward buttons show Button's ownloadingindicator, as they always have.
1.1.0
Added
- Motion, on by default. Menu, Popover, Tooltip and the Combobox and Date Picker popups grow from their trigger. Dialog fades in and settles, Drawer slides in from its side, and the dimmed page fades with them. Toast rises from its edge; a floating Chatbot opens and closes like a popup, and new chat messages rise in. The Tabs indicator slides to the selected tab. Accordion sections grow open and shrink closed. Site Header's phone menu opens like a popup. Switch's thumb slides and Choice marks grow in. Progress eases to each new value. Buttons ease their hover and press, and fields, rows, tabs, calendar days and navigation items ease their colors.
- Focus rings never animate.
- Input never waits for an animation.
- Nothing moves on page load, or when hidden content is shown again.
- Button press: a Button shrinks to 0.98 while pressed, and a wide one by at most about 2px a side; it lands at once and eases back. Under Reduce Motion a pressed Solid or Destructive Button moves toward its label color instead.
DiyaProvidermotion:"system", the default, animates and follows the device's Reduce Motion setting (Reduce Motion on Apple devices, Animation effects on Windows, Remove animations on Android);"reduced"never slides or scales, only fades; indeterminate Progress breathes in place, as it does under the device setting;"off"changes everything at once, with 1.0's timing; loading indicators still move.
A nested provider inherits it. There is no "full": DIYA never overrides a reader who asked for less motion.
- Every provider renders
data-motion: its ownmotion, else its parent's, else"system". Likedata-theme, it's covered by semver. - Public motion tokens, in a new
motiongroup:- durations
--diya-duration-fast(120ms),--diya-duration-medium(160ms) and--diya-duration-slow(240ms); exits take two-thirds of their enter; --diya-duration-scale(1):0.5is twice as fast,0turns motion off from CSS alone, Tooltip's hover wait included;- curves
--diya-ease-enter,--diya-ease-exitand--diya-ease-move.
- durations
Set them on the provider (its style, or .diya-root) or above it; on an element inside a provider the durations have no effect. An override never brings motion back under motion="off".
useDiyaAppearance().motion:"full","reduced"or"off", the motion in effect. Under"system"it reads"full"on the server and follows the device's Reduce Motion setting from mount, asthemedoes. TheDiyaAppearancetype gains this required field, so a mock typed asDiyaAppearanceneeds it.api.json:- token kinds
durationandeasing; - an optional
sinceon props and tokens added after their item or after 1.0.0 (DiyaProvidermotionand the seven motion tokens say1.1.0); - each item's
tokenslist names the motion tokens its styles use.
- token kinds
All of this is additive: schemaVersion stays 1.
Changed
- Closing popups stay on the page briefly while they leave. Menu, Popover, Tooltip and the Combobox and Date Picker popups stay up to about 110ms; Dialog and Drawer stay up to 160ms (Firefox closes Dialog and Drawer at once). While they leave they are inert: no focus, clicks or screen reader.
onOpenChangeand the return of focus still happen at once. A close caused by scrolling, resizing or the trigger leaving the screen skips the exit. Unmounting a Dialog or Drawer instead of settingopen={false}skips it too. - Tests:
- In unit tests, render inside
<DiyaProvider motion="off">: closing popups leave at once and a tooltip shows on hover without its 300ms wait. In jsdom and happy-dom, popups already close at once, andfireEvent.mouseEntershows a tooltip at once, as in 1.0. - In end-to-end tests, closing popups stay up to 160ms with
data-exiting="true", and Playwright'sgetByRolestill finds them. Use web-first assertions (await expect(menu).toBeHidden()), notisVisible()orcount(), or rendermotion="off"in your test build (for examplemotion={process.env.NEXT_PUBLIC_E2E ? 'off' : undefined}). Playwright'sreducedMotion: 'reduce'isn't enough, since things still fade.
- In unit tests, render inside
- Tooltip waits for a mouse to rest on its trigger for 300ms before it shows, so passing over a toolbar shows nothing. It shows at once on keyboard focus, on a tap, when moving from one tooltip to the next (the two swap at once, never overlapping), and with
motion="off"or a duration scale of0. A mouse click on the trigger no longer shows it by itself. The bubble can still be hovered, to read it. - Toast:
onDismisstiming is unchanged; it's called at once, as in 1.0. Its exit then plays on an inert, unannounced copy, so the host unmounts the toast inonDismissand can raise the next one straight away. - Dialog and Drawer: in Light and Dark the dimmed page behind them is no longer blurred, so it can fade without showing the page twice. Glass keeps its blur at full strength from the first frame, still and never animated, and only its own lighter dim fades.
--diya-color-scrimgoes from#00000088to#0000009ein Light and Dark, to keep the page set back without the blur. - Button: hover moves a Solid or Destructive fill 10% toward its label color, so it shows in Light and Dark, and the label stays at full strength. 1.0 dimmed the whole button with a filter, label included. The hover is a layer over the fill, drawn with the Button's
::after, so a Button whose background you set yourself (throughclassNameorstyle) still changes on hover. - Underline Tabs no longer nudge their neighbors when the selection changes: each tab reserves the width of its bold label, so unselected underline tabs are slightly wider than in 1.0.
- Table's loading rows pulse gently (opacity 1 to 0.55 and back, 1.4s). The pulse keeps running under Reduce Motion and with
motion="off", as loading indicators do. - When the provider's theme changes, transitions pause for that frame, so controls change with the page. A
theme="system"change that comes from the device can't be paused in Chromium and WebKit. - With Tailwind v4, its base styles hide
[hidden]with!important, so Accordion sections open and close at once unless you add the one@layer baserule in the README's Tailwind section. - DOM, which isn't covered by semver, so snapshot tests may change:
- Tabs adds an
aria-hiddenindicator inside its tab list (none withmotion="off") and wraps each label in adiya-tab-labelspan. In pill Tabs the indicator holds a drawn copy of every tab's icon, label and badge, with no text of its own, so text queries still find each label once; - Accordion wraps each section's content in a
diya-accordion-bodyelement, its chevron is one path that turns, and a closed section keepshiddenbut stays laid out at zero height, invisible and inert; - popups carry the class
diya-floatinganddata-side, and closing onesdata-exiting="true"; - the provider carries
data-theme-changefor the frames that paint a new theme.
- Tabs adds an
Package
- The tarball's unpacked budget is now 1,300,000 bytes. 1.1 unpacks to about 1,274,000 bytes (1.0.1: 1,199,458) and packs to about 495,000.
styles.cssgrows about 25 KB, 5.5 KB gzipped, and ships readable, with its comments; your bundler minifies it.
1.0.1
Fixed
Progress: under Reduce Motion, indeterminate progress no longer freezes as a 35% bar or a 28% ring, which read as a stuck amount. It shows a full bar or ring that fades gently between faint and clear, so it still reads as working. Without Reduce Motion nothing changes. The indeterminate bar's width now comes from CSS instead of an inline style, and the rule uses no!important, so your own styles can still restyle it.Drawer: the docs no longer say it slides in from the side, which it doesn't in 1.0. The description and thesideprop now say where it sits;api.jsonand the type declarations follow.
1.0.0
First public release, under the MIT License.
Added
- 30 React components and 13 patterns.
ChartandDataVizare exported from@idyeah/diya/chartsand render with the optionalechartspeer dependency; everything else is exported from@idyeah/diya. DiyaProviderwith Light, Dark and Glass appearances, brand color, font, locale and built-in text (messages,defaultMessages).@idyeah/diya/styles.css, with public--diya-*theme tokens and the DIYA Sans font (SIL Open Font License 1.1).@idyeah/diya/api.json, a machine-readable map of exports, props and tokens.- api.json names the uncontrolled default (
defaultValue, SwitchdefaultChecked) for every field that has one: Text Input, Text Area, Select, Combobox, Date Picker, Calendar, Choice, Switch, Slider and Search. - Support for React 18.3 and React 19, including Next.js App Router: the root entry has no
'use client'directive, sodefaultMessagesand types can be imported in Server Components, and each interactive component carries its own directive. Prosesets your own long-form HTML (articles, docs pages, changelogs and legal pages) in DIYA's type and rhythm, at three sizes, and leaves DIYA components inside it as they are.CodeBlockshows code with a Copy button that announces its result, and long lines scroll in a region the keyboard can reach.StackandInlinelayout primitives, withgapon a public spacing scale (--diya-space-1to--diya-space-8),align,justify,wrapandas.- Every component takes
className,styleand its root element's other attributes, and forwards its ref: fields to their native control, Menu, Popover and Tooltip to the trigger, everything else to the root. DiyaProvider:theme="system", now the default, follows the OS Light or Dark setting in CSS, with no flash and nothing to run on the server;- it paints its own background and text color;
surface={false}opts out; brandColoris one brand color, or{ light, dark }, that sets the accent tokens: the main Button, selected pill Tabs, an on Switch, Slider and Progress; a colored brand also leads chart series 1, and a neutral one leaves the charts to DIYA's Vivid palette. Text on it is white whenever that reaches 4.5:1, otherwise near-black;linkComponentrenders everyhrefthrough your router's link, such as Next.jsLink;useDiyaAppearance()reports the theme in effect, Glass, the font and the brand's accent colors.
- Links: Button takes
hrefandasChild, TextLink takesasChild, and Side Navigation, Breadcrumbs, Site Header and Menu items with anhrefare real links (aria-current="page"on the current one). - Button
variant="destructive", and DialogconfirmVariant="destructive". - A loading Button keeps focus: it is
aria-disabled="true"andaria-busyrather than natively disabled, and ignores clicks, Enter and Space, so a focused Save or Send stays focused while it works and still can't submit twice. Form's Submit, Dialog's confirm and Wizard's Continue follow.disabledis still the native attribute. - Menu and Popover take your own
triggerelement and a controlledopenwithonOpenChange; Popover content can be a plain node. Dialog takes atrigger. Tooltip wraps your own trigger, such as an icon-only Button. - Forms: fields forward refs to their native controls, work uncontrolled (
defaultValue,defaultChecked) and reset with their form, and pass nativename,onChangeandonBlurthrough, so react-hook-form'sregister()works without aController. Combobox and DatePicker takename. - A Choice option's
labeltakes a node, not only a string: a consent box with real Terms and Privacy Policy links (a link opens without toggling the box), or a color swatch beside a color's name. - Slider takes
formatValue, such as(value) => '$' + value: it formats the values and marks it shows and sets each handle'saria-valuetext, both handles in range mode. - Slider takes
min,maxandstep. DatePicker takesminandmax, keeps one Tab stop in its calendar (arrows, Home/End and PageUp/PageDown move), and starts weeks on the locale's first day. Calendar, the month grid DatePicker opens, kept on the page: for screens like booking a time or a day's agenda. It shares DatePicker's code, keyboard,valueandrangeshapes,minandmax, and adds a controlledmonth(YYYY-MM) withonMonthChange. Calendar and DatePicker takeisDateUnavailableto mark days that can't be chosen, such as days with no open slots. Both follow the ARIA date grid pattern: a grid named by its month, weekday column headers, gridcells witharia-selectedon chosen days andaria-current="date"on today. Each day's name includes its weekday ("Thursday, November 12, 2026"), and an unavailable day says so in words, through theunavailableDaymessage.headingLevelon every pattern that renders a heading; Form'stitleis optional.- Pagination fits at 320 to 390px.
- DIYA's appearance: Dark sits on a near-black ground (
#111113) with surfaces lifted only slightly; Light is white all the way down, with hairlines, spacing and type carrying the hierarchy. Status colors come from the Vivid family, each label at 4.5:1 or more on its tint. In-page surfaces lift with a soft shadow and a faint edge, and their titles are a quiet 15px. - Glass is see-through frosted glass on every surface. Cards, chart cards, tables (clear rows on the card's glass) and inline alerts are the clearest pane, so the backdrop's light and shade pass visibly behind them; side navigation, headers, controls, menus, popovers, dialogs, drawers and toasts are denser, so text on them always reads. The material is neutral: its blur lifts saturation by 1.15 at most, so a backdrop arrives as soft light, never as a color wash. Each pane has a top-lit inner rim, a faint sheen across its top and a soft shadow, deeper for floating layers. To hold 4.5:1 over what the glass lets through, Light Glass's muted text is a step deeper, status tags and Metric changes keep a solid base under their tint, and pagination labels that sit on the backdrop get a soft frosted lift. Dialogs and drawers sit over a dimming layer.
prefers-reduced-transparencyandprefers-contrast: moreget solid surfaces. A pill Tabs track is a capsule like its thumb. --diya-color-scrimis set in Light and Dark (#00000088), not only under Glass, so an overlay or shadow built on it works everywhere. Dialog and Drawer share it, so a Drawer dims the page as much as a Dialog.- Button is a pill by default;
shape="rounded"keeps the control corner. Pattern actions, Menu and Popover triggers and Table filters follow. --diya-radius-surface, the one corner Card, chart cards, Page Header, Form and Table share.PageHeadertakessurface={false}to sit straight on the page.- Figures are tabular: Metric, Table numbers, chart data and Progress line up digit for digit, in DIYA Sans's own 0 and 1. A positive or negative
Metricchange shows as a tinted chip. Rating, read-only stars for products, places and reviews. The stars fill to the nearest half ofvalue(out ofmax, 5 by default);countadds the number of reviews andshowValuethe rating as a number. Screen readers hear one phrase, such as "Rated 4.3 out of 5, 128 reviews".DataViz'sformatValuelabels the value axis too, and grid lines run along the value axis only.- A
Listinside aCardorDrawerlines up with its title. Form,Card,Drawer,Dialog,Wizard,Accordion,TableandChatbotstyle their own parts and your plain elements, never a DIYA component placed inside them: anAlertin a sign-inFormkeeps its title color and spacing, aCardorFormin aDrawerorDialogkeeps its own header and footer, and aSwitchin aTablecell stays a switch.Listitems takecurrent, for the open item (aria-current="true"and a selected background), andunread: a heavier label, a dot at the row's end, and "unread" after the label for screen readers (messages.list.unread).- Side Navigation items take
count, a quiet number after the label. Above 99 it shows99+; collapsed, a dot on the icon stands in for it. The item's accessible name keeps the real count, "Inbox, 12" (messages.sideNavigation.count). - Side Navigation takes
footer, for an account or workspace Menu pinned to the bottom of a full-height navigation, andcollapsedFooterfor the rail (it defaults tofooter), followingbrandandcollapsedBrand. A Menu, Avatar or Button in either slot keeps its own look. - A
layout="full-page"Chatbot fills its container's height: the header and composer stay put and the thread scrolls between them, following the latest message. A height set on any Chatbot is filled the same way; without one, the thread keeps its 280px (380px full-page). - Chatbot
showHeader={false}hides its header for a screen that has its own heading;titlestill names the chat region and its message log. - A streaming Chatbot reply replaces "Preparing a response…": the line shows only until the reply's first words arrive. The reply gets its Copy button once it is complete or stopped.
- A person's Chatbot message is as wide as its text, up to 90% of the thread, in every layout.
- A tall Chatbot
welcomestays at its top on a short screen; the thread follows the conversation from the first message.diya-chat-welcome-titlestyles the welcome's heading at any level, as a plainh3is styled. npm create diya@latest(thecreate-diyapackage, released with this one on the same version) starts a Next.js or Vite app with the provider, styles and agent notes in place, from Minimal or from Oriel, a four-screen invoicing app.- Oriel, a demo app made only from DIYA, in
examples/oriel. bench/: the bundle-size measurement, rerunnable withnode bench/measure.mjs. One Button withDiyaProvideradds 2.3 KB of gzipped JavaScript to a Vite build.- Charts use DIYA's Vivid palette (bright blue, orange, pink, green, violet, teal, indigo, red) with a fine gradient: bars soften toward their base, donut segments catch a highlight, and one or two lines glow into the plot. Legend dots stay solid, and every chart keeps its data table.
Renamed since the preview
The 0.1.0 preview builds shipped as @diya/ui. The package is now @idyeah/diya, and the names below changed before 1.0. There are no aliases for the old names; TypeScript reports each one.
Values and callbacks
- One change pattern,
valuewithonValueChange:DatePicker:onChange→onValueChange.Combobox:onChange→onValueChange.SiteHeader:onNavigate→onValueChange, paired with itsvalue.SelectgainsonValueChange(value); the nativeonChange(event)still works.
Choice:mode: 'single' | 'multiple'→multiple. Single givesvalue: string;multiplegivesvalue: string[].selectAllis available only withmultiple.Combobox: single givesvalue: string(''for none);multiplegivesvalue: string[].Slider: single givesvalue: number;rangegivesvalue: [number, number].DatePicker: single gives an ISO date string (''for none);rangegivesvalue: DateRange({ start, end }).labelis now required.
Props
| Component | Before | 1.0 |
|---|---|---|
| TextInput, TextArea, Select, Search | fieldSize | size |
| Form, Wizard | pending | loading |
| Chatbot | busy | loading |
| Chatbot | type | layout ('embedded' | 'floating' | 'full-page') |
| Chatbot | timestamps | showTimestamps |
| Toast | onClose | onDismiss |
| Toast | dismissible | showClose |
| Card, Dialog | divider | divided |
| Card | menu | actions |
| Card | tag | tags |
| Button | shape: 'rectangle' | shape: 'rounded'; the default is now 'pill' |
| ContentState | role: 'status' | 'alert' | urgent (true announces it as an alert) |
| Badge | type | variant ('count' | 'dot') |
| Badge | maximum | max |
| Badge, Tag | color | tone |
| Slider | labels | showValues |
| Slider | marks | showMarks |
| Progress | percentage | showValue |
| Progress | type | variant ('linear' | 'circular') |
| Wizard | summary | showStepCount |
| Breadcrumbs | homeIcon | showHomeIcon |
| Tabs | variant: 'pills' | variant: 'pill' |
| Switch | description | helperText (Switch also gains error) |
| SideNavigationItem | id | value (SideNavigationGroup keeps id) |
| Table | selection | selectable |
| Table | filter ({ label, values, value }) | filterOptions (TableFilter: { key, label, options, getValue }) |
Option values are lowercase: Wizard orientation ('horizontal' | 'vertical'), Drawer side ('left' | 'right'), and Chart and DataViz type and variant.
Types
| Before | 1.0 |
|---|---|
ComboOption | ComboboxOption |
SiteNavigationItem | SiteHeaderItem |
DateValue | DateRange |
BadgeColor | Tone, shared by Badge, Tag, Alert and Toast (AlertTone is Tone without 'neutral') |
Removed
- Dialog:
label(the built-in trigger) andinline. Pass your owntrigger, or controlopen. brandColoron Tag, Badge, Alert and Switch. Set it once onDiyaProvider.- Table:
renderExpanded,onArchive,archiveLabel,onInspectandinspectLabel. UsebulkActionsfor actions on selected rows (each also appears in a row's own menu) andonRowOpen(withopenLabel) to open a row's details. - Table: the
filtersandactionsswitches. The filter menus show whenfilterOptionshas entries, and the row menu shows whenrowActions,bulkActionsoronRowOpenis given. - Choice:
descriptions. An option'sdescriptionshows whenever it has one.
Defaults
DiyaProvider:themeis'system'and the provider paints its surface. DIYA's own accent is a neutral ink:#262626with#FAFAFAtext in Light,#E8E8E8with#1C1C1Ctext in Dark. The grays keep a slight cool cast in both themes.- Switch is a native checkbox with
role="switch"; its ref is the input. - Search is
roundedby default, like the other fields. --diya-text-captionis 14px (was 13px), so small print reads more easily.- Table: row checkboxes are opt-in. They show when you pass
bulkActions,onSelectionChangeorselectedIds, or setselectable. The search field shows whensearchTextis given. Tables show 10 rows a page (defaultPageSize,pageSizeOptions). - Progress with no
valueis indeterminate. - FileUpload:
multipledefaults tofalse. - Slider shows its label;
hideLabelhides it visually. - TextInput, TextArea, Select and Search put
classNameandstyleon the outer field wrapper; every other attribute goes on the control. - A nested
DiyaProviderinheritslocaleandmessagesfrom the provider around it and overrides only what it sets.
Tokens
The --library-* custom properties are gone. The public ones were renamed:
| Before | 1.0 |
|---|---|
--library-text, --library-muted | --diya-color-text, --diya-color-muted |
--library-surface, --library-recessed, --library-raised | --diya-color-surface, --diya-color-recessed, --diya-color-raised |
--library-line | --diya-color-line |
--library-active, --library-active-text | --diya-color-accent, --diya-color-accent-text |
--library-hover, --library-selected | --diya-color-hover, --diya-color-selected |
--library-destructive, --library-error | --diya-color-destructive, --diya-color-error |
--library-glass | --diya-color-glass |
--library-depth | --diya-shadow-raised |
--diya-scrim | --diya-color-scrim |
--library-tag-{status}-tone, --library-tag-{status}-surface | --diya-color-{status}, --diya-color-{status}-surface |
--library-badge-{status}-fill, --library-badge-{status}-ink | --diya-color-{status}-fill, --diya-color-{status}-on-fill |
New public tokens: --diya-color-accent-soft and --diya-color-accent-ink (set by brandColor), --diya-radius-control, the corner every control shares, and the spacing scale --diya-space-1 to --diya-space-8. --diya-brand is gone; use brandColor.
{status} is success, warning, error or info; the neutral badge pair is --diya-color-neutral-fill and --diya-color-neutral-on-fill. Every other --library-* property is now --diya-internal-*, which is private and may change in any release. The README lists the public tokens.
Styles
styles.cssis wrapped in thediyacascade layer, so your own CSS and Tailwind's utilities win over DIYA's rules. DIYA's base styles reach only its own elements, never your markup elsewhere in the provider.- Every class DIYA renders starts with
diya-; for example,.app-pattern-surfaceis.diya-app-pattern-surface,.text-input-sr-onlyis.diya-sr-onlyand.atom-descriptionis.diya-switch-description. Class names aren't covered by semver.
api.json
- Item ids are their first export's name in kebab-case:
linkistext-link, andempty-stateiscontent-state.stackandinlineare new, withkind: "layout". - Chatbot and Data Viz (
DataViz,Chart) areexperimental: outside semver until their API settles.