diff --git a/package.json b/package.json index 41662fc6405..096b74f57b4 100644 --- a/package.json +++ b/package.json @@ -125,5 +125,9 @@ }, "resolutions": { "dompurify": "3.4.13" + }, + "dependencies": { + "@lit/react": "^1.0.8", + "@patternfly/elements": "^5.0.0" } } diff --git a/packages/react-core/src/components/ButtonNext/FeltButton.tsx b/packages/react-core/src/components/ButtonNext/FeltButton.tsx new file mode 100644 index 00000000000..38ee81c2977 --- /dev/null +++ b/packages/react-core/src/components/ButtonNext/FeltButton.tsx @@ -0,0 +1,259 @@ +import { forwardRef, type ReactNode, type Ref } from 'react'; +import type { OUIAProps } from '../../helpers/OUIA/ouia'; +import type { PfV5Button as PfV5ButtonElement } from '@patternfly/elements/pf-v5-button/pf-v5-button.js'; +import { V5Button } from '@patternfly/elements/react/pf-v5-button/pf-v5-button.js'; +import type { BadgeCountObject } from '../Button'; + +type PfButtonVariant = + | 'primary' + | 'secondary' + | 'tertiary' + | 'danger' + | 'warning' + | 'link' + | 'plain' + | 'control' + | 'stateful'; + +export interface FeltButtonProps extends OUIAProps { + children?: ReactNode; + className?: string; + component?: React.ElementType | React.ComponentType; + isClicked?: boolean; + isBlock?: boolean; + isDisabled?: boolean; + isAriaDisabled?: boolean; + isLoading?: boolean; + spinnerAriaValueText?: string; + spinnerAriaLabel?: string; + spinnerAriaLabelledBy?: string; + inoperableEvents?: string[]; + isInline?: boolean; + isFavorite?: boolean; + isFavorited?: boolean; + size?: 'default' | 'sm' | 'lg'; + type?: 'button' | 'submit' | 'reset'; + variant?: PfButtonVariant; + state?: 'read' | 'unread' | 'attention'; + hasNoPadding?: boolean; + iconPosition?: 'start' | 'end' | 'left' | 'right'; + 'aria-label'?: string; + icon?: ReactNode | null; + tabIndex?: number; + isDanger?: boolean; + isExpanded?: boolean; + isSettings?: boolean; + isHamburger?: boolean; + hamburgerVariant?: 'expand' | 'collapse'; + isCircle?: boolean; + isDocked?: boolean; + isTextExpanded?: boolean; + countOptions?: BadgeCountObject; + ouiaId?: number | string; + ouiaSafe?: boolean; + onClick?: React.MouseEventHandler; + href?: string; + target?: string; + id?: string; + style?: React.CSSProperties; + title?: string; + name?: string; + value?: string; + role?: string; + [key: `data-${string}`]: string | undefined; + [key: `aria-${string}`]: string | undefined; +} + +const unsupportedProps: Record = { + component: + 'The "component" prop is not supported. pf-v5-button renders as a