@xui/steps 2.0.0-alpha.19 → 2.0.0-alpha.21

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.
@@ -10,8 +10,10 @@ import { XuiIcon } from '@xui/icon';
10
10
  * overrides the status the parent would otherwise derive from `current`.
11
11
  */
12
12
  class XuiStep {
13
+ /** The step's name, shown beside its marker. */
13
14
  title = input('', /* @ts-ignore */
14
15
  ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
16
+ /** Supporting detail under the title. */
15
17
  description = input('', /* @ts-ignore */
16
18
  ...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
17
19
  /** Force a status instead of deriving it from the active step. */
@@ -51,12 +53,19 @@ const [injectXuiStepsConfig, provideXuiStepsConfig] = createXConfigToken('XuiSte
51
53
  */
52
54
  class XuiSteps {
53
55
  config = injectXuiStepsConfig();
56
+ /** Extra classes, merged into the component's own rather than replacing them. */
54
57
  class = input('', /* @ts-ignore */
55
58
  ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
59
+ /**
60
+ * Zero-based index of the active step. Everything before it reads as done, everything after as pending. Two-way
61
+ * bindable.
62
+ */
56
63
  current = model(0, /* @ts-ignore */
57
64
  ...(ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []));
65
+ /** Run the steps across the page or down it. */
58
66
  orientation = input(this.config.orientation, /* @ts-ignore */
59
67
  ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
68
+ /** Let a step header jump to that step. Off by default, so the sequence stays under the host's control. */
60
69
  clickable = input(this.config.clickable, { ...(ngDevMode ? { debugName: "clickable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
61
70
  steps = contentChildren(XuiStep, /* @ts-ignore */
62
71
  ...(ngDevMode ? [{ debugName: "steps" }] : /* istanbul ignore next */ []));
@@ -1 +1 @@
1
- {"version":3,"file":"xui-steps.mjs","sources":["../../../../../../libs/ui/steps/xui/src/lib/step.ts","../../../../../../libs/ui/steps/xui/src/lib/steps.token.ts","../../../../../../libs/ui/steps/xui/src/lib/steps.ts","../../../../../../libs/ui/steps/xui/src/index.ts","../../../../../../libs/ui/steps/xui/src/xui-steps.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, ViewEncapsulation } from '@angular/core';\n\nexport type XuiStepStatus = 'wait' | 'process' | 'finish' | 'error';\n\n/**\n * One step inside {@link XuiSteps}. `title`/`description` describe it; `status`\n * overrides the status the parent would otherwise derive from `current`.\n */\n@Component({\n selector: 'xui-step',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiStep {\n readonly title = input<string>('');\n readonly description = input<string>('');\n /** Force a status instead of deriving it from the active step. */\n readonly status = input<XuiStepStatus>();\n}\n","import { createXConfigToken } from '@xui/core';\n\nexport interface XuiStepsConfig {\n orientation: 'horizontal' | 'vertical';\n clickable: boolean;\n}\n\nexport const [injectXuiStepsConfig, provideXuiStepsConfig] = createXConfigToken<XuiStepsConfig>('XuiStepsConfig', {\n orientation: 'horizontal',\n clickable: false\n});\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n input,\n model,\n ViewEncapsulation\n} from '@angular/core';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport { matCheckRound, matCloseRound } from '@ng-icons/material-icons/round';\nimport { xui } from '@xui/core';\nimport { XuiIcon } from '@xui/icon';\nimport type { ClassValue } from 'clsx';\nimport { XuiStep, type XuiStepStatus } from './step';\nimport { injectXuiStepsConfig } from './steps.token';\n\n/**\n * A step / wizard progress indicator. Wrap `<xui-step>` entries and bind\n * `current` (two-way) to the active index; each step's status is derived\n * (`finish` before, `process` at, `wait` after) unless the step overrides it.\n * With `clickable`, clicking a step moves `current`.\n *\n * ```html\n * <xui-steps [(current)]=\"step\">\n * <xui-step title=\"Cart\" />\n * <xui-step title=\"Pay\" description=\"Card or PayPal\" />\n * <xui-step title=\"Done\" />\n * </xui-steps>\n * ```\n */\n@Component({\n selector: 'xui-steps',\n template: `\n @for (step of steps(); track $index; let i = $index, last = $last) {\n <div [class]=\"itemClass()\">\n <button type=\"button\" [class]=\"headerClass()\" [disabled]=\"!clickable()\" (click)=\"select(i)\">\n <span [class]=\"circleClass(statusAt(i))\">\n @if (statusAt(i) === 'finish') {\n <ng-icon xui size=\"sm\" name=\"matCheckRound\" />\n } @else if (statusAt(i) === 'error') {\n <ng-icon xui size=\"sm\" name=\"matCloseRound\" />\n } @else {\n {{ i + 1 }}\n }\n </span>\n <span class=\"flex flex-col text-start\">\n <span [class]=\"titleClass(statusAt(i))\">{{ step.title() }}</span>\n @if (step.description()) {\n <span class=\"text-foreground-muted text-xs\">{{ step.description() }}</span>\n }\n </span>\n </button>\n @if (!last) {\n <span [class]=\"connectorClass(statusAt(i))\"></span>\n }\n </div>\n }\n `,\n host: {\n '[class]': 'computedClass()'\n },\n imports: [NgIcon, XuiIcon],\n viewProviders: [provideIcons({ matCheckRound, matCloseRound })],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiSteps {\n private readonly config = injectXuiStepsConfig();\n\n readonly class = input<ClassValue>('');\n\n readonly current = model<number>(0);\n readonly orientation = input<'horizontal' | 'vertical'>(this.config.orientation);\n readonly clickable = input<boolean, BooleanInput>(this.config.clickable, { transform: booleanAttribute });\n\n protected readonly steps = contentChildren(XuiStep);\n\n protected statusAt(index: number): XuiStepStatus {\n const override = this.steps()[index]?.status();\n if (override) {\n return override;\n }\n const current = this.current();\n return index < current ? 'finish' : index === current ? 'process' : 'wait';\n }\n\n protected select(index: number): void {\n if (this.clickable()) {\n this.current.set(index);\n }\n }\n\n private get vertical(): boolean {\n return this.orientation() === 'vertical';\n }\n\n protected readonly computedClass = computed(() =>\n xui('flex', this.orientation() === 'vertical' ? 'flex-col gap-1' : 'flex-row items-start', this.class())\n );\n protected readonly itemClass = computed(() =>\n xui('flex', this.vertical ? 'flex-col' : 'flex-1 items-center gap-3 last:flex-none')\n );\n protected readonly headerClass = computed(() =>\n xui('flex items-center gap-3 rounded', this.clickable() ? 'cursor-pointer' : 'cursor-default')\n );\n\n protected circleClass(status: XuiStepStatus): string {\n return xui(\n 'flex size-8 shrink-0 items-center justify-center rounded-full border-2 text-sm font-medium transition-colors',\n status === 'process'\n ? 'bg-primary text-primary-foreground border-primary'\n : status === 'finish'\n ? 'border-primary text-primary'\n : status === 'error'\n ? 'border-error text-error'\n : 'border-border text-foreground-muted'\n );\n }\n\n protected titleClass(status: XuiStepStatus): string {\n return xui(\n 'text-sm font-medium',\n status === 'wait' ? 'text-foreground-muted' : status === 'error' ? 'text-error' : 'text-foreground'\n );\n }\n\n protected connectorClass(status: XuiStepStatus): string {\n const done = status === 'finish';\n return this.vertical\n ? xui('ms-4 min-h-4 w-px flex-1 self-stretch', done ? 'bg-primary' : 'bg-border')\n : xui('h-px flex-1', done ? 'bg-primary' : 'bg-border');\n }\n}\n","import { XuiStep } from './lib/step';\nimport { XuiSteps } from './lib/steps';\n\nexport * from './lib/step';\nexport * from './lib/steps';\nexport * from './lib/steps.token';\n\nexport const XuiStepsImports = [XuiSteps, XuiStep] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAIA;;;AAGG;MAOU,OAAO,CAAA;IACT,KAAK,GAAG,KAAK,CAAS,EAAE;8EAAC;IACzB,WAAW,GAAG,KAAK,CAAS,EAAE;oFAAC;;AAE/B,IAAA,MAAM,GAAG,KAAK;0FAAiB;0HAJ7B,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAP,uBAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,E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EvC,eAAe,GAAG,CAAC,QAAQ,EAAE,OAAO;;ACPjD;;AAEG;;;;"}
1
+ {"version":3,"file":"xui-steps.mjs","sources":["../../../../../../libs/ui/steps/xui/src/lib/step.ts","../../../../../../libs/ui/steps/xui/src/lib/steps.token.ts","../../../../../../libs/ui/steps/xui/src/lib/steps.ts","../../../../../../libs/ui/steps/xui/src/index.ts","../../../../../../libs/ui/steps/xui/src/xui-steps.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, ViewEncapsulation } from '@angular/core';\n\nexport type XuiStepStatus = 'wait' | 'process' | 'finish' | 'error';\n\n/**\n * One step inside {@link XuiSteps}. `title`/`description` describe it; `status`\n * overrides the status the parent would otherwise derive from `current`.\n */\n@Component({\n selector: 'xui-step',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiStep {\n /** The step's name, shown beside its marker. */\n readonly title = input<string>('');\n /** Supporting detail under the title. */\n readonly description = input<string>('');\n /** Force a status instead of deriving it from the active step. */\n readonly status = input<XuiStepStatus>();\n}\n","import { createXConfigToken } from '@xui/core';\n\nexport interface XuiStepsConfig {\n orientation: 'horizontal' | 'vertical';\n clickable: boolean;\n}\n\nexport const [injectXuiStepsConfig, provideXuiStepsConfig] = createXConfigToken<XuiStepsConfig>('XuiStepsConfig', {\n orientation: 'horizontal',\n clickable: false\n});\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n input,\n model,\n ViewEncapsulation\n} from '@angular/core';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport { matCheckRound, matCloseRound } from '@ng-icons/material-icons/round';\nimport { xui } from '@xui/core';\nimport { XuiIcon } from '@xui/icon';\nimport type { ClassValue } from 'clsx';\nimport { XuiStep, type XuiStepStatus } from './step';\nimport { injectXuiStepsConfig } from './steps.token';\n\n/**\n * A step / wizard progress indicator. Wrap `<xui-step>` entries and bind\n * `current` (two-way) to the active index; each step's status is derived\n * (`finish` before, `process` at, `wait` after) unless the step overrides it.\n * With `clickable`, clicking a step moves `current`.\n *\n * ```html\n * <xui-steps [(current)]=\"step\">\n * <xui-step title=\"Cart\" />\n * <xui-step title=\"Pay\" description=\"Card or PayPal\" />\n * <xui-step title=\"Done\" />\n * </xui-steps>\n * ```\n */\n@Component({\n selector: 'xui-steps',\n template: `\n @for (step of steps(); track $index; let i = $index, last = $last) {\n <div [class]=\"itemClass()\">\n <button type=\"button\" [class]=\"headerClass()\" [disabled]=\"!clickable()\" (click)=\"select(i)\">\n <span [class]=\"circleClass(statusAt(i))\">\n @if (statusAt(i) === 'finish') {\n <ng-icon xui size=\"sm\" name=\"matCheckRound\" />\n } @else if (statusAt(i) === 'error') {\n <ng-icon xui size=\"sm\" name=\"matCloseRound\" />\n } @else {\n {{ i + 1 }}\n }\n </span>\n <span class=\"flex flex-col text-start\">\n <span [class]=\"titleClass(statusAt(i))\">{{ step.title() }}</span>\n @if (step.description()) {\n <span class=\"text-foreground-muted text-xs\">{{ step.description() }}</span>\n }\n </span>\n </button>\n @if (!last) {\n <span [class]=\"connectorClass(statusAt(i))\"></span>\n }\n </div>\n }\n `,\n host: {\n '[class]': 'computedClass()'\n },\n imports: [NgIcon, XuiIcon],\n viewProviders: [provideIcons({ matCheckRound, matCloseRound })],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiSteps {\n private readonly config = injectXuiStepsConfig();\n\n /** Extra classes, merged into the component's own rather than replacing them. */\n readonly class = input<ClassValue>('');\n\n /**\n * Zero-based index of the active step. Everything before it reads as done, everything after as pending. Two-way\n * bindable.\n */\n readonly current = model<number>(0);\n /** Run the steps across the page or down it. */\n readonly orientation = input<'horizontal' | 'vertical'>(this.config.orientation);\n /** Let a step header jump to that step. Off by default, so the sequence stays under the host's control. */\n readonly clickable = input<boolean, BooleanInput>(this.config.clickable, { transform: booleanAttribute });\n\n protected readonly steps = contentChildren(XuiStep);\n\n protected statusAt(index: number): XuiStepStatus {\n const override = this.steps()[index]?.status();\n if (override) {\n return override;\n }\n const current = this.current();\n return index < current ? 'finish' : index === current ? 'process' : 'wait';\n }\n\n protected select(index: number): void {\n if (this.clickable()) {\n this.current.set(index);\n }\n }\n\n private get vertical(): boolean {\n return this.orientation() === 'vertical';\n }\n\n protected readonly computedClass = computed(() =>\n xui('flex', this.orientation() === 'vertical' ? 'flex-col gap-1' : 'flex-row items-start', this.class())\n );\n protected readonly itemClass = computed(() =>\n xui('flex', this.vertical ? 'flex-col' : 'flex-1 items-center gap-3 last:flex-none')\n );\n protected readonly headerClass = computed(() =>\n xui('flex items-center gap-3 rounded', this.clickable() ? 'cursor-pointer' : 'cursor-default')\n );\n\n protected circleClass(status: XuiStepStatus): string {\n return xui(\n 'flex size-8 shrink-0 items-center justify-center rounded-full border-2 text-sm font-medium transition-colors',\n status === 'process'\n ? 'bg-primary text-primary-foreground border-primary'\n : status === 'finish'\n ? 'border-primary text-primary'\n : status === 'error'\n ? 'border-error text-error'\n : 'border-border text-foreground-muted'\n );\n }\n\n protected titleClass(status: XuiStepStatus): string {\n return xui(\n 'text-sm font-medium',\n status === 'wait' ? 'text-foreground-muted' : status === 'error' ? 'text-error' : 'text-foreground'\n );\n }\n\n protected connectorClass(status: XuiStepStatus): string {\n const done = status === 'finish';\n return this.vertical\n ? xui('ms-4 min-h-4 w-px flex-1 self-stretch', done ? 'bg-primary' : 'bg-border')\n : xui('h-px flex-1', done ? 'bg-primary' : 'bg-border');\n }\n}\n","import { XuiStep } from './lib/step';\nimport { XuiSteps } from './lib/steps';\n\nexport * from './lib/step';\nexport * from './lib/steps';\nexport * from './lib/steps.token';\n\nexport const XuiStepsImports = [XuiSteps, XuiStep] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAIA;;;AAGG;MAOU,OAAO,CAAA;;IAET,KAAK,GAAG,KAAK,CAAS,E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;AACD,oBAAA,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;oBAC1B,aAAa,EAAE,CAAC,YAAY,CAAC,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC,CAAC;oBAC/D,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,aAAa,EAAE,iBAAiB,CAAC;AAClC,iBAAA;2gBAiB4C,OAAO,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;MC9EvC,eAAe,GAAG,CAAC,QAAQ,EAAE,OAAO;;ACPjD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xui/steps",
3
- "version": "2.0.0-alpha.19",
3
+ "version": "2.0.0-alpha.21",
4
4
  "description": "Modern Angular 22 UI Library based on TailwindCSS",
5
5
  "keywords": [
6
6
  "angular",
@@ -40,8 +40,8 @@
40
40
  "@angular/core": "22",
41
41
  "@ng-icons/core": "34",
42
42
  "@ng-icons/material-icons": "34",
43
- "@xui/core": "2.0.0-alpha.19",
44
- "@xui/icon": "2.0.0-alpha.19",
43
+ "@xui/core": "2.0.0-alpha.21",
44
+ "@xui/icon": "2.0.0-alpha.21",
45
45
  "clsx": "^2.1.1"
46
46
  },
47
47
  "publishConfig": {
@@ -8,7 +8,9 @@ type XuiStepStatus = 'wait' | 'process' | 'finish' | 'error';
8
8
  * overrides the status the parent would otherwise derive from `current`.
9
9
  */
10
10
  declare class XuiStep {
11
+ /** The step's name, shown beside its marker. */
11
12
  readonly title: _angular_core.InputSignal<string>;
13
+ /** Supporting detail under the title. */
12
14
  readonly description: _angular_core.InputSignal<string>;
13
15
  /** Force a status instead of deriving it from the active step. */
14
16
  readonly status: _angular_core.InputSignal<XuiStepStatus | undefined>;
@@ -32,9 +34,16 @@ declare class XuiStep {
32
34
  */
33
35
  declare class XuiSteps {
34
36
  private readonly config;
37
+ /** Extra classes, merged into the component's own rather than replacing them. */
35
38
  readonly class: _angular_core.InputSignal<ClassValue>;
39
+ /**
40
+ * Zero-based index of the active step. Everything before it reads as done, everything after as pending. Two-way
41
+ * bindable.
42
+ */
36
43
  readonly current: _angular_core.ModelSignal<number>;
44
+ /** Run the steps across the page or down it. */
37
45
  readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
46
+ /** Let a step header jump to that step. Off by default, so the sequence stays under the host's control. */
38
47
  readonly clickable: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
39
48
  protected readonly steps: _angular_core.Signal<readonly XuiStep[]>;
40
49
  protected statusAt(index: number): XuiStepStatus;