-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
79 changed files
with
1,103 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/// <reference types="react" /> | ||
import { ButtonVariant } from "../theme/buttons"; | ||
interface ButtonOptions { | ||
variant?: ButtonVariant; | ||
} | ||
declare type ButtonBase = React.ComponentPropsWithoutRef<'button'> & ButtonOptions; | ||
declare type LinkButtonBase = React.ComponentPropsWithoutRef<'a'> & ButtonOptions; | ||
interface ButtonProps extends ButtonBase { | ||
isWaiting?: never; | ||
waitingText?: never; | ||
} | ||
interface WaitingButtonProps extends ButtonBase { | ||
isWaiting: boolean; | ||
waitingText: string; | ||
} | ||
export declare const Button: (props: ButtonProps | WaitingButtonProps) => JSX.Element; | ||
export declare const LinkButton: ({ variant, ...props }: LinkButtonBase) => JSX.Element; | ||
export declare const linkStyle: import("styled-components").FlattenSimpleInterpolation; | ||
export declare const PlainButton: import("styled-components").StyledComponent<"button", any, {}, never>; | ||
export declare const ButtonLink: import("styled-components").StyledComponent<"button", any, {}, never>; | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export declare const Primary: () => JSX.Element; | ||
export declare const Light: () => JSX.Element; | ||
export declare const Secondary: () => JSX.Element; | ||
export declare const Link: () => JSX.Element; | ||
export declare const Linkish: () => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { PropsWithChildren } from "react"; | ||
import { InputHTMLAttributes } from "react"; | ||
declare type CheckboxVariant = keyof typeof checkboxVariants; | ||
declare type CheckboxSize = 1.4 | 1.6 | 1.8 | 2; | ||
export declare const checkboxVariants: { | ||
readonly primary: { | ||
readonly accentColor: "#026AA1"; | ||
readonly boxShadow: "none"; | ||
}; | ||
readonly light: { | ||
readonly accentColor: "#ffffff"; | ||
readonly boxShadow: "0 0 1px 0"; | ||
}; | ||
}; | ||
declare type CheckboxProps = PropsWithChildren<Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> & { | ||
variant?: CheckboxVariant; | ||
size?: CheckboxSize; | ||
bold?: boolean; | ||
}>; | ||
export declare const Checkbox: ({ children, variant, bold, size, ...props }: CheckboxProps) => JSX.Element; | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export declare const Primary: () => JSX.Element; | ||
export declare const Light: () => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const CloseModalButton: import("styled-components").StyledComponent<({ variant, ...props }: any) => JSX.Element, any, {}, never>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from "react"; | ||
export interface ErrorPropTypes { | ||
className?: string; | ||
children?: React.ReactNode; | ||
heading?: string; | ||
} | ||
export declare const Error: ({ heading, children, ...props }: ErrorPropTypes) => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export declare const Default: () => JSX.Element; | ||
export declare const CustomText: () => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import * as Sentry from '@sentry/react'; | ||
import type { ErrorBoundaryProps } from '@sentry/react/types/errorboundary'; | ||
export declare const ErrorBoundary: ({ children, renderFallback, fallback, sentryDsn, sentryInit, ...props }: Sentry.ErrorBoundaryProps & { | ||
renderFallback?: boolean | undefined; | ||
sentryDsn?: string | undefined; | ||
sentryInit?: Sentry.BrowserOptions | undefined; | ||
errorFallbacks?: { | ||
[_: string]: JSX.Element; | ||
} | undefined; | ||
}) => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export declare const InlineMessages: () => JSX.Element; | ||
export declare const Fallback_GenericError_Default: () => JSX.Element; | ||
export declare const Fallback_GenericError_Custom: () => JSX.Element; | ||
export declare const Fallback_SpecialError: () => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export declare const ErrorMessage: ({ message, showEventId }: { | ||
message?: string | undefined; | ||
showEventId?: boolean | undefined; | ||
}) => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// <reference types="react" /> | ||
import { ModalPropTypes } from "./Modal"; | ||
declare type ErrorModalProps = React.PropsWithChildren<Omit<ModalPropTypes, 'variant' | 'heading'>>; | ||
export declare const ErrorModal: (props: ErrorModalProps) => JSX.Element; | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const Default: () => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
interface Props { | ||
large?: boolean; | ||
delay?: number; | ||
} | ||
export declare const Loader: (props: Props) => JSX.Element; | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export declare const Default: () => JSX.Element; | ||
export declare const Large: () => JSX.Element; | ||
export declare const Delay: () => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import React from 'react'; | ||
declare type ManageCookiesLinkProps = React.ButtonHTMLAttributes<HTMLButtonElement> & { | ||
wrapper?: (button: React.ReactElement) => React.ReactElement; | ||
}; | ||
export declare const ManageCookiesLink: (props: ManageCookiesLinkProps) => JSX.Element | null; | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export declare const WithoutOsano: () => JSX.Element; | ||
export declare const WithOsano: () => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export declare const ModalCard: import("styled-components").StyledComponent<"div", any, {}, never>; | ||
export declare const ModalBodyHeading: import("styled-components").StyledComponent<"h3", any, {}, never>; | ||
export declare const ModalBody: import("styled-components").StyledComponent<"div", any, {}, never>; | ||
export declare const Mask: import("styled-components").StyledComponent<"div", any, {}, never>; | ||
export declare const ModalWrapper: import("styled-components").StyledComponent<"div", any, {}, never>; | ||
export declare const ModalFooter: import("styled-components").StyledComponent<"div", any, {}, never>; | ||
export interface ModalPropTypes { | ||
onModalClose: () => void; | ||
heading: string; | ||
className?: string; | ||
show?: boolean; | ||
variant?: 'default' | 'error'; | ||
} | ||
export declare const Modal: ({ className, heading, onModalClose, children, show, variant }: React.PropsWithChildren<ModalPropTypes>) => JSX.Element | null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export declare const Default: () => JSX.Element; | ||
export declare const Error: () => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/// <reference types="react" /> | ||
declare type Logo = React.HTMLProps<HTMLAnchorElement> & { | ||
alt?: string; | ||
}; | ||
declare type NavBarProps = React.PropsWithChildren<{ | ||
maxWidth?: number; | ||
navDesktopHeight?: number; | ||
navMobileHeight?: number; | ||
logo?: boolean | Logo; | ||
justifyContent?: string; | ||
}>; | ||
export declare const NavBar: ({ logo, maxWidth, ...props }: NavBarProps) => JSX.Element; | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export declare const Plain: () => JSX.Element; | ||
export declare const LogoAndChildren: () => JSX.Element; | ||
export declare const AltTextLinkedLogo: () => JSX.Element; | ||
export declare const AltTextNoLinkedLogo: () => JSX.Element; | ||
export declare const OverrideJustifyContent: () => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export declare const NavBarLogo: ({ alt }: { | ||
alt: string; | ||
}) => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/// <reference types="react" /> | ||
export declare const OverlayMask: import("styled-components").StyledComponent<"div", any, {}, never>; | ||
export declare const OverlayCloseButton: import("styled-components").StyledComponent<({ variant, ...props }: any) => JSX.Element, any, {}, never>; | ||
export declare const OverlayWrapper: import("styled-components").StyledComponent<"div", any, {}, never>; | ||
export declare const OverlayBody: import("styled-components").StyledComponent<"div", any, {}, never>; | ||
export declare const Overlay: ({ className, onClose, children, show }: import("react").PropsWithChildren<{ | ||
onClose: () => void; | ||
className?: string | undefined; | ||
show?: boolean | undefined; | ||
}>) => JSX.Element | null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const Default: () => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export declare const RiceLogo: ({ alt, ...props }: { | ||
alt?: string | undefined; | ||
}) => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const Default: () => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export declare const H2: import("styled-components").StyledComponent<"h2", any, {}, never>; | ||
export declare const Paragraph: import("styled-components").StyledComponent<"p", any, {}, never>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export declare const PText: () => JSX.Element; | ||
export declare const Heading: () => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
import { ToastData } from '../../src/types'; | ||
interface ToastBase extends React.PropsWithChildren<Omit<ToastData, 'message' | 'onDismiss'>> { | ||
inline?: boolean; | ||
} | ||
interface ToastWithTimeout extends ToastBase { | ||
onDismiss?: ToastData['onDismiss']; | ||
dismissAfterMs?: number; | ||
} | ||
interface ToastWithoutTimeout extends ToastBase { | ||
onDismiss?: never; | ||
dismissAfterMs?: never; | ||
} | ||
export declare type Toast = ToastWithTimeout | ToastWithoutTimeout; | ||
export declare const Toast: ({ id, title, children, variant, inline, dismissAfterMs, onDismiss, }: Toast) => JSX.Element | null; | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export declare const Default: () => JSX.Element; | ||
export declare const SuccessWithTimeout: () => JSX.Element; | ||
export declare const FailureWithTimeout: () => JSX.Element; | ||
export declare const InlineAndPermanent: () => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { ToastData } from '../../src/types'; | ||
export declare const ToastContainer: ({ toasts, onDismissToast, inline }: { | ||
toasts: ToastData[]; | ||
onDismissToast?: ToastData['onDismiss']; | ||
inline?: boolean | undefined; | ||
}) => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const Default: () => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export declare const BasicControlledForm: () => JSX.Element; | ||
export declare const FormRepeatableElements: () => JSX.Element; | ||
export declare const BasicDataReferences: () => JSX.Element; | ||
export declare const DataReferencesInNamespaces: () => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react'; | ||
import { FetchState } from "@openstax/ts-utils/fetch.js"; | ||
export declare type AbstractFormData = Record<string, any>; | ||
declare type FormStateHelpers<T extends AbstractFormData> = { | ||
data: Partial<T>; | ||
submit: () => void; | ||
namespace: string; | ||
state: FetchState<T, string>; | ||
setInput: { | ||
fields: React.Dispatch<React.SetStateAction<Partial<T>>>; | ||
field: <F extends keyof T>(fieldName: F) => (value: T[F]) => void; | ||
merge: (input: Partial<T>) => void; | ||
}; | ||
}; | ||
export declare const FormStateContext: React.Context<() => FormStateHelpers<AbstractFormData>>; | ||
export declare const useFormHelpers: () => FormStateHelpers<AbstractFormData>; | ||
export declare const useFormState: <T extends AbstractFormData>(state: FetchState<T, string>, defaultValue?: Partial<T> | undefined, onSubmit?: ((data: Partial<T>) => void) | undefined) => FormStateHelpers<T>; | ||
export declare const useFormNameSpace: (field: string) => FormStateHelpers<AbstractFormData>; | ||
export declare const FormListContext: React.Context<() => ListStateHelpers>; | ||
export declare const useFormListHelpers: () => ListStateHelpers; | ||
declare type ListStateHelpers = { | ||
addRecord: (record?: AbstractFormData) => void; | ||
removeRecord: (id: string) => void; | ||
data: Array<AbstractFormData & { | ||
id: string; | ||
}>; | ||
setData: React.Dispatch<React.SetStateAction<AbstractFormData[]>>; | ||
makeRecordHelpers: (record: AbstractFormData & { | ||
id: string; | ||
}) => FormStateHelpers<AbstractFormData>; | ||
}; | ||
export declare type FormListConfig = { | ||
name: string; | ||
}; | ||
export declare const useFormList: ({ name }: FormListConfig) => ListStateHelpers; | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from 'react'; | ||
import { FetchState } from "@openstax/ts-utils/fetch.js"; | ||
import * as Uncontrolled from '../uncontrolled'; | ||
import { AbstractFormData, FormListConfig } from "./hooks"; | ||
export * from './inputs'; | ||
export * from './hooks'; | ||
export { Submit, Cancel, FormSection } from '../uncontrolled'; | ||
declare type FormProps = Omit<React.ComponentPropsWithoutRef<typeof Uncontrolled.Form>, 'onSubmit'> & { | ||
state: FetchState<any, string>; | ||
defaultData?: AbstractFormData; | ||
onSubmit?: (data: AbstractFormData) => void; | ||
}; | ||
export declare const Form: ({ children, state, onSubmit, defaultData, ...props }: FormProps) => JSX.Element; | ||
export declare const Messages: (props: Omit<React.ComponentPropsWithoutRef<typeof Uncontrolled.Messages>, 'state'>) => JSX.Element; | ||
export declare const Buttons: (props: Omit<React.ComponentPropsWithoutRef<typeof Uncontrolled.Buttons>, 'state'>) => JSX.Element; | ||
declare type GetFormValueProps = { | ||
name: string; | ||
children: (value: AbstractFormData[string]) => JSX.Element | null; | ||
}; | ||
export declare const GetFormValue: (props: GetFormValueProps) => JSX.Element | null; | ||
declare type GetFormDataProps = { | ||
children: (value: AbstractFormData) => JSX.Element | null; | ||
}; | ||
export declare const GetFormData: (props: GetFormDataProps) => JSX.Element | null; | ||
export declare const NameSpace: (props: React.PropsWithChildren<{ | ||
name: string; | ||
}>) => JSX.Element; | ||
export declare const List: ({ children, ...props }: React.PropsWithChildren<FormListConfig>) => JSX.Element; | ||
export declare const ListItems: (props: { | ||
children: React.ReactNode; | ||
}) => JSX.Element; | ||
declare type ListRecordSortableHandleProps = React.ComponentPropsWithoutRef<'div'>; | ||
export declare const ListRecordSortableHandle: (props: ListRecordSortableHandleProps) => JSX.Element; | ||
declare type ListRecordRemoveButtonProps = React.ComponentPropsWithoutRef<'button'>; | ||
export declare const ListRecordRemoveButton: (props: ListRecordRemoveButtonProps) => JSX.Element; | ||
declare type ListRecordAddButtonProps = React.ComponentPropsWithoutRef<'button'>; | ||
export declare const ListRecordAddButton: (props: ListRecordAddButtonProps) => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import * as Uncontrolled from '../uncontrolled/inputTypes'; | ||
declare type MakeControlled<T extends React.ComponentType<any>> = Omit<React.ComponentPropsWithoutRef<T>, 'value'> & { | ||
name: string; | ||
emptyDisabledValue?: boolean; | ||
}; | ||
export declare const TextInput: (props: MakeControlled<typeof Uncontrolled.TextInput>) => JSX.Element; | ||
export declare const TextArea: (props: MakeControlled<typeof Uncontrolled.TextArea>) => JSX.Element; | ||
export declare const Checkbox: (props: MakeControlled<typeof Uncontrolled.Checkbox>) => JSX.Element; | ||
declare type SelectProps = { | ||
onChangeValue?: (value: string | undefined) => void; | ||
multiple?: false; | ||
} | { | ||
onChangeValue?: (value: readonly string[] | undefined) => void; | ||
multiple: true; | ||
}; | ||
export declare const Select: (props: MakeControlled<typeof Uncontrolled.Select> & SelectProps) => JSX.Element; | ||
export declare const File: (props: MakeControlled<typeof Uncontrolled.File>) => JSX.Element; | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { FormInputWrapper, FormLabelText, HelpText, RequiredIndicator } from '../uncontrolled/inputs'; | ||
export * from './inputTypes'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * as Controlled from './controlled'; | ||
export * as Uncontrolled from './uncontrolled'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import { FetchState } from "@openstax/ts-utils/fetch.js"; | ||
export * from './inputs'; | ||
declare type FormProps = React.ComponentPropsWithoutRef<'form'>; | ||
export declare const Form: ({ children, ...props }: FormProps) => JSX.Element; | ||
export declare const FormSection: import("styled-components").StyledComponent<"div", any, {}, never>; | ||
declare type MessagesProps = { | ||
state: FetchState<any, string>; | ||
}; | ||
export declare const Messages: ({ state }: MessagesProps) => JSX.Element | null; | ||
declare type ButtonsProps = { | ||
state: FetchState<any, string>; | ||
onCancel?: () => void; | ||
}; | ||
export declare const Buttons: (props: ButtonsProps) => JSX.Element; | ||
declare type SubmitButtonProps = React.ComponentPropsWithoutRef<'input'>; | ||
export declare const Submit: ({ ...props }: SubmitButtonProps) => JSX.Element; | ||
declare type CancelButtonProps = React.ComponentPropsWithoutRef<'button'>; | ||
export declare const Cancel: ({ ...props }: CancelButtonProps) => JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
export declare const FormInputWrapper: import("styled-components").StyledComponent<"label", any, {}, never>; | ||
export declare const FormLabelText: import("styled-components").StyledComponent<"span", any, {}, never>; | ||
export declare type InputProps = { | ||
label: string; | ||
help?: string; | ||
}; | ||
declare type HelpTextProps = React.ComponentPropsWithoutRef<'p'> & { | ||
value: string | undefined; | ||
}; | ||
export declare const HelpText: ({ value, ...props }: HelpTextProps) => JSX.Element | null; | ||
export declare const RequiredIndicator: (props: { | ||
show: boolean | undefined; | ||
}) => JSX.Element | null; | ||
export {}; |
Oops, something went wrong.