bianic-ui 2.14.0-beta.2 → 2.14.0-beta.4
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/dist/cjs/index.js +171 -12
- package/dist/cjs/lib.css +1 -1
- package/dist/cjs/types/components/Forms/Toggle/configs.d.ts +13 -2
- package/dist/cjs/types/components/Forms/Toggle/index.d.ts +1 -1
- package/dist/cjs/types/components/Stepper/Horizontal/Navbar.d.ts +4 -0
- package/dist/cjs/types/components/Stepper/Horizontal/Standard.d.ts +4 -0
- package/dist/cjs/types/components/Stepper/Horizontal/configs.d.ts +9 -0
- package/dist/cjs/types/components/Stepper/Horizontal/index.d.ts +3 -20
- package/dist/cjs/types/components/Stepper/Horizontal/types.d.ts +32 -0
- package/dist/cjs/types/components/Stepper/index.d.ts +1 -0
- package/dist/cjs/types/components/index.d.ts +1 -0
- package/dist/cjs/types/stories/Button/Button.test.stories.d.ts +24 -0
- package/dist/cjs/types/stories/HorizontalStepper/HorizontalStepper.stories.d.ts +123 -4
- package/dist/cjs/types/stories/HorizontalStepper/HorizontalStepper.test.stories.d.ts +49 -0
- package/dist/esm/index.js +171 -12
- package/dist/esm/lib.css +1 -1
- package/dist/esm/types/components/Forms/Toggle/configs.d.ts +13 -2
- package/dist/esm/types/components/Forms/Toggle/index.d.ts +1 -1
- package/dist/esm/types/components/Stepper/Horizontal/Navbar.d.ts +4 -0
- package/dist/esm/types/components/Stepper/Horizontal/Standard.d.ts +4 -0
- package/dist/esm/types/components/Stepper/Horizontal/configs.d.ts +9 -0
- package/dist/esm/types/components/Stepper/Horizontal/index.d.ts +3 -20
- package/dist/esm/types/components/Stepper/Horizontal/types.d.ts +32 -0
- package/dist/esm/types/components/Stepper/index.d.ts +1 -0
- package/dist/esm/types/components/index.d.ts +1 -0
- package/dist/esm/types/stories/Button/Button.test.stories.d.ts +24 -0
- package/dist/esm/types/stories/HorizontalStepper/HorizontalStepper.stories.d.ts +123 -4
- package/dist/esm/types/stories/HorizontalStepper/HorizontalStepper.test.stories.d.ts +49 -0
- package/dist/index.d.ts +18 -6
- package/package.json +13 -3
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
declare const sizeConfig: {
|
|
2
2
|
md: {
|
|
3
3
|
containerSize: string;
|
|
4
|
-
|
|
4
|
+
trackBorder: string;
|
|
5
|
+
knobSize: string;
|
|
6
|
+
knobInset: string;
|
|
5
7
|
labelClass: string;
|
|
6
8
|
};
|
|
7
9
|
sm: {
|
|
8
10
|
containerSize: string;
|
|
9
|
-
|
|
11
|
+
trackBorder: string;
|
|
12
|
+
knobSize: string;
|
|
13
|
+
knobInset: string;
|
|
14
|
+
labelClass: string;
|
|
15
|
+
};
|
|
16
|
+
tn: {
|
|
17
|
+
containerSize: string;
|
|
18
|
+
trackBorder: string;
|
|
19
|
+
knobSize: string;
|
|
20
|
+
knobInset: string;
|
|
10
21
|
labelClass: string;
|
|
11
22
|
};
|
|
12
23
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
interface CheckboxProps extends Omit<ComponentPropsWithoutRef<'input'>, 'size'> {
|
|
3
3
|
label?: string;
|
|
4
|
-
size?: 'md' | 'sm';
|
|
4
|
+
size?: 'md' | 'sm' | 'tn';
|
|
5
5
|
checked?: boolean;
|
|
6
6
|
id?: string;
|
|
7
7
|
onClick?: (event: React.MouseEvent<HTMLInputElement>) => void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NavbarHorizontalStepperProps } from './types';
|
|
3
|
+
export declare function NavbarHorizontalStepper({ steps, activeStep, className, onStepClick, color, processedIcon, currentIcon, size, showLabels, }: Omit<NavbarHorizontalStepperProps, 'variant'>): React.JSX.Element;
|
|
4
|
+
export default NavbarHorizontalStepper;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StandardHorizontalStepperProps } from './types';
|
|
3
|
+
export declare function StandardHorizontalStepper({ steps, activeStep, size, className, onStepClick, processedIcon, currentIcon, color, showLabels, }: Omit<StandardHorizontalStepperProps, 'variant'>): React.JSX.Element;
|
|
4
|
+
export default StandardHorizontalStepper;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HorizontalStepperColor } from './types';
|
|
2
|
+
export type NavbarStepState = 'current' | 'clickable' | 'static' | 'disabled';
|
|
3
|
+
export declare const navbarItemConfig: Record<NavbarStepState, string>;
|
|
4
|
+
export declare const navbarCircleConfig: Record<'currentDefault' | 'other' | 'disabled', string>;
|
|
5
|
+
export declare const navbarCurrentColorConfig: Record<HorizontalStepperColor, string>;
|
|
6
|
+
export declare const navbarProcessedColorConfig: Record<HorizontalStepperColor, string>;
|
|
7
|
+
export declare const navbarProcessedFilledColorConfig: Record<HorizontalStepperColor, string>;
|
|
8
|
+
export declare const navbarLabelConfig: Record<'enabled' | 'disabled', string>;
|
|
9
|
+
export declare const navbarChevronConfig: Record<'enabled' | 'disabled', string>;
|
|
@@ -1,22 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export interface Step {
|
|
5
|
-
id: string | number;
|
|
6
|
-
label?: string;
|
|
7
|
-
description?: string;
|
|
8
|
-
icon?: React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
export interface HorizontalStepperProps {
|
|
11
|
-
steps: Step[];
|
|
12
|
-
activeStep: number;
|
|
13
|
-
size?: StepperSize;
|
|
14
|
-
className?: string;
|
|
15
|
-
onStepClick?: (index: number) => void;
|
|
16
|
-
processedIcon?: React.ReactNode;
|
|
17
|
-
currentIcon?: React.ReactNode;
|
|
18
|
-
color?: string;
|
|
19
|
-
showLabels?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export declare function HorizontalStepper({ steps, activeStep, size, className, onStepClick, processedIcon, currentIcon, color, showLabels, }: HorizontalStepperProps): React.JSX.Element;
|
|
2
|
+
import { HorizontalStepperProps } from './types';
|
|
3
|
+
export declare function HorizontalStepper(props: HorizontalStepperProps): React.JSX.Element;
|
|
22
4
|
export default HorizontalStepper;
|
|
5
|
+
export type { Step, StepStatus, StepperSize, HorizontalStepperProps, HorizontalStepperVariant, HorizontalStepperColor, StandardHorizontalStepperProps, NavbarHorizontalStepperProps, } from './types';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type StepStatus = 'upcoming' | 'current' | 'processed';
|
|
3
|
+
export type StepperSize = 'sm' | 'md';
|
|
4
|
+
export interface Step {
|
|
5
|
+
id: string | number;
|
|
6
|
+
label?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export type HorizontalStepperVariant = 'default' | 'navbar';
|
|
12
|
+
export type HorizontalStepperColor = 'blue' | 'green' | 'teal' | 'crayola' | 'orange' | 'red';
|
|
13
|
+
interface BaseHorizontalStepperProps {
|
|
14
|
+
steps: Step[];
|
|
15
|
+
activeStep: number;
|
|
16
|
+
className?: string;
|
|
17
|
+
onStepClick?: (index: number) => void;
|
|
18
|
+
processedIcon?: React.ReactNode;
|
|
19
|
+
currentIcon?: React.ReactNode;
|
|
20
|
+
size?: StepperSize;
|
|
21
|
+
showLabels?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface StandardHorizontalStepperProps extends BaseHorizontalStepperProps {
|
|
24
|
+
variant?: 'default';
|
|
25
|
+
color?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface NavbarHorizontalStepperProps extends BaseHorizontalStepperProps {
|
|
28
|
+
variant: 'navbar';
|
|
29
|
+
color?: HorizontalStepperColor;
|
|
30
|
+
}
|
|
31
|
+
export type HorizontalStepperProps = StandardHorizontalStepperProps | NavbarHorizontalStepperProps;
|
|
32
|
+
export {};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { default as HorizontalStepper } from './Horizontal';
|
|
2
2
|
export { default as VerticalStepper } from './Vertical';
|
|
3
|
+
export type { HorizontalStepperProps, HorizontalStepperVariant, HorizontalStepperColor, StandardHorizontalStepperProps, NavbarHorizontalStepperProps, } from './Horizontal';
|
|
@@ -35,6 +35,7 @@ export { default as Tooltip } from './Tooltip';
|
|
|
35
35
|
export { Display, P, Heading, Text, Link } from './Typography';
|
|
36
36
|
export { Toaster } from './Toaster';
|
|
37
37
|
export { HorizontalStepper, VerticalStepper } from './Stepper';
|
|
38
|
+
export type { HorizontalStepperProps, HorizontalStepperVariant, HorizontalStepperColor, StandardHorizontalStepperProps, NavbarHorizontalStepperProps, } from './Stepper';
|
|
38
39
|
export { default as Window } from './Window';
|
|
39
40
|
export { getRelativeTime, formatDateTime } from '../utility';
|
|
40
41
|
export type { DateTimeFormatType } from '../utility';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").ForwardRefExoticComponent<Omit<import("../../components/Button/PropInterfaceButton").ButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
tags: string[];
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
a11y: {
|
|
9
|
+
test: string;
|
|
10
|
+
};
|
|
11
|
+
chromatic: {
|
|
12
|
+
disableSnapshot: boolean;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
args: {
|
|
16
|
+
label: string;
|
|
17
|
+
onClick: import("storybook/test").Mock<(...args: any[]) => any>;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryObj<typeof meta>;
|
|
22
|
+
export declare const ClickCallsOnClick: Story;
|
|
23
|
+
export declare const DisabledDoesNotFire: Story;
|
|
24
|
+
export declare const KeyboardActivates: Story;
|
|
@@ -1,9 +1,128 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { HorizontalStepper } from '../../components
|
|
3
|
-
declare const meta:
|
|
1
|
+
import type { StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { HorizontalStepper } from '../../components';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof HorizontalStepper;
|
|
6
|
+
argTypes: {
|
|
7
|
+
variant: {
|
|
8
|
+
control: "inline-radio";
|
|
9
|
+
options: string[];
|
|
10
|
+
description: string;
|
|
11
|
+
table: {
|
|
12
|
+
defaultValue: {
|
|
13
|
+
summary: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
steps: {
|
|
18
|
+
control: false;
|
|
19
|
+
description: string;
|
|
20
|
+
table: {
|
|
21
|
+
defaultValue: {
|
|
22
|
+
summary: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
activeStep: {
|
|
27
|
+
control: {
|
|
28
|
+
type: "number";
|
|
29
|
+
min: number;
|
|
30
|
+
max: number;
|
|
31
|
+
};
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
className: {
|
|
35
|
+
control: "text";
|
|
36
|
+
description: string;
|
|
37
|
+
table: {
|
|
38
|
+
defaultValue: {
|
|
39
|
+
summary: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
size: {
|
|
44
|
+
control: "radio";
|
|
45
|
+
options: string[];
|
|
46
|
+
description: string;
|
|
47
|
+
table: {
|
|
48
|
+
defaultValue: {
|
|
49
|
+
summary: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
color: {
|
|
54
|
+
control: "select";
|
|
55
|
+
options: string[];
|
|
56
|
+
description: string;
|
|
57
|
+
table: {
|
|
58
|
+
defaultValue: {
|
|
59
|
+
summary: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
showLabels: {
|
|
64
|
+
control: "boolean";
|
|
65
|
+
description: string;
|
|
66
|
+
table: {
|
|
67
|
+
defaultValue: {
|
|
68
|
+
summary: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
processedIcon: {
|
|
73
|
+
control: false;
|
|
74
|
+
description: string;
|
|
75
|
+
table: {
|
|
76
|
+
defaultValue: {
|
|
77
|
+
summary: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
currentIcon: {
|
|
82
|
+
control: false;
|
|
83
|
+
description: string;
|
|
84
|
+
table: {
|
|
85
|
+
defaultValue: {
|
|
86
|
+
summary: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
onStepClick: {
|
|
91
|
+
control: false;
|
|
92
|
+
action: string;
|
|
93
|
+
description: string;
|
|
94
|
+
table: {
|
|
95
|
+
type: {
|
|
96
|
+
summary: string;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
args: {
|
|
102
|
+
variant: "default";
|
|
103
|
+
steps: {
|
|
104
|
+
id: string;
|
|
105
|
+
label: string;
|
|
106
|
+
}[];
|
|
107
|
+
activeStep: number;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
4
110
|
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof
|
|
111
|
+
type Story = StoryObj<typeof meta>;
|
|
6
112
|
export declare const Medium: Story;
|
|
7
113
|
export declare const Small: Story;
|
|
8
114
|
export declare const Interactive: Story;
|
|
9
115
|
export declare const InteractiveCustomIcon: Story;
|
|
116
|
+
export declare const Default: Story;
|
|
117
|
+
export declare const Basic: Story;
|
|
118
|
+
export declare const DefaultVariant: Story;
|
|
119
|
+
export declare const WithColor: Story;
|
|
120
|
+
export declare const WithoutLabels: Story;
|
|
121
|
+
export declare const Navbar: Story;
|
|
122
|
+
export declare const NavbarWithColor: Story;
|
|
123
|
+
export declare const NavbarWithIcons: Story;
|
|
124
|
+
export declare const NavbarWithDisabledSteps: Story;
|
|
125
|
+
export declare const NavbarStatic: Story;
|
|
126
|
+
export declare const NavbarLongLabels: Story;
|
|
127
|
+
export declare const NavbarSimulation: Story;
|
|
128
|
+
export declare const NavbarLockedStepsSimulation: Story;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { HorizontalStepper } from '../../components';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof HorizontalStepper;
|
|
6
|
+
tags: string[];
|
|
7
|
+
parameters: {
|
|
8
|
+
a11y: {
|
|
9
|
+
test: string;
|
|
10
|
+
};
|
|
11
|
+
chromatic: {
|
|
12
|
+
disableSnapshot: boolean;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
args: {
|
|
16
|
+
variant: "default";
|
|
17
|
+
steps: {
|
|
18
|
+
id: string;
|
|
19
|
+
label: string;
|
|
20
|
+
}[];
|
|
21
|
+
activeStep: number;
|
|
22
|
+
onStepClick: import("storybook/test").Mock<(...args: any[]) => any>;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default meta;
|
|
26
|
+
type Story = StoryObj<typeof meta>;
|
|
27
|
+
export declare const DefaultVariantMatchesOmittedVariant: Story;
|
|
28
|
+
export declare const InvalidVariantFallsBackToDefault: Story;
|
|
29
|
+
export declare const NavbarStructure: Story;
|
|
30
|
+
export declare const NavbarClickCallsOnStepClick: Story;
|
|
31
|
+
export declare const NavbarKeyboardActivates: Story;
|
|
32
|
+
export declare const NavbarCurrentStepNotClickable: Story;
|
|
33
|
+
export declare const NavbarDisabledStepsBlockClicks: Story;
|
|
34
|
+
export declare const NavbarCurrentStepIgnoresDisabled: Story;
|
|
35
|
+
export declare const NavbarStaticNoButtons: Story;
|
|
36
|
+
export declare const NavbarIgnoresSizeAndShowLabels: Story;
|
|
37
|
+
export declare const NavbarSimulationClickMovesActiveStep: Story;
|
|
38
|
+
export declare const NavbarLockedStepsSimulationFlow: Story;
|
|
39
|
+
export declare const NavbarEmpty: Story;
|
|
40
|
+
export declare const NavbarOutOfRange: Story;
|
|
41
|
+
export declare const NavbarManySteps: Story;
|
|
42
|
+
export declare const NavbarClassName: Story;
|
|
43
|
+
export declare const StandardIgnoresDisabled: Story;
|
|
44
|
+
export declare const NavbarColorAppliesToCircles: Story;
|
|
45
|
+
export declare const NavbarDefaultColorIsWhite: Story;
|
|
46
|
+
export declare const NavbarColorDisabledIgnoresColor: Story;
|
|
47
|
+
export declare const NavbarInvalidColor: Story;
|
|
48
|
+
export declare const NavbarIcons: Story;
|
|
49
|
+
export declare const NavbarCurrentShowsNumberWithoutIcon: Story;
|
package/dist/esm/index.js
CHANGED
|
@@ -3383,27 +3383,38 @@ var TagLabelInput = forwardRef(TagLabelInputInner);
|
|
|
3383
3383
|
|
|
3384
3384
|
var sizeConfig$4 = {
|
|
3385
3385
|
md: {
|
|
3386
|
-
containerSize: 'w-[
|
|
3387
|
-
|
|
3388
|
-
|
|
3386
|
+
containerSize: 'w-[46px] h-[26px]',
|
|
3387
|
+
trackBorder: 'border-2',
|
|
3388
|
+
knobSize: 'size-[18px]',
|
|
3389
|
+
knobInset: 'mx-[4px]',
|
|
3390
|
+
labelClass: 'text-size-base',
|
|
3389
3391
|
},
|
|
3390
3392
|
sm: {
|
|
3391
|
-
containerSize: 'w-[
|
|
3392
|
-
|
|
3393
|
-
|
|
3393
|
+
containerSize: 'w-[32px] h-[20px]',
|
|
3394
|
+
trackBorder: 'border-2',
|
|
3395
|
+
knobSize: 'size-[12px]',
|
|
3396
|
+
knobInset: 'mx-[4px]',
|
|
3397
|
+
labelClass: 'text-size-sm',
|
|
3398
|
+
},
|
|
3399
|
+
tn: {
|
|
3400
|
+
containerSize: 'w-[22.4px] h-[14px]',
|
|
3401
|
+
trackBorder: 'border-[1.5px]',
|
|
3402
|
+
knobSize: 'size-[8.4px]',
|
|
3403
|
+
knobInset: 'mx-[2.8px]',
|
|
3404
|
+
labelClass: 'text-size-sm',
|
|
3394
3405
|
},
|
|
3395
3406
|
};
|
|
3396
3407
|
|
|
3397
3408
|
function Toggle(_a) {
|
|
3398
3409
|
var _b = _a.label, label = _b === void 0 ? '' : _b, _c = _a.size, size = _c === void 0 ? 'md' : _c, _d = _a.onClick, onClick = _d === void 0 ? function () { } : _d, _e = _a.checked, checked = _e === void 0 ? false : _e, _f = _a.id, id = _f === void 0 ? '' : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g;
|
|
3399
|
-
var _h = sizeConfig$4[size], containerSize = _h.containerSize,
|
|
3410
|
+
var _h = sizeConfig$4[size], containerSize = _h.containerSize, trackBorder = _h.trackBorder, knobSize = _h.knobSize, knobInset = _h.knobInset, labelClass = _h.labelClass;
|
|
3400
3411
|
var checkedClass = checked ? 'justify-end' : 'justify-start';
|
|
3401
3412
|
var containerClass = "".concat(checkedClass, " ").concat(containerSize);
|
|
3402
3413
|
return (React.createElement("div", { className: "flex items-center" },
|
|
3403
|
-
React.createElement("div", { className: "relative flex flex-shrink-0 cursor-pointer items-center rounded-full
|
|
3404
|
-
React.createElement("input", { id: id, checked: checked, disabled: disabled, className: "
|
|
3405
|
-
React.createElement("div", { className: "check-icon group peer z-10
|
|
3406
|
-
React.createElement("label", { htmlFor: id, className: "
|
|
3414
|
+
React.createElement("div", { className: "relative flex flex-shrink-0 cursor-pointer items-center rounded-full ".concat(containerClass), onClick: onClick },
|
|
3415
|
+
React.createElement("input", { id: id, checked: checked, disabled: disabled, className: "checkbox peer absolute h-full w-full cursor-pointer appearance-none rounded-full border-bia-grey bg-primary-white opacity-100 checked:border-bia-blue checked:bg-bia-blue hover:border-bia-blue-hover checked:hover:bg-bia-blue-hover focus:outline-none focus-visible:ring-1 focus-visible:ring-bia-blue focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:border-none disabled:bg-bia-grey-light-80 disabled:checked:bg-bia-blue-light-50 peer-hover:border-bia-blue-hover ".concat(trackBorder), type: "checkbox" }),
|
|
3416
|
+
React.createElement("div", { className: "check-icon group peer z-10 flex-shrink-0 rounded-full bg-bia-grey text-bia-grey peer-checked:bg-primary-white peer-checked:hover:bg-primary-white peer-hover:bg-bia-blue-hover peer-checked:peer-hover:bg-primary-white peer-disabled:cursor-not-allowed peer-disabled:bg-bia-grey-dark-10 peer-disabled:peer-checked:bg-bia-blue-light-90 ".concat(knobSize, " ").concat(knobInset) })),
|
|
3417
|
+
React.createElement("label", { htmlFor: id, className: "ml-2 font-normal leading-4 text-bia-black ".concat(labelClass), style: { color: disabled ? '#8C8CA6' : '' } }, label)));
|
|
3407
3418
|
}
|
|
3408
3419
|
|
|
3409
3420
|
var isSelectedConfig = {
|
|
@@ -9235,7 +9246,7 @@ function cn() {
|
|
|
9235
9246
|
}
|
|
9236
9247
|
return twMerge(clsx(inputs));
|
|
9237
9248
|
}
|
|
9238
|
-
function
|
|
9249
|
+
function StandardHorizontalStepper(_a) {
|
|
9239
9250
|
var steps = _a.steps, activeStep = _a.activeStep, _b = _a.size, size = _b === void 0 ? 'md' : _b, _c = _a.className, className = _c === void 0 ? '' : _c, _d = _a.onStepClick, onStepClick = _d === void 0 ? undefined : _d, _e = _a.processedIcon, processedIcon = _e === void 0 ? undefined : _e, _f = _a.currentIcon, currentIcon = _f === void 0 ? undefined : _f, _g = _a.color, color = _g === void 0 ? 'blue' : _g, _h = _a.showLabels, showLabels = _h === void 0 ? true : _h;
|
|
9240
9251
|
var isSmall = size === 'sm';
|
|
9241
9252
|
var connectorColor = "bg-bia-".concat(color);
|
|
@@ -9285,6 +9296,154 @@ function HorizontalStepper(_a) {
|
|
|
9285
9296
|
})));
|
|
9286
9297
|
}
|
|
9287
9298
|
|
|
9299
|
+
var navbarItemConfig = {
|
|
9300
|
+
current: 'cursor-default',
|
|
9301
|
+
clickable: 'cursor-pointer hover:bg-bia-white/15 active:bg-bia-white-transparent-80 focus-visible:outline focus-visible:outline-[3px] focus-visible:outline-offset-0 focus-visible:outline-bia-blue-light-50',
|
|
9302
|
+
static: 'cursor-default',
|
|
9303
|
+
disabled: 'cursor-default',
|
|
9304
|
+
};
|
|
9305
|
+
var navbarCircleConfig = {
|
|
9306
|
+
currentDefault: 'bg-bia-white border-bia-white text-bia-black',
|
|
9307
|
+
other: 'border-bia-white text-bia-white',
|
|
9308
|
+
disabled: 'border-bia-white-transparent-40 text-bia-white-transparent-40',
|
|
9309
|
+
};
|
|
9310
|
+
var navbarCurrentColorConfig = {
|
|
9311
|
+
blue: 'bg-bia-blue border-bia-blue text-bia-white',
|
|
9312
|
+
green: 'bg-bia-green border-bia-green text-bia-white',
|
|
9313
|
+
teal: 'bg-bia-teal border-bia-teal text-bia-white',
|
|
9314
|
+
crayola: 'bg-bia-crayola border-bia-crayola text-bia-white',
|
|
9315
|
+
orange: 'bg-bia-orange border-bia-orange text-bia-white',
|
|
9316
|
+
red: 'bg-bia-red border-bia-red text-bia-white',
|
|
9317
|
+
};
|
|
9318
|
+
var navbarProcessedColorConfig = {
|
|
9319
|
+
blue: 'border-bia-blue text-bia-white',
|
|
9320
|
+
green: 'border-bia-green text-bia-white',
|
|
9321
|
+
teal: 'border-bia-teal text-bia-white',
|
|
9322
|
+
crayola: 'border-bia-crayola text-bia-white',
|
|
9323
|
+
orange: 'border-bia-orange text-bia-white',
|
|
9324
|
+
red: 'border-bia-red text-bia-white',
|
|
9325
|
+
};
|
|
9326
|
+
var navbarProcessedFilledColorConfig = {
|
|
9327
|
+
blue: 'bg-bia-blue border-bia-blue text-bia-white',
|
|
9328
|
+
green: 'bg-bia-green border-bia-green text-bia-white',
|
|
9329
|
+
teal: 'bg-bia-teal border-bia-teal text-bia-white',
|
|
9330
|
+
crayola: 'bg-bia-crayola border-bia-crayola text-bia-white',
|
|
9331
|
+
orange: 'bg-bia-orange border-bia-orange text-bia-white',
|
|
9332
|
+
red: 'bg-bia-red border-bia-red text-bia-white',
|
|
9333
|
+
};
|
|
9334
|
+
var navbarLabelConfig = {
|
|
9335
|
+
enabled: 'whitespace-nowrap leading-4 text-bia-white',
|
|
9336
|
+
disabled: 'whitespace-nowrap leading-4 text-bia-white-transparent-40',
|
|
9337
|
+
};
|
|
9338
|
+
var navbarChevronConfig = {
|
|
9339
|
+
enabled: 'shrink-0 text-bia-white',
|
|
9340
|
+
disabled: 'shrink-0 text-bia-white-transparent-40',
|
|
9341
|
+
};
|
|
9342
|
+
|
|
9343
|
+
var NAVBAR_COLORS = [
|
|
9344
|
+
'blue',
|
|
9345
|
+
'green',
|
|
9346
|
+
'teal',
|
|
9347
|
+
'crayola',
|
|
9348
|
+
'orange',
|
|
9349
|
+
'red',
|
|
9350
|
+
];
|
|
9351
|
+
var circleTextColor = function (circleClass) { var _a, _b; return (_b = (_a = circleClass.match(/text-bia-\S+/)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : ''; };
|
|
9352
|
+
function resolveItemState(isCurrent, isDisabled, isClickable) {
|
|
9353
|
+
if (isCurrent)
|
|
9354
|
+
return 'current';
|
|
9355
|
+
if (isDisabled)
|
|
9356
|
+
return 'disabled';
|
|
9357
|
+
if (isClickable)
|
|
9358
|
+
return 'clickable';
|
|
9359
|
+
return 'static';
|
|
9360
|
+
}
|
|
9361
|
+
function resolveCircleClass(isCurrent, isDisabled, isProcessed, navColor, processedIcon) {
|
|
9362
|
+
if (isCurrent) {
|
|
9363
|
+
if (navColor)
|
|
9364
|
+
return navbarCurrentColorConfig[navColor];
|
|
9365
|
+
return navbarCircleConfig.currentDefault;
|
|
9366
|
+
}
|
|
9367
|
+
if (isDisabled)
|
|
9368
|
+
return navbarCircleConfig.disabled;
|
|
9369
|
+
if (isProcessed && navColor) {
|
|
9370
|
+
if (processedIcon)
|
|
9371
|
+
return navbarProcessedFilledColorConfig[navColor];
|
|
9372
|
+
return navbarProcessedColorConfig[navColor];
|
|
9373
|
+
}
|
|
9374
|
+
return navbarCircleConfig.other;
|
|
9375
|
+
}
|
|
9376
|
+
function resolveCircleContent(step, index, isProcessed, isCurrent, processedIcon, currentIcon, circleClass) {
|
|
9377
|
+
if (step.icon)
|
|
9378
|
+
return step.icon;
|
|
9379
|
+
if (isProcessed && processedIcon)
|
|
9380
|
+
return processedIcon;
|
|
9381
|
+
if (isCurrent && currentIcon)
|
|
9382
|
+
return currentIcon;
|
|
9383
|
+
return (React.createElement(Text, { variant: "tiny-text", className: "leading-none ".concat(circleTextColor(circleClass)) }, index + 1));
|
|
9384
|
+
}
|
|
9385
|
+
function NavbarHorizontalStepper(_a) {
|
|
9386
|
+
var steps = _a.steps, activeStep = _a.activeStep, _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.onStepClick, onStepClick = _c === void 0 ? undefined : _c, _d = _a.color, color = _d === void 0 ? undefined : _d, _e = _a.processedIcon, processedIcon = _e === void 0 ? undefined : _e, _f = _a.currentIcon, currentIcon = _f === void 0 ? undefined : _f;
|
|
9387
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9388
|
+
_a.size;
|
|
9389
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9390
|
+
_a.showLabels;
|
|
9391
|
+
// size and showLabels are accepted for API parity, ignored on navbar
|
|
9392
|
+
var navColor = color === undefined
|
|
9393
|
+
? undefined
|
|
9394
|
+
: validUnion(color, NAVBAR_COLORS);
|
|
9395
|
+
return (React.createElement("nav", { "aria-label": "Progress", className: cn$1('flex', className) },
|
|
9396
|
+
React.createElement("ol", { className: "flex items-center" }, steps.map(function (step, index) {
|
|
9397
|
+
var _a;
|
|
9398
|
+
var isCurrent = index === activeStep;
|
|
9399
|
+
var isProcessed = index < activeStep;
|
|
9400
|
+
var isDisabled = !isCurrent && Boolean(step.disabled);
|
|
9401
|
+
var isClickable = !isCurrent && !isDisabled && Boolean(onStepClick);
|
|
9402
|
+
var itemState = resolveItemState(isCurrent, isDisabled, isClickable);
|
|
9403
|
+
var itemClass = cn$1('flex h-6 items-center gap-[5px] px-[5px] py-[3px]', !isCurrent && 'rounded-radius-sm', navbarItemConfig[itemState]);
|
|
9404
|
+
var circleClass = resolveCircleClass(isCurrent, isDisabled, isProcessed, navColor, processedIcon);
|
|
9405
|
+
var labelClass = isDisabled
|
|
9406
|
+
? navbarLabelConfig.disabled
|
|
9407
|
+
: navbarLabelConfig.enabled;
|
|
9408
|
+
var isChevronDisabled = !isCurrent && Boolean(step.disabled);
|
|
9409
|
+
var circleContent = resolveCircleContent(step, index, isProcessed, isCurrent, processedIcon, currentIcon, circleClass);
|
|
9410
|
+
var circle = (React.createElement("span", { className: cn$1('flex size-5 min-w-5 shrink-0 items-center justify-center rounded-full border px-[5px] py-px text-size-tiny', circleClass) }, circleContent));
|
|
9411
|
+
var label = step.label ? (React.createElement(Text, { variant: "tiny-text", className: labelClass }, step.label)) : null;
|
|
9412
|
+
var content = (React.createElement(React.Fragment, null,
|
|
9413
|
+
circle,
|
|
9414
|
+
label));
|
|
9415
|
+
var stepElement;
|
|
9416
|
+
if (isCurrent) {
|
|
9417
|
+
stepElement = (React.createElement("span", { "aria-current": "step", className: itemClass }, content));
|
|
9418
|
+
}
|
|
9419
|
+
else if (isClickable) {
|
|
9420
|
+
stepElement = (React.createElement("button", { type: "button", onClick: function () { return onStepClick === null || onStepClick === void 0 ? void 0 : onStepClick(index); }, className: itemClass }, content));
|
|
9421
|
+
}
|
|
9422
|
+
else if (isDisabled && onStepClick) {
|
|
9423
|
+
stepElement = (React.createElement("button", { type: "button", disabled: true, className: itemClass }, content));
|
|
9424
|
+
}
|
|
9425
|
+
else {
|
|
9426
|
+
stepElement = React.createElement("span", { className: itemClass }, content);
|
|
9427
|
+
}
|
|
9428
|
+
return (React.createElement("li", { key: (_a = step.id) !== null && _a !== void 0 ? _a : index, className: "flex items-center" },
|
|
9429
|
+
index > 0 && (React.createElement(TbChevronRight, { size: 14, "aria-hidden": "true", className: isChevronDisabled
|
|
9430
|
+
? navbarChevronConfig.disabled
|
|
9431
|
+
: navbarChevronConfig.enabled })),
|
|
9432
|
+
stepElement));
|
|
9433
|
+
}))));
|
|
9434
|
+
}
|
|
9435
|
+
|
|
9436
|
+
var VARIANT_UNION = ['default', 'navbar'];
|
|
9437
|
+
function HorizontalStepper(props) {
|
|
9438
|
+
var variant = props.variant, rest = __rest(props, ["variant"]);
|
|
9439
|
+
switch (validUnion(variant, VARIANT_UNION)) {
|
|
9440
|
+
case 'navbar':
|
|
9441
|
+
return (React.createElement(NavbarHorizontalStepper, __assign({}, rest)));
|
|
9442
|
+
default:
|
|
9443
|
+
return (React.createElement(StandardHorizontalStepper, __assign({}, rest)));
|
|
9444
|
+
}
|
|
9445
|
+
}
|
|
9446
|
+
|
|
9288
9447
|
var variantConfig = {
|
|
9289
9448
|
upcoming: 'bg-white border-2 border-coolgrey-light-50',
|
|
9290
9449
|
processed: 'bg-white border-2 border-bia-blue',
|