From 8a2d21d422f8a8c46842e8a0a7dd4c9657ce4d5a Mon Sep 17 00:00:00 2001 From: TheoryOfNekomata Date: Tue, 18 Jul 2023 14:00:23 +0800 Subject: [PATCH] Add default indicators Add indicators to email, phone, url, password, date, and time components. --- TODO.md | 2 +- .../react/src/components/ComboBox/index.tsx | 10 +- .../DropdownSelect/DropdownSelect.test.tsx | 11 +- .../src/components/DropdownSelect/index.tsx | 89 ++--- .../react/src/components/MenuSelect/index.tsx | 10 +- .../react/src/components/EmailInput/index.tsx | 94 ++--- .../src/components/PatternTextInput/index.tsx | 10 +- .../src/components/PhoneNumberInput/index.tsx | 94 ++--- .../react/src/components/UrlInput/index.tsx | 95 ++--- categories/freeform/react/package.json | 3 +- .../src/components/MaskedTextInput/index.tsx | 49 ++- .../components/MultilineTextInput/index.tsx | 10 +- .../react/src/components/TextInput/index.tsx | 10 +- .../src/components/MenuMultiSelect/index.tsx | 10 +- .../react/src/components/TagInput/index.tsx | 10 +- .../src/components/ToggleSwitch/index.tsx | 15 +- categories/number/react/package.json | 2 +- .../src/components/NumberSpinner/index.tsx | 10 +- categories/temporal/react/package.json | 3 +- .../src/components/DateDropdown/index.tsx | 146 ++++--- .../src/components}/TimeSpinner/index.tsx | 148 +++---- categories/temporal/react/src/index.ts | 1 + pnpm-lock.yaml | 371 ++++++++++++++++-- .../web-kitchensink-reactnext/package.json | 4 +- .../components/temporal/WeekInput/index.tsx | 10 +- .../temporal/YearMonthInput/index.tsx | 10 +- .../src/components/temporal/index.ts | 1 - .../src/pages/categories/color/index.tsx | 2 +- .../src/pages/categories/formatted/index.tsx | 9 + .../src/pages/categories/number/index.tsx | 1 + .../src/pages/categories/temporal/index.tsx | 6 +- .../src/pages/index.tsx | 2 +- .../tailwind.config.js | 6 + 33 files changed, 776 insertions(+), 478 deletions(-) rename {showcases/web-kitchensink-reactnext/src/components/temporal => categories/temporal/react/src/components}/TimeSpinner/index.tsx (58%) diff --git a/TODO.md b/TODO.md index 05c16e9..26f4720 100644 --- a/TODO.md +++ b/TODO.md @@ -66,7 +66,7 @@ # Others - [X] Add `select-none` to input labels, etc. -- [ ] Add indicators to components (select, datetime input etc) +- [X] Add indicators to components (select, datetime input etc) - [ ] Test all components! - [ ] Where to put the "click-to-copy" textboxes? Does `Swatch` belong to this category? diff --git a/categories/choice/react/src/components/ComboBox/index.tsx b/categories/choice/react/src/components/ComboBox/index.tsx index 9ed76ab..2ae1cfc 100644 --- a/categories/choice/react/src/components/ComboBox/index.tsx +++ b/categories/choice/react/src/components/ComboBox/index.tsx @@ -104,7 +104,7 @@ export const ComboBox = React.forwardRef(
( id={labelId} htmlFor={id} className={clsx( - 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold peer-disabled:opacity-50 peer-focus: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, }, @@ -188,7 +188,7 @@ export const ComboBox = React.forwardRef(
(
( {border && ( )}
diff --git a/categories/choice/react/src/components/DropdownSelect/DropdownSelect.test.tsx b/categories/choice/react/src/components/DropdownSelect/DropdownSelect.test.tsx index 23827ef..f20f417 100644 --- a/categories/choice/react/src/components/DropdownSelect/DropdownSelect.test.tsx +++ b/categories/choice/react/src/components/DropdownSelect/DropdownSelect.test.tsx @@ -77,6 +77,14 @@ describe('DropdownSelect', () => { expect(hint).toBeInTheDocument(); }); + it('renders an indicator', () => { + render( + , + ); + const indicator = screen.getByTestId('indicator'); + expect(indicator).toBeInTheDocument(); + }); + it('render options with implicit values', () => { render( @@ -149,7 +157,6 @@ describe('DropdownSelect', () => { , ); @@ -161,7 +168,6 @@ describe('DropdownSelect', () => { render( , ); @@ -174,7 +180,6 @@ describe('DropdownSelect', () => { , ); diff --git a/categories/choice/react/src/components/DropdownSelect/index.tsx b/categories/choice/react/src/components/DropdownSelect/index.tsx index ce53192..cc8a8a7 100644 --- a/categories/choice/react/src/components/DropdownSelect/index.tsx +++ b/categories/choice/react/src/components/DropdownSelect/index.tsx @@ -24,10 +24,6 @@ export interface DropdownSelectProps extends Omit @@ -146,30 +138,14 @@ export const DropdownSelect = React.forwardRef @@ -179,7 +155,7 @@ export const DropdownSelect = React.forwardRef @@ -206,25 +178,29 @@ export const DropdownSelect = React.forwardRef
)} - {indicator && ( -
+ - {indicator} -
- )} + + +
{border && ( )} @@ -236,7 +212,6 @@ DropdownSelect.displayName = 'DropdownSelect' as const; DropdownSelect.defaultProps = { label: undefined, hint: undefined, - indicator: undefined, size: 'medium' as const, border: false as const, block: false as const, diff --git a/categories/choice/react/src/components/MenuSelect/index.tsx b/categories/choice/react/src/components/MenuSelect/index.tsx index e681f72..d4d5abd 100644 --- a/categories/choice/react/src/components/MenuSelect/index.tsx +++ b/categories/choice/react/src/components/MenuSelect/index.tsx @@ -99,7 +99,7 @@ export const MenuSelect = React.forwardRef )} diff --git a/categories/formatted/react/src/components/EmailInput/index.tsx b/categories/formatted/react/src/components/EmailInput/index.tsx index 55359ca..a5d9347 100644 --- a/categories/formatted/react/src/components/EmailInput/index.tsx +++ b/categories/formatted/react/src/components/EmailInput/index.tsx @@ -17,10 +17,6 @@ export interface EmailInputProps extends Omit @@ -131,33 +123,17 @@ export const EmailInput = React.forwardRef @@ -165,7 +141,7 @@ export const EmailInput = React.forwardRef @@ -192,25 +164,30 @@ export const EmailInput = React.forwardRef )} - {indicator && ( -
+ - {indicator} -
- )} + + + + {border && ( )} @@ -223,7 +200,6 @@ EmailInput.displayName = 'EmailInput'; EmailInput.defaultProps = { label: undefined, hint: undefined, - indicator: undefined, size: 'medium', border: false, block: false, diff --git a/categories/formatted/react/src/components/PatternTextInput/index.tsx b/categories/formatted/react/src/components/PatternTextInput/index.tsx index 1d2deae..17edcf5 100644 --- a/categories/formatted/react/src/components/PatternTextInput/index.tsx +++ b/categories/formatted/react/src/components/PatternTextInput/index.tsx @@ -93,7 +93,7 @@ export const PatternTextInput = React.forwardRef< return (
)}
diff --git a/categories/formatted/react/src/components/PhoneNumberInput/index.tsx b/categories/formatted/react/src/components/PhoneNumberInput/index.tsx index 71cea1a..a74f8ef 100644 --- a/categories/formatted/react/src/components/PhoneNumberInput/index.tsx +++ b/categories/formatted/react/src/components/PhoneNumberInput/index.tsx @@ -19,10 +19,6 @@ export interface PhoneNumberInputProps extends Omit @@ -203,7 +179,7 @@ export const PhoneNumberInput = React.forwardRef<
@@ -230,25 +202,29 @@ export const PhoneNumberInput = React.forwardRef<
)} - {indicator && ( -
+ - {indicator} -
- )} + + + {border && ( )} @@ -260,7 +236,6 @@ PhoneNumberInput.displayName = 'PhoneNumberInput'; PhoneNumberInput.defaultProps = { label: undefined, hint: undefined, - indicator: undefined, size: 'medium' as const, border: false as const, block: false as const, @@ -268,4 +243,5 @@ PhoneNumberInput.defaultProps = { hiddenLabel: false as const, enhanced: false as const, country: 'PH' as const, + length: undefined, }; diff --git a/categories/formatted/react/src/components/UrlInput/index.tsx b/categories/formatted/react/src/components/UrlInput/index.tsx index 594a68a..a732edf 100644 --- a/categories/formatted/react/src/components/UrlInput/index.tsx +++ b/categories/formatted/react/src/components/UrlInput/index.tsx @@ -17,10 +17,6 @@ export interface UrlInputProps extends Omit( { label, hint, - indicator, size = 'medium' as const, border = false, block = false, @@ -71,7 +66,7 @@ export const UrlInput = React.forwardRef( return (
( htmlFor={id} id={labelId} className={clsx( - 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold peer-disabled:opacity-50 peer-focus: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, }, { - 'pr-1': !indicator, - }, - { - 'pr-10': indicator && size === 'small', - 'pr-12': indicator && size === 'medium', - 'pr-16': indicator && size === 'large', + 'pr-10': size === 'small', + 'pr-12': size === 'medium', + 'pr-16': size === 'large', }, )} > @@ -119,33 +111,17 @@ export const UrlInput = React.forwardRef( type="url" data-testid="input" className={clsx( - 'bg-negative rounded-inherit w-full peer block font-inherit', + 'bg-negative rounded-inherit w-full peer block font-inherit tabular-nums', 'focus:outline-0', - 'disabled:opacity-50 disabled:cursor-not-allowed', - { - 'text-xxs': size === 'small', - 'text-xs': size === 'medium', - }, + 'disabled:cursor-not-allowed', { 'pl-4': variant === 'default', - 'pl-1.5': variant === 'alternate', + 'pl-1.5 pt-4': variant === 'alternate', }, { - 'pt-4': variant === 'alternate', - }, - { - 'pr-4': variant === 'default' && !indicator, - 'pr-1.5': variant === 'alternate' && !indicator, - }, - { - 'pr-10': indicator && size === 'small', - 'pr-12': indicator && size === 'medium', - 'pr-16': indicator && size === 'large', - }, - { - 'h-10': size === 'small', - 'h-12': size === 'medium', - 'h-16': size === 'large', + 'pr-10 h-10 text-xxs': size === 'small', + 'pr-12 h-12 text-xs': size === 'medium', + 'pr-16 h-16': size === 'large', }, )} /> @@ -153,7 +129,7 @@ export const UrlInput = React.forwardRef(
( 'pt-3': variant === 'alternate' && size !== 'small', }, { - 'pr-4': !indicator && variant === 'default', - 'pr-1': !indicator && variant === 'alternate', - }, - { - 'pr-10': indicator && size === 'small', - 'pr-12': indicator && size === 'medium', - 'pr-16': indicator && size === 'large', + 'pr-10': size === 'small', + 'pr-12': size === 'medium', + 'pr-16': size === 'large', }, )} > @@ -180,25 +152,31 @@ export const UrlInput = React.forwardRef(
)} - {indicator && ( -
+ - {indicator} -
- )} + + + + + {border && ( )} @@ -210,7 +188,6 @@ UrlInput.displayName = 'UrlInput'; UrlInput.defaultProps = { label: undefined, hint: undefined, - indicator: undefined, size: 'medium', border: false, block: false, diff --git a/categories/freeform/react/package.json b/categories/freeform/react/package.json index 13fa39e..79eb42d 100644 --- a/categories/freeform/react/package.json +++ b/categories/freeform/react/package.json @@ -62,7 +62,8 @@ }, "dependencies": { "clsx": "^1.2.1", - "@tesseract-design/web-base": "workspace:*" + "@tesseract-design/web-base": "workspace:*", + "@modal-sh/react-utils": "workspace:*" }, "types": "./dist/types/index.d.ts", "main": "./dist/cjs/production/index.js", diff --git a/categories/freeform/react/src/components/MaskedTextInput/index.tsx b/categories/freeform/react/src/components/MaskedTextInput/index.tsx index efd04e3..3b45f0e 100644 --- a/categories/freeform/react/src/components/MaskedTextInput/index.tsx +++ b/categories/freeform/react/src/components/MaskedTextInput/index.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import { TextControl } from '@tesseract-design/web-base'; import clsx from 'clsx'; +import { useClientSide } from '@modal-sh/react-utils'; export type MaskedTextInputDerivedElement = HTMLInputElement; @@ -17,10 +18,6 @@ export interface MaskedTextInputProps extends Omit { + const { clientSide: indicator } = useClientSide({ clientSide: true, initial: false }); const labelId = React.useId(); const defaultId = React.useId(); const id = idProp ?? defaultId; + const [visible, setVisible] = React.useState(false); return (
)} {indicator && ( -
{ setVisible((b) => !b); }} > - {indicator} -
+ + {!visible && ( + <> + + + + )} + {visible && ( + <> + + + + )} + + )} {border && ( )}
@@ -214,7 +234,6 @@ MaskedTextInput.defaultProps = { label: undefined, hint: undefined, size: 'medium', - indicator: undefined, border: false, block: false, variant: 'default', diff --git a/categories/freeform/react/src/components/MultilineTextInput/index.tsx b/categories/freeform/react/src/components/MultilineTextInput/index.tsx index a71adad..bc628e4 100644 --- a/categories/freeform/react/src/components/MultilineTextInput/index.tsx +++ b/categories/freeform/react/src/components/MultilineTextInput/index.tsx @@ -71,7 +71,7 @@ export const MultilineTextInput = React.forwardRef< return (
)}
diff --git a/categories/freeform/react/src/components/TextInput/index.tsx b/categories/freeform/react/src/components/TextInput/index.tsx index 36fd2fa..2067f64 100644 --- a/categories/freeform/react/src/components/TextInput/index.tsx +++ b/categories/freeform/react/src/components/TextInput/index.tsx @@ -90,7 +90,7 @@ export const TextInput = React.forwardRef )} diff --git a/categories/multichoice/react/src/components/MenuMultiSelect/index.tsx b/categories/multichoice/react/src/components/MenuMultiSelect/index.tsx index b086e5f..80bb0f3 100644 --- a/categories/multichoice/react/src/components/MenuMultiSelect/index.tsx +++ b/categories/multichoice/react/src/components/MenuMultiSelect/index.tsx @@ -98,7 +98,7 @@ export const MenuMultiSelect = React.forwardRef< return (
)}
diff --git a/categories/multichoice/react/src/components/TagInput/index.tsx b/categories/multichoice/react/src/components/TagInput/index.tsx index 0c99f3b..2206c23 100644 --- a/categories/multichoice/react/src/components/TagInput/index.tsx +++ b/categories/multichoice/react/src/components/TagInput/index.tsx @@ -321,7 +321,7 @@ export const TagInput = React.forwardRef( data-size={size} data-variant={variant} className={clsx( - 'relative rounded ring-secondary/50 group', + 'relative rounded ring-secondary/50 group has-[:disabled]:opacity-50', 'focus-within:ring-4', { 'block': block, @@ -346,7 +346,7 @@ export const TagInput = React.forwardRef( id={labelId} htmlFor={id} className={clsx( - 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold peer-disabled:opacity-50 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, }, @@ -447,7 +447,7 @@ export const TagInput = React.forwardRef(
( {indicator && (
( {border && ( )}
diff --git a/categories/multichoice/react/src/components/ToggleSwitch/index.tsx b/categories/multichoice/react/src/components/ToggleSwitch/index.tsx index 16019d2..4ca6125 100644 --- a/categories/multichoice/react/src/components/ToggleSwitch/index.tsx +++ b/categories/multichoice/react/src/components/ToggleSwitch/index.tsx @@ -196,11 +196,16 @@ export const ToggleSwitch = React.forwardRef {uncheckedLabel && ( - - {uncheckedLabel} - + <> + + {' / '} + + + {uncheckedLabel} + + )}
diff --git a/categories/temporal/react/package.json b/categories/temporal/react/package.json index 163a615..bfbe03a 100644 --- a/categories/temporal/react/package.json +++ b/categories/temporal/react/package.json @@ -58,8 +58,9 @@ "access": "public" }, "dependencies": { + "@tesseract-design/web-base": "workspace:*", "clsx": "^1.2.1", - "@tesseract-design/web-base": "workspace:*" + "tailwindcss": "3.3.3" }, "types": "./dist/types/index.d.ts", "main": "./dist/cjs/production/index.js", diff --git a/categories/temporal/react/src/components/DateDropdown/index.tsx b/categories/temporal/react/src/components/DateDropdown/index.tsx index b9d0c7b..6e12ea9 100644 --- a/categories/temporal/react/src/components/DateDropdown/index.tsx +++ b/categories/temporal/react/src/components/DateDropdown/index.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import { TextControl } from '@tesseract-design/web-base'; import clsx from 'clsx'; +import plugin from 'tailwindcss/plugin'; export type DateDropdownDerivedElement = HTMLInputElement; @@ -17,10 +18,6 @@ export interface DateDropdownProps extends Omit { + addComponents({ + '.date-dropdown': { + '& > input::-webkit-calendar-picker-indicator': { + 'background-image': 'none', + 'position': 'absolute', + 'bottom': '0', + 'right': '0', + 'height': '100%', + 'padding': '0', + 'aspect-ratio': '1 / 1', + 'cursor': 'inherit', + }, + '&[data-size="small"] > input::-webkit-calendar-picker-indicator': { + 'width': '2.5rem', + }, + '&[data-size="medium"] > input::-webkit-calendar-picker-indicator': { + 'width': '3rem', + }, + '&[data-size="large"] > input::-webkit-calendar-picker-indicator': { + 'width': '4rem', + }, + }, + }); +}); + /** * Component for inputting textual values. */ @@ -53,7 +76,6 @@ export const DateDropdown = React.forwardRef< { label, hint, - indicator, size = 'medium' as const, border = false, block = false, @@ -74,7 +96,7 @@ export const DateDropdown = React.forwardRef< return (
{label && ( @@ -92,17 +115,14 @@ export const DateDropdown = React.forwardRef< id={labelId} htmlFor={id} className={clsx( - 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold peer-disabled:opacity-50 peer-focus: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, }, { - 'pr-1': !indicator, - }, - { - 'pr-10': indicator && size === 'small', - 'pr-12': indicator && size === 'medium', - 'pr-16': indicator && size === 'large', + 'pr-10': size === 'small', + 'pr-12': size === 'medium', + 'pr-16': size === 'large', }, )} > @@ -123,33 +143,17 @@ export const DateDropdown = React.forwardRef< data-testid="input" pattern="\d{4}-\d{2}-\d{2}" className={clsx( - 'bg-negative rounded-inherit w-full peer block font-inherit tabular-nums', + 'bg-negative rounded-inherit w-full peer block font-inherit tabular-nums cursor-pointer', 'focus:outline-0', - 'disabled:opacity-50 disabled:cursor-not-allowed', - { - 'text-xxs': size === 'small', - 'text-xs': size === 'medium', - }, + 'disabled:cursor-not-allowed', { 'pl-4': variant === 'default', - 'pl-1.5': variant === 'alternate', - }, - { - 'pt-4': variant === 'alternate', - }, - { - 'pr-4': variant === 'default' && !indicator, - 'pr-1.5': variant === 'alternate' && !indicator, - }, - { - 'pr-10': indicator && size === 'small', - 'pr-12': indicator && size === 'medium', - 'pr-16': indicator && size === 'large', + 'pl-1.5 pt-4': variant === 'alternate', }, { - 'h-10': size === 'small', - 'h-12': size === 'medium', - 'h-16': size === 'large', + 'pr-10 h-10 text-xxs': size === 'small', + 'pr-12 h-12 text-xs': size === 'medium', + 'pr-16 h-16': size === 'large', }, )} /> @@ -157,7 +161,7 @@ export const DateDropdown = React.forwardRef<
@@ -184,25 +184,54 @@ export const DateDropdown = React.forwardRef<
)} - {indicator && ( -
+ - {indicator} -
- )} + + + + + + {border && ( )} @@ -215,7 +244,6 @@ DateDropdown.defaultProps = { label: undefined, hint: undefined, size: 'medium', - indicator: undefined, border: false, block: false, variant: 'default', diff --git a/showcases/web-kitchensink-reactnext/src/components/temporal/TimeSpinner/index.tsx b/categories/temporal/react/src/components/TimeSpinner/index.tsx similarity index 58% rename from showcases/web-kitchensink-reactnext/src/components/temporal/TimeSpinner/index.tsx rename to categories/temporal/react/src/components/TimeSpinner/index.tsx index 95d57b4..c12a6d4 100644 --- a/showcases/web-kitchensink-reactnext/src/components/temporal/TimeSpinner/index.tsx +++ b/categories/temporal/react/src/components/TimeSpinner/index.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import { TextControl } from '@tesseract-design/web-base'; import clsx from 'clsx'; +import plugin from 'tailwindcss/plugin'; export type TimeSpinnerDerivedElement = HTMLInputElement; @@ -27,10 +28,6 @@ export interface TimeSpinnerProps extends Omit { + addComponents({ + '.time-spinner': { + '& > input::-webkit-calendar-picker-indicator': { + 'background-image': 'none', + 'position': 'absolute', + 'bottom': '0', + 'right': '0', + 'height': '100%', + 'padding': '0', + 'aspect-ratio': '1 / 1', + 'cursor': 'inherit', + }, + '&[data-size="small"] > input::-webkit-calendar-picker-indicator': { + 'width': '2.5rem', + }, + '&[data-size="medium"] > input::-webkit-calendar-picker-indicator': { + 'width': '3rem', + }, + '&[data-size="large"] > input::-webkit-calendar-picker-indicator': { + 'width': '4rem', + }, + }, + }); +}); + /** * Component for inputting textual values. */ @@ -67,17 +90,16 @@ export const TimeSpinner = React.forwardRef< { label, hint, - indicator, size = 'medium' as const, - border = false, - block = false, + border = false as const, + block = false as const, variant = 'default' as const, - hiddenLabel = false, + hiddenLabel = false as const, className, id: idProp, style, - displaySeconds = false, - step = '00:01', + displaySeconds = false as const, + step = '00:01' as const, ...etcProps }: TimeSpinnerProps, forwardedRef, @@ -86,13 +108,13 @@ export const TimeSpinner = React.forwardRef< const defaultId = React.useId(); const id = idProp ?? defaultId; - const [hh, mm, ss = 0] = step.split(':').map((s: string) => parseInt(s, 10)); + const [hh, mm, ss = 0] = step.split(':').map((s: string) => parseInt(s, 10)) as number[]; const stepValue = ss + (mm * 60) + (hh * 3600); return (
{label && ( <> @@ -110,17 +133,14 @@ export const TimeSpinner = React.forwardRef< id={labelId} htmlFor={id} className={clsx( - 'absolute z-[1] w-full top-0.5 left-0 pointer-events-none pl-1 text-xxs font-bold peer-disabled:opacity-50 peer-focus: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, }, { - 'pr-1': !indicator, - }, - { - 'pr-10': indicator && size === 'small', - 'pr-12': indicator && size === 'medium', - 'pr-16': indicator && size === 'large', + 'pr-10': size === 'small', + 'pr-12': size === 'medium', + 'pr-16': size === 'large', }, )} > @@ -141,33 +161,17 @@ export const TimeSpinner = React.forwardRef< step={displaySeconds && stepValue > 60 ? 1 : stepValue} pattern="\d{2}:\d{2}(:\d{2})?" className={clsx( - 'bg-negative rounded-inherit w-full peer block font-inherit tabular-nums', + 'bg-negative rounded-inherit w-full peer block font-inherit tabular-nums cursor-pointer', 'focus:outline-0', - 'disabled:opacity-50 disabled:cursor-not-allowed', - { - 'text-xxs': size === 'small', - 'text-xs': size === 'medium', - }, + 'disabled:cursor-not-allowed', { 'pl-4': variant === 'default', - 'pl-1.5': variant === 'alternate', - }, - { - 'pt-4': variant === 'alternate', - }, - { - 'pr-4': variant === 'default' && !indicator, - 'pr-1.5': variant === 'alternate' && !indicator, - }, - { - 'pr-10': indicator && size === 'small', - 'pr-12': indicator && size === 'medium', - 'pr-16': indicator && size === 'large', + 'pl-1.5 pt-4': variant === 'alternate', }, { - 'h-10': size === 'small', - 'h-12': size === 'medium', - 'h-16': size === 'large', + 'pr-10 h-10 text-xxs': size === 'small', + 'pr-12 h-12 text-xs': size === 'medium', + 'pr-16 h-16': size === 'large', }, )} /> @@ -175,7 +179,7 @@ export const TimeSpinner = React.forwardRef<
@@ -202,24 +202,33 @@ export const TimeSpinner = React.forwardRef<
)} - {indicator && ( -
+ - {indicator} -
- )} + + + + {border && ( )} @@ -231,10 +240,11 @@ TimeSpinner.displayName = 'TimeSpinner'; TimeSpinner.defaultProps = { label: undefined, hint: undefined, - size: 'medium', - indicator: undefined, - border: false, - block: false, - variant: 'default', - hiddenLabel: false, + size: 'medium' as const, + border: false as const, + block: false as const, + variant: 'default' as const, + hiddenLabel: false as const, + displaySeconds: false as const, + step: '00:01' as const, }; diff --git a/categories/temporal/react/src/index.ts b/categories/temporal/react/src/index.ts index 61f534c..f4d77f5 100644 --- a/categories/temporal/react/src/index.ts +++ b/categories/temporal/react/src/index.ts @@ -1 +1,2 @@ export * from './components/DateDropdown'; +export * from './components/TimeSpinner'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e97e70d..f80029d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -331,6 +331,9 @@ importers: categories/freeform/react: dependencies: + '@modal-sh/react-utils': + specifier: workspace:* + version: link:../../../packages/react-utils '@tesseract-design/web-base': specifier: workspace:* version: link:../../../base @@ -588,8 +591,8 @@ importers: specifier: ^1.2.1 version: 1.2.1 tailwindcss: - specifier: 3.3.2 - version: 3.3.2 + specifier: 3.3.3 + version: 3.3.3 devDependencies: '@testing-library/jest-dom': specifier: ^5.16.5 @@ -651,6 +654,9 @@ importers: clsx: specifier: ^1.2.1 version: 1.2.1 + tailwindcss: + specifier: 3.3.3 + version: 3.3.3 devDependencies: '@testing-library/jest-dom': specifier: ^5.16.5 @@ -1207,12 +1213,13 @@ importers: react-refractor: specifier: ^2.1.7 version: 2.1.7(react@18.2.0) - tailwindcss: - specifier: 3.3.2 - version: 3.3.2 typescript: specifier: 5.1.3 version: 5.1.3 + devDependencies: + tailwindcss: + specifier: 0.0.0-insiders.7f31ac1 + version: 0.0.0-insiders.7f31ac1 packages: @@ -1227,7 +1234,6 @@ packages: /@alloc/quick-lru@5.2.0: resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} - dev: false /@ampproject/remapping@2.2.1: resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} @@ -1970,6 +1976,102 @@ packages: tslib: 2.6.0 dev: false + /@tailwindcss/oxide-darwin-arm64@0.0.0-insiders.7f31ac1: + resolution: {integrity: sha512-ru47I091xW1oKYK6a4/i2nSTVhC6MXzJ/bkHKp3LCUE3kJaefOknFCTZwaKd3+FOlAFxqhEsrnPpPY9sSm3dHg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@tailwindcss/oxide-darwin-x64@0.0.0-insiders.7f31ac1: + resolution: {integrity: sha512-Xwv8anoQJiDGaIaYfxjjQhq1OhDle6pig8J4fsEaTr89jHC+ku8F9HyU+sYASVGcZ1JV8NZyKl2jd3ZBCWp1dQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@tailwindcss/oxide-freebsd-x64@0.0.0-insiders.7f31ac1: + resolution: {integrity: sha512-AwyHGFlgQPyr+OZtaPFs7q04+Nb5B352OdHY9amtgLYNE7bZLTmpFxNG4JeewSpgqVeDVlrZdtlXOMYffkRfqA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@tailwindcss/oxide-linux-arm-gnueabihf@0.0.0-insiders.7f31ac1: + resolution: {integrity: sha512-43zRBZDUVEEMPm+oO3oViVRwaX0lV7K1Cf+llbgkOzW0QjlEOr3a/EabLVqzxQ6NCVUar7Q+z6jSj07LTGjEGA==} + engines: {node: '>= 10'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@tailwindcss/oxide-linux-arm64-gnu@0.0.0-insiders.7f31ac1: + resolution: {integrity: sha512-8UKgagNvZWRcRXwJN6u00Hupiz4etX6+nHblWfyQrnClwB9n7TINwArG8T4yAxi7IJck/YEg6x2HAGQlyOfRAw==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@tailwindcss/oxide-linux-arm64-musl@0.0.0-insiders.7f31ac1: + resolution: {integrity: sha512-zO3gCbeXBSJQ8/Od5LTWTkHbJdUwPbDN6CqLqEkqeReirxYquzl0qn/xBp2WAyhm190Xx0XjNvWViGWIMx6RPQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@tailwindcss/oxide-linux-x64-gnu@0.0.0-insiders.7f31ac1: + resolution: {integrity: sha512-N5ApQ+p4b6endPXkSaHD3U142Kp1HQWe8r9CHAAEAnarjxrjCfZB9C9n69k3aKGp6zfW7xlgqK9AXaf9cem/qQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@tailwindcss/oxide-linux-x64-musl@0.0.0-insiders.7f31ac1: + resolution: {integrity: sha512-6Pbd3GVgp2NS6wmNMHGM6vwlmO1AMmBsk0cfrZUs4ppuS4TMTLrapS62xVd2DZqIDW6IBpxgUjXVfz7FOpnnGA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@tailwindcss/oxide-win32-x64-msvc@0.0.0-insiders.7f31ac1: + resolution: {integrity: sha512-UJX/+Q/NV8z4h9wErBAx3TjoWlWRsWWYYgfvR1zno56ErZfiOxy8znsr0LEJstP3Z68j1EeqEYBDmuzD/i1oYw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@tailwindcss/oxide@0.0.0-insiders.7f31ac1: + resolution: {integrity: sha512-l9k8MNFYGQAmn2wXvXw4FYDkjmduNFHYSKGrYmS8j8bHAdMBrJmW5RdfvLYMDhNyhZWAeTj4LLmguPHe10FmGg==} + engines: {node: '>= 10'} + optionalDependencies: + '@tailwindcss/oxide-darwin-arm64': 0.0.0-insiders.7f31ac1 + '@tailwindcss/oxide-darwin-x64': 0.0.0-insiders.7f31ac1 + '@tailwindcss/oxide-freebsd-x64': 0.0.0-insiders.7f31ac1 + '@tailwindcss/oxide-linux-arm-gnueabihf': 0.0.0-insiders.7f31ac1 + '@tailwindcss/oxide-linux-arm64-gnu': 0.0.0-insiders.7f31ac1 + '@tailwindcss/oxide-linux-arm64-musl': 0.0.0-insiders.7f31ac1 + '@tailwindcss/oxide-linux-x64-gnu': 0.0.0-insiders.7f31ac1 + '@tailwindcss/oxide-linux-x64-musl': 0.0.0-insiders.7f31ac1 + '@tailwindcss/oxide-win32-x64-msvc': 0.0.0-insiders.7f31ac1 + dev: true + /@testing-library/dom@8.20.1: resolution: {integrity: sha512-/DiOQ5xBxgdYRC8LNk7U+RWat0S3qRLeIw3ZIkMQ9kkVlRmwD/Eg8k8CqIpD6GW7u20JIUOfMKbxtiLutpjQ4g==} engines: {node: '>=12'} @@ -2523,7 +2625,6 @@ packages: /any-promise@1.3.0: resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} - dev: false /anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} @@ -2531,11 +2632,9 @@ packages: dependencies: normalize-path: 3.0.0 picomatch: 2.3.1 - dev: false /arg@5.0.2: resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} - dev: false /argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} @@ -2682,7 +2781,6 @@ packages: /binary-extensions@2.2.0: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} - dev: false /bl@5.1.0: resolution: {integrity: sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==} @@ -2765,7 +2863,6 @@ packages: /camelcase-css@2.0.1: resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==} engines: {node: '>= 6'} - dev: false /camelcase@5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} @@ -2884,7 +2981,6 @@ packages: readdirp: 3.6.0 optionalDependencies: fsevents: 2.3.2 - dev: false /chroma-js@2.4.2: resolution: {integrity: sha512-U9eDw6+wt7V8z5NncY2jJfZa+hUH8XEj8FQHgFJTrUFnJfXYf4Ml4adI2vXZOjqRDpFWtYVWypDfZwnJ+HIR4A==} @@ -3008,7 +3104,6 @@ packages: /commander@4.1.1: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} engines: {node: '>= 6'} - dev: false /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} @@ -3244,9 +3339,14 @@ packages: engines: {node: '>=8'} dev: true + /detect-libc@1.0.3: + resolution: {integrity: sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==} + engines: {node: '>=0.10'} + hasBin: true + dev: true + /didyoumean@1.2.2: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} - dev: false /diff-sequences@29.4.3: resolution: {integrity: sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==} @@ -3266,7 +3366,6 @@ packages: /dlv@1.1.3: resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==} - dev: false /doctrine@2.1.0: resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} @@ -4252,7 +4351,6 @@ packages: minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 - dev: false /glob@7.1.7: resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==} @@ -4589,7 +4687,6 @@ packages: engines: {node: '>=8'} dependencies: binary-extensions: 2.2.0 - dev: false /is-boolean-object@1.1.2: resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} @@ -4890,6 +4987,10 @@ packages: hasBin: true dev: false + /jiti@1.19.1: + resolution: {integrity: sha512-oVhqoRDaBXf7sjkll95LHVS6Myyyb1zaunVwk4Z0+WPSW4gjS0pl01zYKHScTuyEhQsFxV5L4DR5r+YqSyqyyg==} + hasBin: true + /jpeg-js@0.4.4: resolution: {integrity: sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==} dev: false @@ -5047,14 +5148,100 @@ packages: yargs: 15.4.1 dev: true + /lightningcss-darwin-arm64@1.21.5: + resolution: {integrity: sha512-z05hyLX85WY0UfhkFUOrWEFqD69lpVAmgl3aDzMKlIZJGygbhbegqb4PV8qfUrKKNBauut/qVNPKZglhTaDDxA==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /lightningcss-darwin-x64@1.21.5: + resolution: {integrity: sha512-MSJhmej/U9MrdPxDk7+FWhO8+UqVoZUHG4VvKT5RQ4RJtqtANTiWiI97LvoVNMtdMnHaKs1Pkji6wHUFxjJsHQ==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /lightningcss-linux-arm-gnueabihf@1.21.5: + resolution: {integrity: sha512-xN6+5/JsMrbZHL1lPl+MiNJ3Xza12ueBKPepiyDCFQzlhFRTj7D0LG+cfNTzPBTO8KcYQynLpl1iBB8LGp3Xtw==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /lightningcss-linux-arm64-gnu@1.21.5: + resolution: {integrity: sha512-KfzFNhC4XTbmG3ma/xcTs/IhCwieW89XALIusKmnV0N618ZDXEB0XjWOYQRCXeK9mfqPdbTBpurEHV/XZtkniQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /lightningcss-linux-arm64-musl@1.21.5: + resolution: {integrity: sha512-bc0GytQO5Mn9QM6szaZ+31fQHNdidgpM1sSCwzPItz8hg3wOvKl8039rU0veMJV3ZgC9z0ypNRceLrSHeRHmXw==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /lightningcss-linux-x64-gnu@1.21.5: + resolution: {integrity: sha512-JwMbgypPQgc2kW2av3OwzZ8cbrEuIiDiXPJdXRE6aVxu67yHauJawQLqJKTGUhiAhy6iLDG8Wg0a3/ziL+m+Kw==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /lightningcss-linux-x64-musl@1.21.5: + resolution: {integrity: sha512-Ib8b6IQ/OR/VrPU6YBgy4T3QnuHY7DUa95O+nz+cwrTkMSN6fuHcTcIaz4t8TJ6HI5pl3uxUOZjmtls2pyQWow==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /lightningcss-win32-x64-msvc@1.21.5: + resolution: {integrity: sha512-A8cSi8lUpBeVmoF+DqqW7cd0FemDbCuKr490IXdjyeI+KL8adpSKUs8tcqO0OXPh1EoDqK7JNkD/dELmd4Iz5g==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /lightningcss@1.21.5: + resolution: {integrity: sha512-/pEUPeih2EwIx9n4T82aOG6CInN83tl/mWlw6B5gWLf36UplQi1L+5p3FUHsdt4fXVfOkkh9KIaM3owoq7ss8A==} + engines: {node: '>= 12.0.0'} + dependencies: + detect-libc: 1.0.3 + optionalDependencies: + lightningcss-darwin-arm64: 1.21.5 + lightningcss-darwin-x64: 1.21.5 + lightningcss-linux-arm-gnueabihf: 1.21.5 + lightningcss-linux-arm64-gnu: 1.21.5 + lightningcss-linux-arm64-musl: 1.21.5 + lightningcss-linux-x64-gnu: 1.21.5 + lightningcss-linux-x64-musl: 1.21.5 + lightningcss-win32-x64-msvc: 1.21.5 + dev: true + /lilconfig@2.1.0: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} - dev: false /lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - dev: false /local-pkg@0.4.3: resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} @@ -5254,7 +5441,6 @@ packages: any-promise: 1.3.0 object-assign: 4.1.1 thenify-all: 1.6.0 - dev: false /nanoid@3.3.6: resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} @@ -5336,7 +5522,6 @@ packages: /normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} - dev: false /normalize-range@0.1.2: resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==} @@ -5382,7 +5567,6 @@ packages: /object-hash@3.0.0: resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==} engines: {node: '>= 6'} - dev: false /object-inspect@1.12.3: resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} @@ -5631,7 +5815,6 @@ packages: /pify@2.3.0: resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} engines: {node: '>=0.10.0'} - dev: false /pify@5.0.0: resolution: {integrity: sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA==} @@ -5641,7 +5824,6 @@ packages: /pirates@4.0.6: resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} engines: {node: '>= 6'} - dev: false /pkg-types@1.0.3: resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} @@ -5668,6 +5850,18 @@ packages: resolve: 1.22.2 dev: false + /postcss-import@15.1.0(postcss@8.4.26): + resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} + engines: {node: '>=14.0.0'} + peerDependencies: + postcss: ^8.0.0 + dependencies: + postcss: 8.4.26 + postcss-value-parser: 4.2.0 + read-cache: 1.0.0 + resolve: 1.22.2 + dev: true + /postcss-js@4.0.1(postcss@8.4.24): resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==} engines: {node: ^12 || ^14 || >= 16} @@ -5678,6 +5872,16 @@ packages: postcss: 8.4.24 dev: false + /postcss-js@4.0.1(postcss@8.4.26): + 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.26 + dev: true + /postcss-load-config@4.0.1(postcss@8.4.24): resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} engines: {node: '>= 14'} @@ -5695,6 +5899,23 @@ packages: yaml: 2.3.1 dev: false + /postcss-load-config@4.0.1(postcss@8.4.26): + 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.26 + yaml: 2.3.1 + dev: true + /postcss-nested@6.0.1(postcss@8.4.24): resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==} engines: {node: '>=12.0'} @@ -5705,6 +5926,16 @@ packages: postcss-selector-parser: 6.0.13 dev: false + /postcss-nested@6.0.1(postcss@8.4.26): + resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==} + engines: {node: '>=12.0'} + peerDependencies: + postcss: ^8.2.14 + dependencies: + postcss: 8.4.26 + postcss-selector-parser: 6.0.13 + dev: true + /postcss-selector-parser@6.0.13: resolution: {integrity: sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==} engines: {node: '>=4'} @@ -5714,7 +5945,6 @@ packages: /postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: false /postcss@8.4.14: resolution: {integrity: sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==} @@ -5733,6 +5963,15 @@ packages: picocolors: 1.0.0 source-map-js: 1.0.2 + /postcss@8.4.26: + resolution: {integrity: sha512-jrXHFF8iTloAenySjM/ob3gSj7pCu0Ji49hnjqzsgSRa50hkWCKD0HQ+gMNJkW38jBI68MpAAg7ZWwHwX8NMMw==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.6 + picocolors: 1.0.0 + source-map-js: 1.0.2 + dev: true + /prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -5938,7 +6177,6 @@ packages: resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==} dependencies: pify: 2.3.0 - dev: false /readable-stream@3.6.2: resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} @@ -5953,7 +6191,6 @@ packages: engines: {node: '>=8.10.0'} dependencies: picomatch: 2.3.1 - dev: false /redent@3.0.0: resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} @@ -6046,6 +6283,15 @@ packages: path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 + /resolve@1.22.3: + resolution: {integrity: sha512-P8ur/gp/AmbEzjr729bZnLjXK5Z+4P0zhIJgBgzqRih7hL7BOukHGtSTA3ACMY467GRFz3duQsi0bDZdR7DKdw==} + hasBin: true + dependencies: + is-core-module: 2.12.1 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + /resolve@2.0.0-next.4: resolution: {integrity: sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==} hasBin: true @@ -6395,7 +6641,6 @@ packages: mz: 2.7.0 pirates: 4.0.6 ts-interface-checker: 0.1.13 - dev: false /supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} @@ -6425,6 +6670,41 @@ packages: '@pkgr/utils': 2.4.1 tslib: 2.6.0 + /tailwindcss@0.0.0-insiders.7f31ac1: + resolution: {integrity: sha512-ynoxCChgC5S9oRnoV6z/B/piwyT04qThXj+DfJ8IXIbHE2F16S8SYTQtgUYbcqglfLRSrFez4pM9jGig+MwFnA==} + engines: {node: '>=16.0.0'} + hasBin: true + dependencies: + '@alloc/quick-lru': 5.2.0 + '@tailwindcss/oxide': 0.0.0-insiders.7f31ac1 + arg: 5.0.2 + browserslist: 4.21.9 + 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 + lightningcss: 1.21.5 + 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.26 + postcss-import: 15.1.0(postcss@8.4.26) + postcss-js: 4.0.1(postcss@8.4.26) + postcss-load-config: 4.0.1(postcss@8.4.26) + postcss-nested: 6.0.1(postcss@8.4.26) + postcss-selector-parser: 6.0.13 + postcss-value-parser: 4.2.0 + resolve: 1.22.3 + sucrase: 3.32.0 + transitivePeerDependencies: + - ts-node + dev: true + /tailwindcss@3.3.2: resolution: {integrity: sha512-9jPkMiIBXvPc2KywkraqsUfbfj+dHDb+JPWtSJa9MLFdrPyazI7q6WX2sUrm7R9eVR7qqv3Pas7EvQFzxKnI6w==} engines: {node: '>=14.0.0'} @@ -6457,6 +6737,37 @@ packages: - ts-node dev: false + /tailwindcss@3.3.3: + resolution: {integrity: sha512-A0KgSkef7eE4Mf+nKJ83i75TMyq8HqY3qmFIJSWy8bNt0v1lG7jUcpGpoTFxAwYcWOphcTBLPPJg+bDfhDf52w==} + 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 + resolve: 1.22.2 + sucrase: 3.32.0 + transitivePeerDependencies: + - ts-node + dev: false + /tapable@2.2.1: resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} engines: {node: '>=6'} @@ -6478,13 +6789,11 @@ packages: engines: {node: '>=0.8'} dependencies: thenify: 3.3.1 - dev: false /thenify@3.3.1: resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} dependencies: any-promise: 1.3.0 - dev: false /through@2.3.8: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} @@ -6556,7 +6865,6 @@ packages: /ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - dev: false /tsconfig-paths@3.14.2: resolution: {integrity: sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==} @@ -7153,7 +7461,6 @@ packages: /yaml@2.3.1: resolution: {integrity: sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==} engines: {node: '>= 14'} - dev: false /yargs-parser@18.1.3: resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} diff --git a/showcases/web-kitchensink-reactnext/package.json b/showcases/web-kitchensink-reactnext/package.json index 44327e8..1c77af8 100644 --- a/showcases/web-kitchensink-reactnext/package.json +++ b/showcases/web-kitchensink-reactnext/package.json @@ -41,7 +41,9 @@ "react": "18.2.0", "react-dom": "18.2.0", "react-refractor": "^2.1.7", - "tailwindcss": "3.3.2", "typescript": "5.1.3" + }, + "devDependencies": { + "tailwindcss": "0.0.0-insiders.7f31ac1" } } diff --git a/showcases/web-kitchensink-reactnext/src/components/temporal/WeekInput/index.tsx b/showcases/web-kitchensink-reactnext/src/components/temporal/WeekInput/index.tsx index 8435d97..3ccc3a1 100644 --- a/showcases/web-kitchensink-reactnext/src/components/temporal/WeekInput/index.tsx +++ b/showcases/web-kitchensink-reactnext/src/components/temporal/WeekInput/index.tsx @@ -71,7 +71,7 @@ export const WeekInput = React.forwardRef< return (
)}
diff --git a/showcases/web-kitchensink-reactnext/src/components/temporal/YearMonthInput/index.tsx b/showcases/web-kitchensink-reactnext/src/components/temporal/YearMonthInput/index.tsx index a1b7aa9..2c55996 100644 --- a/showcases/web-kitchensink-reactnext/src/components/temporal/YearMonthInput/index.tsx +++ b/showcases/web-kitchensink-reactnext/src/components/temporal/YearMonthInput/index.tsx @@ -71,7 +71,7 @@ export const YearMonthInput = React.forwardRef< return (
)}
diff --git a/showcases/web-kitchensink-reactnext/src/components/temporal/index.ts b/showcases/web-kitchensink-reactnext/src/components/temporal/index.ts index c5b2ded..70ebb3f 100644 --- a/showcases/web-kitchensink-reactnext/src/components/temporal/index.ts +++ b/showcases/web-kitchensink-reactnext/src/components/temporal/index.ts @@ -1,3 +1,2 @@ -export * from './TimeSpinner'; export * from './YearMonthInput'; export * from './WeekInput'; diff --git a/showcases/web-kitchensink-reactnext/src/pages/categories/color/index.tsx b/showcases/web-kitchensink-reactnext/src/pages/categories/color/index.tsx index 2abf023..f49e6ff 100644 --- a/showcases/web-kitchensink-reactnext/src/pages/categories/color/index.tsx +++ b/showcases/web-kitchensink-reactnext/src/pages/categories/color/index.tsx @@ -6,7 +6,7 @@ import * as Color from '@tesseract-design/web-color-react'; const ColorPage: NextPage = () => { return ( -
+
{ />
+
+ + + +
) } diff --git a/showcases/web-kitchensink-reactnext/src/pages/categories/number/index.tsx b/showcases/web-kitchensink-reactnext/src/pages/categories/number/index.tsx index 59c7cda..bd719e8 100644 --- a/showcases/web-kitchensink-reactnext/src/pages/categories/number/index.tsx +++ b/showcases/web-kitchensink-reactnext/src/pages/categories/number/index.tsx @@ -13,6 +13,7 @@ const NumberPage: NextPage = () => { max={100} step="any" label="Step" + border />
diff --git a/showcases/web-kitchensink-reactnext/src/pages/categories/temporal/index.tsx b/showcases/web-kitchensink-reactnext/src/pages/categories/temporal/index.tsx index ec169fa..cb6c846 100644 --- a/showcases/web-kitchensink-reactnext/src/pages/categories/temporal/index.tsx +++ b/showcases/web-kitchensink-reactnext/src/pages/categories/temporal/index.tsx @@ -17,14 +17,14 @@ const TemporalPage: NextPage = () => {
- - { /> -