diff --git a/packages/design-system/src/lib/assets/styles/fontcustom.scss b/packages/design-system/src/lib/assets/styles/fontcustom.scss index 5d6812862..e915d66a1 100644 --- a/packages/design-system/src/lib/assets/styles/fontcustom.scss +++ b/packages/design-system/src/lib/assets/styles/fontcustom.scss @@ -6,16 +6,16 @@ font-weight: normal; font-family: fontcustom; font-style: normal; - src: url("/fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.woff2") format("woff2"), - url("/fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.woff") format("woff"), - url("/fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.ttf") format("truetype"), - url("/fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.svg#fontcustom") format("svg"); + src: url("fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.woff2") format("woff2"), + url("fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.woff") format("woff"), + url("fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.ttf") format("truetype"), + url("fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.svg#fontcustom") format("svg"); } @media screen and (min-resolution) { @font-face { font-family: fontcustom; - src: url("/fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.svg#fontcustom") format("svg"); + src: url("fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.svg#fontcustom") format("svg"); } } diff --git a/packages/design-system/src/lib/assets/styles/fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.svg b/packages/design-system/src/lib/assets/styles/fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.svg new file mode 100644 index 000000000..a438b9316 --- /dev/null +++ b/packages/design-system/src/lib/assets/styles/fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.svg @@ -0,0 +1,127 @@ + + + + + +Created by FontForge 20220308 at Wed Mar 29 16:15:10 2023 + By Philip Durbin + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/design-system/src/lib/assets/styles/fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.ttf b/packages/design-system/src/lib/assets/styles/fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.ttf new file mode 100644 index 000000000..64c42c7e8 Binary files /dev/null and b/packages/design-system/src/lib/assets/styles/fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.ttf differ diff --git a/packages/design-system/src/lib/assets/styles/fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.woff b/packages/design-system/src/lib/assets/styles/fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.woff new file mode 100644 index 000000000..128fc6a52 Binary files /dev/null and b/packages/design-system/src/lib/assets/styles/fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.woff differ diff --git a/packages/design-system/src/lib/assets/styles/fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.woff2 b/packages/design-system/src/lib/assets/styles/fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.woff2 new file mode 100644 index 000000000..1019b3e90 Binary files /dev/null and b/packages/design-system/src/lib/assets/styles/fontcustom/fontcustom_8c9f858763dbca8e064e7fd59d1aa2b7.woff2 differ diff --git a/packages/design-system/src/lib/components/button/Button.tsx b/packages/design-system/src/lib/components/button/Button.tsx index 02bd4da42..1afa95314 100644 --- a/packages/design-system/src/lib/components/button/Button.tsx +++ b/packages/design-system/src/lib/components/button/Button.tsx @@ -1,4 +1,4 @@ -import { MouseEvent, ReactNode } from 'react' +import { HTMLAttributes, MouseEvent, ReactNode } from 'react' import styles from './Button.module.scss' import { Button as ButtonBS } from 'react-bootstrap' import { IconName } from '../icon/IconName' @@ -6,13 +6,13 @@ import { Icon } from '../icon/Icon' type ButtonVariant = 'primary' | 'secondary' | 'link' -interface ButtonProps { +interface ButtonProps extends HTMLAttributes { variant?: ButtonVariant disabled?: boolean onClick?: (event: MouseEvent) => void icon?: IconName | ReactNode withSpacing?: boolean - children: ReactNode + children?: ReactNode } export function Button({ @@ -21,7 +21,8 @@ export function Button({ onClick, icon, withSpacing, - children + children, + ...props }: ButtonProps) { return ( + aria-disabled={disabled} + {...props}> {typeof icon === 'string' ? : icon} {children} diff --git a/packages/design-system/src/lib/components/form/Form.tsx b/packages/design-system/src/lib/components/form/Form.tsx index e585602af..162a9cb70 100644 --- a/packages/design-system/src/lib/components/form/Form.tsx +++ b/packages/design-system/src/lib/components/form/Form.tsx @@ -2,6 +2,7 @@ import { FormEvent, PropsWithChildren } from 'react' import { FormGroup } from './form-group/FormGroup' import { Form as FormBS } from 'react-bootstrap' import { FormGroupWithMultipleFields } from './form-group-multiple-fields/FormGroupWithMultipleFields' +import { FormInputGroup } from './form-group/form-input-group/FormInputGroup' interface FormProps { validated?: boolean @@ -16,6 +17,7 @@ function Form({ validated, onSubmit, children }: PropsWithChildren) { ) } +Form.InputGroup = FormInputGroup Form.Group = FormGroup Form.GroupWithMultipleFields = FormGroupWithMultipleFields diff --git a/packages/design-system/src/lib/components/form/form-group/form-element/FormInput.tsx b/packages/design-system/src/lib/components/form/form-group/form-element/FormInput.tsx index e6506d571..6712c86c4 100644 --- a/packages/design-system/src/lib/components/form/form-group/form-element/FormInput.tsx +++ b/packages/design-system/src/lib/components/form/form-group/form-element/FormInput.tsx @@ -1,6 +1,5 @@ -import { Form as FormBS, InputGroup } from 'react-bootstrap' +import { Form as FormBS } from 'react-bootstrap' import { FormElementLayout } from './FormElementLayout' -import { PropsWithChildren } from 'react' import * as React from 'react' export type FormInputElement = HTMLInputElement | HTMLTextAreaElement @@ -8,33 +7,18 @@ export type FormInputElement = HTMLInputElement | HTMLTextAreaElement interface FormInputProps extends React.HTMLAttributes { type?: 'text' | 'email' | 'password' readOnly?: boolean - prefix?: string withinMultipleFieldsGroup?: boolean } export function FormInput({ type = 'text', readOnly, - prefix, withinMultipleFieldsGroup, ...props }: FormInputProps) { - const FormInputPrefix = ({ children }: PropsWithChildren) => { - return prefix ? ( - - {prefix} - {children} - - ) : ( - <>{children} - ) - } - return ( - - - + ) } diff --git a/packages/design-system/src/lib/components/form/form-group/form-input-group/FormInputGroup.tsx b/packages/design-system/src/lib/components/form/form-group/form-input-group/FormInputGroup.tsx new file mode 100644 index 000000000..a90d8c2ec --- /dev/null +++ b/packages/design-system/src/lib/components/form/form-group/form-input-group/FormInputGroup.tsx @@ -0,0 +1,28 @@ +import React, { PropsWithChildren } from 'react' +import { InputGroup } from 'react-bootstrap' +import { FormInputGroupText } from './FormInputGroupText' +import { Col } from '../../../grid/Col' + +interface FormInputGroupProps { + hasVisibleLabel?: boolean +} + +function FormInputGroup({ hasVisibleLabel, children }: PropsWithChildren) { + const childrenInsideGroup = React.Children.map(children as JSX.Element, (child) => { + return React.cloneElement(child, { + withinMultipleFieldsGroup: true + }) + }) + + return hasVisibleLabel ? ( + + {childrenInsideGroup} + + ) : ( + {childrenInsideGroup} + ) +} + +FormInputGroup.Text = FormInputGroupText + +export { FormInputGroup } diff --git a/packages/design-system/src/lib/components/form/form-group/form-input-group/FormInputGroupText.tsx b/packages/design-system/src/lib/components/form/form-group/form-input-group/FormInputGroupText.tsx new file mode 100644 index 000000000..12d916d42 --- /dev/null +++ b/packages/design-system/src/lib/components/form/form-group/form-input-group/FormInputGroupText.tsx @@ -0,0 +1,6 @@ +import { PropsWithChildren } from 'react' +import { InputGroup } from 'react-bootstrap' + +export function FormInputGroupText({ children }: PropsWithChildren) { + return {children} +} diff --git a/packages/design-system/src/lib/stories/button/Button.stories.tsx b/packages/design-system/src/lib/stories/button/Button.stories.tsx index 7fe3a268d..30621588f 100644 --- a/packages/design-system/src/lib/stories/button/Button.stories.tsx +++ b/packages/design-system/src/lib/stories/button/Button.stories.tsx @@ -1,6 +1,7 @@ import type { Meta, StoryObj } from '@storybook/react' import { Button } from '../../components/button/Button' import { IconName } from '../../components/icon/IconName' +import { Search } from 'react-bootstrap-icons' /** * ## Description @@ -123,6 +124,10 @@ export const WithIcon: Story = { render: () => } +export const IconOnly: Story = { + render: () =>