Browse Source

Update components

Update email input autocomplete, multiline text input rows, and link button types.
master
TheoryOfNekomata 7 months ago
parent
commit
2503a64cbc
6 changed files with 10 additions and 24 deletions
  1. +1
    -1
      categories/web/formatted/react/package.json
  2. +1
    -1
      categories/web/formatted/react/src/components/EmailInput/index.tsx
  3. +1
    -1
      categories/web/freeform/react/package.json
  4. +3
    -1
      categories/web/freeform/react/src/components/MultilineTextInput/index.tsx
  5. +1
    -1
      categories/web/navigation/react/package.json
  6. +3
    -19
      categories/web/navigation/react/src/components/LinkButton/index.tsx

+ 1
- 1
categories/web/formatted/react/package.json View File

@@ -1,6 +1,6 @@
{ {
"name": "@tesseract-design/web-formatted-react", "name": "@tesseract-design/web-formatted-react",
"version": "0.2.0",
"version": "0.2.1",
"files": [ "files": [
"dist", "dist",
"src" "src"


+ 1
- 1
categories/web/formatted/react/src/components/EmailInput/index.tsx View File

@@ -137,7 +137,7 @@ export const EmailInput = React.forwardRef<EmailInputDerivedElement, EmailInputP
aria-labelledby={labelId} aria-labelledby={labelId}
type="email" type="email"
data-testid="input" data-testid="input"
autoComplete={autoComplete ? 'email' : undefined}
autoComplete={autoComplete ? 'email' : 'off'}
pattern={pattern} pattern={pattern}
className={tw( className={tw(
'bg-negative rounded-inherit w-full peer block font-inherit tabular-nums', 'bg-negative rounded-inherit w-full peer block font-inherit tabular-nums',


+ 1
- 1
categories/web/freeform/react/package.json View File

@@ -1,6 +1,6 @@
{ {
"name": "@tesseract-design/web-freeform-react", "name": "@tesseract-design/web-freeform-react",
"version": "0.2.0",
"version": "0.2.1",
"files": [ "files": [
"dist", "dist",
"src" "src"


+ 3
- 1
categories/web/freeform/react/src/components/MultilineTextInput/index.tsx View File

@@ -71,6 +71,7 @@ export const MultilineTextInput = React.forwardRef<
hiddenLabel = false, hiddenLabel = false,
className, className,
style, style,
rows,
id: idProp, id: idProp,
...etcProps ...etcProps
}: MultilineTextInputProps, }: MultilineTextInputProps,
@@ -127,9 +128,10 @@ export const MultilineTextInput = React.forwardRef<
aria-labelledby={labelId} aria-labelledby={labelId}
id={id} id={id}
data-testid="input" data-testid="input"
style={{
style={Number.isFinite(rows) ? undefined : {
height: 0, height: 0,
}} }}
rows={rows}
className={tw( className={tw(
'bg-negative rounded-inherit w-full peer block font-inherit', 'bg-negative rounded-inherit w-full peer block font-inherit',
'focus:outline-0', 'focus:outline-0',


+ 1
- 1
categories/web/navigation/react/package.json View File

@@ -1,6 +1,6 @@
{ {
"name": "@tesseract-design/web-navigation-react", "name": "@tesseract-design/web-navigation-react",
"version": "0.2.0",
"version": "0.2.1",
"files": [ "files": [
"dist", "dist",
"src" "src"


+ 3
- 19
categories/web/navigation/react/src/components/LinkButton/index.tsx View File

@@ -59,15 +59,15 @@ interface LinkButtonAnchorProps extends Pick<React.HTMLProps<LinkButtonDerivedEl
component: typeof LinkButtonDerivedElementComponent; component: typeof LinkButtonDerivedElementComponent;
} }


interface LinkButtonComponentType {
(props: { href?: string }): React.ReactNode;
export interface LinkButtonComponentType {
(props: { href: string }): React.ReactNode;
} }


interface LinkButtonFCProps< interface LinkButtonFCProps<
C extends LinkButtonComponentType = LinkButtonComponentType C extends LinkButtonComponentType = LinkButtonComponentType
> { > {
component: C; component: C;
href: C extends (props: { href?: infer Href }) => React.ReactNode ? Href : never;
href: C extends (props: { href: infer Href }) => React.ReactNode ? Href : never;
} }


type LinkButtonAllProps< type LinkButtonAllProps<
@@ -262,19 +262,3 @@ LinkButton.defaultProps = {
// eslint-disable-next-line react/default-props-match-prop-types // eslint-disable-next-line react/default-props-match-prop-types
href: undefined, href: undefined,
}; };

// extend the component type here for defining new props
// interface LinkButtonComponentType {
// (props: { href?: number }): React.ReactNode;
// }

// const CustomLink = (props: { href?: string | number }) => {
// return null;
// };
//
// const a = (
// <LinkButton
// component="a"
// href="string"
// />
// );

Loading…
Cancel
Save