Skip to content

Commit

Permalink
build(sub-layer): format, build & publish package
Browse files Browse the repository at this point in the history
  • Loading branch information
lovrozagar committed Oct 26, 2024
1 parent e7e79a9 commit ddebbd9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 24 deletions.
31 changes: 15 additions & 16 deletions src/packages/components/sub-layer/src/components/sub-layer.tsx
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 }
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 }
4 changes: 2 additions & 2 deletions src/packages/components/sub-layer/src/index.ts
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"
8 changes: 3 additions & 5 deletions src/packages/components/sub-layer/src/types/sub-layer.ts
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 }

0 comments on commit ddebbd9

Please sign in to comment.