From 17ec2a19b2d2dc5ba3f99c43d86c27946de2ac71 Mon Sep 17 00:00:00 2001 From: Joanne Date: Sun, 22 Jun 2025 23:12:46 -0400 Subject: successfully merged documentationtext functionality with new version of agent, however still minor issues with the agent not selecting the proper tool for documentation generation without the additional context from the topbar --- .../components/src/components/Button/Button.tsx | 164 +-------------------- 1 file changed, 2 insertions(+), 162 deletions(-) (limited to 'packages/components/src') diff --git a/packages/components/src/components/Button/Button.tsx b/packages/components/src/components/Button/Button.tsx index 9b8893452..dd6942a7e 100644 --- a/packages/components/src/components/Button/Button.tsx +++ b/packages/components/src/components/Button/Button.tsx @@ -5,28 +5,14 @@ import { Colors, Size } from '../../global/globalEnums'; import { getFontSize, getHeight } from '../../global/globalUtils'; import { IconButton } from '../IconButton'; import './Button.scss'; -import { infoState } from '../../../../../src/client/views/collections/collectionFreeForm/CollectionFreeFormInfoState'; -import { Tooltip } from '@mui/material'; -import React from 'react'; -import { Alignment, IGlobalProps, Placement, Type, getFormLabelSize } from '../../global'; -import { Colors, Size } from '../../global/globalEnums'; -import { getFontSize, getHeight } from '../../global/globalUtils'; -import { IconButton } from '../IconButton'; -import './Button.scss'; +// import { infoState } from '../../../../../src/client/views/collections/collectionFreeForm/CollectionFreeFormInfoState'; // This import was unused export interface IButtonProps extends IGlobalProps { onClick?: (event: React.MouseEvent) => void; onDoubleClick?: (event: React.MouseEvent) => void; type?: Type; active?: boolean; - onClick?: (event: React.MouseEvent) => void; - onDoubleClick?: (event: React.MouseEvent) => void; - type?: Type; - active?: boolean; - // Content - text?: string; - icon?: JSX.Element | string; // Content text?: string; icon?: JSX.Element | string; @@ -38,14 +24,6 @@ export interface IButtonProps extends IGlobalProps { uppercase?: boolean; align?: Alignment; filter?: string; - targetState?: infoState - // Additional stylization - iconPlacement?: Placement; - color?: string; - colorPicker?: string; - uppercase?: boolean; - align?: Alignment; - filter?: string; } export const Button = (props: IButtonProps) => { @@ -74,50 +52,11 @@ export const Button = (props: IButtonProps) => { fillWidth, align = fillWidth ? 'flex-start' : 'center', } = props; - const { - text, - icon, - onClick, - onDoubleClick, - onPointerDown, - active, - height, - inactive, - type = Type.PRIM, - filter, - uppercase = false, - iconPlacement = 'right', - size = Size.SMALL, - color = Colors.MEDIUM_BLUE, - background, - style, - tooltip, - tooltipPlacement = 'top', - colorPicker, - formLabel, - formLabelPlacement, - fillWidth, - align = fillWidth ? 'flex-start' : 'center', - } = props; - if (!text) { - return ; - } if (!text) { return ; } - /** - * Pointer down - * @param e - */ - const handlePointerDown = (e: React.PointerEvent) => { - if (!inactive && onPointerDown) { - e.stopPropagation(); - e.preventDefault(); - onPointerDown(e); - } - }; /** * Pointer down * @param e @@ -130,17 +69,6 @@ export const Button = (props: IButtonProps) => { } }; - /** - * In the event that there is a single click - * @param e - */ - const handleClick = (e: React.MouseEvent) => { - if (!inactive && onClick) { - e.stopPropagation(); - e.preventDefault(); - onClick(e); - } - }; /** * In the event that there is a single click * @param e @@ -153,17 +81,6 @@ export const Button = (props: IButtonProps) => { } }; - /** - * Double click - * @param e - */ - const handleDoubleClick = (e: React.MouseEvent) => { - if (!inactive && onDoubleClick) { - e.stopPropagation(); - e.preventDefault(); - onDoubleClick(e); - } - }; /** * Double click * @param e @@ -176,17 +93,6 @@ export const Button = (props: IButtonProps) => { } }; - const getBorderColor = (): Colors | string | undefined => { - switch (type) { - case Type.PRIM: - return undefined; - case Type.SEC: - if (colorPicker) return colorPicker; - return color; - case Type.TERT: - return color; - } - }; const getBorderColor = (): Colors | string | undefined => { switch (type) { case Type.PRIM: @@ -219,32 +125,10 @@ export const Button = (props: IButtonProps) => { if (colorPicker) return colorPicker; return color; case Type.TERT: - } - }; - const getBackground = (): Colors | string | undefined => { - if (background) return background; - switch (type) { - case Type.PRIM: - case Type.SEC: - if (colorPicker) return colorPicker; - return color; - case Type.TERT: + return undefined; // Tertiary buttons usually don't have a background or it's transparent } }; - const defaultProperties: React.CSSProperties = { - height: getHeight(height, size), - minHeight: getHeight(height, size), - width: fillWidth ? '100%' : 'fit-content', - justifyContent: align ? align : undefined, - padding: fillWidth && align === 'center' ? 0 : undefined, - fontWeight: 500, - fontSize: getFontSize(size), - fontFamily: 'sans-serif', - textTransform: uppercase ? 'uppercase' : undefined, - borderColor: getBorderColor(), - color: getColor(), - }; const defaultProperties: React.CSSProperties = { height: getHeight(height, size), minHeight: getHeight(height, size), @@ -259,10 +143,6 @@ export const Button = (props: IButtonProps) => { color: getColor(), }; - const backgroundProperties: React.CSSProperties = { - background: getBackground(), - filter, - }; const backgroundProperties: React.CSSProperties = { background: getBackground(), filter, @@ -308,43 +188,3 @@ export const Button = (props: IButtonProps) => { button ); }; - const button: JSX.Element = ( - -
-
- {iconPlacement == 'left' && icon ? ( -
- {icon} -
- ) : null} - {text} - {iconPlacement == 'right' && icon ? ( -
- {icon} -
- ) : null} -
-
-
- - ); - - return formLabel ? ( -
-
- {formLabel} -
- {button} -
- ) : ( - button - ); -}; -- cgit v1.2.3-70-g09d2