tfy-web-components 0.0.39 → 0.0.41
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.
- package/dist/{Button-jOAqbUsb.js → Button-CHzl5RaT.js} +22 -21
- package/dist/Button-CHzl5RaT.js.map +1 -0
- package/dist/{Input-CPtcHuvs.js → Input-WdhMjVoF.js} +14 -26
- package/dist/{Input-CPtcHuvs.js.map → Input-WdhMjVoF.js.map} +1 -1
- package/dist/{Modal-C4MUy9GD.js → Modal-MUzR0rK2.js} +3 -3
- package/dist/{Modal-C4MUy9GD.js.map → Modal-MUzR0rK2.js.map} +1 -1
- package/dist/{Popover-CobCCoQO.js → Popover-B3yBTSQa.js} +5 -5
- package/dist/{Popover-CobCCoQO.js.map → Popover-B3yBTSQa.js.map} +1 -1
- package/dist/{Tooltip-CLO2X6GB.js → Tooltip-D5E-qGtP.js} +217 -32
- package/dist/{Tooltip-CLO2X6GB.js.map → Tooltip-D5E-qGtP.js.map} +1 -1
- package/dist/components/atoms/Accordion.es.js +1 -1
- package/dist/components/atoms/Accordion.es.js.map +1 -1
- package/dist/components/atoms/AudioPlayer.es.js +4 -4
- package/dist/components/atoms/AudioPlayer.es.js.map +1 -1
- package/dist/components/atoms/Avatar.es.js +16 -16
- package/dist/components/atoms/Avatar.es.js.map +1 -1
- package/dist/components/atoms/Badge.es.js +37 -37
- package/dist/components/atoms/Badge.es.js.map +1 -1
- package/dist/components/atoms/Button.d.ts +2 -0
- package/dist/components/atoms/Button.es.js +2 -2
- package/dist/components/atoms/ButtonGroup.es.js +6 -6
- package/dist/components/atoms/ButtonGroup.es.js.map +1 -1
- package/dist/components/atoms/Code.d.ts +5 -0
- package/dist/components/atoms/Code.es.js +31 -0
- package/dist/components/atoms/Code.es.js.map +1 -0
- package/dist/components/atoms/IconButton.es.js +6 -6
- package/dist/components/atoms/IconButton.es.js.map +1 -1
- package/dist/components/atoms/Logo.es.js +1 -1
- package/dist/components/atoms/Logo.es.js.map +1 -1
- package/dist/components/atoms/Modal.es.js +1 -1
- package/dist/components/atoms/OutlinedRadio.es.js +1 -1
- package/dist/components/atoms/OutlinedRadio.es.js.map +1 -1
- package/dist/components/atoms/OverflowButton.es.js +4 -4
- package/dist/components/atoms/OverflowButton.es.js.map +1 -1
- package/dist/components/atoms/Progress.es.js +11 -11
- package/dist/components/atoms/Progress.es.js.map +1 -1
- package/dist/components/atoms/Skeleton.es.js +1 -8
- package/dist/components/atoms/Skeleton.es.js.map +1 -1
- package/dist/components/atoms/Spinner.es.js +4 -4
- package/dist/components/atoms/Spinner.es.js.map +1 -1
- package/dist/components/atoms/Switch.d.ts +10 -2
- package/dist/components/atoms/Switch.es.js +39 -16
- package/dist/components/atoms/Switch.es.js.map +1 -1
- package/dist/components/atoms/TabButton.es.js +2 -2
- package/dist/components/atoms/TabButton.es.js.map +1 -1
- package/dist/components/atoms/Tag.es.js +1 -1
- package/dist/components/atoms/Tag.es.js.map +1 -1
- package/dist/components/atoms/Tooltip.d.ts +61 -15
- package/dist/components/atoms/Tooltip.es.js +15 -2
- package/dist/components/atoms/Tooltip.es.js.map +1 -1
- package/dist/components/molecules/Alert.es.js +4 -4
- package/dist/components/molecules/Alert.es.js.map +1 -1
- package/dist/components/molecules/CopyField.es.js +2 -2
- package/dist/components/molecules/CustomDrawer.es.js +5 -5
- package/dist/components/molecules/CustomDrawer.es.js.map +1 -1
- package/dist/components/molecules/Dialog.es.js +1 -1
- package/dist/components/molecules/ImagesPreview.es.js +7 -7
- package/dist/components/molecules/ImagesPreview.es.js.map +1 -1
- package/dist/components/molecules/Input.es.js +2 -2
- package/dist/components/molecules/Markdown.es.js +4 -4
- package/dist/components/molecules/Markdown.es.js.map +1 -1
- package/dist/components/molecules/Notify.es.js +4 -4
- package/dist/components/molecules/Notify.es.js.map +1 -1
- package/dist/components/molecules/SimpleCodeEditor.es.js +7 -7
- package/dist/components/molecules/SimpleCodeEditor.es.js.map +1 -1
- package/dist/components/molecules/ToggleButton.es.js +13 -16
- package/dist/components/molecules/ToggleButton.es.js.map +1 -1
- package/dist/components/molecules/agent-chat/UserMessage.es.js +1 -1
- package/dist/components/molecules/agent-chat/UserMessage.es.js.map +1 -1
- package/dist/components/molecules/agent-chat/UserMessageEdit.es.js +2 -2
- package/dist/components/molecules/agent-chat/UserMessageEdit.es.js.map +1 -1
- package/dist/components/molecules/agent-chat.es.js +9 -9
- package/dist/components/molecules/agent-chat.es.js.map +1 -1
- package/dist/components/theme/colors.es.js +15 -1
- package/dist/components/theme/colors.es.js.map +1 -1
- package/dist/index.es.js +1 -1
- package/dist/markdown.css +2 -2
- package/dist/new-components/atoms/Checkbox.es.js +1 -1
- package/dist/new-components/atoms/Checkbox.es.js.map +1 -1
- package/dist/new-components/atoms/Chip.es.js +17 -20
- package/dist/new-components/atoms/Chip.es.js.map +1 -1
- package/dist/new-components/atoms/Popover.es.js +2 -2
- package/dist/new-components/atoms/Radio.es.js +2 -2
- package/dist/new-components/atoms/Radio.es.js.map +1 -1
- package/dist/new-components/atoms/SegmentedControl.es.js +2 -2
- package/dist/new-components/atoms/SegmentedControl.es.js.map +1 -1
- package/dist/new-components/atoms/Slider.es.js +3 -3
- package/dist/new-components/atoms/Slider.es.js.map +1 -1
- package/dist/new-components/atoms/Toggletip.es.js +8 -27
- package/dist/new-components/atoms/Toggletip.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tokens.css +509 -614
- package/package.json +3 -2
- package/dist/Button-jOAqbUsb.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.es.js","sources":["../../../src/components/atoms/IconButton.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '@/lib/utils'\n\nimport { ControlButton, type ControlButtonProps } from './Button'\nimport IconProvider, { iconFrame, type IconProp } from './IconProvider'\nimport { DarkTooltip, LightTooltip } from './Tooltip'\n\nconst iconButtonVariants = cva('', {\n variants: {\n variant: {\n primary:\n 'text-button-primary-icon data-[selected=true]:text-button-primary-icon-selected [&_[data-slot=button-icon]]:text-button-primary-icon data-[selected=true]:[&_[data-slot=button-icon]]:text-button-primary-icon-selected',\n secondary:\n 'text-button-secondary-icon hover:text-button-secondary-icon-hover data-[selected=true]:text-button-secondary-icon-selected [&_[data-slot=button-icon]]:text-button-secondary-icon hover:[&_[data-slot=button-icon]]:text-button-secondary-icon-hover data-[selected=true]:[&_[data-slot=button-icon]]:text-button-secondary-icon-selected',\n ghost:\n 'text-button-ghost-icon data-[selected=true]:text-button-ghost-icon-selected [&_[data-slot=button-icon]]:text-button-ghost-icon data-[selected=true]:[&_[data-slot=button-icon]]:text-button-ghost-icon-selected',\n destructive:\n 'text-button-destructive-icon hover:text-button-destructive-icon-hover data-[selected=true]:text-button-destructive-icon-hover [&_[data-slot=button-icon]]:text-button-destructive-icon hover:[&_[data-slot=button-icon]]:text-button-destructive-icon-hover data-[selected=true]:[&_[data-slot=button-icon]]:text-button-destructive-icon-hover',\n },\n size: {\n default: '',\n md: '',\n sm: '',\n },\n },\n defaultVariants: {\n variant: 'ghost',\n size: 'default',\n },\n})\n\nexport type IconButtonVariant = NonNullable<VariantProps<typeof iconButtonVariants>['variant']>\nexport type IconButtonSize = NonNullable<VariantProps<typeof iconButtonVariants>['size']>\n\nconst controlSizeMap = {\n default: 'icon',\n md: 'icon-md',\n sm: 'icon-sm',\n} as const satisfies Record<IconButtonSize, NonNullable<ControlButtonProps['size']>>\n\nconst iconFrameKey = {\n default: '16',\n md: '24',\n sm: '12',\n} as const satisfies Record<IconButtonSize, keyof typeof iconFrame>\n\ntype IconButtonCommonProps = Omit<React.ComponentProps<'button'>, 'children' | 'onClick' | 'size'> & {\n onClick?: React.MouseEventHandler<HTMLButtonElement>\n iconSize?: number\n tooltip?: React.ReactNode\n disabledTooltip?: React.ReactNode\n size?: IconButtonSize\n selected?: boolean\n loading?: boolean\n}\n\nexport type IconButtonProps = IconButtonCommonProps &\n (\n | {\n variant: 'destructive'\n icon?: IconProp\n }\n | {\n variant?: Exclude<IconButtonVariant, 'destructive'>\n icon: IconProp\n }\n )\n\nfunction IconButton({\n ref,\n icon,\n iconSize,\n onClick,\n disabled = false,\n tooltip,\n disabledTooltip,\n variant = 'ghost',\n size = 'default',\n selected = false,\n loading = false,\n className,\n type = 'button',\n 'aria-label': ariaLabel,\n ...props\n}: IconButtonProps) {\n const resolvedVariant = variant ?? 'ghost'\n const resolvedSize = size ?? 'default'\n const resolvedIcon = icon ?? (resolvedVariant === 'destructive' ? 'trash' : undefined)\n const tooltipTitle = disabled ? disabledTooltip ?? tooltip : tooltip\n const
|
|
1
|
+
{"version":3,"file":"IconButton.es.js","sources":["../../../src/components/atoms/IconButton.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '@/lib/utils'\n\nimport { ControlButton, type ControlButtonProps } from './Button'\nimport IconProvider, { iconFrame, type IconProp } from './IconProvider'\nimport { DarkTooltip, LightTooltip, tooltipTrigger } from './Tooltip'\n\nconst iconButtonVariants = cva('', {\n variants: {\n variant: {\n primary:\n 'text-button-primary-icon data-[selected=true]:text-button-primary-icon-selected [&_[data-slot=button-icon]]:text-button-primary-icon data-[selected=true]:[&_[data-slot=button-icon]]:text-button-primary-icon-selected',\n secondary:\n 'text-button-secondary-icon not-disabled:not-aria-disabled:hover:text-button-secondary-icon-hover data-[selected=true]:text-button-secondary-icon-selected [&_[data-slot=button-icon]]:text-button-secondary-icon not-disabled:not-aria-disabled:hover:[&_[data-slot=button-icon]]:text-button-secondary-icon-hover data-[selected=true]:[&_[data-slot=button-icon]]:text-button-secondary-icon-selected',\n ghost:\n 'text-button-ghost-icon data-[selected=true]:text-button-ghost-icon-selected [&_[data-slot=button-icon]]:text-button-ghost-icon data-[selected=true]:[&_[data-slot=button-icon]]:text-button-ghost-icon-selected',\n destructive:\n 'text-button-destructive-icon not-disabled:not-aria-disabled:hover:text-button-destructive-icon-hover data-[selected=true]:text-button-destructive-icon-hover [&_[data-slot=button-icon]]:text-button-destructive-icon not-disabled:not-aria-disabled:hover:[&_[data-slot=button-icon]]:text-button-destructive-icon-hover data-[selected=true]:[&_[data-slot=button-icon]]:text-button-destructive-icon-hover',\n },\n size: {\n default: '',\n md: '',\n sm: '',\n },\n },\n defaultVariants: {\n variant: 'ghost',\n size: 'default',\n },\n})\n\nexport type IconButtonVariant = NonNullable<VariantProps<typeof iconButtonVariants>['variant']>\nexport type IconButtonSize = NonNullable<VariantProps<typeof iconButtonVariants>['size']>\n\nconst controlSizeMap = {\n default: 'icon',\n md: 'icon-md',\n sm: 'icon-sm',\n} as const satisfies Record<IconButtonSize, NonNullable<ControlButtonProps['size']>>\n\nconst iconFrameKey = {\n default: '16',\n md: '24',\n sm: '12',\n} as const satisfies Record<IconButtonSize, keyof typeof iconFrame>\n\ntype IconButtonCommonProps = Omit<React.ComponentProps<'button'>, 'children' | 'onClick' | 'size'> & {\n onClick?: React.MouseEventHandler<HTMLButtonElement>\n iconSize?: number\n tooltip?: React.ReactNode\n disabledTooltip?: React.ReactNode\n size?: IconButtonSize\n selected?: boolean\n loading?: boolean\n}\n\nexport type IconButtonProps = IconButtonCommonProps &\n (\n | {\n variant: 'destructive'\n icon?: IconProp\n }\n | {\n variant?: Exclude<IconButtonVariant, 'destructive'>\n icon: IconProp\n }\n )\n\nfunction IconButton({\n ref,\n icon,\n iconSize,\n onClick,\n disabled = false,\n tooltip,\n disabledTooltip,\n variant = 'ghost',\n size = 'default',\n selected = false,\n loading = false,\n className,\n type = 'button',\n 'aria-label': ariaLabel,\n ...props\n}: IconButtonProps) {\n const resolvedVariant = variant ?? 'ghost'\n const resolvedSize = size ?? 'default'\n const resolvedIcon = icon ?? (resolvedVariant === 'destructive' ? 'trash' : undefined)\n const tooltipTitle = disabled ? disabledTooltip ?? tooltip : tooltip\n const accessibleName = ariaLabel ?? (typeof tooltip === 'string' ? tooltip : undefined)\n\n const button = (\n <ControlButton\n ref={ref}\n type=\"icon\"\n htmlType={type}\n variant={resolvedVariant}\n size={controlSizeMap[resolvedSize]}\n disabled={disabled}\n selected={selected}\n loading={loading}\n onClick={onClick}\n aria-label={accessibleName}\n className={cn(iconButtonVariants({ variant: resolvedVariant, size: resolvedSize }), className)}\n {...props}\n >\n {!loading && resolvedIcon ? (\n <span\n data-slot=\"button-icon\"\n data-icon={String(resolvedIcon)}\n className={cn(\n 'inline-flex shrink-0 items-center justify-center',\n iconFrame[iconFrameKey[resolvedSize]].frameClass,\n )}\n >\n <IconProvider icon={resolvedIcon} size={iconSize ?? iconFrame[iconFrameKey[resolvedSize]].glyph} />\n </span>\n ) : null}\n </ControlButton>\n )\n\n if (!tooltipTitle) {\n return button\n }\n\n const TooltipWrap = disabled ? LightTooltip : DarkTooltip\n return <TooltipWrap title={tooltipTitle}>{tooltipTrigger(disabled, button)}</TooltipWrap>\n}\n\nexport default IconButton\n"],"names":["cn"],"mappings":";;;;;;AASA,MAAM,qBAAqB,IAAI,IAAI;AAAA,EACjC,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SACE;AAAA,MACF,WACE;AAAA,MACF,OACE;AAAA,MACF,aACE;AAAA,IAAA;AAAA,IAEJ,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,iBAAiB;AAAA,IACf,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAEV,CAAC;AAKD,MAAM,iBAAiB;AAAA,EACrB,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,eAAe;AAAA,EACnB,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,IAAI;AACN;AAwBA,SAAS,WAAW;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP,WAAW;AAAA,EACX,UAAU;AAAA,EACV;AAAA,EACA,OAAO;AAAA,EACP,cAAc;AAAA,EACd,GAAG;AACL,GAAoB;AAClB,QAAM,kBAAkB,WAAW;AACnC,QAAM,eAAe,QAAQ;AAC7B,QAAM,eAAe,SAAS,oBAAoB,gBAAgB,UAAU;AAC5E,QAAM,eAAe,WAAW,mBAAmB,UAAU;AAC7D,QAAM,iBAAiB,cAAc,OAAO,YAAY,WAAW,UAAU;AAE7E,QAAM,SACJ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,MAAK;AAAA,MACL,UAAU;AAAA,MACV,SAAS;AAAA,MACT,MAAM,eAAe,YAAY;AAAA,MACjC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,cAAY;AAAA,MACZ,WAAWA,WAAG,mBAAmB,EAAE,SAAS,iBAAiB,MAAM,cAAc,GAAG,SAAS;AAAA,MAC5F,GAAG;AAAA,MAEH,UAAA,CAAC,WAAW,eACX;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,aAAU;AAAA,UACV,aAAW,OAAO,YAAY;AAAA,UAC9B,WAAWA;AAAAA,YACT;AAAA,YACA,UAAU,aAAa,YAAY,CAAC,EAAE;AAAA,UAAA;AAAA,UAGxC,UAAA,oBAAC,cAAA,EAAa,MAAM,cAAc,MAAM,YAAY,UAAU,aAAa,YAAY,CAAC,EAAE,MAAA,CAAO;AAAA,QAAA;AAAA,MAAA,IAEjG;AAAA,IAAA;AAAA,EAAA;AAIR,MAAI,CAAC,cAAc;AACjB,WAAO;AAAA,EACT;AAEA,QAAM,cAAc,WAAW,eAAe;AAC9C,6BAAQ,aAAA,EAAY,OAAO,cAAe,UAAA,eAAe,UAAU,MAAM,GAAE;AAC7E;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logo.es.js","sources":["../../../src/components/atoms/Logo.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '@/lib/utils'\n\nimport IconProvider, { registerIcons } from './IconProvider'\n\n/**\n * Drop SVGs in `src/assets/logos/{brand,product}/`:\n * `<slug>.svg` (Full), `<slug>-on-dark.svg` (On dark), `<slug>-mono.svg` (Mono).\n * Token-bound fills (Mono, and the white parts of On dark) are `currentColor`.\n * One file per colour; the box scales it. Keys are `logo-<basename>` (not `-dark`,\n * so IconProvider does not swap them with the theme).\n */\nconst logoModules = import.meta.glob<React.FC<React.SVGProps<SVGSVGElement>>>('../../assets/logos/*/*.svg', {\n query: '?react',\n import: 'default',\n})\n\nconst LOGO_KEYS = new Set<string>()\n\nconst logoIcons: Parameters<typeof registerIcons>[0] = {}\nfor (const [path, loader] of Object.entries(logoModules)) {\n const basename = path\n .split('/')\n .pop()\n ?.replace(/\\.svg$/, '')\n .split('?')[0]\n if (!basename) continue\n const key = `logo-${basename}`\n LOGO_KEYS.add(key)\n logoIcons[key] = React.lazy(async () => ({ default: await loader() }))\n}\nregisterIcons(logoIcons)\n\n/** Figma Color: Full · Mono · On dark. */\nexport type LogoColor = 'full' | 'mono' | 'on-dark'\n\n/** Figma Size. Square box in px, same literal style as IconSize. */\nexport type LogoSize = '16' | '24' | '32' | '40'\n\nconst COLOR_SUFFIX: Record<LogoColor, string> = {\n full: '',\n mono: '-mono',\n 'on-dark': '-on-dark',\n}\n\nconst LOGO_SIZE_REM: Record<LogoSize, number> = {\n '16': 1,\n '24': 1.5,\n '32': 2,\n '40': 2.5,\n}\n\nconst logoVariants = cva('inline-flex shrink-0 items-center justify-center', {\n variants: {\n color: {\n full: '',\n mono: 'text-icon-primary',\n 'on-dark': 'text-icon-on-
|
|
1
|
+
{"version":3,"file":"Logo.es.js","sources":["../../../src/components/atoms/Logo.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '@/lib/utils'\n\nimport IconProvider, { registerIcons } from './IconProvider'\n\n/**\n * Drop SVGs in `src/assets/logos/{brand,product}/`:\n * `<slug>.svg` (Full), `<slug>-on-dark.svg` (On dark), `<slug>-mono.svg` (Mono).\n * Token-bound fills (Mono, and the white parts of On dark) are `currentColor`.\n * One file per colour; the box scales it. Keys are `logo-<basename>` (not `-dark`,\n * so IconProvider does not swap them with the theme).\n */\nconst logoModules = import.meta.glob<React.FC<React.SVGProps<SVGSVGElement>>>('../../assets/logos/*/*.svg', {\n query: '?react',\n import: 'default',\n})\n\nconst LOGO_KEYS = new Set<string>()\n\nconst logoIcons: Parameters<typeof registerIcons>[0] = {}\nfor (const [path, loader] of Object.entries(logoModules)) {\n const basename = path\n .split('/')\n .pop()\n ?.replace(/\\.svg$/, '')\n .split('?')[0]\n if (!basename) continue\n const key = `logo-${basename}`\n LOGO_KEYS.add(key)\n logoIcons[key] = React.lazy(async () => ({ default: await loader() }))\n}\nregisterIcons(logoIcons)\n\n/** Figma Color: Full · Mono · On dark. */\nexport type LogoColor = 'full' | 'mono' | 'on-dark'\n\n/** Figma Size. Square box in px, same literal style as IconSize. */\nexport type LogoSize = '16' | '24' | '32' | '40'\n\nconst COLOR_SUFFIX: Record<LogoColor, string> = {\n full: '',\n mono: '-mono',\n 'on-dark': '-on-dark',\n}\n\nconst LOGO_SIZE_REM: Record<LogoSize, number> = {\n '16': 1,\n '24': 1.5,\n '32': 2,\n '40': 2.5,\n}\n\nconst logoVariants = cva('inline-flex shrink-0 items-center justify-center', {\n variants: {\n color: {\n full: '',\n mono: 'text-icon-primary',\n 'on-dark': 'text-icon-on-bold',\n },\n size: {\n '16': 'size-4',\n '24': 'size-6',\n '32': 'size-8',\n '40': 'size-10',\n },\n },\n defaultVariants: {\n color: 'full',\n size: '32',\n },\n})\n\ntype LogoProps = Omit<React.ComponentProps<'span'>, 'color' | 'children'> &\n VariantProps<typeof logoVariants> & {\n /** kebab-case brand slug, e.g. `github`, or an http(s) CDN URL. */\n brand: string\n }\n\n/** Requested colour, then Full, then nothing. Missing Mono and On dark repeat Full. */\nexport function resolveLogoIcon(brand: string, color: LogoColor, available: ReadonlySet<string>): string | null {\n const requested = `logo-${brand}${COLOR_SUFFIX[color]}`\n if (available.has(requested)) return requested\n const full = `logo-${brand}`\n if (color !== 'full' && available.has(full)) return full\n return null\n}\n\nfunction Logo({ brand, color, size, className, ref, 'aria-label': ariaLabel, ...props }: LogoProps) {\n const resolvedColor = color ?? 'full'\n const resolvedSize = size ?? '32'\n // CDN urls go through IconProvider, which loads `<file>-dark.<ext>` in dark mode and falls back to the original.\n const icon = brand.startsWith('http') ? brand : resolveLogoIcon(brand, resolvedColor, LOGO_KEYS)\n if (!icon) return null\n\n const labelled = Boolean(ariaLabel)\n\n return (\n <span\n ref={ref}\n data-slot=\"logo\"\n {...(labelled ? { role: 'img' as const, 'aria-label': ariaLabel } : { 'aria-hidden': true as const })}\n {...props}\n className={cn(logoVariants({ color: resolvedColor, size: resolvedSize }), className)}\n >\n <IconProvider icon={icon} size={LOGO_SIZE_REM[resolvedSize]} className=\"max-h-full max-w-full\" />\n </span>\n )\n}\n\nexport default Logo\n"],"names":["cn"],"mappings":";;;;;;AAcA,MAAM,cAAc,uBAAA,OAAA;AAAA,EAAA,oCAAA,MAAA,OAAA,uBAAA,EAAA,KAAA,OAAA,EAAA,SAAA,CAAA;AAAA,CAAA;AAKpB,MAAM,gCAAgB,IAAA;AAEtB,MAAM,YAAiD,CAAA;AACvD,WAAW,CAAC,MAAM,MAAM,KAAK,OAAO,QAAQ,WAAW,GAAG;AACxD,QAAM,YAAW,UACd,MAAM,GAAG,EACT,IAAA,MAFc,mBAGb,QAAQ,UAAU,IACnB,MAAM,KAAK;AACd,MAAI,CAAC,SAAU;AACf,QAAM,MAAM,QAAQ,QAAQ;AAC5B,YAAU,IAAI,GAAG;AACjB,YAAU,GAAG,IAAI,MAAM,KAAK,aAAa,EAAE,SAAS,MAAM,OAAA,EAAO,EAAI;AACvE;AACA,cAAc,SAAS;AAQvB,MAAM,eAA0C;AAAA,EAC9C,MAAM;AAAA,EACN,MAAM;AAAA,EACN,WAAW;AACb;AAEA,MAAM,gBAA0C;AAAA,EA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,EAAA;AAGrG;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "./IconProvider.es.js";
|
|
3
3
|
import "../../classNames-B1XpQHle.js";
|
|
4
|
-
import { D, k, a, l, d, b, m, n, c, o, M } from "../../Modal-
|
|
4
|
+
import { D, k, a, l, d, b, m, n, c, o, M } from "../../Modal-MUzR0rK2.js";
|
|
5
5
|
export {
|
|
6
6
|
D as Dialog,
|
|
7
7
|
k as DialogClose,
|
|
@@ -6,7 +6,7 @@ const OutlinedRadio = ({ className, ...props }) => /* @__PURE__ */ jsxs("span",
|
|
|
6
6
|
"span",
|
|
7
7
|
{
|
|
8
8
|
"aria-hidden": true,
|
|
9
|
-
className: "inline-flex size-4 shrink-0 rounded-full border border-border-bold bg-background-
|
|
9
|
+
className: "inline-flex size-4 shrink-0 rounded-full border border-border-bold bg-background-input peer-checked:border-[0.3125rem] peer-checked:border-border-brand-bold peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-border-focus peer-disabled:opacity-50"
|
|
10
10
|
}
|
|
11
11
|
)
|
|
12
12
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OutlinedRadio.es.js","sources":["../../../src/components/atoms/OutlinedRadio.tsx"],"sourcesContent":["import React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nexport type OutlinedRadioProps = React.InputHTMLAttributes<HTMLInputElement>\n\n/**\n * The dot follows the native input's `:checked` via `peer-checked`.\n * Focus ring is applied with peer-focus-visible outline classes (not `focus-ring`,\n * which only styles the element that has the class on its own `:focus-visible`).\n */\nconst OutlinedRadio: React.FC<OutlinedRadioProps> = ({ className, ...props }) => (\n <span className={cn('relative inline-flex size-4 shrink-0 items-start justify-start leading-none', className)}>\n <input type=\"radio\" className=\"peer absolute inset-0 cursor-pointer opacity-0 disabled:cursor-default\" {...props} />\n <span\n aria-hidden\n className=\"inline-flex size-4 shrink-0 rounded-full border border-border-bold bg-background-
|
|
1
|
+
{"version":3,"file":"OutlinedRadio.es.js","sources":["../../../src/components/atoms/OutlinedRadio.tsx"],"sourcesContent":["import React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nexport type OutlinedRadioProps = React.InputHTMLAttributes<HTMLInputElement>\n\n/**\n * The dot follows the native input's `:checked` via `peer-checked`.\n * Focus ring is applied with peer-focus-visible outline classes (not `focus-ring`,\n * which only styles the element that has the class on its own `:focus-visible`).\n */\nconst OutlinedRadio: React.FC<OutlinedRadioProps> = ({ className, ...props }) => (\n <span className={cn('relative inline-flex size-4 shrink-0 items-start justify-start leading-none', className)}>\n <input type=\"radio\" className=\"peer absolute inset-0 cursor-pointer opacity-0 disabled:cursor-default\" {...props} />\n <span\n aria-hidden\n className=\"inline-flex size-4 shrink-0 rounded-full border border-border-bold bg-background-input peer-checked:border-[0.3125rem] peer-checked:border-border-brand-bold peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-border-focus peer-disabled:opacity-50\"\n />\n </span>\n)\n\nexport default OutlinedRadio\n"],"names":["cn"],"mappings":";;AAWA,MAAM,gBAA8C,CAAC,EAAE,WAAW,GAAG,MAAA,MACnE,qBAAC,QAAA,EAAK,WAAWA,WAAG,+EAA+E,SAAS,GAC1G,UAAA;AAAA,EAAA,oBAAC,WAAM,MAAK,SAAQ,WAAU,0EAA0E,GAAG,OAAO;AAAA,EAClH;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAW;AAAA,MACX,WAAU;AAAA,IAAA;AAAA,EAAA;AACZ,EAAA,CACF;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { C as ControlButton } from "../../Button-
|
|
2
|
+
import { C as ControlButton } from "../../Button-CHzl5RaT.js";
|
|
3
3
|
import IconProvider, { iconFrame } from "./IconProvider.es.js";
|
|
4
|
-
import { L as LightTooltip, D as DarkTooltip } from "../../Tooltip-
|
|
4
|
+
import { L as LightTooltip, D as DarkTooltip, t as tooltipTrigger } from "../../Tooltip-D5E-qGtP.js";
|
|
5
5
|
import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
6
6
|
const controlSizeMap = {
|
|
7
7
|
default: "overflow",
|
|
@@ -22,7 +22,6 @@ function OverflowButton({
|
|
|
22
22
|
...props
|
|
23
23
|
}) {
|
|
24
24
|
const tooltipTitle = disabled ? disabledTooltip ?? tooltip : tooltip;
|
|
25
|
-
const TooltipComponent = disabled ? LightTooltip : DarkTooltip;
|
|
26
25
|
const accessibleName = ariaLabel ?? (typeof tooltipTitle === "string" ? tooltipTitle : "More actions");
|
|
27
26
|
const button = /* @__PURE__ */ jsx(
|
|
28
27
|
ControlButton,
|
|
@@ -55,7 +54,8 @@ function OverflowButton({
|
|
|
55
54
|
if (!tooltipTitle) {
|
|
56
55
|
return button;
|
|
57
56
|
}
|
|
58
|
-
|
|
57
|
+
const TooltipWrap = disabled ? LightTooltip : DarkTooltip;
|
|
58
|
+
return /* @__PURE__ */ jsx(TooltipWrap, { title: tooltipTitle, children: tooltipTrigger(disabled, button) });
|
|
59
59
|
}
|
|
60
60
|
export {
|
|
61
61
|
OverflowButton as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverflowButton.es.js","sources":["../../../src/components/atoms/OverflowButton.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nimport { ControlButton, type ControlButtonProps } from './Button'\nimport IconProvider, { iconFrame } from './IconProvider'\nimport { DarkTooltip, LightTooltip } from './Tooltip'\n\nexport type OverflowButtonVariant = 'ghost' | 'secondary'\nexport type OverflowButtonSize = 'default' | 'md'\n\nconst controlSizeMap = {\n default: 'overflow',\n md: 'overflow-md',\n} as const satisfies Record<OverflowButtonSize, NonNullable<ControlButtonProps['size']>>\n\nexport type OverflowButtonProps = Omit<React.ComponentProps<'button'>, 'children' | 'onClick'> & {\n ref?: React.Ref<HTMLButtonElement>\n variant?: OverflowButtonVariant\n size?: OverflowButtonSize\n open?: boolean\n tooltip?: React.ReactNode\n disabledTooltip?: React.ReactNode\n onClick?: React.MouseEventHandler<HTMLButtonElement>\n}\n\nfunction OverflowButton({\n ref,\n variant = 'ghost',\n size = 'default',\n open = false,\n disabled = false,\n tooltip = 'More actions',\n disabledTooltip,\n className,\n type = 'button',\n onClick,\n 'aria-label': ariaLabel,\n ...props\n}: OverflowButtonProps) {\n const tooltipTitle = disabled ? disabledTooltip ?? tooltip : tooltip\n const
|
|
1
|
+
{"version":3,"file":"OverflowButton.es.js","sources":["../../../src/components/atoms/OverflowButton.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nimport { ControlButton, type ControlButtonProps } from './Button'\nimport IconProvider, { iconFrame } from './IconProvider'\nimport { DarkTooltip, LightTooltip, tooltipTrigger } from './Tooltip'\n\nexport type OverflowButtonVariant = 'ghost' | 'secondary'\nexport type OverflowButtonSize = 'default' | 'md'\n\nconst controlSizeMap = {\n default: 'overflow',\n md: 'overflow-md',\n} as const satisfies Record<OverflowButtonSize, NonNullable<ControlButtonProps['size']>>\n\nexport type OverflowButtonProps = Omit<React.ComponentProps<'button'>, 'children' | 'onClick'> & {\n ref?: React.Ref<HTMLButtonElement>\n variant?: OverflowButtonVariant\n size?: OverflowButtonSize\n open?: boolean\n tooltip?: React.ReactNode\n disabledTooltip?: React.ReactNode\n onClick?: React.MouseEventHandler<HTMLButtonElement>\n}\n\nfunction OverflowButton({\n ref,\n variant = 'ghost',\n size = 'default',\n open = false,\n disabled = false,\n tooltip = 'More actions',\n disabledTooltip,\n className,\n type = 'button',\n onClick,\n 'aria-label': ariaLabel,\n ...props\n}: OverflowButtonProps) {\n const tooltipTitle = disabled ? disabledTooltip ?? tooltip : tooltip\n const accessibleName = ariaLabel ?? (typeof tooltipTitle === 'string' ? tooltipTitle : 'More actions')\n\n const button = (\n <ControlButton\n ref={ref}\n type=\"text\"\n htmlType={type}\n variant={variant}\n size={controlSizeMap[size]}\n disabled={disabled}\n onClick={onClick}\n aria-label={accessibleName}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n data-open={open || undefined}\n data-selected={(open && variant === 'secondary') || undefined}\n className={className}\n {...props}\n >\n <span\n data-slot=\"button-icon\"\n data-icon=\"ellipsis-vertical\"\n className={cn('inline-flex shrink-0 items-center justify-center', iconFrame['16'].frameClass)}\n >\n <IconProvider icon=\"ellipsis-vertical\" size={iconFrame['16'].glyph} />\n </span>\n </ControlButton>\n )\n\n if (!tooltipTitle) {\n return button\n }\n\n const TooltipWrap = disabled ? LightTooltip : DarkTooltip\n return <TooltipWrap title={tooltipTitle}>{tooltipTrigger(disabled, button)}</TooltipWrap>\n}\n\nexport default OverflowButton\n"],"names":["cn"],"mappings":";;;;;AAWA,MAAM,iBAAiB;AAAA,EACrB,SAAS;AAAA,EACT,IAAI;AACN;AAYA,SAAS,eAAe;AAAA,EACtB;AAAA,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP,OAAO;AAAA,EACP,WAAW;AAAA,EACX,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA,cAAc;AAAA,EACd,GAAG;AACL,GAAwB;AACtB,QAAM,eAAe,WAAW,mBAAmB,UAAU;AAC7D,QAAM,iBAAiB,cAAc,OAAO,iBAAiB,WAAW,eAAe;AAEvF,QAAM,SACJ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,MAAK;AAAA,MACL,UAAU;AAAA,MACV;AAAA,MACA,MAAM,eAAe,IAAI;AAAA,MACzB;AAAA,MACA;AAAA,MACA,cAAY;AAAA,MACZ,iBAAc;AAAA,MACd,iBAAe;AAAA,MACf,aAAW,QAAQ;AAAA,MACnB,iBAAgB,QAAQ,YAAY,eAAgB;AAAA,MACpD;AAAA,MACC,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,aAAU;AAAA,UACV,aAAU;AAAA,UACV,WAAWA,WAAG,oDAAoD,UAAU,IAAI,EAAE,UAAU;AAAA,UAE5F,UAAA,oBAAC,gBAAa,MAAK,qBAAoB,MAAM,UAAU,IAAI,EAAE,MAAA,CAAO;AAAA,QAAA;AAAA,MAAA;AAAA,IACtE;AAAA,EAAA;AAIJ,MAAI,CAAC,cAAc;AACjB,WAAO;AAAA,EACT;AAEA,QAAM,cAAc,WAAW,eAAe;AAC9C,6BAAQ,aAAA,EAAY,OAAO,cAAe,UAAA,eAAe,UAAU,MAAM,GAAE;AAC7E;"}
|
|
@@ -13,19 +13,19 @@ const progressTrackVariants = cva("relative w-full overflow-hidden rounded-pill
|
|
|
13
13
|
defaultVariants: { size: "sm" }
|
|
14
14
|
});
|
|
15
15
|
const toneClasses = {
|
|
16
|
-
brand: "bg-background-
|
|
17
|
-
success: "bg-background-
|
|
18
|
-
error: "bg-background-
|
|
16
|
+
brand: "bg-background-brand-bold",
|
|
17
|
+
success: "bg-status-background-success-bold",
|
|
18
|
+
error: "bg-status-background-error-bold"
|
|
19
19
|
};
|
|
20
20
|
const fillToneClasses = {
|
|
21
|
-
brand: "fill-background-
|
|
22
|
-
success: "fill-background-
|
|
23
|
-
error: "fill-background-
|
|
21
|
+
brand: "fill-background-brand-bold",
|
|
22
|
+
success: "fill-status-background-success-bold",
|
|
23
|
+
error: "fill-status-background-error-bold"
|
|
24
24
|
};
|
|
25
25
|
const strokeToneClasses = {
|
|
26
|
-
brand: "text-background-
|
|
27
|
-
success: "text-background-
|
|
28
|
-
error: "text-background-
|
|
26
|
+
brand: "text-background-brand-bold",
|
|
27
|
+
success: "text-status-background-success-bold",
|
|
28
|
+
error: "text-status-background-error-bold"
|
|
29
29
|
};
|
|
30
30
|
function clampValue(value) {
|
|
31
31
|
return Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : 0;
|
|
@@ -250,8 +250,8 @@ function ProgressField({
|
|
|
250
250
|
className: classNames(
|
|
251
251
|
"flex items-start gap-space-4 text-body-sm",
|
|
252
252
|
state === "default" && "text-text-secondary",
|
|
253
|
-
state === "success" && "text-text-success",
|
|
254
|
-
state === "error" && "text-text-error"
|
|
253
|
+
state === "success" && "text-status-text-success",
|
|
254
|
+
state === "error" && "text-status-text-error"
|
|
255
255
|
),
|
|
256
256
|
children: [
|
|
257
257
|
state !== "default" ? /* @__PURE__ */ jsx(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.es.js","sources":["../../../src/components/atoms/Progress.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '@/lib/utils'\n\nimport IconProvider from './IconProvider'\n\nexport type ProgressTone = 'brand' | 'success' | 'error'\nexport type ProgressSize = 'sm' | 'md'\n\nconst progressTrackVariants = cva('relative w-full overflow-hidden rounded-pill bg-border-subtle', {\n variants: {\n size: {\n sm: 'h-1',\n md: 'h-2',\n },\n },\n defaultVariants: { size: 'sm' },\n})\n\nconst toneClasses: Record<ProgressTone, string> = {\n brand: 'bg-background-fill-brand',\n success: 'bg-background-fill-success',\n error: 'bg-background-fill-error',\n}\n\nconst fillToneClasses: Record<ProgressTone, string> = {\n brand: 'fill-background-fill-brand',\n success: 'fill-background-fill-success',\n error: 'fill-background-fill-error',\n}\n\nconst strokeToneClasses: Record<ProgressTone, string> = {\n brand: 'text-background-fill-brand',\n success: 'text-background-fill-success',\n error: 'text-background-fill-error',\n}\n\nfunction clampValue(value: number): number {\n return Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : 0\n}\n\nexport type ProgressProps = Omit<React.ComponentProps<'div'>, 'children'> &\n VariantProps<typeof progressTrackVariants> & {\n ref?: React.Ref<HTMLDivElement>\n value?: number\n loading?: boolean\n tone?: ProgressTone\n label?: string\n }\n\nexport function Progress({\n ref,\n className,\n value = 25,\n loading = false,\n tone = 'brand',\n size = 'sm',\n label = 'Progress',\n ...props\n}: ProgressProps) {\n const clampedValue = clampValue(value)\n const indicatorRadius = size === 'md' ? 4 : 2\n\n return (\n <div\n ref={ref}\n data-slot=\"progress\"\n role=\"progressbar\"\n aria-label={label}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={loading ? undefined : clampedValue}\n className={cn(progressTrackVariants({ size }), className)}\n {...props}\n >\n {loading ? (\n <>\n <svg aria-hidden className=\"absolute inset-0 size-full overflow-visible motion-reduce:hidden\">\n <rect\n data-slot=\"progress-indicator\"\n x=\"-40%\"\n width=\"40%\"\n height=\"100%\"\n rx={indicatorRadius}\n className={fillToneClasses[tone]}\n >\n <animate attributeName=\"x\" values=\"-40%;100%\" dur=\"1.5s\" repeatCount=\"indefinite\" />\n </rect>\n </svg>\n <span\n data-slot=\"progress-indicator\"\n className={cn(\n 'absolute inset-y-0 left-[30%] right-[30%] hidden rounded-pill motion-reduce:block',\n toneClasses[tone],\n )}\n />\n </>\n ) : (\n <svg aria-hidden className=\"absolute inset-0 size-full\">\n <rect\n data-slot=\"progress-indicator\"\n width={`${clampedValue}%`}\n height=\"100%\"\n rx={indicatorRadius}\n className={fillToneClasses[tone]}\n />\n </svg>\n )}\n </div>\n )\n}\n\nexport type ProgressCircleSize = 'sm' | 'md' | 'lg'\n\nconst circleSizeClasses: Record<ProgressCircleSize, string> = {\n sm: 'size-[var(--size-24)]',\n md: 'size-[var(--size-40)]',\n lg: 'size-[var(--size-64)]',\n}\n\nexport interface ProgressCircleProps extends Omit<React.ComponentProps<'div'>, 'children'> {\n ref?: React.Ref<HTMLDivElement>\n value?: number\n loading?: boolean\n tone?: ProgressTone\n size?: ProgressCircleSize\n showValue?: boolean\n label?: string\n}\n\nexport function ProgressCircle({\n ref,\n className,\n value = 50,\n loading = false,\n tone = 'brand',\n size = 'sm',\n showValue = true,\n label = 'Progress',\n ...props\n}: ProgressCircleProps) {\n const clampedValue = clampValue(value)\n const strokeWidth = size === 'lg' ? 4 : 3\n\n return (\n <div\n ref={ref}\n data-slot=\"progress-circle\"\n role=\"progressbar\"\n aria-label={label}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={loading ? undefined : clampedValue}\n className={cn('relative shrink-0', circleSizeClasses[size], strokeToneClasses[tone], className)}\n {...props}\n >\n <svg\n aria-hidden\n viewBox=\"0 0 36 36\"\n className={cn('size-full -rotate-90', loading && 'motion-safe:animate-spin')}\n >\n <circle cx=\"18\" cy=\"18\" r=\"16\" fill=\"none\" strokeWidth={strokeWidth} className=\"stroke-border-subtle\" />\n <circle\n cx=\"18\"\n cy=\"18\"\n r=\"16\"\n fill=\"none\"\n pathLength=\"100\"\n stroke=\"currentColor\"\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeDasharray={loading ? '25 75' : '100'}\n strokeDashoffset={loading ? 0 : 100 - clampedValue}\n />\n </svg>\n {size === 'lg' && showValue && !loading ? (\n <span\n data-slot=\"progress-circle-value\"\n className=\"absolute inset-0 flex items-center justify-center text-label-md text-text-primary\"\n >\n {clampedValue}%\n </span>\n ) : null}\n </div>\n )\n}\n\nexport interface ProgressStepsProps extends Omit<React.ComponentProps<'div'>, 'children'> {\n ref?: React.Ref<HTMLDivElement>\n segments?: 3 | 4 | 5\n completed?: number\n tone?: ProgressTone\n size?: ProgressSize\n label?: string\n}\n\nexport function ProgressSteps({\n ref,\n className,\n segments = 3,\n completed = 1,\n tone = 'brand',\n size = 'sm',\n label = 'Progress steps',\n ...props\n}: ProgressStepsProps) {\n const normalizedCompleted = Math.min(segments, Math.max(0, completed))\n\n return (\n <div\n ref={ref}\n data-slot=\"progress-steps\"\n role=\"progressbar\"\n aria-label={label}\n aria-valuemin={0}\n aria-valuemax={segments}\n aria-valuenow={normalizedCompleted}\n className={cn('flex w-full gap-space-4', size === 'md' ? 'h-2' : 'h-1', className)}\n {...props}\n >\n {Array.from({ length: segments }, (_, index) => (\n <span\n key={index}\n data-slot=\"progress-step\"\n data-complete={index < normalizedCompleted || undefined}\n className={cn(\n 'h-full min-w-px flex-1 rounded-pill',\n index < normalizedCompleted ? toneClasses[tone] : 'bg-border-subtle',\n )}\n />\n ))}\n </div>\n )\n}\n\nexport type ProgressFieldState = 'default' | 'success' | 'error'\n\nexport interface ProgressFieldProps extends Omit<React.ComponentProps<'div'>, 'children'> {\n ref?: React.Ref<HTMLDivElement>\n value?: number\n loading?: boolean\n state?: ProgressFieldState\n label: React.ReactNode\n message?: React.ReactNode\n showValue?: boolean\n size?: ProgressSize\n}\n\nexport function ProgressField({\n ref,\n className,\n value = 50,\n loading = false,\n state = 'default',\n label,\n message,\n showValue = true,\n size = 'md',\n ...props\n}: ProgressFieldProps) {\n const tone = state === 'default' ? 'brand' : state\n const clampedValue = clampValue(value)\n const messageId = React.useId()\n\n return (\n <div\n ref={ref}\n data-slot=\"progress-field\"\n data-state={state}\n className={cn('flex w-full flex-col gap-space-6', className)}\n {...props}\n >\n <div data-slot=\"progress-field-header\" className=\"flex items-center justify-between gap-space-8\">\n <span className=\"min-w-0 text-label-md text-text-primary\">{label}</span>\n {showValue && !loading ? (\n <span className=\"shrink-0 text-body-sm text-text-secondary\">{clampedValue}%</span>\n ) : null}\n </div>\n <Progress\n value={value}\n loading={loading}\n tone={tone}\n size={size}\n label={typeof label === 'string' ? label : 'Progress'}\n aria-describedby={message ? messageId : undefined}\n />\n {message ? (\n <div\n id={messageId}\n data-slot=\"progress-field-message\"\n className={cn(\n 'flex items-start gap-space-4 text-body-sm',\n state === 'default' && 'text-text-secondary',\n state === 'success' && 'text-text-success',\n state === 'error' && 'text-text-error',\n )}\n >\n {state !== 'default' ? (\n <IconProvider\n icon={state === 'success' ? 'check-circle' : 'circle-xmark'}\n className=\"mt-0.5 size-3 shrink-0\"\n />\n ) : null}\n <span>{message}</span>\n </div>\n ) : null}\n </div>\n )\n}\n\nexport default Progress\n"],"names":["cn"],"mappings":";;;;;AAUA,MAAM,wBAAwB,IAAI,iEAAiE;AAAA,EACjG,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,iBAAiB,EAAE,MAAM,KAAA;AAC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AAiB;AAAA,kBAC7C,WAAU;AAAA,gBAAA;AAAA,cAAA,IAEV;AAAA,cACJ,oBAAC,UAAM,UAAA,QAAA,CAAQ;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA,IAEf;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
1
|
+
{"version":3,"file":"Progress.es.js","sources":["../../../src/components/atoms/Progress.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '@/lib/utils'\n\nimport IconProvider from './IconProvider'\n\nexport type ProgressTone = 'brand' | 'success' | 'error'\nexport type ProgressSize = 'sm' | 'md'\n\nconst progressTrackVariants = cva('relative w-full overflow-hidden rounded-pill bg-border-subtle', {\n variants: {\n size: {\n sm: 'h-1',\n md: 'h-2',\n },\n },\n defaultVariants: { size: 'sm' },\n})\n\nconst toneClasses: Record<ProgressTone, string> = {\n brand: 'bg-background-brand-bold',\n success: 'bg-status-background-success-bold',\n error: 'bg-status-background-error-bold',\n}\n\nconst fillToneClasses: Record<ProgressTone, string> = {\n brand: 'fill-background-brand-bold',\n success: 'fill-status-background-success-bold',\n error: 'fill-status-background-error-bold',\n}\n\nconst strokeToneClasses: Record<ProgressTone, string> = {\n brand: 'text-background-brand-bold',\n success: 'text-status-background-success-bold',\n error: 'text-status-background-error-bold',\n}\n\nfunction clampValue(value: number): number {\n return Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : 0\n}\n\nexport type ProgressProps = Omit<React.ComponentProps<'div'>, 'children'> &\n VariantProps<typeof progressTrackVariants> & {\n ref?: React.Ref<HTMLDivElement>\n value?: number\n loading?: boolean\n tone?: ProgressTone\n label?: string\n }\n\nexport function Progress({\n ref,\n className,\n value = 25,\n loading = false,\n tone = 'brand',\n size = 'sm',\n label = 'Progress',\n ...props\n}: ProgressProps) {\n const clampedValue = clampValue(value)\n const indicatorRadius = size === 'md' ? 4 : 2\n\n return (\n <div\n ref={ref}\n data-slot=\"progress\"\n role=\"progressbar\"\n aria-label={label}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={loading ? undefined : clampedValue}\n className={cn(progressTrackVariants({ size }), className)}\n {...props}\n >\n {loading ? (\n <>\n <svg aria-hidden className=\"absolute inset-0 size-full overflow-visible motion-reduce:hidden\">\n <rect\n data-slot=\"progress-indicator\"\n x=\"-40%\"\n width=\"40%\"\n height=\"100%\"\n rx={indicatorRadius}\n className={fillToneClasses[tone]}\n >\n <animate attributeName=\"x\" values=\"-40%;100%\" dur=\"1.5s\" repeatCount=\"indefinite\" />\n </rect>\n </svg>\n <span\n data-slot=\"progress-indicator\"\n className={cn(\n 'absolute inset-y-0 left-[30%] right-[30%] hidden rounded-pill motion-reduce:block',\n toneClasses[tone],\n )}\n />\n </>\n ) : (\n <svg aria-hidden className=\"absolute inset-0 size-full\">\n <rect\n data-slot=\"progress-indicator\"\n width={`${clampedValue}%`}\n height=\"100%\"\n rx={indicatorRadius}\n className={fillToneClasses[tone]}\n />\n </svg>\n )}\n </div>\n )\n}\n\nexport type ProgressCircleSize = 'sm' | 'md' | 'lg'\n\nconst circleSizeClasses: Record<ProgressCircleSize, string> = {\n sm: 'size-[var(--size-24)]',\n md: 'size-[var(--size-40)]',\n lg: 'size-[var(--size-64)]',\n}\n\nexport interface ProgressCircleProps extends Omit<React.ComponentProps<'div'>, 'children'> {\n ref?: React.Ref<HTMLDivElement>\n value?: number\n loading?: boolean\n tone?: ProgressTone\n size?: ProgressCircleSize\n showValue?: boolean\n label?: string\n}\n\nexport function ProgressCircle({\n ref,\n className,\n value = 50,\n loading = false,\n tone = 'brand',\n size = 'sm',\n showValue = true,\n label = 'Progress',\n ...props\n}: ProgressCircleProps) {\n const clampedValue = clampValue(value)\n const strokeWidth = size === 'lg' ? 4 : 3\n\n return (\n <div\n ref={ref}\n data-slot=\"progress-circle\"\n role=\"progressbar\"\n aria-label={label}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={loading ? undefined : clampedValue}\n className={cn('relative shrink-0', circleSizeClasses[size], strokeToneClasses[tone], className)}\n {...props}\n >\n <svg\n aria-hidden\n viewBox=\"0 0 36 36\"\n className={cn('size-full -rotate-90', loading && 'motion-safe:animate-spin')}\n >\n <circle cx=\"18\" cy=\"18\" r=\"16\" fill=\"none\" strokeWidth={strokeWidth} className=\"stroke-border-subtle\" />\n <circle\n cx=\"18\"\n cy=\"18\"\n r=\"16\"\n fill=\"none\"\n pathLength=\"100\"\n stroke=\"currentColor\"\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeDasharray={loading ? '25 75' : '100'}\n strokeDashoffset={loading ? 0 : 100 - clampedValue}\n />\n </svg>\n {size === 'lg' && showValue && !loading ? (\n <span\n data-slot=\"progress-circle-value\"\n className=\"absolute inset-0 flex items-center justify-center text-label-md text-text-primary\"\n >\n {clampedValue}%\n </span>\n ) : null}\n </div>\n )\n}\n\nexport interface ProgressStepsProps extends Omit<React.ComponentProps<'div'>, 'children'> {\n ref?: React.Ref<HTMLDivElement>\n segments?: 3 | 4 | 5\n completed?: number\n tone?: ProgressTone\n size?: ProgressSize\n label?: string\n}\n\nexport function ProgressSteps({\n ref,\n className,\n segments = 3,\n completed = 1,\n tone = 'brand',\n size = 'sm',\n label = 'Progress steps',\n ...props\n}: ProgressStepsProps) {\n const normalizedCompleted = Math.min(segments, Math.max(0, completed))\n\n return (\n <div\n ref={ref}\n data-slot=\"progress-steps\"\n role=\"progressbar\"\n aria-label={label}\n aria-valuemin={0}\n aria-valuemax={segments}\n aria-valuenow={normalizedCompleted}\n className={cn('flex w-full gap-space-4', size === 'md' ? 'h-2' : 'h-1', className)}\n {...props}\n >\n {Array.from({ length: segments }, (_, index) => (\n <span\n key={index}\n data-slot=\"progress-step\"\n data-complete={index < normalizedCompleted || undefined}\n className={cn(\n 'h-full min-w-px flex-1 rounded-pill',\n index < normalizedCompleted ? toneClasses[tone] : 'bg-border-subtle',\n )}\n />\n ))}\n </div>\n )\n}\n\nexport type ProgressFieldState = 'default' | 'success' | 'error'\n\nexport interface ProgressFieldProps extends Omit<React.ComponentProps<'div'>, 'children'> {\n ref?: React.Ref<HTMLDivElement>\n value?: number\n loading?: boolean\n state?: ProgressFieldState\n label: React.ReactNode\n message?: React.ReactNode\n showValue?: boolean\n size?: ProgressSize\n}\n\nexport function ProgressField({\n ref,\n className,\n value = 50,\n loading = false,\n state = 'default',\n label,\n message,\n showValue = true,\n size = 'md',\n ...props\n}: ProgressFieldProps) {\n const tone = state === 'default' ? 'brand' : state\n const clampedValue = clampValue(value)\n const messageId = React.useId()\n\n return (\n <div\n ref={ref}\n data-slot=\"progress-field\"\n data-state={state}\n className={cn('flex w-full flex-col gap-space-6', className)}\n {...props}\n >\n <div data-slot=\"progress-field-header\" className=\"flex items-center justify-between gap-space-8\">\n <span className=\"min-w-0 text-label-md text-text-primary\">{label}</span>\n {showValue && !loading ? (\n <span className=\"shrink-0 text-body-sm text-text-secondary\">{clampedValue}%</span>\n ) : null}\n </div>\n <Progress\n value={value}\n loading={loading}\n tone={tone}\n size={size}\n label={typeof label === 'string' ? label : 'Progress'}\n aria-describedby={message ? messageId : undefined}\n />\n {message ? (\n <div\n id={messageId}\n data-slot=\"progress-field-message\"\n className={cn(\n 'flex items-start gap-space-4 text-body-sm',\n state === 'default' && 'text-text-secondary',\n state === 'success' && 'text-status-text-success',\n state === 'error' && 'text-status-text-error',\n )}\n >\n {state !== 'default' ? (\n <IconProvider\n icon={state === 'success' ? 'check-circle' : 'circle-xmark'}\n className=\"mt-0.5 size-3 shrink-0\"\n />\n ) : null}\n <span>{message}</span>\n </div>\n ) : null}\n </div>\n )\n}\n\nexport default Progress\n"],"names":["cn"],"mappings":";;;;;AAUA,MAAM,wBAAwB,IAAI,iEAAiE;AAAA,EACjG,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,iBAAiB,EAAE,MAAM,KAAA;AAC3B,CAAC;AAED,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AC7C,WAAU;AAAA,gBAAA;AAAA,cAAA,IAEV;AAAA,cACJ,oBAAC,UAAM,UAAA,QAAA,CAAQ;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA,IAEf;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
3
3
|
function SkeletonBar({ className, ...props }) {
|
|
4
|
-
return /* @__PURE__ */ jsx(
|
|
5
|
-
"div",
|
|
6
|
-
{
|
|
7
|
-
"data-slot": "skeleton",
|
|
8
|
-
className: classNames("animate-pulse rounded-md bg-background-surface-sunken", className),
|
|
9
|
-
...props
|
|
10
|
-
}
|
|
11
|
-
);
|
|
4
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "skeleton", className: classNames("animate-pulse rounded-md bg-background-sunken", className), ...props });
|
|
12
5
|
}
|
|
13
6
|
const Skeleton = ({
|
|
14
7
|
variant = "rectangular",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.es.js","sources":["../../../src/components/atoms/Skeleton.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nfunction SkeletonBar({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div
|
|
1
|
+
{"version":3,"file":"Skeleton.es.js","sources":["../../../src/components/atoms/Skeleton.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nfunction SkeletonBar({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div data-slot=\"skeleton\" className={cn('animate-pulse rounded-md bg-background-sunken', className)} {...props} />\n )\n}\n\n/** Legacy MUI Skeleton props used by ImagesPreview and similar. */\nexport type LegacySkeletonProps = Omit<React.ComponentProps<'div'>, 'children'> & {\n variant?: 'rectangular' | 'circular' | 'text'\n animation?: 'wave' | 'pulse' | false\n width?: number | string\n height?: number | string\n}\n\nconst Skeleton: React.FC<LegacySkeletonProps> = ({\n variant = 'rectangular',\n animation = 'wave',\n width,\n height,\n className,\n style,\n ...props\n}) => {\n return (\n <SkeletonBar\n className={cn(\n variant === 'circular' && 'rounded-full',\n variant === 'text' && 'h-4 w-full',\n animation === false && 'animate-none',\n className,\n )}\n style={{ width, height, ...style }}\n {...props}\n />\n )\n}\n\nexport default Skeleton\n"],"names":["cn"],"mappings":";;AAIA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;AACzE,SACE,oBAAC,OAAA,EAAI,aAAU,YAAW,WAAWA,WAAG,iDAAiD,SAAS,GAAI,GAAG,MAAA,CAAO;AAEpH;AAUA,MAAM,WAA0C,CAAC;AAAA,EAC/C,UAAU;AAAA,EACV,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWA;AAAAA,QACT,YAAY,cAAc;AAAA,QAC1B,YAAY,UAAU;AAAA,QACtB,cAAc,SAAS;AAAA,QACvB;AAAA,MAAA;AAAA,MAEF,OAAO,EAAE,OAAO,QAAQ,GAAG,MAAA;AAAA,MAC1B,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -4,15 +4,15 @@ import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
|
4
4
|
const spinnerVariants = cva("", {
|
|
5
5
|
variants: {
|
|
6
6
|
size: {
|
|
7
|
-
sm: "size-[var(--size-12)]",
|
|
7
|
+
sm: "size-[var(--icon-size-12)]",
|
|
8
8
|
md: "size-[var(--size-16)]",
|
|
9
9
|
lg: "size-[var(--size-20)]",
|
|
10
10
|
xl: "size-[var(--size-24)]"
|
|
11
11
|
},
|
|
12
12
|
tone: {
|
|
13
|
-
brand: "text-background-
|
|
13
|
+
brand: "text-background-brand-bold",
|
|
14
14
|
neutral: "text-icon-secondary",
|
|
15
|
-
inverse: "text-icon-inverse"
|
|
15
|
+
inverse: "text-icon-on-inverse"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
defaultVariants: { size: "md", tone: "brand" }
|
|
@@ -51,7 +51,7 @@ function SpinnerMark({
|
|
|
51
51
|
className: classNames(
|
|
52
52
|
"absolute inset-0 rounded-full",
|
|
53
53
|
spinnerStrokeVariants({ size }),
|
|
54
|
-
tone === "inverse" ? "border-icon-inverse opacity-[0.24]" : "border-border-subtle"
|
|
54
|
+
tone === "inverse" ? "border-icon-on-inverse opacity-[0.24]" : "border-border-subtle"
|
|
55
55
|
)
|
|
56
56
|
}
|
|
57
57
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner.es.js","sources":["../../../src/components/atoms/Spinner.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '@/lib/utils'\n\nconst spinnerVariants = cva('', {\n variants: {\n size: {\n sm: 'size-[var(--size-12)]',\n md: 'size-[var(--size-16)]',\n lg: 'size-[var(--size-20)]',\n xl: 'size-[var(--size-24)]',\n },\n tone: {\n brand: 'text-background-
|
|
1
|
+
{"version":3,"file":"Spinner.es.js","sources":["../../../src/components/atoms/Spinner.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '@/lib/utils'\n\nconst spinnerVariants = cva('', {\n variants: {\n size: {\n sm: 'size-[var(--icon-size-12)]',\n md: 'size-[var(--size-16)]',\n lg: 'size-[var(--size-20)]',\n xl: 'size-[var(--size-24)]',\n },\n tone: {\n brand: 'text-background-brand-bold',\n neutral: 'text-icon-secondary',\n inverse: 'text-icon-on-inverse',\n },\n },\n defaultVariants: { size: 'md', tone: 'brand' },\n})\n\nconst spinnerStrokeVariants = cva('border-solid', {\n variants: {\n size: {\n sm: 'border-[0.09375rem]',\n md: 'border-2',\n lg: 'border-[0.15625rem]',\n xl: 'border-[0.1875rem]',\n },\n },\n defaultVariants: { size: 'md' },\n})\n\nexport type SpinnerSize = NonNullable<VariantProps<typeof spinnerVariants>['size']>\nexport type SpinnerTone = NonNullable<VariantProps<typeof spinnerVariants>['tone']>\n\nexport function SpinnerMark({\n className,\n size,\n tone,\n ...props\n}: React.ComponentProps<'span'> & VariantProps<typeof spinnerVariants>) {\n return (\n <span\n data-slot=\"spinner\"\n role=\"status\"\n aria-label=\"Loading\"\n className={cn('relative inline-block shrink-0', spinnerVariants({ size, tone }), className)}\n {...props}\n >\n <span\n data-slot=\"spinner-track\"\n aria-hidden\n className={cn(\n 'absolute inset-0 rounded-full',\n spinnerStrokeVariants({ size }),\n tone === 'inverse' ? 'border-icon-on-inverse opacity-[0.24]' : 'border-border-subtle',\n )}\n />\n <span\n data-slot=\"spinner-indicator\"\n aria-hidden\n className={cn(\n 'absolute inset-0 animate-spin rounded-full border-transparent border-r-current border-t-current motion-reduce:animate-none',\n spinnerStrokeVariants({ size }),\n )}\n />\n </span>\n )\n}\n\nexport interface SpinnerProps extends Omit<React.ComponentProps<'span'>, 'children'> {\n ref?: React.Ref<HTMLSpanElement>\n size?: SpinnerSize\n tone?: SpinnerTone\n small?: boolean\n big?: boolean\n medium?: boolean\n center?: boolean\n type?: 'normal'\n}\n\n/** Legacy flags map onto the nearest Figma size; prefer the size prop. */\nfunction Spinner({ ref, className, size, tone = 'brand', small, big, medium, center, ...props }: SpinnerProps) {\n const resolvedSize = size ?? (big || medium ? 'xl' : small ? 'md' : 'xl')\n\n return (\n <SpinnerMark\n ref={ref}\n size={resolvedSize}\n tone={tone}\n className={cn(center && 'mx-auto block', className)}\n {...props}\n />\n )\n}\n\nexport default Spinner\n"],"names":["cn"],"mappings":";;;AAKA,MAAM,kBAAkB,IAAI,IAAI;AAAA,EAC9B,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,IAEN,MAAM;AAAA,M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AA,MACC;AAAA,MACA,MAAM;AAAA,MACN;AAAA,MACA,WAAWA,WAAG,UAAU,iBAAiB,SAAS;AAAA,MACjD,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
3
|
import { Switch as SwitchPrimitive } from '@base-ui/react/switch';
|
|
4
|
+
export declare const switchVariants: (props?: ({
|
|
5
|
+
size?: "default" | "sm" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
type SwitchControlProps = Omit<SwitchPrimitive.Root.Props, 'size'> & VariantProps<typeof switchVariants> & {
|
|
8
|
+
invalid?: boolean;
|
|
9
|
+
};
|
|
3
10
|
/** Legacy MUI Switch styled props — mapped to atoms Switch (Base UI). */
|
|
4
|
-
export interface StyledSwitchProps extends Omit<
|
|
11
|
+
export interface StyledSwitchProps extends Omit<SwitchControlProps, 'onCheckedChange' | 'onChange'> {
|
|
5
12
|
/**
|
|
6
13
|
* Legacy MUI hidden-input attributes. `id`, `name`, `value`, `required`, `aria-*`, and `data-test`
|
|
7
14
|
* are forwarded to the Base UI root (Base UI renders a hidden form input when `name` is set).
|
|
@@ -20,5 +27,6 @@ export interface StyledSwitchProps extends Omit<SwitchPrimitive.Root.Props, 'onC
|
|
|
20
27
|
/** Legacy MUI-style change handler */
|
|
21
28
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
|
|
22
29
|
}
|
|
23
|
-
|
|
30
|
+
export type SwitchProps = StyledSwitchProps;
|
|
31
|
+
declare function Switch({ inputProps, widthMultiple: _w, heightMultiple: _h, thumbWidthMultiple: _t, onChange, onCheckedChange, ...props }: SwitchProps): React.JSX.Element;
|
|
24
32
|
export default Switch;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c as cva } from "../../index-DSVg79g-.js";
|
|
2
3
|
import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
3
4
|
import * as React from "react";
|
|
4
5
|
import { u as useControlled } from "../../useControlled-BSyYkg5C.js";
|
|
@@ -223,27 +224,48 @@ const SwitchThumb = /* @__PURE__ */ React.forwardRef(function SwitchThumb2(compo
|
|
|
223
224
|
});
|
|
224
225
|
});
|
|
225
226
|
if (process.env.NODE_ENV !== "production") SwitchThumb.displayName = "SwitchThumb";
|
|
226
|
-
|
|
227
|
+
const switchVariants = cva(
|
|
228
|
+
'group relative inline-flex shrink-0 cursor-pointer items-center rounded-pill border border-border-subtle bg-background-input p-px focus-ring transition-[background-color,border-color] duration-150 ease-out after:absolute after:inset-x-0 after:content-[""] hover:border-border-default data-checked:border-transparent data-checked:bg-background-brand-bold data-checked:hover:bg-background-brand-bold-selected dark:data-checked:hover:bg-background-brand-bold-hover data-disabled:cursor-not-allowed data-disabled:opacity-(--opacity-disabled) data-disabled:hover:border-border-subtle data-disabled:data-checked:hover:bg-background-brand-bold data-invalid:border-status-border-error-bold data-invalid:bg-status-background-error data-invalid:hover:border-status-border-error-bold data-invalid:data-checked:bg-status-background-error-bold data-invalid:data-checked:hover:bg-status-background-error-bold motion-reduce:transition-none',
|
|
229
|
+
{
|
|
230
|
+
variants: {
|
|
231
|
+
size: {
|
|
232
|
+
sm: "h-3.5 w-6",
|
|
233
|
+
default: "h-4 w-8 after:-inset-y-1"
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
defaultVariants: {
|
|
237
|
+
size: "default"
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
);
|
|
241
|
+
const switchThumbVariants = cva(
|
|
242
|
+
"pointer-events-none block translate-x-0 rounded-pill bg-icon-on-bold shadow-elevation-2 transition-[translate,box-shadow] duration-150 ease-out group-hover:data-unchecked:shadow-elevation-1 group-data-disabled:data-unchecked:shadow-elevation-2 motion-reduce:transition-none",
|
|
243
|
+
{
|
|
244
|
+
variants: {
|
|
245
|
+
size: {
|
|
246
|
+
sm: "size-2.5 data-checked:translate-x-2.5",
|
|
247
|
+
default: "size-3 data-checked:translate-x-4"
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
defaultVariants: {
|
|
251
|
+
size: "default"
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
);
|
|
255
|
+
function SwitchControl({ className, invalid, size, ...props }) {
|
|
227
256
|
return /* @__PURE__ */ jsx(
|
|
228
257
|
SwitchRoot,
|
|
229
258
|
{
|
|
230
259
|
"data-slot": "switch",
|
|
231
|
-
className: classNames(
|
|
232
|
-
"peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-border-default bg-background-surface-sunken transition-colors focus-ring data-checked:border-border-brand-bold data-checked:bg-primary data-disabled:cursor-not-allowed data-disabled:opacity-50",
|
|
233
|
-
className
|
|
234
|
-
),
|
|
235
260
|
...props,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
className: "pointer-events-none block size-4 translate-x-0.5 rounded-full bg-background-surface-raised shadow-sm transition-transform data-checked:translate-x-4"
|
|
241
|
-
}
|
|
242
|
-
)
|
|
261
|
+
"aria-invalid": invalid || props["aria-invalid"] || void 0,
|
|
262
|
+
"data-invalid": invalid ? "" : void 0,
|
|
263
|
+
className: classNames(switchVariants({ size }), className),
|
|
264
|
+
children: /* @__PURE__ */ jsx(SwitchThumb, { "data-slot": "switch-thumb", className: switchThumbVariants({ size }) })
|
|
243
265
|
}
|
|
244
266
|
);
|
|
245
267
|
}
|
|
246
|
-
|
|
268
|
+
function Switch({
|
|
247
269
|
inputProps,
|
|
248
270
|
widthMultiple: _w,
|
|
249
271
|
heightMultiple: _h,
|
|
@@ -251,7 +273,7 @@ const Switch = ({
|
|
|
251
273
|
onChange,
|
|
252
274
|
onCheckedChange,
|
|
253
275
|
...props
|
|
254
|
-
})
|
|
276
|
+
}) {
|
|
255
277
|
const {
|
|
256
278
|
id,
|
|
257
279
|
name,
|
|
@@ -293,8 +315,9 @@ const Switch = ({
|
|
|
293
315
|
}
|
|
294
316
|
}
|
|
295
317
|
);
|
|
296
|
-
}
|
|
318
|
+
}
|
|
297
319
|
export {
|
|
298
|
-
Switch as default
|
|
320
|
+
Switch as default,
|
|
321
|
+
switchVariants
|
|
299
322
|
};
|
|
300
323
|
//# sourceMappingURL=Switch.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.es.js","sources":["../../../node_modules/@base-ui/react/switch/root/SwitchRootContext.mjs","../../../node_modules/@base-ui/react/switch/root/SwitchRootDataAttributes.mjs","../../../node_modules/@base-ui/react/switch/stateAttributesMapping.mjs","../../../node_modules/@base-ui/react/switch/root/SwitchRoot.mjs","../../../node_modules/@base-ui/react/switch/thumb/SwitchThumb.mjs","../../../src/components/atoms/Switch.tsx"],"sourcesContent":["'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SwitchRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SwitchRootContext.displayName = \"SwitchRootContext\";\nexport function useSwitchRootContext() {\n const context = React.useContext(SwitchRootContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>.' : _formatErrorMessage(63));\n }\n return context;\n}","/**\n * Present when the switch is checked.\n */\nexport const checked = 'data-checked';\n/**\n * Present when the switch is not checked.\n */\nexport const unchecked = 'data-unchecked';\n/**\n * Present when the switch is disabled.\n */\nexport const disabled = 'data-disabled';\n/**\n * Present when the switch is readonly.\n */\nexport const readonly = 'data-readonly';\n/**\n * Present when the switch is required.\n */\nexport const required = 'data-required';\n/**\n * Present when the switch is in a valid state (when wrapped in Field.Root).\n */\nexport const valid = 'data-valid';\n/**\n * Present when the switch is in an invalid state (when wrapped in Field.Root).\n */\nexport const invalid = 'data-invalid';\n/**\n * Present when the switch has been touched (when wrapped in Field.Root).\n */\nexport const touched = 'data-touched';\n/**\n * Present when the switch's value has changed (when wrapped in Field.Root).\n */\nexport const dirty = 'data-dirty';\n/**\n * Present when the switch is active (when wrapped in Field.Root).\n */\nexport const filled = 'data-filled';\n/**\n * Present when the switch is focused (when wrapped in Field.Root).\n */\nexport const focused = 'data-focused';","import { fieldValidityMapping } from \"../internals/field-constants/constants.mjs\";\nimport * as SwitchRootDataAttributes from \"./root/SwitchRootDataAttributes.mjs\";\nexport const stateAttributesMapping = {\n ...fieldValidityMapping,\n checked(value) {\n if (value) {\n return {\n [SwitchRootDataAttributes.checked]: ''\n };\n }\n return {\n [SwitchRootDataAttributes.unchecked]: ''\n };\n }\n};","'use client';\n\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { visuallyHidden, visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { SwitchRootContext } from \"./SwitchRootContext.mjs\";\nimport { stateAttributesMapping } from \"../stateAttributesMapping.mjs\";\nimport { dispatchClickWithModifiers } from \"../../utils/dispatchClickWithModifiers.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useSetFieldFocused } from \"../../internals/field-root-context/useSetFieldFocused.mjs\";\nimport { useRegisterFieldControl } from \"../../internals/field-register-control/useRegisterFieldControl.mjs\";\nimport { useFormContext } from \"../../internals/form-context/FormContext.mjs\";\nimport { useLabelableContext } from \"../../internals/labelable-provider/LabelableContext.mjs\";\nimport { useAriaLabelledBy } from \"../../internals/labelable-provider/useAriaLabelledBy.mjs\";\nimport { useLabelableId } from \"../../internals/labelable-provider/useLabelableId.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useValueChanged } from \"../../internals/useValueChanged.mjs\";\n\n/**\n * Represents the switch itself.\n * Renders a `<span>` element and a hidden `<input>` beside.\n *\n * Documentation: [Base UI Switch](https://base-ui.com/react/components/switch)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const SwitchRoot = /*#__PURE__*/React.forwardRef(function SwitchRoot(componentProps, forwardedRef) {\n const {\n checked: checkedProp,\n className,\n defaultChecked,\n 'aria-labelledby': ariaLabelledByProp,\n form,\n id: idProp,\n inputRef: externalInputRef,\n name: nameProp,\n nativeButton = false,\n onCheckedChange,\n readOnly = false,\n required = false,\n disabled: disabledProp = false,\n render,\n uncheckedValue,\n value,\n style,\n ...elementProps\n } = componentProps;\n const {\n clearErrors\n } = useFormContext();\n const {\n state: fieldState,\n setTouched,\n setDirty,\n validityData,\n setFilled,\n validationMode,\n disabled: fieldDisabled,\n name: fieldName,\n validation\n } = useFieldRootContext();\n const {\n labelId\n } = useLabelableContext();\n const disabled = fieldDisabled || disabledProp;\n const name = fieldName ?? nameProp;\n const inputRef = React.useRef(null);\n const handleInputRef = useMergedRefs(inputRef, externalInputRef, validation.inputRef);\n const switchRef = React.useRef(null);\n const setFocused = useSetFieldFocused(disabled, switchRef);\n const id = useBaseUiId();\n const controlId = useLabelableId({\n id: idProp\n });\n const hiddenInputId = nativeButton ? undefined : controlId;\n const [checked, setCheckedState] = useControlled({\n controlled: checkedProp,\n default: Boolean(defaultChecked),\n name: 'Switch',\n state: 'checked'\n });\n useRegisterFieldControl(switchRef, id, checked, undefined, !disabled, nameProp);\n useIsoLayoutEffect(() => {\n setFilled(checked);\n }, [checked, setFilled]);\n useValueChanged(checked, () => {\n clearErrors(name);\n setDirty(checked !== validityData.initialValue);\n validation.change(checked);\n });\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const ariaLabelledBy = useAriaLabelledBy(ariaLabelledByProp, labelId, inputRef, !nativeButton, hiddenInputId, elementProps['aria-label']);\n const rootProps = {\n id: nativeButton ? controlId : id,\n role: 'switch',\n 'aria-checked': checked,\n 'aria-readonly': readOnly || undefined,\n 'aria-required': required || undefined,\n 'aria-labelledby': ariaLabelledBy,\n onFocus() {\n setFocused(true);\n },\n onBlur() {\n const element = inputRef.current;\n if (!element || disabled) {\n return;\n }\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(element.checked);\n }\n },\n onClick(event) {\n if (readOnly || disabled) {\n return;\n }\n event.preventDefault();\n const input = inputRef.current;\n if (!input) {\n return;\n }\n dispatchClickWithModifiers(input, event);\n }\n };\n const inputProps = {\n ...validation.getValidationProps(disabled),\n checked,\n disabled,\n form,\n id: hiddenInputId,\n name,\n required,\n style: name ? visuallyHiddenInput : visuallyHidden,\n tabIndex: -1,\n type: 'checkbox',\n 'aria-hidden': true,\n ref: handleInputRef,\n onChange(event) {\n // Workaround for https://github.com/react/react/issues/9023\n if (event.nativeEvent.defaultPrevented) {\n return;\n }\n if (readOnly) {\n event.preventDefault();\n return;\n }\n const nextChecked = event.currentTarget.checked;\n const eventDetails = createChangeEventDetails(REASONS.none, event.nativeEvent);\n onCheckedChange?.(nextChecked, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setCheckedState(nextChecked);\n },\n onClick(event) {\n // The click dispatched from the root's `onClick` is an implementation detail\n // and must not reach ancestors, which already receive the original click.\n event.stopPropagation();\n },\n onFocus() {\n switchRef.current?.focus();\n },\n // React <19 sets an empty value if `undefined` is passed explicitly\n // To avoid this, we only set the value if it's defined\n ...(value !== undefined ? {\n value\n } : EMPTY_OBJECT)\n };\n const state = React.useMemo(() => ({\n ...fieldState,\n checked,\n disabled,\n readOnly,\n required\n }), [fieldState, checked, disabled, readOnly, required]);\n const element = useRenderElement('span', componentProps, {\n state,\n ref: [forwardedRef, switchRef, buttonRef],\n props: [rootProps, elementProps, getButtonProps, props => validation.getValidationProps(disabled, props)],\n stateAttributesMapping\n });\n return /*#__PURE__*/_jsxs(SwitchRootContext.Provider, {\n value: state,\n children: [element, !checked && name && uncheckedValue !== undefined && /*#__PURE__*/_jsx(\"input\", {\n type: \"hidden\",\n form: form,\n name: name,\n value: uncheckedValue,\n disabled: disabled\n }), /*#__PURE__*/_jsx(\"input\", {\n ...inputProps,\n suppressHydrationWarning: true\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") SwitchRoot.displayName = \"SwitchRoot\";","'use client';\n\nimport * as React from 'react';\nimport { useSwitchRootContext } from \"../root/SwitchRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { stateAttributesMapping } from \"../stateAttributesMapping.mjs\";\n\n/**\n * The movable part of the switch that indicates whether the switch is on or off.\n * Renders a `<span>`.\n *\n * Documentation: [Base UI Switch](https://base-ui.com/react/components/switch)\n */\nexport const SwitchThumb = /*#__PURE__*/React.forwardRef(function SwitchThumb(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const state = useSwitchRootContext();\n return useRenderElement('span', componentProps, {\n state,\n ref: forwardedRef,\n stateAttributesMapping,\n props: elementProps\n });\n});\nif (process.env.NODE_ENV !== \"production\") SwitchThumb.displayName = \"SwitchThumb\";","import * as React from 'react'\nimport { Switch as SwitchPrimitive } from '@base-ui/react/switch'\n\nimport { cn } from '@/lib/utils'\n\nfunction SwitchControl({ className, ...props }: SwitchPrimitive.Root.Props) {\n return (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n className={cn(\n 'peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-border-default bg-background-surface-sunken transition-colors focus-ring data-checked:border-border-brand-bold data-checked:bg-primary data-disabled:cursor-not-allowed data-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className=\"pointer-events-none block size-4 translate-x-0.5 rounded-full bg-background-surface-raised shadow-sm transition-transform data-checked:translate-x-4\"\n />\n </SwitchPrimitive.Root>\n )\n}\n\n/** Legacy MUI Switch styled props — mapped to atoms Switch (Base UI). */\nexport interface StyledSwitchProps extends Omit<SwitchPrimitive.Root.Props, 'onCheckedChange' | 'onChange'> {\n /**\n * Legacy MUI hidden-input attributes. `id`, `name`, `value`, `required`, `aria-*`, and `data-test`\n * are forwarded to the Base UI root (Base UI renders a hidden form input when `name` is set).\n */\n inputProps?: React.InputHTMLAttributes<HTMLInputElement> & { 'data-test'?: string }\n /** @deprecated No-op — size is fixed by design tokens. */\n widthMultiple?: number\n /** @deprecated No-op — size is fixed by design tokens. */\n heightMultiple?: number\n /** @deprecated No-op — size is fixed by design tokens. */\n thumbWidthMultiple?: number\n /** Base UI / new API */\n onCheckedChange?: (checked: boolean) => void\n /** Legacy MUI-style change handler */\n onChange?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void\n}\n\nconst Switch: React.FC<StyledSwitchProps> = ({\n inputProps,\n widthMultiple: _w,\n heightMultiple: _h,\n thumbWidthMultiple: _t,\n onChange,\n onCheckedChange,\n ...props\n}) => {\n const {\n id,\n name,\n value,\n required,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n 'data-test': dataTest,\n } = inputProps ?? {}\n\n return (\n <SwitchControl\n id={id}\n name={name}\n value={typeof value === 'string' ? value : undefined}\n required={required}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n data-test={dataTest}\n {...props}\n onCheckedChange={(checked) => {\n onCheckedChange?.(checked)\n if (onChange) {\n const target = {\n checked,\n name: name ?? '',\n value: typeof value === 'string' ? value : 'on',\n id: id ?? '',\n type: 'checkbox',\n }\n const event = {\n target,\n currentTarget: target,\n } as unknown as React.ChangeEvent<HTMLInputElement>\n onChange(event, checked)\n }\n }}\n />\n )\n}\n\nexport default Switch\n"],"names":["_formatErrorMessage","SwitchRootDataAttributes.checked","SwitchRootDataAttributes.unchecked","SwitchRoot","checked","element","REASONS.none","_jsxs","_jsx","SwitchThumb","SwitchPrimitive.Root","cn","SwitchPrimitive.Thumb"],"mappings":";;;;;;;;;;AAIO,MAAM,oBAAiC,sBAAM,cAAc,MAAS;AAC3E,IAAI,QAAQ,IAAI,aAAa,aAAc,mBAAkB,cAAc;AACpE,SAAS,uBAAuB;AACrC,QAAM,UAAU,MAAM,WAAW,iBAAiB;AAClD,MAAI,YAAY,QAAW;AACzB,UAAM,IAAI,MAAM,QAAQ,IAAI,aAAa,eAAe,6FAA6FA,mBAAoB,EAAE,CAAC;AAAA,EAC9K;AACA,SAAO;AACT;ACTO,MAAM,UAAU;AAIhB,MAAM,YAAY;ACLlB,MAAM,yBAAyB;AAAA,EACpC,GAAG;AAAA,EACH,QAAQ,OAAO;AACb,QAAI,OAAO;AACT,aAAO;AAAA,QACL,CAACC,OAAgC,GAAG;AAAA,MAC5C;AAAA,IACI;AACA,WAAO;AAAA,MACL,CAACC,SAAkC,GAAG;AAAA,IAC5C;AAAA,EACE;AACF;ACkBO,MAAM,aAA0B,sBAAM,WAAW,SAASC,YAAW,gBAAgB,cAAc;AACxG,QAAM;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,mBAAmB;AAAA,IACnB;AAAA,IACA,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,eAAe;AAAA,IACf;AAAA,IACA,WAAW;AAAA,IACX,WAAW;AAAA,IACX,UAAU,eAAe;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACP,IAAM;AACJ,QAAM;AAAA,IACJ;AAAA,EACJ,IAAM,eAAc;AAClB,QAAM;AAAA,IACJ,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA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;AAAA,UACC,aAAU;AAAA,UACV,WAAU;AAAA,QAAA;AAAA,MAAA;AAAA,IACZ;AAAA,EAAA;AAGN;AAqBA,MAAM,SAAsC,CAAC;AAAA,EAC3C;AAAA,EACA,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,aAAa;AAAA,EAAA,IACX,cAAc,CAAA;AAElB,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,OAAO,OAAO,UAAU,WAAW,QAAQ;AAAA,MAC3C;AAAA,MACA,cAAY;AAAA,MACZ,mBAAiB;AAAA,MACjB,oBAAkB;AAAA,MAClB,aAAW;AAAA,MACV,GAAG;AAAA,MACJ,iBAAiB,CAACR,aAAY;AAC5B,2DAAkBA;AAClB,YAAI,UAAU;AACZ,gBAAM,SAAS;AAAA,YACb,SAAAA;AAAA,YACA,MAAM,QAAQ;AAAA,YACd,OAAO,OAAO,UAAU,WAAW,QAAQ;AAAA,YAC3C,IAAI,MAAM;AAAA,YACV,MAAM;AAAA,UAAA;AAER,gBAAM,QAAQ;AAAA,YACZ;AAAA,YACA,eAAe;AAAA,UAAA;AAEjB,mBAAS,OAAOA,QAAO;AAAA,QACzB;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAGN;","x_google_ignoreList":[0,1,2,3,4]}
|
|
1
|
+
{"version":3,"file":"Switch.es.js","sources":["../../../node_modules/@base-ui/react/switch/root/SwitchRootContext.mjs","../../../node_modules/@base-ui/react/switch/root/SwitchRootDataAttributes.mjs","../../../node_modules/@base-ui/react/switch/stateAttributesMapping.mjs","../../../node_modules/@base-ui/react/switch/root/SwitchRoot.mjs","../../../node_modules/@base-ui/react/switch/thumb/SwitchThumb.mjs","../../../src/components/atoms/Switch.tsx"],"sourcesContent":["'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SwitchRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SwitchRootContext.displayName = \"SwitchRootContext\";\nexport function useSwitchRootContext() {\n const context = React.useContext(SwitchRootContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>.' : _formatErrorMessage(63));\n }\n return context;\n}","/**\n * Present when the switch is checked.\n */\nexport const checked = 'data-checked';\n/**\n * Present when the switch is not checked.\n */\nexport const unchecked = 'data-unchecked';\n/**\n * Present when the switch is disabled.\n */\nexport const disabled = 'data-disabled';\n/**\n * Present when the switch is readonly.\n */\nexport const readonly = 'data-readonly';\n/**\n * Present when the switch is required.\n */\nexport const required = 'data-required';\n/**\n * Present when the switch is in a valid state (when wrapped in Field.Root).\n */\nexport const valid = 'data-valid';\n/**\n * Present when the switch is in an invalid state (when wrapped in Field.Root).\n */\nexport const invalid = 'data-invalid';\n/**\n * Present when the switch has been touched (when wrapped in Field.Root).\n */\nexport const touched = 'data-touched';\n/**\n * Present when the switch's value has changed (when wrapped in Field.Root).\n */\nexport const dirty = 'data-dirty';\n/**\n * Present when the switch is active (when wrapped in Field.Root).\n */\nexport const filled = 'data-filled';\n/**\n * Present when the switch is focused (when wrapped in Field.Root).\n */\nexport const focused = 'data-focused';","import { fieldValidityMapping } from \"../internals/field-constants/constants.mjs\";\nimport * as SwitchRootDataAttributes from \"./root/SwitchRootDataAttributes.mjs\";\nexport const stateAttributesMapping = {\n ...fieldValidityMapping,\n checked(value) {\n if (value) {\n return {\n [SwitchRootDataAttributes.checked]: ''\n };\n }\n return {\n [SwitchRootDataAttributes.unchecked]: ''\n };\n }\n};","'use client';\n\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { visuallyHidden, visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { SwitchRootContext } from \"./SwitchRootContext.mjs\";\nimport { stateAttributesMapping } from \"../stateAttributesMapping.mjs\";\nimport { dispatchClickWithModifiers } from \"../../utils/dispatchClickWithModifiers.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useSetFieldFocused } from \"../../internals/field-root-context/useSetFieldFocused.mjs\";\nimport { useRegisterFieldControl } from \"../../internals/field-register-control/useRegisterFieldControl.mjs\";\nimport { useFormContext } from \"../../internals/form-context/FormContext.mjs\";\nimport { useLabelableContext } from \"../../internals/labelable-provider/LabelableContext.mjs\";\nimport { useAriaLabelledBy } from \"../../internals/labelable-provider/useAriaLabelledBy.mjs\";\nimport { useLabelableId } from \"../../internals/labelable-provider/useLabelableId.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useValueChanged } from \"../../internals/useValueChanged.mjs\";\n\n/**\n * Represents the switch itself.\n * Renders a `<span>` element and a hidden `<input>` beside.\n *\n * Documentation: [Base UI Switch](https://base-ui.com/react/components/switch)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const SwitchRoot = /*#__PURE__*/React.forwardRef(function SwitchRoot(componentProps, forwardedRef) {\n const {\n checked: checkedProp,\n className,\n defaultChecked,\n 'aria-labelledby': ariaLabelledByProp,\n form,\n id: idProp,\n inputRef: externalInputRef,\n name: nameProp,\n nativeButton = false,\n onCheckedChange,\n readOnly = false,\n required = false,\n disabled: disabledProp = false,\n render,\n uncheckedValue,\n value,\n style,\n ...elementProps\n } = componentProps;\n const {\n clearErrors\n } = useFormContext();\n const {\n state: fieldState,\n setTouched,\n setDirty,\n validityData,\n setFilled,\n validationMode,\n disabled: fieldDisabled,\n name: fieldName,\n validation\n } = useFieldRootContext();\n const {\n labelId\n } = useLabelableContext();\n const disabled = fieldDisabled || disabledProp;\n const name = fieldName ?? nameProp;\n const inputRef = React.useRef(null);\n const handleInputRef = useMergedRefs(inputRef, externalInputRef, validation.inputRef);\n const switchRef = React.useRef(null);\n const setFocused = useSetFieldFocused(disabled, switchRef);\n const id = useBaseUiId();\n const controlId = useLabelableId({\n id: idProp\n });\n const hiddenInputId = nativeButton ? undefined : controlId;\n const [checked, setCheckedState] = useControlled({\n controlled: checkedProp,\n default: Boolean(defaultChecked),\n name: 'Switch',\n state: 'checked'\n });\n useRegisterFieldControl(switchRef, id, checked, undefined, !disabled, nameProp);\n useIsoLayoutEffect(() => {\n setFilled(checked);\n }, [checked, setFilled]);\n useValueChanged(checked, () => {\n clearErrors(name);\n setDirty(checked !== validityData.initialValue);\n validation.change(checked);\n });\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const ariaLabelledBy = useAriaLabelledBy(ariaLabelledByProp, labelId, inputRef, !nativeButton, hiddenInputId, elementProps['aria-label']);\n const rootProps = {\n id: nativeButton ? controlId : id,\n role: 'switch',\n 'aria-checked': checked,\n 'aria-readonly': readOnly || undefined,\n 'aria-required': required || undefined,\n 'aria-labelledby': ariaLabelledBy,\n onFocus() {\n setFocused(true);\n },\n onBlur() {\n const element = inputRef.current;\n if (!element || disabled) {\n return;\n }\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(element.checked);\n }\n },\n onClick(event) {\n if (readOnly || disabled) {\n return;\n }\n event.preventDefault();\n const input = inputRef.current;\n if (!input) {\n return;\n }\n dispatchClickWithModifiers(input, event);\n }\n };\n const inputProps = {\n ...validation.getValidationProps(disabled),\n checked,\n disabled,\n form,\n id: hiddenInputId,\n name,\n required,\n style: name ? visuallyHiddenInput : visuallyHidden,\n tabIndex: -1,\n type: 'checkbox',\n 'aria-hidden': true,\n ref: handleInputRef,\n onChange(event) {\n // Workaround for https://github.com/react/react/issues/9023\n if (event.nativeEvent.defaultPrevented) {\n return;\n }\n if (readOnly) {\n event.preventDefault();\n return;\n }\n const nextChecked = event.currentTarget.checked;\n const eventDetails = createChangeEventDetails(REASONS.none, event.nativeEvent);\n onCheckedChange?.(nextChecked, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setCheckedState(nextChecked);\n },\n onClick(event) {\n // The click dispatched from the root's `onClick` is an implementation detail\n // and must not reach ancestors, which already receive the original click.\n event.stopPropagation();\n },\n onFocus() {\n switchRef.current?.focus();\n },\n // React <19 sets an empty value if `undefined` is passed explicitly\n // To avoid this, we only set the value if it's defined\n ...(value !== undefined ? {\n value\n } : EMPTY_OBJECT)\n };\n const state = React.useMemo(() => ({\n ...fieldState,\n checked,\n disabled,\n readOnly,\n required\n }), [fieldState, checked, disabled, readOnly, required]);\n const element = useRenderElement('span', componentProps, {\n state,\n ref: [forwardedRef, switchRef, buttonRef],\n props: [rootProps, elementProps, getButtonProps, props => validation.getValidationProps(disabled, props)],\n stateAttributesMapping\n });\n return /*#__PURE__*/_jsxs(SwitchRootContext.Provider, {\n value: state,\n children: [element, !checked && name && uncheckedValue !== undefined && /*#__PURE__*/_jsx(\"input\", {\n type: \"hidden\",\n form: form,\n name: name,\n value: uncheckedValue,\n disabled: disabled\n }), /*#__PURE__*/_jsx(\"input\", {\n ...inputProps,\n suppressHydrationWarning: true\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") SwitchRoot.displayName = \"SwitchRoot\";","'use client';\n\nimport * as React from 'react';\nimport { useSwitchRootContext } from \"../root/SwitchRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { stateAttributesMapping } from \"../stateAttributesMapping.mjs\";\n\n/**\n * The movable part of the switch that indicates whether the switch is on or off.\n * Renders a `<span>`.\n *\n * Documentation: [Base UI Switch](https://base-ui.com/react/components/switch)\n */\nexport const SwitchThumb = /*#__PURE__*/React.forwardRef(function SwitchThumb(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const state = useSwitchRootContext();\n return useRenderElement('span', componentProps, {\n state,\n ref: forwardedRef,\n stateAttributesMapping,\n props: elementProps\n });\n});\nif (process.env.NODE_ENV !== \"production\") SwitchThumb.displayName = \"SwitchThumb\";","import * as React from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Switch as SwitchPrimitive } from '@base-ui/react/switch'\n\nimport { cn } from '@/lib/utils'\n\nexport const switchVariants = cva(\n 'group relative inline-flex shrink-0 cursor-pointer items-center rounded-pill border border-border-subtle bg-background-input p-px focus-ring transition-[background-color,border-color] duration-150 ease-out after:absolute after:inset-x-0 after:content-[\"\"] hover:border-border-default data-checked:border-transparent data-checked:bg-background-brand-bold data-checked:hover:bg-background-brand-bold-selected dark:data-checked:hover:bg-background-brand-bold-hover data-disabled:cursor-not-allowed data-disabled:opacity-(--opacity-disabled) data-disabled:hover:border-border-subtle data-disabled:data-checked:hover:bg-background-brand-bold data-invalid:border-status-border-error-bold data-invalid:bg-status-background-error data-invalid:hover:border-status-border-error-bold data-invalid:data-checked:bg-status-background-error-bold data-invalid:data-checked:hover:bg-status-background-error-bold motion-reduce:transition-none',\n {\n variants: {\n size: {\n sm: 'h-3.5 w-6',\n default: 'h-4 w-8 after:-inset-y-1',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n },\n)\n\nconst switchThumbVariants = cva(\n 'pointer-events-none block translate-x-0 rounded-pill bg-icon-on-bold shadow-elevation-2 transition-[translate,box-shadow] duration-150 ease-out group-hover:data-unchecked:shadow-elevation-1 group-data-disabled:data-unchecked:shadow-elevation-2 motion-reduce:transition-none',\n {\n variants: {\n size: {\n sm: 'size-2.5 data-checked:translate-x-2.5',\n default: 'size-3 data-checked:translate-x-4',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n },\n)\n\ntype SwitchControlProps = Omit<SwitchPrimitive.Root.Props, 'size'> &\n VariantProps<typeof switchVariants> & {\n invalid?: boolean\n }\n\nfunction SwitchControl({ className, invalid, size, ...props }: SwitchControlProps) {\n return (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n {...props}\n aria-invalid={invalid || props['aria-invalid'] || undefined}\n data-invalid={invalid ? '' : undefined}\n className={cn(switchVariants({ size }), className)}\n >\n <SwitchPrimitive.Thumb data-slot=\"switch-thumb\" className={switchThumbVariants({ size })} />\n </SwitchPrimitive.Root>\n )\n}\n\n/** Legacy MUI Switch styled props — mapped to atoms Switch (Base UI). */\nexport interface StyledSwitchProps extends Omit<SwitchControlProps, 'onCheckedChange' | 'onChange'> {\n /**\n * Legacy MUI hidden-input attributes. `id`, `name`, `value`, `required`, `aria-*`, and `data-test`\n * are forwarded to the Base UI root (Base UI renders a hidden form input when `name` is set).\n */\n inputProps?: React.InputHTMLAttributes<HTMLInputElement> & { 'data-test'?: string }\n /** @deprecated No-op — size is fixed by design tokens. */\n widthMultiple?: number\n /** @deprecated No-op — size is fixed by design tokens. */\n heightMultiple?: number\n /** @deprecated No-op — size is fixed by design tokens. */\n thumbWidthMultiple?: number\n /** Base UI / new API */\n onCheckedChange?: (checked: boolean) => void\n /** Legacy MUI-style change handler */\n onChange?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void\n}\n\nexport type SwitchProps = StyledSwitchProps\n\nfunction Switch({\n inputProps,\n widthMultiple: _w,\n heightMultiple: _h,\n thumbWidthMultiple: _t,\n onChange,\n onCheckedChange,\n ...props\n}: SwitchProps) {\n const {\n id,\n name,\n value,\n required,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n 'data-test': dataTest,\n } = inputProps ?? {}\n\n return (\n <SwitchControl\n id={id}\n name={name}\n value={typeof value === 'string' ? value : undefined}\n required={required}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n data-test={dataTest}\n {...props}\n onCheckedChange={(checked) => {\n onCheckedChange?.(checked)\n if (onChange) {\n const target = {\n checked,\n name: name ?? '',\n value: typeof value === 'string' ? value : 'on',\n id: id ?? '',\n type: 'checkbox',\n }\n const event = {\n target,\n currentTarget: target,\n } as unknown as React.ChangeEvent<HTMLInputElement>\n onChange(event, checked)\n }\n }}\n />\n )\n}\n\nexport default Switch\n"],"names":["_formatErrorMessage","SwitchRootDataAttributes.checked","SwitchRootDataAttributes.unchecked","SwitchRoot","checked","element","REASONS.none","_jsxs","_jsx","SwitchThumb","SwitchPrimitive.Root","cn","SwitchPrimitive.Thumb"],"mappings":";;;;;;;;;;;AAIO,MAAM,oBAAiC,sBAAM,cAAc,MAAS;AAC3E,IAAI,QAAQ,IAAI,aAAa,aAAc,mBAAkB,cAAc;AACpE,SAAS,uBAAuB;AACrC,QAAM,UAAU,MAAM,WAAW,iBAAiB;AAClD,MAAI,YAAY,QAAW;AACzB,UAAM,IAAI,MAAM,QAAQ,IAAI,aAAa,eAAe,6FAA6FA,mBAAoB,EAAE,CAAC;AAAA,EAC9K;AACA,SAAO;AACT;ACTO,MAAM,UAAU;AAIhB,MAAM,YAAY;ACLlB,MAAM,yBAAyB;AAAA,EACpC,GAAG;AAAA,EACH,QAAQ,OAAO;AACb,QAAI,OAAO;AACT,aAAO;AAAA,QACL,CAACC,OAAgC,GAAG;AAAA,MAC5C;AAAA,IACI;AACA,WAAO;AAAA,MACL,CAACC,SAAkC,GAAG;AAAA,IAC5C;AAAA,EACE;AACF;ACkBO,MAAM,aAA0B,sBAAM,WAAW,SAASC,YAAW,gBAAgB,cAAc;AACxG,QAAM;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,mBAAmB;AAAA,IACnB;AAAA,IACA,IAAI;AAAA,IACJ,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AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,OAAO,OAAO,UAAU,WAAW,QAAQ;AAAA,MAC3C;AAAA,MACA,cAAY;AAAA,MACZ,mBAAiB;AAAA,MACjB,oBAAkB;AAAA,MAClB,aAAW;AAAA,MACV,GAAG;AAAA,MACJ,iBAAiB,CAACR,aAAY;AAC5B,2DAAkBA;AAClB,YAAI,UAAU;AACZ,gBAAM,SAAS;AAAA,YACb,SAAAA;AAAA,YACA,MAAM,QAAQ;AAAA,YACd,OAAO,OAAO,UAAU,WAAW,QAAQ;AAAA,YAC3C,IAAI,MAAM;AAAA,YACV,MAAM;AAAA,UAAA;AAER,gBAAM,QAAQ;AAAA,YACZ;AAAA,YACA,eAAe;AAAA,UAAA;AAEjB,mBAAS,OAAOA,QAAO;AAAA,QACzB;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAGN;","x_google_ignoreList":[0,1,2,3,4]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import IconProvider from "./IconProvider.es.js";
|
|
3
|
-
import { D as DarkTooltip } from "../../Tooltip-
|
|
3
|
+
import { D as DarkTooltip } from "../../Tooltip-D5E-qGtP.js";
|
|
4
4
|
import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { u as useControlled } from "../../useControlled-BSyYkg5C.js";
|
|
@@ -580,7 +580,7 @@ function TabsList2({ className, ...props }) {
|
|
|
580
580
|
TabsList$1,
|
|
581
581
|
{
|
|
582
582
|
"data-slot": "tabs-list",
|
|
583
|
-
className: classNames("inline-flex h-9 items-center gap-1 rounded-md bg-tabs-contained-background
|
|
583
|
+
className: classNames("inline-flex h-9 items-center gap-1 rounded-md bg-tabs-contained-background p-1", className),
|
|
584
584
|
...props
|
|
585
585
|
}
|
|
586
586
|
);
|