@betterinternship/components 3.2.10 → 3.2.12

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.
@@ -43,7 +43,7 @@ const iconSizes = {
43
43
  xs: 'size-8', sm: 'size-9', md: 'size-11', lg: 'size-12', xl: 'size-13', '2xl': 'size-14',
44
44
  };
45
45
  function ExpandingButton({ icon, label, size = 'md', loading, ...props }) {
46
- return jsxs(Button, { "aria-label": label, ...props, size: size, loading: loading, className: cn('gap-0 px-3', props.className), children: [!loading && jsx("span", { "aria-hidden": "true", className: "inline-flex", children: icon }), jsx("span", { className: "pointer-fine:ml-0 pointer-fine:max-w-0 pointer-fine:overflow-hidden pointer-fine:whitespace-nowrap pointer-fine:opacity-0 pointer-fine:group-hover/button:ml-2 pointer-fine:group-hover/button:max-w-40 pointer-fine:group-hover/button:opacity-100 pointer-fine:group-focus-visible/button:ml-2 pointer-fine:group-focus-visible/button:max-w-40 pointer-fine:group-focus-visible/button:opacity-100 pointer-fine:group-aria-busy/button:ml-2 pointer-fine:group-aria-busy/button:max-w-40 pointer-fine:group-aria-busy/button:opacity-100 motion-safe:transition-[max-width,margin,opacity] motion-safe:duration-interactive motion-safe:ease-out-strong motion-reduce:transition-none", children: label })] });
46
+ return jsxs(Button, { "aria-label": label, ...props, size: size, loading: loading, className: cn('gap-0 px-3', props.className), children: [!loading && jsx("span", { "aria-hidden": "true", className: "inline-flex", children: icon }), jsx("span", { className: "ml-2 pointer-fine:ml-0 pointer-fine:max-w-0 pointer-fine:overflow-hidden pointer-fine:whitespace-nowrap pointer-fine:opacity-0 pointer-fine:group-hover/button:ml-2 pointer-fine:group-hover/button:max-w-40 pointer-fine:group-hover/button:opacity-100 pointer-fine:group-focus-visible/button:ml-2 pointer-fine:group-focus-visible/button:max-w-40 pointer-fine:group-focus-visible/button:opacity-100 pointer-fine:group-aria-busy/button:ml-2 pointer-fine:group-aria-busy/button:max-w-40 pointer-fine:group-aria-busy/button:opacity-100 motion-safe:transition-[max-width,margin,opacity] motion-safe:duration-interactive motion-safe:ease-out-strong motion-reduce:transition-none", children: label })] });
47
47
  }
