-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: notes * feat: type fixes for note repository * feat: started notes in the backoffice * feat: more work on ui notes * feat: visual work * feat: more work * feat: added pretty editor * feat: more work * feat: boyscouting nad moved sidebar to components directory * feat: small fixes * feat: changes for nitzan * feat: small fixes * feat: version bump * feat: pr comments fix * feat: version bump * feat: pr comments fix * feat: tests fix * feat: test fix
- Loading branch information
1 parent
69cd6b9
commit a4e1e74
Showing
165 changed files
with
7,127 additions
and
737 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
File renamed without changes.
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 |
---|---|---|
|
@@ -96,5 +96,9 @@ | |
"success": "Merchant checks created successfully.", | ||
"error": "Error occurred while creating merchant checks.", | ||
"is_example": "Please contact Ballerine at [email protected] for access to this feature." | ||
}, | ||
"note_created": { | ||
"success": "Note added successfully.", | ||
"error": "Error occurred while adding note." | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
apps/backoffice-v2/src/common/components/atoms/Toggle/Toggle.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,40 @@ | ||
import * as React from 'react'; | ||
import * as TogglePrimitive from '@radix-ui/react-toggle'; | ||
import { cva, type VariantProps } from 'class-variance-authority'; | ||
import { ctw } from '@ballerine/ui'; | ||
|
||
const toggleVariants = cva( | ||
'inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground', | ||
{ | ||
variants: { | ||
variant: { | ||
default: 'bg-transparent', | ||
outline: 'border border-input bg-transparent hover:bg-accent hover:text-accent-foreground', | ||
}, | ||
size: { | ||
default: 'h-10 px-3', | ||
sm: 'h-9 px-2.5', | ||
lg: 'h-11 px-5', | ||
}, | ||
}, | ||
defaultVariants: { | ||
variant: 'default', | ||
size: 'default', | ||
}, | ||
}, | ||
); | ||
|
||
const Toggle = React.forwardRef< | ||
React.ElementRef<typeof TogglePrimitive.Root>, | ||
React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants> | ||
>(({ className, variant, size, ...props }, ref) => ( | ||
<TogglePrimitive.Root | ||
ref={ref} | ||
className={ctw(toggleVariants({ variant, size, className }))} | ||
{...props} | ||
/> | ||
)); | ||
|
||
Toggle.displayName = TogglePrimitive.Root.displayName; | ||
|
||
export { Toggle, toggleVariants }; |
54 changes: 54 additions & 0 deletions
54
apps/backoffice-v2/src/common/components/atoms/ToggleGroup/ToggleGroup.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,54 @@ | ||
import * as React from 'react'; | ||
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group'; | ||
import { type VariantProps } from 'class-variance-authority'; | ||
import { toggleVariants } from '@/common/components/atoms/Toggle/Toggle'; | ||
import { ctw } from '@ballerine/ui'; | ||
|
||
const ToggleGroupContext = React.createContext<VariantProps<typeof toggleVariants>>({ | ||
size: 'default', | ||
variant: 'default', | ||
}); | ||
|
||
const ToggleGroup = React.forwardRef< | ||
React.ElementRef<typeof ToggleGroupPrimitive.Root>, | ||
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> & | ||
VariantProps<typeof toggleVariants> | ||
>(({ className, variant, size, children, ...props }, ref) => ( | ||
<ToggleGroupPrimitive.Root | ||
ref={ref} | ||
className={ctw('flex items-center justify-center gap-1', className)} | ||
{...props} | ||
> | ||
<ToggleGroupContext.Provider value={{ variant, size }}>{children}</ToggleGroupContext.Provider> | ||
</ToggleGroupPrimitive.Root> | ||
)); | ||
|
||
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName; | ||
|
||
const ToggleGroupItem = React.forwardRef< | ||
React.ElementRef<typeof ToggleGroupPrimitive.Item>, | ||
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> & | ||
VariantProps<typeof toggleVariants> | ||
>(({ className, children, variant, size, ...props }, ref) => { | ||
const context = React.useContext(ToggleGroupContext); | ||
|
||
return ( | ||
<ToggleGroupPrimitive.Item | ||
ref={ref} | ||
className={ctw( | ||
toggleVariants({ | ||
variant: context.variant || variant, | ||
size: context.size || size, | ||
}), | ||
className, | ||
)} | ||
{...props} | ||
> | ||
{children} | ||
</ToggleGroupPrimitive.Item> | ||
); | ||
}); | ||
|
||
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName; | ||
|
||
export { ToggleGroup, ToggleGroupItem }; |
37 changes: 37 additions & 0 deletions
37
apps/backoffice-v2/src/common/components/molecules/NotesButton/NotesButton.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,37 @@ | ||
import { Link } from 'react-router-dom'; | ||
import { SquarePen } from 'lucide-react'; | ||
|
||
import { ctw } from '@/common/utils/ctw/ctw'; | ||
import { useUpdateIsNotesOpen } from '@/common/hooks/useUpdateIsNotesOpen/useUpdateIsNotesOpen'; | ||
|
||
interface INotesButtonProps { | ||
numberOfNotes: number | undefined; | ||
} | ||
|
||
export const NotesButton = ({ numberOfNotes = 0 }: INotesButtonProps) => { | ||
const updateIsNotesOpen = useUpdateIsNotesOpen(); | ||
|
||
return ( | ||
<div className={`flex items-center space-x-2`}> | ||
<span className={`me-2 text-sm leading-6`}>Notes</span> | ||
<Link | ||
className={`relative`} | ||
to={{ | ||
search: updateIsNotesOpen(), | ||
}} | ||
> | ||
<SquarePen className={`d-5`} /> | ||
{numberOfNotes > 0 && ( | ||
<div | ||
className={ctw( | ||
`absolute left-3 top-3 rounded-full bg-slate-600 text-center text-[10px] font-bold text-white`, | ||
{ 'd-[14px]': numberOfNotes < 10, 'h-3.5 w-5 ps-[3px]': numberOfNotes >= 10 }, | ||
)} | ||
> | ||
{numberOfNotes > 9 ? '9+' : numberOfNotes} | ||
</div> | ||
)} | ||
</Link> | ||
</div> | ||
); | ||
}; |
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
20 changes: 20 additions & 0 deletions
20
apps/backoffice-v2/src/common/components/organisms/Sidebar/Sidebar.Content.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,20 @@ | ||
import * as React from 'react'; | ||
import { ctw } from '@ballerine/ui'; | ||
|
||
export const SidebarContent = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'>>( | ||
({ className, ...props }, ref) => { | ||
return ( | ||
<div | ||
ref={ref} | ||
data-sidebar="content" | ||
className={ctw( | ||
'flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden', | ||
className, | ||
)} | ||
{...props} | ||
/> | ||
); | ||
}, | ||
); | ||
|
||
SidebarContent.displayName = 'SidebarContent'; |
5 changes: 5 additions & 0 deletions
5
apps/backoffice-v2/src/common/components/organisms/Sidebar/Sidebar.Context.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,5 @@ | ||
import * as React from 'react'; | ||
|
||
import type { TSidebarContext } from '@/common/components/organisms/Sidebar/types'; | ||
|
||
export const SidebarContext = React.createContext<TSidebarContext | null>(null); |
17 changes: 17 additions & 0 deletions
17
apps/backoffice-v2/src/common/components/organisms/Sidebar/Sidebar.Footer.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,17 @@ | ||
import * as React from 'react'; | ||
import { ctw } from '@ballerine/ui'; | ||
|
||
export const SidebarFooter = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'>>( | ||
({ className, ...props }, ref) => { | ||
return ( | ||
<div | ||
ref={ref} | ||
data-sidebar="footer" | ||
className={ctw('flex flex-col gap-2 p-2', className)} | ||
{...props} | ||
/> | ||
); | ||
}, | ||
); | ||
|
||
SidebarFooter.displayName = 'SidebarFooter'; |
17 changes: 17 additions & 0 deletions
17
apps/backoffice-v2/src/common/components/organisms/Sidebar/Sidebar.Group.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,17 @@ | ||
import * as React from 'react'; | ||
import { ctw } from '@ballerine/ui'; | ||
|
||
export const SidebarGroup = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'>>( | ||
({ className, ...props }, ref) => { | ||
return ( | ||
<div | ||
ref={ref} | ||
data-sidebar="group" | ||
className={ctw('relative flex w-full min-w-0 flex-col p-2', className)} | ||
{...props} | ||
/> | ||
); | ||
}, | ||
); | ||
|
||
SidebarGroup.displayName = 'SidebarGroup'; |
27 changes: 27 additions & 0 deletions
27
apps/backoffice-v2/src/common/components/organisms/Sidebar/Sidebar.GroupAction.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,27 @@ | ||
import * as React from 'react'; | ||
import { ctw } from '@ballerine/ui'; | ||
import { Slot } from '@radix-ui/react-slot'; | ||
|
||
export const SidebarGroupAction = React.forwardRef< | ||
HTMLButtonElement, | ||
React.ComponentProps<'button'> & { asChild?: boolean } | ||
>(({ className, asChild = false, ...props }, ref) => { | ||
const Comp = asChild ? Slot : 'button'; | ||
|
||
return ( | ||
<Comp | ||
ref={ref} | ||
data-sidebar="group-action" | ||
className={ctw( | ||
'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground [&>svg]:size-4 absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:shrink-0', | ||
// Increases the hit area of the button on mobile. | ||
'after:absolute after:-inset-2 after:md:hidden', | ||
'group-data-[collapsible=icon]:hidden', | ||
className, | ||
)} | ||
{...props} | ||
/> | ||
); | ||
}); | ||
|
||
SidebarGroupAction.displayName = 'SidebarGroupAction'; |
15 changes: 15 additions & 0 deletions
15
apps/backoffice-v2/src/common/components/organisms/Sidebar/Sidebar.GroupContent.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,15 @@ | ||
import * as React from 'react'; | ||
import { ctw } from '@ballerine/ui'; | ||
|
||
export const SidebarGroupContent = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'>>( | ||
({ className, ...props }, ref) => ( | ||
<div | ||
ref={ref} | ||
data-sidebar="group-content" | ||
className={ctw('w-full text-sm', className)} | ||
{...props} | ||
/> | ||
), | ||
); | ||
|
||
SidebarGroupContent.displayName = 'SidebarGroupContent'; |
Oops, something went wrong.