-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(sub-layer): format, build & publish package
- Loading branch information
1 parent
e7e79a9
commit ddebbd9
Showing
4 changed files
with
21 additions
and
24 deletions.
There are no files selected for viewing
31 changes: 15 additions & 16 deletions
31
src/packages/components/sub-layer/src/components/sub-layer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
'use client' | ||
"use client" | ||
|
||
import { cn, polymorphic } from '@renderui/utils' | ||
|
||
import { DEFAULT_SUB_LAYER_CLASSNAME } from '@/components/sub-layer/constants/constants' | ||
import type { SubLayerProps } from '@/components/sub-layer/types/sub-layer' | ||
import { cn, polymorphic } from "@renderui/utils" | ||
import { DEFAULT_SUB_LAYER_CLASSNAME } from "../constants/constants" | ||
import type { SubLayerProps } from "../types/sub-layer" | ||
|
||
const SubLayer = (props: SubLayerProps) => { | ||
const { asChild, className, role = 'presentation', ...restProps } = props | ||
const { asChild, className, role = "presentation", ...restProps } = props | ||
|
||
const Component = polymorphic(asChild, 'span') | ||
const Component = polymorphic(asChild, "span") | ||
|
||
return ( | ||
<Component | ||
role={role} | ||
aria-hidden | ||
data-slot='sub-layer' | ||
className={cn(DEFAULT_SUB_LAYER_CLASSNAME, className)} | ||
{...restProps} | ||
/> | ||
) | ||
return ( | ||
<Component | ||
role={role} | ||
aria-hidden | ||
data-slot="sub-layer" | ||
className={cn(DEFAULT_SUB_LAYER_CLASSNAME, className)} | ||
{...restProps} | ||
/> | ||
) | ||
} | ||
|
||
export { SubLayer } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
const DEFAULT_SUB_LAYER_CLASSNAME = | ||
'_sub-layer absolute z-0 inset-0 p-[inherit] rounded-[inherit] overflow-hidden' | ||
"_sub-layer absolute z-0 inset-0 p-[inherit] rounded-[inherit] overflow-hidden" | ||
|
||
export { DEFAULT_SUB_LAYER_CLASSNAME } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export { SubLayer } from "./components/sub-layer"; | ||
export type { SubLayerProps } from "./types/sub-layer"; | ||
export { SubLayer } from "./components/sub-layer" | ||
export type { SubLayerProps } from "./types/sub-layer" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import type { Simplify } from '@/components/_shared/types/simplify' | ||
import type React from 'react' | ||
import type { PolymorphicProps, Simplify } from "@renderui/utils" | ||
import type { ComponentPropsWithRef } from "react" | ||
|
||
import type { AsChildProp } from '@/components/_shared/types/as-child' | ||
|
||
type SubLayerProps = Simplify<React.ComponentPropsWithRef<'span'> & AsChildProp> | ||
type SubLayerProps = Simplify<ComponentPropsWithRef<"span"> & PolymorphicProps> | ||
|
||
export type { SubLayerProps } |