48
48
  function FilterChip({ selected = false, icon, children, loading, ...props }) {
49
49
  return jsxs(Button, { ...props, variant: "outline", scheme: selected ? 'secondary' : 'neutral', size: "md", shape: "pill", "aria-pressed": selected, loading: loading, className: cn('w-max max-w-full gap-2.5 px-5 py-3 text-base leading-[1.4]', selected && 'font-semibold'), children: [!loading && icon, children] });
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","sources":["../../src/components/button.tsx"],"sourcesContent":["import Link from 'next/link';\nimport type { ComponentPropsWithRef, ReactNode } from 'react';\nimport { cn } from '@/utils';\nimport { Spinner } from './loader';\nimport { interactiveControlClassName, interactiveControlTransitionClassName } from '@/lib/interaction-styles';\n\nexport type ButtonVariant = 'solid' | 'outline' | 'ghost' | 'link';\nexport type ButtonScheme = 'primary' | 'secondary' | 'neutral' | 'destructive' | 'success';\nexport type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\nexport type ButtonShape = 'rounded' | 'pill';\n\ntype ButtonAppearance = {\n /** Visual treatment. */\n variant?: ButtonVariant;\n /** Semantic color, independent of the fill treatment. Defaults to primary, or neutral for outline/ghost. */\n scheme?: ButtonScheme;\n /** Standard control size: 32px, 36px, 44px, 48px, 52px, or 56px minimum height. */\n size?: ButtonSize;\n /** Corner treatment. Landing presets keep their original shape when omitted. */\n shape?: ButtonShape;\n /** Additional classes, merged after the component's appearance classes. */\n className?: string;\n};\n\nconst schemes: Record<ButtonScheme, string> = {\n primary: '[--btn-fill:var(--color-landing-blue)] [--btn-on:white] [--btn-hover:var(--color-landing-blue-hover)] [--btn-ink:var(--color-landing-blue-hover)] [--btn-soft:var(--color-landing-tint)] [--btn-border:var(--color-landing-blue)]',\n secondary: '[--btn-fill:var(--color-landing-secondary-tint)] [--btn-on:var(--color-landing-secondary-deep)] [--btn-hover:var(--color-brand-secondary-hover)] [--btn-ink:var(--color-landing-secondary-deep)] [--btn-soft:var(--color-landing-secondary-tint)] [--btn-border:var(--color-landing-secondary-border)]',\n neutral: '[--btn-fill:var(--color-v2-surface-subtle)] [--btn-on:var(--color-landing-nav)] [--btn-hover:var(--color-landing-border)] [--btn-ink:var(--color-landing-nav)] [--btn-soft:rgb(55_65_81_/_6%)] [--btn-border:var(--color-landing-control)]',\n destructive: '[--btn-fill:var(--color-v2-destructive)] [--btn-on:white] [--btn-hover:var(--color-brand-destructive-hover)] [--btn-ink:var(--color-brand-destructive-hover)] [--btn-soft:var(--color-brand-destructive-soft)] [--btn-border:var(--color-v2-destructive)]',\n success: '[--btn-fill:var(--color-brand-success)] [--btn-on:white] [--btn-hover:var(--color-brand-success-hover)] [--btn-ink:var(--color-brand-success)] [--btn-soft:var(--color-brand-success-soft)] [--btn-border:var(--color-brand-success)]',\n};\nconst treatments: Record<ButtonVariant, string> = {\n solid: cn('border border-[var(--btn-border)] bg-[var(--btn-fill)] font-semibold text-[var(--btn-on)] enabled:pointer-fine:hover:border-[var(--btn-hover)] enabled:pointer-fine:hover:bg-[var(--btn-hover)] [&:is(a):hover]:bg-[var(--btn-hover)]', interactiveControlClassName),\n outline: cn('border border-[var(--btn-border)] bg-transparent text-[var(--btn-ink)] enabled:hover:bg-[var(--btn-soft)] [&:is(a):hover]:bg-[var(--btn-soft)]', interactiveControlClassName),\n ghost: 'border border-transparent bg-transparent text-[var(--btn-ink)] enabled:hover:bg-[var(--btn-soft)] [&:is(a):hover]:bg-[var(--btn-soft)]',\n link: 'border-0 bg-transparent text-[var(--btn-ink)] underline-offset-4 enabled:hover:underline [&:is(a):hover]:underline',\n};\nconst sizes: Record<ButtonSize, string> = {\n xs: 'min-h-8 px-2 text-xs leading-[1.5]',\n sm: 'min-h-9 px-3 text-sm leading-[1.5]',\n md: 'min-h-11 px-5 text-sm leading-[1.5]',\n lg: 'min-h-12 px-6 text-base leading-[1.5]',\n xl: 'min-h-13 px-7 text-base leading-[1.5]',\n '2xl': 'min-h-14 px-8 text-lg leading-[1.5]',\n};\n\n/** Shared styling for action and navigation controls. Colors never change the fill treatment. */\nexport function buttonClassName({variant = 'solid', scheme, size = 'md', shape, className}: ButtonAppearance = {}) {\n return cn(\n 'group group/button inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-control-lg font-[550] focus-visible:outline-3 focus-visible:outline-offset-4 focus-visible:outline-landing-blue disabled:pointer-events-none disabled:opacity-50 aria-disabled:cursor-default aria-busy:cursor-wait [&_svg]:shrink-0',\n interactiveControlTransitionClassName,\n schemes[scheme ?? (['outline', 'ghost'].includes(variant) ? 'neutral' : 'primary')],\n treatments[variant], sizes[size],\n variant === 'outline' && (scheme === undefined || scheme === 'neutral') && 'enabled:hover:border-landing-control-hover enabled:hover:text-landing-nav-hover [&:is(a):hover]:border-landing-control-hover',\n variant === 'outline' && scheme === 'secondary' && 'bg-[var(--btn-soft)]',\n shape === 'pill' && 'rounded-full', shape === 'rounded' && 'rounded-control-lg', className,\n );\n}\n\ntype IconOnlyProps = { iconOnly?: false } | { iconOnly: true; 'aria-label': string };\ntype ActionButtonProps = ComponentPropsWithRef<'button'> & ButtonAppearance & {\n href?: never;\n /** Shows a progress indicator, exposes aria-busy, and disables the action while work is pending. */\n loading?: boolean;\n};\ntype NavigationButtonProps = Omit<ComponentPropsWithRef<typeof Link>, 'className'> & ButtonAppearance & {\n loading?: never;\n disabled?: never;\n};\nexport type ButtonProps = ActionButtonProps;\nexport type UnifiedButtonProps = (ActionButtonProps | NavigationButtonProps) & IconOnlyProps;\n\nexport function Button({variant = 'solid', scheme, size = 'md', shape, className, iconOnly = false, children, ...props}: UnifiedButtonProps) {\n const classes = buttonClassName({variant, scheme, size, shape, className: cn(iconOnly && [iconSizes[size], 'gap-0 p-0'], className)});\n const content = iconOnly ? <span aria-hidden=\"true\" className=\"inline-flex\">{children}</span> : children;\n if (props.href !== undefined) {\n const { loading: _loading, disabled: _disabled, ...linkProps } = props as NavigationButtonProps;\n return <Link {...linkProps} className={classes}>{content}</Link>;\n }\n const {type = 'button', disabled, loading = false, href: _href, ...buttonProps} = props as ActionButtonProps;\n return <button {...buttonProps} type={type} className={classes} disabled={disabled || loading} aria-busy={loading || buttonProps['aria-busy']}>\n {loading && <Spinner decorative />}{(!iconOnly || !loading) && content}\n </button>;\n}\n\n\ntype IconSize = ButtonSize;\nconst iconSizes: Record<IconSize, string> = {\n xs: 'size-8', sm: 'size-9', md: 'size-11', lg: 'size-12', xl: 'size-13', '2xl': 'size-14',\n};\n\nexport type ExpandingButtonProps = Omit<ActionButtonProps, 'children' | 'size'> & {\n /** Leading icon. */\n icon: ReactNode;\n /** Action label, revealed on hover/focus and always visible on touch screens. */\n label: string;\n /** Standard control size. */\n size?: IconSize;\n};\nexport function ExpandingButton({icon, label, size = 'md', loading, ...props}: ExpandingButtonProps) {\n return <Button aria-label={label} {...props} size={size} loading={loading} className={cn('gap-0 px-3', props.className)}>\n {!loading && <span aria-hidden=\"true\" className=\"inline-flex\">{icon}</span>}\n <span className=\"pointer-fine:ml-0 pointer-fine:max-w-0 pointer-fine:overflow-hidden pointer-fine:whitespace-nowrap pointer-fine:opacity-0 pointer-fine:group-hover/button:ml-2 pointer-fine:group-hover/button:max-w-40 pointer-fine:group-hover/button:opacity-100 pointer-fine:group-focus-visible/button:ml-2 pointer-fine:group-focus-visible/button:max-w-40 pointer-fine:group-focus-visible/button:opacity-100 pointer-fine:group-aria-busy/button:ml-2 pointer-fine:group-aria-busy/button:max-w-40 pointer-fine:group-aria-busy/button:opacity-100 motion-safe:transition-[max-width,margin,opacity] motion-safe:duration-interactive motion-safe:ease-out-strong motion-reduce:transition-none\">{label}</span>\n </Button>;\n}\n\nexport type FilterChipProps = Omit<ActionButtonProps, 'variant' | 'scheme' | 'size' | 'shape' | 'aria-pressed'> & {\n /** Controlled selection state; onClick belongs to the caller. */\n selected?: boolean;\n /** Optional leading icon. */\n icon?: ReactNode;\n};\nexport function FilterChip({selected = false, icon, children, loading, ...props}: FilterChipProps) {\n return <Button {...props} variant=\"outline\" scheme={selected ? 'secondary' : 'neutral'} size=\"md\" shape=\"pill\" aria-pressed={selected} loading={loading} className={cn('w-max max-w-full gap-2.5 px-5 py-3 text-base leading-[1.4]', selected && 'font-semibold')}>\n {!loading && icon}{children}\n </Button>;\n}\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;AAwBA,MAAM,OAAO,GAAiC;AAC5C,IAAA,OAAO,EAAE,mOAAmO;AAC5O,IAAA,SAAS,EAAE,wSAAwS;AACnT,IAAA,OAAO,EAAE,4OAA4O;AACrP,IAAA,WAAW,EAAE,2PAA2P;AACxQ,IAAA,OAAO,EAAE,uOAAuO;CACjP;AACD,MAAM,UAAU,GAAkC;AAChD,IAAA,KAAK,EAAE,EAAE,CAAC,uOAAuO,EAAE,2BAA2B,CAAC;AAC/Q,IAAA,OAAO,EAAE,EAAE,CAAC,gJAAgJ,EAAE,2BAA2B,CAAC;AAC1L,IAAA,KAAK,EAAE,wIAAwI;AAC/I,IAAA,IAAI,EAAE,oHAAoH;CAC3H;AACD,MAAM,KAAK,GAA+B;AACxC,IAAA,EAAE,EAAE,oCAAoC;AACxC,IAAA,EAAE,EAAE,oCAAoC;AACxC,IAAA,EAAE,EAAE,qCAAqC;AACzC,IAAA,EAAE,EAAE,uCAAuC;AAC3C,IAAA,EAAE,EAAE,uCAAuC;AAC3C,IAAA,KAAK,EAAE,qCAAqC;CAC7C;AAED;SACgB,eAAe,CAAC,EAAC,OAAO,GAAG,OAAO,EAAE,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,KAAK,EAAE,SAAS,KAAsB,EAAE,EAAA;AAC/G,IAAA,OAAO,EAAE,CACP,yVAAyV,EACzV,qCAAqC,EACrC,OAAO,CAAC,MAAM,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,SAAS,GAAG,SAAS,CAAC,CAAC,EACnF,UAAU,CAAC,OAAO,CAAC,EAAE,K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AE,IAAI,EAAC,IAAI,EAAC,KAAK,EAAC,MAAM,EAAA,cAAA,EAAe,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,CAAC,4DAA4D,EAAE,QAAQ,IAAI,eAAe,CAAC,EAAA,QAAA,EAAA,CAC9P,CAAC,OAAO,IAAI,IAAI,EAAE,QAAQ,CAAA,EAAA,CACpB;AACX;;;;"}
1
+ {"version":3,"file":"button.js","sources":["../../src/components/button.tsx"],"sourcesContent":["import Link from 'next/link';\nimport type { ComponentPropsWithRef, ReactNode } from 'react';\nimport { cn } from '@/utils';\nimport { Spinner } from './loader';\nimport { interactiveControlClassName, interactiveControlTransitionClassName } from '@/lib/interaction-styles';\n\nexport type ButtonVariant = 'solid' | 'outline' | 'ghost' | 'link';\nexport type ButtonScheme = 'primary' | 'secondary' | 'neutral' | 'destructive' | 'success';\nexport type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\nexport type ButtonShape = 'rounded' | 'pill';\n\ntype ButtonAppearance = {\n /** Visual treatment. */\n variant?: ButtonVariant;\n /** Semantic color, independent of the fill treatment. Defaults to primary, or neutral for outline/ghost. */\n scheme?: ButtonScheme;\n /** Standard control size: 32px, 36px, 44px, 48px, 52px, or 56px minimum height. */\n size?: ButtonSize;\n /** Corner treatment. Landing presets keep their original shape when omitted. */\n shape?: ButtonShape;\n /** Additional classes, merged after the component's appearance classes. */\n className?: string;\n};\n\nconst schemes: Record<ButtonScheme, string> = {\n primary: '[--btn-fill:var(--color-landing-blue)] [--btn-on:white] [--btn-hover:var(--color-landing-blue-hover)] [--btn-ink:var(--color-landing-blue-hover)] [--btn-soft:var(--color-landing-tint)] [--btn-border:var(--color-landing-blue)]',\n secondary: '[--btn-fill:var(--color-landing-secondary-tint)] [--btn-on:var(--color-landing-secondary-deep)] [--btn-hover:var(--color-brand-secondary-hover)] [--btn-ink:var(--color-landing-secondary-deep)] [--btn-soft:var(--color-landing-secondary-tint)] [--btn-border:var(--color-landing-secondary-border)]',\n neutral: '[--btn-fill:var(--color-v2-surface-subtle)] [--btn-on:var(--color-landing-nav)] [--btn-hover:var(--color-landing-border)] [--btn-ink:var(--color-landing-nav)] [--btn-soft:rgb(55_65_81_/_6%)] [--btn-border:var(--color-landing-control)]',\n destructive: '[--btn-fill:var(--color-v2-destructive)] [--btn-on:white] [--btn-hover:var(--color-brand-destructive-hover)] [--btn-ink:var(--color-brand-destructive-hover)] [--btn-soft:var(--color-brand-destructive-soft)] [--btn-border:var(--color-v2-destructive)]',\n success: '[--btn-fill:var(--color-brand-success)] [--btn-on:white] [--btn-hover:var(--color-brand-success-hover)] [--btn-ink:var(--color-brand-success)] [--btn-soft:var(--color-brand-success-soft)] [--btn-border:var(--color-brand-success)]',\n};\nconst treatments: Record<ButtonVariant, string> = {\n solid: cn('border border-[var(--btn-border)] bg-[var(--btn-fill)] font-semibold text-[var(--btn-on)] enabled:pointer-fine:hover:border-[var(--btn-hover)] enabled:pointer-fine:hover:bg-[var(--btn-hover)] [&:is(a):hover]:bg-[var(--btn-hover)]', interactiveControlClassName),\n outline: cn('border border-[var(--btn-border)] bg-transparent text-[var(--btn-ink)] enabled:hover:bg-[var(--btn-soft)] [&:is(a):hover]:bg-[var(--btn-soft)]', interactiveControlClassName),\n ghost: 'border border-transparent bg-transparent text-[var(--btn-ink)] enabled:hover:bg-[var(--btn-soft)] [&:is(a):hover]:bg-[var(--btn-soft)]',\n link: 'border-0 bg-transparent text-[var(--btn-ink)] underline-offset-4 enabled:hover:underline [&:is(a):hover]:underline',\n};\nconst sizes: Record<ButtonSize, string> = {\n xs: 'min-h-8 px-2 text-xs leading-[1.5]',\n sm: 'min-h-9 px-3 text-sm leading-[1.5]',\n md: 'min-h-11 px-5 text-sm leading-[1.5]',\n lg: 'min-h-12 px-6 text-base leading-[1.5]',\n xl: 'min-h-13 px-7 text-base leading-[1.5]',\n '2xl': 'min-h-14 px-8 text-lg leading-[1.5]',\n};\n\n/** Shared styling for action and navigation controls. Colors never change the fill treatment. */\nexport function buttonClassName({variant = 'solid', scheme, size = 'md', shape, className}: ButtonAppearance = {}) {\n return cn(\n 'group group/button inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-control-lg font-[550] focus-visible:outline-3 focus-visible:outline-offset-4 focus-visible:outline-landing-blue disabled:pointer-events-none disabled:opacity-50 aria-disabled:cursor-default aria-busy:cursor-wait [&_svg]:shrink-0',\n interactiveControlTransitionClassName,\n schemes[scheme ?? (['outline', 'ghost'].includes(variant) ? 'neutral' : 'primary')],\n treatments[variant], sizes[size],\n variant === 'outline' && (scheme === undefined || scheme === 'neutral') && 'enabled:hover:border-landing-control-hover enabled:hover:text-landing-nav-hover [&:is(a):hover]:border-landing-control-hover',\n variant === 'outline' && scheme === 'secondary' && 'bg-[var(--btn-soft)]',\n shape === 'pill' && 'rounded-full', shape === 'rounded' && 'rounded-control-lg', className,\n );\n}\n\ntype IconOnlyProps = { iconOnly?: false } | { iconOnly: true; 'aria-label': string };\ntype ActionButtonProps = ComponentPropsWithRef<'button'> & ButtonAppearance & {\n href?: never;\n /** Shows a progress indicator, exposes aria-busy, and disables the action while work is pending. */\n loading?: boolean;\n};\ntype NavigationButtonProps = Omit<ComponentPropsWithRef<typeof Link>, 'className'> & ButtonAppearance & {\n loading?: never;\n disabled?: never;\n};\nexport type ButtonProps = ActionButtonProps;\nexport type UnifiedButtonProps = (ActionButtonProps | NavigationButtonProps) & IconOnlyProps;\n\nexport function Button({variant = 'solid', scheme, size = 'md', shape, className, iconOnly = false, children, ...props}: UnifiedButtonProps) {\n const classes = buttonClassName({variant, scheme, size, shape, className: cn(iconOnly && [iconSizes[size], 'gap-0 p-0'], className)});\n const content = iconOnly ? <span aria-hidden=\"true\" className=\"inline-flex\">{children}</span> : children;\n if (props.href !== undefined) {\n const { loading: _loading, disabled: _disabled, ...linkProps } = props as NavigationButtonProps;\n return <Link {...linkProps} className={classes}>{content}</Link>;\n }\n const {type = 'button', disabled, loading = false, href: _href, ...buttonProps} = props as ActionButtonProps;\n return <button {...buttonProps} type={type} className={classes} disabled={disabled || loading} aria-busy={loading || buttonProps['aria-busy']}>\n {loading && <Spinner decorative />}{(!iconOnly || !loading) && content}\n </button>;\n}\n\n\ntype IconSize = ButtonSize;\nconst iconSizes: Record<IconSize, string> = {\n xs: 'size-8', sm: 'size-9', md: 'size-11', lg: 'size-12', xl: 'size-13', '2xl': 'size-14',\n};\n\nexport type ExpandingButtonProps = Omit<ActionButtonProps, 'children' | 'size'> & {\n /** Leading icon. */\n icon: ReactNode;\n /** Action label, revealed on hover/focus and always visible on touch screens. */\n label: string;\n /** Standard control size. */\n size?: IconSize;\n};\nexport function ExpandingButton({icon, label, size = 'md', loading, ...props}: ExpandingButtonProps) {\n return <Button aria-label={label} {...props} size={size} loading={loading} className={cn('gap-0 px-3', props.className)}>\n {!loading && <span aria-hidden=\"true\" className=\"inline-flex\">{icon}</span>}\n <span className=\"ml-2 pointer-fine:ml-0 pointer-fine:max-w-0 pointer-fine:overflow-hidden pointer-fine:whitespace-nowrap pointer-fine:opacity-0 pointer-fine:group-hover/button:ml-2 pointer-fine:group-hover/button:max-w-40 pointer-fine:group-hover/button:opacity-100 pointer-fine:group-focus-visible/button:ml-2 pointer-fine:group-focus-visible/button:max-w-40 pointer-fine:group-focus-visible/button:opacity-100 pointer-fine:group-aria-busy/button:ml-2 pointer-fine:group-aria-busy/button:max-w-40 pointer-fine:group-aria-busy/button:opacity-100 motion-safe:transition-[max-width,margin,opacity] motion-safe:duration-interactive motion-safe:ease-out-strong motion-reduce:transition-none\">{label}</span>\n </Button>;\n}\n\nexport type FilterChipProps = Omit<ActionButtonProps, 'variant' | 'scheme' | 'size' | 'shape' | 'aria-pressed'> & {\n /** Controlled selection state; onClick belongs to the caller. */\n selected?: boolean;\n /** Optional leading icon. */\n icon?: ReactNode;\n};\nexport function FilterChip({selected = false, icon, children, loading, ...props}: FilterChipProps) {\n return <Button {...props} variant=\"outline\" scheme={selected ? 'secondary' : 'neutral'} size=\"md\" shape=\"pill\" aria-pressed={selected} loading={loading} className={cn('w-max max-w-full gap-2.5 px-5 py-3 text-base leading-[1.4]', selected && 'font-semibold')}>\n {!loading && icon}{children}\n </Button>;\n}\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;AAwBA,MAAM,OAAO,GAAiC;AAC5C,IAAA,OAAO,EAAE,mOAAmO;AAC5O,IAAA,SAAS,EAAE,wSAAwS;AACnT,IAAA,OAAO,EAAE,4OAA4O;AACrP,IAAA,WAAW,EAAE,2PAA2P;AACxQ,IAAA,OAAO,EAAE,uOAAuO;CACjP;AACD,MAAM,UAAU,GAAkC;AAChD,IAAA,KAAK,EAAE,EAAE,CAAC,uOAAuO,EAAE,2BAA2B,CAAC;AAC/Q,IAAA,OAAO,EAAE,EAAE,CAAC,gJAAgJ,EAAE,2BAA2B,CAAC;AAC1L,IAAA,KAAK,EAAE,wIAAwI;AAC/I,IAAA,IAAI,EAAE,oHAAoH;CAC3H;AACD,MAAM,KAAK,GAA+B;AACxC,IAAA,EAAE,EAAE,oCAAoC;AACxC,IAAA,EAAE,EAAE,oCAAoC;AACxC,IAAA,EAAE,EAAE,qCAAqC;AACzC,IAAA,EAAE,EAAE,uCAAuC;AAC3C,IAAA,EAAE,EAAE,uCAAuC;AAC3C,IAAA,KAAK,EAAE,qCAAqC;CAC7C;AAED;SACgB,eAAe,CAAC,EAAC,OAAO,GAAG,OAAO,EAAE,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,KAAK,EAAE,SAAS,KAAsB,EAAE,EAAA;AAC/G,IAAA,OAAO,EAAE,CACP,yVAAyV,EACzV,qCAAqC,EACrC,OAAO,CAAC,MAAM,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,SAAS,GAAG,SAAS,CAAC,CAAC,EACnF,UAAU,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,EAChC,OAAO,KAAK,SAAS,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AAA,cAAA,EAAe,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,CAAC,4DAA4D,EAAE,QAAQ,IAAI,eAAe,CAAC,EAAA,QAAA,EAAA,CAC9P,CAAC,OAAO,IAAI,IAAI,EAAE,QAAQ,CAAA,EAAA,CACpB;AACX;;;;"}
@@ -8,9 +8,11 @@ interface TimelineItemProps {
8
8
  /**
9
9
  * The step's state, shown in its circle: `done` is the green check (as
10
10
  * `number={-1}`), `waiting` a yellow clock for the step it's currently
11
- * waiting on. Otherwise the step's number.
11
+ * waiting on, `rejected` a red cross for the step that turned it down,
12
+ * `cancelled` a muted stop sign for the step where it was called off.
13
+ * Otherwise the step's number.
12
14
  */
13
- status?: 'done' | 'waiting';
15
+ status?: 'done' | 'waiting' | 'rejected' | 'cancelled';
14
16
  title: string | React.ReactNode;
15
17
  subtitle?: React.ReactNode;
16
18
  isLast?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { CheckIcon, ClockIcon, MailWarningIcon } from 'lucide-react';
2
+ import { CheckIcon, ClockIcon, XIcon, BanIcon, MailWarningIcon } from 'lucide-react';
3
3
  import { Badge } from './badge.js';
4
4
  import { cn } from '../utils.js';
5
5
 
@@ -13,8 +13,10 @@ const TimelineItem = ({ number, status, title, subtitle, isLast = false, childre
13
13
  // 28px circles, icons at a heavier stroke so they hold up in the tint.
14
14
  const isCheckmark = status === 'done' || number === -1;
15
15
  const isWaiting = status === 'waiting' && !isCheckmark;
16
+ const isRejected = status === 'rejected' && !isCheckmark;
17
+ const isCancelled = status === 'cancelled' && !isCheckmark;
16
18
  const isExclamation = fromMe;
17
- return (jsxs("div", { className: cn('relative flex items-start gap-3', !isLast && 'pb-6', className), children: [jsxs("div", { className: "relative flex w-7 shrink-0 self-stretch justify-center", children: [isCheckmark ? (jsx("div", { className: "relative z-10 flex size-7 shrink-0 items-center justify-center rounded-full bg-supportive-soft text-supportive-strong", children: jsx(CheckIcon, { className: "size-4", strokeWidth: 2.75, "aria-hidden": "true" }) })) : isWaiting ? (jsx("div", { className: "relative z-10 flex size-7 shrink-0 items-center justify-center rounded-full bg-warning-soft text-warning-strong", children: jsx(ClockIcon, { className: "size-4.5 translate-x-[0.5px]", strokeWidth: 2.5, "aria-hidden": "true" }) })) : isExclamation ? (jsx("div", { className: "relative z-10 flex size-7 shrink-0 items-center justify-center rounded-full bg-primary-selected text-primary", children: jsx(MailWarningIcon, { className: "size-4", strokeWidth: 2.5, "aria-hidden": "true" }) })) : (jsx("div", { className: "relative z-10 flex size-7 shrink-0 items-center justify-center rounded-full border border-input bg-muted text-xs font-semibold text-muted-foreground", children: number })), !isLast && jsx("div", { "aria-hidden": "true", className: "absolute -bottom-5 top-8 w-px bg-border" })] }), jsxs("div", { className: "flex min-w-0 flex-1 flex-wrap items-start justify-between gap-x-3 gap-y-2", children: [jsxs("div", { className: "min-w-0 flex-1 basis-48", children: [jsxs("div", { className: "flex min-h-7 flex-wrap items-center gap-2", children: [fromMe ? (jsx("div", { className: "text-sm font-semibold text-primary", children: title })) : (jsx("div", { className: "text-sm font-medium text-foreground", children: title })), isMe && (
19
+ return (jsxs("div", { className: cn('relative flex items-start gap-3', !isLast && 'pb-6', className), children: [jsxs("div", { className: "relative flex w-7 shrink-0 self-stretch justify-center", children: [isCheckmark ? (jsx("div", { className: "relative z-10 flex size-7 shrink-0 items-center justify-center rounded-full bg-supportive-soft text-supportive-strong", children: jsx(CheckIcon, { className: "size-4", strokeWidth: 2.75, "aria-hidden": "true" }) })) : isWaiting ? (jsx("div", { className: "relative z-10 flex size-7 shrink-0 items-center justify-center rounded-full bg-warning-soft text-warning-strong", children: jsx(ClockIcon, { className: "size-4.5 translate-x-[0.5px]", strokeWidth: 2.5, "aria-hidden": "true" }) })) : isRejected ? (jsx("div", { className: "relative z-10 flex size-7 shrink-0 items-center justify-center rounded-full bg-destructive-soft text-destructive-strong", children: jsx(XIcon, { className: "size-4", strokeWidth: 2.75, "aria-hidden": "true" }) })) : isCancelled ? (jsx("div", { className: "relative z-10 flex size-7 shrink-0 items-center justify-center rounded-full border border-input bg-muted text-muted-foreground", children: jsx(BanIcon, { className: "size-4", strokeWidth: 2.5, "aria-hidden": "true" }) })) : isExclamation ? (jsx("div", { className: "relative z-10 flex size-7 shrink-0 items-center justify-center rounded-full bg-primary-selected text-primary", children: jsx(MailWarningIcon, { className: "size-4", strokeWidth: 2.5, "aria-hidden": "true" }) })) : (jsx("div", { className: "relative z-10 flex size-7 shrink-0 items-center justify-center rounded-full border border-input bg-muted text-xs font-semibold text-muted-foreground", children: number })), !isLast && jsx("div", { "aria-hidden": "true", className: "absolute -bottom-5 top-8 w-px bg-border" })] }), jsxs("div", { className: "flex min-w-0 flex-1 flex-wrap items-start justify-between gap-x-3 gap-y-2", children: [jsxs("div", { className: "min-w-0 flex-1 basis-48", children: [jsxs("div", { className: "flex min-h-7 flex-wrap items-center gap-2", children: [fromMe ? (jsx("div", { className: "text-sm font-semibold text-primary", children: title })) : (jsx("div", { className: "text-sm font-medium text-foreground", children: title })), isMe && (
18
20
  // The waiting clock's colours (warning-soft, -strong), semibold.
19
21
  jsx(Badge, { variant: "soft", type: "warning", className: "font-semibold", children: "You" }))] }), subtitle && (jsx("div", { className: "text-sm leading-snug text-muted-foreground", children: subtitle }))] }), children && jsx("div", { className: "flex min-h-7 shrink-0 items-center", children: children })] })] }));
20
22
  };
@@ -1 +1 @@
1
- {"version":3,"file":"timeline.js","sources":["../../src/components/timeline.tsx"],"sourcesContent":["import React from \"react\";\nimport { CheckIcon, ClockIcon, MailWarningIcon } from \"lucide-react\";\nimport { Badge } from './badge';\nimport { cn } from '@/utils';\n\nexport const Timeline = ({ children, className }: { children: React.ReactNode; className?: string }) => {\n return <div className={cn('w-full', className)}>{children}</div>;\n};\n\ninterface TimelineItemProps {\n number: number;\n /**\n * The step's state, shown in its circle: `done` is the green check (as\n * `number={-1}`), `waiting` a yellow clock for the step it's currently\n * waiting on. Otherwise the step's number.\n */\n status?: 'done' | 'waiting';\n title: string | React.ReactNode;\n subtitle?: React.ReactNode;\n isLast?: boolean;\n children?: React.ReactNode;\n fromMe?: boolean;\n isMe?: boolean;\n className?: string;\n}\n\nexport const TimelineItem = ({\n number,\n status,\n title,\n subtitle,\n isLast = false,\n children,\n fromMe,\n isMe,\n className,\n}: TimelineItemProps) => {\n // Marked steps are soft, like the badges: done and waiting take the\n // \"Completed\" / \"Waiting for recipients\" colours (-soft tint, -strong\n // icon), \"from me\" the primary-selected tint; no ring.\n // 28px circles, icons at a heavier stroke so they hold up in the tint.\n const isCheckmark = status === 'done' || number === -1;\n const isWaiting = status === 'waiting' && !isCheckmark;\n const isExclamation = fromMe;\n\n return (\n <div className={cn('relative flex items-start gap-3', !isLast && 'pb-6', className)}>\n <div className=\"relative flex w-7 shrink-0 self-stretch justify-center\">\n {isCheckmark ? (\n <div className=\"relative z-10 flex size-7 shrink-0 items-center justify-center rounded-full bg-supportive-soft text-supportive-strong\">\n <CheckIcon className=\"size-4\" strokeWidth={2.75} aria-hidden=\"true\" />\n </div>\n ) : isWaiting ? (\n <div className=\"relative z-10 flex size-7 shrink-0 items-center justify-center rounded-full bg-warning-soft text-warning-strong\">\n {/* A size up from the check, and half a pixel right: the clock's\n lopsided hands (up and to the right) read as off-centre\n though the glyph is geometrically centred. */}\n <ClockIcon className=\"size-4.5 translate-x-[0.5px]\" strokeWidth={2.5} aria-hidden=\"true\" />\n </div>\n ) : isExclamation ? (\n <div className=\"relative z-10 flex size-7 shrink-0 items-center justify-center rounded-full bg-primary-selected text-primary\">\n <MailWarningIcon className=\"size-4\" strokeWidth={2.5} aria-hidden=\"true\" />\n </div>\n ) : (\n <div className=\"relative z-10 flex size-7 shrink-0 items-center justify-center rounded-full border border-input bg-muted text-xs font-semibold text-muted-foreground\">\n {number}\n </div>\n )}\n {!isLast && <div aria-hidden=\"true\" className=\"absolute -bottom-5 top-8 w-px bg-border\" />}\n </div>\n\n {/* Content */}\n <div className=\"flex min-w-0 flex-1 flex-wrap items-start justify-between gap-x-3 gap-y-2\">\n {/* At least 12rem for the title and subtitle: on narrow screens the\n right slot (children) wraps below instead of squeezing the title\n into a sliver. */}\n <div className=\"min-w-0 flex-1 basis-48\">\n <div className=\"flex min-h-7 flex-wrap items-center gap-2\">\n {fromMe ? (\n <div className=\"text-sm font-semibold text-primary\">{title}</div>\n ) : (\n <div className=\"text-sm font-medium text-foreground\">{title}</div>\n )}\n {isMe && (\n // The waiting clock's colours (warning-soft, -strong), semibold.\n <Badge variant=\"soft\" type=\"warning\" className=\"font-semibold\">\n You\n </Badge>\n )}\n </div>\n {/* Snug under the title: a one-line detail (an email, a name), not\n prose, so it shouldn't float with prose leading. */}\n {subtitle && (\n <div className=\"text-sm leading-snug text-muted-foreground\">{subtitle}</div>\n )}\n </div>\n {children && <div className=\"flex min-h-7 shrink-0 items-center\">{children}</div>}\n </div>\n </div>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;AAKO,MAAM,QAAQ,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAqD,KAAI;AACrG,IAAA,OAAOA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAO;AAClE;AAmBO,MAAM,YAAY,GAAG,CAAC,EAC3B,MAAM,EACN,MAAM,EACN,KAAK,EACL,QAAQ,EACR,MAAM,GAAG,KAAK,EACd,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,SAAS,GACS,KAAI;;;;;IAKtB,MAAM,WAAW,GAAG,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,EAAE;IACtD,MAAM,SAAS,GAAG,MAAM,KAAK,SAAS,IAAI,CAAC,WAAW;IACtD,MAAM,aAAa,GAAG,MAAM;AAE5B,IAAA,QACEC,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,EAAE,CAAC,iCAAiC,EAAE,CAAC,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AAqC,EAAA,QAAA,EAAE,KAAK,GAAO,CACnE,EACA,IAAI;;AAEH,oCAAAA,GAAA,CAAC,KAAK,EAAA,EAAC,OAAO,EAAC,MAAM,EAAC,IAAI,EAAC,SAAS,EAAC,SAAS,EAAC,eAAe,EAAA,QAAA,EAAA,KAAA,EAAA,CAEtD,CACT,IACG,EAGL,QAAQ,KACPA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,4CAA4C,EAAA,QAAA,EAAE,QAAQ,GAAO,CAC7E,CAAA,EAAA,CACG,EACL,QAAQ,IAAIA,aAAK,SAAS,EAAC,oCAAoC,EAAA,QAAA,EAAE,QAAQ,GAAO,CAAA,EAAA,CAC7E,CAAA,EAAA,CACF;AAEV;;;;"}
1
+ {"version":3,"file":"timeline.js","sources":["../../src/components/timeline.tsx"],"sourcesContent":["import React from \"react\";\nimport { BanIcon, CheckIcon, ClockIcon, MailWarningIcon, XIcon } from \"lucide-react\";\nimport { Badge } from './badge';\nimport { cn } from '@/utils';\n\nexport const Timeline = ({ children, className }: { children: React.ReactNode; className?: string }) => {\n return <div className={cn('w-full', className)}>{children}</div>;\n};\n\ninterface TimelineItemProps {\n number: number;\n /**\n * The step's state, shown in its circle: `done` is the green check (as\n * `number={-1}`), `waiting` a yellow clock for the step it's currently\n * waiting on, `rejected` a red cross for the step that turned it down,\n * `cancelled` a muted stop sign for the step where it was called off.\n * Otherwise the step's number.\n */\n status?: 'done' | 'waiting' | 'rejected' | 'cancelled';\n title: string | React.ReactNode;\n subtitle?: React.ReactNode;\n isLast?: boolean;\n children?: React.ReactNode;\n fromMe?: boolean;\n isMe?: boolean;\n className?: string;\n}\n\nexport const TimelineItem = ({\n number,\n status,\n title,\n subtitle,\n isLast = false,\n children,\n fromMe,\n isMe,\n className,\n}: TimelineItemProps) => {\n // Marked steps are soft, like the badges: done and waiting take the\n // \"Completed\" / \"Waiting for recipients\" colours (-soft tint, -strong\n // icon), \"from me\" the primary-selected tint; no ring.\n // 28px circles, icons at a heavier stroke so they hold up in the tint.\n const isCheckmark = status === 'done' || number === -1;\n const isWaiting = status === 'waiting' && !isCheckmark;\n const isRejected = status === 'rejected' && !isCheckmark;\n const isCancelled = status === 'cancelled' && !isCheckmark;\n const isExclamation = fromMe;\n\n return (\n <div className={cn('relative flex items-start gap-3', !isLast && 'pb-6', className)}>\n <div className=\"relative flex w-7 shrink-0 self-stretch justify-center\">\n {isCheckmark ? (\n <div className=\"relative z-10 flex size-7 shrink-0 items-center justify-center rounded-full bg-supportive-soft text-supportive-strong\">\n <CheckIcon className=\"size-4\" strokeWidth={2.75} aria-hidden=\"true\" />\n </div>\n ) : isWaiting ? (\n <div className=\"relative z-10 flex size-7 shrink-0 items-center justify-center rounded-full bg-warning-soft text-warning-strong\">\n {/* A size up from the check, and half a pixel right: the clock's\n lopsided hands (up and to the right) read as off-centre\n though the glyph is geometrically centred. */}\n <ClockIcon className=\"size-4.5 translate-x-[0.5px]\" strokeWidth={2.5} aria-hidden=\"true\" />\n </div>\n ) : isRejected ? (\n <div className=\"relative z-10 flex size-7 shrink-0 items-center justify-center rounded-full bg-destructive-soft text-destructive-strong\">\n <XIcon className=\"size-4\" strokeWidth={2.75} aria-hidden=\"true\" />\n </div>\n ) : isCancelled ? (\n <div className=\"relative z-10 flex size-7 shrink-0 items-center justify-center rounded-full border border-input bg-muted text-muted-foreground\">\n <BanIcon className=\"size-4\" strokeWidth={2.5} aria-hidden=\"true\" />\n </div>\n ) : isExclamation ? (\n <div className=\"relative z-10 flex size-7 shrink-0 items-center justify-center rounded-full bg-primary-selected text-primary\">\n <MailWarningIcon className=\"size-4\" strokeWidth={2.5} aria-hidden=\"true\" />\n </div>\n ) : (\n <div className=\"relative z-10 flex size-7 shrink-0 items-center justify-center rounded-full border border-input bg-muted text-xs font-semibold text-muted-foreground\">\n {number}\n </div>\n )}\n {!isLast && <div aria-hidden=\"true\" className=\"absolute -bottom-5 top-8 w-px bg-border\" />}\n </div>\n\n {/* Content */}\n <div className=\"flex min-w-0 flex-1 flex-wrap items-start justify-between gap-x-3 gap-y-2\">\n {/* At least 12rem for the title and subtitle: on narrow screens the\n right slot (children) wraps below instead of squeezing the title\n into a sliver. */}\n <div className=\"min-w-0 flex-1 basis-48\">\n <div className=\"flex min-h-7 flex-wrap items-center gap-2\">\n {fromMe ? (\n <div className=\"text-sm font-semibold text-primary\">{title}</div>\n ) : (\n <div className=\"text-sm font-medium text-foreground\">{title}</div>\n )}\n {isMe && (\n // The waiting clock's colours (warning-soft, -strong), semibold.\n <Badge variant=\"soft\" type=\"warning\" className=\"font-semibold\">\n You\n </Badge>\n )}\n </div>\n {/* Snug under the title: a one-line detail (an email, a name), not\n prose, so it shouldn't float with prose leading. */}\n {subtitle && (\n <div className=\"text-sm leading-snug text-muted-foreground\">{subtitle}</div>\n )}\n </div>\n {children && <div className=\"flex min-h-7 shrink-0 items-center\">{children}</div>}\n </div>\n </div>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;AAKO,MAAM,QAAQ,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAqD,KAAI;AACrG,IAAA,OAAOA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAO;AAClE;AAqBO,MAAM,YAAY,GAAG,CAAC,EAC3B,MAAM,EACN,MAAM,EACN,KAAK,EACL,QAAQ,EACR,MAAM,GAAG,KAAK,EACd,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,SAAS,GACS,KAAI;;;;;IAKtB,MAAM,WAAW,GAAG,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,EAAE;IACtD,MAAM,SAAS,GAAG,MAAM,KAAK,SAAS,IAAI,CAAC,WAAW;IACtD,MAAM,UAAU,GAAG,MAAM,KAAK,UAAU,IAAI,CAAC,WAAW;IACxD,MAAM,WAAW,GAAG,MAAM,KAAK,WAAW,IAAI,CAAC,WAAW;IAC1D,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