-
-
Notifications
You must be signed in to change notification settings - Fork 755
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6030943
commit 12b5e82
Showing
34 changed files
with
514 additions
and
158 deletions.
There are no files selected for viewing
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
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
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
29 changes: 29 additions & 0 deletions
29
apps/www/src/registry/default/plate-static-ui/checkbox.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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import * as React from 'react'; | ||
|
||
import { cn } from '@udecode/cn'; | ||
import { Check } from 'lucide-react'; | ||
|
||
export function StaticCheckbox({ | ||
className, | ||
...props | ||
}: { | ||
checked: boolean; | ||
className?: string; | ||
style?: React.CSSProperties; | ||
}) { | ||
return ( | ||
<button | ||
className={cn( | ||
'peer size-4 shrink-0 rounded-sm border border-primary bg-background ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground', | ||
className | ||
)} | ||
data-state={props.checked ? 'checked' : 'unchecked'} | ||
type="button" | ||
{...props} | ||
> | ||
<div className={cn('flex items-center justify-center text-current')}> | ||
{props.checked && <Check className="size-4" />} | ||
</div> | ||
</button> | ||
); | ||
} |
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
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
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
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
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
21 changes: 21 additions & 0 deletions
21
apps/www/src/registry/default/plate-static-ui/highlight-leaf.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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
|
||
import type { StaticLeafProps } from '@udecode/plate-core'; | ||
|
||
import { cn } from '@udecode/cn'; | ||
import { PlateStaticLeaf } from '@udecode/plate-common'; | ||
|
||
export function HighlightStaticLeaf({ | ||
children, | ||
className, | ||
...props | ||
}: StaticLeafProps) { | ||
return ( | ||
<PlateStaticLeaf | ||
className={cn('bg-highlight/30 text-inherit', className)} | ||
{...props} | ||
> | ||
<mark>{children}</mark> | ||
</PlateStaticLeaf> | ||
); | ||
} |
Oops, something went wrong.