Put common utility functions to web-base for any category to import.master
@@ -1,6 +1,6 @@ | |||||
{ | { | ||||
"name": "@tesseract-design/web-base", | "name": "@tesseract-design/web-base", | ||||
"version": "0.0.0", | |||||
"version": "0.2.0", | |||||
"files": [ | "files": [ | ||||
"dist", | "dist", | ||||
"src" | "src" | ||||
@@ -63,5 +63,10 @@ | |||||
}, | }, | ||||
"typesVersions": { | "typesVersions": { | ||||
"*": {} | "*": {} | ||||
}, | |||||
"dependencies": { | |||||
"clsx": "^1.2.1", | |||||
"tailwind-merge": "^1.14.0", | |||||
"tailwindcss": "^3.3.3" | |||||
} | } | ||||
} | } |
@@ -1,2 +1,4 @@ | |||||
export * as Button from './button'; | export * as Button from './button'; | ||||
export * as TextControl from './text-control'; | export * as TextControl from './text-control'; | ||||
export * as tailwind from './tailwind'; |
@@ -0,0 +1,73 @@ | |||||
import { clsx } from 'clsx'; | |||||
//import { twMerge } from 'tailwind-merge'; | |||||
import plugin from 'tailwindcss/plugin'; | |||||
export type { PluginCreator } from 'tailwindcss/types/config'; | |||||
export const tw = (...args: Parameters<typeof clsx>) => clsx(...args); | |||||
export const basePlugin = plugin( | |||||
({ addUtilities, matchUtilities, theme }) => { | |||||
matchUtilities( | |||||
{ | |||||
font: (value) => ({ | |||||
tabSize: value, | |||||
}), | |||||
}, | |||||
{ | |||||
values: theme('fontStretch'), | |||||
}, | |||||
); | |||||
addUtilities({ | |||||
'.linejoin-round': { | |||||
'stroke-linejoin': 'round', | |||||
}, | |||||
'.linecap-round': { | |||||
'stroke-linecap': 'round', | |||||
}, | |||||
}); | |||||
}, | |||||
{ | |||||
theme: { | |||||
extend: { | |||||
colors: { | |||||
'current': 'currentcolor', | |||||
'inherit': 'inherit', | |||||
'transparent': 'transparent', | |||||
}, | |||||
fontFamily: { | |||||
inherit: ['inherit'], | |||||
}, | |||||
fontStretch: { | |||||
'condensed': 'condensed', | |||||
'semi-condensed': 'semi-condensed', | |||||
'expanded': 'expanded', | |||||
'semi-expanded': 'semi-expanded', | |||||
'inherit': 'inherit', | |||||
}, | |||||
borderRadius: { | |||||
inherit: 'inherit', | |||||
}, | |||||
minWidth: { | |||||
6: '1.5rem', | |||||
10: '2.5rem', | |||||
12: '3rem', | |||||
16: '4rem', | |||||
48: '12rem', | |||||
64: '16rem', | |||||
}, | |||||
minHeight: { | |||||
6: '1.5rem', | |||||
10: '2.5rem', | |||||
12: '3rem', | |||||
16: '4rem', | |||||
32: '8rem', | |||||
64: '16rem', | |||||
}, | |||||
strokeWidth: { | |||||
3: '3', | |||||
}, | |||||
}, | |||||
}, | |||||
}, | |||||
); |
@@ -62,8 +62,7 @@ | |||||
"access": "public" | "access": "public" | ||||
}, | }, | ||||
"dependencies": { | "dependencies": { | ||||
"@tesseract-design/web-base": "workspace:*", | |||||
"clsx": "^1.2.1" | |||||
"@tesseract-design/web-base": "workspace:*" | |||||
}, | }, | ||||
"types": "./dist/types/index.d.ts", | "types": "./dist/types/index.d.ts", | ||||
"main": "./dist/cjs/production/index.js", | "main": "./dist/cjs/production/index.js", | ||||
@@ -1,6 +1,7 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import clsx from 'clsx'; | |||||
import { Button } from '@tesseract-design/web-base'; | |||||
import { Button, tailwind } from '@tesseract-design/web-base'; | |||||
const { tw } = tailwind; | |||||
const ActionButtonDerivedElementComponent = 'button' as const; | const ActionButtonDerivedElementComponent = 'button' as const; | ||||
@@ -85,7 +86,7 @@ export const ActionButton = React.forwardRef<ActionButtonDerivedElement, ActionB | |||||
data-testid="button" | data-testid="button" | ||||
type={type} | type={type} | ||||
ref={forwardedRef} | ref={forwardedRef} | ||||
className={clsx( | |||||
className={tw( | |||||
'items-center justify-center rounded overflow-hidden ring-secondary/50 leading-none select-none', | 'items-center justify-center rounded overflow-hidden ring-secondary/50 leading-none select-none', | ||||
'focus:outline-0 focus:ring-4', | 'focus:outline-0 focus:ring-4', | ||||
'active:ring-tertiary/50', | 'active:ring-tertiary/50', | ||||
@@ -115,7 +116,7 @@ export const ActionButton = React.forwardRef<ActionButtonDerivedElement, ActionB | |||||
> | > | ||||
<span | <span | ||||
data-testid="childrenParent" | data-testid="childrenParent" | ||||
className={clsx( | |||||
className={tw( | |||||
'flex-auto min-w-0 flex items-center gap-2', | 'flex-auto min-w-0 flex items-center gap-2', | ||||
iconAfterChildren ? 'flex-row-reverse' : 'flex-row', | iconAfterChildren ? 'flex-row-reverse' : 'flex-row', | ||||
)} | )} | ||||
@@ -129,7 +130,7 @@ export const ActionButton = React.forwardRef<ActionButtonDerivedElement, ActionB | |||||
)} | )} | ||||
{(children || subtext) && ( | {(children || subtext) && ( | ||||
<span | <span | ||||
className={clsx( | |||||
className={tw( | |||||
'min-w-0 flex-auto', | 'min-w-0 flex-auto', | ||||
{ | { | ||||
'text-left': compact || menuItem, | 'text-left': compact || menuItem, | ||||
@@ -139,7 +140,7 @@ export const ActionButton = React.forwardRef<ActionButtonDerivedElement, ActionB | |||||
> | > | ||||
{children && ( | {children && ( | ||||
<span | <span | ||||
className={clsx( | |||||
className={tw( | |||||
'block uppercase font-bold w-full whitespace-nowrap overflow-hidden text-ellipsis font-semi-expanded h-[1.1em]', | 'block uppercase font-bold w-full whitespace-nowrap overflow-hidden text-ellipsis font-semi-expanded h-[1.1em]', | ||||
)} | )} | ||||
data-testid="children" | data-testid="children" | ||||
@@ -63,7 +63,7 @@ | |||||
}, | }, | ||||
"dependencies": { | "dependencies": { | ||||
"@modal-sh/react-utils": "workspace:*", | "@modal-sh/react-utils": "workspace:*", | ||||
"clsx": "^1.2.1" | |||||
"@tesseract-design/web-base": "workspace:*" | |||||
}, | }, | ||||
"types": "./dist/types/index.d.ts", | "types": "./dist/types/index.d.ts", | ||||
"main": "./dist/cjs/production/index.js", | "main": "./dist/cjs/production/index.js", | ||||
@@ -1,6 +1,8 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { tailwind } from '@tesseract-design/web-base' | |||||
import { useClientSide, useFallbackId, useProxyInput } from '@modal-sh/react-utils'; | import { useClientSide, useFallbackId, useProxyInput } from '@modal-sh/react-utils'; | ||||
import clsx from 'clsx'; | |||||
const { tw } = tailwind; | |||||
const FileSelectBoxDefaultPreviewComponentDerivedElementComponent = 'div' as const; | const FileSelectBoxDefaultPreviewComponentDerivedElementComponent = 'div' as const; | ||||
@@ -46,7 +48,7 @@ export const FileSelectBoxDefaultPreviewComponent = React.forwardRef< | |||||
}, forwardedRef) => ( | }, forwardedRef) => ( | ||||
<FileSelectBoxDefaultPreviewComponentDerivedElementComponent | <FileSelectBoxDefaultPreviewComponentDerivedElementComponent | ||||
data-enhanced={enhanced} | data-enhanced={enhanced} | ||||
className={clsx({ | |||||
className={tw({ | |||||
'opacity-50': disabled, | 'opacity-50': disabled, | ||||
})} | })} | ||||
ref={forwardedRef} | ref={forwardedRef} | ||||
@@ -153,6 +155,9 @@ export interface FileSelectBoxProps< | |||||
* Clear label. | * Clear label. | ||||
*/ | */ | ||||
clearLabel?: string, | clearLabel?: string, | ||||
/** | |||||
* Should the component resize vertically? | |||||
*/ | |||||
resize?: boolean, | resize?: boolean, | ||||
} | } | ||||
@@ -391,7 +396,7 @@ export const FileSelectBox = React.forwardRef<FileSelectBoxDerivedElement, FileS | |||||
return ( | return ( | ||||
<FileSelectBoxRootElementComponent | <FileSelectBoxRootElementComponent | ||||
className={clsx( | |||||
className={tw( | |||||
'relative rounded ring-secondary/50 group file-select-box', | 'relative rounded ring-secondary/50 group file-select-box', | ||||
'focus-within:ring-4', | 'focus-within:ring-4', | ||||
block && 'flex w-full', | block && 'flex w-full', | ||||
@@ -405,7 +410,7 @@ export const FileSelectBox = React.forwardRef<FileSelectBoxDerivedElement, FileS | |||||
style={style} | style={style} | ||||
> | > | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'w-full overflow-hidden min-h-16 relative pt-4 min-h-16 rounded-inherit', | 'w-full overflow-hidden min-h-16 relative pt-4 min-h-16 rounded-inherit', | ||||
{ | { | ||||
'h-4': clientSide, | 'h-4': clientSide, | ||||
@@ -420,7 +425,7 @@ export const FileSelectBox = React.forwardRef<FileSelectBoxDerivedElement, FileS | |||||
data-testid="label" | data-testid="label" | ||||
id={labelId} | id={labelId} | ||||
htmlFor={id} | htmlFor={id} | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute z-[1] w-full top-0.5 left-0 pointer-events-none select-none pl-1 text-xxs font-bold peer-disabled:opacity-50 group-focus-within:text-secondary text-primary leading-none bg-negative', | 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none select-none pl-1 text-xxs font-bold peer-disabled:opacity-50 group-focus-within:text-secondary text-primary leading-none bg-negative', | ||||
{ | { | ||||
'sr-only': hiddenLabel, | 'sr-only': hiddenLabel, | ||||
@@ -437,7 +442,7 @@ export const FileSelectBox = React.forwardRef<FileSelectBoxDerivedElement, FileS | |||||
type="button" | type="button" | ||||
disabled={disabled} | disabled={disabled} | ||||
tabIndex={-1} | tabIndex={-1} | ||||
className={clsx( | |||||
className={tw( | |||||
'flex items-center focus:outline-0 justify-center absolute top-0 left-0 w-full h-full cursor-pointer select-none', | 'flex items-center focus:outline-0 justify-center absolute top-0 left-0 w-full h-full cursor-pointer select-none', | ||||
(fileList?.length ?? 0) > 0 && 'opacity-0', | (fileList?.length ?? 0) > 0 && 'opacity-0', | ||||
)} | )} | ||||
@@ -457,11 +462,11 @@ export const FileSelectBox = React.forwardRef<FileSelectBoxDerivedElement, FileS | |||||
onBlur={handleBlur} | onBlur={handleBlur} | ||||
onKeyDown={clientSide ? handleKeyDown : undefined} | onKeyDown={clientSide ? handleKeyDown : undefined} | ||||
onKeyUp={clientSide ? doSetFileList : undefined} | onKeyUp={clientSide ? doSetFileList : undefined} | ||||
className={clsx( | |||||
'peer box-border focus:outline-0 px-4 file:cursor-pointer disabled:file:cursor-pointer block cursor-pointer disabled:cursor-not-allowed file:bg-transparent file:text-primary file:block file:font-bold file:font-semi-expanded file:uppercase file:p-0 file:border-0 group-focus-within:file:text-secondary', | |||||
className={tw( | |||||
'peer box-border focus:outline-0 file:cursor-pointer disabled:file:cursor-pointer block cursor-pointer disabled:cursor-not-allowed file:bg-transparent file:text-primary file:block file:font-bold file:font-semi-expanded file:uppercase file:p-0 file:border-0 group-focus-within:file:text-secondary', | |||||
{ | { | ||||
'sr-only': clientSide, | 'sr-only': clientSide, | ||||
'h-full w-full': !clientSide, | |||||
'h-full w-full px-4': !clientSide, | |||||
}, | }, | ||||
)} | )} | ||||
onChange={clientSide ? handleFileChange : onChange} | onChange={clientSide ? handleFileChange : onChange} | ||||
@@ -550,7 +555,7 @@ export const FileSelectBox = React.forwardRef<FileSelectBoxDerivedElement, FileS | |||||
onMouseDown={handleReselectMouseDown} | onMouseDown={handleReselectMouseDown} | ||||
onMouseUp={handleReselectMouseUp} | onMouseUp={handleReselectMouseUp} | ||||
tabIndex={-1} | tabIndex={-1} | ||||
className={clsx( | |||||
className={tw( | |||||
'flex w-full h-full focus:outline-0 bg-negative text-primary cursor-pointer items-center justify-center leading-none gap-4 select-none', | 'flex w-full h-full focus:outline-0 bg-negative text-primary cursor-pointer items-center justify-center leading-none gap-4 select-none', | ||||
{ | { | ||||
'group-focus-within:text-secondary group-focus-within:active:text-tertiary': !aboutToSelect, | 'group-focus-within:text-secondary group-focus-within:active:text-tertiary': !aboutToSelect, | ||||
@@ -575,7 +580,7 @@ export const FileSelectBox = React.forwardRef<FileSelectBoxDerivedElement, FileS | |||||
onMouseDown={handleDeleteMouseDown} | onMouseDown={handleDeleteMouseDown} | ||||
onMouseUp={doSetFileList} | onMouseUp={doSetFileList} | ||||
tabIndex={-1} | tabIndex={-1} | ||||
className={clsx( | |||||
className={tw( | |||||
'flex w-full h-full bg-negative text-primary disabled:text-primary items-center justify-center leading-none gap-4 select-none focus:outline-0', | 'flex w-full h-full bg-negative text-primary disabled:text-primary items-center justify-center leading-none gap-4 select-none focus:outline-0', | ||||
{ | { | ||||
'group-focus-within:text-secondary group-focus-within:active:text-tertiary': !aboutToClear, | 'group-focus-within:text-secondary group-focus-within:active:text-tertiary': !aboutToClear, | ||||
@@ -63,9 +63,7 @@ | |||||
}, | }, | ||||
"dependencies": { | "dependencies": { | ||||
"@modal-sh/react-utils": "workspace:*", | "@modal-sh/react-utils": "workspace:*", | ||||
"@tesseract-design/web-base": "workspace:*", | |||||
"clsx": "^1.2.1", | |||||
"tailwindcss": "3.3.2" | |||||
"@tesseract-design/web-base": "workspace:*" | |||||
}, | }, | ||||
"types": "./dist/types/index.d.ts", | "types": "./dist/types/index.d.ts", | ||||
"main": "./dist/cjs/production/index.js", | "main": "./dist/cjs/production/index.js", | ||||
@@ -1,7 +1,8 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import { TextControl, tailwind } from '@tesseract-design/web-base'; | |||||
import { useFallbackId } from '@modal-sh/react-utils'; | import { useFallbackId } from '@modal-sh/react-utils'; | ||||
import clsx from 'clsx'; | |||||
const { tw } = tailwind; | |||||
const ComboBoxDerivedElementComponent = 'input' as const; | const ComboBoxDerivedElementComponent = 'input' as const; | ||||
@@ -107,7 +108,7 @@ export const ComboBox = React.forwardRef<ComboBoxDerivedElement, ComboBoxProps>( | |||||
{children} | {children} | ||||
</datalist> | </datalist> | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'relative rounded ring-secondary/50 overflow-hidden group has-[:disabled]:opacity-50', | 'relative rounded ring-secondary/50 overflow-hidden group has-[:disabled]:opacity-50', | ||||
'focus-within:ring-4', | 'focus-within:ring-4', | ||||
{ | { | ||||
@@ -125,7 +126,7 @@ export const ComboBox = React.forwardRef<ComboBoxDerivedElement, ComboBoxProps>( | |||||
data-testid="label" | data-testid="label" | ||||
id={labelId} | id={labelId} | ||||
htmlFor={id} | htmlFor={id} | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | ||||
{ | { | ||||
'sr-only': hiddenLabel, | 'sr-only': hiddenLabel, | ||||
@@ -157,7 +158,7 @@ export const ComboBox = React.forwardRef<ComboBoxDerivedElement, ComboBoxProps>( | |||||
inputMode={resultInputMode} | inputMode={resultInputMode} | ||||
list={datalistId} | list={datalistId} | ||||
data-testid="input" | data-testid="input" | ||||
className={clsx( | |||||
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', | ||||
'disabled:opacity-50 disabled:cursor-not-allowed', | 'disabled:opacity-50 disabled:cursor-not-allowed', | ||||
@@ -191,7 +192,7 @@ export const ComboBox = React.forwardRef<ComboBoxDerivedElement, ComboBoxProps>( | |||||
{hint && ( | {hint && ( | ||||
<div | <div | ||||
data-testid="hint" | data-testid="hint" | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | 'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | ||||
{ | { | ||||
'bottom-0 pl-4 pb-1': variant === 'default', | 'bottom-0 pl-4 pb-1': variant === 'default', | ||||
@@ -222,7 +223,7 @@ export const ComboBox = React.forwardRef<ComboBoxDerivedElement, ComboBoxProps>( | |||||
{indicator && ( | {indicator && ( | ||||
<div | <div | ||||
data-testid="indicator" | data-testid="indicator" | ||||
className={clsx( | |||||
className={tw( | |||||
'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none', | 'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none', | ||||
{ | { | ||||
'w-10': size === 'small', | 'w-10': size === 'small', | ||||
@@ -1,9 +1,10 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | |||||
import { TextControl, tailwind } from '@tesseract-design/web-base'; | |||||
import { useFallbackId } from '@modal-sh/react-utils'; | import { useFallbackId } from '@modal-sh/react-utils'; | ||||
import { PluginCreator } from 'tailwindcss/types/config'; | import { PluginCreator } from 'tailwindcss/types/config'; | ||||
const { tw } = tailwind; | |||||
const DropdownSelectDerivedElementComponent = 'select' as const; | const DropdownSelectDerivedElementComponent = 'select' as const; | ||||
/** | /** | ||||
@@ -94,7 +95,7 @@ export const DropdownSelect = React.forwardRef<DropdownSelectDerivedElement, Dro | |||||
return ( | return ( | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'relative rounded ring-secondary/50 min-w-48 group has-[:disabled]:opacity-50', | 'relative rounded ring-secondary/50 min-w-48 group has-[:disabled]:opacity-50', | ||||
'focus-within:ring-4', | 'focus-within:ring-4', | ||||
{ | { | ||||
@@ -112,7 +113,7 @@ export const DropdownSelect = React.forwardRef<DropdownSelectDerivedElement, Dro | |||||
htmlFor={id} | htmlFor={id} | ||||
data-testid="label" | data-testid="label" | ||||
id={labelId} | id={labelId} | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | ||||
{ | { | ||||
'sr-only': hiddenLabel, | 'sr-only': hiddenLabel, | ||||
@@ -138,7 +139,7 @@ export const DropdownSelect = React.forwardRef<DropdownSelectDerivedElement, Dro | |||||
aria-labelledby={labelId} | aria-labelledby={labelId} | ||||
data-testid="input" | data-testid="input" | ||||
role="combobox" | role="combobox" | ||||
className={clsx( | |||||
className={tw( | |||||
'dropdown-select bg-negative rounded-inherit w-full peer block appearance-none cursor-pointer select-none font-inherit', | 'dropdown-select bg-negative rounded-inherit w-full peer block appearance-none cursor-pointer select-none font-inherit', | ||||
'focus:outline-0', | 'focus:outline-0', | ||||
'disabled:opacity-50 disabled:cursor-not-allowed', | 'disabled:opacity-50 disabled:cursor-not-allowed', | ||||
@@ -158,7 +159,7 @@ export const DropdownSelect = React.forwardRef<DropdownSelectDerivedElement, Dro | |||||
{hint && ( | {hint && ( | ||||
<div | <div | ||||
data-testid="hint" | data-testid="hint" | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | 'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | ||||
{ | { | ||||
'bottom-0 pl-4 pb-1': variant === 'default', | 'bottom-0 pl-4 pb-1': variant === 'default', | ||||
@@ -184,7 +185,7 @@ export const DropdownSelect = React.forwardRef<DropdownSelectDerivedElement, Dro | |||||
)} | )} | ||||
<div | <div | ||||
data-testid="indicator" | data-testid="indicator" | ||||
className={clsx( | |||||
className={tw( | |||||
'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none text-primary peer-focus:text-secondary', | 'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none text-primary peer-focus:text-secondary', | ||||
{ | { | ||||
'w-10': size === 'small', | 'w-10': size === 'small', | ||||
@@ -1,9 +1,10 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | |||||
import { TextControl, tailwind } from '@tesseract-design/web-base'; | |||||
import { useFallbackId } from '@modal-sh/react-utils'; | import { useFallbackId } from '@modal-sh/react-utils'; | ||||
import { PluginCreator } from 'tailwindcss/types/config'; | import { PluginCreator } from 'tailwindcss/types/config'; | ||||
const { tw } = tailwind; | |||||
const MenuSelectDerivedElementComponent = 'select' as const; | const MenuSelectDerivedElementComponent = 'select' as const; | ||||
/** | /** | ||||
@@ -102,7 +103,7 @@ export const MenuSelect = React.forwardRef<MenuSelectDerivedElement, MenuSelectP | |||||
return ( | return ( | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'relative rounded ring-secondary/50 group has-[:disabled]:opacity-50', | 'relative rounded ring-secondary/50 group has-[:disabled]:opacity-50', | ||||
'focus-within:ring-4', | 'focus-within:ring-4', | ||||
{ | { | ||||
@@ -119,7 +120,7 @@ export const MenuSelect = React.forwardRef<MenuSelectDerivedElement, MenuSelectP | |||||
data-testid="label" | data-testid="label" | ||||
htmlFor={id} | htmlFor={id} | ||||
id={labelId} | id={labelId} | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | ||||
{ | { | ||||
'sr-only': hiddenLabel, | 'sr-only': hiddenLabel, | ||||
@@ -151,7 +152,7 @@ export const MenuSelect = React.forwardRef<MenuSelectDerivedElement, MenuSelectP | |||||
style={{ | style={{ | ||||
height: startingHeight, | height: startingHeight, | ||||
}} | }} | ||||
className={clsx( | |||||
className={tw( | |||||
'menu-select bg-negative rounded-inherit w-full peer block overflow-auto cursor-pointer font-inherit', | 'menu-select bg-negative rounded-inherit w-full peer block overflow-auto cursor-pointer font-inherit', | ||||
'focus:outline-0', | 'focus:outline-0', | ||||
'disabled:opacity-50 disabled:cursor-not-allowed', | 'disabled:opacity-50 disabled:cursor-not-allowed', | ||||
@@ -196,7 +197,7 @@ export const MenuSelect = React.forwardRef<MenuSelectDerivedElement, MenuSelectP | |||||
{hint && ( | {hint && ( | ||||
<div | <div | ||||
data-testid="hint" | data-testid="hint" | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | 'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | ||||
{ | { | ||||
'bottom-0 pl-4 pb-1': variant === 'default', | 'bottom-0 pl-4 pb-1': variant === 'default', | ||||
@@ -227,7 +228,7 @@ export const MenuSelect = React.forwardRef<MenuSelectDerivedElement, MenuSelectP | |||||
{indicator && ( | {indicator && ( | ||||
<div | <div | ||||
data-testid="indicator" | data-testid="indicator" | ||||
className={clsx( | |||||
className={tw( | |||||
'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none', | 'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none', | ||||
{ | { | ||||
'w-10': size === 'small', | 'w-10': size === 'small', | ||||
@@ -1,9 +1,10 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import clsx from 'clsx'; | |||||
import { Button } from '@tesseract-design/web-base'; | |||||
import { Button, tailwind } from '@tesseract-design/web-base'; | |||||
import { useFallbackId } from '@modal-sh/react-utils'; | import { useFallbackId } from '@modal-sh/react-utils'; | ||||
import { PluginCreator } from 'tailwindcss/types/config'; | import { PluginCreator } from 'tailwindcss/types/config'; | ||||
const { tw } = tailwind; | |||||
const RadioButtonDerivedElementComponent = 'input' as const; | const RadioButtonDerivedElementComponent = 'input' as const; | ||||
/** | /** | ||||
@@ -94,7 +95,7 @@ export const RadioButton = React.forwardRef<RadioButtonDerivedElement, RadioButt | |||||
style={style} | style={style} | ||||
htmlFor={id} | htmlFor={id} | ||||
data-testid="button" | data-testid="button" | ||||
className={clsx( | |||||
className={tw( | |||||
'items-center justify-start rounded overflow-hidden ring-secondary/50 leading-none select-none cursor-pointer', | 'items-center justify-start rounded overflow-hidden ring-secondary/50 leading-none select-none cursor-pointer', | ||||
'peer-focus:outline-0 peer-focus:ring-4 peer-focus:ring-secondary/50', | 'peer-focus:outline-0 peer-focus:ring-4 peer-focus:ring-secondary/50', | ||||
'active:ring-tertiary/50 active:ring-4', | 'active:ring-tertiary/50 active:ring-4', | ||||
@@ -121,7 +122,7 @@ export const RadioButton = React.forwardRef<RadioButtonDerivedElement, RadioButt | |||||
)} | )} | ||||
> | > | ||||
<span | <span | ||||
className={clsx( | |||||
className={tw( | |||||
'w-6 h-6 block rounded-full border-2 p-0.5 box-border', | 'w-6 h-6 block rounded-full border-2 p-0.5 box-border', | ||||
{ | { | ||||
'border-current': variant !== 'filled', | 'border-current': variant !== 'filled', | ||||
@@ -130,7 +131,7 @@ export const RadioButton = React.forwardRef<RadioButtonDerivedElement, RadioButt | |||||
)} | )} | ||||
> | > | ||||
<span | <span | ||||
className={clsx( | |||||
className={tw( | |||||
'w-full h-full rounded-full bg-current', | 'w-full h-full rounded-full bg-current', | ||||
{ | { | ||||
'text-current': variant !== 'filled', | 'text-current': variant !== 'filled', | ||||
@@ -140,7 +141,7 @@ export const RadioButton = React.forwardRef<RadioButtonDerivedElement, RadioButt | |||||
/> | /> | ||||
</span> | </span> | ||||
<span | <span | ||||
className={clsx( | |||||
className={tw( | |||||
'contents', | 'contents', | ||||
{ | { | ||||
'text-current': variant !== 'filled', | 'text-current': variant !== 'filled', | ||||
@@ -149,7 +150,7 @@ export const RadioButton = React.forwardRef<RadioButtonDerivedElement, RadioButt | |||||
)} | )} | ||||
> | > | ||||
<span | <span | ||||
className={clsx( | |||||
className={tw( | |||||
'flex-auto min-w-0', | 'flex-auto min-w-0', | ||||
)} | )} | ||||
> | > | ||||
@@ -1,5 +1,4 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import clsx from 'clsx'; | |||||
import { useFallbackId } from '@modal-sh/react-utils'; | import { useFallbackId } from '@modal-sh/react-utils'; | ||||
import { PluginCreator } from 'tailwindcss/types/config'; | import { PluginCreator } from 'tailwindcss/types/config'; | ||||
@@ -64,10 +64,9 @@ | |||||
"access": "public" | "access": "public" | ||||
}, | }, | ||||
"dependencies": { | "dependencies": { | ||||
"clsx": "^1.2.1", | |||||
"@tesseract-design/web-base": "workspace:*", | |||||
"color": "^4.2.3", | "color": "^4.2.3", | ||||
"color-convert": "^2.0.1", | |||||
"tailwindcss": "3.3.2" | |||||
"color-convert": "^2.0.1" | |||||
}, | }, | ||||
"types": "./dist/types/index.d.ts", | "types": "./dist/types/index.d.ts", | ||||
"main": "./dist/cjs/production/index.js", | "main": "./dist/cjs/production/index.js", | ||||
@@ -1,6 +1,7 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import clsx from 'clsx'; | |||||
import { PluginCreator } from 'tailwindcss/types/config'; | |||||
import { tailwind } from '@tesseract-design/web-base'; | |||||
const { tw } = tailwind; | |||||
const ColorPickerDerivedElementComponent = 'input' as const; | const ColorPickerDerivedElementComponent = 'input' as const; | ||||
@@ -19,7 +20,7 @@ export interface ColorPickerProps extends Omit<React.HTMLProps<ColorPickerDerive | |||||
size?: 'small' | 'medium' | 'large'; | size?: 'small' | 'medium' | 'large'; | ||||
} | } | ||||
export const colorPickerPlugin: PluginCreator = ({ addComponents }) => { | |||||
export const colorPickerPlugin: tailwind.PluginCreator = ({ addComponents }) => { | |||||
addComponents({ | addComponents({ | ||||
'.color-picker': { | '.color-picker': { | ||||
'&::-webkit-color-swatch-wrapper': { | '&::-webkit-color-swatch-wrapper': { | ||||
@@ -53,7 +54,7 @@ export const ColorPicker = React.forwardRef< | |||||
forwardedRef, | forwardedRef, | ||||
) => ( | ) => ( | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'inline-block align-center relative ring-secondary/50 rounded overflow-hidden box-border group has-[:disabled]:opacity-50', | 'inline-block align-center relative ring-secondary/50 rounded overflow-hidden box-border group has-[:disabled]:opacity-50', | ||||
'rounded focus-within:ring-4 active:ring-tertiary/50', | 'rounded focus-within:ring-4 active:ring-tertiary/50', | ||||
{ | { | ||||
@@ -71,7 +72,7 @@ export const ColorPicker = React.forwardRef< | |||||
style={style} | style={style} | ||||
> | > | ||||
<span | <span | ||||
className={clsx( | |||||
className={tw( | |||||
'block w-full', | 'block w-full', | ||||
{ | { | ||||
'p-[25%]': square, | 'p-[25%]': square, | ||||
@@ -81,7 +82,7 @@ export const ColorPicker = React.forwardRef< | |||||
> | > | ||||
<ColorPickerDerivedElementComponent | <ColorPickerDerivedElementComponent | ||||
{...etcProps} | {...etcProps} | ||||
className={clsx( | |||||
className={tw( | |||||
'color-picker absolute top-0 left-0 w-full h-full overflow-hidden cursor-pointer disabled:cursor-not-allowed', | 'color-picker absolute top-0 left-0 w-full h-full overflow-hidden cursor-pointer disabled:cursor-not-allowed', | ||||
'focus:outline-0', | 'focus:outline-0', | ||||
)} | )} | ||||
@@ -91,7 +92,7 @@ export const ColorPicker = React.forwardRef< | |||||
/> | /> | ||||
</span> | </span> | ||||
<span | <span | ||||
className={clsx( | |||||
className={tw( | |||||
'border-y-4 border-l-4 border-r-2 absolute top-0 left-0 h-full pointer-events-none border-[#000000]', | 'border-y-4 border-l-4 border-r-2 absolute top-0 left-0 h-full pointer-events-none border-[#000000]', | ||||
{ | { | ||||
'w-1/2': square, | 'w-1/2': square, | ||||
@@ -100,7 +101,7 @@ export const ColorPicker = React.forwardRef< | |||||
)} | )} | ||||
/> | /> | ||||
<span | <span | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute flex items-center justify-center top-0 right-0 h-full pointer-events-none bg-negative text-primary group-has-[:disabled]:text-primary group-active:text-tertiary group-focus-within:text-secondary', | 'absolute flex items-center justify-center top-0 right-0 h-full pointer-events-none bg-negative text-primary group-has-[:disabled]:text-primary group-active:text-tertiary group-focus-within:text-secondary', | ||||
{ | { | ||||
'w-1/2': square, | 'w-1/2': square, | ||||
@@ -1,7 +1,9 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import clsx from 'clsx'; | |||||
import Color from 'color'; | import Color from 'color'; | ||||
import * as convert from 'color-convert'; | import * as convert from 'color-convert'; | ||||
import { tailwind } from '@tesseract-design/web-base'; | |||||
const { tw } = tailwind; | |||||
const SwatchDerivedElementComponent = 'input' as const; | const SwatchDerivedElementComponent = 'input' as const; | ||||
@@ -54,7 +56,7 @@ export const Swatch = React.forwardRef<SwatchDerivedElement, SwatchProps>(({ | |||||
return ( | return ( | ||||
<span | <span | ||||
className={clsx( | |||||
className={tw( | |||||
'inline-block align-middle', | 'inline-block align-middle', | ||||
className, | className, | ||||
)} | )} | ||||
@@ -71,7 +73,7 @@ export const Swatch = React.forwardRef<SwatchDerivedElement, SwatchProps>(({ | |||||
onSelect={copyColor} | onSelect={copyColor} | ||||
/> | /> | ||||
<label | <label | ||||
className={clsx( | |||||
className={tw( | |||||
'relative rounded ring-secondary/50 whitespace-nowrap inline-block align-top leading-none cursor-pointer', // todo eyedropper cursor | 'relative rounded ring-secondary/50 whitespace-nowrap inline-block align-top leading-none cursor-pointer', // todo eyedropper cursor | ||||
'peer-focus:outline-0 peer-focus:ring-4', | 'peer-focus:outline-0 peer-focus:ring-4', | ||||
'peer-active:ring-tertiary/50', | 'peer-active:ring-tertiary/50', | ||||
@@ -64,7 +64,6 @@ | |||||
"dependencies": { | "dependencies": { | ||||
"@modal-sh/react-utils": "workspace:*", | "@modal-sh/react-utils": "workspace:*", | ||||
"@tesseract-design/web-base": "workspace:*", | "@tesseract-design/web-base": "workspace:*", | ||||
"clsx": "^1.2.1", | |||||
"react-phone-number-input": "^3.3.0" | "react-phone-number-input": "^3.3.0" | ||||
}, | }, | ||||
"types": "./dist/types/index.d.ts", | "types": "./dist/types/index.d.ts", | ||||
@@ -1,8 +1,9 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | |||||
import { TextControl, tailwind } from '@tesseract-design/web-base'; | |||||
import { useFallbackId } from '@modal-sh/react-utils'; | import { useFallbackId } from '@modal-sh/react-utils'; | ||||
const { tw } = tailwind; | |||||
const EmailInputDerivedElementComponent = 'input' as const; | const EmailInputDerivedElementComponent = 'input' as const; | ||||
/** | /** | ||||
@@ -92,7 +93,7 @@ export const EmailInput = React.forwardRef<EmailInputDerivedElement, EmailInputP | |||||
return ( | return ( | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'relative rounded ring-secondary/50 group has-[:disabled]:opacity-50', | 'relative rounded ring-secondary/50 group has-[:disabled]:opacity-50', | ||||
'focus-within:ring-4', | 'focus-within:ring-4', | ||||
{ | { | ||||
@@ -109,7 +110,7 @@ export const EmailInput = React.forwardRef<EmailInputDerivedElement, EmailInputP | |||||
data-testid="label" | data-testid="label" | ||||
id={labelId} | id={labelId} | ||||
htmlFor={id} | htmlFor={id} | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | ||||
{ | { | ||||
'sr-only': hiddenLabel, | 'sr-only': hiddenLabel, | ||||
@@ -138,7 +139,7 @@ export const EmailInput = React.forwardRef<EmailInputDerivedElement, EmailInputP | |||||
data-testid="input" | data-testid="input" | ||||
autoComplete={autoComplete ? 'email' : undefined} | autoComplete={autoComplete ? 'email' : undefined} | ||||
pattern={pattern} | pattern={pattern} | ||||
className={clsx( | |||||
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', | ||||
'focus:outline-0', | 'focus:outline-0', | ||||
'disabled:cursor-not-allowed', | 'disabled:cursor-not-allowed', | ||||
@@ -156,7 +157,7 @@ export const EmailInput = React.forwardRef<EmailInputDerivedElement, EmailInputP | |||||
{hint && ( | {hint && ( | ||||
<div | <div | ||||
data-testid="hint" | data-testid="hint" | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | 'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | ||||
{ | { | ||||
'bottom-0 pl-4 pb-1': variant === 'default', | 'bottom-0 pl-4 pb-1': variant === 'default', | ||||
@@ -182,7 +183,7 @@ export const EmailInput = React.forwardRef<EmailInputDerivedElement, EmailInputP | |||||
)} | )} | ||||
<div | <div | ||||
data-testid="indicator" | data-testid="indicator" | ||||
className={clsx( | |||||
className={tw( | |||||
'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none text-primary group-focus-within:text-secondary', | 'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none text-primary group-focus-within:text-secondary', | ||||
{ | { | ||||
'w-10': size === 'small', | 'w-10': size === 'small', | ||||
@@ -1,8 +1,9 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | |||||
import { TextControl, tailwind } from '@tesseract-design/web-base'; | |||||
import { useFallbackId } from '@modal-sh/react-utils'; | import { useFallbackId } from '@modal-sh/react-utils'; | ||||
const { tw } = tailwind; | |||||
const PatternTextInputDerivedElementComponent = 'input' as const; | const PatternTextInputDerivedElementComponent = 'input' as const; | ||||
/** | /** | ||||
@@ -102,7 +103,7 @@ export const PatternTextInput = React.forwardRef< | |||||
return ( | return ( | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'relative rounded ring-secondary/50 overflow-hidden group has-[:disabled]:opacity-50', | 'relative rounded ring-secondary/50 overflow-hidden group has-[:disabled]:opacity-50', | ||||
'focus-within:ring-4', | 'focus-within:ring-4', | ||||
{ | { | ||||
@@ -120,7 +121,7 @@ export const PatternTextInput = React.forwardRef< | |||||
data-testid="label" | data-testid="label" | ||||
htmlFor={id} | htmlFor={id} | ||||
id={labelId} | id={labelId} | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | ||||
{ | { | ||||
'sr-only': hiddenLabel, | 'sr-only': hiddenLabel, | ||||
@@ -151,7 +152,7 @@ export const PatternTextInput = React.forwardRef< | |||||
type={type} | type={type} | ||||
inputMode={resultInputMode} | inputMode={resultInputMode} | ||||
data-testid="input" | data-testid="input" | ||||
className={clsx( | |||||
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', | ||||
'disabled:opacity-50 disabled:cursor-not-allowed', | 'disabled:opacity-50 disabled:cursor-not-allowed', | ||||
@@ -185,7 +186,7 @@ export const PatternTextInput = React.forwardRef< | |||||
{hint && ( | {hint && ( | ||||
<div | <div | ||||
data-testid="hint" | data-testid="hint" | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | 'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | ||||
{ | { | ||||
'bottom-0 pl-4 pb-1': variant === 'default', | 'bottom-0 pl-4 pb-1': variant === 'default', | ||||
@@ -216,7 +217,7 @@ export const PatternTextInput = React.forwardRef< | |||||
{indicator && ( | {indicator && ( | ||||
<div | <div | ||||
data-testid="indicator" | data-testid="indicator" | ||||
className={clsx( | |||||
className={tw( | |||||
'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none', | 'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none', | ||||
{ | { | ||||
'w-10': size === 'small', | 'w-10': size === 'small', | ||||
@@ -1,8 +1,9 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import { TextControl, tailwind } from '@tesseract-design/web-base'; | |||||
import { useClientSide, useFallbackId, useProxyInput } from '@modal-sh/react-utils'; | import { useClientSide, useFallbackId, useProxyInput } from '@modal-sh/react-utils'; | ||||
import PhoneInput, { Country, Value } from 'react-phone-number-input/input'; | import PhoneInput, { Country, Value } from 'react-phone-number-input/input'; | ||||
import clsx from 'clsx'; | |||||
const { tw } = tailwind; | |||||
const PhoneNumberInputDerivedElementComponent = 'input' as const; | const PhoneNumberInputDerivedElementComponent = 'input' as const; | ||||
@@ -105,7 +106,7 @@ export const PhoneNumberInput = React.forwardRef< | |||||
transformChangeHandlerArgs: (v) => (v ?? '') as unknown as Value, | transformChangeHandlerArgs: (v) => (v ?? '') as unknown as Value, | ||||
}); | }); | ||||
const commonInputStyles = clsx( | |||||
const commonInputStyles = 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', | ||||
'focus:outline-0', | 'focus:outline-0', | ||||
'disabled:cursor-not-allowed', | 'disabled:cursor-not-allowed', | ||||
@@ -122,7 +123,7 @@ export const PhoneNumberInput = React.forwardRef< | |||||
return ( | return ( | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'relative rounded ring-secondary/50 group has-[:disabled]:opacity-50', | 'relative rounded ring-secondary/50 group has-[:disabled]:opacity-50', | ||||
'focus-within:ring-4', | 'focus-within:ring-4', | ||||
{ | { | ||||
@@ -140,7 +141,7 @@ export const PhoneNumberInput = React.forwardRef< | |||||
data-testid="label" | data-testid="label" | ||||
id={labelId} | id={labelId} | ||||
htmlFor={id} | htmlFor={id} | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | ||||
{ | { | ||||
'sr-only': hiddenLabel, | 'sr-only': hiddenLabel, | ||||
@@ -172,7 +173,7 @@ export const PhoneNumberInput = React.forwardRef< | |||||
name={name} | name={name} | ||||
data-testid="input" | data-testid="input" | ||||
tabIndex={clientSide ? -1 : undefined} | tabIndex={clientSide ? -1 : undefined} | ||||
className={clsx(commonInputStyles, clientSide && 'sr-only')} | |||||
className={tw(commonInputStyles, clientSide && 'sr-only')} | |||||
/> | /> | ||||
{clientSide && ( | {clientSide && ( | ||||
<PhoneInput | <PhoneInput | ||||
@@ -187,7 +188,7 @@ export const PhoneNumberInput = React.forwardRef< | |||||
{hint && ( | {hint && ( | ||||
<div | <div | ||||
data-testid="hint" | data-testid="hint" | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | 'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | ||||
{ | { | ||||
'bottom-0 pl-4 pb-1': variant === 'default', | 'bottom-0 pl-4 pb-1': variant === 'default', | ||||
@@ -213,7 +214,7 @@ export const PhoneNumberInput = React.forwardRef< | |||||
)} | )} | ||||
<div | <div | ||||
data-testid="indicator" | data-testid="indicator" | ||||
className={clsx( | |||||
className={tw( | |||||
'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none text-primary group-focus-within:text-secondary', | 'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none text-primary group-focus-within:text-secondary', | ||||
{ | { | ||||
'w-10': size === 'small', | 'w-10': size === 'small', | ||||
@@ -1,8 +1,9 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | |||||
import { TextControl, tailwind } from '@tesseract-design/web-base'; | |||||
import { useFallbackId } from '@modal-sh/react-utils'; | import { useFallbackId } from '@modal-sh/react-utils'; | ||||
const { tw } = tailwind; | |||||
const UrlInputDerivedElementComponent = 'input' as const; | const UrlInputDerivedElementComponent = 'input' as const; | ||||
/** | /** | ||||
@@ -75,7 +76,7 @@ export const UrlInput = React.forwardRef<UrlInputDerivedElement, UrlInputProps>( | |||||
return ( | return ( | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'relative rounded ring-secondary/50 group has-[:disabled]:opacity-50', | 'relative rounded ring-secondary/50 group has-[:disabled]:opacity-50', | ||||
'focus-within:ring-4', | 'focus-within:ring-4', | ||||
{ | { | ||||
@@ -93,7 +94,7 @@ export const UrlInput = React.forwardRef<UrlInputDerivedElement, UrlInputProps>( | |||||
data-testid="label" | data-testid="label" | ||||
htmlFor={id} | htmlFor={id} | ||||
id={labelId} | id={labelId} | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | ||||
{ | { | ||||
'sr-only': hiddenLabel, | 'sr-only': hiddenLabel, | ||||
@@ -120,7 +121,7 @@ export const UrlInput = React.forwardRef<UrlInputDerivedElement, UrlInputProps>( | |||||
aria-labelledby={labelId} | aria-labelledby={labelId} | ||||
type="url" | type="url" | ||||
data-testid="input" | data-testid="input" | ||||
className={clsx( | |||||
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', | ||||
'focus:outline-0', | 'focus:outline-0', | ||||
'disabled:cursor-not-allowed', | 'disabled:cursor-not-allowed', | ||||
@@ -138,7 +139,7 @@ export const UrlInput = React.forwardRef<UrlInputDerivedElement, UrlInputProps>( | |||||
{hint && ( | {hint && ( | ||||
<div | <div | ||||
data-testid="hint" | data-testid="hint" | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | 'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | ||||
{ | { | ||||
'bottom-0 pl-4 pb-1': variant === 'default', | 'bottom-0 pl-4 pb-1': variant === 'default', | ||||
@@ -164,7 +165,7 @@ export const UrlInput = React.forwardRef<UrlInputDerivedElement, UrlInputProps>( | |||||
)} | )} | ||||
<div | <div | ||||
data-testid="indicator" | data-testid="indicator" | ||||
className={clsx( | |||||
className={tw( | |||||
'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none text-primary group-focus-within:text-secondary', | 'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none text-primary group-focus-within:text-secondary', | ||||
{ | { | ||||
'w-10': size === 'small', | 'w-10': size === 'small', | ||||
@@ -63,8 +63,7 @@ | |||||
}, | }, | ||||
"dependencies": { | "dependencies": { | ||||
"@modal-sh/react-utils": "workspace:*", | "@modal-sh/react-utils": "workspace:*", | ||||
"@tesseract-design/web-base": "workspace:*", | |||||
"clsx": "^1.2.1" | |||||
"@tesseract-design/web-base": "workspace:*" | |||||
}, | }, | ||||
"types": "./dist/types/index.d.ts", | "types": "./dist/types/index.d.ts", | ||||
"main": "./dist/cjs/production/index.js", | "main": "./dist/cjs/production/index.js", | ||||
@@ -1,8 +1,9 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | |||||
import { TextControl, tailwind } from '@tesseract-design/web-base'; | |||||
import { useClientSide, useFallbackId } from '@modal-sh/react-utils'; | import { useClientSide, useFallbackId } from '@modal-sh/react-utils'; | ||||
const { tw } = tailwind; | |||||
const MaskedTextInputDerivedElementComponent = 'input' as const; | const MaskedTextInputDerivedElementComponent = 'input' as const; | ||||
/** | /** | ||||
@@ -156,7 +157,7 @@ export const MaskedTextInput = React.forwardRef< | |||||
return ( | return ( | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'relative rounded ring-secondary/50 overflow-hidden group has-[:disabled]:opacity-50', | 'relative rounded ring-secondary/50 overflow-hidden group has-[:disabled]:opacity-50', | ||||
'focus-within:ring-4', | 'focus-within:ring-4', | ||||
{ | { | ||||
@@ -174,7 +175,7 @@ export const MaskedTextInput = React.forwardRef< | |||||
data-testid="label" | data-testid="label" | ||||
id={labelId} | id={labelId} | ||||
htmlFor={id} | htmlFor={id} | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | ||||
{ | { | ||||
'sr-only': hiddenLabel, | 'sr-only': hiddenLabel, | ||||
@@ -208,7 +209,7 @@ export const MaskedTextInput = React.forwardRef< | |||||
autoComplete={autoComplete ?? 'off'} | autoComplete={autoComplete ?? 'off'} | ||||
onKeyUp={enhanced ? handleKeyUp : undefined} | onKeyUp={enhanced ? handleKeyUp : undefined} | ||||
onKeyDown={enhanced ? handleKeyDown : undefined} | onKeyDown={enhanced ? handleKeyDown : undefined} | ||||
className={clsx( | |||||
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', | ||||
'disabled:opacity-50 disabled:cursor-not-allowed', | 'disabled:opacity-50 disabled:cursor-not-allowed', | ||||
@@ -242,7 +243,7 @@ export const MaskedTextInput = React.forwardRef< | |||||
{hint && ( | {hint && ( | ||||
<div | <div | ||||
data-testid="hint" | data-testid="hint" | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | 'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | ||||
{ | { | ||||
'bottom-0 pl-4 pb-1': variant === 'default', | 'bottom-0 pl-4 pb-1': variant === 'default', | ||||
@@ -276,7 +277,7 @@ export const MaskedTextInput = React.forwardRef< | |||||
type="button" | type="button" | ||||
data-testid="indicator" | data-testid="indicator" | ||||
tabIndex={-1} | tabIndex={-1} | ||||
className={clsx( | |||||
className={tw( | |||||
'text-center z-[1] focus:outline-0 flex items-center justify-center aspect-square absolute bottom-0 right-0 select-none', | 'text-center z-[1] focus:outline-0 flex items-center justify-center aspect-square absolute bottom-0 right-0 select-none', | ||||
{ | { | ||||
'text-primary group-focus-within:text-secondary group-focus-within:active:text-tertiary': !visibleViaKey, | 'text-primary group-focus-within:text-secondary group-focus-within:active:text-tertiary': !visibleViaKey, | ||||
@@ -1,8 +1,9 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | |||||
import { TextControl, tailwind } from '@tesseract-design/web-base'; | |||||
import { useFallbackId } from '@modal-sh/react-utils'; | import { useFallbackId } from '@modal-sh/react-utils'; | ||||
const { tw } = tailwind; | |||||
const MultilineTextInputDerivedElementComponent = 'textarea' as const; | const MultilineTextInputDerivedElementComponent = 'textarea' as const; | ||||
/** | /** | ||||
@@ -80,7 +81,7 @@ export const MultilineTextInput = React.forwardRef< | |||||
return ( | return ( | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'relative rounded ring-secondary/50 overflow-hidden group has-[:disabled]:opacity-50', | 'relative rounded ring-secondary/50 overflow-hidden group has-[:disabled]:opacity-50', | ||||
'focus-within:ring-4', | 'focus-within:ring-4', | ||||
{ | { | ||||
@@ -98,7 +99,7 @@ export const MultilineTextInput = React.forwardRef< | |||||
data-testid="label" | data-testid="label" | ||||
id={labelId} | id={labelId} | ||||
htmlFor={id} | htmlFor={id} | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | ||||
{ | { | ||||
'sr-only': hiddenLabel, | 'sr-only': hiddenLabel, | ||||
@@ -129,7 +130,7 @@ export const MultilineTextInput = React.forwardRef< | |||||
style={{ | style={{ | ||||
height: 0, | height: 0, | ||||
}} | }} | ||||
className={clsx( | |||||
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', | ||||
'disabled:opacity-50 disabled:cursor-not-allowed', | 'disabled:opacity-50 disabled:cursor-not-allowed', | ||||
@@ -174,7 +175,7 @@ export const MultilineTextInput = React.forwardRef< | |||||
{hint && ( | {hint && ( | ||||
<div | <div | ||||
data-testid="hint" | data-testid="hint" | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | 'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | ||||
{ | { | ||||
'bottom-0 pl-4 pb-1': variant === 'default', | 'bottom-0 pl-4 pb-1': variant === 'default', | ||||
@@ -205,7 +206,7 @@ export const MultilineTextInput = React.forwardRef< | |||||
{indicator && ( | {indicator && ( | ||||
<div | <div | ||||
data-testid="indicator" | data-testid="indicator" | ||||
className={clsx( | |||||
className={tw( | |||||
'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none', | 'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none', | ||||
{ | { | ||||
'w-10': size === 'small', | 'w-10': size === 'small', | ||||
@@ -1,8 +1,9 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | |||||
import { TextControl, tailwind } from '@tesseract-design/web-base'; | |||||
import { useFallbackId } from '@modal-sh/react-utils'; | import { useFallbackId } from '@modal-sh/react-utils'; | ||||
const { tw } = tailwind; | |||||
const TextInputDerivedElementComponent = 'input' as const; | const TextInputDerivedElementComponent = 'input' as const; | ||||
/** | /** | ||||
@@ -99,7 +100,7 @@ export const TextInput = React.forwardRef<TextInputDerivedElement, TextInputProp | |||||
return ( | return ( | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'relative rounded ring-secondary/50 overflow-hidden group has-[:disabled]:opacity-50', | 'relative rounded ring-secondary/50 overflow-hidden group has-[:disabled]:opacity-50', | ||||
'focus-within:ring-4', | 'focus-within:ring-4', | ||||
{ | { | ||||
@@ -117,7 +118,7 @@ export const TextInput = React.forwardRef<TextInputDerivedElement, TextInputProp | |||||
data-testid="label" | data-testid="label" | ||||
htmlFor={id} | htmlFor={id} | ||||
id={labelId} | id={labelId} | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | ||||
{ | { | ||||
'sr-only': hiddenLabel, | 'sr-only': hiddenLabel, | ||||
@@ -148,7 +149,7 @@ export const TextInput = React.forwardRef<TextInputDerivedElement, TextInputProp | |||||
type={type} | type={type} | ||||
inputMode={resultInputMode} | inputMode={resultInputMode} | ||||
data-testid="input" | data-testid="input" | ||||
className={clsx( | |||||
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', | ||||
'disabled:opacity-50 disabled:cursor-not-allowed', | 'disabled:opacity-50 disabled:cursor-not-allowed', | ||||
@@ -182,7 +183,7 @@ export const TextInput = React.forwardRef<TextInputDerivedElement, TextInputProp | |||||
{hint && ( | {hint && ( | ||||
<div | <div | ||||
data-testid="hint" | data-testid="hint" | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | 'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | ||||
{ | { | ||||
'bottom-0 pl-4 pb-1': variant === 'default', | 'bottom-0 pl-4 pb-1': variant === 'default', | ||||
@@ -213,7 +214,7 @@ export const TextInput = React.forwardRef<TextInputDerivedElement, TextInputProp | |||||
{indicator && ( | {indicator && ( | ||||
<div | <div | ||||
data-testid="indicator" | data-testid="indicator" | ||||
className={clsx( | |||||
className={tw( | |||||
'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none', | 'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none', | ||||
{ | { | ||||
'w-10': size === 'small', | 'w-10': size === 'small', | ||||
@@ -61,12 +61,12 @@ | |||||
"publishConfig": { | "publishConfig": { | ||||
"access": "public" | "access": "public" | ||||
}, | }, | ||||
"dependencies": { | |||||
"clsx": "^1.2.1" | |||||
}, | |||||
"types": "./dist/types/index.d.ts", | "types": "./dist/types/index.d.ts", | ||||
"main": "./dist/cjs/production/index.js", | "main": "./dist/cjs/production/index.js", | ||||
"module": "./dist/esm/production/index.js", | "module": "./dist/esm/production/index.js", | ||||
"dependencies": { | |||||
"@tesseract-design/web-base": "workspace:*" | |||||
}, | |||||
"exports": { | "exports": { | ||||
".": { | ".": { | ||||
"development": { | "development": { | ||||
@@ -1,5 +1,7 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import clsx from 'clsx'; | |||||
import { tailwind } from '@tesseract-design/web-base'; | |||||
const { tw } = tailwind; | |||||
const BadgeDerivedElementComponent = 'span' as const; | const BadgeDerivedElementComponent = 'span' as const; | ||||
@@ -36,7 +38,7 @@ export const Badge = React.forwardRef<BadgeDerivedElement, BadgeProps>(( | |||||
<BadgeDerivedElementComponent | <BadgeDerivedElementComponent | ||||
{...etcProps} | {...etcProps} | ||||
ref={forwardedRef} | ref={forwardedRef} | ||||
className={clsx( | |||||
className={tw( | |||||
'relative h-6 min-w-6 inline-flex align-middle items-center justify-center text-xs font-bold overflow-hidden font-semi-expanded', | 'relative h-6 min-w-6 inline-flex align-middle items-center justify-center text-xs font-bold overflow-hidden font-semi-expanded', | ||||
'before:absolute before:top-0 before:left-0 before:w-full before:h-full before:bg-current before:opacity-25', | 'before:absolute before:top-0 before:left-0 before:w-full before:h-full before:bg-current before:opacity-25', | ||||
{ | { | ||||
@@ -1,5 +1,7 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import clsx from 'clsx'; | |||||
import { tailwind } from '@tesseract-design/web-base'; | |||||
const { tw } = tailwind; | |||||
const KeyValueTableDerivedElementComponent = 'dl' as const; | const KeyValueTableDerivedElementComponent = 'dl' as const; | ||||
@@ -63,7 +65,7 @@ export const KeyValueTable = React.forwardRef<KeyValueTableDerivedElement, KeyVa | |||||
) => ( | ) => ( | ||||
<KeyValueTableDerivedElementComponent | <KeyValueTableDerivedElementComponent | ||||
{...etcProps} | {...etcProps} | ||||
className={clsx( | |||||
className={tw( | |||||
'grid gap-y-1 grid-cols-3', | 'grid gap-y-1 grid-cols-3', | ||||
className, | className, | ||||
)} | )} | ||||
@@ -73,16 +75,16 @@ export const KeyValueTable = React.forwardRef<KeyValueTableDerivedElement, KeyVa | |||||
{properties.map((property) => typeof property === 'object' && property && ( | {properties.map((property) => typeof property === 'object' && property && ( | ||||
<KeyValueTablePropertyElementComponent | <KeyValueTablePropertyElementComponent | ||||
key={property.key} | key={property.key} | ||||
className={clsx('contents', property.className)} | |||||
className={tw('contents', property.className)} | |||||
> | > | ||||
<KeyValueTableKeyElementComponent | <KeyValueTableKeyElementComponent | ||||
className={clsx(hiddenKeys && 'sr-only', 'pr-4')} | |||||
className={tw(hiddenKeys && 'sr-only', 'pr-4')} | |||||
> | > | ||||
{property.key} | {property.key} | ||||
</KeyValueTableKeyElementComponent> | </KeyValueTableKeyElementComponent> | ||||
<KeyValueTableValueElementComponent | <KeyValueTableValueElementComponent | ||||
{...(property.valueProps ?? {})} | {...(property.valueProps ?? {})} | ||||
className={clsx( | |||||
className={tw( | |||||
'm-0 text-ellipsis overflow-hidden', | 'm-0 text-ellipsis overflow-hidden', | ||||
!hiddenKeys && 'col-span-2', | !hiddenKeys && 'col-span-2', | ||||
hiddenKeys && 'col-span-3', | hiddenKeys && 'col-span-3', | ||||
@@ -63,9 +63,7 @@ | |||||
}, | }, | ||||
"dependencies": { | "dependencies": { | ||||
"@modal-sh/react-utils": "workspace:*", | "@modal-sh/react-utils": "workspace:*", | ||||
"@tesseract-design/web-base": "workspace:*", | |||||
"clsx": "^1.2.1", | |||||
"tailwindcss": "3.3.2" | |||||
"@tesseract-design/web-base": "workspace:*" | |||||
}, | }, | ||||
"types": "./dist/types/index.d.ts", | "types": "./dist/types/index.d.ts", | ||||
"main": "./dist/cjs/production/index.js", | "main": "./dist/cjs/production/index.js", | ||||
@@ -1,9 +1,9 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | |||||
import { PluginCreator } from 'tailwindcss/types/config'; | |||||
import { TextControl, tailwind } from '@tesseract-design/web-base'; | |||||
import { useFallbackId } from '@modal-sh/react-utils'; | import { useFallbackId } from '@modal-sh/react-utils'; | ||||
const { tw } = tailwind; | |||||
const MenuMultiSelectDerivedElementComponent = 'select' as const; | const MenuMultiSelectDerivedElementComponent = 'select' as const; | ||||
/** | /** | ||||
@@ -55,7 +55,7 @@ export interface MenuMultiSelectProps extends Omit<React.HTMLProps<MenuMultiSele | |||||
startingHeight?: number | string, | startingHeight?: number | string, | ||||
} | } | ||||
export const menuMultiSelectPlugin: PluginCreator = ({ addComponents }) => { | |||||
export const menuMultiSelectPlugin: tailwind.PluginCreator = ({ addComponents }) => { | |||||
addComponents({ | addComponents({ | ||||
'.menu-multi-select': { | '.menu-multi-select': { | ||||
'& optgroup': { | '& optgroup': { | ||||
@@ -108,7 +108,7 @@ export const MenuMultiSelect = React.forwardRef< | |||||
return ( | return ( | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'menu-multi-select relative rounded ring-secondary/50 group has-[:disabled]:opacity-50', | 'menu-multi-select relative rounded ring-secondary/50 group has-[:disabled]:opacity-50', | ||||
'focus-within:ring-4', | 'focus-within:ring-4', | ||||
{ | { | ||||
@@ -126,7 +126,7 @@ export const MenuMultiSelect = React.forwardRef< | |||||
data-testid="label" | data-testid="label" | ||||
id={labelId} | id={labelId} | ||||
htmlFor={id} | htmlFor={id} | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | ||||
{ | { | ||||
'sr-only': hiddenLabel, | 'sr-only': hiddenLabel, | ||||
@@ -159,7 +159,7 @@ export const MenuMultiSelect = React.forwardRef< | |||||
style={{ | style={{ | ||||
height: startingHeight, | height: startingHeight, | ||||
}} | }} | ||||
className={clsx( | |||||
className={tw( | |||||
'bg-negative rounded-inherit w-full peer block overflow-auto font-inherit cursor-pointer', | 'bg-negative rounded-inherit w-full peer block overflow-auto font-inherit cursor-pointer', | ||||
'focus:outline-0', | 'focus:outline-0', | ||||
'disabled:opacity-50 disabled:cursor-not-allowed', | 'disabled:opacity-50 disabled:cursor-not-allowed', | ||||
@@ -204,7 +204,7 @@ export const MenuMultiSelect = React.forwardRef< | |||||
{hint && ( | {hint && ( | ||||
<div | <div | ||||
data-testid="hint" | data-testid="hint" | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | 'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | ||||
{ | { | ||||
'bottom-0 pl-4 pb-1': variant === 'default', | 'bottom-0 pl-4 pb-1': variant === 'default', | ||||
@@ -235,7 +235,7 @@ export const MenuMultiSelect = React.forwardRef< | |||||
{indicator && ( | {indicator && ( | ||||
<div | <div | ||||
data-testid="indicator" | data-testid="indicator" | ||||
className={clsx( | |||||
className={tw( | |||||
'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none', | 'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none', | ||||
{ | { | ||||
'w-10': size === 'small', | 'w-10': size === 'small', | ||||
@@ -1,9 +1,9 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { TagsInput } from './internal'; | import { TagsInput } from './internal'; | ||||
import clsx from 'clsx'; | |||||
import { PluginCreator } from 'tailwindcss/types/config'; | |||||
import { useClientSide, useFallbackId, useProxyInput } from '@modal-sh/react-utils'; | import { useClientSide, useFallbackId, useProxyInput } from '@modal-sh/react-utils'; | ||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import { TextControl, tailwind } from '@tesseract-design/web-base'; | |||||
const { tw } = tailwind; | |||||
export const AVAILABLE_TAG_INPUT_SEPARATORS = ['comma', 'newline', 'semicolon'] as const; | export const AVAILABLE_TAG_INPUT_SEPARATORS = ['comma', 'newline', 'semicolon'] as const; | ||||
@@ -96,7 +96,7 @@ export interface TagInputProps extends Omit<React.HTMLProps<TagInputDerivedEleme | |||||
valueSeparator?: TagInputSeparator, | valueSeparator?: TagInputSeparator, | ||||
} | } | ||||
export const tagInputPlugin: PluginCreator = ({ addComponents }) => { | |||||
export const tagInputPlugin: tailwind.PluginCreator = ({ addComponents }) => { | |||||
addComponents({ | addComponents({ | ||||
'.tag-input': { | '.tag-input': { | ||||
'&[data-size] label + * + div': { | '&[data-size] label + * + div': { | ||||
@@ -360,7 +360,7 @@ export const TagInput = React.forwardRef<TagInputDerivedElement, TagInputProps>( | |||||
<div | <div | ||||
data-size={size} | data-size={size} | ||||
data-variant={variant} | data-variant={variant} | ||||
className={clsx( | |||||
className={tw( | |||||
'relative rounded ring-secondary/50 group has-[:disabled]:opacity-50', | 'relative rounded ring-secondary/50 group has-[:disabled]:opacity-50', | ||||
'focus-within:ring-4', | 'focus-within:ring-4', | ||||
{ | { | ||||
@@ -385,7 +385,7 @@ export const TagInput = React.forwardRef<TagInputDerivedElement, TagInputProps>( | |||||
data-testid="label" | data-testid="label" | ||||
id={labelId} | id={labelId} | ||||
htmlFor={id} | htmlFor={id} | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | ||||
{ | { | ||||
'sr-only': hiddenLabel, | 'sr-only': hiddenLabel, | ||||
@@ -423,7 +423,7 @@ export const TagInput = React.forwardRef<TagInputDerivedElement, TagInputProps>( | |||||
height: 0, | height: 0, | ||||
}} | }} | ||||
tabIndex={clientSide ? -1 : undefined} | tabIndex={clientSide ? -1 : undefined} | ||||
className={clsx( | |||||
className={tw( | |||||
'bg-negative rounded-inherit peer block font-inherit', | 'bg-negative rounded-inherit peer block font-inherit', | ||||
'focus:outline-0', | 'focus:outline-0', | ||||
'disabled:opacity-50 disabled:cursor-not-allowed', | 'disabled:opacity-50 disabled:cursor-not-allowed', | ||||
@@ -483,7 +483,7 @@ export const TagInput = React.forwardRef<TagInputDerivedElement, TagInputProps>( | |||||
{hint && ( | {hint && ( | ||||
<div | <div | ||||
data-testid="hint" | data-testid="hint" | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | 'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | ||||
{ | { | ||||
'bottom-0 pl-4 pb-1': variant === 'default', | 'bottom-0 pl-4 pb-1': variant === 'default', | ||||
@@ -513,7 +513,7 @@ export const TagInput = React.forwardRef<TagInputDerivedElement, TagInputProps>( | |||||
)} | )} | ||||
{indicator && ( | {indicator && ( | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none', | 'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none', | ||||
{ | { | ||||
'w-10': size === 'small', | 'w-10': size === 'small', | ||||
@@ -1,9 +1,9 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import clsx from 'clsx'; | |||||
import { Button } from '@tesseract-design/web-base'; | |||||
import { PluginCreator } from 'tailwindcss/types/config'; | |||||
import { Button, tailwind } from '@tesseract-design/web-base'; | |||||
import { useFallbackId } from '@modal-sh/react-utils'; | import { useFallbackId } from '@modal-sh/react-utils'; | ||||
const { tw } = tailwind; | |||||
const ToggleButtonDerivedElementComponent = 'input' as const; | const ToggleButtonDerivedElementComponent = 'input' as const; | ||||
/** | /** | ||||
@@ -47,7 +47,7 @@ export interface ToggleButtonProps extends Omit<React.InputHTMLAttributes<Toggle | |||||
indeterminate?: boolean; | indeterminate?: boolean; | ||||
} | } | ||||
export const toggleButtonPlugin: PluginCreator = ({ addComponents, }) => { | |||||
export const toggleButtonPlugin: tailwind.PluginCreator = ({ addComponents, }) => { | |||||
addComponents({ | addComponents({ | ||||
'.toggle-button': { | '.toggle-button': { | ||||
'& + label > :first-child > :first-child': { | '& + label > :first-child > :first-child': { | ||||
@@ -115,7 +115,7 @@ export const ToggleButton = React.forwardRef<ToggleButtonDerivedElement, ToggleB | |||||
<label | <label | ||||
data-testid="button" | data-testid="button" | ||||
htmlFor={id} | htmlFor={id} | ||||
className={clsx( | |||||
className={tw( | |||||
'items-center justify-start rounded overflow-hidden ring-secondary/50 leading-none select-none cursor-pointer', | 'items-center justify-start rounded overflow-hidden ring-secondary/50 leading-none select-none cursor-pointer', | ||||
'peer-focus:outline-0 peer-focus:ring-4 peer-focus:ring-secondary/50', | 'peer-focus:outline-0 peer-focus:ring-4 peer-focus:ring-secondary/50', | ||||
'active:ring-tertiary/50 active:ring-4', | 'active:ring-tertiary/50 active:ring-4', | ||||
@@ -144,7 +144,7 @@ export const ToggleButton = React.forwardRef<ToggleButtonDerivedElement, ToggleB | |||||
style={style} | style={style} | ||||
> | > | ||||
<span | <span | ||||
className={clsx( | |||||
className={tw( | |||||
'w-6 h-6 block rounded border-2 p-0.5 box-border', | 'w-6 h-6 block rounded border-2 p-0.5 box-border', | ||||
{ | { | ||||
'border-current': variant !== 'filled', | 'border-current': variant !== 'filled', | ||||
@@ -153,7 +153,7 @@ export const ToggleButton = React.forwardRef<ToggleButtonDerivedElement, ToggleB | |||||
)} | )} | ||||
> | > | ||||
<svg | <svg | ||||
className={clsx( | |||||
className={tw( | |||||
'w-full h-full fill-none stroke-3 linejoin-round linecap-round', | 'w-full h-full fill-none stroke-3 linejoin-round linecap-round', | ||||
{ | { | ||||
'stroke-negative': variant === 'filled', | 'stroke-negative': variant === 'filled', | ||||
@@ -168,7 +168,7 @@ export const ToggleButton = React.forwardRef<ToggleButtonDerivedElement, ToggleB | |||||
/> | /> | ||||
</svg> | </svg> | ||||
<svg | <svg | ||||
className={clsx( | |||||
className={tw( | |||||
'w-full h-full fill-none stroke-3 linejoin-round linecap-round', | 'w-full h-full fill-none stroke-3 linejoin-round linecap-round', | ||||
{ | { | ||||
'stroke-negative': variant === 'filled', | 'stroke-negative': variant === 'filled', | ||||
@@ -184,7 +184,7 @@ export const ToggleButton = React.forwardRef<ToggleButtonDerivedElement, ToggleB | |||||
</svg> | </svg> | ||||
</span> | </span> | ||||
<span | <span | ||||
className={clsx( | |||||
className={tw( | |||||
'contents', | 'contents', | ||||
{ | { | ||||
'text-current': variant !== 'filled', | 'text-current': variant !== 'filled', | ||||
@@ -193,7 +193,7 @@ export const ToggleButton = React.forwardRef<ToggleButtonDerivedElement, ToggleB | |||||
)} | )} | ||||
> | > | ||||
<span | <span | ||||
className={clsx( | |||||
className={tw( | |||||
'flex-auto min-w-0', | 'flex-auto min-w-0', | ||||
)} | )} | ||||
> | > | ||||
@@ -1,8 +1,9 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import clsx from 'clsx'; | |||||
import { PluginCreator } from 'tailwindcss/types/config'; | |||||
import { tailwind } from '@tesseract-design/web-base'; | |||||
import { useFallbackId } from '@modal-sh/react-utils'; | import { useFallbackId } from '@modal-sh/react-utils'; | ||||
const { tw } = tailwind; | |||||
const ToggleSwitchDerivedElementComponent = 'input' as const; | const ToggleSwitchDerivedElementComponent = 'input' as const; | ||||
/** | /** | ||||
@@ -38,7 +39,7 @@ export interface ToggleSwitchProps extends Omit<React.InputHTMLAttributes<Toggle | |||||
uncheckedLabel?: React.ReactNode; | uncheckedLabel?: React.ReactNode; | ||||
} | } | ||||
export const toggleSwitchPlugin: PluginCreator = ({ addComponents }) => { | |||||
export const toggleSwitchPlugin: tailwind.PluginCreator = ({ addComponents }) => { | |||||
addComponents({ | addComponents({ | ||||
'.toggle-switch': { | '.toggle-switch': { | ||||
'& + label + label + label > :first-child': { | '& + label + label + label > :first-child': { | ||||
@@ -193,7 +194,7 @@ export const ToggleSwitch = React.forwardRef<ToggleSwitchDerivedElement, ToggleS | |||||
return ( | return ( | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'gap-x-4 flex-wrap', | 'gap-x-4 flex-wrap', | ||||
block && 'flex', | block && 'flex', | ||||
!block && 'inline-flex align-center', | !block && 'inline-flex align-center', | ||||
@@ -238,7 +239,7 @@ export const ToggleSwitch = React.forwardRef<ToggleSwitchDerivedElement, ToggleS | |||||
</label> | </label> | ||||
<label | <label | ||||
htmlFor={id} | htmlFor={id} | ||||
className={clsx( | |||||
className={tw( | |||||
'order-2 block rounded-full ring-secondary/50 overflow-hidden gap-4 leading-none select-none cursor-pointer', | 'order-2 block rounded-full ring-secondary/50 overflow-hidden gap-4 leading-none select-none cursor-pointer', | ||||
'peer-focus/radio:outline-0 peer-focus/radio:ring-4 peer-focus/radio:ring-secondary/50', | 'peer-focus/radio:outline-0 peer-focus/radio:ring-4 peer-focus/radio:ring-secondary/50', | ||||
'active:ring-tertiary/50 active:ring-4', | 'active:ring-tertiary/50 active:ring-4', | ||||
@@ -258,7 +259,7 @@ export const ToggleSwitch = React.forwardRef<ToggleSwitchDerivedElement, ToggleS | |||||
</label> | </label> | ||||
{subtext && ( | {subtext && ( | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'block w-full text-xs order-4', | 'block w-full text-xs order-4', | ||||
!uncheckedLabel && 'pl-16', | !uncheckedLabel && 'pl-16', | ||||
uncheckedLabel && 'pt-2', | uncheckedLabel && 'pt-2', | ||||
@@ -1,8 +1,9 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import clsx from 'clsx'; | |||||
import { PluginCreator } from 'tailwindcss/types/config'; | |||||
import { tailwind } from '@tesseract-design/web-base'; | |||||
import { useFallbackId } from '@modal-sh/react-utils'; | import { useFallbackId } from '@modal-sh/react-utils'; | ||||
const { tw } = tailwind; | |||||
const ToggleTickBoxDerivedElementComponent = 'input' as const; | const ToggleTickBoxDerivedElementComponent = 'input' as const; | ||||
/** | /** | ||||
@@ -30,7 +31,7 @@ export interface ToggleTickBoxProps extends Omit<React.InputHTMLAttributes<Toggl | |||||
indeterminate?: boolean; | indeterminate?: boolean; | ||||
} | } | ||||
export const toggleTickBoxPlugin: PluginCreator = ({ addComponents, }) => { | |||||
export const toggleTickBoxPlugin: tailwind.PluginCreator = ({ addComponents, }) => { | |||||
addComponents({ | addComponents({ | ||||
'.toggle-tick-box': { | '.toggle-tick-box': { | ||||
'& + label + label > :first-child > :first-child': { | '& + label + label > :first-child > :first-child': { | ||||
@@ -82,7 +83,7 @@ export const ToggleTickBox = React.forwardRef<ToggleTickBoxDerivedElement, Toggl | |||||
return ( | return ( | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'gap-x-4 flex-wrap', | 'gap-x-4 flex-wrap', | ||||
block && 'flex', | block && 'flex', | ||||
!block && 'inline-flex align-center', | !block && 'inline-flex align-center', | ||||
@@ -110,7 +111,7 @@ export const ToggleTickBox = React.forwardRef<ToggleTickBoxDerivedElement, Toggl | |||||
</label> | </label> | ||||
<label | <label | ||||
htmlFor={id} | htmlFor={id} | ||||
className={clsx( | |||||
className={tw( | |||||
'order-1 block rounded ring-secondary/50 overflow-hidden gap-4 leading-none select-none cursor-pointer', | 'order-1 block rounded ring-secondary/50 overflow-hidden gap-4 leading-none select-none cursor-pointer', | ||||
'peer-focus/radio:outline-0 peer-focus/radio:ring-4 peer-focus/radio:ring-secondary/50', | 'peer-focus/radio:outline-0 peer-focus/radio:ring-4 peer-focus/radio:ring-secondary/50', | ||||
'active:ring-tertiary/50 active:ring-4', | 'active:ring-tertiary/50 active:ring-4', | ||||
@@ -120,12 +121,12 @@ export const ToggleTickBox = React.forwardRef<ToggleTickBoxDerivedElement, Toggl | |||||
)} | )} | ||||
> | > | ||||
<span | <span | ||||
className={clsx( | |||||
className={tw( | |||||
'w-6 h-6 block rounded-inherit border-2 p-0.5 box-border border-current', | 'w-6 h-6 block rounded-inherit border-2 p-0.5 box-border border-current', | ||||
)} | )} | ||||
> | > | ||||
<svg | <svg | ||||
className={clsx( | |||||
className={tw( | |||||
'w-full h-full fill-none stroke-3 linejoin-round linecap-round stroke-current', | 'w-full h-full fill-none stroke-3 linejoin-round linecap-round stroke-current', | ||||
)} | )} | ||||
viewBox="0 0 24 24" | viewBox="0 0 24 24" | ||||
@@ -136,7 +137,7 @@ export const ToggleTickBox = React.forwardRef<ToggleTickBoxDerivedElement, Toggl | |||||
/> | /> | ||||
</svg> | </svg> | ||||
<svg | <svg | ||||
className={clsx( | |||||
className={tw( | |||||
'w-full h-full fill-none stroke-3 linejoin-round linecap-round stroke-current', | 'w-full h-full fill-none stroke-3 linejoin-round linecap-round stroke-current', | ||||
)} | )} | ||||
viewBox="0 0 24 24" | viewBox="0 0 24 24" | ||||
@@ -62,8 +62,7 @@ | |||||
"access": "public" | "access": "public" | ||||
}, | }, | ||||
"dependencies": { | "dependencies": { | ||||
"@tesseract-design/web-base": "workspace:*", | |||||
"clsx": "^1.2.1" | |||||
"@tesseract-design/web-base": "workspace:*" | |||||
}, | }, | ||||
"types": "./dist/types/index.d.ts", | "types": "./dist/types/index.d.ts", | ||||
"main": "./dist/cjs/production/index.js", | "main": "./dist/cjs/production/index.js", | ||||
@@ -1,6 +1,7 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import clsx from 'clsx'; | |||||
import { Button } from '@tesseract-design/web-base'; | |||||
import { Button, tailwind } from '@tesseract-design/web-base'; | |||||
const { tw } = tailwind; | |||||
const LinkButtonDerivedElementComponent = 'a' as const; | const LinkButtonDerivedElementComponent = 'a' as const; | ||||
@@ -118,7 +119,7 @@ export const LinkButton = React.forwardRef<LinkButtonDerivedElement, LinkButtonP | |||||
href={disabled ? undefined : href as string} | href={disabled ? undefined : href as string} | ||||
type={disabled ? 'button' : undefined} | type={disabled ? 'button' : undefined} | ||||
ref={forwardedRef} | ref={forwardedRef} | ||||
className={clsx( | |||||
className={tw( | |||||
'items-center justify-center rounded overflow-hidden ring-secondary/50 leading-none select-none no-underline m-0', | 'items-center justify-center rounded overflow-hidden ring-secondary/50 leading-none select-none no-underline m-0', | ||||
'focus:outline-0 focus:ring-4', | 'focus:outline-0 focus:ring-4', | ||||
'active:ring-tertiary/50', | 'active:ring-tertiary/50', | ||||
@@ -150,7 +151,7 @@ export const LinkButton = React.forwardRef<LinkButtonDerivedElement, LinkButtonP | |||||
> | > | ||||
<span | <span | ||||
data-testid="childrenParent" | data-testid="childrenParent" | ||||
className={clsx( | |||||
className={tw( | |||||
'flex-auto min-w-0 flex items-center gap-2', | 'flex-auto min-w-0 flex items-center gap-2', | ||||
iconAfterChildren ? 'flex-row-reverse' : 'flex-row', | iconAfterChildren ? 'flex-row-reverse' : 'flex-row', | ||||
)} | )} | ||||
@@ -164,7 +165,7 @@ export const LinkButton = React.forwardRef<LinkButtonDerivedElement, LinkButtonP | |||||
)} | )} | ||||
{(children || subtext) && ( | {(children || subtext) && ( | ||||
<span | <span | ||||
className={clsx( | |||||
className={tw( | |||||
'min-w-0 flex-auto', | 'min-w-0 flex-auto', | ||||
{ | { | ||||
'text-left': compact || menuItem, | 'text-left': compact || menuItem, | ||||
@@ -174,7 +175,7 @@ export const LinkButton = React.forwardRef<LinkButtonDerivedElement, LinkButtonP | |||||
> | > | ||||
{children && ( | {children && ( | ||||
<span | <span | ||||
className={clsx( | |||||
className={tw( | |||||
'block uppercase font-bold w-full whitespace-nowrap overflow-hidden text-ellipsis font-semi-expanded h-[1.1em]', | 'block uppercase font-bold w-full whitespace-nowrap overflow-hidden text-ellipsis font-semi-expanded h-[1.1em]', | ||||
)} | )} | ||||
data-testid="children" | data-testid="children" | ||||
@@ -63,9 +63,7 @@ | |||||
}, | }, | ||||
"dependencies": { | "dependencies": { | ||||
"@modal-sh/react-utils": "workspace:*", | "@modal-sh/react-utils": "workspace:*", | ||||
"@tesseract-design/web-base": "workspace:*", | |||||
"clsx": "^1.2.1", | |||||
"tailwindcss": "3.3.3" | |||||
"@tesseract-design/web-base": "workspace:*" | |||||
}, | }, | ||||
"types": "./dist/types/index.d.ts", | "types": "./dist/types/index.d.ts", | ||||
"main": "./dist/cjs/production/index.js", | "main": "./dist/cjs/production/index.js", | ||||
@@ -1,9 +1,9 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | |||||
import { PluginCreator } from 'tailwindcss/types/config'; | |||||
import { TextControl, tailwind } from '@tesseract-design/web-base'; | |||||
import { useBrowser, useClientSide, useFallbackId } from '@modal-sh/react-utils'; | import { useBrowser, useClientSide, useFallbackId } from '@modal-sh/react-utils'; | ||||
const { tw } = tailwind; | |||||
const NumberSpinnerDerivedElementComponent = 'input' as const; | const NumberSpinnerDerivedElementComponent = 'input' as const; | ||||
/** | /** | ||||
@@ -69,7 +69,7 @@ export interface NumberSpinnerProps extends Omit<React.HTMLProps<NumberSpinnerDe | |||||
initialStepDelay?: number, | initialStepDelay?: number, | ||||
} | } | ||||
export const numberSpinnerPlugin: PluginCreator = ({ addComponents, }) => { | |||||
export const numberSpinnerPlugin: tailwind.PluginCreator = ({ addComponents, }) => { | |||||
addComponents({ | addComponents({ | ||||
'.number-spinner': { | '.number-spinner': { | ||||
'&[data-browser="chrome"] > input::-webkit-inner-spin-button': { | '&[data-browser="chrome"] > input::-webkit-inner-spin-button': { | ||||
@@ -252,7 +252,7 @@ export const NumberSpinner = React.forwardRef<NumberSpinnerDerivedElement, Numbe | |||||
return ( | return ( | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'relative rounded ring-secondary/50 group has-[:disabled]:opacity-50', | 'relative rounded ring-secondary/50 group has-[:disabled]:opacity-50', | ||||
'focus-within:ring-4', | 'focus-within:ring-4', | ||||
'number-spinner', | 'number-spinner', | ||||
@@ -273,7 +273,7 @@ export const NumberSpinner = React.forwardRef<NumberSpinnerDerivedElement, Numbe | |||||
data-testid="label" | data-testid="label" | ||||
id={labelId} | id={labelId} | ||||
htmlFor={id} | htmlFor={id} | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | ||||
{ | { | ||||
'sr-only': hiddenLabel, | 'sr-only': hiddenLabel, | ||||
@@ -304,7 +304,7 @@ export const NumberSpinner = React.forwardRef<NumberSpinnerDerivedElement, Numbe | |||||
type="number" | type="number" | ||||
data-testid="input" | data-testid="input" | ||||
onKeyDown={doStepKeyboard} | onKeyDown={doStepKeyboard} | ||||
className={clsx( | |||||
className={tw( | |||||
'bg-negative rounded-inherit w-full peer block tabular-nums font-inherit relative', | 'bg-negative rounded-inherit w-full peer block tabular-nums font-inherit relative', | ||||
'focus:outline-0', | 'focus:outline-0', | ||||
'disabled:opacity-50 disabled:cursor-not-allowed', | 'disabled:opacity-50 disabled:cursor-not-allowed', | ||||
@@ -338,7 +338,7 @@ export const NumberSpinner = React.forwardRef<NumberSpinnerDerivedElement, Numbe | |||||
{hint && ( | {hint && ( | ||||
<div | <div | ||||
data-testid="hint" | data-testid="hint" | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none text-primary', | 'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none text-primary', | ||||
{ | { | ||||
'bottom-0 pl-4 pb-1': variant === 'default', | 'bottom-0 pl-4 pb-1': variant === 'default', | ||||
@@ -370,7 +370,7 @@ export const NumberSpinner = React.forwardRef<NumberSpinnerDerivedElement, Numbe | |||||
<NumberSpinnerActionElementComponent | <NumberSpinnerActionElementComponent | ||||
data-testid="indicator" | data-testid="indicator" | ||||
type="button" | type="button" | ||||
className={clsx( | |||||
className={tw( | |||||
'text-center z-[1] flex flex-col items-stretch justify-center aspect-square absolute bottom-0 right-0 select-none text-primary group-focus-within:text-secondary', | 'text-center z-[1] flex flex-col items-stretch justify-center aspect-square absolute bottom-0 right-0 select-none text-primary group-focus-within:text-secondary', | ||||
{ | { | ||||
'w-10': size === 'small', | 'w-10': size === 'small', | ||||
@@ -381,7 +381,7 @@ export const NumberSpinner = React.forwardRef<NumberSpinnerDerivedElement, Numbe | |||||
onMouseDown={doStepMouse} | onMouseDown={doStepMouse} | ||||
> | > | ||||
<span | <span | ||||
className={clsx( | |||||
className={tw( | |||||
'h-0 flex-auto flex justify-center items-end overflow-hidden', | 'h-0 flex-auto flex justify-center items-end overflow-hidden', | ||||
{ | { | ||||
'text-tertiary': displayStep === true, | 'text-tertiary': displayStep === true, | ||||
@@ -404,7 +404,7 @@ export const NumberSpinner = React.forwardRef<NumberSpinnerDerivedElement, Numbe | |||||
/ | / | ||||
</span> | </span> | ||||
<span | <span | ||||
className={clsx( | |||||
className={tw( | |||||
'h-0 flex-auto flex justify-center items-end overflow-hidden', | 'h-0 flex-auto flex justify-center items-end overflow-hidden', | ||||
{ | { | ||||
'text-tertiary': displayStep === false, | 'text-tertiary': displayStep === false, | ||||
@@ -1,8 +1,9 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import clsx from 'clsx'; | |||||
import { PluginCreator } from 'tailwindcss/types/config'; | |||||
import { tailwind } from '@tesseract-design/web-base'; | |||||
import { useBrowser } from '@modal-sh/react-utils'; | import { useBrowser } from '@modal-sh/react-utils'; | ||||
const { tw } = tailwind; | |||||
const filterOptions = (children: React.ReactNode): React.ReactNode => { | const filterOptions = (children: React.ReactNode): React.ReactNode => { | ||||
const childrenArray = Array.isArray(children) ? children : [children]; | const childrenArray = Array.isArray(children) ? children : [children]; | ||||
return childrenArray.reduce( | return childrenArray.reduce( | ||||
@@ -70,7 +71,7 @@ export interface SliderProps extends Omit<React.HTMLProps<SliderDerivedElement>, | |||||
length?: React.CSSProperties['width']; | length?: React.CSSProperties['width']; | ||||
} | } | ||||
export const sliderPlugin: PluginCreator = ({ addComponents }) => { | |||||
export const sliderPlugin: tailwind.PluginCreator = ({ addComponents }) => { | |||||
addComponents({ | addComponents({ | ||||
'.slider': { | '.slider': { | ||||
'& > input': { | '& > input': { | ||||
@@ -438,7 +439,7 @@ export const Slider = React.forwardRef<SliderDerivedElement, SliderProps>(( | |||||
</datalist> | </datalist> | ||||
)} | )} | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
block && orient !== 'vertical' && 'w-full', | block && orient !== 'vertical' && 'w-full', | ||||
!block && 'align-middle', | !block && 'align-middle', | ||||
className, | className, | ||||
@@ -465,7 +466,7 @@ export const Slider = React.forwardRef<SliderDerivedElement, SliderProps>(( | |||||
max={maxValue} | max={maxValue} | ||||
type="range" | type="range" | ||||
list={childrenValues ? tickMarkId : undefined} | list={childrenValues ? tickMarkId : undefined} | ||||
className={clsx( | |||||
className={tw( | |||||
'w-full h-full bg-inherit block text-primary ring-secondary/50 rounded-full', | 'w-full h-full bg-inherit block text-primary ring-secondary/50 rounded-full', | ||||
'focus:text-secondary focus:outline-0 focus:ring-4', | 'focus:text-secondary focus:outline-0 focus:ring-4', | ||||
'active:text-tertiary active:ring-tertiary/50', | 'active:text-tertiary active:ring-tertiary/50', | ||||
@@ -63,9 +63,7 @@ | |||||
}, | }, | ||||
"dependencies": { | "dependencies": { | ||||
"@modal-sh/react-utils": "workspace:*", | "@modal-sh/react-utils": "workspace:*", | ||||
"@tesseract-design/web-base": "workspace:*", | |||||
"clsx": "^1.2.1", | |||||
"tailwindcss": "3.3.3" | |||||
"@tesseract-design/web-base": "workspace:*" | |||||
}, | }, | ||||
"types": "./dist/types/index.d.ts", | "types": "./dist/types/index.d.ts", | ||||
"main": "./dist/cjs/production/index.js", | "main": "./dist/cjs/production/index.js", | ||||
@@ -1,9 +1,9 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | |||||
import { PluginCreator } from 'tailwindcss/types/config'; | |||||
import { TextControl, tailwind } from '@tesseract-design/web-base'; | |||||
import { useFallbackId } from '@modal-sh/react-utils'; | import { useFallbackId } from '@modal-sh/react-utils'; | ||||
const { tw } = tailwind; | |||||
const DateDropdownDerivedElementComponent = 'input'; | const DateDropdownDerivedElementComponent = 'input'; | ||||
/** | /** | ||||
@@ -51,7 +51,7 @@ export interface DateDropdownProps extends Omit<React.HTMLProps<DateDropdownDeri | |||||
length?: number, | length?: number, | ||||
} | } | ||||
export const dateDropdownPlugin: PluginCreator = ({ addComponents }) => { | |||||
export const dateDropdownPlugin: tailwind.PluginCreator = ({ addComponents }) => { | |||||
addComponents({ | addComponents({ | ||||
'.date-dropdown': { | '.date-dropdown': { | ||||
'& > input::-webkit-calendar-picker-indicator': { | '& > input::-webkit-calendar-picker-indicator': { | ||||
@@ -105,7 +105,7 @@ export const DateDropdown = React.forwardRef< | |||||
return ( | return ( | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'relative rounded ring-secondary/50 overflow-hidden group has-[:disabled]:opacity-50 date-dropdown', | 'relative rounded ring-secondary/50 overflow-hidden group has-[:disabled]:opacity-50 date-dropdown', | ||||
'focus-within:ring-4', | 'focus-within:ring-4', | ||||
{ | { | ||||
@@ -124,7 +124,7 @@ export const DateDropdown = React.forwardRef< | |||||
data-testid="label" | data-testid="label" | ||||
id={labelId} | id={labelId} | ||||
htmlFor={id} | htmlFor={id} | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | ||||
{ | { | ||||
'sr-only': hiddenLabel, | 'sr-only': hiddenLabel, | ||||
@@ -152,7 +152,7 @@ export const DateDropdown = React.forwardRef< | |||||
type="date" | type="date" | ||||
data-testid="input" | data-testid="input" | ||||
pattern="\d{4}-\d{2}-\d{2}" | pattern="\d{4}-\d{2}-\d{2}" | ||||
className={clsx( | |||||
className={tw( | |||||
'bg-negative rounded-inherit w-full peer block font-inherit tabular-nums cursor-pointer', | 'bg-negative rounded-inherit w-full peer block font-inherit tabular-nums cursor-pointer', | ||||
'focus:outline-0', | 'focus:outline-0', | ||||
'disabled:cursor-not-allowed', | 'disabled:cursor-not-allowed', | ||||
@@ -170,7 +170,7 @@ export const DateDropdown = React.forwardRef< | |||||
{hint && ( | {hint && ( | ||||
<div | <div | ||||
data-testid="hint" | data-testid="hint" | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | 'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | ||||
{ | { | ||||
'bottom-0 pl-4 pb-1': variant === 'default', | 'bottom-0 pl-4 pb-1': variant === 'default', | ||||
@@ -196,7 +196,7 @@ export const DateDropdown = React.forwardRef< | |||||
)} | )} | ||||
<div | <div | ||||
data-testid="indicator" | data-testid="indicator" | ||||
className={clsx( | |||||
className={tw( | |||||
'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none text-primary group-focus-within:text-secondary', | 'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none text-primary group-focus-within:text-secondary', | ||||
{ | { | ||||
'w-10': size === 'small', | 'w-10': size === 'small', | ||||
@@ -1,9 +1,9 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | |||||
import { PluginCreator } from 'tailwindcss/types/config'; | |||||
import { TextControl, tailwind } from '@tesseract-design/web-base'; | |||||
import { useFallbackId } from '@modal-sh/react-utils'; | import { useFallbackId } from '@modal-sh/react-utils'; | ||||
const { tw } = tailwind; | |||||
const TimeSpinnerDerivedElementComponent = 'input'; | const TimeSpinnerDerivedElementComponent = 'input'; | ||||
/** | /** | ||||
@@ -69,7 +69,7 @@ export interface TimeSpinnerProps extends Omit<React.HTMLProps<TimeSpinnerDerive | |||||
step?: Step | string, | step?: Step | string, | ||||
} | } | ||||
export const timeSpinnerPlugin: PluginCreator = ({ addComponents }) => { | |||||
export const timeSpinnerPlugin: tailwind.PluginCreator = ({ addComponents }) => { | |||||
addComponents({ | addComponents({ | ||||
'.time-spinner': { | '.time-spinner': { | ||||
'& > input::-webkit-calendar-picker-indicator': { | '& > input::-webkit-calendar-picker-indicator': { | ||||
@@ -127,7 +127,7 @@ export const TimeSpinner = React.forwardRef< | |||||
return ( | return ( | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'time-spinner relative rounded ring-secondary/50 overflow-hidden group has-[:disabled]:opacity-50', | 'time-spinner relative rounded ring-secondary/50 overflow-hidden group has-[:disabled]:opacity-50', | ||||
'focus-within:ring-4', | 'focus-within:ring-4', | ||||
{ | { | ||||
@@ -146,7 +146,7 @@ export const TimeSpinner = React.forwardRef< | |||||
data-testid="label" | data-testid="label" | ||||
id={labelId} | id={labelId} | ||||
htmlFor={id} | htmlFor={id} | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold group-focus-within:text-secondary text-primary leading-none bg-negative select-none', | ||||
{ | { | ||||
'sr-only': hiddenLabel, | 'sr-only': hiddenLabel, | ||||
@@ -174,7 +174,7 @@ export const TimeSpinner = React.forwardRef< | |||||
data-testid="input" | data-testid="input" | ||||
step={displaySeconds && stepValue > 60 ? 1 : stepValue} | step={displaySeconds && stepValue > 60 ? 1 : stepValue} | ||||
pattern="\d{2}:\d{2}(:\d{2})?" | pattern="\d{2}:\d{2}(:\d{2})?" | ||||
className={clsx( | |||||
className={tw( | |||||
'bg-negative rounded-inherit w-full peer block font-inherit tabular-nums cursor-pointer', | 'bg-negative rounded-inherit w-full peer block font-inherit tabular-nums cursor-pointer', | ||||
'focus:outline-0', | 'focus:outline-0', | ||||
'disabled:cursor-not-allowed', | 'disabled:cursor-not-allowed', | ||||
@@ -192,7 +192,7 @@ export const TimeSpinner = React.forwardRef< | |||||
{hint && ( | {hint && ( | ||||
<div | <div | ||||
data-testid="hint" | data-testid="hint" | ||||
className={clsx( | |||||
className={tw( | |||||
'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | 'absolute left-0 px-1 pointer-events-none text-xxs leading-none w-full bg-negative select-none', | ||||
{ | { | ||||
'bottom-0 pl-4 pb-1': variant === 'default', | 'bottom-0 pl-4 pb-1': variant === 'default', | ||||
@@ -217,7 +217,7 @@ export const TimeSpinner = React.forwardRef< | |||||
</div> | </div> | ||||
)} | )} | ||||
<div | <div | ||||
className={clsx( | |||||
className={tw( | |||||
'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none text-primary group-focus-within:text-secondary', | 'text-center flex items-center justify-center aspect-square absolute bottom-0 right-0 pointer-events-none select-none text-primary group-focus-within:text-secondary', | ||||
{ | { | ||||
'w-10': size === 'small', | 'w-10': size === 'small', | ||||
@@ -7,6 +7,16 @@ settings: | |||||
importers: | importers: | ||||
base: | base: | ||||
dependencies: | |||||
clsx: | |||||
specifier: ^1.2.1 | |||||
version: 1.2.1 | |||||
tailwind-merge: | |||||
specifier: ^1.14.0 | |||||
version: 1.14.0 | |||||
tailwindcss: | |||||
specifier: ^3.3.3 | |||||
version: 3.3.3 | |||||
devDependencies: | devDependencies: | ||||
'@storybook/react': | '@storybook/react': | ||||
specifier: ^7.3.2 | specifier: ^7.3.2 | ||||
@@ -38,9 +48,6 @@ importers: | |||||
'@tesseract-design/web-base': | '@tesseract-design/web-base': | ||||
specifier: workspace:* | specifier: workspace:* | ||||
version: link:../../../../base | version: link:../../../../base | ||||
clsx: | |||||
specifier: ^1.2.1 | |||||
version: 1.2.1 | |||||
devDependencies: | devDependencies: | ||||
'@storybook/react': | '@storybook/react': | ||||
specifier: ^7.3.2 | specifier: ^7.3.2 | ||||
@@ -102,9 +109,9 @@ importers: | |||||
'@modal-sh/react-utils': | '@modal-sh/react-utils': | ||||
specifier: workspace:* | specifier: workspace:* | ||||
version: link:../../../../packages/react-utils | version: link:../../../../packages/react-utils | ||||
clsx: | |||||
specifier: ^1.2.1 | |||||
version: 1.2.1 | |||||
'@tesseract-design/web-base': | |||||
specifier: workspace:* | |||||
version: link:../../../../base | |||||
devDependencies: | devDependencies: | ||||
'@storybook/react': | '@storybook/react': | ||||
specifier: ^7.3.2 | specifier: ^7.3.2 | ||||
@@ -169,12 +176,6 @@ importers: | |||||
'@tesseract-design/web-base': | '@tesseract-design/web-base': | ||||
specifier: workspace:* | specifier: workspace:* | ||||
version: link:../../../../base | version: link:../../../../base | ||||
clsx: | |||||
specifier: ^1.2.1 | |||||
version: 1.2.1 | |||||
tailwindcss: | |||||
specifier: 3.3.2 | |||||
version: 3.3.2 | |||||
devDependencies: | devDependencies: | ||||
'@storybook/react': | '@storybook/react': | ||||
specifier: ^7.3.2 | specifier: ^7.3.2 | ||||
@@ -233,18 +234,15 @@ importers: | |||||
categories/web/color/react: | categories/web/color/react: | ||||
dependencies: | dependencies: | ||||
clsx: | |||||
specifier: ^1.2.1 | |||||
version: 1.2.1 | |||||
'@tesseract-design/web-base': | |||||
specifier: workspace:* | |||||
version: link:../../../../base | |||||
color: | color: | ||||
specifier: ^4.2.3 | specifier: ^4.2.3 | ||||
version: 4.2.3 | version: 4.2.3 | ||||
color-convert: | color-convert: | ||||
specifier: ^2.0.1 | specifier: ^2.0.1 | ||||
version: 2.0.1 | version: 2.0.1 | ||||
tailwindcss: | |||||
specifier: 3.3.2 | |||||
version: 3.3.2 | |||||
devDependencies: | devDependencies: | ||||
'@storybook/react': | '@storybook/react': | ||||
specifier: ^7.3.2 | specifier: ^7.3.2 | ||||
@@ -315,9 +313,6 @@ importers: | |||||
'@tesseract-design/web-base': | '@tesseract-design/web-base': | ||||
specifier: workspace:* | specifier: workspace:* | ||||
version: link:../../../../base | version: link:../../../../base | ||||
clsx: | |||||
specifier: ^1.2.1 | |||||
version: 1.2.1 | |||||
react-phone-number-input: | react-phone-number-input: | ||||
specifier: ^3.3.0 | specifier: ^3.3.0 | ||||
version: 3.3.0(react-dom@18.2.0)(react@18.2.0) | version: 3.3.0(react-dom@18.2.0)(react@18.2.0) | ||||
@@ -385,9 +380,6 @@ importers: | |||||
'@tesseract-design/web-base': | '@tesseract-design/web-base': | ||||
specifier: workspace:* | specifier: workspace:* | ||||
version: link:../../../../base | version: link:../../../../base | ||||
clsx: | |||||
specifier: ^1.2.1 | |||||
version: 1.2.1 | |||||
devDependencies: | devDependencies: | ||||
'@storybook/react': | '@storybook/react': | ||||
specifier: ^7.3.2 | specifier: ^7.3.2 | ||||
@@ -446,9 +438,9 @@ importers: | |||||
categories/web/information/react: | categories/web/information/react: | ||||
dependencies: | dependencies: | ||||
clsx: | |||||
specifier: ^1.2.1 | |||||
version: 1.2.1 | |||||
'@tesseract-design/web-base': | |||||
specifier: workspace:* | |||||
version: link:../../../../base | |||||
devDependencies: | devDependencies: | ||||
'@storybook/react': | '@storybook/react': | ||||
specifier: ^7.3.2 | specifier: ^7.3.2 | ||||
@@ -513,12 +505,6 @@ importers: | |||||
'@tesseract-design/web-base': | '@tesseract-design/web-base': | ||||
specifier: workspace:* | specifier: workspace:* | ||||
version: link:../../../../base | version: link:../../../../base | ||||
clsx: | |||||
specifier: ^1.2.1 | |||||
version: 1.2.1 | |||||
tailwindcss: | |||||
specifier: 3.3.2 | |||||
version: 3.3.2 | |||||
devDependencies: | devDependencies: | ||||
'@storybook/react': | '@storybook/react': | ||||
specifier: ^7.3.2 | specifier: ^7.3.2 | ||||
@@ -580,9 +566,6 @@ importers: | |||||
'@tesseract-design/web-base': | '@tesseract-design/web-base': | ||||
specifier: workspace:* | specifier: workspace:* | ||||
version: link:../../../../base | version: link:../../../../base | ||||
clsx: | |||||
specifier: ^1.2.1 | |||||
version: 1.2.1 | |||||
devDependencies: | devDependencies: | ||||
'@storybook/react': | '@storybook/react': | ||||
specifier: ^7.4.0 | specifier: ^7.4.0 | ||||
@@ -647,12 +630,6 @@ importers: | |||||
'@tesseract-design/web-base': | '@tesseract-design/web-base': | ||||
specifier: workspace:* | specifier: workspace:* | ||||
version: link:../../../../base | version: link:../../../../base | ||||
clsx: | |||||
specifier: ^1.2.1 | |||||
version: 1.2.1 | |||||
tailwindcss: | |||||
specifier: 3.3.3 | |||||
version: 3.3.3 | |||||
devDependencies: | devDependencies: | ||||
'@storybook/react': | '@storybook/react': | ||||
specifier: ^7.3.2 | specifier: ^7.3.2 | ||||
@@ -717,12 +694,6 @@ importers: | |||||
'@tesseract-design/web-base': | '@tesseract-design/web-base': | ||||
specifier: workspace:* | specifier: workspace:* | ||||
version: link:../../../../base | version: link:../../../../base | ||||
clsx: | |||||
specifier: ^1.2.1 | |||||
version: 1.2.1 | |||||
tailwindcss: | |||||
specifier: 3.3.3 | |||||
version: 3.3.3 | |||||
devDependencies: | devDependencies: | ||||
'@storybook/react': | '@storybook/react': | ||||
specifier: ^7.3.2 | specifier: ^7.3.2 | ||||
@@ -3502,6 +3473,18 @@ packages: | |||||
get-intrinsic: 1.2.1 | get-intrinsic: 1.2.1 | ||||
dev: true | dev: true | ||||
/arraybuffer.prototype.slice@1.0.1: | |||||
resolution: {integrity: sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==} | |||||
engines: {node: '>= 0.4'} | |||||
dependencies: | |||||
array-buffer-byte-length: 1.0.0 | |||||
call-bind: 1.0.2 | |||||
define-properties: 1.2.0 | |||||
get-intrinsic: 1.2.1 | |||||
is-array-buffer: 3.0.2 | |||||
is-shared-array-buffer: 1.0.2 | |||||
dev: true | |||||
/asn1@0.2.6: | /asn1@0.2.6: | ||||
resolution: {integrity: sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==} | resolution: {integrity: sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==} | ||||
dependencies: | dependencies: | ||||
@@ -4337,6 +4320,51 @@ packages: | |||||
which-typed-array: 1.1.9 | which-typed-array: 1.1.9 | ||||
dev: true | dev: true | ||||
/es-abstract@1.22.1: | |||||
resolution: {integrity: sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==} | |||||
engines: {node: '>= 0.4'} | |||||
dependencies: | |||||
array-buffer-byte-length: 1.0.0 | |||||
arraybuffer.prototype.slice: 1.0.1 | |||||
available-typed-arrays: 1.0.5 | |||||
call-bind: 1.0.2 | |||||
es-set-tostringtag: 2.0.1 | |||||
es-to-primitive: 1.2.1 | |||||
function.prototype.name: 1.1.5 | |||||
get-intrinsic: 1.2.1 | |||||
get-symbol-description: 1.0.0 | |||||
globalthis: 1.0.3 | |||||
gopd: 1.0.1 | |||||
has: 1.0.3 | |||||
has-property-descriptors: 1.0.0 | |||||
has-proto: 1.0.1 | |||||
has-symbols: 1.0.3 | |||||
internal-slot: 1.0.5 | |||||
is-array-buffer: 3.0.2 | |||||
is-callable: 1.2.7 | |||||
is-negative-zero: 2.0.2 | |||||
is-regex: 1.1.4 | |||||
is-shared-array-buffer: 1.0.2 | |||||
is-string: 1.0.7 | |||||
is-typed-array: 1.1.10 | |||||
is-weakref: 1.0.2 | |||||
object-inspect: 1.12.3 | |||||
object-keys: 1.1.1 | |||||
object.assign: 4.1.4 | |||||
regexp.prototype.flags: 1.5.0 | |||||
safe-array-concat: 1.0.0 | |||||
safe-regex-test: 1.0.0 | |||||
string.prototype.trim: 1.2.7 | |||||
string.prototype.trimend: 1.0.6 | |||||
string.prototype.trimstart: 1.0.6 | |||||
typed-array-buffer: 1.0.0 | |||||
typed-array-byte-length: 1.0.0 | |||||
typed-array-byte-offset: 1.0.0 | |||||
typed-array-length: 1.0.4 | |||||
unbox-primitive: 1.0.2 | |||||
which-typed-array: 1.1.11 | |||||
dev: true | |||||
/es-get-iterator@1.1.3: | /es-get-iterator@1.1.3: | ||||
resolution: {integrity: sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==} | resolution: {integrity: sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==} | ||||
dependencies: | dependencies: | ||||
@@ -5458,7 +5486,7 @@ packages: | |||||
dependencies: | dependencies: | ||||
call-bind: 1.0.2 | call-bind: 1.0.2 | ||||
define-properties: 1.2.0 | define-properties: 1.2.0 | ||||
es-abstract: 1.21.2 | |||||
es-abstract: 1.22.1 | |||||
functions-have-names: 1.2.3 | functions-have-names: 1.2.3 | ||||
dev: true | dev: true | ||||
@@ -7393,18 +7421,6 @@ packages: | |||||
engines: {node: '>=4.0.0'} | engines: {node: '>=4.0.0'} | ||||
dev: false | dev: false | ||||
/postcss-import@15.1.0(postcss@8.4.24): | |||||
resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} | |||||
engines: {node: '>=14.0.0'} | |||||
peerDependencies: | |||||
postcss: ^8.0.0 | |||||
dependencies: | |||||
postcss: 8.4.24 | |||||
postcss-value-parser: 4.2.0 | |||||
read-cache: 1.0.0 | |||||
resolve: 1.22.2 | |||||
dev: false | |||||
/postcss-import@15.1.0(postcss@8.4.28): | /postcss-import@15.1.0(postcss@8.4.28): | ||||
resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} | resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} | ||||
engines: {node: '>=14.0.0'} | engines: {node: '>=14.0.0'} | ||||
@@ -7417,16 +7433,6 @@ packages: | |||||
resolve: 1.22.2 | resolve: 1.22.2 | ||||
dev: false | dev: false | ||||
/postcss-js@4.0.1(postcss@8.4.24): | |||||
resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==} | |||||
engines: {node: ^12 || ^14 || >= 16} | |||||
peerDependencies: | |||||
postcss: ^8.4.21 | |||||
dependencies: | |||||
camelcase-css: 2.0.1 | |||||
postcss: 8.4.24 | |||||
dev: false | |||||
/postcss-js@4.0.1(postcss@8.4.28): | /postcss-js@4.0.1(postcss@8.4.28): | ||||
resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==} | resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==} | ||||
engines: {node: ^12 || ^14 || >= 16} | engines: {node: ^12 || ^14 || >= 16} | ||||
@@ -7437,23 +7443,6 @@ packages: | |||||
postcss: 8.4.28 | postcss: 8.4.28 | ||||
dev: false | dev: false | ||||
/postcss-load-config@4.0.1(postcss@8.4.24): | |||||
resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} | |||||
engines: {node: '>= 14'} | |||||
peerDependencies: | |||||
postcss: '>=8.0.9' | |||||
ts-node: '>=9.0.0' | |||||
peerDependenciesMeta: | |||||
postcss: | |||||
optional: true | |||||
ts-node: | |||||
optional: true | |||||
dependencies: | |||||
lilconfig: 2.1.0 | |||||
postcss: 8.4.24 | |||||
yaml: 2.3.1 | |||||
dev: false | |||||
/postcss-load-config@4.0.1(postcss@8.4.28): | /postcss-load-config@4.0.1(postcss@8.4.28): | ||||
resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} | resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} | ||||
engines: {node: '>= 14'} | engines: {node: '>= 14'} | ||||
@@ -7471,16 +7460,6 @@ packages: | |||||
yaml: 2.3.1 | yaml: 2.3.1 | ||||
dev: false | dev: false | ||||
/postcss-nested@6.0.1(postcss@8.4.24): | |||||
resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==} | |||||
engines: {node: '>=12.0'} | |||||
peerDependencies: | |||||
postcss: ^8.2.14 | |||||
dependencies: | |||||
postcss: 8.4.24 | |||||
postcss-selector-parser: 6.0.13 | |||||
dev: false | |||||
/postcss-nested@6.0.1(postcss@8.4.28): | /postcss-nested@6.0.1(postcss@8.4.28): | ||||
resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==} | resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==} | ||||
engines: {node: '>=12.0'} | engines: {node: '>=12.0'} | ||||
@@ -7509,6 +7488,7 @@ packages: | |||||
nanoid: 3.3.6 | nanoid: 3.3.6 | ||||
picocolors: 1.0.0 | picocolors: 1.0.0 | ||||
source-map-js: 1.0.2 | source-map-js: 1.0.2 | ||||
dev: true | |||||
/postcss@8.4.28: | /postcss@8.4.28: | ||||
resolution: {integrity: sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw==} | resolution: {integrity: sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw==} | ||||
@@ -7517,7 +7497,6 @@ packages: | |||||
nanoid: 3.3.6 | nanoid: 3.3.6 | ||||
picocolors: 1.0.0 | picocolors: 1.0.0 | ||||
source-map-js: 1.0.2 | source-map-js: 1.0.2 | ||||
dev: false | |||||
/prelude-ls@1.2.1: | /prelude-ls@1.2.1: | ||||
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} | resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} | ||||
@@ -7997,6 +7976,16 @@ packages: | |||||
mri: 1.2.0 | mri: 1.2.0 | ||||
dev: false | dev: false | ||||
/safe-array-concat@1.0.0: | |||||
resolution: {integrity: sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==} | |||||
engines: {node: '>=0.4'} | |||||
dependencies: | |||||
call-bind: 1.0.2 | |||||
get-intrinsic: 1.2.1 | |||||
has-symbols: 1.0.3 | |||||
isarray: 2.0.5 | |||||
dev: true | |||||
/safe-buffer@5.2.1: | /safe-buffer@5.2.1: | ||||
resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} | resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} | ||||
@@ -8223,7 +8212,7 @@ packages: | |||||
dependencies: | dependencies: | ||||
call-bind: 1.0.2 | call-bind: 1.0.2 | ||||
define-properties: 1.2.0 | define-properties: 1.2.0 | ||||
es-abstract: 1.21.2 | |||||
es-abstract: 1.22.1 | |||||
dev: true | dev: true | ||||
/string.prototype.trimend@1.0.6: | /string.prototype.trimend@1.0.6: | ||||
@@ -8231,7 +8220,7 @@ packages: | |||||
dependencies: | dependencies: | ||||
call-bind: 1.0.2 | call-bind: 1.0.2 | ||||
define-properties: 1.2.0 | define-properties: 1.2.0 | ||||
es-abstract: 1.21.2 | |||||
es-abstract: 1.22.1 | |||||
dev: true | dev: true | ||||
/string.prototype.trimstart@1.0.6: | /string.prototype.trimstart@1.0.6: | ||||
@@ -8239,7 +8228,7 @@ packages: | |||||
dependencies: | dependencies: | ||||
call-bind: 1.0.2 | call-bind: 1.0.2 | ||||
define-properties: 1.2.0 | define-properties: 1.2.0 | ||||
es-abstract: 1.21.2 | |||||
es-abstract: 1.22.1 | |||||
dev: true | dev: true | ||||
/string_decoder@1.3.0: | /string_decoder@1.3.0: | ||||
@@ -8349,36 +8338,8 @@ packages: | |||||
tslib: 2.6.0 | tslib: 2.6.0 | ||||
dev: true | dev: true | ||||
/tailwindcss@3.3.2: | |||||
resolution: {integrity: sha512-9jPkMiIBXvPc2KywkraqsUfbfj+dHDb+JPWtSJa9MLFdrPyazI7q6WX2sUrm7R9eVR7qqv3Pas7EvQFzxKnI6w==} | |||||
engines: {node: '>=14.0.0'} | |||||
hasBin: true | |||||
dependencies: | |||||
'@alloc/quick-lru': 5.2.0 | |||||
arg: 5.0.2 | |||||
chokidar: 3.5.3 | |||||
didyoumean: 1.2.2 | |||||
dlv: 1.1.3 | |||||
fast-glob: 3.3.0 | |||||
glob-parent: 6.0.2 | |||||
is-glob: 4.0.3 | |||||
jiti: 1.19.1 | |||||
lilconfig: 2.1.0 | |||||
micromatch: 4.0.5 | |||||
normalize-path: 3.0.0 | |||||
object-hash: 3.0.0 | |||||
picocolors: 1.0.0 | |||||
postcss: 8.4.24 | |||||
postcss-import: 15.1.0(postcss@8.4.24) | |||||
postcss-js: 4.0.1(postcss@8.4.24) | |||||
postcss-load-config: 4.0.1(postcss@8.4.24) | |||||
postcss-nested: 6.0.1(postcss@8.4.24) | |||||
postcss-selector-parser: 6.0.13 | |||||
postcss-value-parser: 4.2.0 | |||||
resolve: 1.22.2 | |||||
sucrase: 3.32.0 | |||||
transitivePeerDependencies: | |||||
- ts-node | |||||
/tailwind-merge@1.14.0: | |||||
resolution: {integrity: sha512-3mFKyCo/MBcgyOTlrY8T7odzZFx+w+qKSMAmdFzRvqBfLlSigU6TZnlFHK0lkMwj9Bj8OYU+9yW9lmGuS0QEnQ==} | |||||
dev: false | dev: false | ||||
/tailwindcss@3.3.3: | /tailwindcss@3.3.3: | ||||
@@ -8623,6 +8584,36 @@ packages: | |||||
engines: {node: '>=12.20'} | engines: {node: '>=12.20'} | ||||
dev: true | dev: true | ||||
/typed-array-buffer@1.0.0: | |||||
resolution: {integrity: sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==} | |||||
engines: {node: '>= 0.4'} | |||||
dependencies: | |||||
call-bind: 1.0.2 | |||||
get-intrinsic: 1.2.1 | |||||
is-typed-array: 1.1.10 | |||||
dev: true | |||||
/typed-array-byte-length@1.0.0: | |||||
resolution: {integrity: sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==} | |||||
engines: {node: '>= 0.4'} | |||||
dependencies: | |||||
call-bind: 1.0.2 | |||||
for-each: 0.3.3 | |||||
has-proto: 1.0.1 | |||||
is-typed-array: 1.1.10 | |||||
dev: true | |||||
/typed-array-byte-offset@1.0.0: | |||||
resolution: {integrity: sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==} | |||||
engines: {node: '>= 0.4'} | |||||
dependencies: | |||||
available-typed-arrays: 1.0.5 | |||||
call-bind: 1.0.2 | |||||
for-each: 0.3.3 | |||||
has-proto: 1.0.1 | |||||
is-typed-array: 1.1.10 | |||||
dev: true | |||||
/typed-array-length@1.0.4: | /typed-array-length@1.0.4: | ||||
resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} | resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} | ||||
dependencies: | dependencies: | ||||
@@ -8967,7 +8958,7 @@ packages: | |||||
dependencies: | dependencies: | ||||
'@types/node': 20.4.7 | '@types/node': 20.4.7 | ||||
esbuild: 0.17.19 | esbuild: 0.17.19 | ||||
postcss: 8.4.24 | |||||
postcss: 8.4.28 | |||||
rollup: 3.26.0 | rollup: 3.26.0 | ||||
optionalDependencies: | optionalDependencies: | ||||
fsevents: 2.3.3 | fsevents: 2.3.3 | ||||
@@ -9217,6 +9208,17 @@ packages: | |||||
resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} | resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} | ||||
dev: true | dev: true | ||||
/which-typed-array@1.1.11: | |||||
resolution: {integrity: sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==} | |||||
engines: {node: '>= 0.4'} | |||||
dependencies: | |||||
available-typed-arrays: 1.0.5 | |||||
call-bind: 1.0.2 | |||||
for-each: 0.3.3 | |||||
gopd: 1.0.1 | |||||
has-tostringtag: 1.0.0 | |||||
dev: true | |||||
/which-typed-array@1.1.9: | /which-typed-array@1.1.9: | ||||
resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==} | resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==} | ||||
engines: {node: '>= 0.4'} | engines: {node: '>= 0.4'} | ||||
@@ -1,6 +1,7 @@ | |||||
import {Config} from 'tailwindcss'; | import {Config} from 'tailwindcss'; | ||||
import defaultTheme from 'tailwindcss/defaultTheme'; | import defaultTheme from 'tailwindcss/defaultTheme'; | ||||
import plugin from 'tailwindcss/plugin'; | import plugin from 'tailwindcss/plugin'; | ||||
import { tailwind } from '../../base/src'; | |||||
import { | import { | ||||
radioButtonPlugin, | radioButtonPlugin, | ||||
menuSelectPlugin, | menuSelectPlugin, | ||||
@@ -37,7 +38,16 @@ const config: Config = { | |||||
sans: ['var(--font-sans)', ...defaultTheme.fontFamily.sans], | sans: ['var(--font-sans)', ...defaultTheme.fontFamily.sans], | ||||
headings: ['var(--font-headings)', ...defaultTheme.fontFamily.sans], | headings: ['var(--font-headings)', ...defaultTheme.fontFamily.sans], | ||||
mono: ['var(--font-mono)', ...defaultTheme.fontFamily.mono], | mono: ['var(--font-mono)', ...defaultTheme.fontFamily.mono], | ||||
inherit: ['inherit'], | |||||
}, | |||||
fontSize: { | |||||
'lg': '1.125em', | |||||
'xl': '1.25em', | |||||
'2xl': '1.5em', | |||||
'3xl': '1.75em', | |||||
'4xl': '2em', | |||||
'5xl': '3em', | |||||
'6xl': '4em', | |||||
'xxs': '0.625rem', | |||||
}, | }, | ||||
colors: { | colors: { | ||||
'sidebar': 'rgb(var(--color-sidebar)', | 'sidebar': 'rgb(var(--color-sidebar)', | ||||
@@ -61,46 +71,10 @@ const config: Config = { | |||||
'code-regexp': 'rgb(var(--color-code-regexp))', | 'code-regexp': 'rgb(var(--color-code-regexp))', | ||||
'code-url': 'rgb(var(--color-code-url))', | 'code-url': 'rgb(var(--color-code-url))', | ||||
'code-global': 'rgb(var(--color-code-global))', | 'code-global': 'rgb(var(--color-code-global))', | ||||
'current': 'currentcolor', | |||||
'inherit': 'inherit', | |||||
'transparent': 'transparent', | |||||
}, | |||||
extend: { | |||||
fontSize: { | |||||
'lg': '1.125em', | |||||
'xl': '1.25em', | |||||
'2xl': '1.5em', | |||||
'3xl': '1.75em', | |||||
'4xl': '2em', | |||||
'5xl': '3em', | |||||
'6xl': '4em', | |||||
'xxs': '0.625rem', | |||||
}, | |||||
borderRadius: { | |||||
inherit: 'inherit', | |||||
}, | |||||
minWidth: { | |||||
6: '1.5rem', | |||||
10: '2.5rem', | |||||
12: '3rem', | |||||
16: '4rem', | |||||
48: '12rem', | |||||
64: '16rem', | |||||
}, | |||||
minHeight: { | |||||
6: '1.5rem', | |||||
10: '2.5rem', | |||||
12: '3rem', | |||||
16: '4rem', | |||||
32: '8rem', | |||||
64: '16rem', | |||||
}, | |||||
strokeWidth: { | |||||
3: '3', | |||||
}, | |||||
}, | }, | ||||
}, | }, | ||||
plugins: [ | plugins: [ | ||||
tailwind.basePlugin, | |||||
plugin(radioButtonPlugin), | plugin(radioButtonPlugin), | ||||
plugin(menuSelectPlugin), | plugin(menuSelectPlugin), | ||||
plugin(radioTickBoxPlugin), | plugin(radioTickBoxPlugin), | ||||