@betterinternship/components 3.5.2 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -54,7 +54,9 @@ const SelectTrigger = React.forwardRef(({ className, children, onPointerDown, on
54
54
  pressedRef.current = false;
55
55
  if (fromLabel && !event.defaultPrevented && !open && !props.disabled)
56
56
  setOpen(true);
57
- }, className: cn('group bg-background text-foreground placeholder:text-muted-foreground/40 data-[placeholder]:text-muted-foreground/40 border-input enabled:hover:border-input-hover flex h-form-control min-h-form-control max-h-form-control w-full cursor-pointer items-center justify-between gap-2 rounded-control-lg border px-field-padding-x py-0 text-base font-normal outline-none aria-invalid:border-destructive disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1', 'focus-visible:outline-3 focus-visible:outline-offset-4 focus-visible:outline-landing-blue', fieldInteractionClassName, className), ...props, children: [children, jsx(SelectPrimitive.Icon, { asChild: true, children: jsx(ChevronDown, { className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-interactive ease-out-strong group-data-[state=open]:rotate-180 motion-reduce:transition-none" }) })] }));
57
+ }, className: cn(
58
+ // text-left: a <button> centres its text, which pushes a cut-off value right.
59
+ 'group text-left bg-background text-foreground placeholder:text-muted-foreground/40 data-[placeholder]:text-muted-foreground/40 border-input enabled:hover:border-input-hover flex h-form-control min-h-form-control max-h-form-control w-full cursor-pointer items-center justify-between gap-2 rounded-control-lg border px-field-padding-x py-0 text-base font-normal outline-none aria-invalid:border-destructive disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1', 'focus-visible:outline-3 focus-visible:outline-offset-4 focus-visible:outline-landing-blue', fieldInteractionClassName, className), ...props, children: [children, jsx(SelectPrimitive.Icon, { asChild: true, children: jsx(ChevronDown, { className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-interactive ease-out-strong group-data-[state=open]:rotate-180 motion-reduce:transition-none" }) })] }));
58
60
  });
59
61
  SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
60
62
  const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => (jsx(SelectPrimitive.ScrollUpButton, { ref: ref, className: cn('flex cursor-default items-center justify-center py-1', className), ...props, children: jsx(ChevronUp, { className: "h-4 w-4" }) })));
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sources":["../../src/components/select.tsx"],"sourcesContent":["'use client';\r\n\r\nimport * as React from 'react';\r\nimport * as SelectPrimitive from '@radix-ui/react-select';\r\nimport { Check, ChevronDown, ChevronUp, X } from 'lucide-react';\r\n\r\nimport { cn } from '@/utils';\r\nimport { fieldInteractionClassName } from '@/hooks/use-field-focus';\r\nimport { useMobile } from '@/hooks/use-mobile';\r\nimport { useMobileSheetViewport } from '@/hooks/use-mobile-sheet-viewport';\r\nimport { useFormField, useFormFieldControl } from './form-field';\r\n\r\nconst SelectContext = React.createContext({ open: false, setOpen: (_open: boolean) => {} });\r\n\r\nfunction Select({ open: controlledOpen, defaultOpen = false, onOpenChange, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {\r\n const [internalOpen, setInternalOpen] = React.useState(defaultOpen);\r\n const open = controlledOpen ?? internalOpen;\r\n const setOpen = (next: boolean) => {\r\n if (controlledOpen === undefined) setInternalOpen(next);\r\n onOpenChange?.(next);\r\n };\r\n\r\n return (\r\n <SelectContext.Provider value={{ open, setOpen }}>\r\n <SelectPrimitive.Root {...props} open={open} onOpenChange={setOpen}>\r\n {children}\r\n </SelectPrimitive.Root>\r\n </SelectContext.Provider>\r\n );\r\n}\r\n\r\nconst SelectGroup = SelectPrimitive.Group;\r\n\r\nconst SelectValue = SelectPrimitive.Value;\r\n\r\nconst SelectTrigger = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Trigger>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\r\n>(({ className, children, onPointerDown, onClick, ...ownProps }, ref) => {\r\n const props = useFormFieldControl(ownProps);\r\n const { open, setOpen } = React.useContext(SelectContext);\r\n // Radix opens on a mouse press on the trigger itself, so a click that arrives\r\n // without one (from the field's label) would only focus it. Open it here.\r\n // A press on the trigger stops counting once anything else is pressed: when\r\n // Radix opens on the press, the release lands on the menu, not the trigger.\r\n const pressedRef = React.useRef(false);\r\n const triggerRef = React.useRef<HTMLButtonElement | null>(null);\r\n React.useEffect(() => {\r\n const onPointerDownAnywhere = (event: PointerEvent) => {\r\n if (!(event.target instanceof Node) || !triggerRef.current?.contains(event.target)) pressedRef.current = false;\r\n };\r\n document.addEventListener('pointerdown', onPointerDownAnywhere, true);\r\n return () => document.removeEventListener('pointerdown', onPointerDownAnywhere, true);\r\n }, []);\r\n return (\r\n <SelectPrimitive.Trigger\r\n ref={(node) => {\r\n triggerRef.current = node;\r\n if (typeof ref === 'function') ref(node);\r\n else if (ref) ref.current = node;\r\n }}\r\n onPointerDown={(event) => {\r\n pressedRef.current = true;\r\n onPointerDown?.(event);\r\n }}\r\n onClick={(event) => {\r\n onClick?.(event);\r\n const fromLabel = !pressedRef.current;\r\n pressedRef.current = false;\r\n if (fromLabel && !event.defaultPrevented && !open && !props.disabled) setOpen(true);\r\n }}\r\n className={cn(\r\n 'group bg-background text-foreground placeholder:text-muted-foreground/40 data-[placeholder]:text-muted-foreground/40 border-input enabled:hover:border-input-hover flex h-form-control min-h-form-control max-h-form-control w-full cursor-pointer items-center justify-between gap-2 rounded-control-lg border px-field-padding-x py-0 text-base font-normal outline-none aria-invalid:border-destructive disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',\r\n 'focus-visible:outline-3 focus-visible:outline-offset-4 focus-visible:outline-landing-blue',\r\n fieldInteractionClassName,\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n <SelectPrimitive.Icon asChild>\r\n <ChevronDown className=\"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-interactive ease-out-strong group-data-[state=open]:rotate-180 motion-reduce:transition-none\" />\r\n </SelectPrimitive.Icon>\r\n </SelectPrimitive.Trigger>\r\n );\r\n});\r\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\r\n\r\nconst SelectScrollUpButton = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\r\n>(({ className, ...props }, ref) => (\r\n <SelectPrimitive.ScrollUpButton\r\n ref={ref}\r\n className={cn(\r\n 'flex cursor-default items-center justify-center py-1',\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <ChevronUp className=\"h-4 w-4\" />\r\n </SelectPrimitive.ScrollUpButton>\r\n));\r\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\r\n\r\nconst SelectScrollDownButton = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\r\n>(({ className, ...props }, ref) => (\r\n <SelectPrimitive.ScrollDownButton\r\n ref={ref}\r\n className={cn(\r\n 'flex cursor-default items-center justify-center py-1',\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <ChevronDown className=\"h-4 w-4\" />\r\n </SelectPrimitive.ScrollDownButton>\r\n));\r\nSelectScrollDownButton.displayName =\r\n SelectPrimitive.ScrollDownButton.displayName;\r\n\r\nconst SelectContent = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> & { title?: string }\r\n>(({ className, children, position = 'popper', title: ownTitle, style, ...props }, ref) => {\r\n // The phone sheet's title: an explicit title, else the field's label.\r\n const title = ownTitle ?? useFormField()?.labelText ?? 'Choose an option';\r\n const mobile = useMobile();\r\n const { open, setOpen } = React.useContext(SelectContext);\r\n const viewport = useMobileSheetViewport(open && mobile);\r\n\r\n return (\r\n <SelectPrimitive.Portal>\r\n <div\r\n className={mobile ? '[&>[data-radix-popper-content-wrapper]]:!fixed [&>[data-radix-popper-content-wrapper]]:!inset-x-0 [&>[data-radix-popper-content-wrapper]]:!top-auto [&>[data-radix-popper-content-wrapper]]:!bottom-[var(--select-sheet-bottom)] [&>[data-radix-popper-content-wrapper]]:!transform-none [&>[data-radix-popper-content-wrapper]]:!z-(--z-popover) [&>[data-radix-popper-content-wrapper]]:!min-w-0' : undefined}\r\n style={{ '--select-sheet-bottom': `${viewport?.bottom ?? 0}px` } as React.CSSProperties}\r\n >\r\n {mobile && open && (\r\n <div aria-hidden=\"true\" className=\"fixed inset-0 z-(--z-popover-overlay) bg-black/25 backdrop-blur-[1px]\" />\r\n )}\r\n <SelectPrimitive.Content\r\n ref={ref}\r\n className={cn(\r\n 'relative flex flex-col overflow-hidden border border-border bg-background text-sm text-foreground shadow-card duration-interactive ease-out-strong motion-reduce:animate-none',\r\n mobile\r\n ? 'w-full rounded-t-control-lg border-b-0 pb-[env(safe-area-inset-bottom)]'\r\n : 'z-(--z-popover) max-h-[400px] min-w-[8rem] rounded-control-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',\r\n className,\r\n )}\r\n position={mobile ? 'popper' : position}\r\n sideOffset={4}\r\n style={{\r\n ...(mobile ? { maxHeight: viewport ? Math.min(viewport.height, 640) : '80dvh' } : {}),\r\n ...style,\r\n }}\r\n {...props}\r\n >\r\n {mobile && (\r\n <div role=\"presentation\" className=\"flex shrink-0 items-center justify-between gap-4 px-4 pb-3 pt-4\">\r\n <h2 className=\"text-base font-semibold text-foreground\">{title}</h2>\r\n <button\r\n type=\"button\"\r\n aria-label=\"Close options\"\r\n className=\"-mr-3 flex h-11 w-11 shrink-0 items-center justify-center rounded-control-lg text-muted-foreground hover:bg-muted\"\r\n onPointerDown={(event) => event.stopPropagation()}\r\n onClick={() => setOpen(false)}\r\n >\r\n <X className=\"h-5 w-5\" aria-hidden=\"true\" />\r\n </button>\r\n </div>\r\n )}\r\n {!mobile && <SelectScrollUpButton />}\r\n <SelectPrimitive.Viewport\r\n className={cn(\r\n 'flex min-h-0 flex-col gap-option-gap overflow-y-auto overscroll-contain p-option-inset',\r\n mobile ? 'w-full flex-1' : position === 'popper' && 'w-full min-w-[var(--radix-select-trigger-width)]',\r\n )}\r\n >\r\n {children}\r\n </SelectPrimitive.Viewport>\r\n {!mobile && <SelectScrollDownButton />}\r\n </SelectPrimitive.Content>\r\n </div>\r\n </SelectPrimitive.Portal>\r\n );\r\n});\r\nSelectContent.displayName = SelectPrimitive.Content.displayName;\r\n\r\nconst SelectLabel = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Label>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\r\n>(({ className, ...props }, ref) => (\r\n <SelectPrimitive.Label\r\n ref={ref}\r\n className={cn('px-option-x py-2 text-sm font-semibold text-foreground', className)}\r\n {...props}\r\n />\r\n));\r\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\r\n\r\nconst SelectItem = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Item>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\r\n>(({ className, children, ...props }, ref) => (\r\n <SelectPrimitive.Item\r\n ref={ref}\r\n className={cn(\r\n 'relative flex min-h-option-row w-full cursor-pointer items-center gap-2 rounded-control-sm px-option-x py-2 pr-9 text-sm text-muted-foreground outline-none select-none transition-colors duration-interactive ease-out-strong focus:bg-muted data-[state=checked]:bg-primary-tint data-[disabled]:pointer-events-none data-[disabled]:opacity-50 motion-reduce:transition-none max-md:min-h-12',\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <span className=\"absolute right-option-x flex h-4 w-4 items-center justify-center\">\r\n <SelectPrimitive.ItemIndicator>\r\n <Check className=\"h-4 w-4\" />\r\n </SelectPrimitive.ItemIndicator>\r\n </span>\r\n\r\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\r\n </SelectPrimitive.Item>\r\n));\r\nSelectItem.displayName = SelectPrimitive.Item.displayName;\r\n\r\nconst SelectSeparator = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Separator>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\r\n>(({ className, ...props }, ref) => (\r\n <SelectPrimitive.Separator\r\n ref={ref}\r\n className={cn('bg-border h-px', className)}\r\n {...props}\r\n />\r\n));\r\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\r\n\r\nexport {\r\n Select,\r\n SelectGroup,\r\n SelectValue,\r\n SelectTrigger,\r\n SelectContent,\r\n SelectLabel,\r\n SelectItem,\r\n SelectSeparator,\r\n SelectScrollUpButton,\r\n SelectScrollDownButton,\r\n};\r\n"],"names":[],"mappings":";;;;;;;;;;;AAYA;AAEA;AACE;AACA;AACA;;;AAEE;AACF;AAEA;AAOF;AAEA;AAEA;AAEA;AAIE;AACA;;;;;;;AAOA;AACE;AACE;AAAoF;AACtF;;AAEA;;;AAKE;;;AAEK;AAAS;AAChB;AAEE;AACA;AACF;AAEE;AACA;AACA;AACA;;AACF;AAeJ;AACA;AAEA;AAeA;AAEA;AAeA;AACE;AAEF;;;AAME;AACA;;AAGA;AAcQ;;AAOF;AACA;;AAgCR;AACA;AAEA;AAUA;AAEA;AAqBA;AAEA;AAUA;;"}
1
+ {"version":3,"file":"select.js","sources":["../../src/components/select.tsx"],"sourcesContent":["'use client';\r\n\r\nimport * as React from 'react';\r\nimport * as SelectPrimitive from '@radix-ui/react-select';\r\nimport { Check, ChevronDown, ChevronUp, X } from 'lucide-react';\r\n\r\nimport { cn } from '@/utils';\r\nimport { fieldInteractionClassName } from '@/hooks/use-field-focus';\r\nimport { useMobile } from '@/hooks/use-mobile';\r\nimport { useMobileSheetViewport } from '@/hooks/use-mobile-sheet-viewport';\r\nimport { useFormField, useFormFieldControl } from './form-field';\r\n\r\nconst SelectContext = React.createContext({ open: false, setOpen: (_open: boolean) => {} });\r\n\r\nfunction Select({ open: controlledOpen, defaultOpen = false, onOpenChange, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {\r\n const [internalOpen, setInternalOpen] = React.useState(defaultOpen);\r\n const open = controlledOpen ?? internalOpen;\r\n const setOpen = (next: boolean) => {\r\n if (controlledOpen === undefined) setInternalOpen(next);\r\n onOpenChange?.(next);\r\n };\r\n\r\n return (\r\n <SelectContext.Provider value={{ open, setOpen }}>\r\n <SelectPrimitive.Root {...props} open={open} onOpenChange={setOpen}>\r\n {children}\r\n </SelectPrimitive.Root>\r\n </SelectContext.Provider>\r\n );\r\n}\r\n\r\nconst SelectGroup = SelectPrimitive.Group;\r\n\r\nconst SelectValue = SelectPrimitive.Value;\r\n\r\nconst SelectTrigger = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Trigger>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\r\n>(({ className, children, onPointerDown, onClick, ...ownProps }, ref) => {\r\n const props = useFormFieldControl(ownProps);\r\n const { open, setOpen } = React.useContext(SelectContext);\r\n // Radix opens on a mouse press on the trigger itself, so a click that arrives\r\n // without one (from the field's label) would only focus it. Open it here.\r\n // A press on the trigger stops counting once anything else is pressed: when\r\n // Radix opens on the press, the release lands on the menu, not the trigger.\r\n const pressedRef = React.useRef(false);\r\n const triggerRef = React.useRef<HTMLButtonElement | null>(null);\r\n React.useEffect(() => {\r\n const onPointerDownAnywhere = (event: PointerEvent) => {\r\n if (!(event.target instanceof Node) || !triggerRef.current?.contains(event.target)) pressedRef.current = false;\r\n };\r\n document.addEventListener('pointerdown', onPointerDownAnywhere, true);\r\n return () => document.removeEventListener('pointerdown', onPointerDownAnywhere, true);\r\n }, []);\r\n return (\r\n <SelectPrimitive.Trigger\r\n ref={(node) => {\r\n triggerRef.current = node;\r\n if (typeof ref === 'function') ref(node);\r\n else if (ref) ref.current = node;\r\n }}\r\n onPointerDown={(event) => {\r\n pressedRef.current = true;\r\n onPointerDown?.(event);\r\n }}\r\n onClick={(event) => {\r\n onClick?.(event);\r\n const fromLabel = !pressedRef.current;\r\n pressedRef.current = false;\r\n if (fromLabel && !event.defaultPrevented && !open && !props.disabled) setOpen(true);\r\n }}\r\n className={cn(\r\n // text-left: a <button> centres its text, which pushes a cut-off value right.\r\n 'group text-left bg-background text-foreground placeholder:text-muted-foreground/40 data-[placeholder]:text-muted-foreground/40 border-input enabled:hover:border-input-hover flex h-form-control min-h-form-control max-h-form-control w-full cursor-pointer items-center justify-between gap-2 rounded-control-lg border px-field-padding-x py-0 text-base font-normal outline-none aria-invalid:border-destructive disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',\r\n 'focus-visible:outline-3 focus-visible:outline-offset-4 focus-visible:outline-landing-blue',\r\n fieldInteractionClassName,\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n <SelectPrimitive.Icon asChild>\r\n <ChevronDown className=\"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-interactive ease-out-strong group-data-[state=open]:rotate-180 motion-reduce:transition-none\" />\r\n </SelectPrimitive.Icon>\r\n </SelectPrimitive.Trigger>\r\n );\r\n});\r\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\r\n\r\nconst SelectScrollUpButton = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\r\n>(({ className, ...props }, ref) => (\r\n <SelectPrimitive.ScrollUpButton\r\n ref={ref}\r\n className={cn(\r\n 'flex cursor-default items-center justify-center py-1',\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <ChevronUp className=\"h-4 w-4\" />\r\n </SelectPrimitive.ScrollUpButton>\r\n));\r\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\r\n\r\nconst SelectScrollDownButton = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\r\n>(({ className, ...props }, ref) => (\r\n <SelectPrimitive.ScrollDownButton\r\n ref={ref}\r\n className={cn(\r\n 'flex cursor-default items-center justify-center py-1',\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <ChevronDown className=\"h-4 w-4\" />\r\n </SelectPrimitive.ScrollDownButton>\r\n));\r\nSelectScrollDownButton.displayName =\r\n SelectPrimitive.ScrollDownButton.displayName;\r\n\r\nconst SelectContent = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> & { title?: string }\r\n>(({ className, children, position = 'popper', title: ownTitle, style, ...props }, ref) => {\r\n // The phone sheet's title: an explicit title, else the field's label.\r\n const title = ownTitle ?? useFormField()?.labelText ?? 'Choose an option';\r\n const mobile = useMobile();\r\n const { open, setOpen } = React.useContext(SelectContext);\r\n const viewport = useMobileSheetViewport(open && mobile);\r\n\r\n return (\r\n <SelectPrimitive.Portal>\r\n <div\r\n className={mobile ? '[&>[data-radix-popper-content-wrapper]]:!fixed [&>[data-radix-popper-content-wrapper]]:!inset-x-0 [&>[data-radix-popper-content-wrapper]]:!top-auto [&>[data-radix-popper-content-wrapper]]:!bottom-[var(--select-sheet-bottom)] [&>[data-radix-popper-content-wrapper]]:!transform-none [&>[data-radix-popper-content-wrapper]]:!z-(--z-popover) [&>[data-radix-popper-content-wrapper]]:!min-w-0' : undefined}\r\n style={{ '--select-sheet-bottom': `${viewport?.bottom ?? 0}px` } as React.CSSProperties}\r\n >\r\n {mobile && open && (\r\n <div aria-hidden=\"true\" className=\"fixed inset-0 z-(--z-popover-overlay) bg-black/25 backdrop-blur-[1px]\" />\r\n )}\r\n <SelectPrimitive.Content\r\n ref={ref}\r\n className={cn(\r\n 'relative flex flex-col overflow-hidden border border-border bg-background text-sm text-foreground shadow-card duration-interactive ease-out-strong motion-reduce:animate-none',\r\n mobile\r\n ? 'w-full rounded-t-control-lg border-b-0 pb-[env(safe-area-inset-bottom)]'\r\n : 'z-(--z-popover) max-h-[400px] min-w-[8rem] rounded-control-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',\r\n className,\r\n )}\r\n position={mobile ? 'popper' : position}\r\n sideOffset={4}\r\n style={{\r\n ...(mobile ? { maxHeight: viewport ? Math.min(viewport.height, 640) : '80dvh' } : {}),\r\n ...style,\r\n }}\r\n {...props}\r\n >\r\n {mobile && (\r\n <div role=\"presentation\" className=\"flex shrink-0 items-center justify-between gap-4 px-4 pb-3 pt-4\">\r\n <h2 className=\"text-base font-semibold text-foreground\">{title}</h2>\r\n <button\r\n type=\"button\"\r\n aria-label=\"Close options\"\r\n className=\"-mr-3 flex h-11 w-11 shrink-0 items-center justify-center rounded-control-lg text-muted-foreground hover:bg-muted\"\r\n onPointerDown={(event) => event.stopPropagation()}\r\n onClick={() => setOpen(false)}\r\n >\r\n <X className=\"h-5 w-5\" aria-hidden=\"true\" />\r\n </button>\r\n </div>\r\n )}\r\n {!mobile && <SelectScrollUpButton />}\r\n <SelectPrimitive.Viewport\r\n className={cn(\r\n 'flex min-h-0 flex-col gap-option-gap overflow-y-auto overscroll-contain p-option-inset',\r\n mobile ? 'w-full flex-1' : position === 'popper' && 'w-full min-w-[var(--radix-select-trigger-width)]',\r\n )}\r\n >\r\n {children}\r\n </SelectPrimitive.Viewport>\r\n {!mobile && <SelectScrollDownButton />}\r\n </SelectPrimitive.Content>\r\n </div>\r\n </SelectPrimitive.Portal>\r\n );\r\n});\r\nSelectContent.displayName = SelectPrimitive.Content.displayName;\r\n\r\nconst SelectLabel = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Label>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\r\n>(({ className, ...props }, ref) => (\r\n <SelectPrimitive.Label\r\n ref={ref}\r\n className={cn('px-option-x py-2 text-sm font-semibold text-foreground', className)}\r\n {...props}\r\n />\r\n));\r\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\r\n\r\nconst SelectItem = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Item>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\r\n>(({ className, children, ...props }, ref) => (\r\n <SelectPrimitive.Item\r\n ref={ref}\r\n className={cn(\r\n 'relative flex min-h-option-row w-full cursor-pointer items-center gap-2 rounded-control-sm px-option-x py-2 pr-9 text-sm text-muted-foreground outline-none select-none transition-colors duration-interactive ease-out-strong focus:bg-muted data-[state=checked]:bg-primary-tint data-[disabled]:pointer-events-none data-[disabled]:opacity-50 motion-reduce:transition-none max-md:min-h-12',\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <span className=\"absolute right-option-x flex h-4 w-4 items-center justify-center\">\r\n <SelectPrimitive.ItemIndicator>\r\n <Check className=\"h-4 w-4\" />\r\n </SelectPrimitive.ItemIndicator>\r\n </span>\r\n\r\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\r\n </SelectPrimitive.Item>\r\n));\r\nSelectItem.displayName = SelectPrimitive.Item.displayName;\r\n\r\nconst SelectSeparator = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Separator>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\r\n>(({ className, ...props }, ref) => (\r\n <SelectPrimitive.Separator\r\n ref={ref}\r\n className={cn('bg-border h-px', className)}\r\n {...props}\r\n />\r\n));\r\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\r\n\r\nexport {\r\n Select,\r\n SelectGroup,\r\n SelectValue,\r\n SelectTrigger,\r\n SelectContent,\r\n SelectLabel,\r\n SelectItem,\r\n SelectSeparator,\r\n SelectScrollUpButton,\r\n SelectScrollDownButton,\r\n};\r\n"],"names":[],"mappings":";;;;;;;;;;;AAYA;AAEA;AACE;AACA;AACA;;;AAEE;AACF;AAEA;AAOF;AAEA;AAEA;AAEA;AAIE;AACA;;;;;;;AAOA;AACE;AACE;AAAoF;AACtF;;AAEA;;;AAKE;;;AAEK;AAAS;AAChB;AAEE;AACA;AACF;AAEE;AACA;AACA;AACA;;;;AAIA;AAaN;AACA;AAEA;AAeA;AAEA;AAeA;AACE;AAEF;;;AAME;AACA;;AAGA;AAcQ;;AAOF;AACA;;AAgCR;AACA;AAEA;AAUA;AAEA;AAqBA;AAEA;AAUA;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterinternship/components",
3
- "version": "3.5.2",
3
+ "version": "3.7.0",
4
4
  "workspaces": [
5
5
  "playground"
6
6
  ],
package/theme.css CHANGED
@@ -1,416 +1,470 @@
1
- @custom-variant dark (&:is(.dark *));
2
-
3
- :root {
4
- /*
5
- * Layering. Every overlay takes its z-index from this scale (z-(--z-name)),
6
- * never a number of its own, so one that opens from another (a Select in a
7
- * Dialog, a phone sheet over a Sheet) is always above it. Page chrome
8
- * (sticky headers and the like) stays below 1100; toasts sit above all of
9
- * these.
10
- */
11
- --z-modal-overlay: 1100; /* Dialog / Sheet backdrop */
12
- --z-modal: 1101; /* Dialog / Sheet content */
13
- --z-popover-overlay: 1110; /* dimmer behind a phone option sheet */
14
- --z-popover: 1111; /* Select, Popover, menus, hover cards, option sheets */
15
- --z-tooltip: 1400;
16
- /* Design tokens: the shared visual foundation for every component. */
17
- --radius: 0.75rem;
18
- --background: oklch(1 0 0);
19
- /* text is navy rather than neutral black */
20
- --foreground: oklch(0.216 0.095 275);
21
- --card: oklch(1 0 0);
22
- --card-foreground: oklch(0.216 0.095 275);
23
- --popover: oklch(1 0 0);
24
- --popover-foreground: oklch(0.216 0.095 275);
25
-
26
- /* primary brand (bright blue) */
27
- --primary: var(--color-brand-primary);
28
- --primary-foreground: oklch(1 0 0);
29
- --primary-hover: var(--color-brand-primary-hover);
30
- --primary-tint: var(--color-surface-primary);
31
- --primary-selected: color-mix(in oklab, var(--primary) 15%, transparent);
32
-
33
- /* secondary (warm gold): a cream fill with a gold edge. Text on it is gold
34
- (secondary-strong: selected chips, secondary buttons) or navy
35
- (secondary-foreground: badges, banners, calendar). */
36
- --secondary: var(--color-brand-secondary);
37
- --secondary-hover: var(--color-brand-secondary-hover);
38
- --secondary-border: var(--color-brand-secondary-border);
39
- --secondary-strong: var(--color-brand-secondary-deep);
40
- --secondary-foreground: var(--color-content-strong);
41
-
42
- /* Elevation for things floating over the page (toasts, floating
43
- panels): deeper than a card's. */
44
- --floating-shadow: 0 16px 40px -16px rgb(16 16 68 / 0.55);
45
- --supportive: oklch(0.663 0.137 137);
46
- --supportive-foreground: oklch(0.984 0.003 210);
47
- /* Lighter and deeper partners of supportive, warning and destructive, for
48
- soft badges, status markers and tinted notes: a 10% tint to sit on, and
49
- the colour darkened enough to read on that tint. */
50
- --supportive-soft: color-mix(in oklab, var(--supportive) 10%, transparent);
51
- --supportive-strong: color-mix(in oklab, var(--supportive), black 25%);
52
- /* ...and a quiet edge for those tinted shapes (toasts, status markers). */
53
- --supportive-border: color-mix(
54
- in oklab,
55
- var(--supportive) 48%,
56
- var(--border)
57
- );
58
- --muted: oklch(0.966 0.006 255);
59
- --muted-foreground: oklch(0.542 0.07 265);
60
- --warning: oklch(0.731 0.144 64);
61
- --warning-foreground: oklch(0.968 0.007 210);
62
- --warning-soft: color-mix(in oklab, var(--warning) 10%, transparent);
63
- --warning-strong: color-mix(in oklab, var(--warning), black 30%);
64
- --warning-border: color-mix(in oklab, var(--warning) 48%, var(--border));
65
- --accent: oklch(0.97 0 0);
66
- --accent-foreground: oklch(0.205 0 0);
67
- --destructive: var(--color-brand-destructive);
68
- --destructive-foreground: oklch(0.984 0.003 210);
69
- /* Red is dark enough to read on its own tint, so -strong is the colour. */
70
- --destructive-soft: color-mix(in oklab, var(--destructive) 10%, transparent);
71
- --destructive-strong: var(--destructive);
72
- --destructive-border: color-mix(
73
- in oklab,
74
- var(--destructive) 48%,
75
- var(--border)
76
- );
77
- --border: var(--color-border);
78
- --border-hover: var(--color-border-hover);
79
- --input: var(--color-border-control);
80
- --input-hover: oklch(0.851 0.025 258);
81
- --ring: oklch(0.544 0.221 260);
82
- --chart-1: oklch(0.646 0.222 41.116);
83
- --chart-2: oklch(0.6 0.118 184.704);
84
- --chart-3: oklch(0.398 0.07 227.392);
85
- --chart-4: oklch(0.828 0.189 84.429);
86
- --chart-5: oklch(0.769 0.188 70.08);
87
- --sidebar: oklch(0.985 0 0);
88
- --sidebar-foreground: oklch(0.145 0 0);
89
- --sidebar-primary: oklch(0.205 0 0);
90
- --sidebar-primary-foreground: oklch(0.985 0 0);
91
- --sidebar-accent: oklch(0.97 0 0);
92
- --sidebar-accent-foreground: oklch(0.205 0 0);
93
- --sidebar-border: oklch(0.922 0 0);
94
- --sidebar-ring: oklch(0.708 0 0);
95
-
96
- /* Semantic color roles. Components should use these roles rather than
97
- introducing one-off brand colors. */
98
- --color-brand-primary: #0064ed;
99
- --color-brand-primary-hover: #0053c7;
100
- /* Secondary (gold): fill, fill on hover, edge, and text on the fill. */
101
- --color-brand-secondary: #fcf6e8;
102
- --color-brand-secondary-hover: #f7eedb;
103
- --color-brand-secondary-border: #dfc58d;
104
- --color-brand-secondary-deep: #80571d;
105
- --color-brand-destructive: #dc2626;
106
- --color-brand-destructive-hover: #b91c1c;
107
- --color-brand-destructive-soft: #fef2f2;
108
- --color-brand-success: #4f9f45;
109
- --color-brand-success-hover: #255920;
110
- --color-brand-success-soft: #f0f8ee;
111
- --color-content-strong: #101044;
112
- --color-content: #374151;
113
- --color-content-muted: #5d719b;
114
- --color-surface: #ffffff;
115
- --color-surface-subtle: #f1f4f8;
116
- --color-surface-primary: #f0f6ff;
117
- --color-border: #e1e7ef;
118
- --color-border-control: #d9e2ef;
119
- --color-border-hover: #cfd5df;
120
- }
121
-
122
- @theme {
123
- /* Default height for single-line form controls. */
124
- --spacing-form-control: 2.25rem;
125
- /* Option lists (menus, selects, dropdowns, autocomplete, filter menus):
126
- an inset list of rounded rows with a little space between them. */
127
- --spacing-option-inset: 0.375rem;
128
- --spacing-option-gap: 0.125rem;
129
- --spacing-option-x: 0.625rem;
130
- --spacing-option-row: 2.5rem;
131
- --spacing-field-label-gap: 0.25rem;
132
- --text-page-heading: 2rem;
133
- --text-page-heading--line-height: 1.2;
134
- --text-page-heading--letter-spacing: -0.06875rem;
135
- --font-weight-page-heading: 650;
136
- --spacing-page-description-gap: 0.625rem;
137
- --leading-page-description: 1.65;
138
- --container-page-description: 62ch;
139
- --spacing-field-padding-x: 0.75rem;
140
- --text-field-label: var(--text-sm);
141
- --text-field-label--line-height: var(--text-sm--line-height);
142
- --font-weight-field-label: 400;
143
- /* Named -foreground, not field-label: a --color-field-label would make
144
- `text-field-label` a colour class and hide the label size. */
145
- --color-label-foreground: var(--muted-foreground);
146
-
147
- /* Shared radius scale. Keep component rounding on this scale. */
148
- --radius-control-sm: 0.375rem;
149
- --radius-control-md: 0.5rem;
150
- --radius-control-lg: 0.75rem;
151
- --radius-card: 0.75rem;
152
- --radius-pill: 9999px;
153
- /* Tailwind utility aliases used by existing V3 components. */
154
- --radius-sm: var(--radius-control-sm);
155
- --radius-md: var(--radius-control-md);
156
- --radius-lg: var(--radius-control-lg);
157
- --radius-xl: var(--radius-card);
158
- --radius-2xl: var(--radius-card);
159
-
160
- /* Shared BetterInternship client foundation. Keep playground and client
161
- chrome on the same palette instead of redefining brand values locally. */
162
- --color-v2-destructive: var(--color-brand-destructive);
163
- --color-v2-success: var(--color-brand-success);
164
- --color-v2-primary: var(--color-brand-primary);
165
- --color-v2-primary-hover: var(--color-brand-primary-hover);
166
- --color-v2-primary-soft: var(--color-surface-primary);
167
- --color-v2-primary-action: #0060e5;
168
- --color-v2-text: var(--color-content);
169
- --color-v2-text-strong: var(--color-content-strong);
170
- --color-v2-text-hover: #111827;
171
- --color-v2-text-muted: var(--color-content-muted);
172
- --color-v2-text-subtle: #66758c;
173
- --color-v2-border: var(--color-border);
174
- --color-v2-border-hover: var(--color-border-hover);
175
- --color-v2-control: var(--color-border-control);
176
- --color-v2-control-hover: #c4cfdf;
177
- --color-v2-surface-subtle: #f1f4f8;
178
- --color-v2-surface-footer: #fbfdff;
179
- --color-landing-navy: var(--color-v2-text-strong);
180
- --color-landing-blue: var(--color-v2-primary);
181
- --color-landing-muted: var(--color-v2-text-muted);
182
- --color-landing-border: var(--color-v2-border);
183
- --color-landing-tint: var(--color-v2-primary-soft);
184
- --color-landing-control: var(--color-v2-control);
185
- --color-landing-control-hover: var(--color-v2-control-hover);
186
- --color-landing-border-hover: var(--color-v2-border-hover);
187
- --color-landing-blue-hover: var(--color-v2-primary-hover);
188
- --color-landing-nav: var(--color-v2-text);
189
- --color-landing-nav-hover: var(--color-v2-text-hover);
190
- --color-landing-community: var(--color-v2-primary-action);
191
- --color-landing-footer: var(--color-v2-surface-footer);
192
- --color-landing-social: var(--color-v2-text-subtle);
193
- --color-landing-tag: var(--color-v2-surface-subtle);
194
- --shadow-landing-card: 0 8px 24px rgb(15 23 42 / 5%);
195
- --shadow-landing-interactive: 0 10px 28px rgb(31 45 68 / 8%);
196
- --ease-landing-out: cubic-bezier(0.23, 1, 0.32, 1);
197
- --animate-accordion-down: accordion-down 0.2s ease-out;
198
- --animate-accordion-up: accordion-up 0.2s ease-out;
199
- --animate-error-bob: error-bob 2.8s ease-in-out infinite;
200
- --animate-page-enter: page-enter 0.2s ease-out both;
201
-
202
- --font-sans:
203
- Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
204
- 'Helvetica Neue', Arial, sans-serif;
205
- --font-mono:
206
- 'JetBrains Mono', 'Fira Code', Menlo, Monaco, Consolas, 'Liberation Mono',
207
- 'Courier New', monospace;
208
-
209
- --color-background: var(--background);
210
- --color-foreground: var(--foreground);
211
- --color-sidebar-ring: var(--sidebar-ring);
212
- --color-sidebar-border: var(--sidebar-border);
213
- --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
214
- --color-sidebar-accent: var(--sidebar-accent);
215
- --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
216
- --color-sidebar-primary: var(--sidebar-primary);
217
- --color-sidebar-foreground: var(--sidebar-foreground);
218
- --color-sidebar: var(--sidebar);
219
- --color-chart-5: var(--chart-5);
220
- --color-chart-4: var(--chart-4);
221
- --color-chart-3: var(--chart-3);
222
- --color-chart-2: var(--chart-2);
223
- --color-chart-1: var(--chart-1);
224
- --color-ring: var(--ring);
225
- --color-input-hover: var(--input-hover);
226
- --color-input: var(--input);
227
- --color-border-hover: var(--border-hover);
228
- --color-border: var(--border);
229
- --color-destructive: var(--destructive);
230
- --color-destructive-foreground: var(--destructive-foreground);
231
- --color-destructive-soft: var(--destructive-soft);
232
- --color-destructive-strong: var(--destructive-strong);
233
- --color-destructive-border: var(--destructive-border);
234
- --color-supportive: var(--supportive);
235
- --color-supportive-foreground: var(--supportive-foreground);
236
- --color-supportive-soft: var(--supportive-soft);
237
- --color-supportive-strong: var(--supportive-strong);
238
- --color-supportive-border: var(--supportive-border);
239
- --color-warning: var(--warning);
240
- --color-warning-foreground: var(--warning-foreground);
241
- --color-warning-soft: var(--warning-soft);
242
- --color-warning-strong: var(--warning-strong);
243
- --color-warning-border: var(--warning-border);
244
- --color-accent-foreground: var(--accent-foreground);
245
- --color-accent: var(--accent);
246
- --color-muted-foreground: var(--muted-foreground);
247
- --color-muted: var(--muted);
248
- --color-secondary-hover: var(--secondary-hover);
249
- --color-secondary-border: var(--secondary-border);
250
- --color-secondary-strong: var(--secondary-strong);
251
- --color-secondary-foreground: var(--secondary-foreground);
252
- --color-secondary: var(--secondary);
253
- --color-primary-tint: var(--primary-tint);
254
- --color-primary-selected: var(--primary-selected);
255
- --color-primary-hover: var(--primary-hover);
256
- --color-primary-foreground: var(--primary-foreground);
257
- --color-primary: var(--primary);
258
- --color-popover-foreground: var(--popover-foreground);
259
- --color-popover: var(--popover);
260
- --color-card-foreground: var(--card-foreground);
261
- --color-card: var(--card);
262
- --shadow-card: 0 8px 24px rgb(15 23 42 / 5%);
263
- --shadow-floating: var(--floating-shadow);
264
- --shadow-interactive: 0 10px 28px rgb(31 45 68 / 8%);
265
- --duration-interactive: 200ms;
266
- --duration-state: 160ms;
267
- --duration-press: 120ms;
268
-
269
- /* Not --ease-out: that would replace Tailwind's built-in ease-out. */
270
- --ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1);
271
-
272
- @keyframes accordion-down {
273
- from {
274
- height: 0;
275
- }
276
- to {
277
- height: var(--radix-accordion-content-height);
278
- }
279
- }
280
- @keyframes accordion-up {
281
- from {
282
- height: var(--radix-accordion-content-height);
283
- }
284
- to {
285
- height: 0;
286
- }
287
- }
288
- @keyframes error-bob {
289
- 0%,
290
- 100% {
291
- transform: translateY(0);
292
- }
293
- 50% {
294
- transform: translateY(-6px);
295
- }
296
- }
297
- /* Page title entrance: a short fade up when a page opens. */
298
- @keyframes page-enter {
299
- from {
300
- opacity: 0;
301
- transform: translateY(6px);
302
- }
303
- }
304
- }
305
-
306
- .dark {
307
- --background: oklch(0.145 0 0);
308
- --foreground: oklch(0.985 0 0);
309
- --card: oklch(0.205 0 0);
310
- --card-foreground: oklch(0.985 0 0);
311
- --popover: oklch(0.205 0 0);
312
- --popover-foreground: oklch(0.985 0 0);
313
- --primary: oklch(0.922 0 0);
314
- --primary-foreground: oklch(0.205 0 0);
315
- --secondary: oklch(0.269 0 0);
316
- --secondary-foreground: oklch(0.985 0 0);
317
- --muted: oklch(0.269 0 0);
318
- --muted-foreground: oklch(0.708 0 0);
319
- --accent: oklch(0.269 0 0);
320
- --accent-foreground: oklch(0.985 0 0);
321
- --destructive: oklch(0.704 0.191 22.216);
322
- --destructive-foreground: oklch(0.984 0.003 210);
323
- --border: oklch(1 0 0 / 10%);
324
- --input: oklch(1 0 0 / 15%);
325
- --ring: oklch(0.556 0 0);
326
- --chart-1: oklch(0.488 0.243 264.376);
327
- --chart-2: oklch(0.696 0.17 162.48);
328
- --chart-3: oklch(0.769 0.188 70.08);
329
- --chart-4: oklch(0.627 0.265 303.9);
330
- --chart-5: oklch(0.645 0.246 16.439);
331
- --sidebar: oklch(0.205 0 0);
332
- --sidebar-foreground: oklch(0.985 0 0);
333
- --sidebar-primary: oklch(0.488 0.243 264.376);
334
- --sidebar-primary-foreground: oklch(0.985 0 0);
335
- --sidebar-accent: oklch(0.269 0 0);
336
- --sidebar-accent-foreground: oklch(0.985 0 0);
337
- --sidebar-border: oklch(1 0 0 / 10%);
338
- --sidebar-ring: oklch(0.556 0 0);
339
- }
340
-
341
- @layer base {
342
- * {
343
- @apply border-border outline-ring/50;
344
- }
345
- body {
346
- @apply bg-background text-foreground;
347
- }
348
- a {
349
- @apply text-primary hover:text-primary/80 transition-colors duration-200;
350
- @apply rounded-sm focus:outline-none;
351
- }
352
- }
353
-
354
- body {
355
- width: 100vw;
356
- height: 100vh;
357
- margin: 0;
358
- padding: 0;
359
- }
360
-
361
- html {
362
- overflow: hidden;
363
- }
364
-
365
- * {
366
- box-sizing: border-box;
367
- }
368
-
369
- /* Mobile-specific utilities */
370
- @layer utilities {
371
- .pb-safe {
372
- padding-bottom: env(safe-area-inset-bottom);
373
- }
374
-
375
- .pt-safe {
376
- padding-top: env(safe-area-inset-top);
377
- }
378
-
379
- .pl-safe {
380
- padding-left: env(safe-area-inset-left);
381
- }
382
-
383
- .pr-safe {
384
- padding-right: env(safe-area-inset-right);
385
- }
386
-
387
- .webkit-overflow-scrolling-touch {
388
- -webkit-overflow-scrolling: touch;
389
- }
390
- }
391
-
392
- .input-wrap {
393
- height: 40px; /* lock height so font-size change won't jump */
394
- display: flex;
395
- align-items: center;
396
- }
397
-
398
- .input-wrap input {
399
- font-size: 14px; /* your preferred size */
400
- }
401
-
402
- .input-wrap input:focus {
403
- font-size: 16px; /* prevents iOS zoom */
404
- }
405
-
406
- /* --- unified input sizing: 1rem on focus only on mobile --- */
407
- @layer base {
408
- /* Mobile: bump to 1rem (16px) on focus to avoid iOS zoom */
409
- @media (max-width: 639.98px) {
410
- input:focus,
411
- textarea:focus,
412
- select:focus {
413
- font-size: 1rem; /* 16px on focus ONLY on mobile */
414
- }
415
- }
416
- }
1
+ @custom-variant dark (&:is(.dark *));
2
+
3
+ :root {
4
+ /*
5
+ * Layering. Every overlay takes its z-index from this scale (z-(--z-name)),
6
+ * never a number of its own, so one that opens from another (a Select in a
7
+ * Dialog, a phone sheet over a Sheet) is always above it. Page chrome
8
+ * (sticky headers and the like) stays below 1100; toasts sit above all of
9
+ * these.
10
+ */
11
+ --z-modal-overlay: 1100; /* Dialog / Sheet backdrop */
12
+ --z-modal: 1101; /* Dialog / Sheet content */
13
+ --z-popover-overlay: 1110; /* dimmer behind a phone option sheet */
14
+ --z-popover: 1111; /* Select, Popover, menus, hover cards, option sheets */
15
+ --z-tooltip: 1400;
16
+ /* Design tokens: the shared visual foundation for every component. */
17
+ --radius: 0.75rem;
18
+ --background: oklch(1 0 0);
19
+ /* text is navy rather than neutral black */
20
+ --foreground: oklch(0.216 0.095 275);
21
+ --card: oklch(1 0 0);
22
+ --card-foreground: oklch(0.216 0.095 275);
23
+ --popover: oklch(1 0 0);
24
+ --popover-foreground: oklch(0.216 0.095 275);
25
+
26
+ /* primary brand (bright blue) */
27
+ --primary: var(--color-brand-primary);
28
+ --primary-foreground: oklch(1 0 0);
29
+ --primary-hover: var(--color-brand-primary-hover);
30
+ --primary-tint: var(--color-surface-primary);
31
+ --primary-selected: color-mix(in oklab, var(--primary) 15%, transparent);
32
+
33
+ /* secondary (warm gold): a cream fill with a gold edge. Text on it is gold
34
+ (secondary-strong: selected chips, secondary buttons) or navy
35
+ (secondary-foreground: badges, banners, calendar). */
36
+ --secondary: var(--color-brand-secondary);
37
+ --secondary-hover: var(--color-brand-secondary-hover);
38
+ --secondary-border: var(--color-brand-secondary-border);
39
+ --secondary-strong: var(--color-brand-secondary-deep);
40
+ --secondary-foreground: var(--color-content-strong);
41
+
42
+ /* Elevation for things floating over the page (toasts, floating
43
+ panels): deeper than a card's. */
44
+ --floating-shadow: 0 16px 40px -16px rgb(16 16 68 / 0.55);
45
+ --supportive: oklch(0.663 0.137 137);
46
+ --supportive-foreground: oklch(0.984 0.003 210);
47
+ /* Lighter and deeper partners of supportive, warning and destructive, for
48
+ soft badges, status markers and tinted notes: a 10% tint to sit on, and
49
+ the colour darkened enough to read on that tint. */
50
+ --supportive-soft: color-mix(in oklab, var(--supportive) 10%, transparent);
51
+ --supportive-strong: color-mix(in oklab, var(--supportive), black 25%);
52
+ /* ...and a quiet edge for those tinted shapes (toasts, status markers). */
53
+ --supportive-border: color-mix(
54
+ in oklab,
55
+ var(--supportive) 48%,
56
+ var(--border)
57
+ );
58
+ --muted: oklch(0.966 0.006 255);
59
+ --muted-foreground: oklch(0.542 0.07 265);
60
+ --warning: oklch(0.731 0.144 64);
61
+ --warning-foreground: oklch(0.968 0.007 210);
62
+ --warning-soft: color-mix(in oklab, var(--warning) 10%, transparent);
63
+ --warning-strong: color-mix(in oklab, var(--warning), black 30%);
64
+ --warning-border: color-mix(in oklab, var(--warning) 48%, var(--border));
65
+ --accent: oklch(0.97 0 0);
66
+ --accent-foreground: oklch(0.205 0 0);
67
+ --destructive: var(--color-brand-destructive);
68
+ --destructive-foreground: oklch(0.984 0.003 210);
69
+ /* Red is dark enough to read on its own tint, so -strong is the colour. */
70
+ --destructive-soft: color-mix(in oklab, var(--destructive) 10%, transparent);
71
+ --destructive-strong: var(--destructive);
72
+ --destructive-border: color-mix(
73
+ in oklab,
74
+ var(--destructive) 48%,
75
+ var(--border)
76
+ );
77
+ --border: var(--color-border);
78
+ --border-hover: var(--color-border-hover);
79
+ --input: var(--color-border-control);
80
+ --input-hover: oklch(0.851 0.025 258);
81
+ --ring: oklch(0.544 0.221 260);
82
+ --chart-1: oklch(0.646 0.222 41.116);
83
+ --chart-2: oklch(0.6 0.118 184.704);
84
+ --chart-3: oklch(0.398 0.07 227.392);
85
+ --chart-4: oklch(0.828 0.189 84.429);
86
+ --chart-5: oklch(0.769 0.188 70.08);
87
+ --sidebar: oklch(0.985 0 0);
88
+ --sidebar-foreground: oklch(0.145 0 0);
89
+ --sidebar-primary: oklch(0.205 0 0);
90
+ --sidebar-primary-foreground: oklch(0.985 0 0);
91
+ --sidebar-accent: oklch(0.97 0 0);
92
+ --sidebar-accent-foreground: oklch(0.205 0 0);
93
+ --sidebar-border: oklch(0.922 0 0);
94
+ --sidebar-ring: oklch(0.708 0 0);
95
+
96
+ /* Semantic color roles. Components should use these roles rather than
97
+ introducing one-off brand colors. */
98
+ --color-brand-primary: #0064ed;
99
+ --color-brand-primary-hover: #0053c7;
100
+ /* Secondary (gold): fill, fill on hover, edge, and text on the fill. */
101
+ --color-brand-secondary: #fcf6e8;
102
+ --color-brand-secondary-hover: #f7eedb;
103
+ --color-brand-secondary-border: #dfc58d;
104
+ --color-brand-secondary-deep: #80571d;
105
+ --color-brand-destructive: #dc2626;
106
+ --color-brand-destructive-hover: #b91c1c;
107
+ --color-brand-destructive-soft: #fef2f2;
108
+ --color-brand-success: #4f9f45;
109
+ --color-brand-success-hover: #255920;
110
+ --color-brand-success-soft: #f0f8ee;
111
+ --color-content-strong: #101044;
112
+ --color-content: #374151;
113
+ --color-content-muted: #5d719b;
114
+ --color-surface: #ffffff;
115
+ --color-surface-subtle: #f1f4f8;
116
+ --color-surface-primary: #f0f6ff;
117
+ --color-border: #e1e7ef;
118
+ --color-border-control: #d9e2ef;
119
+ --color-border-hover: #cfd5df;
120
+ }
121
+
122
+ @theme {
123
+ /* Default height for single-line form controls. */
124
+ --spacing-form-control: 2.25rem;
125
+ /* Option lists (menus, selects, dropdowns, autocomplete, filter menus):
126
+ an inset list of rounded rows with a little space between them. */
127
+ --spacing-option-inset: 0.375rem;
128
+ --spacing-option-gap: 0.125rem;
129
+ --spacing-option-x: 0.625rem;
130
+ --spacing-option-row: 2.5rem;
131
+ --spacing-field-label-gap: 0.25rem;
132
+ --text-page-heading: 2rem;
133
+ --text-page-heading--line-height: 1.2;
134
+ --text-page-heading--letter-spacing: -0.06875rem;
135
+ --font-weight-page-heading: 650;
136
+ --spacing-page-description-gap: 0.625rem;
137
+ --leading-page-description: 1.65;
138
+ --container-page-description: 62ch;
139
+ --spacing-field-padding-x: 0.75rem;
140
+ --text-field-label: var(--text-sm);
141
+ --text-field-label--line-height: var(--text-sm--line-height);
142
+ --font-weight-field-label: 400;
143
+ /* Named -foreground, not field-label: a --color-field-label would make
144
+ `text-field-label` a colour class and hide the label size. */
145
+ --color-label-foreground: var(--muted-foreground);
146
+
147
+ /* Shared radius scale. Keep component rounding on this scale. */
148
+ --radius-control-sm: 0.375rem;
149
+ --radius-control-md: 0.5rem;
150
+ --radius-control-lg: 0.75rem;
151
+ --radius-card: 0.75rem;
152
+ --radius-pill: 9999px;
153
+ /* Tailwind utility aliases used by existing V3 components. */
154
+ --radius-sm: var(--radius-control-sm);
155
+ --radius-md: var(--radius-control-md);
156
+ --radius-lg: var(--radius-control-lg);
157
+ --radius-xl: var(--radius-card);
158
+ --radius-2xl: var(--radius-card);
159
+
160
+ /* Shared BetterInternship client foundation. Keep playground and client
161
+ chrome on the same palette instead of redefining brand values locally. */
162
+ --color-v2-destructive: var(--color-brand-destructive);
163
+ --color-v2-success: var(--color-brand-success);
164
+ --color-v2-primary: var(--color-brand-primary);
165
+ --color-v2-primary-hover: var(--color-brand-primary-hover);
166
+ --color-v2-primary-soft: var(--color-surface-primary);
167
+ --color-v2-primary-action: #0060e5;
168
+ --color-v2-text: var(--color-content);
169
+ --color-v2-text-strong: var(--color-content-strong);
170
+ --color-v2-text-hover: #111827;
171
+ --color-v2-text-muted: var(--color-content-muted);
172
+ --color-v2-text-subtle: #66758c;
173
+ --color-v2-border: var(--color-border);
174
+ --color-v2-border-hover: var(--color-border-hover);
175
+ --color-v2-control: var(--color-border-control);
176
+ --color-v2-control-hover: #c4cfdf;
177
+ --color-v2-surface-subtle: #f1f4f8;
178
+ --color-v2-surface-footer: #fbfdff;
179
+ --color-landing-navy: var(--color-v2-text-strong);
180
+ --color-landing-blue: var(--color-v2-primary);
181
+ --color-landing-muted: var(--color-v2-text-muted);
182
+ --color-landing-border: var(--color-v2-border);
183
+ --color-landing-tint: var(--color-v2-primary-soft);
184
+ --color-landing-control: var(--color-v2-control);
185
+ --color-landing-control-hover: var(--color-v2-control-hover);
186
+ --color-landing-border-hover: var(--color-v2-border-hover);
187
+ --color-landing-blue-hover: var(--color-v2-primary-hover);
188
+ --color-landing-nav: var(--color-v2-text);
189
+ --color-landing-nav-hover: var(--color-v2-text-hover);
190
+ --color-landing-community: var(--color-v2-primary-action);
191
+ --color-landing-footer: var(--color-v2-surface-footer);
192
+ --color-landing-social: var(--color-v2-text-subtle);
193
+ --color-landing-tag: var(--color-v2-surface-subtle);
194
+ --shadow-landing-card: 0 8px 24px rgb(15 23 42 / 5%);
195
+ --shadow-landing-interactive: 0 10px 28px rgb(31 45 68 / 8%);
196
+ --ease-landing-out: cubic-bezier(0.23, 1, 0.32, 1);
197
+ --animate-accordion-down: accordion-down 0.2s ease-out;
198
+ --animate-accordion-up: accordion-up 0.2s ease-out;
199
+ --animate-error-bob: error-bob 2.8s ease-in-out infinite;
200
+ --animate-page-enter: page-enter 0.2s ease-out both;
201
+
202
+ /* Apps load Inter with next/font (variable: '--font-inter'); without it,
203
+ an installed Inter or the system stack is used. */
204
+ --font-sans:
205
+ var(--font-inter, Inter), -apple-system, BlinkMacSystemFont, 'Segoe UI',
206
+ Roboto, 'Helvetica Neue', Arial, sans-serif;
207
+ --font-mono:
208
+ 'JetBrains Mono', 'Fira Code', Menlo, Monaco, Consolas, 'Liberation Mono',
209
+ 'Courier New', monospace;
210
+
211
+ --color-background: var(--background);
212
+ --color-foreground: var(--foreground);
213
+ --color-sidebar-ring: var(--sidebar-ring);
214
+ --color-sidebar-border: var(--sidebar-border);
215
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
216
+ --color-sidebar-accent: var(--sidebar-accent);
217
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
218
+ --color-sidebar-primary: var(--sidebar-primary);
219
+ --color-sidebar-foreground: var(--sidebar-foreground);
220
+ --color-sidebar: var(--sidebar);
221
+ --color-chart-5: var(--chart-5);
222
+ --color-chart-4: var(--chart-4);
223
+ --color-chart-3: var(--chart-3);
224
+ --color-chart-2: var(--chart-2);
225
+ --color-chart-1: var(--chart-1);
226
+ --color-ring: var(--ring);
227
+ --color-input-hover: var(--input-hover);
228
+ --color-input: var(--input);
229
+ --color-border-hover: var(--border-hover);
230
+ --color-border: var(--border);
231
+ --color-destructive: var(--destructive);
232
+ --color-destructive-foreground: var(--destructive-foreground);
233
+ --color-destructive-soft: var(--destructive-soft);
234
+ --color-destructive-strong: var(--destructive-strong);
235
+ --color-destructive-border: var(--destructive-border);
236
+ --color-supportive: var(--supportive);
237
+ --color-supportive-foreground: var(--supportive-foreground);
238
+ --color-supportive-soft: var(--supportive-soft);
239
+ --color-supportive-strong: var(--supportive-strong);
240
+ --color-supportive-border: var(--supportive-border);
241
+ --color-warning: var(--warning);
242
+ --color-warning-foreground: var(--warning-foreground);
243
+ --color-warning-soft: var(--warning-soft);
244
+ --color-warning-strong: var(--warning-strong);
245
+ --color-warning-border: var(--warning-border);
246
+ --color-accent-foreground: var(--accent-foreground);
247
+ --color-accent: var(--accent);
248
+ --color-muted-foreground: var(--muted-foreground);
249
+ --color-muted: var(--muted);
250
+ --color-secondary-hover: var(--secondary-hover);
251
+ --color-secondary-border: var(--secondary-border);
252
+ --color-secondary-strong: var(--secondary-strong);
253
+ --color-secondary-foreground: var(--secondary-foreground);
254
+ --color-secondary: var(--secondary);
255
+ --color-primary-tint: var(--primary-tint);
256
+ --color-primary-selected: var(--primary-selected);
257
+ --color-primary-hover: var(--primary-hover);
258
+ --color-primary-foreground: var(--primary-foreground);
259
+ --color-primary: var(--primary);
260
+ --color-popover-foreground: var(--popover-foreground);
261
+ --color-popover: var(--popover);
262
+ --color-card-foreground: var(--card-foreground);
263
+ --color-card: var(--card);
264
+ --shadow-card: 0 8px 24px rgb(15 23 42 / 5%);
265
+ --shadow-floating: var(--floating-shadow);
266
+ --shadow-interactive: 0 10px 28px rgb(31 45 68 / 8%);
267
+ --duration-interactive: 200ms;
268
+ --duration-state: 160ms;
269
+ --duration-press: 120ms;
270
+
271
+ /* Not --ease-out: that would replace Tailwind's built-in ease-out. */
272
+ --ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1);
273
+
274
+ @keyframes accordion-down {
275
+ from {
276
+ height: 0;
277
+ }
278
+ to {
279
+ height: var(--radix-accordion-content-height);
280
+ }
281
+ }
282
+ @keyframes accordion-up {
283
+ from {
284
+ height: var(--radix-accordion-content-height);
285
+ }
286
+ to {
287
+ height: 0;
288
+ }
289
+ }
290
+ @keyframes error-bob {
291
+ 0%,
292
+ 100% {
293
+ transform: translateY(0);
294
+ }
295
+ 50% {
296
+ transform: translateY(-6px);
297
+ }
298
+ }
299
+ /* Page title entrance: a short fade up when a page opens. */
300
+ @keyframes page-enter {
301
+ from {
302
+ opacity: 0;
303
+ transform: translateY(6px);
304
+ }
305
+ }
306
+ }
307
+
308
+ .dark {
309
+ --background: oklch(0.145 0 0);
310
+ --foreground: oklch(0.985 0 0);
311
+ --card: oklch(0.205 0 0);
312
+ --card-foreground: oklch(0.985 0 0);
313
+ --popover: oklch(0.205 0 0);
314
+ --popover-foreground: oklch(0.985 0 0);
315
+ --primary: oklch(0.922 0 0);
316
+ --primary-foreground: oklch(0.205 0 0);
317
+ --secondary: oklch(0.269 0 0);
318
+ --secondary-foreground: oklch(0.985 0 0);
319
+ --muted: oklch(0.269 0 0);
320
+ --muted-foreground: oklch(0.708 0 0);
321
+ --accent: oklch(0.269 0 0);
322
+ --accent-foreground: oklch(0.985 0 0);
323
+ --destructive: oklch(0.704 0.191 22.216);
324
+ --destructive-foreground: oklch(0.984 0.003 210);
325
+ --border: oklch(1 0 0 / 10%);
326
+ --input: oklch(1 0 0 / 15%);
327
+ --ring: oklch(0.556 0 0);
328
+ --chart-1: oklch(0.488 0.243 264.376);
329
+ --chart-2: oklch(0.696 0.17 162.48);
330
+ --chart-3: oklch(0.769 0.188 70.08);
331
+ --chart-4: oklch(0.627 0.265 303.9);
332
+ --chart-5: oklch(0.645 0.246 16.439);
333
+ --sidebar: oklch(0.205 0 0);
334
+ --sidebar-foreground: oklch(0.985 0 0);
335
+ --sidebar-primary: oklch(0.488 0.243 264.376);
336
+ --sidebar-primary-foreground: oklch(0.985 0 0);
337
+ --sidebar-accent: oklch(0.269 0 0);
338
+ --sidebar-accent-foreground: oklch(0.985 0 0);
339
+ --sidebar-border: oklch(1 0 0 / 10%);
340
+ --sidebar-ring: oklch(0.556 0 0);
341
+ }
342
+
343
+ @layer base {
344
+ * {
345
+ @apply border-border outline-ring/50;
346
+ }
347
+ html {
348
+ @apply scroll-smooth;
349
+ /* Prevent iOS text auto-zooming and scaling jumps. */
350
+ -webkit-text-size-adjust: 100%;
351
+ }
352
+ body {
353
+ @apply bg-background text-foreground font-sans antialiased;
354
+ font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
355
+ }
356
+ img,
357
+ video {
358
+ max-width: 100%;
359
+ height: auto;
360
+ }
361
+ a {
362
+ @apply text-primary hover:text-primary/80 transition-colors duration-200;
363
+ @apply rounded-sm focus:outline-none;
364
+ }
365
+ }
366
+
367
+ body {
368
+ width: 100vw;
369
+ height: 100vh;
370
+ margin: 0;
371
+ padding: 0;
372
+ }
373
+
374
+ html {
375
+ overflow: hidden;
376
+ }
377
+
378
+ * {
379
+ box-sizing: border-box;
380
+ }
381
+
382
+ /* Mobile-specific utilities */
383
+ @layer utilities {
384
+ .pb-safe {
385
+ padding-bottom: env(safe-area-inset-bottom);
386
+ }
387
+
388
+ .pt-safe {
389
+ padding-top: env(safe-area-inset-top);
390
+ }
391
+
392
+ .pl-safe {
393
+ padding-left: env(safe-area-inset-left);
394
+ }
395
+
396
+ .pr-safe {
397
+ padding-right: env(safe-area-inset-right);
398
+ }
399
+
400
+ .webkit-overflow-scrolling-touch {
401
+ -webkit-overflow-scrolling: touch;
402
+ }
403
+ }
404
+
405
+ .input-wrap {
406
+ height: 40px; /* lock height so font-size change won't jump */
407
+ display: flex;
408
+ align-items: center;
409
+ }
410
+
411
+ .input-wrap input {
412
+ font-size: 14px; /* your preferred size */
413
+ }
414
+
415
+ .input-wrap input:focus {
416
+ font-size: 16px; /* prevents iOS zoom */
417
+ }
418
+
419
+ /* --- unified input sizing: 16px on phones (iOS Safari zooms into smaller
420
+ focused fields), 14px from 640px, and 1rem on focus on phones --- */
421
+ @layer base {
422
+ input,
423
+ textarea,
424
+ select {
425
+ @apply text-base;
426
+ }
427
+ @media (width >= 40rem) {
428
+ input,
429
+ textarea,
430
+ select {
431
+ @apply text-sm;
432
+ }
433
+ }
434
+
435
+ /* Mobile: bump to 1rem (16px) on focus to avoid iOS zoom */
436
+ @media (max-width: 639.98px) {
437
+ input:focus,
438
+ textarea:focus,
439
+ select:focus {
440
+ font-size: 1rem; /* 16px on focus ONLY on mobile */
441
+ }
442
+ }
443
+ }
444
+
445
+ /* Thin scrollbars everywhere. */
446
+ @layer utilities {
447
+ *::-webkit-scrollbar {
448
+ width: 6px;
449
+ }
450
+
451
+ *::-webkit-scrollbar-track {
452
+ background: #f8fafc;
453
+ border-radius: 3px;
454
+ }
455
+
456
+ *::-webkit-scrollbar-thumb {
457
+ background: #cbd5e1;
458
+ border-radius: 0px;
459
+ }
460
+
461
+ *::-webkit-scrollbar-thumb:hover {
462
+ background: #94a3b8;
463
+ }
464
+
465
+ * {
466
+ scrollbar-width: thin;
467
+ scrollbar-color: #cbd5e1 #f8fafc;
468
+ scrollbar-gutter: 6px;
469
+ }
470
+ }