@fanvue/ui 3.49.0 → 3.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/animated-icons.d.ts +4 -1
- package/dist/charts.d.ts +18 -13
- package/dist/cjs/components/Alert/Alert.cjs +45 -36
- package/dist/cjs/components/Alert/Alert.cjs.map +1 -1
- package/dist/cjs/components/Autocomplete/Autocomplete.cjs +1 -1
- package/dist/cjs/components/Autocomplete/Autocomplete.cjs.map +1 -1
- package/dist/cjs/components/Autocomplete/AutocompleteDropdownContent.cjs +1 -1
- package/dist/cjs/components/Autocomplete/AutocompleteDropdownContent.cjs.map +1 -1
- package/dist/cjs/components/Button/Button.cjs +13 -9
- package/dist/cjs/components/Button/Button.cjs.map +1 -1
- package/dist/cjs/components/Chart/ChartCard.cjs +4 -3
- package/dist/cjs/components/Chart/ChartCard.cjs.map +1 -1
- package/dist/cjs/components/Chart/ChartGrid.cjs +19 -10
- package/dist/cjs/components/Chart/ChartGrid.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Dialog.cjs +57 -24
- package/dist/cjs/components/Dialog/Dialog.cjs.map +1 -1
- package/dist/cjs/components/Drawer/Drawer.cjs +61 -14
- package/dist/cjs/components/Drawer/Drawer.cjs.map +1 -1
- package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs +26 -7
- package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs.map +1 -1
- package/dist/cjs/components/IconButton/IconButton.cjs +17 -3
- package/dist/cjs/components/IconButton/IconButton.cjs.map +1 -1
- package/dist/cjs/components/Icons/BaseIcon.cjs +3 -2
- package/dist/cjs/components/Icons/BaseIcon.cjs.map +1 -1
- package/dist/cjs/components/Icons/DocumentIcon.cjs +74 -0
- package/dist/cjs/components/Icons/DocumentIcon.cjs.map +1 -0
- package/dist/cjs/components/Icons/EpisodesIcon.cjs +65 -0
- package/dist/cjs/components/Icons/EpisodesIcon.cjs.map +1 -0
- package/dist/cjs/components/Icons/ShortsIcon.cjs +74 -0
- package/dist/cjs/components/Icons/ShortsIcon.cjs.map +1 -0
- package/dist/cjs/components/Icons/SpinnerIcon.cjs +4 -2
- package/dist/cjs/components/Icons/SpinnerIcon.cjs.map +1 -1
- package/dist/cjs/components/Icons/iconSpinClass.cjs +6 -0
- package/dist/cjs/components/Icons/iconSpinClass.cjs.map +1 -0
- package/dist/cjs/components/InfoBox/InfoBox.cjs +1 -1
- package/dist/cjs/components/InfoBox/InfoBox.cjs.map +1 -1
- package/dist/cjs/components/Loader/Loader.cjs +1 -1
- package/dist/cjs/components/Loader/Loader.cjs.map +1 -1
- package/dist/cjs/components/Pill/Pill.cjs +1 -1
- package/dist/cjs/components/Pill/Pill.cjs.map +1 -1
- package/dist/cjs/components/Skeleton/Skeleton.cjs +17 -1
- package/dist/cjs/components/Skeleton/Skeleton.cjs.map +1 -1
- package/dist/cjs/index.cjs +6 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/Alert/Alert.mjs +45 -36
- package/dist/components/Alert/Alert.mjs.map +1 -1
- package/dist/components/Autocomplete/Autocomplete.mjs +1 -1
- package/dist/components/Autocomplete/Autocomplete.mjs.map +1 -1
- package/dist/components/Autocomplete/AutocompleteDropdownContent.mjs +1 -1
- package/dist/components/Autocomplete/AutocompleteDropdownContent.mjs.map +1 -1
- package/dist/components/Button/Button.mjs +13 -9
- package/dist/components/Button/Button.mjs.map +1 -1
- package/dist/components/Chart/ChartCard.mjs +4 -3
- package/dist/components/Chart/ChartCard.mjs.map +1 -1
- package/dist/components/Chart/ChartGrid.mjs +20 -11
- package/dist/components/Chart/ChartGrid.mjs.map +1 -1
- package/dist/components/Dialog/Dialog.mjs +57 -24
- package/dist/components/Dialog/Dialog.mjs.map +1 -1
- package/dist/components/Drawer/Drawer.mjs +61 -14
- package/dist/components/Drawer/Drawer.mjs.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenuItem.mjs +26 -7
- package/dist/components/DropdownMenu/DropdownMenuItem.mjs.map +1 -1
- package/dist/components/IconButton/IconButton.mjs +17 -3
- package/dist/components/IconButton/IconButton.mjs.map +1 -1
- package/dist/components/Icons/BaseIcon.mjs +3 -2
- package/dist/components/Icons/BaseIcon.mjs.map +1 -1
- package/dist/components/Icons/DocumentIcon.mjs +57 -0
- package/dist/components/Icons/DocumentIcon.mjs.map +1 -0
- package/dist/components/Icons/EpisodesIcon.mjs +48 -0
- package/dist/components/Icons/EpisodesIcon.mjs.map +1 -0
- package/dist/components/Icons/ShortsIcon.mjs +57 -0
- package/dist/components/Icons/ShortsIcon.mjs.map +1 -0
- package/dist/components/Icons/SpinnerIcon.mjs +4 -2
- package/dist/components/Icons/SpinnerIcon.mjs.map +1 -1
- package/dist/components/Icons/iconSpinClass.mjs +6 -0
- package/dist/components/Icons/iconSpinClass.mjs.map +1 -0
- package/dist/components/InfoBox/InfoBox.mjs +1 -1
- package/dist/components/InfoBox/InfoBox.mjs.map +1 -1
- package/dist/components/Loader/Loader.mjs +1 -1
- package/dist/components/Loader/Loader.mjs.map +1 -1
- package/dist/components/Pill/Pill.mjs +1 -1
- package/dist/components/Pill/Pill.mjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.mjs +17 -1
- package/dist/components/Skeleton/Skeleton.mjs.map +1 -1
- package/dist/index.d.ts +140 -17
- package/dist/index.mjs +6 -0
- package/dist/index.mjs.map +1 -1
- package/dist/styles/base.css +157 -4
- package/dist/styles/theme.css +20 -12
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.mjs","sources":["../../../src/components/IconButton/IconButton.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Count, type CountSize } from \"../Count/Count\";\nimport { IconDefaultsContext, NO_ICON_DEFAULTS } from \"../Icons/IconDefaults\";\n\n/**\n * Visual style variant of the icon button.\n *\n * `primary`, `secondary`, `tertiary`, `outline`, `error`, `white` and `black`\n * use the shared button colour tokens and a size-driven shape (squared at the\n * `24` size, circular otherwise). Of these, `primary`, `secondary`, `tertiary`\n * and `outline` also honour the {@link IconButtonProps.negative} prop.\n *\n * `brand`, `contrast`, `messaging`, `navTray`, `tertiaryDestructive`, `stop` and\n * `microphone` are bespoke variants that stay circular at every size.\n */\nexport type IconButtonVariant =\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"outline\"\n | \"error\"\n | \"white\"\n | \"black\"\n | \"brand\"\n | \"contrast\"\n | \"messaging\"\n | \"navTray\"\n | \"tertiaryDestructive\"\n | \"stop\"\n | \"microphone\"\n | \"field\";\n\n/** Icon button size in pixels. */\nexport type IconButtonSize = \"24\" | \"32\" | \"40\" | \"48\" | \"52\" | \"72\";\n\nconst iconSizeVariants: Record<IconButtonSize, string> = {\n 24: \"[&>svg]:size-4\",\n 32: \"[&>svg]:size-4\",\n 40: \"[&>svg]:size-4\",\n 48: \"[&>svg]:size-6\",\n 52: \"[&>svg]:size-7\",\n 72: \"[&>svg]:size-8\",\n};\n\nconst sizeVariants: Record<IconButtonSize, string> = {\n 24: \"size-6 p-1\",\n 32: \"size-8 p-1.5\",\n 40: \"size-10 p-[10px]\",\n 48: \"size-12 p-3\",\n 52: \"size-[52px] p-2\",\n 72: \"size-[72px] p-4\",\n};\n\nconst countSizeMap: Record<IconButtonSize, CountSize> = {\n 24: \"16\",\n 32: \"24\",\n 40: \"32\",\n 48: \"32\",\n 52: \"32\",\n 72: \"32\",\n};\n\n/**\n * Variants whose corner radius is size-driven (see {@link IconButton}): the `24`\n * size is squared (`rounded-xs`), every larger size stays circular. All other\n * variants are circular at every size.\n */\nconst SIZE_DRIVEN_SHAPE_VARIANTS = new Set<IconButtonVariant>([\n \"primary\",\n \"secondary\",\n \"tertiary\",\n \"outline\",\n \"error\",\n \"white\",\n \"black\",\n]);\n\n/** Variants that honour the `negative` (dark-surface) treatment. */\nconst NEGATIVE_AWARE_VARIANTS = new Set<IconButtonVariant>([\n \"primary\",\n \"secondary\",\n \"tertiary\",\n \"outline\",\n]);\n\nconst DISABLED_FILL = \"disabled:bg-buttons-disabled-default disabled:text-content-disabled\";\nconst DISABLED_FILL_NEGATIVE =\n \"disabled:bg-buttons-disabled-negative disabled:text-content-disabled\";\nconst DISABLED_TRANSPARENT = \"disabled:text-content-disabled\";\nconst DISABLED_OPACITY = \"disabled:opacity-50\";\n\ntype VariantClasses = {\n default: string;\n disabled: string;\n negative?: string;\n negativeDisabled?: string;\n};\n\n/**\n * Icon button styling for every variant. The disabled treatment is expressed\n * with the CSS `disabled:` variant (not the `disabled` prop) so an ancestor\n * `<fieldset disabled>` is styled too; hover is guarded with `not-disabled:` so\n * it never fights the disabled state.\n */\nconst VARIANT_CLASSES: Record<IconButtonVariant, VariantClasses> = {\n primary: {\n default:\n \"bg-buttons-primary-default text-content-primary-inverted not-disabled:hover:bg-buttons-primary-hover not-disabled:active:bg-buttons-primary-hover\",\n disabled: DISABLED_FILL,\n negative:\n \"bg-buttons-primary-negative-default text-content-primary not-disabled:hover:bg-buttons-primary-negative-hover not-disabled:active:bg-buttons-primary-negative-hover\",\n negativeDisabled: DISABLED_FILL_NEGATIVE,\n },\n secondary: {\n default:\n \"bg-buttons-secondary-default text-content-primary not-disabled:hover:bg-buttons-secondary-hover not-disabled:active:bg-buttons-secondary-hover\",\n disabled: DISABLED_FILL,\n negative:\n \"bg-buttons-secondary-negative-default text-content-primary-inverted not-disabled:hover:bg-buttons-secondary-negative-hover not-disabled:active:bg-buttons-secondary-negative-hover\",\n negativeDisabled: DISABLED_FILL_NEGATIVE,\n },\n tertiary: {\n default:\n \"bg-transparent text-content-primary not-disabled:hover:bg-buttons-tertiary-hover not-disabled:active:bg-buttons-tertiary-hover\",\n disabled: DISABLED_TRANSPARENT,\n negative:\n \"bg-transparent text-content-primary-inverted not-disabled:hover:bg-buttons-tertiary-negative-hover not-disabled:active:bg-buttons-tertiary-negative-hover\",\n negativeDisabled: DISABLED_TRANSPARENT,\n },\n outline: {\n default:\n \"border border-buttons-outline-default bg-transparent text-content-primary not-disabled:hover:bg-buttons-outline-hover not-disabled:active:bg-buttons-outline-hover\",\n disabled: \"disabled:border-buttons-disabled-default disabled:text-content-disabled\",\n negative:\n \"border border-buttons-outline-negative-default bg-transparent text-content-primary-inverted not-disabled:hover:bg-buttons-outline-negative-hover not-disabled:active:bg-buttons-outline-negative-hover\",\n negativeDisabled: \"disabled:border-buttons-disabled-negative disabled:text-content-disabled\",\n },\n error: {\n default:\n \"bg-buttons-error-default text-content-always-white not-disabled:hover:bg-buttons-error-hover not-disabled:active:bg-buttons-error-hover\",\n disabled: DISABLED_FILL,\n },\n white: {\n default:\n \"bg-buttons-always-white-default text-content-always-black not-disabled:hover:bg-buttons-always-white-hover not-disabled:active:bg-buttons-always-white-hover\",\n disabled: DISABLED_FILL,\n },\n black: {\n default:\n \"bg-buttons-always-black-default text-content-always-white not-disabled:hover:bg-buttons-always-black-hover not-disabled:active:bg-buttons-always-black-hover\",\n disabled: DISABLED_FILL,\n },\n brand: {\n default:\n \"bg-content-always-black text-brand-primary-default hover:bg-brand-primary-default hover:text-content-always-black not-disabled:active:bg-brand-primary-default not-disabled:active:text-content-always-black\",\n disabled: DISABLED_OPACITY,\n },\n contrast: {\n default:\n \"bg-transparent text-content-always-white hover:bg-brand-primary-muted not-disabled:active:bg-brand-primary-muted\",\n disabled: DISABLED_OPACITY,\n },\n messaging: {\n default:\n \"bg-content-always-black text-brand-primary-default hover:bg-brand-primary-default hover:text-content-always-black not-disabled:active:bg-brand-primary-default not-disabled:active:text-content-always-black\",\n disabled: DISABLED_OPACITY,\n },\n navTray: {\n default:\n \"bg-transparent text-content-primary hover:bg-brand-primary-muted not-disabled:active:bg-brand-primary-muted\",\n disabled: DISABLED_OPACITY,\n },\n tertiaryDestructive: {\n default:\n \"bg-transparent text-error-content hover:bg-brand-primary-muted not-disabled:active:bg-brand-primary-muted\",\n disabled: DISABLED_OPACITY,\n },\n stop: {\n default:\n \"bg-buttons-primary-default text-content-primary-inverted hover:bg-buttons-brand-default hover:text-content-always-black not-disabled:active:bg-buttons-brand-default not-disabled:active:text-content-always-black\",\n disabled: DISABLED_OPACITY,\n },\n microphone: {\n default:\n \"bg-buttons-primary-default text-content-primary-inverted hover:bg-buttons-brand-default hover:text-content-always-black not-disabled:active:bg-buttons-brand-default not-disabled:active:text-content-always-black\",\n disabled: DISABLED_OPACITY,\n },\n // Carries the input surface rather than a button one, so an icon-only action can\n // sit flush in a row of fields (Figma draws these as a `V2 Input Fields` instance\n // with only an icon inside). Border and hover match the Select trigger it lines up\n // with, so the row reads as one control group.\n field: {\n default:\n \"border border-border-primary bg-inputs-inputs-primary text-content-primary not-disabled:hover:border-neutral-alphas-400\",\n disabled: DISABLED_TRANSPARENT,\n },\n};\n\nfunction getVariantClasses(variant: IconButtonVariant, negative: boolean): string {\n const classes = VARIANT_CLASSES[variant];\n const isNegative = NEGATIVE_AWARE_VARIANTS.has(variant) && negative;\n const base = (isNegative && classes.negative) || classes.default;\n const disabledClasses = (isNegative && classes.negativeDisabled) || classes.disabled;\n return cn(base, disabledClasses);\n}\n\nexport interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Visual style variant of the icon button. @default \"primary\" */\n variant?: IconButtonVariant;\n /** Size of the button in pixels. @default \"40\" */\n size?: IconButtonSize;\n /** Icon element to render inside the button. */\n icon: React.ReactNode;\n /**\n * Forces the dark-surface treatment regardless of theme. Only honoured on the\n * `primary`, `secondary`, `tertiary`, and `outline` variants. @default false\n */\n negative?: boolean;\n /** When provided, displays a {@link Count} badge at the top-right corner. */\n counterValue?: number;\n}\n\n/**\n * A button containing only an icon. Use when an action can be represented by an\n * icon alone (e.g. close, send). Always pair with an `aria-label` for\n * accessibility.\n *\n * Shape is size-driven for the standard variants: the `24` size is squared\n * (`rounded-xs`), every larger size is circular. Bespoke variants (`brand`,\n * `contrast`, `messaging`, `navTray`, `tertiaryDestructive`, `stop`,\n * `microphone`) stay circular at all sizes. `field` is the exception that is\n * never circular — it takes the inputs' `rounded-sm` so it matches the fields it\n * sits beside. Use it at `32`, `40` or `48`: those are the sizes `Select` offers,\n * and the variant only earns its surface when it lines up with one.\n *\n * @example\n * ```tsx\n * <IconButton icon={<CloseIcon />} aria-label=\"Close\" variant=\"tertiary\" />\n * ```\n */\nexport const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n {\n className,\n variant = \"primary\",\n size = \"40\",\n icon,\n counterValue,\n negative = false,\n disabled = false,\n ...props\n },\n ref,\n ) => {\n if (process.env.NODE_ENV !== \"production\") {\n if (!props[\"aria-label\"] && !props[\"aria-labelledby\"] && !props.title) {\n console.warn(\n \"IconButton: No accessible name provided. Add an `aria-label`, `aria-labelledby`, or `title` prop so screen readers can announce this button.\",\n );\n }\n }\n\n return (\n <button\n ref={ref}\n type=\"button\"\n data-testid=\"icon-button\"\n disabled={disabled}\n className={cn(\n \"relative inline-flex shrink-0 items-center justify-center focus-visible:outline-none\",\n \"cursor-pointer transition-all duration-150 ease-in-out disabled:cursor-default\",\n \"focus-visible:shadow-focus-ring\",\n // `field` takes the inputs' radius at every size so it lines up with the\n // fields around it; everything else keeps the existing size-driven shape.\n variant === \"field\"\n ? \"rounded-sm\"\n : SIZE_DRIVEN_SHAPE_VARIANTS.has(variant) && size === \"24\"\n ? \"rounded-xs\"\n : \"rounded-full\",\n sizeVariants[size],\n getVariantClasses(variant, negative),\n className,\n )}\n {...props}\n >\n <span\n className={cn(\"flex shrink-0 items-center justify-center\", iconSizeVariants[size])}\n aria-hidden=\"true\"\n >\n {/* A button sizes its own icon, so a menu row's icon defaults stop here. */}\n <IconDefaultsContext.Provider value={NO_ICON_DEFAULTS}>\n {icon}\n </IconDefaultsContext.Provider>\n </span>\n\n {counterValue !== undefined && (\n <Count\n value={counterValue}\n variant=\"alert\"\n size={countSizeMap[size]}\n className=\"absolute -top-0.5 -right-0.5\"\n />\n )}\n </button>\n );\n },\n);\n\nIconButton.displayName = \"IconButton\";\n"],"names":[],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"IconButton.mjs","sources":["../../../src/components/IconButton/IconButton.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Count, type CountSize } from \"../Count/Count\";\nimport { IconDefaultsContext, NO_ICON_DEFAULTS } from \"../Icons/IconDefaults\";\n\n/**\n * Visual style variant of the icon button.\n *\n * `primary`, `secondary`, `tertiary`, `outline`, `error`, `white` and `black`\n * use the shared button colour tokens and a size-driven shape (squared at the\n * `24` size, circular otherwise). Of these, `primary`, `secondary`, `tertiary`\n * and `outline` also honour the {@link IconButtonProps.negative} prop, as does\n * `upsell`, which takes the other theme's glow.\n *\n * `upsell` is the Figma \"Upsell\" icon button and matches `Button`'s `brand`\n * variant: a green radial fill, a green glow and a highlight that circles the\n * rim once, held still when the user prefers reduced motion. It takes the same\n * size-driven shape as the standard variants.\n *\n * `overlay` is a translucent dark fill with a backdrop blur, for buttons that sit\n * on photos or video. Its fill and icon look the same in light and dark themes, while\n * the keyboard focus ring still follows the theme. It takes the same size-driven\n * shape as the standard variants.\n *\n * `brand`, `contrast`, `messaging`, `navTray`, `tertiaryDestructive`, `stop` and\n * `microphone` are bespoke variants that stay circular at every size.\n */\nexport type IconButtonVariant =\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"outline\"\n | \"error\"\n | \"white\"\n | \"black\"\n | \"brand\"\n | \"upsell\"\n | \"contrast\"\n | \"messaging\"\n | \"navTray\"\n | \"tertiaryDestructive\"\n | \"stop\"\n | \"microphone\"\n | \"overlay\"\n | \"field\";\n\n/** Icon button size in pixels. */\nexport type IconButtonSize = \"24\" | \"32\" | \"40\" | \"48\" | \"52\" | \"72\";\n\nconst iconSizeVariants: Record<IconButtonSize, string> = {\n 24: \"[&>svg]:size-4\",\n 32: \"[&>svg]:size-4\",\n 40: \"[&>svg]:size-4\",\n 48: \"[&>svg]:size-6\",\n 52: \"[&>svg]:size-7\",\n 72: \"[&>svg]:size-8\",\n};\n\nconst sizeVariants: Record<IconButtonSize, string> = {\n 24: \"size-6 p-1\",\n 32: \"size-8 p-1.5\",\n 40: \"size-10 p-[10px]\",\n 48: \"size-12 p-3\",\n 52: \"size-[52px] p-2\",\n 72: \"size-[72px] p-4\",\n};\n\nconst countSizeMap: Record<IconButtonSize, CountSize> = {\n 24: \"16\",\n 32: \"24\",\n 40: \"32\",\n 48: \"32\",\n 52: \"32\",\n 72: \"32\",\n};\n\n/**\n * Variants whose corner radius is size-driven (see {@link IconButton}): the `24`\n * size is squared (`rounded-xs`), every larger size stays circular. All other\n * variants are circular at every size.\n */\nconst SIZE_DRIVEN_SHAPE_VARIANTS = new Set<IconButtonVariant>([\n \"primary\",\n \"secondary\",\n \"tertiary\",\n \"outline\",\n \"error\",\n \"white\",\n \"black\",\n \"upsell\",\n \"overlay\",\n]);\n\n/** Variants that honour the `negative` (dark-surface) treatment. */\nconst NEGATIVE_AWARE_VARIANTS = new Set<IconButtonVariant>([\n \"primary\",\n \"secondary\",\n \"tertiary\",\n \"outline\",\n \"upsell\",\n]);\n\nconst DISABLED_FILL = \"disabled:bg-buttons-disabled-default disabled:text-content-disabled\";\nconst DISABLED_FILL_NEGATIVE =\n \"disabled:bg-buttons-disabled-negative disabled:text-content-disabled\";\nconst UPSELL =\n \"fv-upsell fv-upsell-shine bg-buttons-brand-default text-content-always-black not-disabled:hover:[--fv-upsell-end:var(--color-buttons-brand-hover)] not-disabled:active:[--fv-upsell-end:var(--color-buttons-brand-hover)]\";\nconst DISABLED_TRANSPARENT = \"disabled:text-content-disabled\";\nconst DISABLED_OPACITY = \"disabled:opacity-50\";\n\ntype VariantClasses = {\n default: string;\n disabled: string;\n negative?: string;\n negativeDisabled?: string;\n};\n\n/**\n * Icon button styling for every variant. The disabled treatment is expressed\n * with the CSS `disabled:` variant (not the `disabled` prop) so an ancestor\n * `<fieldset disabled>` is styled too; hover is guarded with `not-disabled:` so\n * it never fights the disabled state.\n */\nconst VARIANT_CLASSES: Record<IconButtonVariant, VariantClasses> = {\n primary: {\n default:\n \"bg-buttons-primary-default text-content-primary-inverted not-disabled:hover:bg-buttons-primary-hover not-disabled:active:bg-buttons-primary-hover\",\n disabled: DISABLED_FILL,\n negative:\n \"bg-buttons-primary-negative-default text-content-primary not-disabled:hover:bg-buttons-primary-negative-hover not-disabled:active:bg-buttons-primary-negative-hover\",\n negativeDisabled: DISABLED_FILL_NEGATIVE,\n },\n secondary: {\n default:\n \"bg-buttons-secondary-default text-content-primary not-disabled:hover:bg-buttons-secondary-hover not-disabled:active:bg-buttons-secondary-hover\",\n disabled: DISABLED_FILL,\n negative:\n \"bg-buttons-secondary-negative-default text-content-primary-inverted not-disabled:hover:bg-buttons-secondary-negative-hover not-disabled:active:bg-buttons-secondary-negative-hover\",\n negativeDisabled: DISABLED_FILL_NEGATIVE,\n },\n tertiary: {\n default:\n \"bg-transparent text-content-primary not-disabled:hover:bg-buttons-tertiary-hover not-disabled:active:bg-buttons-tertiary-hover\",\n disabled: DISABLED_TRANSPARENT,\n negative:\n \"bg-transparent text-content-primary-inverted not-disabled:hover:bg-buttons-tertiary-negative-hover not-disabled:active:bg-buttons-tertiary-negative-hover\",\n negativeDisabled: DISABLED_TRANSPARENT,\n },\n outline: {\n default:\n \"border border-buttons-outline-default bg-transparent text-content-primary not-disabled:hover:bg-buttons-outline-hover not-disabled:active:bg-buttons-outline-hover\",\n disabled: \"disabled:border-buttons-disabled-default disabled:text-content-disabled\",\n negative:\n \"border border-buttons-outline-negative-default bg-transparent text-content-primary-inverted not-disabled:hover:bg-buttons-outline-negative-hover not-disabled:active:bg-buttons-outline-negative-hover\",\n negativeDisabled: \"disabled:border-buttons-disabled-negative disabled:text-content-disabled\",\n },\n error: {\n default:\n \"bg-buttons-error-default text-content-always-white not-disabled:hover:bg-buttons-error-hover not-disabled:active:bg-buttons-error-hover\",\n disabled: DISABLED_FILL,\n },\n white: {\n default:\n \"bg-buttons-always-white-default text-content-always-black not-disabled:hover:bg-buttons-always-white-hover not-disabled:active:bg-buttons-always-white-hover\",\n disabled: DISABLED_FILL,\n },\n black: {\n default:\n \"bg-buttons-always-black-default text-content-always-white not-disabled:hover:bg-buttons-always-black-hover not-disabled:active:bg-buttons-always-black-hover\",\n disabled: DISABLED_FILL,\n },\n brand: {\n default:\n \"bg-content-always-black text-brand-primary-default hover:bg-brand-primary-default hover:text-content-always-black not-disabled:active:bg-brand-primary-default not-disabled:active:text-content-always-black\",\n disabled: DISABLED_OPACITY,\n },\n upsell: {\n default: UPSELL,\n negative: `${UPSELL} fv-upsell-negative`,\n disabled: DISABLED_FILL,\n negativeDisabled: DISABLED_FILL_NEGATIVE,\n },\n contrast: {\n default:\n \"bg-transparent text-content-always-white hover:bg-brand-primary-muted not-disabled:active:bg-brand-primary-muted\",\n disabled: DISABLED_OPACITY,\n },\n messaging: {\n default:\n \"bg-content-always-black text-brand-primary-default hover:bg-brand-primary-default hover:text-content-always-black not-disabled:active:bg-brand-primary-default not-disabled:active:text-content-always-black\",\n disabled: DISABLED_OPACITY,\n },\n navTray: {\n default:\n \"bg-transparent text-content-primary hover:bg-brand-primary-muted not-disabled:active:bg-brand-primary-muted\",\n disabled: DISABLED_OPACITY,\n },\n tertiaryDestructive: {\n default:\n \"bg-transparent text-error-content hover:bg-brand-primary-muted not-disabled:active:bg-brand-primary-muted\",\n disabled: DISABLED_OPACITY,\n },\n stop: {\n default:\n \"bg-buttons-primary-default text-content-primary-inverted hover:bg-buttons-brand-default hover:text-content-always-black not-disabled:active:bg-buttons-brand-default not-disabled:active:text-content-always-black\",\n disabled: DISABLED_OPACITY,\n },\n microphone: {\n default:\n \"bg-buttons-primary-default text-content-primary-inverted hover:bg-buttons-brand-default hover:text-content-always-black not-disabled:active:bg-buttons-brand-default not-disabled:active:text-content-always-black\",\n disabled: DISABLED_OPACITY,\n },\n overlay: {\n default:\n \"bg-buttons-overlay-default text-content-always-white backdrop-blur-sm not-disabled:hover:bg-buttons-overlay-hover not-disabled:active:bg-buttons-overlay-hover\",\n disabled: DISABLED_OPACITY,\n },\n // Carries the input surface rather than a button one, so an icon-only action can\n // sit flush in a row of fields (Figma draws these as a `V2 Input Fields` instance\n // with only an icon inside). Border and hover match the Select trigger it lines up\n // with, so the row reads as one control group.\n field: {\n default:\n \"border border-border-primary bg-inputs-inputs-primary text-content-primary not-disabled:hover:border-neutral-alphas-400\",\n disabled: DISABLED_TRANSPARENT,\n },\n};\n\nfunction getVariantClasses(variant: IconButtonVariant, negative: boolean): string {\n const classes = VARIANT_CLASSES[variant];\n const isNegative = NEGATIVE_AWARE_VARIANTS.has(variant) && negative;\n const base = (isNegative && classes.negative) || classes.default;\n const disabledClasses = (isNegative && classes.negativeDisabled) || classes.disabled;\n return cn(base, disabledClasses);\n}\n\nexport interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Visual style variant of the icon button. @default \"primary\" */\n variant?: IconButtonVariant;\n /** Size of the button in pixels. @default \"40\" */\n size?: IconButtonSize;\n /** Icon element to render inside the button. */\n icon: React.ReactNode;\n /**\n * Forces the dark-surface treatment regardless of theme. Only honoured on the\n * `primary`, `secondary`, `tertiary`, and `outline` variants. @default false\n */\n negative?: boolean;\n /** When provided, displays a {@link Count} badge at the top-right corner. */\n counterValue?: number;\n}\n\n/**\n * A button containing only an icon. Use when an action can be represented by an\n * icon alone (e.g. close, send). Always pair with an `aria-label` for\n * accessibility.\n *\n * Shape is size-driven for the standard variants, `upsell` and `overlay`: the `24` size is\n * squared (`rounded-xs`), every larger size is circular. Bespoke variants (`brand`,\n * `contrast`, `messaging`, `navTray`, `tertiaryDestructive`, `stop`,\n * `microphone`) stay circular at all sizes. `field` is the exception that is\n * never circular — it takes the inputs' `rounded-sm` so it matches the fields it\n * sits beside. Use it at `32`, `40` or `48`: those are the sizes `Select` offers,\n * and the variant only earns its surface when it lines up with one.\n *\n * @example\n * ```tsx\n * <IconButton icon={<CloseIcon />} aria-label=\"Close\" variant=\"tertiary\" />\n * ```\n */\nexport const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n {\n className,\n variant = \"primary\",\n size = \"40\",\n icon,\n counterValue,\n negative = false,\n disabled = false,\n ...props\n },\n ref,\n ) => {\n if (process.env.NODE_ENV !== \"production\") {\n if (!props[\"aria-label\"] && !props[\"aria-labelledby\"] && !props.title) {\n console.warn(\n \"IconButton: No accessible name provided. Add an `aria-label`, `aria-labelledby`, or `title` prop so screen readers can announce this button.\",\n );\n }\n }\n\n return (\n <button\n ref={ref}\n type=\"button\"\n data-testid=\"icon-button\"\n disabled={disabled}\n className={cn(\n \"relative inline-flex shrink-0 items-center justify-center focus-visible:outline-none\",\n \"cursor-pointer transition-all duration-150 ease-in-out disabled:cursor-default\",\n \"focus-visible:shadow-focus-ring\",\n // `field` takes the inputs' radius at every size so it lines up with the\n // fields around it; everything else keeps the existing size-driven shape.\n variant === \"field\"\n ? \"rounded-sm\"\n : SIZE_DRIVEN_SHAPE_VARIANTS.has(variant) && size === \"24\"\n ? \"rounded-xs\"\n : \"rounded-full\",\n sizeVariants[size],\n getVariantClasses(variant, negative),\n className,\n )}\n {...props}\n >\n <span\n className={cn(\"flex shrink-0 items-center justify-center\", iconSizeVariants[size])}\n aria-hidden=\"true\"\n >\n {/* A button sizes its own icon, so a menu row's icon defaults stop here. */}\n <IconDefaultsContext.Provider value={NO_ICON_DEFAULTS}>\n {icon}\n </IconDefaultsContext.Provider>\n </span>\n\n {counterValue !== undefined && (\n <Count\n value={counterValue}\n variant=\"alert\"\n size={countSizeMap[size]}\n className=\"absolute -top-0.5 -right-0.5 z-10\"\n />\n )}\n </button>\n );\n },\n);\n\nIconButton.displayName = \"IconButton\";\n"],"names":[],"mappings":"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"}
|
|
@@ -4,6 +4,7 @@ import * as React from "react";
|
|
|
4
4
|
import { cn } from "../../utils/cn.mjs";
|
|
5
5
|
import { IconDefaultsContext } from "./IconDefaults.mjs";
|
|
6
6
|
import { ICON_SIZE_CLASS } from "./iconSizeClass.mjs";
|
|
7
|
+
import { ICON_SPIN_CLASS } from "./iconSpinClass.mjs";
|
|
7
8
|
const LAYER_TRANSITION = "motion-safe:transition-opacity motion-safe:duration-150 motion-safe:ease-in-out";
|
|
8
9
|
const renderPath = (p) => p.sw !== void 0 ? /* @__PURE__ */ jsx(
|
|
9
10
|
"path",
|
|
@@ -26,7 +27,7 @@ const renderPath = (p) => p.sw !== void 0 ? /* @__PURE__ */ jsx(
|
|
|
26
27
|
p.d
|
|
27
28
|
);
|
|
28
29
|
const BaseIcon = React.forwardRef(
|
|
29
|
-
({ variants, size: sizeProp, filled: filledProp, className, ...props }, ref) => {
|
|
30
|
+
({ variants, size: sizeProp, filled: filledProp, spin = false, className, ...props }, ref) => {
|
|
30
31
|
const defaults = React.useContext(IconDefaultsContext);
|
|
31
32
|
const size = sizeProp ?? (defaults.size !== void 0 && variants[defaults.size] ? defaults.size : 24);
|
|
32
33
|
const filled = filledProp ?? (defaults.filled && variants[size]?.filled ? true : void 0);
|
|
@@ -46,7 +47,7 @@ const BaseIcon = React.forwardRef(
|
|
|
46
47
|
viewBox: `0 0 ${size} ${size}`,
|
|
47
48
|
fill: "none",
|
|
48
49
|
"aria-hidden": "true",
|
|
49
|
-
className: cn(ICON_SIZE_CLASS[size], className),
|
|
50
|
+
className: cn(ICON_SIZE_CLASS[size], spin && ICON_SPIN_CLASS, className),
|
|
50
51
|
...props,
|
|
51
52
|
children: [
|
|
52
53
|
/* @__PURE__ */ jsx("g", { className: cn(LAYER_TRANSITION, showFilled ? "opacity-0" : "opacity-100"), children: outlined.map(renderPath) }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseIcon.mjs","sources":["../../../src/components/Icons/BaseIcon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { IconDefaultsContext } from \"./IconDefaults\";\nimport { ICON_SIZE_CLASS } from \"./iconSizeClass\";\nimport type { BaseIconProps, IconPath, IconVariants } from \"./types\";\n\nconst LAYER_TRANSITION =\n \"motion-safe:transition-opacity motion-safe:duration-150 motion-safe:ease-in-out\";\n\ninterface InternalBaseIconProps extends BaseIconProps {\n variants: IconVariants;\n}\n\nconst renderPath = (p: IconPath) =>\n p.sw !== undefined ? (\n <path\n key={p.d}\n d={p.d}\n stroke=\"currentColor\"\n strokeWidth={p.sw}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n ) : (\n <path\n key={p.d}\n d={p.d}\n fill=\"currentColor\"\n fillRule={p.eo ? \"evenodd\" : undefined}\n clipRule={p.eo ? \"evenodd\" : undefined}\n />\n );\n\n/**\n * Internal renderer for prop-based icons. Each public icon (e.g. `HeartIcon`)\n * is a thin wrapper that supplies its own `variants` table and re-exports\n * {@link BaseIconProps} as `*IconProps`. Not exported from the package.\n *\n * When a `filled` variant exists, both layers are rendered simultaneously and\n * the `filled` prop crossfades between them. The same `<svg>` and `<g>` nodes\n * persist across toggles so the transition is visible rather than an instant\n * remount.\n */\nexport const BaseIcon = React.forwardRef<SVGSVGElement, InternalBaseIconProps>(\n ({ variants, size: sizeProp, filled: filledProp, className, ...props }, ref) => {\n const defaults = React.useContext(IconDefaultsContext);\n // A container default only applies when the icon has artwork for it, so an\n // icon drawn at 24/32 only, or without a filled 16, keeps its own look.\n const size =\n sizeProp ?? (defaults.size !== undefined && variants[defaults.size] ? defaults.size : 24);\n const filled = filledProp ?? (defaults.filled && variants[size]?.filled ? true : undefined);\n const v = variants[size];\n const outlined = v?.outlined ?? [];\n const filledPaths = v?.filled;\n const showFilled = !!(filled && filledPaths);\n\n if (filled && !filledPaths && v && process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[fanvue/ui] Icon at size=${size} has no 'filled' variant; falling back to outlined.`,\n );\n }\n\n return (\n <svg\n ref={ref}\n viewBox={`0 0 ${size} ${size}`}\n fill=\"none\"\n aria-hidden=\"true\"\n className={cn(ICON_SIZE_CLASS[size], className)}\n {...props}\n >\n <g className={cn(LAYER_TRANSITION, showFilled ? \"opacity-0\" : \"opacity-100\")}>\n {outlined.map(renderPath)}\n </g>\n {filledPaths && (\n <g className={cn(LAYER_TRANSITION, showFilled ? \"opacity-100\" : \"opacity-0\")}>\n {filledPaths.map(renderPath)}\n </g>\n )}\n </svg>\n );\n },\n);\n\nBaseIcon.displayName = \"BaseIcon\";\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BaseIcon.mjs","sources":["../../../src/components/Icons/BaseIcon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { IconDefaultsContext } from \"./IconDefaults\";\nimport { ICON_SIZE_CLASS } from \"./iconSizeClass\";\nimport { ICON_SPIN_CLASS } from \"./iconSpinClass\";\nimport type { BaseIconProps, IconPath, IconVariants } from \"./types\";\n\nconst LAYER_TRANSITION =\n \"motion-safe:transition-opacity motion-safe:duration-150 motion-safe:ease-in-out\";\n\ninterface InternalBaseIconProps extends BaseIconProps {\n variants: IconVariants;\n}\n\nconst renderPath = (p: IconPath) =>\n p.sw !== undefined ? (\n <path\n key={p.d}\n d={p.d}\n stroke=\"currentColor\"\n strokeWidth={p.sw}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n ) : (\n <path\n key={p.d}\n d={p.d}\n fill=\"currentColor\"\n fillRule={p.eo ? \"evenodd\" : undefined}\n clipRule={p.eo ? \"evenodd\" : undefined}\n />\n );\n\n/**\n * Internal renderer for prop-based icons. Each public icon (e.g. `HeartIcon`)\n * is a thin wrapper that supplies its own `variants` table and re-exports\n * {@link BaseIconProps} as `*IconProps`. Not exported from the package.\n *\n * When a `filled` variant exists, both layers are rendered simultaneously and\n * the `filled` prop crossfades between them. The same `<svg>` and `<g>` nodes\n * persist across toggles so the transition is visible rather than an instant\n * remount.\n */\nexport const BaseIcon = React.forwardRef<SVGSVGElement, InternalBaseIconProps>(\n ({ variants, size: sizeProp, filled: filledProp, spin = false, className, ...props }, ref) => {\n const defaults = React.useContext(IconDefaultsContext);\n // A container default only applies when the icon has artwork for it, so an\n // icon drawn at 24/32 only, or without a filled 16, keeps its own look.\n const size =\n sizeProp ?? (defaults.size !== undefined && variants[defaults.size] ? defaults.size : 24);\n const filled = filledProp ?? (defaults.filled && variants[size]?.filled ? true : undefined);\n const v = variants[size];\n const outlined = v?.outlined ?? [];\n const filledPaths = v?.filled;\n const showFilled = !!(filled && filledPaths);\n\n if (filled && !filledPaths && v && process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[fanvue/ui] Icon at size=${size} has no 'filled' variant; falling back to outlined.`,\n );\n }\n\n return (\n <svg\n ref={ref}\n viewBox={`0 0 ${size} ${size}`}\n fill=\"none\"\n aria-hidden=\"true\"\n className={cn(ICON_SIZE_CLASS[size], spin && ICON_SPIN_CLASS, className)}\n {...props}\n >\n <g className={cn(LAYER_TRANSITION, showFilled ? \"opacity-0\" : \"opacity-100\")}>\n {outlined.map(renderPath)}\n </g>\n {filledPaths && (\n <g className={cn(LAYER_TRANSITION, showFilled ? \"opacity-100\" : \"opacity-0\")}>\n {filledPaths.map(renderPath)}\n </g>\n )}\n </svg>\n );\n },\n);\n\nBaseIcon.displayName = \"BaseIcon\";\n"],"names":[],"mappings":";;;;;;;AAOA,MAAM,mBACJ;AAMF,MAAM,aAAa,CAAC,MAClB,EAAE,OAAO,SACP;AAAA,EAAC;AAAA,EAAA;AAAA,IAEC,GAAG,EAAE;AAAA,IACL,QAAO;AAAA,IACP,aAAa,EAAE;AAAA,IACf,eAAc;AAAA,IACd,gBAAe;AAAA,EAAA;AAAA,EALV,EAAE;AAMT,IAEA;AAAA,EAAC;AAAA,EAAA;AAAA,IAEC,GAAG,EAAE;AAAA,IACL,MAAK;AAAA,IACL,UAAU,EAAE,KAAK,YAAY;AAAA,IAC7B,UAAU,EAAE,KAAK,YAAY;AAAA,EAAA;AAAA,EAJxB,EAAE;AAKT;AAaG,MAAM,WAAW,MAAM;AAAA,EAC5B,CAAC,EAAE,UAAU,MAAM,UAAU,QAAQ,YAAY,OAAO,OAAO,WAAW,GAAG,MAAA,GAAS,QAAQ;AAC5F,UAAM,WAAW,MAAM,WAAW,mBAAmB;AAGrD,UAAM,OACJ,aAAa,SAAS,SAAS,UAAa,SAAS,SAAS,IAAI,IAAI,SAAS,OAAO;AACxF,UAAM,SAAS,eAAe,SAAS,UAAU,SAAS,IAAI,GAAG,SAAS,OAAO;AACjF,UAAM,IAAI,SAAS,IAAI;AACvB,UAAM,WAAW,GAAG,YAAY,CAAA;AAChC,UAAM,cAAc,GAAG;AACvB,UAAM,aAAa,CAAC,EAAE,UAAU;AAEhC,QAAI,UAAU,CAAC,eAAe,KAAK,QAAQ,IAAI,aAAa,cAAc;AACxE,cAAQ;AAAA,QACN,4BAA4B,IAAI;AAAA,MAAA;AAAA,IAEpC;AAEA,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,SAAS,OAAO,IAAI,IAAI,IAAI;AAAA,QAC5B,MAAK;AAAA,QACL,eAAY;AAAA,QACZ,WAAW,GAAG,gBAAgB,IAAI,GAAG,QAAQ,iBAAiB,SAAS;AAAA,QACtE,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAA,oBAAC,KAAA,EAAE,WAAW,GAAG,kBAAkB,aAAa,cAAc,aAAa,GACxE,UAAA,SAAS,IAAI,UAAU,EAAA,CAC1B;AAAA,UACC,eACC,oBAAC,KAAA,EAAE,WAAW,GAAG,kBAAkB,aAAa,gBAAgB,WAAW,GACxE,UAAA,YAAY,IAAI,UAAU,EAAA,CAC7B;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,SAAS,cAAc;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { BaseIcon } from "./BaseIcon.mjs";
|
|
5
|
+
const VARIANTS = {
|
|
6
|
+
16: {
|
|
7
|
+
outlined: [
|
|
8
|
+
{
|
|
9
|
+
d: "M10 15.167H6C2.38 15.167.833 13.62.833 10V6C.833 2.38 2.38.833 6 .833h3.333c.274 0 .5.227.5.5 0 .274-.226.5-.5.5H6C2.927 1.833 1.833 2.927 1.833 6v4c0 3.073 1.094 4.167 4.167 4.167h4c3.073 0 4.167-1.094 4.167-4.167V6.667c0-.274.226-.5.5-.5.273 0 .5.226.5.5V10c0 3.62-1.547 5.167-5.167 5.167"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
d: "M14.667 7.167H12C9.72 7.167 8.833 6.28 8.833 4V1.333c0-.2.12-.386.307-.46.187-.08.4-.033.547.107l5.333 5.333a.502.502 0 0 1-.353.854M9.833 2.54V4c0 1.72.447 2.167 2.167 2.167h1.46zM8.667 9.167h-4a.504.504 0 0 1-.5-.5c0-.274.226-.5.5-.5h4c.273 0 .5.226.5.5 0 .273-.227.5-.5.5m-1.334 2.666H4.667a.504.504 0 0 1-.5-.5c0-.273.226-.5.5-.5h2.666c.274 0 .5.227.5.5 0 .274-.226.5-.5.5"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
filled: [
|
|
16
|
+
{
|
|
17
|
+
d: "M10.667 1.333H5.333C3 1.333 2 2.667 2 4.667v6.666c0 2 1 3.334 3.333 3.334h5.334C13 14.667 14 13.333 14 11.333V4.667c0-2-1-3.334-3.333-3.334M5.333 8.167H8c.273 0 .5.226.5.5 0 .273-.227.5-.5.5H5.333a.504.504 0 0 1-.5-.5c0-.274.227-.5.5-.5m5.334 3.666H5.333a.504.504 0 0 1-.5-.5c0-.273.227-.5.5-.5h5.334c.273 0 .5.227.5.5 0 .274-.227.5-.5.5m1.666-5.666H11a1.83 1.83 0 0 1-1.833-1.834V3c0-.273.226-.5.5-.5.273 0 .5.227.5.5v1.333c0 .46.373.834.833.834h1.333c.274 0 .5.226.5.5 0 .273-.226.5-.5.5"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
24: {
|
|
22
|
+
outlined: [
|
|
23
|
+
{
|
|
24
|
+
d: "M15 22.75H9c-5.43 0-7.75-2.32-7.75-7.75V9c0-5.43 2.32-7.75 7.75-7.75h5c.41 0 .75.34.75.75s-.34.75-.75.75H9C4.39 2.75 2.75 4.39 2.75 9v6c0 4.61 1.64 6.25 6.25 6.25h6c4.61 0 6.25-1.64 6.25-6.25v-5c0-.41.34-.75.75-.75s.75.34.75.75v5c0 5.43-2.32 7.75-7.75 7.75"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
d: "M22 10.75h-4c-3.42 0-4.75-1.33-4.75-4.75V2c0-.3.18-.58.46-.69.28-.12.6-.05.82.16l8 8a.751.751 0 0 1-.53 1.28m-7.25-6.94V6c0 2.58.67 3.25 3.25 3.25h2.19zM13 13.75H7c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h6c.41 0 .75.34.75.75s-.34.75-.75.75m-2 4H7c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h4c.41 0 .75.34.75.75s-.34.75-.75.75"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
filled: [
|
|
31
|
+
{
|
|
32
|
+
d: "M16 2H8C4.5 2 3 4 3 7v10c0 3 1.5 5 5 5h8c3.5 0 5-2 5-5V7c0-3-1.5-5-5-5M8 12.25h4c.41 0 .75.34.75.75s-.34.75-.75.75H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75m8 5.5H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h8c.41 0 .75.34.75.75s-.34.75-.75.75m2.5-8.5h-2c-1.52 0-2.75-1.23-2.75-2.75v-2c0-.41.34-.75.75-.75s.75.34.75.75v2c0 .69.56 1.25 1.25 1.25h2c.41 0 .75.34.75.75s-.34.75-.75.75"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
32: {
|
|
37
|
+
outlined: [
|
|
38
|
+
{
|
|
39
|
+
d: "M20 30.333h-8C4.76 30.333 1.667 27.24 1.667 20v-8C1.666 4.76 4.76 1.667 12 1.667h6.666c.547 0 1 .453 1 1s-.453 1-1 1H12c-6.147 0-8.333 2.186-8.333 8.333v8c0 6.147 2.186 8.333 8.333 8.333h8c6.147 0 8.333-2.186 8.333-8.333v-6.667c0-.546.454-1 1-1 .547 0 1 .454 1 1V20c0 7.24-3.093 10.333-10.333 10.333"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
d: "M29.333 14.334H24c-4.56 0-6.334-1.773-6.334-6.333V2.667c0-.4.24-.773.614-.92.373-.16.8-.066 1.093.214L30.04 12.627a1.002 1.002 0 0 1-.707 1.707M19.667 5.08V8c0 3.44.893 4.333 4.333 4.333h2.92zm-2.333 13.253h-8c-.547 0-1-.453-1-1s.453-1 1-1h8c.546 0 1 .454 1 1 0 .547-.454 1-1 1m-2.667 5.334H9.334c-.547 0-1-.454-1-1 0-.547.453-1 1-1h5.333c.547 0 1 .453 1 1s-.453 1-1 1"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
filled: [
|
|
46
|
+
{
|
|
47
|
+
d: "M21.333 2.667H10.667C6 2.667 4 5.333 4 9.333v13.333c0 4 2 6.667 6.667 6.667h10.666C26 29.333 28 26.667 28 22.667V9.333c0-4-2-6.666-6.667-6.666M10.667 16.333H16c.547 0 1 .454 1 1 0 .547-.453 1-1 1h-5.333c-.547 0-1-.453-1-1s.453-1 1-1m10.666 7.334H10.667c-.547 0-1-.454-1-1 0-.547.453-1 1-1h10.666c.547 0 1 .453 1 1s-.453 1-1 1m3.334-11.334H22a3.665 3.665 0 0 1-3.667-3.667V6c0-.547.454-1 1-1 .547 0 1 .453 1 1v2.666c0 .92.747 1.667 1.667 1.667h2.667c.546 0 1 .454 1 1 0 .547-.454 1-1 1"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const DocumentIcon = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(BaseIcon, { ref, variants: VARIANTS, ...props }));
|
|
53
|
+
DocumentIcon.displayName = "DocumentIcon";
|
|
54
|
+
export {
|
|
55
|
+
DocumentIcon
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=DocumentIcon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentIcon.mjs","sources":["../../../src/components/Icons/DocumentIcon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { BaseIcon } from \"./BaseIcon\";\nimport type { BaseIconProps, IconVariants } from \"./types\";\n\nconst VARIANTS: IconVariants = {\n 16: {\n outlined: [\n {\n d: \"M10 15.167H6C2.38 15.167.833 13.62.833 10V6C.833 2.38 2.38.833 6 .833h3.333c.274 0 .5.227.5.5 0 .274-.226.5-.5.5H6C2.927 1.833 1.833 2.927 1.833 6v4c0 3.073 1.094 4.167 4.167 4.167h4c3.073 0 4.167-1.094 4.167-4.167V6.667c0-.274.226-.5.5-.5.273 0 .5.226.5.5V10c0 3.62-1.547 5.167-5.167 5.167\",\n },\n {\n d: \"M14.667 7.167H12C9.72 7.167 8.833 6.28 8.833 4V1.333c0-.2.12-.386.307-.46.187-.08.4-.033.547.107l5.333 5.333a.502.502 0 0 1-.353.854M9.833 2.54V4c0 1.72.447 2.167 2.167 2.167h1.46zM8.667 9.167h-4a.504.504 0 0 1-.5-.5c0-.274.226-.5.5-.5h4c.273 0 .5.226.5.5 0 .273-.227.5-.5.5m-1.334 2.666H4.667a.504.504 0 0 1-.5-.5c0-.273.226-.5.5-.5h2.666c.274 0 .5.227.5.5 0 .274-.226.5-.5.5\",\n },\n ],\n filled: [\n {\n d: \"M10.667 1.333H5.333C3 1.333 2 2.667 2 4.667v6.666c0 2 1 3.334 3.333 3.334h5.334C13 14.667 14 13.333 14 11.333V4.667c0-2-1-3.334-3.333-3.334M5.333 8.167H8c.273 0 .5.226.5.5 0 .273-.227.5-.5.5H5.333a.504.504 0 0 1-.5-.5c0-.274.227-.5.5-.5m5.334 3.666H5.333a.504.504 0 0 1-.5-.5c0-.273.227-.5.5-.5h5.334c.273 0 .5.227.5.5 0 .274-.227.5-.5.5m1.666-5.666H11a1.83 1.83 0 0 1-1.833-1.834V3c0-.273.226-.5.5-.5.273 0 .5.227.5.5v1.333c0 .46.373.834.833.834h1.333c.274 0 .5.226.5.5 0 .273-.226.5-.5.5\",\n },\n ],\n },\n 24: {\n outlined: [\n {\n d: \"M15 22.75H9c-5.43 0-7.75-2.32-7.75-7.75V9c0-5.43 2.32-7.75 7.75-7.75h5c.41 0 .75.34.75.75s-.34.75-.75.75H9C4.39 2.75 2.75 4.39 2.75 9v6c0 4.61 1.64 6.25 6.25 6.25h6c4.61 0 6.25-1.64 6.25-6.25v-5c0-.41.34-.75.75-.75s.75.34.75.75v5c0 5.43-2.32 7.75-7.75 7.75\",\n },\n {\n d: \"M22 10.75h-4c-3.42 0-4.75-1.33-4.75-4.75V2c0-.3.18-.58.46-.69.28-.12.6-.05.82.16l8 8a.751.751 0 0 1-.53 1.28m-7.25-6.94V6c0 2.58.67 3.25 3.25 3.25h2.19zM13 13.75H7c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h6c.41 0 .75.34.75.75s-.34.75-.75.75m-2 4H7c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h4c.41 0 .75.34.75.75s-.34.75-.75.75\",\n },\n ],\n filled: [\n {\n d: \"M16 2H8C4.5 2 3 4 3 7v10c0 3 1.5 5 5 5h8c3.5 0 5-2 5-5V7c0-3-1.5-5-5-5M8 12.25h4c.41 0 .75.34.75.75s-.34.75-.75.75H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75m8 5.5H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h8c.41 0 .75.34.75.75s-.34.75-.75.75m2.5-8.5h-2c-1.52 0-2.75-1.23-2.75-2.75v-2c0-.41.34-.75.75-.75s.75.34.75.75v2c0 .69.56 1.25 1.25 1.25h2c.41 0 .75.34.75.75s-.34.75-.75.75\",\n },\n ],\n },\n 32: {\n outlined: [\n {\n d: \"M20 30.333h-8C4.76 30.333 1.667 27.24 1.667 20v-8C1.666 4.76 4.76 1.667 12 1.667h6.666c.547 0 1 .453 1 1s-.453 1-1 1H12c-6.147 0-8.333 2.186-8.333 8.333v8c0 6.147 2.186 8.333 8.333 8.333h8c6.147 0 8.333-2.186 8.333-8.333v-6.667c0-.546.454-1 1-1 .547 0 1 .454 1 1V20c0 7.24-3.093 10.333-10.333 10.333\",\n },\n {\n d: \"M29.333 14.334H24c-4.56 0-6.334-1.773-6.334-6.333V2.667c0-.4.24-.773.614-.92.373-.16.8-.066 1.093.214L30.04 12.627a1.002 1.002 0 0 1-.707 1.707M19.667 5.08V8c0 3.44.893 4.333 4.333 4.333h2.92zm-2.333 13.253h-8c-.547 0-1-.453-1-1s.453-1 1-1h8c.546 0 1 .454 1 1 0 .547-.454 1-1 1m-2.667 5.334H9.334c-.547 0-1-.454-1-1 0-.547.453-1 1-1h5.333c.547 0 1 .453 1 1s-.453 1-1 1\",\n },\n ],\n filled: [\n {\n d: \"M21.333 2.667H10.667C6 2.667 4 5.333 4 9.333v13.333c0 4 2 6.667 6.667 6.667h10.666C26 29.333 28 26.667 28 22.667V9.333c0-4-2-6.666-6.667-6.666M10.667 16.333H16c.547 0 1 .454 1 1 0 .547-.453 1-1 1h-5.333c-.547 0-1-.453-1-1s.453-1 1-1m10.666 7.334H10.667c-.547 0-1-.454-1-1 0-.547.453-1 1-1h10.666c.547 0 1 .453 1 1s-.453 1-1 1m3.334-11.334H22a3.665 3.665 0 0 1-3.667-3.667V6c0-.547.454-1 1-1 .547 0 1 .453 1 1v2.666c0 .92.747 1.667 1.667 1.667h2.667c.546 0 1 .454 1 1 0 .547-.454 1-1 1\",\n },\n ],\n },\n};\n\n/** Props for {@link DocumentIcon}. See {@link BaseIconProps} for the shared shape. */\nexport type DocumentIconProps = BaseIconProps;\n\n/**\n * Document icon. Renders at sizes 16, 24, or 32 px with outlined and filled variants.\n *\n * @example\n * ```tsx\n * <DocumentIcon size={24} filled />\n * ```\n */\nexport const DocumentIcon = React.forwardRef<SVGSVGElement, DocumentIconProps>((props, ref) => (\n <BaseIcon ref={ref} variants={VARIANTS} {...props} />\n));\n\nDocumentIcon.displayName = \"DocumentIcon\";\n"],"names":[],"mappings":";;;;AAIA,MAAM,WAAyB;AAAA,EAC7B,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,MAEL;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAAA,EAEF,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,MAEL;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAAA,EAEF,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,MAEL;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAEJ;AAaO,MAAM,eAAe,MAAM,WAA6C,CAAC,OAAO,QACrF,oBAAC,UAAA,EAAS,KAAU,UAAU,UAAW,GAAG,OAAO,CACpD;AAED,aAAa,cAAc;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { BaseIcon } from "./BaseIcon.mjs";
|
|
5
|
+
const VARIANTS = {
|
|
6
|
+
16: {
|
|
7
|
+
outlined: [
|
|
8
|
+
{
|
|
9
|
+
d: "M14.167 2.833a.5.5 0 0 1 0 1H1.833a.5.5 0 0 1 0-1zm0 3.334a.5.5 0 0 1 0 1H1.833a.5.5 0 0 1 0-1zm-7 3.333a.5.5 0 0 1 0 1H1.833a.5.5 0 0 1 0-1zm2.505-.612c.57-.328 1.269-.23 1.91.139h.001l1.706.986c.643.37 1.076.928 1.076 1.587s-.432 1.217-1.075 1.587h-.001l-.852.493-.854.492v.001c-.643.37-1.342.464-1.912.136-.57-.33-.838-.981-.838-1.722v-1.974c0-.743.267-1.397.839-1.725m.161 3.699c0 .525.183.766.338.856.135.078.383.117.749-.051l.164-.085 1.706-.987c.457-.264.575-.543.575-.72 0-.178-.118-.457-.575-.72l-1.706-.987c-.458-.264-.76-.227-.914-.138-.154.088-.337.328-.337.858z"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
filled: [
|
|
13
|
+
{
|
|
14
|
+
d: "M14.167 2.833a.5.5 0 1 1 0 1H1.834a.5.5 0 1 1 0-1zm0 3.334a.5.5 0 1 1 0 1H1.834a.5.5 0 1 1 0-1zm-7 3.333a.5.5 0 0 1 0 1H1.834a.5.5 0 0 1 0-1zm2.505-.612c.57-.328 1.27-.23 1.91.139h.002l1.705.986c.643.37 1.076.928 1.076 1.587s-.432 1.217-1.075 1.587l-.853.493-.853.492-.001.001c-.643.37-1.342.464-1.912.136-.57-.33-.837-.981-.837-1.722v-1.974c0-.743.266-1.397.838-1.725"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
24: {
|
|
19
|
+
outlined: [
|
|
20
|
+
{
|
|
21
|
+
d: "M21.25 4.25a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5zm0 5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5zm-10.5 5a.75.75 0 0 1 0 1.5h-8a.75.75 0 0 1 0-1.5zm3.758-.918c.856-.492 1.904-.346 2.866.208l.001.001 2.559 1.479c.964.555 1.614 1.392 1.614 2.38 0 .987-.649 1.825-1.613 2.38h-.001l-1.279.74-1.28.739h-.001c-.964.556-2.012.697-2.867.204-.855-.494-1.257-1.472-1.257-2.583v-2.96c0-1.115.4-2.095 1.258-2.588m.242 5.548c0 .788.274 1.15.506 1.284.203.117.575.176 1.124-.076l.246-.128 2.559-1.48c.686-.395.863-.814.863-1.08 0-.268-.177-.685-.862-1.08h-.001l-2.559-1.481c-.688-.396-1.14-.34-1.371-.206-.23.132-.505.492-.505 1.287z"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
filled: [
|
|
25
|
+
{
|
|
26
|
+
d: "M21.25 4.25a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5zm0 5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5zm-10.5 5a.75.75 0 0 1 0 1.5h-8a.75.75 0 0 1 0-1.5zm3.758-.918c.856-.492 1.904-.346 2.866.208l.001.001 2.559 1.479c.964.555 1.614 1.392 1.614 2.38 0 .987-.649 1.825-1.613 2.38h-.001l-1.279.74-1.28.739h-.001c-.964.556-2.012.697-2.867.204-.855-.494-1.257-1.472-1.257-2.583v-2.96c0-1.115.4-2.095 1.258-2.588"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
32: {
|
|
31
|
+
outlined: [
|
|
32
|
+
{
|
|
33
|
+
d: "M28.333 5.667a1 1 0 1 1 0 2H3.667a1 1 0 0 1 0-2zm0 6.666a1 1 0 1 1 0 2H3.667a1 1 0 0 1 0-2zm-14 6.667a1 1 0 1 1 0 2H3.667a1 1 0 1 1 0-2zm5.011-1.224c1.14-.656 2.538-.462 3.821.277l.002.002 3.411 1.971c1.286.74 2.152 1.856 2.152 3.173s-.865 2.434-2.15 3.175l-.002-.002-1.704.987-1.707.986-.002.001c-1.286.74-2.683.929-3.823.271s-1.675-1.962-1.675-3.444v-3.946c0-1.487.534-2.794 1.677-3.451m.322 7.397c0 1.051.366 1.534.675 1.712.271.157.767.235 1.499-.101l.328-.17 3.411-1.973.002-.002c.913-.526 1.15-1.084 1.15-1.44-.001-.356-.237-.913-1.15-1.439h-.002l-3.411-1.975c-.917-.528-1.52-.452-1.828-.275-.307.177-.674.657-.674 1.717z"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
filled: [
|
|
37
|
+
{
|
|
38
|
+
d: "M28.333 5.667a1 1 0 1 1 0 2H3.667a1 1 0 1 1 0-2zm0 6.666a1 1 0 1 1 0 2H3.667a1 1 0 0 1 0-2zm-14 6.667a1 1 0 1 1 0 2H3.667a1 1 0 1 1 0-2zm5.011-1.224c1.141-.656 2.538-.462 3.821.277l.002.002 3.411 1.971c1.286.74 2.152 1.856 2.153 3.173s-.865 2.434-2.152 3.175v-.002l-1.705.987-1.707.986-.002.001c-1.285.74-2.682.929-3.822.271s-1.676-1.962-1.676-3.444v-3.946c0-1.487.534-2.794 1.677-3.451"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const EpisodesIcon = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(BaseIcon, { ref, variants: VARIANTS, ...props }));
|
|
44
|
+
EpisodesIcon.displayName = "EpisodesIcon";
|
|
45
|
+
export {
|
|
46
|
+
EpisodesIcon
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=EpisodesIcon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EpisodesIcon.mjs","sources":["../../../src/components/Icons/EpisodesIcon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { BaseIcon } from \"./BaseIcon\";\nimport type { BaseIconProps, IconVariants } from \"./types\";\n\nconst VARIANTS: IconVariants = {\n 16: {\n outlined: [\n {\n d: \"M14.167 2.833a.5.5 0 0 1 0 1H1.833a.5.5 0 0 1 0-1zm0 3.334a.5.5 0 0 1 0 1H1.833a.5.5 0 0 1 0-1zm-7 3.333a.5.5 0 0 1 0 1H1.833a.5.5 0 0 1 0-1zm2.505-.612c.57-.328 1.269-.23 1.91.139h.001l1.706.986c.643.37 1.076.928 1.076 1.587s-.432 1.217-1.075 1.587h-.001l-.852.493-.854.492v.001c-.643.37-1.342.464-1.912.136-.57-.33-.838-.981-.838-1.722v-1.974c0-.743.267-1.397.839-1.725m.161 3.699c0 .525.183.766.338.856.135.078.383.117.749-.051l.164-.085 1.706-.987c.457-.264.575-.543.575-.72 0-.178-.118-.457-.575-.72l-1.706-.987c-.458-.264-.76-.227-.914-.138-.154.088-.337.328-.337.858z\",\n },\n ],\n filled: [\n {\n d: \"M14.167 2.833a.5.5 0 1 1 0 1H1.834a.5.5 0 1 1 0-1zm0 3.334a.5.5 0 1 1 0 1H1.834a.5.5 0 1 1 0-1zm-7 3.333a.5.5 0 0 1 0 1H1.834a.5.5 0 0 1 0-1zm2.505-.612c.57-.328 1.27-.23 1.91.139h.002l1.705.986c.643.37 1.076.928 1.076 1.587s-.432 1.217-1.075 1.587l-.853.493-.853.492-.001.001c-.643.37-1.342.464-1.912.136-.57-.33-.837-.981-.837-1.722v-1.974c0-.743.266-1.397.838-1.725\",\n },\n ],\n },\n 24: {\n outlined: [\n {\n d: \"M21.25 4.25a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5zm0 5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5zm-10.5 5a.75.75 0 0 1 0 1.5h-8a.75.75 0 0 1 0-1.5zm3.758-.918c.856-.492 1.904-.346 2.866.208l.001.001 2.559 1.479c.964.555 1.614 1.392 1.614 2.38 0 .987-.649 1.825-1.613 2.38h-.001l-1.279.74-1.28.739h-.001c-.964.556-2.012.697-2.867.204-.855-.494-1.257-1.472-1.257-2.583v-2.96c0-1.115.4-2.095 1.258-2.588m.242 5.548c0 .788.274 1.15.506 1.284.203.117.575.176 1.124-.076l.246-.128 2.559-1.48c.686-.395.863-.814.863-1.08 0-.268-.177-.685-.862-1.08h-.001l-2.559-1.481c-.688-.396-1.14-.34-1.371-.206-.23.132-.505.492-.505 1.287z\",\n },\n ],\n filled: [\n {\n d: \"M21.25 4.25a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5zm0 5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5zm-10.5 5a.75.75 0 0 1 0 1.5h-8a.75.75 0 0 1 0-1.5zm3.758-.918c.856-.492 1.904-.346 2.866.208l.001.001 2.559 1.479c.964.555 1.614 1.392 1.614 2.38 0 .987-.649 1.825-1.613 2.38h-.001l-1.279.74-1.28.739h-.001c-.964.556-2.012.697-2.867.204-.855-.494-1.257-1.472-1.257-2.583v-2.96c0-1.115.4-2.095 1.258-2.588\",\n },\n ],\n },\n 32: {\n outlined: [\n {\n d: \"M28.333 5.667a1 1 0 1 1 0 2H3.667a1 1 0 0 1 0-2zm0 6.666a1 1 0 1 1 0 2H3.667a1 1 0 0 1 0-2zm-14 6.667a1 1 0 1 1 0 2H3.667a1 1 0 1 1 0-2zm5.011-1.224c1.14-.656 2.538-.462 3.821.277l.002.002 3.411 1.971c1.286.74 2.152 1.856 2.152 3.173s-.865 2.434-2.15 3.175l-.002-.002-1.704.987-1.707.986-.002.001c-1.286.74-2.683.929-3.823.271s-1.675-1.962-1.675-3.444v-3.946c0-1.487.534-2.794 1.677-3.451m.322 7.397c0 1.051.366 1.534.675 1.712.271.157.767.235 1.499-.101l.328-.17 3.411-1.973.002-.002c.913-.526 1.15-1.084 1.15-1.44-.001-.356-.237-.913-1.15-1.439h-.002l-3.411-1.975c-.917-.528-1.52-.452-1.828-.275-.307.177-.674.657-.674 1.717z\",\n },\n ],\n filled: [\n {\n d: \"M28.333 5.667a1 1 0 1 1 0 2H3.667a1 1 0 1 1 0-2zm0 6.666a1 1 0 1 1 0 2H3.667a1 1 0 0 1 0-2zm-14 6.667a1 1 0 1 1 0 2H3.667a1 1 0 1 1 0-2zm5.011-1.224c1.141-.656 2.538-.462 3.821.277l.002.002 3.411 1.971c1.286.74 2.152 1.856 2.153 3.173s-.865 2.434-2.152 3.175v-.002l-1.705.987-1.707.986-.002.001c-1.285.74-2.682.929-3.822.271s-1.676-1.962-1.676-3.444v-3.946c0-1.487.534-2.794 1.677-3.451\",\n },\n ],\n },\n};\n\n/** Props for {@link EpisodesIcon}. See {@link BaseIconProps} for the shared shape. */\nexport type EpisodesIconProps = BaseIconProps;\n\n/**\n * Episodes icon. Renders at sizes 16, 24, or 32 px with outlined and filled variants.\n *\n * @example\n * ```tsx\n * <EpisodesIcon size={24} filled />\n * ```\n */\nexport const EpisodesIcon = React.forwardRef<SVGSVGElement, EpisodesIconProps>((props, ref) => (\n <BaseIcon ref={ref} variants={VARIANTS} {...props} />\n));\n\nEpisodesIcon.displayName = \"EpisodesIcon\";\n"],"names":[],"mappings":";;;;AAIA,MAAM,WAAyB;AAAA,EAC7B,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAAA,EAEF,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAAA,EAEF,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAEJ;AAaO,MAAM,eAAe,MAAM,WAA6C,CAAC,OAAO,QACrF,oBAAC,UAAA,EAAS,KAAU,UAAU,UAAW,GAAG,OAAO,CACpD;AAED,aAAa,cAAc;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { BaseIcon } from "./BaseIcon.mjs";
|
|
5
|
+
const VARIANTS = {
|
|
6
|
+
16: {
|
|
7
|
+
outlined: [
|
|
8
|
+
{
|
|
9
|
+
d: "M13.833 4.667v6.666c0 2.294-1.54 3.834-3.833 3.834H6c-2.293 0-3.833-1.54-3.833-3.834V4.667C2.167 2.373 3.707.833 6 .833h4c2.293 0 3.833 1.54 3.833 3.834M3.167 11.333c0 1.72 1.113 2.834 2.833 2.834h4c1.72 0 2.833-1.114 2.833-2.834V4.667c0-1.72-1.113-2.834-2.833-2.834H6c-1.72 0-2.833 1.114-2.833 2.834z"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
d: "M7.06 10.353c-.193 0-.38-.047-.546-.14-.387-.22-.614-.667-.614-1.22V7.019c0-.553.22-1 .614-1.22.386-.22.886-.18 1.36.107l1.646.987c.454.273.713.68.713 1.113s-.26.84-.713 1.113l-1.647.987c-.273.16-.553.247-.813.247m0-3.707A.13.13 0 0 0 7 6.66c-.047.027-.1.147-.1.354v1.973c0 .2.053.32.1.353.053.027.18.014.354-.093L9 8.26c.167-.1.227-.2.227-.26s-.06-.153-.227-.26l-1.646-.986a.63.63 0 0 0-.294-.107"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
filled: [
|
|
16
|
+
{
|
|
17
|
+
d: "M2.667 4.667v6.666c0 2 1.333 3.334 3.333 3.334h4c2 0 3.333-1.334 3.333-3.334V4.667c0-2-1.333-3.334-3.333-3.334H6c-2 0-3.333 1.334-3.333 3.334m6.522 3.955-1.646.987c-.667.4-1.214.093-1.214-.687v-1.98c0-.78.547-1.086 1.214-.686l1.646.986c.634.387.634 1 0 1.38"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
24: {
|
|
22
|
+
outlined: [
|
|
23
|
+
{
|
|
24
|
+
d: "M20.75 7v10c0 3.44-2.31 5.75-5.75 5.75H9c-3.44 0-5.75-2.31-5.75-5.75V7c0-3.44 2.31-5.75 5.75-5.75h6c3.44 0 5.75 2.31 5.75 5.75m-16 10c0 2.58 1.67 4.25 4.25 4.25h6c2.58 0 4.25-1.67 4.25-4.25V7c0-2.58-1.67-4.25-4.25-4.25H9C6.42 2.75 4.75 4.42 4.75 7z"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
d: "M10.59 15.53c-.29 0-.57-.07-.82-.21-.58-.33-.92-1-.92-1.83v-2.96c0-.83.33-1.5.92-1.83.58-.33 1.33-.27 2.04.16l2.47 1.48c.68.41 1.07 1.02 1.07 1.67s-.39 1.26-1.07 1.67l-2.47 1.48c-.41.24-.83.37-1.22.37m0-5.56a.2.2 0 0 0-.09.02c-.07.04-.15.22-.15.53v2.96c0 .3.08.48.15.53.08.04.27.02.53-.14l2.47-1.48c.25-.15.34-.3.34-.39s-.09-.23-.34-.39l-2.47-1.48c-.18-.11-.34-.16-.44-.16"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
filled: [
|
|
31
|
+
{
|
|
32
|
+
d: "M4 7v10c0 3 2 5 5 5h6c3 0 5-2 5-5V7c0-3-2-5-5-5H9C6 2 4 4 4 7m9.784 5.934-2.47 1.48c-1 .6-1.82.14-1.82-1.03v-2.97c0-1.17.82-1.63 1.82-1.03l2.47 1.48c.95.58.95 1.5 0 2.07"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
32: {
|
|
37
|
+
outlined: [
|
|
38
|
+
{
|
|
39
|
+
d: "M27.667 9.333v13.334c0 4.586-3.08 7.666-7.667 7.666h-8c-4.587 0-7.667-3.08-7.667-7.666V9.333c0-4.586 3.08-7.666 7.667-7.666h8c4.587 0 7.667 3.08 7.667 7.666M6.333 22.667c0 3.44 2.227 5.666 5.667 5.666h8c3.44 0 5.667-2.226 5.667-5.666V9.333c0-3.44-2.227-5.666-5.667-5.666h-8c-3.44 0-5.667 2.226-5.667 5.666z"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
d: "M14.12 20.706c-.387 0-.76-.094-1.093-.28-.774-.44-1.227-1.334-1.227-2.44v-3.947c0-1.107.44-2 1.227-2.44.773-.44 1.773-.36 2.72.213l3.293 1.974c.907.546 1.427 1.36 1.427 2.226 0 .867-.52 1.68-1.427 2.227l-3.293 1.973c-.547.32-1.107.494-1.627.494m0-7.414a.3.3 0 0 0-.12.027c-.093.053-.2.293-.2.707v3.946c0 .4.107.64.2.707.107.053.36.027.707-.187L18 16.52c.333-.2.453-.4.453-.52s-.12-.307-.453-.52l-3.293-1.973c-.24-.147-.454-.214-.587-.214"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
filled: [
|
|
46
|
+
{
|
|
47
|
+
d: "M5.334 9.333v13.334c0 4 2.666 6.666 6.666 6.666h8c4 0 6.667-2.666 6.667-6.666V9.333c0-4-2.667-6.666-6.667-6.666h-8c-4 0-6.666 2.666-6.666 6.666m13.045 7.912-3.294 1.973c-1.333.8-2.427.187-2.427-1.373v-3.96c0-1.56 1.094-2.173 2.427-1.373l3.293 1.973c1.267.773 1.267 2 0 2.76"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const ShortsIcon = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(BaseIcon, { ref, variants: VARIANTS, ...props }));
|
|
53
|
+
ShortsIcon.displayName = "ShortsIcon";
|
|
54
|
+
export {
|
|
55
|
+
ShortsIcon
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=ShortsIcon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShortsIcon.mjs","sources":["../../../src/components/Icons/ShortsIcon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { BaseIcon } from \"./BaseIcon\";\nimport type { BaseIconProps, IconVariants } from \"./types\";\n\nconst VARIANTS: IconVariants = {\n 16: {\n outlined: [\n {\n d: \"M13.833 4.667v6.666c0 2.294-1.54 3.834-3.833 3.834H6c-2.293 0-3.833-1.54-3.833-3.834V4.667C2.167 2.373 3.707.833 6 .833h4c2.293 0 3.833 1.54 3.833 3.834M3.167 11.333c0 1.72 1.113 2.834 2.833 2.834h4c1.72 0 2.833-1.114 2.833-2.834V4.667c0-1.72-1.113-2.834-2.833-2.834H6c-1.72 0-2.833 1.114-2.833 2.834z\",\n },\n {\n d: \"M7.06 10.353c-.193 0-.38-.047-.546-.14-.387-.22-.614-.667-.614-1.22V7.019c0-.553.22-1 .614-1.22.386-.22.886-.18 1.36.107l1.646.987c.454.273.713.68.713 1.113s-.26.84-.713 1.113l-1.647.987c-.273.16-.553.247-.813.247m0-3.707A.13.13 0 0 0 7 6.66c-.047.027-.1.147-.1.354v1.973c0 .2.053.32.1.353.053.027.18.014.354-.093L9 8.26c.167-.1.227-.2.227-.26s-.06-.153-.227-.26l-1.646-.986a.63.63 0 0 0-.294-.107\",\n },\n ],\n filled: [\n {\n d: \"M2.667 4.667v6.666c0 2 1.333 3.334 3.333 3.334h4c2 0 3.333-1.334 3.333-3.334V4.667c0-2-1.333-3.334-3.333-3.334H6c-2 0-3.333 1.334-3.333 3.334m6.522 3.955-1.646.987c-.667.4-1.214.093-1.214-.687v-1.98c0-.78.547-1.086 1.214-.686l1.646.986c.634.387.634 1 0 1.38\",\n },\n ],\n },\n 24: {\n outlined: [\n {\n d: \"M20.75 7v10c0 3.44-2.31 5.75-5.75 5.75H9c-3.44 0-5.75-2.31-5.75-5.75V7c0-3.44 2.31-5.75 5.75-5.75h6c3.44 0 5.75 2.31 5.75 5.75m-16 10c0 2.58 1.67 4.25 4.25 4.25h6c2.58 0 4.25-1.67 4.25-4.25V7c0-2.58-1.67-4.25-4.25-4.25H9C6.42 2.75 4.75 4.42 4.75 7z\",\n },\n {\n d: \"M10.59 15.53c-.29 0-.57-.07-.82-.21-.58-.33-.92-1-.92-1.83v-2.96c0-.83.33-1.5.92-1.83.58-.33 1.33-.27 2.04.16l2.47 1.48c.68.41 1.07 1.02 1.07 1.67s-.39 1.26-1.07 1.67l-2.47 1.48c-.41.24-.83.37-1.22.37m0-5.56a.2.2 0 0 0-.09.02c-.07.04-.15.22-.15.53v2.96c0 .3.08.48.15.53.08.04.27.02.53-.14l2.47-1.48c.25-.15.34-.3.34-.39s-.09-.23-.34-.39l-2.47-1.48c-.18-.11-.34-.16-.44-.16\",\n },\n ],\n filled: [\n {\n d: \"M4 7v10c0 3 2 5 5 5h6c3 0 5-2 5-5V7c0-3-2-5-5-5H9C6 2 4 4 4 7m9.784 5.934-2.47 1.48c-1 .6-1.82.14-1.82-1.03v-2.97c0-1.17.82-1.63 1.82-1.03l2.47 1.48c.95.58.95 1.5 0 2.07\",\n },\n ],\n },\n 32: {\n outlined: [\n {\n d: \"M27.667 9.333v13.334c0 4.586-3.08 7.666-7.667 7.666h-8c-4.587 0-7.667-3.08-7.667-7.666V9.333c0-4.586 3.08-7.666 7.667-7.666h8c4.587 0 7.667 3.08 7.667 7.666M6.333 22.667c0 3.44 2.227 5.666 5.667 5.666h8c3.44 0 5.667-2.226 5.667-5.666V9.333c0-3.44-2.227-5.666-5.667-5.666h-8c-3.44 0-5.667 2.226-5.667 5.666z\",\n },\n {\n d: \"M14.12 20.706c-.387 0-.76-.094-1.093-.28-.774-.44-1.227-1.334-1.227-2.44v-3.947c0-1.107.44-2 1.227-2.44.773-.44 1.773-.36 2.72.213l3.293 1.974c.907.546 1.427 1.36 1.427 2.226 0 .867-.52 1.68-1.427 2.227l-3.293 1.973c-.547.32-1.107.494-1.627.494m0-7.414a.3.3 0 0 0-.12.027c-.093.053-.2.293-.2.707v3.946c0 .4.107.64.2.707.107.053.36.027.707-.187L18 16.52c.333-.2.453-.4.453-.52s-.12-.307-.453-.52l-3.293-1.973c-.24-.147-.454-.214-.587-.214\",\n },\n ],\n filled: [\n {\n d: \"M5.334 9.333v13.334c0 4 2.666 6.666 6.666 6.666h8c4 0 6.667-2.666 6.667-6.666V9.333c0-4-2.667-6.666-6.667-6.666h-8c-4 0-6.666 2.666-6.666 6.666m13.045 7.912-3.294 1.973c-1.333.8-2.427.187-2.427-1.373v-3.96c0-1.56 1.094-2.173 2.427-1.373l3.293 1.973c1.267.773 1.267 2 0 2.76\",\n },\n ],\n },\n};\n\n/** Props for {@link ShortsIcon}. See {@link BaseIconProps} for the shared shape. */\nexport type ShortsIconProps = BaseIconProps;\n\n/**\n * Shorts icon. Renders at sizes 16, 24, or 32 px with outlined and filled variants.\n *\n * @example\n * ```tsx\n * <ShortsIcon size={24} filled />\n * ```\n */\nexport const ShortsIcon = React.forwardRef<SVGSVGElement, ShortsIconProps>((props, ref) => (\n <BaseIcon ref={ref} variants={VARIANTS} {...props} />\n));\n\nShortsIcon.displayName = \"ShortsIcon\";\n"],"names":[],"mappings":";;;;AAIA,MAAM,WAAyB;AAAA,EAC7B,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,MAEL;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAAA,EAEF,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,MAEL;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAAA,EAEF,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,MAEL;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAEJ;AAaO,MAAM,aAAa,MAAM,WAA2C,CAAC,OAAO,QACjF,oBAAC,UAAA,EAAS,KAAU,UAAU,UAAW,GAAG,OAAO,CACpD;AAED,WAAW,cAAc;"}
|
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { cn } from "../../utils/cn.mjs";
|
|
5
|
+
import { ICON_SIZE_CLASS } from "./iconSizeClass.mjs";
|
|
6
|
+
import { ICON_SPIN_CLASS } from "./iconSpinClass.mjs";
|
|
5
7
|
const SpinnerIcon = React.forwardRef(
|
|
6
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
8
|
+
({ className, size, spin = false, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
7
9
|
"svg",
|
|
8
10
|
{
|
|
9
11
|
ref,
|
|
10
12
|
viewBox: "0 0 20 20",
|
|
11
13
|
fill: "none",
|
|
12
14
|
"aria-hidden": "true",
|
|
13
|
-
className: cn("size-5", className),
|
|
15
|
+
className: cn(size ? ICON_SIZE_CLASS[size] : "size-5", spin && ICON_SPIN_CLASS, className),
|
|
14
16
|
...props,
|
|
15
17
|
children: [
|
|
16
18
|
/* @__PURE__ */ jsx("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeOpacity: ".25", strokeWidth: "2" }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpinnerIcon.mjs","sources":["../../../src/components/Icons/SpinnerIcon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport type { IconProps } from \"./types\";\n\n/** A circular spinner
|
|
1
|
+
{"version":3,"file":"SpinnerIcon.mjs","sources":["../../../src/components/Icons/SpinnerIcon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { ICON_SIZE_CLASS } from \"./iconSizeClass\";\nimport { ICON_SPIN_CLASS } from \"./iconSpinClass\";\nimport type { BaseIconProps, IconProps, IconSize } from \"./types\";\n\n/** Props for {@link SpinnerIcon}. */\nexport interface SpinnerIconProps extends Omit<IconProps, \"size\">, Pick<BaseIconProps, \"spin\"> {\n /** Pixel size of the spinner. Defaults to 20px when omitted. */\n size?: IconSize;\n}\n\n/**\n * A circular spinner glyph for loading states. It is a plain icon: pass `spin`\n * to turn it, as with any other prop-based icon. Prefer `spin`: a raw `animate-spin`\n * class keeps rotating under reduced motion. Combining the two never doubles the\n * speed. For a full-area loading state use the `Loader` component.\n *\n * @example\n * ```tsx\n * <SpinnerIcon size={16} spin />\n * ```\n */\nexport const SpinnerIcon = React.forwardRef<SVGSVGElement, SpinnerIconProps>(\n ({ className, size, spin = false, ...props }, ref) => (\n <svg\n ref={ref}\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n aria-hidden=\"true\"\n className={cn(size ? ICON_SIZE_CLASS[size] : \"size-5\", spin && ICON_SPIN_CLASS, className)}\n {...props}\n >\n <circle cx=\"10\" cy=\"10\" r=\"8\" stroke=\"currentColor\" strokeOpacity=\".25\" strokeWidth=\"2\" />\n <path d=\"M10 2a8 8 0 0 1 8 8\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" />\n </svg>\n ),\n);\n\nSpinnerIcon.displayName = \"SpinnerIcon\";\n"],"names":[],"mappings":";;;;;;AAuBO,MAAM,cAAc,MAAM;AAAA,EAC/B,CAAC,EAAE,WAAW,MAAM,OAAO,OAAO,GAAG,MAAA,GAAS,QAC5C;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,eAAY;AAAA,MACZ,WAAW,GAAG,OAAO,gBAAgB,IAAI,IAAI,UAAU,QAAQ,iBAAiB,SAAS;AAAA,MACxF,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAA,oBAAC,UAAA,EAAO,IAAG,MAAK,IAAG,MAAK,GAAE,KAAI,QAAO,gBAAe,eAAc,OAAM,aAAY,KAAI;AAAA,QACxF,oBAAC,UAAK,GAAE,uBAAsB,QAAO,gBAAe,aAAY,KAAI,eAAc,QAAA,CAAQ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGhG;AAEA,YAAY,cAAc;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iconSpinClass.mjs","sources":["../../../src/components/Icons/iconSpinClass.ts"],"sourcesContent":["/**\n * Classes behind the icon `spin` prop: a full turn per second when motion is\n * allowed, a pulse in place under `prefers-reduced-motion`. Uses the same\n * `spin` keyframes as Tailwind's `animate-spin`, so an icon that also carries\n * that class still turns at one speed.\n *\n * Internal — not exported from the package.\n */\nexport const ICON_SPIN_CLASS = \"motion-safe:animate-spin motion-reduce:animate-pulse\";\n"],"names":[],"mappings":";AAQO,MAAM,kBAAkB;"}
|
|
@@ -10,7 +10,7 @@ const InfoBox = PopoverPrimitive.Root;
|
|
|
10
10
|
const InfoBoxTrigger = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, { ref, ...useSuppressClickAfterDrag(props) }));
|
|
11
11
|
InfoBoxTrigger.displayName = "InfoBoxTrigger";
|
|
12
12
|
const ACTION_CLASSES = {
|
|
13
|
-
brand: "
|
|
13
|
+
brand: "",
|
|
14
14
|
tertiary: "text-content-primary-inverted hover:text-content-primary-inverted hover:bg-content-primary-inverted/10"
|
|
15
15
|
};
|
|
16
16
|
const ActionButton = ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoBox.mjs","sources":["../../../src/components/InfoBox/InfoBox.tsx"],"sourcesContent":["import * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { FLOATING_CONTENT_COLLISION_PADDING } from \"../../utils/floatingContentCollisionPadding\";\nimport { useSuppressClickAfterDrag } from \"../../utils/useSuppressClickAfterDrag\";\nimport { Button } from \"../Button/Button\";\n\n/** Props for the {@link InfoBox} root component. */\nexport interface InfoBoxProps extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Root> {\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n defaultOpen?: boolean;\n}\n\n/** Root component that manages open/close state for an info box. */\nexport const InfoBox = PopoverPrimitive.Root;\n\n/** Props for the {@link InfoBoxTrigger} component. */\nexport type InfoBoxTriggerProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Trigger>;\n\n/**\n * The element that triggers the info box on click.\n *\n * On touch / pen, a press-and-release that crosses a small movement threshold\n * is treated as a drag and the resulting synthetic click is suppressed —\n * defends against Android Chrome opening the popover on a scroll-drag-end.\n */\nexport const InfoBoxTrigger = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Trigger>,\n InfoBoxTriggerProps\n>((props, ref) => <PopoverPrimitive.Trigger ref={ref} {...useSuppressClickAfterDrag(props)} />);\nInfoBoxTrigger.displayName = \"InfoBoxTrigger\";\n\n/** Action button with a label and click handler. */\ninterface InfoBoxButtonAction {\n label: string;\n onClick?: () => void;\n}\n\n/** Custom element rendered in place of the default action button. */\ninterface InfoBoxElementAction {\n element: React.ReactNode;\n}\n\n/** Action configuration for {@link InfoBoxContent}. */\nexport type InfoBoxAction = InfoBoxButtonAction | InfoBoxElementAction;\n\nexport interface InfoBoxContentProps\n extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> {\n /** Whether to show the directional arrow pointer. @default true */\n showArrow?: boolean;\n /** Heading text rendered at the top of the info box. */\n heading?: React.ReactNode;\n /** Icon element displayed to the left of the heading. */\n icon?: React.ReactNode;\n /** Pill or badge element displayed to the right of the heading. */\n pill?: React.ReactNode;\n /** Primary action button (brand green). */\n primaryAction?: InfoBoxAction;\n /** Secondary action button (ghost). */\n secondaryAction?: InfoBoxAction;\n}\n\nconst ACTION_CLASSES: Record<\"brand\" | \"tertiary\", string> = {\n brand: \"
|
|
1
|
+
{"version":3,"file":"InfoBox.mjs","sources":["../../../src/components/InfoBox/InfoBox.tsx"],"sourcesContent":["import * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { FLOATING_CONTENT_COLLISION_PADDING } from \"../../utils/floatingContentCollisionPadding\";\nimport { useSuppressClickAfterDrag } from \"../../utils/useSuppressClickAfterDrag\";\nimport { Button } from \"../Button/Button\";\n\n/** Props for the {@link InfoBox} root component. */\nexport interface InfoBoxProps extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Root> {\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n defaultOpen?: boolean;\n}\n\n/** Root component that manages open/close state for an info box. */\nexport const InfoBox = PopoverPrimitive.Root;\n\n/** Props for the {@link InfoBoxTrigger} component. */\nexport type InfoBoxTriggerProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Trigger>;\n\n/**\n * The element that triggers the info box on click.\n *\n * On touch / pen, a press-and-release that crosses a small movement threshold\n * is treated as a drag and the resulting synthetic click is suppressed —\n * defends against Android Chrome opening the popover on a scroll-drag-end.\n */\nexport const InfoBoxTrigger = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Trigger>,\n InfoBoxTriggerProps\n>((props, ref) => <PopoverPrimitive.Trigger ref={ref} {...useSuppressClickAfterDrag(props)} />);\nInfoBoxTrigger.displayName = \"InfoBoxTrigger\";\n\n/** Action button with a label and click handler. */\ninterface InfoBoxButtonAction {\n label: string;\n onClick?: () => void;\n}\n\n/** Custom element rendered in place of the default action button. */\ninterface InfoBoxElementAction {\n element: React.ReactNode;\n}\n\n/** Action configuration for {@link InfoBoxContent}. */\nexport type InfoBoxAction = InfoBoxButtonAction | InfoBoxElementAction;\n\nexport interface InfoBoxContentProps\n extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> {\n /** Whether to show the directional arrow pointer. @default true */\n showArrow?: boolean;\n /** Heading text rendered at the top of the info box. */\n heading?: React.ReactNode;\n /** Icon element displayed to the left of the heading. */\n icon?: React.ReactNode;\n /** Pill or badge element displayed to the right of the heading. */\n pill?: React.ReactNode;\n /** Primary action button (brand green). */\n primaryAction?: InfoBoxAction;\n /** Secondary action button (ghost). */\n secondaryAction?: InfoBoxAction;\n}\n\nconst ACTION_CLASSES: Record<\"brand\" | \"tertiary\", string> = {\n brand: \"\",\n tertiary:\n \"text-content-primary-inverted hover:text-content-primary-inverted hover:bg-content-primary-inverted/10\",\n};\n\nconst ActionButton = ({\n action,\n variant,\n}: {\n action: InfoBoxAction;\n variant: \"brand\" | \"tertiary\";\n}) =>\n \"element\" in action ? (\n action.element\n ) : (\n <Button variant={variant} onClick={action.onClick} className={ACTION_CLASSES[variant]}>\n {action.label}\n </Button>\n );\n\nexport const InfoBoxContent = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Content>,\n InfoBoxContentProps\n>(\n (\n {\n className,\n showArrow = true,\n sideOffset = 8,\n heading,\n icon,\n pill,\n primaryAction,\n secondaryAction,\n children,\n style,\n onOpenAutoFocus,\n collisionPadding = FLOATING_CONTENT_COLLISION_PADDING,\n ...props\n },\n ref,\n ) => {\n const hasHeader = icon !== undefined || heading !== undefined || pill !== undefined;\n const hasActions = primaryAction !== undefined || secondaryAction !== undefined;\n const headingId = React.useId();\n\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n style={{ zIndex: \"var(--fanvue-ui-portal-z-index, 50)\", ...style }}\n className={cn(\n \"typography-body-small-14px-regular max-w-[280px] overflow-hidden rounded-md border border-white/20 bg-surface-primary-inverted p-4 text-content-primary-inverted shadow-[0px_2px_4px_0px_rgba(17,24,39,0.08)]\",\n className,\n )}\n align=\"center\"\n aria-labelledby={heading ? headingId : undefined}\n arrowPadding={12}\n onOpenAutoFocus={(e) => {\n // Prevent auto-focus stealing when opening — content is supplementary, not a dialog.\n e.preventDefault();\n onOpenAutoFocus?.(e);\n }}\n {...props}\n >\n <div className=\"flex flex-col gap-3\">\n {hasHeader && (\n <div className=\"flex items-center gap-3\">\n {icon && <div className=\"size-5 shrink-0\">{icon}</div>}\n {heading && (\n <p\n id={headingId}\n className=\"typography-body-default-16px-semibold min-w-0 flex-1 text-content-primary-inverted\"\n >\n {heading}\n </p>\n )}\n {pill && <div className=\"shrink-0\">{pill}</div>}\n </div>\n )}\n {children && (\n <div className=\"typography-body-small-14px-regular text-content-primary-inverted\">\n {children}\n </div>\n )}\n {hasActions && (\n <div className=\"flex items-center gap-1\">\n {primaryAction && <ActionButton action={primaryAction} variant=\"brand\" />}\n {secondaryAction && <ActionButton action={secondaryAction} variant=\"tertiary\" />}\n </div>\n )}\n </div>\n {showArrow && (\n <PopoverPrimitive.Arrow\n className={\n \"-translate-y-px! fill-surface-primary-inverted stroke-2 stroke-surface-primary-inverted\"\n }\n width={12}\n height={6}\n />\n )}\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n );\n },\n);\nInfoBoxContent.displayName = \"InfoBoxContent\";\n"],"names":[],"mappings":";;;;;;;;AAeO,MAAM,UAAU,iBAAiB;AAYjC,MAAM,iBAAiB,MAAM,WAGlC,CAAC,OAAO,QAAQ,oBAAC,iBAAiB,SAAjB,EAAyB,KAAW,GAAG,0BAA0B,KAAK,GAAG,CAAE;AAC9F,eAAe,cAAc;AAgC7B,MAAM,iBAAuD;AAAA,EAC3D,OAAO;AAAA,EACP,UACE;AACJ;AAEA,MAAM,eAAe,CAAC;AAAA,EACpB;AAAA,EACA;AACF,MAIE,aAAa,SACX,OAAO,8BAEN,QAAA,EAAO,SAAkB,SAAS,OAAO,SAAS,WAAW,eAAe,OAAO,GACjF,iBAAO,OACV;AAGG,MAAM,iBAAiB,MAAM;AAAA,EAIlC,CACE;AAAA,IACE;AAAA,IACA,YAAY;AAAA,IACZ,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,mBAAmB;AAAA,IACnB,GAAG;AAAA,EAAA,GAEL,QACG;AACH,UAAM,YAAY,SAAS,UAAa,YAAY,UAAa,SAAS;AAC1E,UAAM,aAAa,kBAAkB,UAAa,oBAAoB;AACtE,UAAM,YAAY,MAAM,MAAA;AAExB,WACE,oBAAC,iBAAiB,QAAjB,EACC,UAAA;AAAA,MAAC,iBAAiB;AAAA,MAAjB;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA,OAAO,EAAE,QAAQ,uCAAuC,GAAG,MAAA;AAAA,QAC3D,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAEF,OAAM;AAAA,QACN,mBAAiB,UAAU,YAAY;AAAA,QACvC,cAAc;AAAA,QACd,iBAAiB,CAAC,MAAM;AAEtB,YAAE,eAAA;AACF,4BAAkB,CAAC;AAAA,QACrB;AAAA,QACC,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAA,qBAAC,OAAA,EAAI,WAAU,uBACZ,UAAA;AAAA,YAAA,aACC,qBAAC,OAAA,EAAI,WAAU,2BACZ,UAAA;AAAA,cAAA,QAAQ,oBAAC,OAAA,EAAI,WAAU,mBAAmB,UAAA,MAAK;AAAA,cAC/C,WACC;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,IAAI;AAAA,kBACJ,WAAU;AAAA,kBAET,UAAA;AAAA,gBAAA;AAAA,cAAA;AAAA,cAGJ,QAAQ,oBAAC,OAAA,EAAI,WAAU,YAAY,UAAA,KAAA,CAAK;AAAA,YAAA,GAC3C;AAAA,YAED,YACC,oBAAC,OAAA,EAAI,WAAU,oEACZ,UACH;AAAA,YAED,cACC,qBAAC,OAAA,EAAI,WAAU,2BACZ,UAAA;AAAA,cAAA,iBAAiB,oBAAC,cAAA,EAAa,QAAQ,eAAe,SAAQ,SAAQ;AAAA,cACtE,mBAAmB,oBAAC,cAAA,EAAa,QAAQ,iBAAiB,SAAQ,WAAA,CAAW;AAAA,YAAA,EAAA,CAChF;AAAA,UAAA,GAEJ;AAAA,UACC,aACC;AAAA,YAAC,iBAAiB;AAAA,YAAjB;AAAA,cACC,WACE;AAAA,cAEF,OAAO;AAAA,cACP,QAAQ;AAAA,YAAA;AAAA,UAAA;AAAA,QACV;AAAA,MAAA;AAAA,IAAA,GAGN;AAAA,EAEJ;AACF;AACA,eAAe,cAAc;"}
|
|
@@ -28,7 +28,7 @@ const Loader = React.forwardRef(
|
|
|
28
28
|
shouldCenterY && "top-1/2 -translate-y-1/2"
|
|
29
29
|
),
|
|
30
30
|
"aria-label": ariaLabel ?? "loading",
|
|
31
|
-
children: /* @__PURE__ */ jsx(SpinnerIcon, { className: "size-9
|
|
31
|
+
children: /* @__PURE__ */ jsx(SpinnerIcon, { spin: true, className: "size-9 text-content-secondary" })
|
|
32
32
|
}
|
|
33
33
|
)
|
|
34
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Loader.mjs","sources":["../../../src/components/Loader/Loader.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { SpinnerIcon } from \"../Icons/SpinnerIcon\";\n\nexport interface LoaderProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Whether the loader is visible. When `false`, renders nothing. @default true */\n show?: boolean;\n /** Accessible label for the loading indicator. @default \"loading\" */\n ariaLabel?: string;\n /** Minimum height of the container. Numbers are treated as pixels. @default \"100%\" */\n minHeight?: number | string;\n /** Center the spinner horizontally. @default false */\n center?: boolean;\n /** Center the spinner horizontally. @default false */\n centerX?: boolean;\n /** Center the spinner vertically. @default false */\n centerY?: boolean;\n}\n\n/**\n * A layout-aware loading indicator that renders a centered `SpinnerIcon` inside\n * a relatively-positioned container. Drop-in replacement for the Olympus `Loader`.\n *\n * @example\n * ```tsx\n * <Loader show center />\n * <Loader show centerX minHeight={200} />\n * ```\n */\nexport const Loader = React.forwardRef<HTMLDivElement, LoaderProps>(\n (\n { show = true, ariaLabel, minHeight = \"100%\", center, centerX, centerY, className, ...props },\n ref,\n ) => {\n if (!show) {\n return null;\n }\n\n const shouldCenterX = center || centerX;\n const shouldCenterY = center || centerY;\n\n return (\n <div\n ref={ref}\n className={cn(\"relative\", className)}\n style={{\n minHeight: typeof minHeight === \"number\" ? `${minHeight}px` : minHeight,\n }}\n {...props}\n >\n <output\n className={cn(\n \"absolute flex size-[60px] items-center justify-center\",\n shouldCenterX && \"left-1/2 -translate-x-1/2\",\n shouldCenterY && \"top-1/2 -translate-y-1/2\",\n )}\n aria-label={ariaLabel ?? \"loading\"}\n >\n <SpinnerIcon className=\"size-9
|
|
1
|
+
{"version":3,"file":"Loader.mjs","sources":["../../../src/components/Loader/Loader.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { SpinnerIcon } from \"../Icons/SpinnerIcon\";\n\nexport interface LoaderProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Whether the loader is visible. When `false`, renders nothing. @default true */\n show?: boolean;\n /** Accessible label for the loading indicator. @default \"loading\" */\n ariaLabel?: string;\n /** Minimum height of the container. Numbers are treated as pixels. @default \"100%\" */\n minHeight?: number | string;\n /** Center the spinner horizontally. @default false */\n center?: boolean;\n /** Center the spinner horizontally. @default false */\n centerX?: boolean;\n /** Center the spinner vertically. @default false */\n centerY?: boolean;\n}\n\n/**\n * A layout-aware loading indicator that renders a centered `SpinnerIcon` inside\n * a relatively-positioned container. Drop-in replacement for the Olympus `Loader`.\n *\n * @example\n * ```tsx\n * <Loader show center />\n * <Loader show centerX minHeight={200} />\n * ```\n */\nexport const Loader = React.forwardRef<HTMLDivElement, LoaderProps>(\n (\n { show = true, ariaLabel, minHeight = \"100%\", center, centerX, centerY, className, ...props },\n ref,\n ) => {\n if (!show) {\n return null;\n }\n\n const shouldCenterX = center || centerX;\n const shouldCenterY = center || centerY;\n\n return (\n <div\n ref={ref}\n className={cn(\"relative\", className)}\n style={{\n minHeight: typeof minHeight === \"number\" ? `${minHeight}px` : minHeight,\n }}\n {...props}\n >\n <output\n className={cn(\n \"absolute flex size-[60px] items-center justify-center\",\n shouldCenterX && \"left-1/2 -translate-x-1/2\",\n shouldCenterY && \"top-1/2 -translate-y-1/2\",\n )}\n aria-label={ariaLabel ?? \"loading\"}\n >\n <SpinnerIcon spin className=\"size-9 text-content-secondary\" />\n </output>\n </div>\n );\n },\n);\n\nLoader.displayName = \"Loader\";\n"],"names":[],"mappings":";;;;;AA6BO,MAAM,SAAS,MAAM;AAAA,EAC1B,CACE,EAAE,OAAO,MAAM,WAAW,YAAY,QAAQ,QAAQ,SAAS,SAAS,WAAW,GAAG,MAAA,GACtF,QACG;AACH,QAAI,CAAC,MAAM;AACT,aAAO;AAAA,IACT;AAEA,UAAM,gBAAgB,UAAU;AAChC,UAAM,gBAAgB,UAAU;AAEhC,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,YAAY,SAAS;AAAA,QACnC,OAAO;AAAA,UACL,WAAW,OAAO,cAAc,WAAW,GAAG,SAAS,OAAO;AAAA,QAAA;AAAA,QAE/D,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW;AAAA,cACT;AAAA,cACA,iBAAiB;AAAA,cACjB,iBAAiB;AAAA,YAAA;AAAA,YAEnB,cAAY,aAAa;AAAA,YAEzB,UAAA,oBAAC,aAAA,EAAY,MAAI,MAAC,WAAU,gCAAA,CAAgC;AAAA,UAAA;AAAA,QAAA;AAAA,MAC9D;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,OAAO,cAAc;"}
|
|
@@ -13,7 +13,7 @@ const pillVariants = {
|
|
|
13
13
|
base: "bg-surface-primary-inverted text-content-primary-inverted",
|
|
14
14
|
contrast: "bg-buttons-primary-default text-content-primary-inverted",
|
|
15
15
|
negative: "bg-buttons-secondary-negative-default text-content-primary-inverted",
|
|
16
|
-
brand: "bg-brand-primary-default text-content-always-black",
|
|
16
|
+
brand: "fv-upsell bg-brand-primary-default text-content-always-black",
|
|
17
17
|
brandLight: "bg-brand-primary-muted text-content-primary",
|
|
18
18
|
beta: "bg-brand-secondary-default text-content-always-black",
|
|
19
19
|
error: "bg-error-content text-error-surface",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pill.mjs","sources":["../../../src/components/Pill/Pill.tsx"],"sourcesContent":["import { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\nconst pillVariants = {\n variant: {\n green: \"bg-success-surface text-success-content\",\n grey: \"bg-neutral-alphas-50 text-content-secondary\",\n blue: \"bg-info-surface text-info-content\",\n gold: \"bg-warning-surface text-warning-content\",\n pinkLight: \"bg-brand-secondary-muted text-content-primary\",\n base: \"bg-surface-primary-inverted text-content-primary-inverted\",\n contrast: \"bg-buttons-primary-default text-content-primary-inverted\",\n negative: \"bg-buttons-secondary-negative-default text-content-primary-inverted\",\n brand: \"bg-brand-primary-default text-content-always-black\",\n brandLight: \"bg-brand-primary-muted text-content-primary\",\n beta: \"bg-brand-secondary-default text-content-always-black\",\n error: \"bg-error-content text-error-surface\",\n red: \"bg-error-surface text-error-content\",\n },\n} as const;\n\n/** Colour variant of the pill. */\nexport type PillVariant =\n | \"green\"\n | \"grey\"\n | \"blue\"\n | \"gold\"\n | \"pinkLight\"\n | \"base\"\n | \"contrast\"\n | \"negative\"\n | \"brand\"\n | \"brandLight\"\n | \"beta\"\n | \"error\"\n | \"red\";\n\nexport interface PillProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Colour variant of the pill. @default \"green\" */\n variant?: PillVariant;\n /** Icon element displayed before the label. */\n leftIcon?: React.ReactNode;\n /** Icon element displayed after the label. */\n rightIcon?: React.ReactNode;\n /** Merge props onto a child element instead of rendering a `<span>`. @default false */\n asChild?: boolean;\n}\n\n/**\n * A small rounded label for categorisation, status, or tagging.\n *\n * @example\n * ```tsx\n * <Pill variant=\"brand\">New</Pill>\n * ```\n */\nexport const Pill = React.forwardRef<HTMLSpanElement, PillProps>(\n (\n {\n className,\n variant = \"green\",\n leftIcon,\n rightIcon,\n asChild = false,\n onClick,\n children,\n ...props\n },\n ref,\n ) => {\n const Comp = asChild ? Slot : \"span\";\n\n return (\n <Comp\n ref={ref}\n data-testid=\"pill\"\n className={cn(\n // Base styles\n \"inline-flex min-w-0 items-center justify-center gap-2 rounded-full px-2 py-1\",\n // Typography\n \"typography-description-12px-semibold\",\n // Variant styles\n pillVariants.variant[variant],\n // Interactive\n onClick && \"cursor-pointer\",\n // Manual CSS overrides\n className,\n )}\n onClick={onClick}\n {...props}\n >\n {leftIcon && (\n <span className=\"flex [&>svg]:size-3\" aria-hidden=\"true\">\n {leftIcon}\n </span>\n )}\n {asChild ? (\n <Slottable>{children}</Slottable>\n ) : (\n <span className=\"min-w-0 truncate\">{children}</span>\n )}\n {rightIcon && (\n <span className=\"flex [&>svg]:size-3\" aria-hidden=\"true\">\n {rightIcon}\n </span>\n )}\n </Comp>\n );\n },\n);\n\nPill.displayName = \"Pill\";\n"],"names":[],"mappings":";;;;;AAIA,MAAM,eAAe;AAAA,EACnB,SAAS;AAAA,IACP,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,WAAW;AAAA,IACX,MAAM;AAAA,IACN,UAAU;AAAA,IACV,UAAU;AAAA,IACV,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,EAAA;AAET;AAqCO,MAAM,OAAO,MAAM;AAAA,EACxB,CACE;AAAA,IACE;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACG;AACH,UAAM,OAAO,UAAU,OAAO;AAE9B,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAY;AAAA,QACZ,WAAW;AAAA;AAAA,UAET;AAAA;AAAA,UAEA;AAAA;AAAA,UAEA,aAAa,QAAQ,OAAO;AAAA;AAAA,UAE5B,WAAW;AAAA;AAAA,UAEX;AAAA,QAAA;AAAA,QAEF;AAAA,QACC,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA,gCACE,QAAA,EAAK,WAAU,uBAAsB,eAAY,QAC/C,UAAA,UACH;AAAA,UAED,8BACE,WAAA,EAAW,SAAA,CAAS,IAErB,oBAAC,QAAA,EAAK,WAAU,oBAAoB,SAAA,CAAS;AAAA,UAE9C,aACC,oBAAC,QAAA,EAAK,WAAU,uBAAsB,eAAY,QAC/C,UAAA,UAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,KAAK,cAAc;"}
|
|
1
|
+
{"version":3,"file":"Pill.mjs","sources":["../../../src/components/Pill/Pill.tsx"],"sourcesContent":["import { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\nconst pillVariants = {\n variant: {\n green: \"bg-success-surface text-success-content\",\n grey: \"bg-neutral-alphas-50 text-content-secondary\",\n blue: \"bg-info-surface text-info-content\",\n gold: \"bg-warning-surface text-warning-content\",\n pinkLight: \"bg-brand-secondary-muted text-content-primary\",\n base: \"bg-surface-primary-inverted text-content-primary-inverted\",\n contrast: \"bg-buttons-primary-default text-content-primary-inverted\",\n negative: \"bg-buttons-secondary-negative-default text-content-primary-inverted\",\n brand: \"fv-upsell bg-brand-primary-default text-content-always-black\",\n brandLight: \"bg-brand-primary-muted text-content-primary\",\n beta: \"bg-brand-secondary-default text-content-always-black\",\n error: \"bg-error-content text-error-surface\",\n red: \"bg-error-surface text-error-content\",\n },\n} as const;\n\n/** Colour variant of the pill. */\nexport type PillVariant =\n | \"green\"\n | \"grey\"\n | \"blue\"\n | \"gold\"\n | \"pinkLight\"\n | \"base\"\n | \"contrast\"\n | \"negative\"\n | \"brand\"\n | \"brandLight\"\n | \"beta\"\n | \"error\"\n | \"red\";\n\nexport interface PillProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Colour variant of the pill. @default \"green\" */\n variant?: PillVariant;\n /** Icon element displayed before the label. */\n leftIcon?: React.ReactNode;\n /** Icon element displayed after the label. */\n rightIcon?: React.ReactNode;\n /** Merge props onto a child element instead of rendering a `<span>`. @default false */\n asChild?: boolean;\n}\n\n/**\n * A small rounded label for categorisation, status, or tagging.\n *\n * @example\n * ```tsx\n * <Pill variant=\"brand\">New</Pill>\n * ```\n */\nexport const Pill = React.forwardRef<HTMLSpanElement, PillProps>(\n (\n {\n className,\n variant = \"green\",\n leftIcon,\n rightIcon,\n asChild = false,\n onClick,\n children,\n ...props\n },\n ref,\n ) => {\n const Comp = asChild ? Slot : \"span\";\n\n return (\n <Comp\n ref={ref}\n data-testid=\"pill\"\n className={cn(\n // Base styles\n \"inline-flex min-w-0 items-center justify-center gap-2 rounded-full px-2 py-1\",\n // Typography\n \"typography-description-12px-semibold\",\n // Variant styles\n pillVariants.variant[variant],\n // Interactive\n onClick && \"cursor-pointer\",\n // Manual CSS overrides\n className,\n )}\n onClick={onClick}\n {...props}\n >\n {leftIcon && (\n <span className=\"flex [&>svg]:size-3\" aria-hidden=\"true\">\n {leftIcon}\n </span>\n )}\n {asChild ? (\n <Slottable>{children}</Slottable>\n ) : (\n <span className=\"min-w-0 truncate\">{children}</span>\n )}\n {rightIcon && (\n <span className=\"flex [&>svg]:size-3\" aria-hidden=\"true\">\n {rightIcon}\n </span>\n )}\n </Comp>\n );\n },\n);\n\nPill.displayName = \"Pill\";\n"],"names":[],"mappings":";;;;;AAIA,MAAM,eAAe;AAAA,EACnB,SAAS;AAAA,IACP,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,WAAW;AAAA,IACX,MAAM;AAAA,IACN,UAAU;AAAA,IACV,UAAU;AAAA,IACV,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,EAAA;AAET;AAqCO,MAAM,OAAO,MAAM;AAAA,EACxB,CACE;AAAA,IACE;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACG;AACH,UAAM,OAAO,UAAU,OAAO;AAE9B,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAY;AAAA,QACZ,WAAW;AAAA;AAAA,UAET;AAAA;AAAA,UAEA;AAAA;AAAA,UAEA,aAAa,QAAQ,OAAO;AAAA;AAAA,UAE5B,WAAW;AAAA;AAAA,UAEX;AAAA,QAAA;AAAA,QAEF;AAAA,QACC,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA,gCACE,QAAA,EAAK,WAAU,uBAAsB,eAAY,QAC/C,UAAA,UACH;AAAA,UAED,8BACE,WAAA,EAAW,SAAA,CAAS,IAErB,oBAAC,QAAA,EAAK,WAAU,oBAAoB,SAAA,CAAS;AAAA,UAE9C,aACC,oBAAC,QAAA,EAAK,WAAU,uBAAsB,eAAY,QAC/C,UAAA,UAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,KAAK,cAAc;"}
|
|
@@ -8,8 +8,23 @@ const VARIANT_CLASSES = {
|
|
|
8
8
|
rectangular: "",
|
|
9
9
|
rounded: "rounded-xs"
|
|
10
10
|
};
|
|
11
|
+
const RADIUS_CLASSES = {
|
|
12
|
+
sm: "rounded-sm",
|
|
13
|
+
md: "rounded-md",
|
|
14
|
+
lg: "rounded-lg"
|
|
15
|
+
};
|
|
11
16
|
const Skeleton = React.forwardRef(
|
|
12
|
-
({
|
|
17
|
+
({
|
|
18
|
+
className,
|
|
19
|
+
variant = "text",
|
|
20
|
+
radius,
|
|
21
|
+
animation = "pulse",
|
|
22
|
+
width,
|
|
23
|
+
height,
|
|
24
|
+
style,
|
|
25
|
+
children,
|
|
26
|
+
...props
|
|
27
|
+
}, ref) => {
|
|
13
28
|
const hasChildren = React.Children.count(children) > 0;
|
|
14
29
|
const sizeStyle = {
|
|
15
30
|
...style,
|
|
@@ -28,6 +43,7 @@ const Skeleton = React.forwardRef(
|
|
|
28
43
|
className: cn(
|
|
29
44
|
"block bg-[color-mix(in_srgb,var(--color-content-primary)_11%,var(--color-background-primary))]",
|
|
30
45
|
VARIANT_CLASSES[variant],
|
|
46
|
+
radius && RADIUS_CLASSES[radius],
|
|
31
47
|
variant === "text" && !height && !hasChildren && "h-[1em]",
|
|
32
48
|
animation === "pulse" && "animate-pulse",
|
|
33
49
|
animation === "wave" && "fv-skeleton-wave",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.mjs","sources":["../../../src/components/Skeleton/Skeleton.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** Shape variant of the skeleton placeholder. */\nexport type SkeletonVariant = \"text\" | \"circular\" | \"rectangular\" | \"rounded\";\n\n/** Animation style of the skeleton. `false` disables animation. */\nexport type SkeletonAnimation = \"pulse\" | \"wave\" | false;\n\nexport interface SkeletonProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Shape variant of the skeleton.\n *\n * - `text` – a single line of text with slight vertical margin and rounded ends\n * - `circular` – a circle (width and height should match)\n * - `rectangular` – a sharp-cornered rectangle\n * - `rounded` – a rectangle with rounded corners\n *\n * @default \"text\"\n */\n variant?: SkeletonVariant;\n /** Animation style. Set to `false` to disable animation. @default \"pulse\" */\n animation?: SkeletonAnimation;\n /** Width of the skeleton. Accepts a CSS value (number is treated as `px`). */\n width?: number | string;\n /** Height of the skeleton. Accepts a CSS value (number is treated as `px`). */\n height?: number | string;\n}\n\nconst VARIANT_CLASSES: Record<SkeletonVariant, string> = {\n text: \"rounded my-0.5\",\n circular: \"rounded-full\",\n rectangular: \"\",\n rounded: \"rounded-xs\",\n};\n\n/**\n * A placeholder preview of content before data is loaded, reducing perceived\n * load time. Mirrors common MUI Skeleton props for easy migration.\n *\n * When used as a loading state, wrap the skeleton region with `aria-busy=\"true\"`\n * and provide an accessible label so screen readers can convey the loading state.\n *\n * @example\n * ```tsx\n * <Skeleton variant=\"text\" width={200} />\n * <Skeleton variant=\"circular\" width={40} height={40} />\n * <Skeleton variant=\"rectangular\" width=\"100%\" height={120} />\n * ```\n */\nexport const Skeleton = React.forwardRef<HTMLSpanElement, SkeletonProps>(\n (\n {
|
|
1
|
+
{"version":3,"file":"Skeleton.mjs","sources":["../../../src/components/Skeleton/Skeleton.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** Shape variant of the skeleton placeholder. */\nexport type SkeletonVariant = \"text\" | \"circular\" | \"rectangular\" | \"rounded\";\n\n/** Corner radius of the skeleton, on the kit radius scale. */\nexport type SkeletonRadius = \"sm\" | \"md\" | \"lg\";\n\n/** Animation style of the skeleton. `false` disables animation. */\nexport type SkeletonAnimation = \"pulse\" | \"wave\" | false;\n\nexport interface SkeletonProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Shape variant of the skeleton.\n *\n * - `text` – a single line of text with slight vertical margin and rounded ends\n * - `circular` – a circle (width and height should match)\n * - `rectangular` – a sharp-cornered rectangle\n * - `rounded` – a rectangle with rounded corners\n *\n * @default \"text\"\n */\n variant?: SkeletonVariant;\n /**\n * Corner radius on the kit scale, so a skeleton can match the corners of the\n * surface it stands in for. Overrides the radius the `variant` sets.\n *\n * - `sm` – `--radius-sm` (12px)\n * - `md` – `--radius-md` (16px)\n * - `lg` – `--radius-lg` (24px)\n *\n * Leave unset to keep the variant's own radius.\n */\n radius?: SkeletonRadius;\n /** Animation style. Set to `false` to disable animation. @default \"pulse\" */\n animation?: SkeletonAnimation;\n /** Width of the skeleton. Accepts a CSS value (number is treated as `px`). */\n width?: number | string;\n /** Height of the skeleton. Accepts a CSS value (number is treated as `px`). */\n height?: number | string;\n}\n\nconst VARIANT_CLASSES: Record<SkeletonVariant, string> = {\n text: \"rounded my-0.5\",\n circular: \"rounded-full\",\n rectangular: \"\",\n rounded: \"rounded-xs\",\n};\n\nconst RADIUS_CLASSES: Record<SkeletonRadius, string> = {\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n};\n\n/**\n * A placeholder preview of content before data is loaded, reducing perceived\n * load time. Mirrors common MUI Skeleton props for easy migration.\n *\n * When used as a loading state, wrap the skeleton region with `aria-busy=\"true\"`\n * and provide an accessible label so screen readers can convey the loading state.\n *\n * @example\n * ```tsx\n * <Skeleton variant=\"text\" width={200} />\n * <Skeleton variant=\"circular\" width={40} height={40} />\n * <Skeleton variant=\"rectangular\" width=\"100%\" height={120} />\n * <Skeleton variant=\"rectangular\" radius=\"lg\" width=\"100%\" height={240} />\n * ```\n */\nexport const Skeleton = React.forwardRef<HTMLSpanElement, SkeletonProps>(\n (\n {\n className,\n variant = \"text\",\n radius,\n animation = \"pulse\",\n width,\n height,\n style,\n children,\n ...props\n },\n ref,\n ) => {\n const hasChildren = React.Children.count(children) > 0;\n const sizeStyle: React.CSSProperties = {\n ...style,\n ...(width !== undefined && {\n width: typeof width === \"number\" ? `${width}px` : width,\n }),\n ...(height !== undefined && {\n height: typeof height === \"number\" ? `${height}px` : height,\n }),\n };\n\n return (\n <span\n ref={ref}\n aria-hidden=\"true\"\n className={cn(\n \"block bg-[color-mix(in_srgb,var(--color-content-primary)_11%,var(--color-background-primary))]\",\n VARIANT_CLASSES[variant],\n radius && RADIUS_CLASSES[radius],\n variant === \"text\" && !height && !hasChildren && \"h-[1em]\",\n animation === \"pulse\" && \"animate-pulse\",\n animation === \"wave\" && \"fv-skeleton-wave\",\n hasChildren && \"relative overflow-hidden [&>*]:invisible\",\n className,\n )}\n style={sizeStyle}\n {...props}\n >\n {children}\n </span>\n );\n },\n);\n\nSkeleton.displayName = \"Skeleton\";\n"],"names":[],"mappings":";;;;AA0CA,MAAM,kBAAmD;AAAA,EACvD,MAAM;AAAA,EACN,UAAU;AAAA,EACV,aAAa;AAAA,EACb,SAAS;AACX;AAEA,MAAM,iBAAiD;AAAA,EACrD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAiBO,MAAM,WAAW,MAAM;AAAA,EAC5B,CACE;AAAA,IACE;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACG;AACH,UAAM,cAAc,MAAM,SAAS,MAAM,QAAQ,IAAI;AACrD,UAAM,YAAiC;AAAA,MACrC,GAAG;AAAA,MACH,GAAI,UAAU,UAAa;AAAA,QACzB,OAAO,OAAO,UAAU,WAAW,GAAG,KAAK,OAAO;AAAA,MAAA;AAAA,MAEpD,GAAI,WAAW,UAAa;AAAA,QAC1B,QAAQ,OAAO,WAAW,WAAW,GAAG,MAAM,OAAO;AAAA,MAAA;AAAA,IACvD;AAGF,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAY;AAAA,QACZ,WAAW;AAAA,UACT;AAAA,UACA,gBAAgB,OAAO;AAAA,UACvB,UAAU,eAAe,MAAM;AAAA,UAC/B,YAAY,UAAU,CAAC,UAAU,CAAC,eAAe;AAAA,UACjD,cAAc,WAAW;AAAA,UACzB,cAAc,UAAU;AAAA,UACxB,eAAe;AAAA,UACf;AAAA,QAAA;AAAA,QAEF,OAAO;AAAA,QACN,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,SAAS,cAAc;"}
|