@unofficialbox/box-open-elements 0.28.0 → 0.28.1

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/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  Browse the full catalog on the **[live docs site](https://unofficialbox.github.io/box-open-elements)** — live previews, an events/properties inspector, per-framework code snippets (React / Angular / Vue / Svelte / HTML), and the foundations pages.
14
14
 
15
- The library is organized around three layers (see [taxonomy](https://github.com/unofficialbox/box-open-elements/blob/v0.28.0/docs/taxonomy.md) for the canonical model):
15
+ The library is organized around three layers (see [taxonomy](https://github.com/unofficialbox/box-open-elements/blob/v0.28.1/docs/taxonomy.md) for the canonical model):
16
16
 
17
17
  - **Foundations** — design decisions as data: tokens, color, typography, iconography, accessibility, theming
18
18
  - **Components** — accessible Web Components for single controls, organized by category
@@ -77,7 +77,7 @@ selection.toggleSelection("1");
77
77
  - optimized component entrypoints: `@unofficialbox/box-open-elements/<name>`
78
78
  - patterns: `@unofficialbox/box-open-elements/patterns/<area>` and `@unofficialbox/box-open-elements/patterns/<area>/<module>`
79
79
 
80
- See the versioned [API guidelines](https://github.com/unofficialbox/box-open-elements/blob/v0.28.0/docs/api-guidelines.md).
80
+ See the versioned [API guidelines](https://github.com/unofficialbox/box-open-elements/blob/v0.28.1/docs/api-guidelines.md).
81
81
 
82
82
  ## Developing
83
83
 
@@ -91,17 +91,17 @@ bun run docs # build + serve the docs site at http://localhost:4600
91
91
 
92
92
  ## Documentation
93
93
 
94
- The versioned docs index is at [docs/README.md](https://github.com/unofficialbox/box-open-elements/blob/v0.28.0/docs/README.md). The most important entries:
95
-
96
- - [Taxonomy](https://github.com/unofficialbox/box-open-elements/blob/v0.28.0/docs/taxonomy.md)
97
- - [Architecture](https://github.com/unofficialbox/box-open-elements/blob/v0.28.0/docs/architecture.md)
98
- - [API Guidelines](https://github.com/unofficialbox/box-open-elements/blob/v0.28.0/docs/api-guidelines.md)
99
- - [Components catalog](https://github.com/unofficialbox/box-open-elements/blob/v0.28.0/docs/components/catalog.md) and [patterns catalog](https://github.com/unofficialbox/box-open-elements/blob/v0.28.0/docs/patterns/catalog.md)
100
- - [Using with React, Angular, Vue, and Svelte](https://github.com/unofficialbox/box-open-elements/blob/v0.28.0/docs/integration/frameworks.md)
101
- - [Design Tokens](https://github.com/unofficialbox/box-open-elements/blob/v0.28.0/docs/foundations/tokens.md)
102
- - [Content Explorer](https://github.com/unofficialbox/box-open-elements/blob/v0.28.0/docs/patterns/content-explorer.md)
103
- - [Box Server Integration](https://github.com/unofficialbox/box-open-elements/blob/v0.28.0/docs/integration/box-server.md)
104
- - [Agent UI guidelines](https://github.com/unofficialbox/box-open-elements/blob/v0.28.0/docs/patterns/agent-ui-guidelines.md), [building blocks](https://github.com/unofficialbox/box-open-elements/blob/v0.28.0/docs/patterns/agent-ui.md), and [motion](https://github.com/unofficialbox/box-open-elements/blob/v0.28.0/docs/foundations/motion.md)
94
+ The versioned docs index is at [docs/README.md](https://github.com/unofficialbox/box-open-elements/blob/v0.28.1/docs/README.md). The most important entries:
95
+
96
+ - [Taxonomy](https://github.com/unofficialbox/box-open-elements/blob/v0.28.1/docs/taxonomy.md)
97
+ - [Architecture](https://github.com/unofficialbox/box-open-elements/blob/v0.28.1/docs/architecture.md)
98
+ - [API Guidelines](https://github.com/unofficialbox/box-open-elements/blob/v0.28.1/docs/api-guidelines.md)
99
+ - [Components catalog](https://github.com/unofficialbox/box-open-elements/blob/v0.28.1/docs/components/catalog.md) and [patterns catalog](https://github.com/unofficialbox/box-open-elements/blob/v0.28.1/docs/patterns/catalog.md)
100
+ - [Using with React, Angular, Vue, and Svelte](https://github.com/unofficialbox/box-open-elements/blob/v0.28.1/docs/integration/frameworks.md)
101
+ - [Design Tokens](https://github.com/unofficialbox/box-open-elements/blob/v0.28.1/docs/foundations/tokens.md)
102
+ - [Content Explorer](https://github.com/unofficialbox/box-open-elements/blob/v0.28.1/docs/patterns/content-explorer.md)
103
+ - [Box Server Integration](https://github.com/unofficialbox/box-open-elements/blob/v0.28.1/docs/integration/box-server.md)
104
+ - [Agent UI guidelines](https://github.com/unofficialbox/box-open-elements/blob/v0.28.1/docs/patterns/agent-ui-guidelines.md), [building blocks](https://github.com/unofficialbox/box-open-elements/blob/v0.28.1/docs/patterns/agent-ui.md), and [motion](https://github.com/unofficialbox/box-open-elements/blob/v0.28.1/docs/foundations/motion.md)
105
105
 
106
106
  ## Contributing
107
107
 
@@ -3,11 +3,12 @@ import { BaseElement } from "../../core/index.js";
3
3
  * Explicit per-step status. Absent means the step derives complete / current /
4
4
  * upcoming from its position relative to `value` — the behaviour existing
5
5
  * hosts rely on. An explicit status wins over the positional derivation:
6
- * `complete` marks out-of-order completion, `blocked` and `disabled` make the
6
+ * `complete` marks out-of-order completion, `visited` marks a reached step
7
+ * without claiming it passed validation, `blocked` and `disabled` make the
7
8
  * step non-interactive, `failed` stays interactive because a failed step is
8
9
  * usually exactly where the user needs to go.
9
10
  */
10
- export type ProgressStepStatus = "complete" | "blocked" | "failed" | "disabled";
11
+ export type ProgressStepStatus = "complete" | "visited" | "blocked" | "failed" | "disabled";
11
12
  export interface ProgressStepItem {
12
13
  description?: string;
13
14
  label: string;
@@ -8,7 +8,7 @@ const escapeHtml = (value) => value
8
8
  .replaceAll(">", "&gt;")
9
9
  .replaceAll('"', "&quot;")
10
10
  .replaceAll("'", "&#39;");
11
- const STEP_STATUSES = new Set(["complete", "blocked", "failed", "disabled"]);
11
+ const STEP_STATUSES = new Set(["complete", "visited", "blocked", "failed", "disabled"]);
12
12
  /** Attribute payloads are author input — validate every record. */
13
13
  export const isProgressStepRecord = (value) => {
14
14
  if (typeof value !== "object" || value === null) {
@@ -46,6 +46,7 @@ export const resolveStepStates = (items, value) => {
46
46
  /** Every state in words — colour never carries the meaning alone. */
47
47
  export const STEP_STATE_LABEL = {
48
48
  complete: "Complete",
49
+ visited: "Visited",
49
50
  current: "Current step",
50
51
  upcoming: "Not started",
51
52
  blocked: "Blocked",
@@ -141,6 +142,12 @@ const progressStepsStyles = `
141
142
  color: color-mix(in srgb, var(--boe-token-surface-status-surface-success, #26c281) 62%, var(--boe-token-text-text, #222222));
142
143
  }
143
144
 
145
+ [part="step"][data-state="visited"] [part="marker"] {
146
+ border-color: color-mix(in srgb, var(--boe-token-surface-surface-brand, #0061d5) 30%, transparent);
147
+ background: color-mix(in srgb, var(--boe-token-surface-surface-brand, #0061d5) 9%, var(--boe-token-surface-surface, #ffffff));
148
+ color: var(--boe-token-text-text, #222222);
149
+ }
150
+
144
151
  [part="step"][data-state="current"] [part="marker"] {
145
152
  border-color: transparent;
146
153
  background: var(--boe-token-surface-surface-brand, #0061d5);
@@ -455,11 +455,19 @@ export class FormWizard extends BaseElement {
455
455
  this.suppressRailEvent = true;
456
456
  try {
457
457
  this.railEl.label = this.heading ? `${this.heading} steps` : "Wizard steps";
458
- this.railEl.items = steps.map(step => ({
459
- label: step.label,
460
- value: step.id,
461
- ...(step.description ? { description: step.description } : {}),
462
- }));
458
+ const furthestVisitedIndex = Math.max(-1, ...steps.map((step, index) => state?.visitedStepIds.includes(step.id) ? index : -1));
459
+ this.railEl.items = steps.map((step, index) => {
460
+ const visited = state?.visitedStepIds.includes(step.id) ?? false;
461
+ const status = visited && step.id !== state?.currentStepId
462
+ ? (index < furthestVisitedIndex || step.optional || state?.submitted ? "complete" : "visited")
463
+ : undefined;
464
+ return {
465
+ label: step.label,
466
+ value: step.id,
467
+ ...(step.description ? { description: step.description } : {}),
468
+ ...(status ? { status } : {}),
469
+ };
470
+ });
463
471
  if (state && this.railEl.value !== state.currentStepId) {
464
472
  this.railEl.value = state.currentStepId;
465
473
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unofficialbox/box-open-elements",
3
- "version": "0.28.0",
3
+ "version": "0.28.1",
4
4
  "description": "Box Open Elements: an open, framework-agnostic design system and web component library for Box-style experiences",
5
5
  "license": "MIT",
6
6
  "homepage": "https://unofficialbox.github.io/box-open-elements",