idea-react 3.0.0-beta.0 → 3.0.0-beta.2
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/AGENTS.md +19 -2
- package/ReadMe.md +95 -54
- package/dist/DatePickerPlugin-CpGuQRsi.js +1 -0
- package/dist/DatePickerPlugin-DB3nnslN.mjs +1 -0
- package/dist/index.d.mts +1232 -474
- package/dist/index.d.ts +1232 -474
- package/dist/index.js +16 -16
- package/dist/index.mjs +15 -15
- package/dist/rolldown-runtime-5iZMYShA.js +1 -0
- package/dist/style.css +66 -66
- package/package.json +1 -1
- package/source/Accordion.tsx +161 -0
- package/source/Alert.tsx +153 -0
- package/source/Avatar.tsx +57 -46
- package/source/Badge.tsx +17 -15
- package/source/Breadcrumb.tsx +50 -0
- package/source/Button.tsx +69 -40
- package/source/ButtonGroup.tsx +23 -18
- package/source/Card.tsx +86 -17
- package/source/Carousel/index.tsx +392 -0
- package/source/Carousel/model.ts +113 -0
- package/source/Carousel/scroll.ts +79 -0
- package/source/CloseButton.tsx +20 -15
- package/source/Collapse.tsx +233 -0
- package/source/Drawer.tsx +158 -38
- package/source/{ClickBoundary.tsx → Extension/ClickBoundary.tsx} +24 -5
- package/source/Extension/CodeBlock.tsx +64 -0
- package/source/{Countdown.tsx → Extension/Countdown.tsx} +21 -9
- package/source/{Dialog.tsx → Extension/Dialog.tsx} +10 -6
- package/source/Extension/Editor.tsx +78 -0
- package/source/Extension/EditorHTML.tsx +20 -0
- package/source/{HorizontalMarquee → Extension/HorizontalMarquee}/index.module.less +1 -3
- package/source/Extension/HorizontalMarquee/index.tsx +85 -0
- package/source/Extension/Icon.tsx +19 -0
- package/source/Extension/Loading.tsx +30 -0
- package/source/{MonthCalendar.tsx → Extension/MonthCalendar.tsx} +29 -13
- package/source/{Nameplate.tsx → Extension/Nameplate.tsx} +1 -1
- package/source/Extension/OverlayBox.tsx +293 -0
- package/source/{PageNav.tsx → Extension/PageNav.tsx} +43 -16
- package/source/{ScrollNav → Extension/ScrollNav}/Scroller.tsx +21 -5
- package/source/Extension/ScrollNav/index.tsx +47 -0
- package/source/Extension/Select.tsx +128 -0
- package/source/{ShareBox.tsx → Extension/ShareBox.tsx} +1 -1
- package/source/Extension/SpinnerButton.tsx +30 -0
- package/source/Extension/TableSpinner.tsx +22 -0
- package/source/Extension/TextTruncate/index.tsx +29 -0
- package/source/Extension/Time.tsx +17 -0
- package/source/Extension/TimeDistance.tsx +45 -0
- package/source/Extension/Timeline/index.tsx +63 -0
- package/source/Extension/TypeEcho/Content.tsx +123 -0
- package/source/Extension/TypeEcho/index.tsx +22 -0
- package/source/Extension/UserRank/Address.tsx +22 -0
- package/source/Extension/UserRank/index.tsx +106 -0
- package/source/Extension/VerticalMarquee/index.tsx +23 -0
- package/source/Extension/ZodiacBar.tsx +59 -0
- package/source/Extension/index.ts +27 -0
- package/source/Form/Adorn.tsx +45 -26
- package/source/Form/Checkbox.tsx +20 -11
- package/source/Form/ChipInput.tsx +129 -0
- package/source/Form/Chips.tsx +57 -37
- package/source/Form/Combobox.tsx +362 -78
- package/source/Form/Control.tsx +72 -42
- package/source/Form/DatePicker.tsx +245 -45
- package/source/Form/DatePickerPlugin.ts +37 -0
- package/source/Form/Feedback.tsx +21 -16
- package/source/Form/FloatingLabel.tsx +21 -7
- package/source/Form/InputGroup.tsx +162 -11
- package/source/Form/OTP.tsx +156 -45
- package/source/Form/PasswordStrength.tsx +43 -17
- package/source/Form/Plugin.tsx +53 -0
- package/source/Form/Primitives.tsx +70 -20
- package/source/Form/Radio.tsx +35 -40
- package/source/Form/Range.tsx +125 -56
- package/source/Form/Switch.tsx +53 -27
- package/source/Form/index.ts +1 -0
- package/source/Grid.tsx +68 -56
- package/source/Image.tsx +10 -6
- package/source/ListGroup.tsx +59 -58
- package/source/Menu.tsx +317 -46
- package/source/NativeDialog/index.tsx +148 -22
- package/source/Nav.tsx +49 -33
- package/source/NavOverflow/index.tsx +323 -0
- package/source/NavOverflow/model.ts +21 -0
- package/source/Navbar.tsx +65 -45
- package/source/Overlay.ts +163 -1
- package/source/Pagination.tsx +86 -0
- package/source/Placeholder.tsx +70 -0
- package/source/Polymorphic.ts +57 -0
- package/source/Popover.tsx +34 -26
- package/source/Progress/index.tsx +81 -0
- package/source/Progress/style.module.css +15 -0
- package/source/ScrollSpy/index.tsx +380 -0
- package/source/ScrollSpy/model.ts +17 -0
- package/source/Spinner.tsx +31 -17
- package/source/Stack.tsx +25 -0
- package/source/Stepper.tsx +91 -0
- package/source/Tab.tsx +261 -0
- package/source/Table.tsx +53 -42
- package/source/Toast.tsx +93 -46
- package/source/ToggleButton.tsx +47 -30
- package/source/Toggler.tsx +117 -0
- package/source/Tooltip.tsx +31 -24
- package/source/index.ts +17 -27
- package/source/CodeBlock.tsx +0 -40
- package/source/Editor.tsx +0 -43
- package/source/EditorHTML.tsx +0 -16
- package/source/HorizontalMarquee/index.tsx +0 -61
- package/source/Icon.tsx +0 -24
- package/source/Loading.tsx +0 -22
- package/source/OverlayBox.tsx +0 -208
- package/source/ScrollNav/index.tsx +0 -22
- package/source/Select.tsx +0 -95
- package/source/SpinnerButton.tsx +0 -35
- package/source/TableSpinner.tsx +0 -26
- package/source/TextTruncate/index.tsx +0 -25
- package/source/Time.tsx +0 -15
- package/source/TimeDistance.tsx +0 -41
- package/source/Timeline/index.tsx +0 -60
- package/source/TypeEcho/Content.tsx +0 -58
- package/source/TypeEcho/index.tsx +0 -14
- package/source/UserRank/Address.tsx +0 -20
- package/source/UserRank/index.tsx +0 -111
- package/source/VerticalMarquee/index.tsx +0 -25
- package/source/ZodiacBar.tsx +0 -51
- /package/source/{LiveTSX.tsx → Extension/LiveTSX.tsx} +0 -0
- /package/source/{ScrollNav → Extension/ScrollNav}/index.module.less +0 -0
- /package/source/{TextTruncate → Extension/TextTruncate}/Content.tsx +0 -0
- /package/source/{Timeline → Extension/Timeline}/index.module.less +0 -0
- /package/source/{UserRank → Extension/UserRank}/index.module.less +0 -0
- /package/source/{VerticalMarquee → Extension/VerticalMarquee}/index.module.less +0 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { cloneElement, ComponentPropsWithRef, isValidElement } from 'react';
|
|
3
|
+
|
|
4
|
+
import { ComponentTheme } from './Button';
|
|
5
|
+
import { polymorphic } from './Polymorphic';
|
|
6
|
+
|
|
7
|
+
export interface PaginationProps extends ComponentPropsWithRef<'ul'> {
|
|
8
|
+
theme?: ComponentTheme;
|
|
9
|
+
size?: 'sm' | 'lg';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const Pagination = polymorphic<PaginationProps>(
|
|
13
|
+
({ as: Root = 'ul', theme, size, className, ...props }) => (
|
|
14
|
+
<Root
|
|
15
|
+
{...props}
|
|
16
|
+
className={classNames(
|
|
17
|
+
'pagination',
|
|
18
|
+
theme && `theme-${theme}`,
|
|
19
|
+
size && `pagination-${size}`,
|
|
20
|
+
className
|
|
21
|
+
)}
|
|
22
|
+
/>
|
|
23
|
+
)
|
|
24
|
+
);
|
|
25
|
+
Pagination.displayName = 'Pagination';
|
|
26
|
+
|
|
27
|
+
type PageState = Partial<Record<'active' | 'disabled', boolean>>;
|
|
28
|
+
|
|
29
|
+
export type PageItemProps = ComponentPropsWithRef<'li'> & PageState;
|
|
30
|
+
|
|
31
|
+
export const PageItem = polymorphic<PageItemProps>(
|
|
32
|
+
({ as: Root = 'li', active, disabled, className, children, ...props }) => {
|
|
33
|
+
const child =
|
|
34
|
+
isValidElement<PageLinkProps>(children) && children.type === PageLink
|
|
35
|
+
? cloneElement(children, {
|
|
36
|
+
active: children.props.active ?? active,
|
|
37
|
+
disabled: children.props.disabled ?? disabled
|
|
38
|
+
})
|
|
39
|
+
: children;
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Root {...props} className={classNames('page-item', { active, disabled }, className)}>
|
|
43
|
+
{child}
|
|
44
|
+
</Root>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
PageItem.displayName = 'PageItem';
|
|
49
|
+
|
|
50
|
+
export type PageLinkProps = ComponentPropsWithRef<'a'> & PageState;
|
|
51
|
+
|
|
52
|
+
export const PageLink = polymorphic<PageLinkProps>(
|
|
53
|
+
({
|
|
54
|
+
as: RootAs,
|
|
55
|
+
active,
|
|
56
|
+
disabled,
|
|
57
|
+
className,
|
|
58
|
+
href,
|
|
59
|
+
tabIndex,
|
|
60
|
+
onClick,
|
|
61
|
+
'aria-current': current,
|
|
62
|
+
...props
|
|
63
|
+
}) => {
|
|
64
|
+
const Root = RootAs ?? (href === undefined ? 'span' : 'a');
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<Root
|
|
68
|
+
{...props}
|
|
69
|
+
className={classNames('page-link', className)}
|
|
70
|
+
href={disabled ? undefined : href}
|
|
71
|
+
tabIndex={disabled ? -1 : tabIndex}
|
|
72
|
+
aria-disabled={disabled || undefined}
|
|
73
|
+
aria-current={current ?? (active ? 'page' : undefined)}
|
|
74
|
+
onClick={disabled ? undefined : onClick}
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
PageLink.displayName = 'PageLink';
|
|
80
|
+
|
|
81
|
+
export const PageText = polymorphic<ComponentPropsWithRef<'span'>>(
|
|
82
|
+
({ as: Root = 'span', className, ...props }) => (
|
|
83
|
+
<Root {...props} className={classNames('page-link', className)} />
|
|
84
|
+
)
|
|
85
|
+
);
|
|
86
|
+
PageText.displayName = 'PageText';
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { ComponentPropsWithRef, CSSProperties } from 'react';
|
|
3
|
+
|
|
4
|
+
import { Button, ButtonProps, ComponentTheme } from './Button';
|
|
5
|
+
import { polymorphic } from './Polymorphic';
|
|
6
|
+
|
|
7
|
+
export interface PlaceholderProps extends ComponentPropsWithRef<'span'> {
|
|
8
|
+
size?: 'xs' | 'sm' | 'lg';
|
|
9
|
+
animation?: 'wave' | 'pulse' | 'glow';
|
|
10
|
+
theme?: ComponentTheme;
|
|
11
|
+
width?: CSSProperties['width'];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const Placeholder = polymorphic<PlaceholderProps>(
|
|
15
|
+
({
|
|
16
|
+
as: Root = 'span',
|
|
17
|
+
size,
|
|
18
|
+
animation,
|
|
19
|
+
theme,
|
|
20
|
+
width,
|
|
21
|
+
className,
|
|
22
|
+
style,
|
|
23
|
+
'aria-hidden': hidden = true,
|
|
24
|
+
...props
|
|
25
|
+
}) => (
|
|
26
|
+
<Root
|
|
27
|
+
{...props}
|
|
28
|
+
className={classNames(
|
|
29
|
+
'placeholder',
|
|
30
|
+
size && `placeholder-${size}`,
|
|
31
|
+
animation && `placeholder-${animation}`,
|
|
32
|
+
theme && `bg-${theme}`,
|
|
33
|
+
className
|
|
34
|
+
)}
|
|
35
|
+
style={{ width, ...style }}
|
|
36
|
+
aria-hidden={hidden}
|
|
37
|
+
/>
|
|
38
|
+
)
|
|
39
|
+
);
|
|
40
|
+
Placeholder.displayName = 'Placeholder';
|
|
41
|
+
|
|
42
|
+
export interface PlaceholderAnimationProps extends ComponentPropsWithRef<'div'> {
|
|
43
|
+
animation?: PlaceholderProps['animation'];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const PlaceholderAnimation = polymorphic<PlaceholderAnimationProps>(
|
|
47
|
+
({ as: Root = 'div', animation = 'wave', className, ...props }) => (
|
|
48
|
+
<Root
|
|
49
|
+
{...props}
|
|
50
|
+
className={classNames(`placeholder-${animation}`, className)}
|
|
51
|
+
aria-hidden="true"
|
|
52
|
+
/>
|
|
53
|
+
)
|
|
54
|
+
);
|
|
55
|
+
PlaceholderAnimation.displayName = 'PlaceholderAnimation';
|
|
56
|
+
|
|
57
|
+
export type PlaceholderButtonProps = ButtonProps;
|
|
58
|
+
|
|
59
|
+
export const PlaceholderButton = polymorphic<PlaceholderButtonProps>(
|
|
60
|
+
({ as: RootAs, className, ...props }) => (
|
|
61
|
+
<Button
|
|
62
|
+
as={RootAs}
|
|
63
|
+
{...props}
|
|
64
|
+
className={classNames('placeholder', className)}
|
|
65
|
+
aria-hidden="true"
|
|
66
|
+
disabled
|
|
67
|
+
/>
|
|
68
|
+
)
|
|
69
|
+
);
|
|
70
|
+
PlaceholderButton.displayName = 'PlaceholderButton';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ComponentPropsWithRef, ElementType, FC, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface AsProps<T extends ElementType = ElementType> {
|
|
4
|
+
as?: T;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
type RequiredKeys<T> = {
|
|
8
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? never : K;
|
|
9
|
+
}[keyof T];
|
|
10
|
+
|
|
11
|
+
type TargetProps<T, P extends object> = T extends unknown
|
|
12
|
+
? Omit<T, keyof P | 'as'> & Pick<T, Extract<RequiredKeys<T>, keyof P>>
|
|
13
|
+
: never;
|
|
14
|
+
|
|
15
|
+
type ReadonlyTargetProps<T, P extends object> = T extends unknown
|
|
16
|
+
? Readonly<TargetProps<T, P>>
|
|
17
|
+
: never;
|
|
18
|
+
|
|
19
|
+
type PolymorphicRef<T extends ElementType> = T extends unknown
|
|
20
|
+
? 'ref' extends keyof ComponentPropsWithRef<T>
|
|
21
|
+
? ComponentPropsWithRef<T>['ref']
|
|
22
|
+
: never
|
|
23
|
+
: never;
|
|
24
|
+
|
|
25
|
+
export type PolymorphicProps<T extends ElementType, P extends object = {}> = P extends unknown
|
|
26
|
+
? Omit<P, 'as' | 'ref'> &
|
|
27
|
+
TargetProps<ComponentPropsWithRef<T>, P> & {
|
|
28
|
+
ref?: NoInfer<PolymorphicRef<T>>;
|
|
29
|
+
} & AsProps<T>
|
|
30
|
+
: never;
|
|
31
|
+
|
|
32
|
+
export type PolymorphicClassProps<
|
|
33
|
+
T extends ElementType | undefined,
|
|
34
|
+
P extends object = {}
|
|
35
|
+
> = P extends unknown
|
|
36
|
+
? Readonly<Omit<P, 'as' | 'ref'> & { as?: T }> &
|
|
37
|
+
NoInfer<
|
|
38
|
+
[T] extends [undefined]
|
|
39
|
+
? {}
|
|
40
|
+
: ReadonlyTargetProps<ComponentPropsWithoutRef<Exclude<T, undefined>>, P>
|
|
41
|
+
>
|
|
42
|
+
: never;
|
|
43
|
+
|
|
44
|
+
export interface PolymorphicComponent<P extends object> {
|
|
45
|
+
<T extends ElementType | undefined>(
|
|
46
|
+
props: { as: T } & ([T] extends [undefined]
|
|
47
|
+
? P
|
|
48
|
+
: NoInfer<PolymorphicProps<Exclude<T, undefined>, P>>)
|
|
49
|
+
): ReactNode;
|
|
50
|
+
(props: P & { as?: never }): ReactNode;
|
|
51
|
+
displayName?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Preserve the component's identity and lifecycle; only its public call signature changes.
|
|
55
|
+
export const polymorphic = <P extends object>(
|
|
56
|
+
component: FC<P & AsProps>
|
|
57
|
+
): PolymorphicComponent<P> => component as PolymorphicComponent<P>;
|
package/source/Popover.tsx
CHANGED
|
@@ -1,36 +1,44 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import {
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
import { OVERLAY_ARROW_POSITIONS, OVERLAY_DIRECTIONS, OverlayTriggerProps } from './Overlay';
|
|
5
|
+
import { polymorphic } from './Polymorphic';
|
|
5
6
|
|
|
6
7
|
export interface PopoverProps extends Omit<OverlayTriggerProps, 'title'> {
|
|
7
8
|
title?: ReactNode;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
export const Popover
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
11
|
+
export const Popover = polymorphic<PopoverProps>(
|
|
12
|
+
({
|
|
13
|
+
as: Root = 'div',
|
|
14
|
+
title,
|
|
15
|
+
placement = 'top',
|
|
16
|
+
show = true,
|
|
17
|
+
role = 'tooltip',
|
|
18
|
+
className,
|
|
19
|
+
children,
|
|
20
|
+
arrowStyle,
|
|
21
|
+
...props
|
|
22
|
+
}) => (
|
|
23
|
+
<Root
|
|
24
|
+
{...props}
|
|
25
|
+
className={classNames(
|
|
26
|
+
'popover',
|
|
27
|
+
{ show },
|
|
28
|
+
`bs-popover-${OVERLAY_DIRECTIONS[placement]}`,
|
|
29
|
+
className
|
|
30
|
+
)}
|
|
31
|
+
role={role}
|
|
32
|
+
hidden={!show}
|
|
33
|
+
data-bs-placement={placement}
|
|
34
|
+
>
|
|
35
|
+
<div
|
|
36
|
+
style={arrowStyle}
|
|
37
|
+
className={classNames('popover-arrow', OVERLAY_ARROW_POSITIONS[placement])}
|
|
38
|
+
/>
|
|
39
|
+
{title != null && <h3 className="popover-header">{title}</h3>}
|
|
40
|
+
<div className="popover-body">{children}</div>
|
|
41
|
+
</Root>
|
|
42
|
+
)
|
|
34
43
|
);
|
|
35
|
-
|
|
36
44
|
Popover.displayName = 'Popover';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import './style.module.css';
|
|
2
|
+
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { ComponentPropsWithRef, CSSProperties } from 'react';
|
|
5
|
+
|
|
6
|
+
import { ComponentTheme } from '../Button';
|
|
7
|
+
import { polymorphic } from '../Polymorphic';
|
|
8
|
+
|
|
9
|
+
export interface ProgressProps extends ComponentPropsWithRef<'div'> {
|
|
10
|
+
value: number;
|
|
11
|
+
min?: number;
|
|
12
|
+
max?: number;
|
|
13
|
+
theme?: ComponentTheme;
|
|
14
|
+
striped?: boolean;
|
|
15
|
+
animated?: boolean;
|
|
16
|
+
barProps?: ComponentPropsWithRef<'div'>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const Progress = polymorphic<ProgressProps>(
|
|
20
|
+
({
|
|
21
|
+
as: Root = 'div',
|
|
22
|
+
value,
|
|
23
|
+
min = 0,
|
|
24
|
+
max = 100,
|
|
25
|
+
theme,
|
|
26
|
+
striped,
|
|
27
|
+
animated,
|
|
28
|
+
barProps = {},
|
|
29
|
+
className,
|
|
30
|
+
style,
|
|
31
|
+
children,
|
|
32
|
+
...props
|
|
33
|
+
}) => {
|
|
34
|
+
if (![value, min, max].every(Number.isFinite) || max <= min)
|
|
35
|
+
throw new RangeError('Progress requires finite values and max greater than min');
|
|
36
|
+
|
|
37
|
+
const current = Math.min(max, Math.max(min, value));
|
|
38
|
+
const width = `${((current - min) / (max - min)) * 100}%`;
|
|
39
|
+
const progressStyle: CSSProperties & { '--_progress-width': string } = {
|
|
40
|
+
...style,
|
|
41
|
+
'--_progress-width': width
|
|
42
|
+
};
|
|
43
|
+
const { className: barClass, style: barStyle, ...barAttributes } = barProps;
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<Root
|
|
47
|
+
{...props}
|
|
48
|
+
className={classNames('progress', className)}
|
|
49
|
+
style={progressStyle}
|
|
50
|
+
role="progressbar"
|
|
51
|
+
aria-valuenow={current}
|
|
52
|
+
aria-valuemin={min}
|
|
53
|
+
aria-valuemax={max}
|
|
54
|
+
>
|
|
55
|
+
<div
|
|
56
|
+
{...barAttributes}
|
|
57
|
+
className={classNames(
|
|
58
|
+
'progress-bar',
|
|
59
|
+
theme && `theme-${theme}`,
|
|
60
|
+
{
|
|
61
|
+
'progress-bar-striped': striped || animated,
|
|
62
|
+
'progress-bar-animated': animated
|
|
63
|
+
},
|
|
64
|
+
barClass
|
|
65
|
+
)}
|
|
66
|
+
style={barStyle}
|
|
67
|
+
>
|
|
68
|
+
{children}
|
|
69
|
+
</div>
|
|
70
|
+
</Root>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
Progress.displayName = 'Progress';
|
|
75
|
+
|
|
76
|
+
export const ProgressStack = polymorphic<ComponentPropsWithRef<'div'>>(
|
|
77
|
+
({ as: Root = 'div', className, ...props }) => (
|
|
78
|
+
<Root {...props} className={classNames('progress-stacked', className)} />
|
|
79
|
+
)
|
|
80
|
+
);
|
|
81
|
+
ProgressStack.displayName = 'ProgressStack';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
:global(.progress) {
|
|
2
|
+
width: 100%;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
:global(.progress) > :global(.progress-bar) {
|
|
6
|
+
width: var(--_progress-width);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:global(.progress-stacked) > :global(.progress) {
|
|
10
|
+
width: var(--_progress-width);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:global(.progress-stacked) > :global(.progress) > :global(.progress-bar) {
|
|
14
|
+
width: 100%;
|
|
15
|
+
}
|