Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Make sure UI lib conforms with design standards

Blue Mouse5076030fb145
diff --git a/web/app/ui/Combobox.tsx b/web/app/ui/Combobox.tsx
index c64876523..59d749b6c 100644
--- a/web/app/ui/Combobox.tsx
+++ b/web/app/ui/Combobox.tsx
@@ -56,7 +56,7 @@ const Combobox = ({
<div className='relative w-full cursor-default rounded-lg'>
<ComboboxInput
className={cx(
- 'relative w-full cursor-default rounded-md border border-gray-300 bg-white py-2 pr-10 pl-3 text-left ring-inset focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 focus:outline-hidden sm:text-sm dark:border-gray-800 dark:bg-slate-900 dark:text-gray-50',
+ 'relative w-full cursor-default rounded-md border-0 bg-white py-2 pr-10 pl-3 text-left ring-1 ring-gray-300 ring-inset focus:ring-2 focus:ring-slate-900 focus:outline-hidden sm:text-sm dark:bg-slate-950 dark:text-gray-50 dark:ring-slate-700/80 dark:focus:ring-slate-300',
buttonClassName,
)}
// @ts-expect-error
@@ -80,7 +80,7 @@ const Combobox = ({
leaveTo='opacity-0'
afterLeave={() => setQuery('')}
>
- <ComboboxOptions className='absolute z-30 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base ring-1 ring-black/10 focus:outline-hidden sm:text-sm dark:bg-slate-900'>
+ <ComboboxOptions className='absolute z-30 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base ring-1 ring-black/10 focus:outline-hidden sm:text-sm dark:bg-slate-950 dark:ring-slate-700/80'>
{_isEmpty(filteredItems) && !_isEmpty(query) ? (
<div className='relative cursor-default px-4 py-2 text-gray-900 select-none dark:text-white'>
{t('common.nothingFound')}
@@ -90,13 +90,11 @@ const Combobox = ({
<ComboboxOption
key={keyExtractor ? keyExtractor(item, index) : item}
className={({ active }) =>
- cx(
- 'relative cursor-default py-2 pr-4 pl-8 select-none dark:text-white',
- {
- 'bg-indigo-600 text-white': active,
- 'text-gray-900': !active,
- },
- )
+ cx('relative cursor-default py-2 pr-4 pl-8 select-none', {
+ 'bg-gray-100 text-gray-900 dark:bg-slate-800 dark:text-white':
+ active,
+ 'text-gray-900 dark:text-white': !active,
+ })
}
value={labelExtractor ? labelExtractor(item, index) : item}
>
@@ -112,8 +110,8 @@ const Combobox = ({
className={cx(
'absolute inset-y-0 left-0 flex items-center pl-1.5',
{
- 'text-white': active,
- 'text-indigo-600': !active,
+ 'text-gray-900 dark:text-white': active,
+ 'text-gray-600 dark:text-gray-300': !active,
},
)}
>
diff --git a/web/app/ui/Datepicker.tsx b/web/app/ui/Datepicker.tsx
index 7ffeb5ed3..f39206d91 100644
--- a/web/app/ui/Datepicker.tsx
+++ b/web/app/ui/Datepicker.tsx
@@ -356,7 +356,7 @@ const DatePicker = forwardRef<DatePickerHandle, DatePickerProps>(
<div className='fixed inset-0 z-50 flex items-start justify-center bg-black/20 p-4'>
<div
ref={popoverRef}
- className='mt-10 w-[320px] rounded-xl border border-gray-200 bg-white p-3 shadow-xl dark:border-slate-800 dark:bg-slate-950'
+ className='mt-10 w-[320px] rounded-xl border border-gray-200 bg-white p-3 shadow-md dark:border-slate-800 dark:bg-slate-950'
>
<div className='flex items-center justify-between'>
<button
@@ -459,7 +459,7 @@ const DatePicker = forwardRef<DatePickerHandle, DatePickerProps>(
isCurrentMonth && !disabled,
'text-gray-400 dark:text-gray-500':
!isCurrentMonth || disabled,
- 'bg-indigo-600 text-white dark:bg-indigo-500':
+ 'bg-slate-900 text-white dark:bg-slate-100 dark:text-slate-900':
isStart || isEnd,
'bg-gray-100 dark:bg-slate-900':
isBetween && !isStart && !isEnd,
@@ -496,7 +496,7 @@ const DatePicker = forwardRef<DatePickerHandle, DatePickerProps>(
</button>
<button
type='button'
- className='rounded-md bg-indigo-600 px-2 py-1 text-xs font-semibold text-white hover:bg-indigo-500'
+ className='rounded-md bg-slate-900 px-2 py-1 text-xs font-semibold text-white hover:bg-slate-700 dark:bg-slate-100 dark:text-slate-900 dark:hover:bg-white'
disabled={!start}
onClick={() => {
if (!start) return
@@ -514,7 +514,7 @@ const DatePicker = forwardRef<DatePickerHandle, DatePickerProps>(
<div className='absolute top-7 right-0 z-50'>
<div
ref={popoverRef}
- className='w-[320px] rounded-xl border border-gray-200 bg-white p-3 shadow-xl dark:border-slate-800 dark:bg-slate-950'
+ className='w-[320px] rounded-xl border border-gray-200 bg-white p-3 shadow-md dark:border-slate-800 dark:bg-slate-950'
>
<div className='flex items-center justify-between'>
<button
@@ -617,7 +617,7 @@ const DatePicker = forwardRef<DatePickerHandle, DatePickerProps>(
isCurrentMonth && !disabled,
'text-gray-400 dark:text-gray-500':
!isCurrentMonth || disabled,
- 'bg-indigo-600 text-white dark:bg-indigo-500':
+ 'bg-slate-900 text-white dark:bg-slate-100 dark:text-slate-900':
isStart || isEnd,
'bg-gray-100 dark:bg-slate-900':
isBetween && !isStart && !isEnd,
@@ -654,7 +654,7 @@ const DatePicker = forwardRef<DatePickerHandle, DatePickerProps>(
</button>
<button
type='button'
- className='rounded-md bg-indigo-600 px-2 py-1 text-xs font-semibold text-white hover:bg-indigo-500'
+ className='rounded-md bg-slate-900 px-2 py-1 text-xs font-semibold text-white hover:bg-slate-700 dark:bg-slate-100 dark:text-slate-900 dark:hover:bg-white'
disabled={!start}
onClick={() => {
if (!start) return
diff --git a/web/app/ui/FilterValueInput.tsx b/web/app/ui/FilterValueInput.tsx
index 9ac4fa883..d63dbbd22 100644
--- a/web/app/ui/FilterValueInput.tsx
+++ b/web/app/ui/FilterValueInput.tsx
@@ -347,7 +347,7 @@ const FilterValueInput = ({
ref={inputRef}
type='text'
className={cx(
- 'w-full rounded-md border border-gray-300 bg-white py-2 pr-8 text-sm transition-colors ring-inset placeholder:text-gray-400 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 focus:outline-hidden dark:border-gray-700 dark:bg-slate-900 dark:text-gray-50 dark:placeholder:text-gray-500',
+ 'w-full rounded-md border-0 bg-white py-2 pr-8 text-sm ring-1 ring-gray-300 transition-colors ring-inset placeholder:text-gray-400 focus:ring-2 focus:ring-slate-900 focus:outline-hidden dark:bg-slate-950 dark:text-gray-50 dark:ring-slate-700/80 dark:placeholder:text-gray-500 dark:focus:ring-slate-300',
{
'cursor-not-allowed opacity-60': disabled,
'pl-8': showIconInInput,
@@ -371,7 +371,7 @@ const FilterValueInput = ({
</div>
{isOpen && !disabled ? (
- <div className='absolute z-50 mt-1 w-full min-w-[200px] rounded-md bg-white text-sm shadow-lg ring-1 ring-black/10 dark:bg-slate-900'>
+ <div className='absolute z-50 mt-1 w-full min-w-[200px] rounded-md bg-white text-sm ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
{isLoading ? (
<div className='flex items-center justify-center gap-2 px-4 py-3 text-gray-500 dark:text-gray-400'>
<Spin className='size-4' />
@@ -394,7 +394,7 @@ const FilterValueInput = ({
}
setIsOpen(false)
}}
- className='flex w-full items-center justify-center gap-1.5 rounded-md bg-indigo-600 px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-indigo-700'
+ className='flex w-full items-center justify-center gap-1.5 rounded-md bg-slate-900 px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-slate-700 dark:bg-slate-100 dark:text-slate-900 dark:hover:bg-white'
>
<PlusIcon className='h-4 w-4' />
{t('project.filterUseValue', { value: inputValue.trim() })}
@@ -428,7 +428,7 @@ const FilterValueInput = ({
className={cx(
'absolute right-0 left-0 mx-1 flex cursor-pointer items-center gap-2 rounded-md py-2 pr-4 pl-2 text-left transition-colors select-none hover:bg-gray-100 dark:hover:bg-slate-800',
{
- 'bg-indigo-50 dark:bg-indigo-900/30': selected,
+ 'bg-gray-100 dark:bg-slate-800': selected,
'text-gray-700 dark:text-gray-50': !selected,
},
)}
@@ -447,7 +447,7 @@ const FilterValueInput = ({
{labelValue}
</span>
{selected ? (
- <CheckIcon className='ml-auto h-4 w-4 shrink-0 text-indigo-600 dark:text-indigo-400' />
+ <CheckIcon className='ml-auto h-4 w-4 shrink-0 text-gray-600 dark:text-gray-300' />
) : null}
</button>
)
diff --git a/web/app/ui/LoadingBar.tsx b/web/app/ui/LoadingBar.tsx
index 8d82629ab..6911bacef 100644
--- a/web/app/ui/LoadingBar.tsx
+++ b/web/app/ui/LoadingBar.tsx
@@ -14,7 +14,7 @@ const LoadingBar: React.FC<LoadingBarProps> = ({ className }) => {
)}
>
<div
- className='absolute h-full rounded-full bg-gradient-to-r from-indigo-500 to-blue-600 opacity-90 shadow-sm'
+ className='absolute h-full rounded-full bg-gradient-to-r from-slate-700 to-slate-900 opacity-90 dark:from-slate-300 dark:to-white'
style={{
animation:
'indeterminate1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite',
@@ -22,7 +22,7 @@ const LoadingBar: React.FC<LoadingBarProps> = ({ className }) => {
/>
<div
- className='absolute h-full rounded-full bg-gradient-to-r from-indigo-500 to-blue-600 opacity-75 shadow-sm'
+ className='absolute h-full rounded-full bg-gradient-to-r from-slate-700 to-slate-900 opacity-75 dark:from-slate-300 dark:to-white'
style={{
animation:
'indeterminate2 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite',
diff --git a/web/app/ui/StatusPage.tsx b/web/app/ui/StatusPage.tsx
index 4af473b83..c8e533f12 100644
--- a/web/app/ui/StatusPage.tsx
+++ b/web/app/ui/StatusPage.tsx
@@ -117,10 +117,10 @@ const StatusPage = ({
key={action.to}
to={action.to}
className={cn(
- 'inline-flex items-center rounded-md px-4 py-2 text-sm font-medium transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-none',
+ 'inline-flex items-center rounded-md px-4 py-2 text-sm font-medium transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-hidden',
action.primary
- ? 'bg-slate-900 text-white hover:bg-slate-700 focus:ring-slate-500 dark:bg-slate-900 dark:hover:bg-slate-800'
- : 'bg-gray-100 text-gray-700 hover:bg-gray-200 focus:ring-gray-500 dark:bg-slate-900 dark:text-gray-200 dark:hover:bg-slate-800',
+ ? 'bg-slate-900 text-white hover:bg-slate-700 focus:ring-slate-900 dark:bg-slate-100 dark:text-slate-900 dark:hover:bg-white dark:focus:ring-slate-300 dark:focus:ring-offset-slate-900'
+ : 'bg-gray-100 text-gray-700 hover:bg-gray-200 focus:ring-slate-900 dark:bg-slate-900 dark:text-gray-200 dark:hover:bg-slate-800 dark:focus:ring-slate-300 dark:focus:ring-offset-slate-900',
)}
>
{action.label}
@@ -131,10 +131,10 @@ const StatusPage = ({
type='button'
onClick={action.onClick}
className={cn(
- 'inline-flex items-center rounded-md px-4 py-2 text-sm font-medium transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-none',
+ 'inline-flex items-center rounded-md px-4 py-2 text-sm font-medium transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-hidden',
action.primary
- ? 'bg-slate-900 text-white hover:bg-slate-700 focus:ring-slate-500 dark:bg-slate-900 dark:hover:bg-slate-800'
- : 'bg-gray-100 text-gray-700 hover:bg-gray-200 focus:ring-gray-500 dark:bg-slate-900 dark:text-gray-200 dark:hover:bg-slate-800',
+ ? 'bg-slate-900 text-white hover:bg-slate-700 focus:ring-slate-900 dark:bg-slate-100 dark:text-slate-900 dark:hover:bg-white dark:focus:ring-slate-300 dark:focus:ring-offset-slate-900'
+ : 'bg-gray-100 text-gray-700 hover:bg-gray-200 focus:ring-slate-900 dark:bg-slate-900 dark:text-gray-200 dark:hover:bg-slate-800 dark:focus:ring-slate-300 dark:focus:ring-offset-slate-900',
)}
>
{action.label}
diff --git a/web/app/ui/icons/SwetrixLogo.tsx b/web/app/ui/icons/SwetrixLogo.tsx
index 788d48149..8d5d95eb6 100644
--- a/web/app/ui/icons/SwetrixLogo.tsx
+++ b/web/app/ui/icons/SwetrixLogo.tsx
@@ -41,7 +41,7 @@ const SwetrixLogo = ({
<span
className={cx(
'text-2xl leading-5 font-bold',
- theme === 'dark' ? 'text-white' : 'text-indigo-950',
+ theme === 'dark' ? 'text-white' : 'text-slate-900',
)}
>
Swetrix
@@ -50,7 +50,7 @@ const SwetrixLogo = ({
<span
className={cx(
'text-xs font-semibold',
- theme === 'dark' ? 'text-white' : 'text-indigo-600',
+ theme === 'dark' ? 'text-white' : 'text-slate-600',
)}
>
{t('common.communityEdition')}