@gridui/feature 1.0.3 → 1.0.6
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 +5 -5
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/styles.css +12 -12
- package/docs/catalog.json +71 -0
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -22,11 +22,11 @@ Content slots must not contain interactive elements inside the link.
|
|
|
22
22
|
|
|
23
23
|
`mobileLayout` selects the layout below 48rem:
|
|
24
24
|
|
|
25
|
-
- `"banner"` (default): artwork is
|
|
26
|
-
without artwork, content has a
|
|
27
|
-
- `"shallow"`: artwork is
|
|
28
|
-
without artwork, content has a
|
|
29
|
-
- `"compact"`:
|
|
25
|
+
- `"banner"` (default): artwork is 10.25rem tall and content starts at 11rem;
|
|
26
|
+
without artwork, content has a 1.5rem top inset.
|
|
27
|
+
- `"shallow"`: artwork is 5.5rem tall and content starts at 6.25rem;
|
|
28
|
+
without artwork, content has a 1.5rem top inset.
|
|
29
|
+
- `"compact"`: a 5rem square thumbnail sits beside the content, with no
|
|
30
30
|
gradient overlay. Without artwork, content uses the full available width.
|
|
31
31
|
|
|
32
32
|
```tsx
|
package/dist/index.js
CHANGED
|
@@ -41,8 +41,8 @@ var featureBannerStyles = cva2(cn3(
|
|
|
41
41
|
), {
|
|
42
42
|
variants: {
|
|
43
43
|
mobileLayout: {
|
|
44
|
-
banner: "gridui-u-[--gridui-banner-artwork-height:
|
|
45
|
-
shallow: "gridui-u-[--gridui-banner-artwork-height:
|
|
44
|
+
banner: "gridui-u-[--gridui-banner-artwork-height:10.25rem] gridui-u-[--gridui-banner-fade-start:5rem]",
|
|
45
|
+
shallow: "gridui-u-[--gridui-banner-artwork-height:5.5rem] gridui-u-[--gridui-banner-fade-start:2.5rem]",
|
|
46
46
|
compact: "gridui-feature-banner-compact gridui-u-max-[48rem]:p-gridui-24 gridui-u-max-[48rem]:gap-gridui-16"
|
|
47
47
|
},
|
|
48
48
|
hasArtwork: {
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/feature-action/style.ts", "../src/feature-action/feature-action.tsx", "../src/feature-banner/style.ts", "../src/feature-banner/feature-banner.tsx", "../src/feature-domain/style.ts", "../src/feature-domain/feature-domain.tsx", "../src/feature-identity/feature-identity.tsx", "../src/feature-link/style.ts", "../src/feature-link/feature-link.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * @author WMXPY\n * @package Feature\n * @namespace FeatureAction\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const featureVisitStyles = cva(cn(\n \"gridui-feature-visit\",\n \"gridui-u-inline-flex gridui-u-items-center gridui-u-gap-gridui-8\",\n \"gridui-u-[&_svg]:w-gridui-16 gridui-u-[&_svg]:h-gridui-16\",\n));\n", "/**\n * @author WMXPY\n * @package Feature\n * @namespace FeatureAction\n * @description Feature Action\n */\n\nimport { featureVisitStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type FC, type ReactNode } from \"react\";\n\nexport type FeatureActionProps = ComponentPropsWithRef<\"span\"> & {\n readonly icon: ReactNode;\n};\n\nexport const FeatureAction: FC<FeatureActionProps> = (props: FeatureActionProps) => {\n const {\n icon,\n children,\n className,\n ...restProps\n } = props;\n return (<span\n {...restProps}\n className={cn(featureVisitStyles(), className)}\n >\n {children}\n {icon}\n </span>);\n};\n", "/**\n * @author WMXPY\n * @package Feature\n * @namespace FeatureBanner\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const featureBannerStyles = cva(cn(\n \"gridui-feature-banner\",\n \"gridui-u-relative gridui-u-isolate gridui-u-grid gridui-u-overflow-hidden gridui-u-text-foreground gridui-u-bg-surface gridui-u-no-underline\",\n \"gridui-u-min-[48rem]:items-center\",\n), {\n variants: {\n mobileLayout: {\n banner: \"gridui-u-[--gridui-banner-artwork-height:164px] gridui-u-[--gridui-banner-fade-start:80px]\",\n shallow: \"gridui-u-[--gridui-banner-artwork-height:88px] gridui-u-[--gridui-banner-fade-start:40px]\",\n compact: \"gridui-feature-banner-compact gridui-u-max-[48rem]:p-gridui-24 gridui-u-max-[48rem]:gap-gridui-16\",\n },\n hasArtwork: {\n true: \"gridui-u-min-[48rem]:min-h-68\",\n false: \"gridui-feature-banner-without-artwork\",\n },\n },\n compoundVariants: [\n {\n mobileLayout: \"compact\",\n hasArtwork: true,\n className: \"gridui-u-max-[48rem]:grid-cols-[80px_minmax(0,1fr)]\",\n },\n ],\n});\n\nexport const featureBannerArtworkStyles = cva(cn(\n \"gridui-feature-banner-artwork\",\n \"gridui-u-object-cover gridui-u-object-center\",\n \"gridui-u-transition-transform gridui-u-duration-240 gridui-u-ease-[ease] gridui-u-motion-reduce:transition-none gridui-u-motion-reduce:duration-0\",\n));\n\nexport const featureBannerContentStyles = cva(cn(\n \"gridui-feature-banner-content gridui-u-box-border gridui-u-flex gridui-u-min-w-0 gridui-u-flex-col gridui-u-items-start gridui-u-gap-gridui-16\",\n \"gridui-u-min-[48rem]:py-gridui-32 gridui-u-min-[48rem]:px-gridui-48\",\n), {\n variants: {\n mobileLayout: {\n banner: \"gridui-u-max-[48rem]:px-gridui-24 gridui-u-max-[48rem]:pb-gridui-32\",\n shallow: \"gridui-u-max-[48rem]:px-gridui-24 gridui-u-max-[48rem]:pb-gridui-24\",\n compact: \"\",\n },\n hasArtwork: {\n true: \"\",\n false: \"\",\n },\n },\n compoundVariants: [\n {\n mobileLayout: \"banner\",\n hasArtwork: true,\n className: \"gridui-u-max-[48rem]:pt-44\",\n },\n {\n mobileLayout: \"shallow\",\n hasArtwork: true,\n className: \"gridui-u-max-[48rem]:pt-25\",\n },\n {\n mobileLayout: [\n \"banner\",\n \"shallow\",\n ],\n hasArtwork: false,\n className: \"gridui-u-max-[48rem]:pt-gridui-24\",\n },\n ],\n});\n\nexport const featureBannerActionStyles = cva(cn(\n \"gridui-feature-banner-action\",\n \"gridui-u-inline-flex gridui-u-min-h-11 gridui-u-items-center gridui-u-gap-gridui-8 gridui-u-mt-gridui-8 gridui-u-text-link gridui-u-type-ui\",\n));\n", "/**\n * @author WMXPY\n * @package Feature\n * @namespace FeatureBanner\n * @description Feature Banner\n */\n\nimport { featureBannerActionStyles, featureBannerArtworkStyles, featureBannerContentStyles, featureBannerStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport { ArrowUpRight } from \"lucide-react\";\nimport { Children, type ComponentPropsWithRef, type FC, type ReactNode, useId } from \"react\";\n\nexport type FeatureBannerProps = Omit<ComponentPropsWithRef<\"a\">, \"children\" | \"title\"> & {\n readonly title: ReactNode;\n readonly description?: ReactNode;\n readonly artwork?: string | undefined;\n readonly action?: ReactNode;\n readonly mobileLayout?: \"banner\" | \"shallow\" | \"compact\";\n};\n\nexport const FeatureBanner: FC<FeatureBannerProps> = (props: FeatureBannerProps) => {\n const { title, description, artwork, action, mobileLayout = \"banner\", className, ...restProps } = props;\n const id = useId();\n const hasDescription = Children.toArray(description).some(child => {\n return child !== \"\";\n });\n const hasAction = Children.toArray(action).some(child => {\n return child !== \"\";\n });\n return (<a\n aria-labelledby={`${id}-title`}\n aria-describedby={hasDescription ? `${id}-intro` : undefined}\n {...restProps}\n className={cn(featureBannerStyles({\n mobileLayout,\n hasArtwork: Boolean(artwork),\n }), className)}\n >\n {artwork && (<img\n className={cn(featureBannerArtworkStyles())}\n src={artwork}\n alt=\"\"\n width={1920}\n height={620}\n loading=\"lazy\"\n decoding=\"async\"\n referrerPolicy=\"no-referrer\"\n />)}\n <div\n className={cn(featureBannerContentStyles({\n mobileLayout,\n hasArtwork: Boolean(artwork),\n }))}\n >\n <h2\n id={`${id}-title`}\n className=\"gridui-u-type-heading\"\n >\n {title}\n </h2>\n {hasDescription && (<p\n className=\"gridui-copy\"\n id={`${id}-intro`}\n >\n {description}\n </p>)}\n {hasAction && (<span\n className={cn(featureBannerActionStyles())}\n >\n {action}\n <ArrowUpRight\n aria-hidden=\"true\"\n size={18}\n />\n </span>)}\n </div>\n </a>);\n};\n", "/**\n * @author WMXPY\n * @package Feature\n * @namespace FeatureDomain\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const featureDomainStyles = cva(cn(\n \"gridui-feature-domain\",\n \"gridui-u-type-code\",\n));\n", "/**\n * @author WMXPY\n * @package Feature\n * @namespace FeatureDomain\n * @description Feature Domain\n */\n\nimport { featureDomainStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type FC } from \"react\";\n\nexport type FeatureDomainProps = ComponentPropsWithRef<\"span\">;\n\nexport const FeatureDomain: FC<FeatureDomainProps> = (props: FeatureDomainProps) => {\n const { className, ...restProps } = props;\n return (<span\n {...restProps}\n className={cn(featureDomainStyles(), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Feature\n * @namespace FeatureIdentity\n * @description Feature Identity\n */\n\nimport { type FC, type ReactNode } from \"react\";\n\nexport type FeatureIdentityProps = {\n readonly logo: ReactNode;\n readonly children: ReactNode;\n};\n\nexport const FeatureIdentity: FC<FeatureIdentityProps> = (props: FeatureIdentityProps) => {\n const { logo, children } = props;\n return (<>\n {logo}\n <h2\n className=\"gridui-wordmark\"\n >\n {children}\n </h2>\n </>);\n};\n", "/**\n * @author WMXPY\n * @package Feature\n * @namespace FeatureLink\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const featureLinkStyles = cva(cn(\n \"gridui-feature-link\",\n \"gridui-u-flex gridui-u-h-full gridui-u-flex-col gridui-u-p-gridui-24 gridui-u-text-foreground gridui-u-bg-[color-mix(in_srgb,var(--gridui-feature-accent)_3%,var(--gridui-background))] gridui-u-no-underline gridui-u-[transition:background-color_120ms_ease]\",\n \"gridui-u-min-[40rem]:py-gridui-32 gridui-u-min-[40rem]:px-gridui-48\",\n \"gridui-u-motion-reduce:transition-none\",\n));\n\nexport const featureCategoryStyles = cva(cn(\n \"gridui-feature-category\",\n \"gridui-u-mb-gridui-24\",\n));\n\nexport const featureIdentityStyles = cva(cn(\n \"gridui-feature-identity\",\n \"gridui-u-flex gridui-u-items-center gridui-u-gap-gridui-16\",\n \"gridui-u-[&_>_svg]:w-gridui-48 gridui-u-[&_>_svg]:h-gridui-48 gridui-u-[&_>_svg]:shrink-0\",\n \"gridui-u-[&_h2]:type-heading\",\n \"gridui-u-min-[40rem]:[&_>_svg]:w-gridui-64 gridui-u-min-[40rem]:[&_>_svg]:h-gridui-64\",\n));\n\nexport const featureDescriptionStyles = cva(cn(\n \"gridui-feature-description\",\n \"gridui-u-flex-1 gridui-u-mt-gridui-24 gridui-u-text-muted\",\n));\n\nexport const featureDestinationStyles = cva(cn(\n \"gridui-feature-destination\",\n \"gridui-u-flex gridui-u-flex-wrap gridui-u-items-center gridui-u-justify-between gridui-u-gap-gridui-16 gridui-u-mt-gridui-32 gridui-u-pt-gridui-16 gridui-u-border-t gridui-u-border-solid gridui-u-border-[color-mix(in_srgb,var(--gridui-feature-accent)_18%,var(--gridui-background))] gridui-u-text-(--gridui-feature-accent) gridui-u-type-caption\",\n));\n", "/**\n * @author WMXPY\n * @package Feature\n * @namespace FeatureLink\n * @description Feature Link\n */\n\nimport { featureCategoryStyles, featureDescriptionStyles, featureDestinationStyles, featureIdentityStyles, featureLinkStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport { Children, type ComponentPropsWithRef, type CSSProperties, type FC, type ReactNode } from \"react\";\n\ntype PresentationStyle = CSSProperties & {\n [key: `--gridui-${string}`]: string | number;\n};\n\nexport type FeatureLinkProps = ComponentPropsWithRef<\"a\"> & {\n readonly seed: string;\n readonly category?: ReactNode;\n readonly identity: ReactNode;\n readonly description?: ReactNode;\n readonly destination?: ReactNode;\n};\n\nexport const FeatureLink: FC<FeatureLinkProps> = (props: FeatureLinkProps) => {\n const {\n seed,\n category,\n identity,\n description,\n destination,\n className,\n style,\n ...restProps\n } = props;\n const hasCategory = Children.toArray(category).some(child => {\n return child !== \"\";\n });\n const hasDescription = Children.toArray(description).some(child => {\n return child !== \"\";\n });\n const hasDestination = Children.toArray(destination).some(child => {\n return child !== \"\";\n });\n return (<a\n {...restProps}\n className={cn(featureLinkStyles(), className)}\n style={{\n \"--gridui-feature-seed\": seed,\n ...style,\n } as PresentationStyle}\n >\n {hasCategory && (<p\n className={cn(\"gridui-u-type-eyebrow gridui-u-text-muted\", featureCategoryStyles())}\n >\n {category}\n </p>)}\n <div\n className={cn(featureIdentityStyles())}\n >\n {identity}\n </div>\n {hasDescription && (<p\n className={cn(featureDescriptionStyles())}\n >\n {description}\n </p>)}\n {hasDestination && (<div\n className={cn(featureDestinationStyles())}\n >\n {destination}\n </div>)}\n </a>);\n};\n"],
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Feature\n * @namespace FeatureAction\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const featureVisitStyles = cva(cn(\n \"gridui-feature-visit\",\n \"gridui-u-inline-flex gridui-u-items-center gridui-u-gap-gridui-8\",\n \"gridui-u-[&_svg]:w-gridui-16 gridui-u-[&_svg]:h-gridui-16\",\n));\n", "/**\n * @author WMXPY\n * @package Feature\n * @namespace FeatureAction\n * @description Feature Action\n */\n\nimport { featureVisitStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type FC, type ReactNode } from \"react\";\n\nexport type FeatureActionProps = ComponentPropsWithRef<\"span\"> & {\n readonly icon: ReactNode;\n};\n\nexport const FeatureAction: FC<FeatureActionProps> = (props: FeatureActionProps) => {\n const {\n icon,\n children,\n className,\n ...restProps\n } = props;\n return (<span\n {...restProps}\n className={cn(featureVisitStyles(), className)}\n >\n {children}\n {icon}\n </span>);\n};\n", "/**\n * @author WMXPY\n * @package Feature\n * @namespace FeatureBanner\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const featureBannerStyles = cva(cn(\n \"gridui-feature-banner\",\n \"gridui-u-relative gridui-u-isolate gridui-u-grid gridui-u-overflow-hidden gridui-u-text-foreground gridui-u-bg-surface gridui-u-no-underline\",\n \"gridui-u-min-[48rem]:items-center\",\n), {\n variants: {\n mobileLayout: {\n banner: \"gridui-u-[--gridui-banner-artwork-height:10.25rem] gridui-u-[--gridui-banner-fade-start:5rem]\",\n shallow: \"gridui-u-[--gridui-banner-artwork-height:5.5rem] gridui-u-[--gridui-banner-fade-start:2.5rem]\",\n compact: \"gridui-feature-banner-compact gridui-u-max-[48rem]:p-gridui-24 gridui-u-max-[48rem]:gap-gridui-16\",\n },\n hasArtwork: {\n true: \"gridui-u-min-[48rem]:min-h-68\",\n false: \"gridui-feature-banner-without-artwork\",\n },\n },\n compoundVariants: [\n {\n mobileLayout: \"compact\",\n hasArtwork: true,\n className: \"gridui-u-max-[48rem]:grid-cols-[80px_minmax(0,1fr)]\",\n },\n ],\n});\n\nexport const featureBannerArtworkStyles = cva(cn(\n \"gridui-feature-banner-artwork\",\n \"gridui-u-object-cover gridui-u-object-center\",\n \"gridui-u-transition-transform gridui-u-duration-240 gridui-u-ease-[ease] gridui-u-motion-reduce:transition-none gridui-u-motion-reduce:duration-0\",\n));\n\nexport const featureBannerContentStyles = cva(cn(\n \"gridui-feature-banner-content gridui-u-box-border gridui-u-flex gridui-u-min-w-0 gridui-u-flex-col gridui-u-items-start gridui-u-gap-gridui-16\",\n \"gridui-u-min-[48rem]:py-gridui-32 gridui-u-min-[48rem]:px-gridui-48\",\n), {\n variants: {\n mobileLayout: {\n banner: \"gridui-u-max-[48rem]:px-gridui-24 gridui-u-max-[48rem]:pb-gridui-32\",\n shallow: \"gridui-u-max-[48rem]:px-gridui-24 gridui-u-max-[48rem]:pb-gridui-24\",\n compact: \"\",\n },\n hasArtwork: {\n true: \"\",\n false: \"\",\n },\n },\n compoundVariants: [\n {\n mobileLayout: \"banner\",\n hasArtwork: true,\n className: \"gridui-u-max-[48rem]:pt-44\",\n },\n {\n mobileLayout: \"shallow\",\n hasArtwork: true,\n className: \"gridui-u-max-[48rem]:pt-25\",\n },\n {\n mobileLayout: [\n \"banner\",\n \"shallow\",\n ],\n hasArtwork: false,\n className: \"gridui-u-max-[48rem]:pt-gridui-24\",\n },\n ],\n});\n\nexport const featureBannerActionStyles = cva(cn(\n \"gridui-feature-banner-action\",\n \"gridui-u-inline-flex gridui-u-min-h-11 gridui-u-items-center gridui-u-gap-gridui-8 gridui-u-mt-gridui-8 gridui-u-text-link gridui-u-type-ui\",\n));\n", "/**\n * @author WMXPY\n * @package Feature\n * @namespace FeatureBanner\n * @description Feature Banner\n */\n\nimport { featureBannerActionStyles, featureBannerArtworkStyles, featureBannerContentStyles, featureBannerStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport { ArrowUpRight } from \"lucide-react\";\nimport { Children, type ComponentPropsWithRef, type FC, type ReactNode, useId } from \"react\";\n\nexport type FeatureBannerProps = Omit<ComponentPropsWithRef<\"a\">, \"children\" | \"title\"> & {\n readonly title: ReactNode;\n readonly description?: ReactNode;\n readonly artwork?: string | undefined;\n readonly action?: ReactNode;\n readonly mobileLayout?: \"banner\" | \"shallow\" | \"compact\";\n};\n\nexport const FeatureBanner: FC<FeatureBannerProps> = (props: FeatureBannerProps) => {\n const { title, description, artwork, action, mobileLayout = \"banner\", className, ...restProps } = props;\n const id = useId();\n const hasDescription = Children.toArray(description).some(child => {\n return child !== \"\";\n });\n const hasAction = Children.toArray(action).some(child => {\n return child !== \"\";\n });\n return (<a\n aria-labelledby={`${id}-title`}\n aria-describedby={hasDescription ? `${id}-intro` : undefined}\n {...restProps}\n className={cn(featureBannerStyles({\n mobileLayout,\n hasArtwork: Boolean(artwork),\n }), className)}\n >\n {artwork && (<img\n className={cn(featureBannerArtworkStyles())}\n src={artwork}\n alt=\"\"\n width={1920}\n height={620}\n loading=\"lazy\"\n decoding=\"async\"\n referrerPolicy=\"no-referrer\"\n />)}\n <div\n className={cn(featureBannerContentStyles({\n mobileLayout,\n hasArtwork: Boolean(artwork),\n }))}\n >\n <h2\n id={`${id}-title`}\n className=\"gridui-u-type-heading\"\n >\n {title}\n </h2>\n {hasDescription && (<p\n className=\"gridui-copy\"\n id={`${id}-intro`}\n >\n {description}\n </p>)}\n {hasAction && (<span\n className={cn(featureBannerActionStyles())}\n >\n {action}\n <ArrowUpRight\n aria-hidden=\"true\"\n size={18}\n />\n </span>)}\n </div>\n </a>);\n};\n", "/**\n * @author WMXPY\n * @package Feature\n * @namespace FeatureDomain\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const featureDomainStyles = cva(cn(\n \"gridui-feature-domain\",\n \"gridui-u-type-code\",\n));\n", "/**\n * @author WMXPY\n * @package Feature\n * @namespace FeatureDomain\n * @description Feature Domain\n */\n\nimport { featureDomainStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type FC } from \"react\";\n\nexport type FeatureDomainProps = ComponentPropsWithRef<\"span\">;\n\nexport const FeatureDomain: FC<FeatureDomainProps> = (props: FeatureDomainProps) => {\n const { className, ...restProps } = props;\n return (<span\n {...restProps}\n className={cn(featureDomainStyles(), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Feature\n * @namespace FeatureIdentity\n * @description Feature Identity\n */\n\nimport { type FC, type ReactNode } from \"react\";\n\nexport type FeatureIdentityProps = {\n readonly logo: ReactNode;\n readonly children: ReactNode;\n};\n\nexport const FeatureIdentity: FC<FeatureIdentityProps> = (props: FeatureIdentityProps) => {\n const { logo, children } = props;\n return (<>\n {logo}\n <h2\n className=\"gridui-wordmark\"\n >\n {children}\n </h2>\n </>);\n};\n", "/**\n * @author WMXPY\n * @package Feature\n * @namespace FeatureLink\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const featureLinkStyles = cva(cn(\n \"gridui-feature-link\",\n \"gridui-u-flex gridui-u-h-full gridui-u-flex-col gridui-u-p-gridui-24 gridui-u-text-foreground gridui-u-bg-[color-mix(in_srgb,var(--gridui-feature-accent)_3%,var(--gridui-background))] gridui-u-no-underline gridui-u-[transition:background-color_120ms_ease]\",\n \"gridui-u-min-[40rem]:py-gridui-32 gridui-u-min-[40rem]:px-gridui-48\",\n \"gridui-u-motion-reduce:transition-none\",\n));\n\nexport const featureCategoryStyles = cva(cn(\n \"gridui-feature-category\",\n \"gridui-u-mb-gridui-24\",\n));\n\nexport const featureIdentityStyles = cva(cn(\n \"gridui-feature-identity\",\n \"gridui-u-flex gridui-u-items-center gridui-u-gap-gridui-16\",\n \"gridui-u-[&_>_svg]:w-gridui-48 gridui-u-[&_>_svg]:h-gridui-48 gridui-u-[&_>_svg]:shrink-0\",\n \"gridui-u-[&_h2]:type-heading\",\n \"gridui-u-min-[40rem]:[&_>_svg]:w-gridui-64 gridui-u-min-[40rem]:[&_>_svg]:h-gridui-64\",\n));\n\nexport const featureDescriptionStyles = cva(cn(\n \"gridui-feature-description\",\n \"gridui-u-flex-1 gridui-u-mt-gridui-24 gridui-u-text-muted\",\n));\n\nexport const featureDestinationStyles = cva(cn(\n \"gridui-feature-destination\",\n \"gridui-u-flex gridui-u-flex-wrap gridui-u-items-center gridui-u-justify-between gridui-u-gap-gridui-16 gridui-u-mt-gridui-32 gridui-u-pt-gridui-16 gridui-u-border-t gridui-u-border-solid gridui-u-border-[color-mix(in_srgb,var(--gridui-feature-accent)_18%,var(--gridui-background))] gridui-u-text-(--gridui-feature-accent) gridui-u-type-caption\",\n));\n", "/**\n * @author WMXPY\n * @package Feature\n * @namespace FeatureLink\n * @description Feature Link\n */\n\nimport { featureCategoryStyles, featureDescriptionStyles, featureDestinationStyles, featureIdentityStyles, featureLinkStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport { Children, type ComponentPropsWithRef, type CSSProperties, type FC, type ReactNode } from \"react\";\n\ntype PresentationStyle = CSSProperties & {\n [key: `--gridui-${string}`]: string | number;\n};\n\nexport type FeatureLinkProps = ComponentPropsWithRef<\"a\"> & {\n readonly seed: string;\n readonly category?: ReactNode;\n readonly identity: ReactNode;\n readonly description?: ReactNode;\n readonly destination?: ReactNode;\n};\n\nexport const FeatureLink: FC<FeatureLinkProps> = (props: FeatureLinkProps) => {\n const {\n seed,\n category,\n identity,\n description,\n destination,\n className,\n style,\n ...restProps\n } = props;\n const hasCategory = Children.toArray(category).some(child => {\n return child !== \"\";\n });\n const hasDescription = Children.toArray(description).some(child => {\n return child !== \"\";\n });\n const hasDestination = Children.toArray(destination).some(child => {\n return child !== \"\";\n });\n return (<a\n {...restProps}\n className={cn(featureLinkStyles(), className)}\n style={{\n \"--gridui-feature-seed\": seed,\n ...style,\n } as PresentationStyle}\n >\n {hasCategory && (<p\n className={cn(\"gridui-u-type-eyebrow gridui-u-text-muted\", featureCategoryStyles())}\n >\n {category}\n </p>)}\n <div\n className={cn(featureIdentityStyles())}\n >\n {identity}\n </div>\n {hasDescription && (<p\n className={cn(featureDescriptionStyles())}\n >\n {description}\n </p>)}\n {hasDestination && (<div\n className={cn(featureDestinationStyles())}\n >\n {destination}\n </div>)}\n </a>);\n};\n"],
|
|
5
5
|
"mappings": ";AAOA,SAAS,UAAU;AACnB,SAAS,WAAW;AAEb,IAAM,qBAAqB,IAAI;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AACJ,CAAC;;;ACND,SAAS,MAAAA,WAAU;AACnB,OAAoE;AAaxD;AAPL,IAAM,gBAAwC,CAAC,UAA8B;AAChF,QAAM;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACP,IAAI;AACJ,SAAQ;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,WAAWA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;AAAA;AAAA,QACL;AAAA;AAAA;AAAA,EACJ;AACJ;",
|
|
6
6
|
"names": ["cn", "cn", "cva", "cn", "jsxs", "cn", "cva", "cn", "jsx", "jsx", "jsxs", "cn", "cva", "cn", "Children", "jsx", "jsxs"]
|
|
7
7
|
}
|
package/dist/styles.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! tailwindcss v4.3.
|
|
1
|
+
/*! tailwindcss v4.3.4 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties;
|
|
3
3
|
@layer theme, base, components, utilities;
|
|
4
4
|
@layer theme {
|
|
@@ -159,17 +159,17 @@
|
|
|
159
159
|
--tw-ease: ease;
|
|
160
160
|
transition-timing-function: ease;
|
|
161
161
|
}
|
|
162
|
-
.gridui-u-\[--gridui-banner-artwork-height\:
|
|
163
|
-
--gridui-banner-artwork-height:
|
|
162
|
+
.gridui-u-\[--gridui-banner-artwork-height\:5\.5rem\] {
|
|
163
|
+
--gridui-banner-artwork-height: 5.5rem;
|
|
164
164
|
}
|
|
165
|
-
.gridui-u-\[--gridui-banner-artwork-height\:
|
|
166
|
-
--gridui-banner-artwork-height:
|
|
165
|
+
.gridui-u-\[--gridui-banner-artwork-height\:10\.25rem\] {
|
|
166
|
+
--gridui-banner-artwork-height: 10.25rem;
|
|
167
167
|
}
|
|
168
|
-
.gridui-u-\[--gridui-banner-fade-start\:
|
|
169
|
-
--gridui-banner-fade-start:
|
|
168
|
+
.gridui-u-\[--gridui-banner-fade-start\:2\.5rem\] {
|
|
169
|
+
--gridui-banner-fade-start: 2.5rem;
|
|
170
170
|
}
|
|
171
|
-
.gridui-u-\[--gridui-banner-fade-start\:
|
|
172
|
-
--gridui-banner-fade-start:
|
|
171
|
+
.gridui-u-\[--gridui-banner-fade-start\:5rem\] {
|
|
172
|
+
--gridui-banner-fade-start: 5rem;
|
|
173
173
|
}
|
|
174
174
|
.gridui-u-\[transition\:background-color_120ms_ease\] {
|
|
175
175
|
transition: background-color 120ms ease;
|
|
@@ -292,8 +292,8 @@
|
|
|
292
292
|
position: relative;
|
|
293
293
|
z-index: var(--gridui-z-base);
|
|
294
294
|
inset: auto;
|
|
295
|
-
width:
|
|
296
|
-
height:
|
|
295
|
+
width: 5rem;
|
|
296
|
+
height: 5rem;
|
|
297
297
|
}
|
|
298
298
|
.gridui-feature-banner-compact::before {
|
|
299
299
|
content: none;
|
|
@@ -347,7 +347,7 @@
|
|
|
347
347
|
inherits: false;
|
|
348
348
|
}
|
|
349
349
|
@layer properties {
|
|
350
|
-
@supports ((-webkit-hyphens: none) and (not (margin-trim:
|
|
350
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
351
351
|
*, ::before, ::after, ::backdrop {
|
|
352
352
|
--tw-border-style: solid;
|
|
353
353
|
--tw-duration: initial;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"name": "@gridui/feature",
|
|
4
|
+
"version": "1.0.6",
|
|
5
|
+
"category": "landing",
|
|
6
|
+
"description": "GridUI React feature",
|
|
7
|
+
"usage": "`FeatureBanner` is a single native destination link with a heading and optional decorative image, description, and trailing arrow action. Import it from `@gridui/feature` and load the package stylesheet. Supply `href`, `title`, and optional `description`, `action`, and `artwork` (image URL). Native anchor props and refs are forwarded; `className` is merged. The title receives a unique accessible relationship by default; a description relationship is added only when description content is present. Omitted, empty, or false descriptions and actions add no wrapper or spacing. Without artwork, content uses the full width without an image gap, overlay, or minimum image height. Content slots must not contain interactive elements inside the link.",
|
|
8
|
+
"documentation": [
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
11
|
+
"exports": [
|
|
12
|
+
{
|
|
13
|
+
"name": "FeatureAction",
|
|
14
|
+
"kind": "component",
|
|
15
|
+
"importPath": "@gridui/feature"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "FeatureActionProps",
|
|
19
|
+
"kind": "type",
|
|
20
|
+
"importPath": "@gridui/feature"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "FeatureBanner",
|
|
24
|
+
"kind": "component",
|
|
25
|
+
"importPath": "@gridui/feature"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "FeatureBannerProps",
|
|
29
|
+
"kind": "type",
|
|
30
|
+
"importPath": "@gridui/feature"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "FeatureDomain",
|
|
34
|
+
"kind": "component",
|
|
35
|
+
"importPath": "@gridui/feature"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "FeatureDomainProps",
|
|
39
|
+
"kind": "type",
|
|
40
|
+
"importPath": "@gridui/feature"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "FeatureIdentity",
|
|
44
|
+
"kind": "component",
|
|
45
|
+
"importPath": "@gridui/feature"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "FeatureIdentityProps",
|
|
49
|
+
"kind": "type",
|
|
50
|
+
"importPath": "@gridui/feature"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "FeatureLink",
|
|
54
|
+
"kind": "component",
|
|
55
|
+
"importPath": "@gridui/feature"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "FeatureLinkProps",
|
|
59
|
+
"kind": "type",
|
|
60
|
+
"importPath": "@gridui/feature"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"styles": [
|
|
64
|
+
"@gridui/theme/styles.css",
|
|
65
|
+
"@gridui/feature/styles.css"
|
|
66
|
+
],
|
|
67
|
+
"examples": [
|
|
68
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-landing/feature/stories/feature-banner.stories.tsx",
|
|
69
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-landing/feature/stories/feature-link.stories.tsx"
|
|
70
|
+
]
|
|
71
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/feature",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "GridUI React feature",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
|
-
"README.md"
|
|
9
|
+
"README.md",
|
|
10
|
+
"docs"
|
|
10
11
|
],
|
|
11
12
|
"sideEffects": [
|
|
12
13
|
"**/*.css"
|
|
@@ -26,15 +27,15 @@
|
|
|
26
27
|
"react-dom": "^19.2.0"
|
|
27
28
|
},
|
|
28
29
|
"dependencies": {
|
|
29
|
-
"@gridui/style-utils": "^2.
|
|
30
|
-
"@gridui/theme": "^2.
|
|
30
|
+
"@gridui/style-utils": "^2.2.2",
|
|
31
|
+
"@gridui/theme": "^2.5.3",
|
|
31
32
|
"class-variance-authority": "0.7.1",
|
|
32
|
-
"lucide-react": "1.
|
|
33
|
+
"lucide-react": "1.69.0"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
36
|
"@gridui-internal/configuration": "0.0.0-internal",
|
|
36
37
|
"@jest/globals": "30.5.2",
|
|
37
|
-
"@storybook/react-vite": "10.6.
|
|
38
|
+
"@storybook/react-vite": "10.6.6",
|
|
38
39
|
"@types/jest": "30.0.0",
|
|
39
40
|
"@types/node": "26.6.6",
|
|
40
41
|
"@types/react": "19.3.0",
|