@kushagradhawan/kookie-ui 0.1.8 → 0.1.9
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/components.css +60 -1
- package/dist/cjs/components/image.d.ts +2 -2
- package/dist/cjs/components/image.d.ts.map +1 -1
- package/dist/cjs/components/image.js +1 -1
- package/dist/cjs/components/image.js.map +3 -3
- package/dist/cjs/components/image.props.d.ts +16 -0
- package/dist/cjs/components/image.props.d.ts.map +1 -1
- package/dist/cjs/components/image.props.js +1 -1
- package/dist/cjs/components/image.props.js.map +3 -3
- package/dist/esm/components/image.d.ts +2 -2
- package/dist/esm/components/image.d.ts.map +1 -1
- package/dist/esm/components/image.js +1 -1
- package/dist/esm/components/image.js.map +3 -3
- package/dist/esm/components/image.props.d.ts +16 -0
- package/dist/esm/components/image.props.d.ts.map +1 -1
- package/dist/esm/components/image.props.js +1 -1
- package/dist/esm/components/image.props.js.map +3 -3
- package/package.json +1 -1
- package/src/components/image.css +89 -1
- package/src/components/image.props.ts +17 -0
- package/src/components/image.tsx +133 -4
- package/styles.css +60 -1
package/components.css
CHANGED
|
@@ -5975,7 +5975,66 @@
|
|
|
5975
5975
|
display: block;
|
|
5976
5976
|
object-fit: var(--object-fit);
|
|
5977
5977
|
box-shadow: var(--box-shadow);
|
|
5978
|
-
border-radius: max(var(--radius-
|
|
5978
|
+
border-radius: max(var(--radius-4), var(--radius-full));
|
|
5979
|
+
transition: var(--transition-button);
|
|
5980
|
+
}
|
|
5981
|
+
.rt-Image:where(:any-link, button, label) {
|
|
5982
|
+
cursor: pointer;
|
|
5983
|
+
}
|
|
5984
|
+
@media (hover: hover) {
|
|
5985
|
+
.rt-Image:where(:any-link, button, label):where(:hover) {
|
|
5986
|
+
transform: scale(1.02);
|
|
5987
|
+
box-shadow: var(--box-shadow, var(--shadow-2)), 0 0 0 1px var(--gray-a4);
|
|
5988
|
+
}
|
|
5989
|
+
}
|
|
5990
|
+
.rt-Image:where(:any-link, button, label):where(:focus-visible) {
|
|
5991
|
+
outline: 2px solid var(--focus-8);
|
|
5992
|
+
outline-offset: 2px;
|
|
5993
|
+
}
|
|
5994
|
+
.rt-Image:where(:any-link, button, label):where(:active) {
|
|
5995
|
+
transform: scale(0.98);
|
|
5996
|
+
}
|
|
5997
|
+
.rt-variant-blur {
|
|
5998
|
+
position: relative;
|
|
5999
|
+
display: inline-block;
|
|
6000
|
+
--blur-filter: blur(16px) saturate(1.5);
|
|
6001
|
+
--blur-opacity: 0.5;
|
|
6002
|
+
--blur-offset-y: 8px;
|
|
6003
|
+
--blur-offset-x: 0;
|
|
6004
|
+
}
|
|
6005
|
+
.rt-variant-blur:where(:any-link, button, label) {
|
|
6006
|
+
cursor: pointer;
|
|
6007
|
+
transition: var(--transition-button);
|
|
6008
|
+
}
|
|
6009
|
+
@media (hover: hover) {
|
|
6010
|
+
.rt-variant-blur:where(:any-link, button, label):where(:hover) {
|
|
6011
|
+
transform: scale(1.02);
|
|
6012
|
+
}
|
|
6013
|
+
}
|
|
6014
|
+
.rt-variant-blur:where(:any-link, button, label):where(:focus-visible) {
|
|
6015
|
+
outline: 2px solid var(--focus-8);
|
|
6016
|
+
outline-offset: 2px;
|
|
6017
|
+
}
|
|
6018
|
+
.rt-variant-blur:where(:any-link, button, label):where(:active) {
|
|
6019
|
+
transform: scale(0.98);
|
|
6020
|
+
}
|
|
6021
|
+
.rt-variant-blur:where(:any-link, button, label) .rt-Image {
|
|
6022
|
+
cursor: inherit;
|
|
6023
|
+
transform: none !important;
|
|
6024
|
+
outline: none !important;
|
|
6025
|
+
box-shadow: var(--box-shadow) !important;
|
|
6026
|
+
}
|
|
6027
|
+
.rt-Image--blur-bg {
|
|
6028
|
+
position: absolute;
|
|
6029
|
+
top: var(--blur-offset-y, 8px);
|
|
6030
|
+
left: var(--blur-offset-x, 0);
|
|
6031
|
+
filter: var(--blur-filter);
|
|
6032
|
+
opacity: var(--blur-opacity);
|
|
6033
|
+
z-index: -1;
|
|
6034
|
+
}
|
|
6035
|
+
.rt-Image--blur {
|
|
6036
|
+
position: relative;
|
|
6037
|
+
z-index: 1;
|
|
5979
6038
|
}
|
|
5980
6039
|
.rt-r-fit-cover {
|
|
5981
6040
|
--object-fit: cover;
|
|
@@ -11,9 +11,9 @@ type ImageOwnProps = GetPropDefTypes<typeof imagePropDefs> & {
|
|
|
11
11
|
interface ImageProps extends ComponentPropsWithout<'img', RemovedProps | 'color' | 'width' | 'height' | 'alt'>, MarginProps, WidthProps, HeightProps, ImageOwnProps {
|
|
12
12
|
/**
|
|
13
13
|
* The alt attribute provides alternative information for an image if a user for some reason cannot view it.
|
|
14
|
-
* Required for accessibility.
|
|
14
|
+
* Required for accessibility when not using asChild.
|
|
15
15
|
*/
|
|
16
|
-
alt
|
|
16
|
+
alt?: string;
|
|
17
17
|
}
|
|
18
18
|
declare const Image: React.ForwardRefExoticComponent<ImageProps & React.RefAttributes<HTMLImageElement>>;
|
|
19
19
|
export { Image };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/components/image.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,KAAK,aAAa,GAAG,eAAe,CAAC,OAAO,aAAa,CAAC,GAAG;IAC3D,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC5B,CAAC;AAEF,UAAU,UACR,SAAQ,qBAAqB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC,EACvF,WAAW,EACX,UAAU,EACV,WAAW,EACX,aAAa;IACf;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/components/image.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,KAAK,aAAa,GAAG,eAAe,CAAC,OAAO,aAAa,CAAC,GAAG;IAC3D,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC5B,CAAC;AAEF,UAAU,UACR,SAAQ,qBAAqB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC,EACvF,WAAW,EACX,UAAU,EACV,WAAW,EACX,aAAa;IACf;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,QAAA,MAAM,KAAK,qFAsJT,CAAC;AAIH,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
1
|
+
"use strict";"use client";var j=Object.create;var c=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var W=(e,r)=>{for(var t in r)c(e,t,{get:r[t],enumerable:!0})},I=(e,r,t,f)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of w(r))!C.call(e,s)&&s!==t&&c(e,s,{get:()=>r[s],enumerable:!(f=k(r,s))||f.enumerable});return e};var P=(e,r,t)=>(t=e!=null?j(z(e)):{},I(r||!e||!e.__esModule?c(t,"default",{value:e,enumerable:!0}):t,e)),G=e=>I(c({},"__esModule",{value:!0}),e);var H={};W(H,{Image:()=>y});module.exports=G(H);var o=P(require("react")),a=P(require("classnames")),b=require("./image.props.js"),N=require("../helpers/extract-props.js"),v=require("../props/margin.props.js"),x=require("../props/width.props.js"),D=require("../props/height.props.js");const y=o.forwardRef((e,r)=>{const{variant:t="surface",fit:f="cover",children:s}=e,{asChild:E,className:p,radius:l,style:n,loading:m="lazy",alt:u,src:g,children:M,...d}=(0,N.extractProps)(e,b.imagePropDefs,v.marginPropDefs,x.widthPropDefs,D.heightPropDefs),h=o.createElement("img",{"data-radius":l,loading:m,style:n,className:(0,a.default)("rt-reset","rt-Image",t==="blur"&&"rt-Image--blur",p),alt:u,src:g,...d,ref:r});if(E&&s){const i=o.Children.only(s);return t==="blur"?o.cloneElement(i,{className:(0,a.default)(i.props?.className,"rt-variant-blur"),style:{position:"relative",display:"inline-block",textDecoration:"none",color:"inherit",border:"none",background:"none",padding:0,font:"inherit",cursor:"pointer",...i.props?.style},children:o.createElement(o.Fragment,null,o.createElement("img",{"data-radius":l,loading:m,style:{...n,position:"absolute",top:"8px",left:"0"},className:(0,a.default)("rt-reset","rt-Image","rt-Image--blur","rt-Image--blur-bg",p),alt:"",src:g,...d}),o.createElement("img",{"data-radius":l,loading:m,style:{...n,position:"relative",zIndex:1},className:(0,a.default)("rt-reset","rt-Image","rt-Image--blur",p),alt:u,src:g,...d,ref:r}))}):o.cloneElement(i,{className:(0,a.default)(i.props?.className,"rt-Image"),style:{textDecoration:"none",color:"inherit",border:"none",background:"none",padding:0,font:"inherit",cursor:"pointer",...i.props?.style},children:h})}return t==="blur"?o.createElement("div",{className:"rt-variant-blur",style:{position:"relative",display:"inline-block"}},o.createElement("img",{"data-radius":l,loading:m,style:{...n,position:"absolute",top:"8px",left:"0"},className:(0,a.default)("rt-reset","rt-Image","rt-Image--blur","rt-Image--blur-bg",p),alt:"",src:g,...d}),o.createElement("img",{"data-radius":l,loading:m,style:{...n,position:"relative",zIndex:1},className:(0,a.default)("rt-reset","rt-Image","rt-Image--blur",p),alt:u,src:g,...d,ref:r})):h});y.displayName="Image";
|
|
2
2
|
//# sourceMappingURL=image.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/image.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { imagePropDefs } from './image.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\nimport { widthPropDefs } from '../props/width.props.js';\nimport { heightPropDefs } from '../props/height.props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { WidthProps } from '../props/width.props.js';\nimport type { HeightProps } from '../props/height.props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype ImageElement = React.ElementRef<'img'>;\ntype ImageOwnProps = GetPropDefTypes<typeof imagePropDefs> & {\n loading?: 'eager' | 'lazy';\n};\n\ninterface ImageProps\n extends ComponentPropsWithout<'img', RemovedProps | 'color' | 'width' | 'height' | 'alt'>,\n MarginProps,\n WidthProps,\n HeightProps,\n ImageOwnProps {\n /**\n * The alt attribute provides alternative information for an image if a user for some reason cannot view it.\n * Required for accessibility.\n */\n alt
|
|
5
|
-
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,IAAA,eAAAC,EAAAH,GAEA,IAAAI,EAAuB,oBACvBC,EAAuB,yBAEvBC,EAA8B,4BAC9BC,EAA6B,uCAC7BC,EAA+B,oCAC/BC,EAA8B,mCAC9BC,EAA+B,oCA0B/B,MAAMR,EAAQE,EAAM,WAAqC,CAACO,EAAOC,IAAiB,CAChF,KAAM,CACJ,UAAAC,EACA,OAAAC,EACA,MAAAC,EACA,QAAAC,EAAU,OACV,IAAAC,EACA,GAAGC,CACL,KAAI,
|
|
6
|
-
"names": ["image_exports", "__export", "Image", "__toCommonJS", "React", "import_classnames", "import_image_props", "import_extract_props", "import_margin_props", "import_width_props", "import_height_props", "props", "forwardedRef", "className", "radius", "style", "loading", "alt", "imgProps", "classNames"]
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { imagePropDefs } from './image.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\nimport { widthPropDefs } from '../props/width.props.js';\nimport { heightPropDefs } from '../props/height.props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { WidthProps } from '../props/width.props.js';\nimport type { HeightProps } from '../props/height.props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype ImageElement = React.ElementRef<'img'>;\ntype ImageOwnProps = GetPropDefTypes<typeof imagePropDefs> & {\n loading?: 'eager' | 'lazy';\n};\n\ninterface ImageProps\n extends ComponentPropsWithout<'img', RemovedProps | 'color' | 'width' | 'height' | 'alt'>,\n MarginProps,\n WidthProps,\n HeightProps,\n ImageOwnProps {\n /**\n * The alt attribute provides alternative information for an image if a user for some reason cannot view it.\n * Required for accessibility when not using asChild.\n */\n alt?: string;\n}\n\nconst Image = React.forwardRef<ImageElement, ImageProps>((props, forwardedRef) => {\n const { variant = 'surface', fit = 'cover', children } = props;\n const {\n asChild,\n className,\n radius,\n style,\n loading = 'lazy',\n alt,\n src,\n children: _children, // Extract children to exclude from imgProps\n ...imgProps\n } = extractProps(props, imagePropDefs, marginPropDefs, widthPropDefs, heightPropDefs);\n\n // Create the standard img element\n const imgElement = (\n <img\n data-radius={radius}\n loading={loading}\n style={style}\n className={classNames(\n 'rt-reset',\n 'rt-Image',\n variant === 'blur' && 'rt-Image--blur',\n className,\n )}\n alt={alt}\n src={src}\n {...imgProps}\n ref={forwardedRef}\n />\n );\n\n // Handle asChild - inject img into the child element\n if (asChild && children) {\n const child = React.Children.only(children) as React.ReactElement<any>;\n\n if (variant === 'blur') {\n // For blur variant with asChild\n return React.cloneElement(child, {\n className: classNames(child.props?.className, 'rt-variant-blur'),\n style: {\n position: 'relative',\n display: 'inline-block',\n textDecoration: 'none', // Reset link underlines\n color: 'inherit', // Reset link colors\n border: 'none', // Reset button borders\n background: 'none', // Reset button backgrounds\n padding: 0, // Reset button padding\n font: 'inherit', // Reset button fonts\n cursor: 'pointer', // Ensure interactive cursor\n ...child.props?.style,\n },\n children: (\n <>\n {/* Background blurred image */}\n <img\n data-radius={radius}\n loading={loading}\n style={{\n ...style,\n position: 'absolute',\n top: '8px',\n left: '0',\n }}\n className={classNames(\n 'rt-reset',\n 'rt-Image',\n 'rt-Image--blur',\n 'rt-Image--blur-bg',\n className,\n )}\n alt=\"\"\n src={src}\n {...imgProps}\n />\n {/* Foreground image */}\n <img\n data-radius={radius}\n loading={loading}\n style={{ ...style, position: 'relative', zIndex: 1 }}\n className={classNames('rt-reset', 'rt-Image', 'rt-Image--blur', className)}\n alt={alt}\n src={src}\n {...imgProps}\n ref={forwardedRef}\n />\n </>\n ),\n });\n } else {\n // For surface variant with asChild\n return React.cloneElement(child, {\n className: classNames(child.props?.className, 'rt-Image'),\n style: {\n textDecoration: 'none', // Reset link underlines\n color: 'inherit', // Reset link colors\n border: 'none', // Reset button borders\n background: 'none', // Reset button backgrounds\n padding: 0, // Reset button padding\n font: 'inherit', // Reset button fonts\n cursor: 'pointer', // Ensure interactive cursor\n ...child.props?.style, // Allow user overrides\n },\n children: imgElement,\n });\n }\n }\n\n // Regular rendering without asChild\n if (variant === 'blur') {\n return (\n <div className=\"rt-variant-blur\" style={{ position: 'relative', display: 'inline-block' }}>\n {/* Background blurred image */}\n <img\n data-radius={radius}\n loading={loading}\n style={{\n ...style,\n position: 'absolute',\n top: '8px',\n left: '0',\n }}\n className={classNames(\n 'rt-reset',\n 'rt-Image',\n 'rt-Image--blur',\n 'rt-Image--blur-bg',\n className,\n )}\n alt=\"\"\n src={src}\n {...imgProps}\n />\n {/* Foreground image */}\n <img\n data-radius={radius}\n loading={loading}\n style={{ ...style, position: 'relative', zIndex: 1 }}\n className={classNames('rt-reset', 'rt-Image', 'rt-Image--blur', className)}\n alt={alt}\n src={src}\n {...imgProps}\n ref={forwardedRef}\n />\n </div>\n );\n }\n\n return imgElement;\n});\n\nImage.displayName = 'Image';\n\nexport { Image };\nexport type { ImageProps };\n"],
|
|
5
|
+
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,IAAA,eAAAC,EAAAH,GAEA,IAAAI,EAAuB,oBACvBC,EAAuB,yBAEvBC,EAA8B,4BAC9BC,EAA6B,uCAC7BC,EAA+B,oCAC/BC,EAA8B,mCAC9BC,EAA+B,oCA0B/B,MAAMR,EAAQE,EAAM,WAAqC,CAACO,EAAOC,IAAiB,CAChF,KAAM,CAAE,QAAAC,EAAU,UAAW,IAAAC,EAAM,QAAS,SAAAC,CAAS,EAAIJ,EACnD,CACJ,QAAAK,EACA,UAAAC,EACA,OAAAC,EACA,MAAAC,EACA,QAAAC,EAAU,OACV,IAAAC,EACA,IAAAC,EACA,SAAUC,EACV,GAAGC,CACL,KAAI,gBAAab,EAAO,gBAAe,iBAAgB,gBAAe,gBAAc,EAG9Ec,EACJrB,EAAA,cAAC,OACC,cAAac,EACb,QAASE,EACT,MAAOD,EACP,aAAW,EAAAO,SACT,WACA,WACAb,IAAY,QAAU,iBACtBI,CACF,EACA,IAAKI,EACL,IAAKC,EACJ,GAAGE,EACJ,IAAKZ,EACP,EAIF,GAAII,GAAWD,EAAU,CACvB,MAAMY,EAAQvB,EAAM,SAAS,KAAKW,CAAQ,EAE1C,OAAIF,IAAY,OAEPT,EAAM,aAAauB,EAAO,CAC/B,aAAW,EAAAD,SAAWC,EAAM,OAAO,UAAW,iBAAiB,EAC/D,MAAO,CACL,SAAU,WACV,QAAS,eACT,eAAgB,OAChB,MAAO,UACP,OAAQ,OACR,WAAY,OACZ,QAAS,EACT,KAAM,UACN,OAAQ,UACR,GAAGA,EAAM,OAAO,KAClB,EACA,SACEvB,EAAA,cAAAA,EAAA,cAEEA,EAAA,cAAC,OACC,cAAac,EACb,QAASE,EACT,MAAO,CACL,GAAGD,EACH,SAAU,WACV,IAAK,MACL,KAAM,GACR,EACA,aAAW,EAAAO,SACT,WACA,WACA,iBACA,oBACAT,CACF,EACA,IAAI,GACJ,IAAKK,EACJ,GAAGE,EACN,EAEApB,EAAA,cAAC,OACC,cAAac,EACb,QAASE,EACT,MAAO,CAAE,GAAGD,EAAO,SAAU,WAAY,OAAQ,CAAE,EACnD,aAAW,EAAAO,SAAW,WAAY,WAAY,iBAAkBT,CAAS,EACzE,IAAKI,EACL,IAAKC,EACJ,GAAGE,EACJ,IAAKZ,EACP,CACF,CAEJ,CAAC,EAGMR,EAAM,aAAauB,EAAO,CAC/B,aAAW,EAAAD,SAAWC,EAAM,OAAO,UAAW,UAAU,EACxD,MAAO,CACL,eAAgB,OAChB,MAAO,UACP,OAAQ,OACR,WAAY,OACZ,QAAS,EACT,KAAM,UACN,OAAQ,UACR,GAAGA,EAAM,OAAO,KAClB,EACA,SAAUF,CACZ,CAAC,CAEL,CAGA,OAAIZ,IAAY,OAEZT,EAAA,cAAC,OAAI,UAAU,kBAAkB,MAAO,CAAE,SAAU,WAAY,QAAS,cAAe,GAEtFA,EAAA,cAAC,OACC,cAAac,EACb,QAASE,EACT,MAAO,CACL,GAAGD,EACH,SAAU,WACV,IAAK,MACL,KAAM,GACR,EACA,aAAW,EAAAO,SACT,WACA,WACA,iBACA,oBACAT,CACF,EACA,IAAI,GACJ,IAAKK,EACJ,GAAGE,EACN,EAEApB,EAAA,cAAC,OACC,cAAac,EACb,QAASE,EACT,MAAO,CAAE,GAAGD,EAAO,SAAU,WAAY,OAAQ,CAAE,EACnD,aAAW,EAAAO,SAAW,WAAY,WAAY,iBAAkBT,CAAS,EACzE,IAAKI,EACL,IAAKC,EACJ,GAAGE,EACJ,IAAKZ,EACP,CACF,EAIGa,CACT,CAAC,EAEDvB,EAAM,YAAc",
|
|
6
|
+
"names": ["image_exports", "__export", "Image", "__toCommonJS", "React", "import_classnames", "import_image_props", "import_extract_props", "import_margin_props", "import_width_props", "import_height_props", "props", "forwardedRef", "variant", "fit", "children", "asChild", "className", "radius", "style", "loading", "alt", "src", "_children", "imgProps", "imgElement", "classNames", "child"]
|
|
7
7
|
}
|
|
@@ -28,6 +28,22 @@ declare const imagePropDefs: {
|
|
|
28
28
|
default: "cover";
|
|
29
29
|
responsive: true;
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* Sets the visual variant of the image.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* variant="surface"
|
|
36
|
+
* variant="blur"
|
|
37
|
+
*/
|
|
38
|
+
variant: {
|
|
39
|
+
type: "enum";
|
|
40
|
+
className: string;
|
|
41
|
+
values: readonly ["surface", "blur"];
|
|
42
|
+
default: "surface";
|
|
43
|
+
};
|
|
44
|
+
asChild: {
|
|
45
|
+
type: "boolean";
|
|
46
|
+
};
|
|
31
47
|
};
|
|
32
48
|
export { imagePropDefs };
|
|
33
49
|
//# sourceMappingURL=image.props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.props.d.ts","sourceRoot":"","sources":["../../../src/components/image.props.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"image.props.d.ts","sourceRoot":"","sources":["../../../src/components/image.props.ts"],"names":[],"mappings":"AASA,QAAA,MAAM,aAAa;;;;;;;;;;;;IAEjB;;;;;;;;;;OAUG;;;;;;;;IAQH;;;;;;OAMG;;;;;;;;;;CAYJ,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var s=Object.defineProperty;var
|
|
1
|
+
"use strict";var s=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var l=(r,e)=>{for(var t in e)s(r,t,{get:e[t],enumerable:!0})},v=(r,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of m(e))!u.call(r,o)&&o!==t&&s(r,o,{get:()=>e[o],enumerable:!(a=c(e,o))||a.enumerable});return r};var d=r=>v(s({},"__esModule",{value:!0}),r);var b={};l(b,{imagePropDefs:()=>n});module.exports=d(b);var f=require("../props/as-child.prop.js"),i=require("../props/radius.prop.js"),p=require("../props/shadow.props.js");const D=["cover","contain","fill","scale-down","none"],P=["surface","blur"],n={...f.asChildPropDef,fit:{type:"enum",className:"rt-r-fit",values:D,default:"cover",responsive:!0},variant:{type:"enum",className:"rt-variant",values:P,default:"surface"},...i.radiusPropDef,...p.shadowPropDefs};
|
|
2
2
|
//# sourceMappingURL=image.props.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/image.props.ts"],
|
|
4
|
-
"sourcesContent": ["import { radiusPropDef } from '../props/radius.prop.js';\nimport { shadowPropDefs } from '../props/shadow.props.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst objectFitValues = ['cover', 'contain', 'fill', 'scale-down', 'none'] as const;\n\nconst imagePropDefs = {\n /**\n * Sets the CSS **object-fit** property.\n * Controls how the image should be resized to fit its container.\n *\n * @example\n * fit=\"cover\"\n * fit=\"contain\"\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit\n */\n fit: {\n type: 'enum',\n className: 'rt-r-fit',\n values: objectFitValues,\n default: 'cover',\n responsive: true,\n },\n ...radiusPropDef,\n ...shadowPropDefs,\n} satisfies {\n fit: PropDef<(typeof objectFitValues)[number]>;\n};\n\nexport { imagePropDefs };\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA8B,mCAC9BC,EAA+B,oCAI/B,MAAMC,EAAkB,CAAC,QAAS,UAAW,OAAQ,aAAc,MAAM,
|
|
6
|
-
"names": ["image_props_exports", "__export", "imagePropDefs", "__toCommonJS", "import_radius_prop", "import_shadow_props", "objectFitValues"]
|
|
4
|
+
"sourcesContent": ["import { asChildPropDef } from '../props/as-child.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\nimport { shadowPropDefs } from '../props/shadow.props.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst objectFitValues = ['cover', 'contain', 'fill', 'scale-down', 'none'] as const;\nconst variants = ['surface', 'blur'] as const;\n\nconst imagePropDefs = {\n ...asChildPropDef,\n /**\n * Sets the CSS **object-fit** property.\n * Controls how the image should be resized to fit its container.\n *\n * @example\n * fit=\"cover\"\n * fit=\"contain\"\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit\n */\n fit: {\n type: 'enum',\n className: 'rt-r-fit',\n values: objectFitValues,\n default: 'cover',\n responsive: true,\n },\n /**\n * Sets the visual variant of the image.\n *\n * @example\n * variant=\"surface\"\n * variant=\"blur\"\n */\n variant: {\n type: 'enum',\n className: 'rt-variant',\n values: variants,\n default: 'surface',\n },\n ...radiusPropDef,\n ...shadowPropDefs,\n} satisfies {\n fit: PropDef<(typeof objectFitValues)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n};\n\nexport { imagePropDefs };\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA+B,qCAC/BC,EAA8B,mCAC9BC,EAA+B,oCAI/B,MAAMC,EAAkB,CAAC,QAAS,UAAW,OAAQ,aAAc,MAAM,EACnEC,EAAW,CAAC,UAAW,MAAM,EAE7BN,EAAgB,CACpB,GAAG,iBAYH,IAAK,CACH,KAAM,OACN,UAAW,WACX,OAAQK,EACR,QAAS,QACT,WAAY,EACd,EAQA,QAAS,CACP,KAAM,OACN,UAAW,aACX,OAAQC,EACR,QAAS,SACX,EACA,GAAG,gBACH,GAAG,gBACL",
|
|
6
|
+
"names": ["image_props_exports", "__export", "imagePropDefs", "__toCommonJS", "import_as_child_prop", "import_radius_prop", "import_shadow_props", "objectFitValues", "variants"]
|
|
7
7
|
}
|
|
@@ -11,9 +11,9 @@ type ImageOwnProps = GetPropDefTypes<typeof imagePropDefs> & {
|
|
|
11
11
|
interface ImageProps extends ComponentPropsWithout<'img', RemovedProps | 'color' | 'width' | 'height' | 'alt'>, MarginProps, WidthProps, HeightProps, ImageOwnProps {
|
|
12
12
|
/**
|
|
13
13
|
* The alt attribute provides alternative information for an image if a user for some reason cannot view it.
|
|
14
|
-
* Required for accessibility.
|
|
14
|
+
* Required for accessibility when not using asChild.
|
|
15
15
|
*/
|
|
16
|
-
alt
|
|
16
|
+
alt?: string;
|
|
17
17
|
}
|
|
18
18
|
declare const Image: React.ForwardRefExoticComponent<ImageProps & React.RefAttributes<HTMLImageElement>>;
|
|
19
19
|
export { Image };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/components/image.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,KAAK,aAAa,GAAG,eAAe,CAAC,OAAO,aAAa,CAAC,GAAG;IAC3D,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC5B,CAAC;AAEF,UAAU,UACR,SAAQ,qBAAqB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC,EACvF,WAAW,EACX,UAAU,EACV,WAAW,EACX,aAAa;IACf;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/components/image.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,KAAK,aAAa,GAAG,eAAe,CAAC,OAAO,aAAa,CAAC,GAAG;IAC3D,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC5B,CAAC;AAEF,UAAU,UACR,SAAQ,qBAAqB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC,EACvF,WAAW,EACX,UAAU,EACV,WAAW,EACX,aAAa;IACf;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,QAAA,MAAM,KAAK,qFAsJT,CAAC;AAIH,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import*as
|
|
1
|
+
"use client";import*as e from"react";import r from"classnames";import{imagePropDefs as h}from"./image.props.js";import{extractProps as I}from"../helpers/extract-props.js";import{marginPropDefs as P}from"../props/margin.props.js";import{widthPropDefs as b}from"../props/width.props.js";import{heightPropDefs as N}from"../props/height.props.js";const u=e.forwardRef((d,n)=>{const{variant:m="surface",fit:v="cover",children:c}=d,{asChild:y,className:o,radius:s,style:a,loading:i="lazy",alt:g,src:p,children:x,...l}=I(d,h,P,b,N),f=e.createElement("img",{"data-radius":s,loading:i,style:a,className:r("rt-reset","rt-Image",m==="blur"&&"rt-Image--blur",o),alt:g,src:p,...l,ref:n});if(y&&c){const t=e.Children.only(c);return m==="blur"?e.cloneElement(t,{className:r(t.props?.className,"rt-variant-blur"),style:{position:"relative",display:"inline-block",textDecoration:"none",color:"inherit",border:"none",background:"none",padding:0,font:"inherit",cursor:"pointer",...t.props?.style},children:e.createElement(e.Fragment,null,e.createElement("img",{"data-radius":s,loading:i,style:{...a,position:"absolute",top:"8px",left:"0"},className:r("rt-reset","rt-Image","rt-Image--blur","rt-Image--blur-bg",o),alt:"",src:p,...l}),e.createElement("img",{"data-radius":s,loading:i,style:{...a,position:"relative",zIndex:1},className:r("rt-reset","rt-Image","rt-Image--blur",o),alt:g,src:p,...l,ref:n}))}):e.cloneElement(t,{className:r(t.props?.className,"rt-Image"),style:{textDecoration:"none",color:"inherit",border:"none",background:"none",padding:0,font:"inherit",cursor:"pointer",...t.props?.style},children:f})}return m==="blur"?e.createElement("div",{className:"rt-variant-blur",style:{position:"relative",display:"inline-block"}},e.createElement("img",{"data-radius":s,loading:i,style:{...a,position:"absolute",top:"8px",left:"0"},className:r("rt-reset","rt-Image","rt-Image--blur","rt-Image--blur-bg",o),alt:"",src:p,...l}),e.createElement("img",{"data-radius":s,loading:i,style:{...a,position:"relative",zIndex:1},className:r("rt-reset","rt-Image","rt-Image--blur",o),alt:g,src:p,...l,ref:n})):f});u.displayName="Image";export{u as Image};
|
|
2
2
|
//# sourceMappingURL=image.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/image.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { imagePropDefs } from './image.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\nimport { widthPropDefs } from '../props/width.props.js';\nimport { heightPropDefs } from '../props/height.props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { WidthProps } from '../props/width.props.js';\nimport type { HeightProps } from '../props/height.props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype ImageElement = React.ElementRef<'img'>;\ntype ImageOwnProps = GetPropDefTypes<typeof imagePropDefs> & {\n loading?: 'eager' | 'lazy';\n};\n\ninterface ImageProps\n extends ComponentPropsWithout<'img', RemovedProps | 'color' | 'width' | 'height' | 'alt'>,\n MarginProps,\n WidthProps,\n HeightProps,\n ImageOwnProps {\n /**\n * The alt attribute provides alternative information for an image if a user for some reason cannot view it.\n * Required for accessibility.\n */\n alt
|
|
5
|
-
"mappings": "aAEA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aAEvB,OAAS,iBAAAC,MAAqB,mBAC9B,OAAS,gBAAAC,MAAoB,8BAC7B,OAAS,kBAAAC,MAAsB,2BAC/B,OAAS,iBAAAC,MAAqB,0BAC9B,OAAS,kBAAAC,MAAsB,2BA0B/B,MAAMC,EAAQP,EAAM,WAAqC,CAACQ,EAAOC,IAAiB,CAChF,KAAM,CACJ,UAAAC,EACA,OAAAC,EACA,MAAAC,EACA,QAAAC,EAAU,OACV,IAAAC,EACA,GAAGC,CACL,
|
|
6
|
-
"names": ["React", "classNames", "imagePropDefs", "extractProps", "marginPropDefs", "widthPropDefs", "heightPropDefs", "Image", "props", "forwardedRef", "className", "radius", "style", "loading", "alt", "imgProps"]
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { imagePropDefs } from './image.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\nimport { widthPropDefs } from '../props/width.props.js';\nimport { heightPropDefs } from '../props/height.props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { WidthProps } from '../props/width.props.js';\nimport type { HeightProps } from '../props/height.props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype ImageElement = React.ElementRef<'img'>;\ntype ImageOwnProps = GetPropDefTypes<typeof imagePropDefs> & {\n loading?: 'eager' | 'lazy';\n};\n\ninterface ImageProps\n extends ComponentPropsWithout<'img', RemovedProps | 'color' | 'width' | 'height' | 'alt'>,\n MarginProps,\n WidthProps,\n HeightProps,\n ImageOwnProps {\n /**\n * The alt attribute provides alternative information for an image if a user for some reason cannot view it.\n * Required for accessibility when not using asChild.\n */\n alt?: string;\n}\n\nconst Image = React.forwardRef<ImageElement, ImageProps>((props, forwardedRef) => {\n const { variant = 'surface', fit = 'cover', children } = props;\n const {\n asChild,\n className,\n radius,\n style,\n loading = 'lazy',\n alt,\n src,\n children: _children, // Extract children to exclude from imgProps\n ...imgProps\n } = extractProps(props, imagePropDefs, marginPropDefs, widthPropDefs, heightPropDefs);\n\n // Create the standard img element\n const imgElement = (\n <img\n data-radius={radius}\n loading={loading}\n style={style}\n className={classNames(\n 'rt-reset',\n 'rt-Image',\n variant === 'blur' && 'rt-Image--blur',\n className,\n )}\n alt={alt}\n src={src}\n {...imgProps}\n ref={forwardedRef}\n />\n );\n\n // Handle asChild - inject img into the child element\n if (asChild && children) {\n const child = React.Children.only(children) as React.ReactElement<any>;\n\n if (variant === 'blur') {\n // For blur variant with asChild\n return React.cloneElement(child, {\n className: classNames(child.props?.className, 'rt-variant-blur'),\n style: {\n position: 'relative',\n display: 'inline-block',\n textDecoration: 'none', // Reset link underlines\n color: 'inherit', // Reset link colors\n border: 'none', // Reset button borders\n background: 'none', // Reset button backgrounds\n padding: 0, // Reset button padding\n font: 'inherit', // Reset button fonts\n cursor: 'pointer', // Ensure interactive cursor\n ...child.props?.style,\n },\n children: (\n <>\n {/* Background blurred image */}\n <img\n data-radius={radius}\n loading={loading}\n style={{\n ...style,\n position: 'absolute',\n top: '8px',\n left: '0',\n }}\n className={classNames(\n 'rt-reset',\n 'rt-Image',\n 'rt-Image--blur',\n 'rt-Image--blur-bg',\n className,\n )}\n alt=\"\"\n src={src}\n {...imgProps}\n />\n {/* Foreground image */}\n <img\n data-radius={radius}\n loading={loading}\n style={{ ...style, position: 'relative', zIndex: 1 }}\n className={classNames('rt-reset', 'rt-Image', 'rt-Image--blur', className)}\n alt={alt}\n src={src}\n {...imgProps}\n ref={forwardedRef}\n />\n </>\n ),\n });\n } else {\n // For surface variant with asChild\n return React.cloneElement(child, {\n className: classNames(child.props?.className, 'rt-Image'),\n style: {\n textDecoration: 'none', // Reset link underlines\n color: 'inherit', // Reset link colors\n border: 'none', // Reset button borders\n background: 'none', // Reset button backgrounds\n padding: 0, // Reset button padding\n font: 'inherit', // Reset button fonts\n cursor: 'pointer', // Ensure interactive cursor\n ...child.props?.style, // Allow user overrides\n },\n children: imgElement,\n });\n }\n }\n\n // Regular rendering without asChild\n if (variant === 'blur') {\n return (\n <div className=\"rt-variant-blur\" style={{ position: 'relative', display: 'inline-block' }}>\n {/* Background blurred image */}\n <img\n data-radius={radius}\n loading={loading}\n style={{\n ...style,\n position: 'absolute',\n top: '8px',\n left: '0',\n }}\n className={classNames(\n 'rt-reset',\n 'rt-Image',\n 'rt-Image--blur',\n 'rt-Image--blur-bg',\n className,\n )}\n alt=\"\"\n src={src}\n {...imgProps}\n />\n {/* Foreground image */}\n <img\n data-radius={radius}\n loading={loading}\n style={{ ...style, position: 'relative', zIndex: 1 }}\n className={classNames('rt-reset', 'rt-Image', 'rt-Image--blur', className)}\n alt={alt}\n src={src}\n {...imgProps}\n ref={forwardedRef}\n />\n </div>\n );\n }\n\n return imgElement;\n});\n\nImage.displayName = 'Image';\n\nexport { Image };\nexport type { ImageProps };\n"],
|
|
5
|
+
"mappings": "aAEA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aAEvB,OAAS,iBAAAC,MAAqB,mBAC9B,OAAS,gBAAAC,MAAoB,8BAC7B,OAAS,kBAAAC,MAAsB,2BAC/B,OAAS,iBAAAC,MAAqB,0BAC9B,OAAS,kBAAAC,MAAsB,2BA0B/B,MAAMC,EAAQP,EAAM,WAAqC,CAACQ,EAAOC,IAAiB,CAChF,KAAM,CAAE,QAAAC,EAAU,UAAW,IAAAC,EAAM,QAAS,SAAAC,CAAS,EAAIJ,EACnD,CACJ,QAAAK,EACA,UAAAC,EACA,OAAAC,EACA,MAAAC,EACA,QAAAC,EAAU,OACV,IAAAC,EACA,IAAAC,EACA,SAAUC,EACV,GAAGC,CACL,EAAIlB,EAAaK,EAAON,EAAeE,EAAgBC,EAAeC,CAAc,EAG9EgB,EACJtB,EAAA,cAAC,OACC,cAAae,EACb,QAASE,EACT,MAAOD,EACP,UAAWf,EACT,WACA,WACAS,IAAY,QAAU,iBACtBI,CACF,EACA,IAAKI,EACL,IAAKC,EACJ,GAAGE,EACJ,IAAKZ,EACP,EAIF,GAAII,GAAWD,EAAU,CACvB,MAAMW,EAAQvB,EAAM,SAAS,KAAKY,CAAQ,EAE1C,OAAIF,IAAY,OAEPV,EAAM,aAAauB,EAAO,CAC/B,UAAWtB,EAAWsB,EAAM,OAAO,UAAW,iBAAiB,EAC/D,MAAO,CACL,SAAU,WACV,QAAS,eACT,eAAgB,OAChB,MAAO,UACP,OAAQ,OACR,WAAY,OACZ,QAAS,EACT,KAAM,UACN,OAAQ,UACR,GAAGA,EAAM,OAAO,KAClB,EACA,SACEvB,EAAA,cAAAA,EAAA,cAEEA,EAAA,cAAC,OACC,cAAae,EACb,QAASE,EACT,MAAO,CACL,GAAGD,EACH,SAAU,WACV,IAAK,MACL,KAAM,GACR,EACA,UAAWf,EACT,WACA,WACA,iBACA,oBACAa,CACF,EACA,IAAI,GACJ,IAAKK,EACJ,GAAGE,EACN,EAEArB,EAAA,cAAC,OACC,cAAae,EACb,QAASE,EACT,MAAO,CAAE,GAAGD,EAAO,SAAU,WAAY,OAAQ,CAAE,EACnD,UAAWf,EAAW,WAAY,WAAY,iBAAkBa,CAAS,EACzE,IAAKI,EACL,IAAKC,EACJ,GAAGE,EACJ,IAAKZ,EACP,CACF,CAEJ,CAAC,EAGMT,EAAM,aAAauB,EAAO,CAC/B,UAAWtB,EAAWsB,EAAM,OAAO,UAAW,UAAU,EACxD,MAAO,CACL,eAAgB,OAChB,MAAO,UACP,OAAQ,OACR,WAAY,OACZ,QAAS,EACT,KAAM,UACN,OAAQ,UACR,GAAGA,EAAM,OAAO,KAClB,EACA,SAAUD,CACZ,CAAC,CAEL,CAGA,OAAIZ,IAAY,OAEZV,EAAA,cAAC,OAAI,UAAU,kBAAkB,MAAO,CAAE,SAAU,WAAY,QAAS,cAAe,GAEtFA,EAAA,cAAC,OACC,cAAae,EACb,QAASE,EACT,MAAO,CACL,GAAGD,EACH,SAAU,WACV,IAAK,MACL,KAAM,GACR,EACA,UAAWf,EACT,WACA,WACA,iBACA,oBACAa,CACF,EACA,IAAI,GACJ,IAAKK,EACJ,GAAGE,EACN,EAEArB,EAAA,cAAC,OACC,cAAae,EACb,QAASE,EACT,MAAO,CAAE,GAAGD,EAAO,SAAU,WAAY,OAAQ,CAAE,EACnD,UAAWf,EAAW,WAAY,WAAY,iBAAkBa,CAAS,EACzE,IAAKI,EACL,IAAKC,EACJ,GAAGE,EACJ,IAAKZ,EACP,CACF,EAIGa,CACT,CAAC,EAEDf,EAAM,YAAc",
|
|
6
|
+
"names": ["React", "classNames", "imagePropDefs", "extractProps", "marginPropDefs", "widthPropDefs", "heightPropDefs", "Image", "props", "forwardedRef", "variant", "fit", "children", "asChild", "className", "radius", "style", "loading", "alt", "src", "_children", "imgProps", "imgElement", "child"]
|
|
7
7
|
}
|
|
@@ -28,6 +28,22 @@ declare const imagePropDefs: {
|
|
|
28
28
|
default: "cover";
|
|
29
29
|
responsive: true;
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* Sets the visual variant of the image.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* variant="surface"
|
|
36
|
+
* variant="blur"
|
|
37
|
+
*/
|
|
38
|
+
variant: {
|
|
39
|
+
type: "enum";
|
|
40
|
+
className: string;
|
|
41
|
+
values: readonly ["surface", "blur"];
|
|
42
|
+
default: "surface";
|
|
43
|
+
};
|
|
44
|
+
asChild: {
|
|
45
|
+
type: "boolean";
|
|
46
|
+
};
|
|
31
47
|
};
|
|
32
48
|
export { imagePropDefs };
|
|
33
49
|
//# sourceMappingURL=image.props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.props.d.ts","sourceRoot":"","sources":["../../../src/components/image.props.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"image.props.d.ts","sourceRoot":"","sources":["../../../src/components/image.props.ts"],"names":[],"mappings":"AASA,QAAA,MAAM,aAAa;;;;;;;;;;;;IAEjB;;;;;;;;;;OAUG;;;;;;;;IAQH;;;;;;OAMG;;;;;;;;;;CAYJ,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{asChildPropDef as e}from"../props/as-child.prop.js";import{radiusPropDef as r}from"../props/radius.prop.js";import{shadowPropDefs as o}from"../props/shadow.props.js";const t=["cover","contain","fill","scale-down","none"],s=["surface","blur"],a={...e,fit:{type:"enum",className:"rt-r-fit",values:t,default:"cover",responsive:!0},variant:{type:"enum",className:"rt-variant",values:s,default:"surface"},...r,...o};export{a as imagePropDefs};
|
|
2
2
|
//# sourceMappingURL=image.props.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/image.props.ts"],
|
|
4
|
-
"sourcesContent": ["import { radiusPropDef } from '../props/radius.prop.js';\nimport { shadowPropDefs } from '../props/shadow.props.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst objectFitValues = ['cover', 'contain', 'fill', 'scale-down', 'none'] as const;\n\nconst imagePropDefs = {\n /**\n * Sets the CSS **object-fit** property.\n * Controls how the image should be resized to fit its container.\n *\n * @example\n * fit=\"cover\"\n * fit=\"contain\"\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit\n */\n fit: {\n type: 'enum',\n className: 'rt-r-fit',\n values: objectFitValues,\n default: 'cover',\n responsive: true,\n },\n ...radiusPropDef,\n ...shadowPropDefs,\n} satisfies {\n fit: PropDef<(typeof objectFitValues)[number]>;\n};\n\nexport { imagePropDefs };\n"],
|
|
5
|
-
"mappings": "AAAA,OAAS,
|
|
6
|
-
"names": ["radiusPropDef", "shadowPropDefs", "objectFitValues", "imagePropDefs"]
|
|
4
|
+
"sourcesContent": ["import { asChildPropDef } from '../props/as-child.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\nimport { shadowPropDefs } from '../props/shadow.props.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst objectFitValues = ['cover', 'contain', 'fill', 'scale-down', 'none'] as const;\nconst variants = ['surface', 'blur'] as const;\n\nconst imagePropDefs = {\n ...asChildPropDef,\n /**\n * Sets the CSS **object-fit** property.\n * Controls how the image should be resized to fit its container.\n *\n * @example\n * fit=\"cover\"\n * fit=\"contain\"\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit\n */\n fit: {\n type: 'enum',\n className: 'rt-r-fit',\n values: objectFitValues,\n default: 'cover',\n responsive: true,\n },\n /**\n * Sets the visual variant of the image.\n *\n * @example\n * variant=\"surface\"\n * variant=\"blur\"\n */\n variant: {\n type: 'enum',\n className: 'rt-variant',\n values: variants,\n default: 'surface',\n },\n ...radiusPropDef,\n ...shadowPropDefs,\n} satisfies {\n fit: PropDef<(typeof objectFitValues)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n};\n\nexport { imagePropDefs };\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,kBAAAA,MAAsB,4BAC/B,OAAS,iBAAAC,MAAqB,0BAC9B,OAAS,kBAAAC,MAAsB,2BAI/B,MAAMC,EAAkB,CAAC,QAAS,UAAW,OAAQ,aAAc,MAAM,EACnEC,EAAW,CAAC,UAAW,MAAM,EAE7BC,EAAgB,CACpB,GAAGL,EAYH,IAAK,CACH,KAAM,OACN,UAAW,WACX,OAAQG,EACR,QAAS,QACT,WAAY,EACd,EAQA,QAAS,CACP,KAAM,OACN,UAAW,aACX,OAAQC,EACR,QAAS,SACX,EACA,GAAGH,EACH,GAAGC,CACL",
|
|
6
|
+
"names": ["asChildPropDef", "radiusPropDef", "shadowPropDefs", "objectFitValues", "variants", "imagePropDefs"]
|
|
7
7
|
}
|
package/package.json
CHANGED
package/src/components/image.css
CHANGED
|
@@ -1,8 +1,96 @@
|
|
|
1
|
+
/* stylelint-disable selector-max-type */
|
|
2
|
+
/* Disable selector-max-type rule to target `button` and `a` tags. */
|
|
3
|
+
/* Make sure these tags are wrapped in `:where()` for 0 specificity. */
|
|
4
|
+
|
|
1
5
|
.rt-Image {
|
|
2
6
|
display: block;
|
|
3
7
|
object-fit: var(--object-fit);
|
|
4
8
|
box-shadow: var(--box-shadow);
|
|
5
|
-
border-radius: max(var(--radius-
|
|
9
|
+
border-radius: max(var(--radius-4), var(--radius-full));
|
|
10
|
+
transition: var(--transition-button);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* Interactive states - follows Card pattern */
|
|
14
|
+
.rt-Image:where(:any-link, button, label) {
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
|
|
17
|
+
@media (hover: hover) {
|
|
18
|
+
&:where(:hover) {
|
|
19
|
+
transform: scale(1.02);
|
|
20
|
+
box-shadow:
|
|
21
|
+
var(--box-shadow, var(--shadow-2)),
|
|
22
|
+
0 0 0 1px var(--gray-a4);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:where(:focus-visible) {
|
|
27
|
+
outline: 2px solid var(--focus-8);
|
|
28
|
+
outline-offset: 2px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&:where(:active) {
|
|
32
|
+
transform: scale(0.98);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Blur variant wrapper */
|
|
37
|
+
.rt-variant-blur {
|
|
38
|
+
position: relative;
|
|
39
|
+
display: inline-block;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Interactive states for blur variant - follows Card pattern */
|
|
43
|
+
.rt-variant-blur:where(:any-link, button, label) {
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
transition: var(--transition-button);
|
|
46
|
+
|
|
47
|
+
@media (hover: hover) {
|
|
48
|
+
&:where(:hover) {
|
|
49
|
+
transform: scale(1.02);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:where(:focus-visible) {
|
|
54
|
+
outline: 2px solid var(--focus-8);
|
|
55
|
+
outline-offset: 2px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&:where(:active) {
|
|
59
|
+
transform: scale(0.98);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* Disable individual image interactions when inside blur variant */
|
|
64
|
+
/* stylelint-disable-next-line selector-max-specificity */
|
|
65
|
+
.rt-variant-blur:where(:any-link, button, label) .rt-Image {
|
|
66
|
+
cursor: inherit;
|
|
67
|
+
transform: none !important;
|
|
68
|
+
outline: none !important;
|
|
69
|
+
box-shadow: var(--box-shadow) !important;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Blur background image */
|
|
73
|
+
.rt-Image--blur-bg {
|
|
74
|
+
position: absolute;
|
|
75
|
+
top: var(--blur-offset-y, 8px);
|
|
76
|
+
left: var(--blur-offset-x, 0);
|
|
77
|
+
filter: var(--blur-filter);
|
|
78
|
+
opacity: var(--blur-opacity);
|
|
79
|
+
z-index: -1;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* Blur variant CSS variables */
|
|
83
|
+
.rt-variant-blur {
|
|
84
|
+
--blur-filter: blur(16px) saturate(1.5);
|
|
85
|
+
--blur-opacity: 0.5;
|
|
86
|
+
--blur-offset-y: 8px;
|
|
87
|
+
--blur-offset-x: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Image inside blur variant gets positioned */
|
|
91
|
+
.rt-Image--blur {
|
|
92
|
+
position: relative;
|
|
93
|
+
z-index: 1;
|
|
6
94
|
}
|
|
7
95
|
|
|
8
96
|
/* Object fit variants */
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { asChildPropDef } from '../props/as-child.prop.js';
|
|
1
2
|
import { radiusPropDef } from '../props/radius.prop.js';
|
|
2
3
|
import { shadowPropDefs } from '../props/shadow.props.js';
|
|
3
4
|
|
|
4
5
|
import type { PropDef } from '../props/prop-def.js';
|
|
5
6
|
|
|
6
7
|
const objectFitValues = ['cover', 'contain', 'fill', 'scale-down', 'none'] as const;
|
|
8
|
+
const variants = ['surface', 'blur'] as const;
|
|
7
9
|
|
|
8
10
|
const imagePropDefs = {
|
|
11
|
+
...asChildPropDef,
|
|
9
12
|
/**
|
|
10
13
|
* Sets the CSS **object-fit** property.
|
|
11
14
|
* Controls how the image should be resized to fit its container.
|
|
@@ -24,10 +27,24 @@ const imagePropDefs = {
|
|
|
24
27
|
default: 'cover',
|
|
25
28
|
responsive: true,
|
|
26
29
|
},
|
|
30
|
+
/**
|
|
31
|
+
* Sets the visual variant of the image.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* variant="surface"
|
|
35
|
+
* variant="blur"
|
|
36
|
+
*/
|
|
37
|
+
variant: {
|
|
38
|
+
type: 'enum',
|
|
39
|
+
className: 'rt-variant',
|
|
40
|
+
values: variants,
|
|
41
|
+
default: 'surface',
|
|
42
|
+
},
|
|
27
43
|
...radiusPropDef,
|
|
28
44
|
...shadowPropDefs,
|
|
29
45
|
} satisfies {
|
|
30
46
|
fit: PropDef<(typeof objectFitValues)[number]>;
|
|
47
|
+
variant: PropDef<(typeof variants)[number]>;
|
|
31
48
|
};
|
|
32
49
|
|
|
33
50
|
export { imagePropDefs };
|
package/src/components/image.tsx
CHANGED
|
@@ -28,32 +28,161 @@ interface ImageProps
|
|
|
28
28
|
ImageOwnProps {
|
|
29
29
|
/**
|
|
30
30
|
* The alt attribute provides alternative information for an image if a user for some reason cannot view it.
|
|
31
|
-
* Required for accessibility.
|
|
31
|
+
* Required for accessibility when not using asChild.
|
|
32
32
|
*/
|
|
33
|
-
alt
|
|
33
|
+
alt?: string;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
const Image = React.forwardRef<ImageElement, ImageProps>((props, forwardedRef) => {
|
|
37
|
+
const { variant = 'surface', fit = 'cover', children } = props;
|
|
37
38
|
const {
|
|
39
|
+
asChild,
|
|
38
40
|
className,
|
|
39
41
|
radius,
|
|
40
42
|
style,
|
|
41
43
|
loading = 'lazy',
|
|
42
44
|
alt,
|
|
45
|
+
src,
|
|
46
|
+
children: _children, // Extract children to exclude from imgProps
|
|
43
47
|
...imgProps
|
|
44
48
|
} = extractProps(props, imagePropDefs, marginPropDefs, widthPropDefs, heightPropDefs);
|
|
45
49
|
|
|
46
|
-
|
|
50
|
+
// Create the standard img element
|
|
51
|
+
const imgElement = (
|
|
47
52
|
<img
|
|
48
53
|
data-radius={radius}
|
|
49
54
|
loading={loading}
|
|
50
55
|
style={style}
|
|
51
|
-
className={classNames(
|
|
56
|
+
className={classNames(
|
|
57
|
+
'rt-reset',
|
|
58
|
+
'rt-Image',
|
|
59
|
+
variant === 'blur' && 'rt-Image--blur',
|
|
60
|
+
className,
|
|
61
|
+
)}
|
|
52
62
|
alt={alt}
|
|
63
|
+
src={src}
|
|
53
64
|
{...imgProps}
|
|
54
65
|
ref={forwardedRef}
|
|
55
66
|
/>
|
|
56
67
|
);
|
|
68
|
+
|
|
69
|
+
// Handle asChild - inject img into the child element
|
|
70
|
+
if (asChild && children) {
|
|
71
|
+
const child = React.Children.only(children) as React.ReactElement<any>;
|
|
72
|
+
|
|
73
|
+
if (variant === 'blur') {
|
|
74
|
+
// For blur variant with asChild
|
|
75
|
+
return React.cloneElement(child, {
|
|
76
|
+
className: classNames(child.props?.className, 'rt-variant-blur'),
|
|
77
|
+
style: {
|
|
78
|
+
position: 'relative',
|
|
79
|
+
display: 'inline-block',
|
|
80
|
+
textDecoration: 'none', // Reset link underlines
|
|
81
|
+
color: 'inherit', // Reset link colors
|
|
82
|
+
border: 'none', // Reset button borders
|
|
83
|
+
background: 'none', // Reset button backgrounds
|
|
84
|
+
padding: 0, // Reset button padding
|
|
85
|
+
font: 'inherit', // Reset button fonts
|
|
86
|
+
cursor: 'pointer', // Ensure interactive cursor
|
|
87
|
+
...child.props?.style,
|
|
88
|
+
},
|
|
89
|
+
children: (
|
|
90
|
+
<>
|
|
91
|
+
{/* Background blurred image */}
|
|
92
|
+
<img
|
|
93
|
+
data-radius={radius}
|
|
94
|
+
loading={loading}
|
|
95
|
+
style={{
|
|
96
|
+
...style,
|
|
97
|
+
position: 'absolute',
|
|
98
|
+
top: '8px',
|
|
99
|
+
left: '0',
|
|
100
|
+
}}
|
|
101
|
+
className={classNames(
|
|
102
|
+
'rt-reset',
|
|
103
|
+
'rt-Image',
|
|
104
|
+
'rt-Image--blur',
|
|
105
|
+
'rt-Image--blur-bg',
|
|
106
|
+
className,
|
|
107
|
+
)}
|
|
108
|
+
alt=""
|
|
109
|
+
src={src}
|
|
110
|
+
{...imgProps}
|
|
111
|
+
/>
|
|
112
|
+
{/* Foreground image */}
|
|
113
|
+
<img
|
|
114
|
+
data-radius={radius}
|
|
115
|
+
loading={loading}
|
|
116
|
+
style={{ ...style, position: 'relative', zIndex: 1 }}
|
|
117
|
+
className={classNames('rt-reset', 'rt-Image', 'rt-Image--blur', className)}
|
|
118
|
+
alt={alt}
|
|
119
|
+
src={src}
|
|
120
|
+
{...imgProps}
|
|
121
|
+
ref={forwardedRef}
|
|
122
|
+
/>
|
|
123
|
+
</>
|
|
124
|
+
),
|
|
125
|
+
});
|
|
126
|
+
} else {
|
|
127
|
+
// For surface variant with asChild
|
|
128
|
+
return React.cloneElement(child, {
|
|
129
|
+
className: classNames(child.props?.className, 'rt-Image'),
|
|
130
|
+
style: {
|
|
131
|
+
textDecoration: 'none', // Reset link underlines
|
|
132
|
+
color: 'inherit', // Reset link colors
|
|
133
|
+
border: 'none', // Reset button borders
|
|
134
|
+
background: 'none', // Reset button backgrounds
|
|
135
|
+
padding: 0, // Reset button padding
|
|
136
|
+
font: 'inherit', // Reset button fonts
|
|
137
|
+
cursor: 'pointer', // Ensure interactive cursor
|
|
138
|
+
...child.props?.style, // Allow user overrides
|
|
139
|
+
},
|
|
140
|
+
children: imgElement,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Regular rendering without asChild
|
|
146
|
+
if (variant === 'blur') {
|
|
147
|
+
return (
|
|
148
|
+
<div className="rt-variant-blur" style={{ position: 'relative', display: 'inline-block' }}>
|
|
149
|
+
{/* Background blurred image */}
|
|
150
|
+
<img
|
|
151
|
+
data-radius={radius}
|
|
152
|
+
loading={loading}
|
|
153
|
+
style={{
|
|
154
|
+
...style,
|
|
155
|
+
position: 'absolute',
|
|
156
|
+
top: '8px',
|
|
157
|
+
left: '0',
|
|
158
|
+
}}
|
|
159
|
+
className={classNames(
|
|
160
|
+
'rt-reset',
|
|
161
|
+
'rt-Image',
|
|
162
|
+
'rt-Image--blur',
|
|
163
|
+
'rt-Image--blur-bg',
|
|
164
|
+
className,
|
|
165
|
+
)}
|
|
166
|
+
alt=""
|
|
167
|
+
src={src}
|
|
168
|
+
{...imgProps}
|
|
169
|
+
/>
|
|
170
|
+
{/* Foreground image */}
|
|
171
|
+
<img
|
|
172
|
+
data-radius={radius}
|
|
173
|
+
loading={loading}
|
|
174
|
+
style={{ ...style, position: 'relative', zIndex: 1 }}
|
|
175
|
+
className={classNames('rt-reset', 'rt-Image', 'rt-Image--blur', className)}
|
|
176
|
+
alt={alt}
|
|
177
|
+
src={src}
|
|
178
|
+
{...imgProps}
|
|
179
|
+
ref={forwardedRef}
|
|
180
|
+
/>
|
|
181
|
+
</div>
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return imgElement;
|
|
57
186
|
});
|
|
58
187
|
|
|
59
188
|
Image.displayName = 'Image';
|
package/styles.css
CHANGED
|
@@ -10702,7 +10702,66 @@
|
|
|
10702
10702
|
display: block;
|
|
10703
10703
|
object-fit: var(--object-fit);
|
|
10704
10704
|
box-shadow: var(--box-shadow);
|
|
10705
|
-
border-radius: max(var(--radius-
|
|
10705
|
+
border-radius: max(var(--radius-4), var(--radius-full));
|
|
10706
|
+
transition: var(--transition-button);
|
|
10707
|
+
}
|
|
10708
|
+
.rt-Image:where(:any-link, button, label) {
|
|
10709
|
+
cursor: pointer;
|
|
10710
|
+
}
|
|
10711
|
+
@media (hover: hover) {
|
|
10712
|
+
.rt-Image:where(:any-link, button, label):where(:hover) {
|
|
10713
|
+
transform: scale(1.02);
|
|
10714
|
+
box-shadow: var(--box-shadow, var(--shadow-2)), 0 0 0 1px var(--gray-a4);
|
|
10715
|
+
}
|
|
10716
|
+
}
|
|
10717
|
+
.rt-Image:where(:any-link, button, label):where(:focus-visible) {
|
|
10718
|
+
outline: 2px solid var(--focus-8);
|
|
10719
|
+
outline-offset: 2px;
|
|
10720
|
+
}
|
|
10721
|
+
.rt-Image:where(:any-link, button, label):where(:active) {
|
|
10722
|
+
transform: scale(0.98);
|
|
10723
|
+
}
|
|
10724
|
+
.rt-variant-blur {
|
|
10725
|
+
position: relative;
|
|
10726
|
+
display: inline-block;
|
|
10727
|
+
--blur-filter: blur(16px) saturate(1.5);
|
|
10728
|
+
--blur-opacity: 0.5;
|
|
10729
|
+
--blur-offset-y: 8px;
|
|
10730
|
+
--blur-offset-x: 0;
|
|
10731
|
+
}
|
|
10732
|
+
.rt-variant-blur:where(:any-link, button, label) {
|
|
10733
|
+
cursor: pointer;
|
|
10734
|
+
transition: var(--transition-button);
|
|
10735
|
+
}
|
|
10736
|
+
@media (hover: hover) {
|
|
10737
|
+
.rt-variant-blur:where(:any-link, button, label):where(:hover) {
|
|
10738
|
+
transform: scale(1.02);
|
|
10739
|
+
}
|
|
10740
|
+
}
|
|
10741
|
+
.rt-variant-blur:where(:any-link, button, label):where(:focus-visible) {
|
|
10742
|
+
outline: 2px solid var(--focus-8);
|
|
10743
|
+
outline-offset: 2px;
|
|
10744
|
+
}
|
|
10745
|
+
.rt-variant-blur:where(:any-link, button, label):where(:active) {
|
|
10746
|
+
transform: scale(0.98);
|
|
10747
|
+
}
|
|
10748
|
+
.rt-variant-blur:where(:any-link, button, label) .rt-Image {
|
|
10749
|
+
cursor: inherit;
|
|
10750
|
+
transform: none !important;
|
|
10751
|
+
outline: none !important;
|
|
10752
|
+
box-shadow: var(--box-shadow) !important;
|
|
10753
|
+
}
|
|
10754
|
+
.rt-Image--blur-bg {
|
|
10755
|
+
position: absolute;
|
|
10756
|
+
top: var(--blur-offset-y, 8px);
|
|
10757
|
+
left: var(--blur-offset-x, 0);
|
|
10758
|
+
filter: var(--blur-filter);
|
|
10759
|
+
opacity: var(--blur-opacity);
|
|
10760
|
+
z-index: -1;
|
|
10761
|
+
}
|
|
10762
|
+
.rt-Image--blur {
|
|
10763
|
+
position: relative;
|
|
10764
|
+
z-index: 1;
|
|
10706
10765
|
}
|
|
10707
10766
|
.rt-r-fit-cover {
|
|
10708
10767
|
--object-fit: cover;
|