@tribepad/themis 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tribepad/themis",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "Accessible React component library built on React Aria primitives",
5
5
  "author": "Tribepad <mbasford@tribepad.com>",
6
6
  "license": "MIT",
@@ -423,6 +423,69 @@ export const StepperVerticalNonLinear: Story = {
423
423
  ),
424
424
  };
425
425
 
426
+ /**
427
+ * StepperWithError: a step flagged with `errorDescription` (here, a failed
428
+ * validation on the Shipping step). The errored circle turns destructive and
429
+ * swaps its number for an alert icon — taking visual precedence over the
430
+ * active/completed treatment — and the description appears as a tooltip on
431
+ * hover or keyboard focus of the tab. The tooltip is WCAG 2.2 AAA-compliant
432
+ * (React Aria: Escape-dismissible, hoverable, persistent) and the error state
433
+ * is also announced to screen readers via the tab's `aria-describedby`, so the
434
+ * information never relies on hover or colour alone.
435
+ */
436
+ export const StepperWithError: Story = {
437
+ render: () => (
438
+ <Tabs variant="stepper" defaultSelectedKey="shipping">
439
+ <TabList aria-label="Checkout steps">
440
+ <Tab id="cart">Cart</Tab>
441
+ <Tab id="shipping" errorDescription="Postcode is invalid">Shipping</Tab>
442
+ <Tab id="payment">Payment</Tab>
443
+ </TabList>
444
+ <TabPanel id="cart">
445
+ <div className="p-4">Cart — completed.</div>
446
+ </TabPanel>
447
+ <TabPanel id="shipping">
448
+ <div className="p-4">Shipping — fix the highlighted error to continue.</div>
449
+ </TabPanel>
450
+ <TabPanel id="payment">
451
+ <div className="p-4">Payment — upcoming.</div>
452
+ </TabPanel>
453
+ </Tabs>
454
+ ),
455
+ };
456
+
457
+ /**
458
+ * StepperVerticalWithError: the same error treatment in the vertical (Wizard)
459
+ * stepper — destructive circle, alert icon, and a tooltip above the step.
460
+ */
461
+ export const StepperVerticalWithError: Story = {
462
+ render: () => (
463
+ <Tabs
464
+ variant="stepper"
465
+ orientation="vertical"
466
+ defaultSelectedKey="workflow"
467
+ className="w-[240px]"
468
+ >
469
+ <TabList aria-label="Edit blueprint steps">
470
+ <Tab id="details">Position Details</Tab>
471
+ <Tab id="workflow" errorDescription="At least one stage is required">
472
+ Candidate Workflow
473
+ </Tab>
474
+ <Tab id="pipeline">Pipeline &amp; Journeys</Tab>
475
+ </TabList>
476
+ <TabPanel id="details">
477
+ <div className="p-4">Position Details — completed.</div>
478
+ </TabPanel>
479
+ <TabPanel id="workflow">
480
+ <div className="p-4">Candidate Workflow — has an error.</div>
481
+ </TabPanel>
482
+ <TabPanel id="pipeline">
483
+ <div className="p-4">Pipeline &amp; Journeys — upcoming.</div>
484
+ </TabPanel>
485
+ </Tabs>
486
+ ),
487
+ };
488
+
426
489
  /**
427
490
  * StepperFirstStep: Stepper with the first step active (no completed steps).
428
491
  */