Files
UT-Registration-Plus/unocss.config.ts
Ethan Lanting c2328e461e feat(ui): color picker final touches (#491)
* fix: update CourseCellColorPicker.tsx background to white

* feat: add color picker to CalendarCourseCell component

* feat: add color picker functionality to update course colors

* fix: type issues with storybook components

* feat: add useColorPicker hook, isValidHexColor and updateCourseColors utilities

* refactor: color picker logic and UI components

* refactor: update useFlattenedCourseSchedule hook to include courseID property

* refactor: update storybook calendar components with updated props

* refactor: update color picker ui logic to account for position of cell

* fix: revert back to error handling for invalid rgb

* refactor: update jsdocs

* refactor: integrate ColorPickerContext into Calendar components and update props

* refactor: integrate ColorPickerContext into Calendar components and update related props

* refactor: change JSDocs comments and remove unused color inversion state

* refactor: update story components

* feat: add functionality for selecting secondary course colors

* refactor: enhance HexColorEditor to dynamically adjust tag icon color based on preview color

* refactor: simplify JSDoc comment in useColorPicker hook

* fix: revert Button component

* refactor: update CalendarCourseCell component positioning and styling

* fix: correct types in color.ts

* feat: add getDarkerShade function to compute darker shades of hex colors

* feat: add shadow to color picker button

* fix: update button size in ColorPatch component

* feat: implement debounced input for hex color editor and add useDebounce hook

* chore: utilize the logical and && operator instead of the ternary operator

* fix: imports and palette icon

* refactor: remove unused import

* fix: bug when course add fails with custom colors

* chore: run lint

* chore: run check-types

* feat: add HSL color type and conversion functions

* refactor: rename colorway to theme

* fix: hide color picker on screenshot

* fix: undo important syntax

* refactor: rename SomeFunction to DebouncedCallback

* refactor: remove inner function

* refactor: update return type to DebouncedCallback

* fix: adjust sizes for hash and palette button

* feat: create tests for hexToHSL and isValidHexColor

* refactor: update parameter type to use HexColor

* fix: increase size of palette button

* fix: update dependency array for hex code debounce

* fix: change colorPickerRef element ref

* feat: add Roboto Mono font

* fix: update input class to use monospace font

* feat: add getLighterShade function

* chore: run prettier and lint

* feat: synchronize local hex code with hexCode prop changes

---------

Co-authored-by: doprz <52579214+doprz@users.noreply.github.com>
2025-01-29 20:32:06 -06:00

64 lines
2.6 KiB
TypeScript

import presetUno from '@unocss/preset-uno';
import presetWebFonts from '@unocss/preset-web-fonts';
import transformerDirectives from '@unocss/transformer-directives';
import transformerVariantGroup from '@unocss/transformer-variant-group';
import { defineConfig } from 'unocss';
import { spacing } from './src/shared/types/Spacing';
import { colors } from './src/shared/types/ThemeColors';
export default defineConfig({
rules: [
[
'btn-transition',
{
transition:
'color 180ms ease-in, border-color 150ms ease-in, background-color 150ms ease-in, box-shadow 200ms ease-in, transform 50ms ease-in',
},
],
[
'ring-offset-0',
{
'--un-ring-offset-width': '0px',
},
],
['font-all-small-caps', { 'font-variant-caps': 'all-small-caps' }],
],
shortcuts: {
focusable: 'outline-none ring-blue-500/50 dark:ring-blue-400/60 ring-0 focus-visible:ring-4',
btn: 'h-10 w-auto flex cursor-pointer justify-center items-center gap-spacing-3 rounded-1 px-spacing-5 py-0 text-4.5 btn-transition disabled:(cursor-not-allowed opacity-50) active:enabled:scale-96 focusable',
link: 'text-ut-burntorange link:text-ut-burntorange underline underline-offset-2 hover:text-ut-orange focus-visible:text-ut-orange focusable btn-transition ease-out-expo',
linkanimate:
'relative cursor-pointer transition duration-100 ease-out after:(absolute left-0.4 right-0.4 h-2px scale-x-95 bg-ut-orange opacity-0 transition duration-250 ease-out-expo content-empty -bottom-0.75 -translate-y-0.5) active:scale-95 hover:text-ut-orange focus-visible:text-ut-orange hover:after:(opacity-100) !hover:after:translate-y-0 !hover:after:scale-x-100',
},
theme: {
easing: {
'in-out-expo': 'cubic-bezier(.46, 0, .21, 1)',
'out-expo': 'cubic-bezier(0.19, 1, 0.22, 1)',
},
colors,
spacing,
},
variants: [
matcher => {
const search = 'screenshot:';
if (!matcher.startsWith(search)) return matcher;
return {
matcher: matcher.slice(search.length),
selector: s => `.screenshot-in-progress ${s}`,
};
},
],
presets: [
presetUno(),
presetWebFonts({
provider: 'none',
fonts: {
sans: ['Roboto Flex', 'Roboto Flex Local'],
mono: ['Roboto Mono', 'Roboto Mono Local'],
},
}),
],
transformers: [transformerVariantGroup(), transformerDirectives()],
});