@lotte-innovate/ui-component-test 0.1.72 → 0.1.73
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib/Typography/Header/index.js +2 -55
- package/dist/lib/Typography/Header/index.js.map +1 -0
- package/dist/lib/Typography/Text/index.js +2 -44
- package/dist/lib/Typography/Text/index.js.map +1 -0
- package/dist/lib/color/alpha.js +2 -784
- package/dist/lib/color/alpha.js.map +1 -0
- package/dist/lib/color/constants.js +2 -296
- package/dist/lib/color/constants.js.map +1 -0
- package/dist/lib/color/light.js +2 -393
- package/dist/lib/color/light.js.map +1 -0
- package/dist/lib/components/Accordion/index.js +2 -64
- package/dist/lib/components/Accordion/index.js.map +1 -0
- package/dist/lib/components/AlertDialog/AlertDialogAction.js +2 -61
- package/dist/lib/components/AlertDialog/AlertDialogAction.js.map +1 -0
- package/dist/lib/components/AlertDialog/AlertDialogCancel.js +2 -60
- package/dist/lib/components/AlertDialog/AlertDialogCancel.js.map +1 -0
- package/dist/lib/components/AlertDialog/AlertDialogContent.js +2 -51
- package/dist/lib/components/AlertDialog/AlertDialogContent.js.map +1 -0
- package/dist/lib/components/AlertDialog/AlertDialogDescription.js +2 -47
- package/dist/lib/components/AlertDialog/AlertDialogDescription.js.map +1 -0
- package/dist/lib/components/AlertDialog/AlertDialogRoot.js +2 -46
- package/dist/lib/components/AlertDialog/AlertDialogRoot.js.map +1 -0
- package/dist/lib/components/AlertDialog/AlertDialogTitle.js +2 -47
- package/dist/lib/components/AlertDialog/AlertDialogTitle.js.map +1 -0
- package/dist/lib/components/AlertDialog/AlertDialogTrigger.js +2 -55
- package/dist/lib/components/AlertDialog/AlertDialogTrigger.js.map +1 -0
- package/dist/lib/components/AlertDialog/index.js +2 -17
- package/dist/lib/components/AlertDialog/index.js.map +1 -0
- package/dist/lib/components/AspectRatio/index.js +2 -42
- package/dist/lib/components/AspectRatio/index.js.map +1 -0
- package/dist/lib/components/Avatar/index.js +2 -58
- package/dist/lib/components/Avatar/index.js.map +1 -0
- package/dist/lib/components/Badge/index.js +2 -54
- package/dist/lib/components/Badge/index.js.map +1 -0
- package/dist/lib/components/BarChart/index.js +2 -63
- package/dist/lib/components/BarChart/index.js.map +1 -0
- package/dist/lib/components/BubbleChart/index.js +2 -73
- package/dist/lib/components/BubbleChart/index.js.map +1 -0
- package/dist/lib/components/Button/index.js +2 -56
- package/dist/lib/components/Button/index.js.map +1 -0
- package/dist/lib/components/Callout/CalloutIcon.js +2 -57
- package/dist/lib/components/Callout/CalloutIcon.js.map +1 -0
- package/dist/lib/components/Callout/CalloutRoot.js +2 -72
- package/dist/lib/components/Callout/CalloutRoot.js.map +1 -0
- package/dist/lib/components/Callout/CalloutText.js +2 -52
- package/dist/lib/components/Callout/CalloutText.js.map +1 -0
- package/dist/lib/components/Callout/index.js +2 -9
- package/dist/lib/components/Callout/index.js.map +1 -0
- package/dist/lib/components/Card/index.js +2 -64
- package/dist/lib/components/Card/index.js.map +1 -0
- package/dist/lib/components/Checkbox/index.js +2 -89
- package/dist/lib/components/Checkbox/index.js.map +1 -0
- package/dist/lib/components/CheckboxCard/index.js +2 -58
- package/dist/lib/components/CheckboxCard/index.js.map +1 -0
- package/dist/lib/components/CheckboxGroup/CheckboxGroupItem.js +2 -33
- package/dist/lib/components/CheckboxGroup/CheckboxGroupItem.js.map +1 -0
- package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.js +2 -34
- package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.js.map +1 -0
- package/dist/lib/components/CheckboxGroup/index.js +2 -4
- package/dist/lib/components/CheckboxGroup/index.js.map +1 -0
- package/dist/lib/components/ContextMenu/ContextMenuCheckboxItem.js +2 -42
- package/dist/lib/components/ContextMenu/ContextMenuCheckboxItem.js.map +1 -0
- package/dist/lib/components/ContextMenu/ContextMenuContent.js +2 -56
- package/dist/lib/components/ContextMenu/ContextMenuContent.js.map +1 -0
- package/dist/lib/components/ContextMenu/ContextMenuGroup.js +2 -30
- package/dist/lib/components/ContextMenu/ContextMenuGroup.js.map +1 -0
- package/dist/lib/components/ContextMenu/ContextMenuItem.js +2 -59
- package/dist/lib/components/ContextMenu/ContextMenuItem.js.map +1 -0
- package/dist/lib/components/ContextMenu/ContextMenuItemIndicator.js +2 -50
- package/dist/lib/components/ContextMenu/ContextMenuItemIndicator.js.map +1 -0
- package/dist/lib/components/ContextMenu/ContextMenuLabel.js +2 -48
- package/dist/lib/components/ContextMenu/ContextMenuLabel.js.map +1 -0
- package/dist/lib/components/ContextMenu/ContextMenuRadioGroup.js +2 -31
- package/dist/lib/components/ContextMenu/ContextMenuRadioGroup.js.map +1 -0
- package/dist/lib/components/ContextMenu/ContextMenuRadioItem.js +2 -44
- package/dist/lib/components/ContextMenu/ContextMenuRadioItem.js.map +1 -0
- package/dist/lib/components/ContextMenu/ContextMenuRoot.js +2 -42
- package/dist/lib/components/ContextMenu/ContextMenuRoot.js.map +1 -0
- package/dist/lib/components/ContextMenu/ContextMenuSeparator.js +2 -31
- package/dist/lib/components/ContextMenu/ContextMenuSeparator.js.map +1 -0
- package/dist/lib/components/ContextMenu/ContextMenuSubContent.js +2 -54
- package/dist/lib/components/ContextMenu/ContextMenuSubContent.js.map +1 -0
- package/dist/lib/components/ContextMenu/ContextMenuSubTrigger.js +2 -40
- package/dist/lib/components/ContextMenu/ContextMenuSubTrigger.js.map +1 -0
- package/dist/lib/components/ContextMenu/ContextMenuTrigger.js +2 -31
- package/dist/lib/components/ContextMenu/ContextMenuTrigger.js.map +1 -0
- package/dist/lib/components/ContextMenu/index.js +2 -29
- package/dist/lib/components/ContextMenu/index.js.map +1 -0
- package/dist/lib/components/DataList/DataListItem.js +2 -43
- package/dist/lib/components/DataList/DataListItem.js.map +1 -0
- package/dist/lib/components/DataList/DataListLabel.js +2 -49
- package/dist/lib/components/DataList/DataListLabel.js.map +1 -0
- package/dist/lib/components/DataList/DataListRoot.js +2 -54
- package/dist/lib/components/DataList/DataListRoot.js.map +1 -0
- package/dist/lib/components/DataList/DataListValue.js +2 -51
- package/dist/lib/components/DataList/DataListValue.js.map +1 -0
- package/dist/lib/components/DataList/index.js +2 -6
- package/dist/lib/components/DataList/index.js.map +1 -0
- package/dist/lib/components/Dialog/DialogAction.js +2 -59
- package/dist/lib/components/Dialog/DialogAction.js.map +1 -0
- package/dist/lib/components/Dialog/DialogCancel.js +2 -55
- package/dist/lib/components/Dialog/DialogCancel.js.map +1 -0
- package/dist/lib/components/Dialog/DialogContent.js +2 -57
- package/dist/lib/components/Dialog/DialogContent.js.map +1 -0
- package/dist/lib/components/Dialog/DialogDescription.js +2 -47
- package/dist/lib/components/Dialog/DialogDescription.js.map +1 -0
- package/dist/lib/components/Dialog/DialogRoot.js +2 -37
- package/dist/lib/components/Dialog/DialogRoot.js.map +1 -0
- package/dist/lib/components/Dialog/DialogSlot.js +2 -46
- package/dist/lib/components/Dialog/DialogSlot.js.map +1 -0
- package/dist/lib/components/Dialog/DialogTitle.js +2 -47
- package/dist/lib/components/Dialog/DialogTitle.js.map +1 -0
- package/dist/lib/components/Dialog/DialogTrigger.js +2 -30
- package/dist/lib/components/Dialog/DialogTrigger.js.map +1 -0
- package/dist/lib/components/Dialog/index.js +2 -19
- package/dist/lib/components/Dialog/index.js.map +1 -0
- package/dist/lib/components/DoughnutChart/index.js +2 -65
- package/dist/lib/components/DoughnutChart/index.js.map +1 -0
- package/dist/lib/components/DropdownMenu/DropdonMenuRadioGroup.js +2 -30
- package/dist/lib/components/DropdownMenu/DropdonMenuRadioGroup.js.map +1 -0
- package/dist/lib/components/DropdownMenu/DropdonMenuSubContent.js +2 -60
- package/dist/lib/components/DropdownMenu/DropdonMenuSubContent.js.map +1 -0
- package/dist/lib/components/DropdownMenu/DropdownMenuCheckboxItem.js +2 -41
- package/dist/lib/components/DropdownMenu/DropdownMenuCheckboxItem.js.map +1 -0
- package/dist/lib/components/DropdownMenu/DropdownMenuContent.js +2 -56
- package/dist/lib/components/DropdownMenu/DropdownMenuContent.js.map +1 -0
- package/dist/lib/components/DropdownMenu/DropdownMenuItem.js +2 -58
- package/dist/lib/components/DropdownMenu/DropdownMenuItem.js.map +1 -0
- package/dist/lib/components/DropdownMenu/DropdownMenuItemIndicator.js +2 -48
- package/dist/lib/components/DropdownMenu/DropdownMenuItemIndicator.js.map +1 -0
- package/dist/lib/components/DropdownMenu/DropdownMenuLable.js +2 -45
- package/dist/lib/components/DropdownMenu/DropdownMenuLable.js.map +1 -0
- package/dist/lib/components/DropdownMenu/DropdownMenuRadioItem.js +2 -41
- package/dist/lib/components/DropdownMenu/DropdownMenuRadioItem.js.map +1 -0
- package/dist/lib/components/DropdownMenu/DropdownMenuRoot.js +2 -38
- package/dist/lib/components/DropdownMenu/DropdownMenuRoot.js.map +1 -0
- package/dist/lib/components/DropdownMenu/DropdownMenuSeparator.js +2 -31
- package/dist/lib/components/DropdownMenu/DropdownMenuSeparator.js.map +1 -0
- package/dist/lib/components/DropdownMenu/DropdownMenuSub.js +2 -30
- package/dist/lib/components/DropdownMenu/DropdownMenuSub.js.map +1 -0
- package/dist/lib/components/DropdownMenu/DropdownMenuSubTrigger.js +2 -40
- package/dist/lib/components/DropdownMenu/DropdownMenuSubTrigger.js.map +1 -0
- package/dist/lib/components/DropdownMenu/DropdownMenuTrigger.js +2 -53
- package/dist/lib/components/DropdownMenu/DropdownMenuTrigger.js.map +1 -0
- package/dist/lib/components/DropdownMenu/index.js +2 -29
- package/dist/lib/components/DropdownMenu/index.js.map +1 -0
- package/dist/lib/components/HoverCard/HoverCardContent.js +2 -61
- package/dist/lib/components/HoverCard/HoverCardContent.js.map +1 -0
- package/dist/lib/components/HoverCard/HoverCardRoot.js +2 -38
- package/dist/lib/components/HoverCard/HoverCardRoot.js.map +1 -0
- package/dist/lib/components/HoverCard/HoverCardTrigger.js +2 -30
- package/dist/lib/components/HoverCard/HoverCardTrigger.js.map +1 -0
- package/dist/lib/components/HoverCard/index.js +2 -9
- package/dist/lib/components/HoverCard/index.js.map +1 -0
- package/dist/lib/components/IconButton/index.js +2 -63
- package/dist/lib/components/IconButton/index.js.map +1 -0
- package/dist/lib/components/Inset/index.js +2 -50
- package/dist/lib/components/Inset/index.js.map +1 -0
- package/dist/lib/components/Label/index.js +2 -53
- package/dist/lib/components/Label/index.js.map +1 -0
- package/dist/lib/components/LineChart/index.js +2 -61
- package/dist/lib/components/LineChart/index.js.map +1 -0
- package/dist/lib/components/Menubar/MenubarCheckboxItem.js +2 -38
- package/dist/lib/components/Menubar/MenubarCheckboxItem.js.map +1 -0
- package/dist/lib/components/Menubar/MenubarContent.js +2 -60
- package/dist/lib/components/Menubar/MenubarContent.js.map +1 -0
- package/dist/lib/components/Menubar/MenubarItem.js +2 -54
- package/dist/lib/components/Menubar/MenubarItem.js.map +1 -0
- package/dist/lib/components/Menubar/MenubarItemIndicator.js +2 -49
- package/dist/lib/components/Menubar/MenubarItemIndicator.js.map +1 -0
- package/dist/lib/components/Menubar/MenubarMenu.js +2 -30
- package/dist/lib/components/Menubar/MenubarMenu.js.map +1 -0
- package/dist/lib/components/Menubar/MenubarRadioGroup.js +2 -31
- package/dist/lib/components/Menubar/MenubarRadioGroup.js.map +1 -0
- package/dist/lib/components/Menubar/MenubarRadioItem.js +2 -40
- package/dist/lib/components/Menubar/MenubarRadioItem.js.map +1 -0
- package/dist/lib/components/Menubar/MenubarRoot.js +2 -61
- package/dist/lib/components/Menubar/MenubarRoot.js.map +1 -0
- package/dist/lib/components/Menubar/MenubarSeparator.js +2 -31
- package/dist/lib/components/Menubar/MenubarSeparator.js.map +1 -0
- package/dist/lib/components/Menubar/MenubarSub.js +2 -30
- package/dist/lib/components/Menubar/MenubarSub.js.map +1 -0
- package/dist/lib/components/Menubar/MenubarSubContent.js +2 -51
- package/dist/lib/components/Menubar/MenubarSubContent.js.map +1 -0
- package/dist/lib/components/Menubar/MenubarSubTrigger.js +2 -41
- package/dist/lib/components/Menubar/MenubarSubTrigger.js.map +1 -0
- package/dist/lib/components/Menubar/MenubarTrigger.js +2 -57
- package/dist/lib/components/Menubar/MenubarTrigger.js.map +1 -0
- package/dist/lib/components/Menubar/index.js +2 -29
- package/dist/lib/components/Menubar/index.js.map +1 -0
- package/dist/lib/components/NavigationMenu/NavigationMenuContent.js +2 -48
- package/dist/lib/components/NavigationMenu/NavigationMenuContent.js.map +1 -0
- package/dist/lib/components/NavigationMenu/NavigationMenuIndicator.js +2 -31
- package/dist/lib/components/NavigationMenu/NavigationMenuIndicator.js.map +1 -0
- package/dist/lib/components/NavigationMenu/NavigationMenuItem.js +2 -30
- package/dist/lib/components/NavigationMenu/NavigationMenuItem.js.map +1 -0
- package/dist/lib/components/NavigationMenu/NavigationMenuLink.js +2 -51
- package/dist/lib/components/NavigationMenu/NavigationMenuLink.js.map +1 -0
- package/dist/lib/components/NavigationMenu/NavigationMenuList.js +2 -47
- package/dist/lib/components/NavigationMenu/NavigationMenuList.js.map +1 -0
- package/dist/lib/components/NavigationMenu/NavigationMenuRoot.js +2 -43
- package/dist/lib/components/NavigationMenu/NavigationMenuRoot.js.map +1 -0
- package/dist/lib/components/NavigationMenu/NavigationMenuTrigger.js +2 -58
- package/dist/lib/components/NavigationMenu/NavigationMenuTrigger.js.map +1 -0
- package/dist/lib/components/NavigationMenu/NavigationMenuViewport.js +2 -53
- package/dist/lib/components/NavigationMenu/NavigationMenuViewport.js.map +1 -0
- package/dist/lib/components/NavigationMenu/index.js +2 -10
- package/dist/lib/components/NavigationMenu/index.js.map +1 -0
- package/dist/lib/components/PieChart/index.js +2 -65
- package/dist/lib/components/PieChart/index.js.map +1 -0
- package/dist/lib/components/Popover/PopoverClose.js +2 -48
- package/dist/lib/components/Popover/PopoverClose.js.map +1 -0
- package/dist/lib/components/Popover/PopoverContent.js +2 -65
- package/dist/lib/components/Popover/PopoverContent.js.map +1 -0
- package/dist/lib/components/Popover/PopoverRoot.js +2 -36
- package/dist/lib/components/Popover/PopoverRoot.js.map +1 -0
- package/dist/lib/components/Popover/PopoverTrigger.js +2 -30
- package/dist/lib/components/Popover/PopoverTrigger.js.map +1 -0
- package/dist/lib/components/Popover/index.js +2 -11
- package/dist/lib/components/Popover/index.js.map +1 -0
- package/dist/lib/components/Progress/index.js +2 -56
- package/dist/lib/components/Progress/index.js.map +1 -0
- package/dist/lib/components/RadarChart/index.js +2 -76
- package/dist/lib/components/RadarChart/index.js.map +1 -0
- package/dist/lib/components/Radio/index.js +2 -53
- package/dist/lib/components/Radio/index.js.map +1 -0
- package/dist/lib/components/RadioCards/RadioCardsItem.js +2 -54
- package/dist/lib/components/RadioCards/RadioCardsItem.js.map +1 -0
- package/dist/lib/components/RadioCards/RadioCardsRoot.js +2 -46
- package/dist/lib/components/RadioCards/RadioCardsRoot.js.map +1 -0
- package/dist/lib/components/RadioCards/index.js +2 -7
- package/dist/lib/components/RadioCards/index.js.map +1 -0
- package/dist/lib/components/RadioGroup/RadioGroupItem.js +2 -46
- package/dist/lib/components/RadioGroup/RadioGroupItem.js.map +1 -0
- package/dist/lib/components/RadioGroup/RadioGroupRoot.js +2 -53
- package/dist/lib/components/RadioGroup/RadioGroupRoot.js.map +1 -0
- package/dist/lib/components/RadioGroup/index.js +2 -7
- package/dist/lib/components/RadioGroup/index.js.map +1 -0
- package/dist/lib/components/ScrollArea/index.js +2 -36
- package/dist/lib/components/ScrollArea/index.js.map +1 -0
- package/dist/lib/components/SegmentedControl/SegmentedControlItem.js +2 -35
- package/dist/lib/components/SegmentedControl/SegmentedControlItem.js.map +1 -0
- package/dist/lib/components/SegmentedControl/SegmentedControlRoot.js +2 -47
- package/dist/lib/components/SegmentedControl/SegmentedControlRoot.js.map +1 -0
- package/dist/lib/components/SegmentedControl/index.js +2 -7
- package/dist/lib/components/SegmentedControl/index.js.map +1 -0
- package/dist/lib/components/Select/index.js +2 -92
- package/dist/lib/components/Select/index.js.map +1 -0
- package/dist/lib/components/Separator/index.js +2 -47
- package/dist/lib/components/Separator/index.js.map +1 -0
- package/dist/lib/components/Skeleton/index.js +2 -42
- package/dist/lib/components/Skeleton/index.js.map +1 -0
- package/dist/lib/components/Slider/index.js +2 -49
- package/dist/lib/components/Slider/index.js.map +1 -0
- package/dist/lib/components/Spinner/index.js +2 -47
- package/dist/lib/components/Spinner/index.js.map +1 -0
- package/dist/lib/components/TabNav/index.js +2 -50
- package/dist/lib/components/TabNav/index.js.map +1 -0
- package/dist/lib/components/Table/index.js +2 -98
- package/dist/lib/components/Table/index.js.map +1 -0
- package/dist/lib/components/Tabs/index.js +2 -65
- package/dist/lib/components/Tabs/index.js.map +1 -0
- package/dist/lib/components/TextArea/index.js +2 -58
- package/dist/lib/components/TextArea/index.js.map +1 -0
- package/dist/lib/components/TextField/index.js +2 -56
- package/dist/lib/components/TextField/index.js.map +1 -0
- package/dist/lib/components/Toast/ToastActionButton.js +2 -67
- package/dist/lib/components/Toast/ToastActionButton.js.map +1 -0
- package/dist/lib/components/Toast/ToastDescription.js +2 -53
- package/dist/lib/components/Toast/ToastDescription.js.map +1 -0
- package/dist/lib/components/Toast/ToastRoot.js +2 -90
- package/dist/lib/components/Toast/ToastRoot.js.map +1 -0
- package/dist/lib/components/Toast/ToastTitle.js +2 -53
- package/dist/lib/components/Toast/ToastTitle.js.map +1 -0
- package/dist/lib/components/Toast/index.js +2 -11
- package/dist/lib/components/Toast/index.js.map +1 -0
- package/dist/lib/components/Toggle/ToggleWithText.js +2 -58
- package/dist/lib/components/Toggle/ToggleWithText.js.map +1 -0
- package/dist/lib/components/Toggle/index.js +2 -58
- package/dist/lib/components/Toggle/index.js.map +1 -0
- package/dist/lib/components/ToggleGroup/ToggleGroupItem.js +2 -54
- package/dist/lib/components/ToggleGroup/ToggleGroupItem.js.map +1 -0
- package/dist/lib/components/ToggleGroup/ToggleGroupRoot.js +2 -48
- package/dist/lib/components/ToggleGroup/ToggleGroupRoot.js.map +1 -0
- package/dist/lib/components/ToggleGroup/index.js +2 -7
- package/dist/lib/components/ToggleGroup/index.js.map +1 -0
- package/dist/lib/components/ToggleSwitch/index.js +2 -71
- package/dist/lib/components/ToggleSwitch/index.js.map +1 -0
- package/dist/lib/components/Tooltip/index.js +2 -49
- package/dist/lib/components/Tooltip/index.js.map +1 -0
- package/dist/lib/constants.js +2 -914
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/index.js +2 -3
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/tsconfig.tsbuildinfo +1 -0
- package/dist/lib/utils/useDarkMode.js +2 -49
- package/dist/lib/utils/useDarkMode.js.map +1 -0
- package/dist/lib/utils/utils.js +2 -10
- package/dist/lib/utils/utils.js.map +1 -0
- package/package.json +8 -7
- package/dist/lib/Typography/Header/index.d.ts +0 -13
- package/dist/lib/Typography/Text/index.d.ts +0 -15
- package/dist/lib/Typography/index.d.ts +0 -2
- package/dist/lib/Typography/index.js +0 -2
- package/dist/lib/color/alpha.d.ts +0 -784
- package/dist/lib/color/constants.d.ts +0 -29
- package/dist/lib/color/dark.d.ts +0 -392
- package/dist/lib/color/dark.js +0 -392
- package/dist/lib/color/krdsColors.d.ts +0 -309
- package/dist/lib/color/krdsColors.js +0 -309
- package/dist/lib/color/light.d.ts +0 -392
- package/dist/lib/components/Accordion/index.d.ts +0 -22
- package/dist/lib/components/AlertDialog/AlertDialogAction.d.ts +0 -14
- package/dist/lib/components/AlertDialog/AlertDialogCancel.d.ts +0 -13
- package/dist/lib/components/AlertDialog/AlertDialogContent.d.ts +0 -11
- package/dist/lib/components/AlertDialog/AlertDialogDescription.d.ts +0 -10
- package/dist/lib/components/AlertDialog/AlertDialogRoot.d.ts +0 -16
- package/dist/lib/components/AlertDialog/AlertDialogTitle.d.ts +0 -10
- package/dist/lib/components/AlertDialog/AlertDialogTrigger.d.ts +0 -17
- package/dist/lib/components/AlertDialog/index.d.ts +0 -11
- package/dist/lib/components/AspectRatio/index.d.ts +0 -10
- package/dist/lib/components/Avatar/index.d.ts +0 -21
- package/dist/lib/components/Badge/index.d.ts +0 -18
- package/dist/lib/components/BarChart/index.d.ts +0 -37
- package/dist/lib/components/BubbleChart/index.d.ts +0 -28
- package/dist/lib/components/Button/index.d.ts +0 -16
- package/dist/lib/components/Callout/CalloutIcon.d.ts +0 -13
- package/dist/lib/components/Callout/CalloutRoot.d.ts +0 -18
- package/dist/lib/components/Callout/CalloutText.d.ts +0 -10
- package/dist/lib/components/Callout/index.d.ts +0 -7
- package/dist/lib/components/Card/index.d.ts +0 -14
- package/dist/lib/components/Checkbox/index.d.ts +0 -17
- package/dist/lib/components/CheckboxCard/index.d.ts +0 -20
- package/dist/lib/components/CheckboxGroup/CheckboxGroupItem.d.ts +0 -5
- package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.d.ts +0 -17
- package/dist/lib/components/CheckboxGroup/index.d.ts +0 -6
- package/dist/lib/components/ContextMenu/ContextMenuCheckboxItem.d.ts +0 -4
- package/dist/lib/components/ContextMenu/ContextMenuContent.d.ts +0 -11
- package/dist/lib/components/ContextMenu/ContextMenuGroup.d.ts +0 -4
- package/dist/lib/components/ContextMenu/ContextMenuItem.d.ts +0 -13
- package/dist/lib/components/ContextMenu/ContextMenuItemIndicator.d.ts +0 -10
- package/dist/lib/components/ContextMenu/ContextMenuLabel.d.ts +0 -11
- package/dist/lib/components/ContextMenu/ContextMenuRadioGroup.d.ts +0 -8
- package/dist/lib/components/ContextMenu/ContextMenuRadioItem.d.ts +0 -4
- package/dist/lib/components/ContextMenu/ContextMenuRoot.d.ts +0 -13
- package/dist/lib/components/ContextMenu/ContextMenuSeparator.d.ts +0 -3
- package/dist/lib/components/ContextMenu/ContextMenuSubContent.d.ts +0 -11
- package/dist/lib/components/ContextMenu/ContextMenuSubTrigger.d.ts +0 -4
- package/dist/lib/components/ContextMenu/ContextMenuTrigger.d.ts +0 -4
- package/dist/lib/components/ContextMenu/index.d.ts +0 -17
- package/dist/lib/components/DataList/DataListItem.d.ts +0 -9
- package/dist/lib/components/DataList/DataListLabel.d.ts +0 -10
- package/dist/lib/components/DataList/DataListRoot.d.ts +0 -14
- package/dist/lib/components/DataList/DataListValue.d.ts +0 -11
- package/dist/lib/components/DataList/index.d.ts +0 -8
- package/dist/lib/components/Dialog/DialogAction.d.ts +0 -13
- package/dist/lib/components/Dialog/DialogCancel.d.ts +0 -11
- package/dist/lib/components/Dialog/DialogContent.d.ts +0 -11
- package/dist/lib/components/Dialog/DialogDescription.d.ts +0 -9
- package/dist/lib/components/Dialog/DialogRoot.d.ts +0 -15
- package/dist/lib/components/Dialog/DialogSlot.d.ts +0 -9
- package/dist/lib/components/Dialog/DialogTitle.d.ts +0 -11
- package/dist/lib/components/Dialog/DialogTrigger.d.ts +0 -3
- package/dist/lib/components/Dialog/index.d.ts +0 -15
- package/dist/lib/components/DoughnutChart/index.d.ts +0 -22
- package/dist/lib/components/DropdownMenu/DropdonMenuRadioGroup.d.ts +0 -3
- package/dist/lib/components/DropdownMenu/DropdonMenuSubContent.d.ts +0 -11
- package/dist/lib/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +0 -7
- package/dist/lib/components/DropdownMenu/DropdownMenuContent.d.ts +0 -11
- package/dist/lib/components/DropdownMenu/DropdownMenuItem.d.ts +0 -15
- package/dist/lib/components/DropdownMenu/DropdownMenuItemIndicator.d.ts +0 -10
- package/dist/lib/components/DropdownMenu/DropdownMenuLable.d.ts +0 -10
- package/dist/lib/components/DropdownMenu/DropdownMenuRadioItem.d.ts +0 -6
- package/dist/lib/components/DropdownMenu/DropdownMenuRoot.d.ts +0 -15
- package/dist/lib/components/DropdownMenu/DropdownMenuSeparator.d.ts +0 -3
- package/dist/lib/components/DropdownMenu/DropdownMenuSub.d.ts +0 -3
- package/dist/lib/components/DropdownMenu/DropdownMenuSubTrigger.d.ts +0 -4
- package/dist/lib/components/DropdownMenu/DropdownMenuTrigger.d.ts +0 -14
- package/dist/lib/components/DropdownMenu/index.d.ts +0 -20
- package/dist/lib/components/HoverCard/HoverCardContent.d.ts +0 -14
- package/dist/lib/components/HoverCard/HoverCardRoot.d.ts +0 -11
- package/dist/lib/components/HoverCard/HoverCardTrigger.d.ts +0 -3
- package/dist/lib/components/HoverCard/index.d.ts +0 -10
- package/dist/lib/components/IconButton/index.d.ts +0 -15
- package/dist/lib/components/Inset/index.d.ts +0 -10
- package/dist/lib/components/Label/index.d.ts +0 -17
- package/dist/lib/components/LineChart/index.d.ts +0 -43
- package/dist/lib/components/Menubar/MenubarCheckboxItem.d.ts +0 -4
- package/dist/lib/components/Menubar/MenubarContent.d.ts +0 -11
- package/dist/lib/components/Menubar/MenubarItem.d.ts +0 -13
- package/dist/lib/components/Menubar/MenubarItemIndicator.d.ts +0 -10
- package/dist/lib/components/Menubar/MenubarMenu.d.ts +0 -5
- package/dist/lib/components/Menubar/MenubarRadioGroup.d.ts +0 -8
- package/dist/lib/components/Menubar/MenubarRadioItem.d.ts +0 -4
- package/dist/lib/components/Menubar/MenubarRoot.d.ts +0 -19
- package/dist/lib/components/Menubar/MenubarSeparator.d.ts +0 -3
- package/dist/lib/components/Menubar/MenubarSub.d.ts +0 -3
- package/dist/lib/components/Menubar/MenubarSubContent.d.ts +0 -10
- package/dist/lib/components/Menubar/MenubarSubTrigger.d.ts +0 -4
- package/dist/lib/components/Menubar/MenubarTrigger.d.ts +0 -12
- package/dist/lib/components/Menubar/index.d.ts +0 -19
- package/dist/lib/components/NavigationMenu/NavigationMenuContent.d.ts +0 -11
- package/dist/lib/components/NavigationMenu/NavigationMenuIndicator.d.ts +0 -3
- package/dist/lib/components/NavigationMenu/NavigationMenuItem.d.ts +0 -3
- package/dist/lib/components/NavigationMenu/NavigationMenuLink.d.ts +0 -13
- package/dist/lib/components/NavigationMenu/NavigationMenuList.d.ts +0 -12
- package/dist/lib/components/NavigationMenu/NavigationMenuRoot.d.ts +0 -14
- package/dist/lib/components/NavigationMenu/NavigationMenuTrigger.d.ts +0 -13
- package/dist/lib/components/NavigationMenu/NavigationMenuViewport.d.ts +0 -12
- package/dist/lib/components/NavigationMenu/index.d.ts +0 -12
- package/dist/lib/components/PieChart/index.d.ts +0 -22
- package/dist/lib/components/Popover/PopoverClose.d.ts +0 -9
- package/dist/lib/components/Popover/PopoverContent.d.ts +0 -11
- package/dist/lib/components/Popover/PopoverRoot.d.ts +0 -12
- package/dist/lib/components/Popover/PopoverTrigger.d.ts +0 -3
- package/dist/lib/components/Popover/index.d.ts +0 -11
- package/dist/lib/components/Progress/index.d.ts +0 -13
- package/dist/lib/components/RadarChart/index.d.ts +0 -32
- package/dist/lib/components/Radio/index.d.ts +0 -13
- package/dist/lib/components/RadioCards/RadioCardsItem.d.ts +0 -10
- package/dist/lib/components/RadioCards/RadioCardsRoot.d.ts +0 -13
- package/dist/lib/components/RadioCards/index.d.ts +0 -6
- package/dist/lib/components/RadioGroup/RadioGroupItem.d.ts +0 -13
- package/dist/lib/components/RadioGroup/RadioGroupRoot.d.ts +0 -15
- package/dist/lib/components/RadioGroup/index.d.ts +0 -6
- package/dist/lib/components/ScrollArea/index.d.ts +0 -9
- package/dist/lib/components/SegmentedControl/SegmentedControlItem.d.ts +0 -6
- package/dist/lib/components/SegmentedControl/SegmentedControlRoot.d.ts +0 -14
- package/dist/lib/components/SegmentedControl/index.d.ts +0 -6
- package/dist/lib/components/Select/index.d.ts +0 -34
- package/dist/lib/components/Separator/index.d.ts +0 -11
- package/dist/lib/components/Skeleton/index.d.ts +0 -14
- package/dist/lib/components/Slider/index.d.ts +0 -14
- package/dist/lib/components/Spinner/index.d.ts +0 -15
- package/dist/lib/components/TabNav/index.d.ts +0 -15
- package/dist/lib/components/Table/index.d.ts +0 -30
- package/dist/lib/components/Tabs/index.d.ts +0 -22
- package/dist/lib/components/TextArea/index.d.ts +0 -16
- package/dist/lib/components/TextField/index.d.ts +0 -21
- package/dist/lib/components/Toast/ToastActionButton.d.ts +0 -14
- package/dist/lib/components/Toast/ToastDescription.d.ts +0 -13
- package/dist/lib/components/Toast/ToastRoot.d.ts +0 -27
- package/dist/lib/components/Toast/ToastTitle.d.ts +0 -13
- package/dist/lib/components/Toast/index.d.ts +0 -8
- package/dist/lib/components/Toggle/ToggleWithText.d.ts +0 -21
- package/dist/lib/components/Toggle/index.d.ts +0 -21
- package/dist/lib/components/ToggleGroup/ToggleGroupItem.d.ts +0 -17
- package/dist/lib/components/ToggleGroup/ToggleGroupRoot.d.ts +0 -15
- package/dist/lib/components/ToggleGroup/index.d.ts +0 -6
- package/dist/lib/components/ToggleSwitch/index.d.ts +0 -13
- package/dist/lib/components/Tooltip/index.d.ts +0 -19
- package/dist/lib/components/index.d.ts +0 -50
- package/dist/lib/components/index.js +0 -52
- package/dist/lib/constants.d.ts +0 -655
- package/dist/lib/index.d.ts +0 -3
- package/dist/lib/types.d.ts +0 -81
- package/dist/lib/types.js +0 -1
- package/dist/lib/utils/useDarkMode.d.ts +0 -1
- package/dist/lib/utils/utils.d.ts +0 -2
- /package/dist/{globals.css → lib/globals.css} +0 -0
- /package/dist/{tailwind.config.d.ts → lib/tailwind.config.d.ts} +0 -0
- /package/dist/{tailwind.config.js → lib/tailwind.config.js} +0 -0
@@ -1,90 +1,2 @@
|
|
1
|
-
var
|
2
|
-
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
-
s = arguments[i];
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
-
t[p] = s[p];
|
7
|
-
}
|
8
|
-
return t;
|
9
|
-
};
|
10
|
-
return __assign.apply(this, arguments);
|
11
|
-
};
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
-
var t = {};
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
-
t[p] = s[p];
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
-
t[p[i]] = s[p[i]];
|
20
|
-
}
|
21
|
-
return t;
|
22
|
-
};
|
23
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
24
|
-
import { forwardRef, createContext, useContext, useMemo, } from 'react';
|
25
|
-
import { cva } from 'class-variance-authority';
|
26
|
-
import { cn } from '../../../lib/utils/utils';
|
27
|
-
import { scalingVariants } from '../../../lib/constants';
|
28
|
-
import * as ToastPrimitive from '@radix-ui/react-toast';
|
29
|
-
export var toastVariants = cva('flex bg-white dark:bg-slateDark-1', {
|
30
|
-
variants: {
|
31
|
-
radius: {
|
32
|
-
none: 'rounded-none',
|
33
|
-
small: 'rounded-[3px]',
|
34
|
-
medium: 'rounded',
|
35
|
-
large: 'rounded-md',
|
36
|
-
full: 'rounded-md',
|
37
|
-
},
|
38
|
-
size: {
|
39
|
-
small: 'w-[300px] min-h-[55px] p-3',
|
40
|
-
medium: 'w-[400px] min-h-[63px] p-3',
|
41
|
-
large: 'w-[400px] min-h-[84px] p-4',
|
42
|
-
'x-large': 'w-[400px] min-h-[88px] p-4',
|
43
|
-
},
|
44
|
-
scaling: __assign({}, scalingVariants),
|
45
|
-
color: {
|
46
|
-
danger: 'bg-red-3 dark:bg-redDark-3',
|
47
|
-
warning: 'bg-amber-3 dark:bg-amberDark-3',
|
48
|
-
success: 'bg-green-3 dark:bg-greenDark-3',
|
49
|
-
information: 'bg-sky-3 dark:bg-skyDark-3',
|
50
|
-
},
|
51
|
-
},
|
52
|
-
defaultVariants: {
|
53
|
-
radius: 'medium',
|
54
|
-
scaling: '100%',
|
55
|
-
size: 'medium',
|
56
|
-
},
|
57
|
-
});
|
58
|
-
export var toastViewportVariants = cva("[--viewport-padding:_25px] fixed flex flex-col outline-none gap-[10px]\n p-[var(--viewport-padding)] m-0 list-none z-[987654321]", {
|
59
|
-
variants: {
|
60
|
-
toastPosition: {
|
61
|
-
top_center: 'top-0 left-1/2 transform -translate-x-1/2',
|
62
|
-
top_left: 'top-0 left-0',
|
63
|
-
top_right: 'top-0 right-0',
|
64
|
-
bottom_center: 'bottom-0 left-1/2 transform -translate-x-1/2',
|
65
|
-
bottom_left: 'bottom-0 left-0',
|
66
|
-
bottom_right: 'bottom-0 right-0',
|
67
|
-
},
|
68
|
-
},
|
69
|
-
defaultVariants: {
|
70
|
-
toastPosition: 'top_right',
|
71
|
-
},
|
72
|
-
});
|
73
|
-
var ToastContext = createContext({
|
74
|
-
radius: 'medium',
|
75
|
-
scaling: '100%',
|
76
|
-
size: 'medium',
|
77
|
-
color: null,
|
78
|
-
});
|
79
|
-
export var useToastContext = function () {
|
80
|
-
return useContext(ToastContext);
|
81
|
-
};
|
82
|
-
export var ToastRoot = forwardRef(function (_a, ref) {
|
83
|
-
var className = _a.className, children = _a.children, openToast = _a.openToast, radius = _a.radius, scaling = _a.scaling, size = _a.size, color = _a.color, _b = _a.duration, duration = _b === void 0 ? 3000 : _b, _c = _a.toastPosition, toastPosition = _c === void 0 ? 'top_right' : _c, setOpenToast = _a.setOpenToast, props = __rest(_a, ["className", "children", "openToast", "radius", "scaling", "size", "color", "duration", "toastPosition", "setOpenToast"]);
|
84
|
-
var contextValue = useMemo(function () { return ({ radius: radius, size: size, scaling: scaling, color: color }); }, [radius, size, scaling, color]);
|
85
|
-
var toastRootStyle = "\n shadow-[hsl(206_22%_7%_/_35%)_0px_10px_38px_-10px,_hsl(206_22%_7%_/_20%)_0px_10px_20px_-15px] \n flex flex-col px-[15px] relative justify-center\n data-[state=open]:animate-slideIn \n data-[state=closed]:animate-hide \n data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] \n data-[swipe=cancel]:translate-x-0 \n data-[swipe=cancel]:transition-[transform_200ms_ease-out] \n data-[swipe=end]:animate-swipeOut\n ";
|
86
|
-
var toastClassName = cn(toastVariants({ radius: radius, scaling: scaling, size: size, color: color }), toastRootStyle, className);
|
87
|
-
return (_jsx(ToastContext.Provider, { value: contextValue, children: _jsxs(ToastPrimitive.Provider, { swipeDirection: "right", duration: duration, children: [_jsx(ToastPrimitive.Root, __assign({ ref: ref, className: toastClassName, open: openToast, onOpenChange: setOpenToast }, props, { children: children })), _jsx(ToastPrimitive.Viewport, { className: cn(toastViewportVariants({ toastPosition: toastPosition })) })] }) }));
|
88
|
-
});
|
89
|
-
ToastRoot.displayName = 'Toast.Root';
|
90
|
-
export default ToastRoot;
|
1
|
+
import{j as t}from"../../../../_virtual/jsx-runtime.js";import{createContext as e,forwardRef as a,useMemo as r,useContext as o}from"react";import{cva as n}from"../../../../node_modules/class-variance-authority/dist/index.mjs.js";import{cn as i}from"../../utils/utils.js";import{scalingVariants as s}from"../../constants.js";import{Provider as l,Root as d,Viewport as p}from"../../../../node_modules/@radix-ui/react-toast/dist/index.mjs.js";var m=function(){return m=Object.assign||function(t){for(var e,a=1,r=arguments.length;a<r;a++)for(var o in e=arguments[a])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},m.apply(this,arguments)},c=function(t,e){var a={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(a[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(a[r[o]]=t[r[o]])}return a},u=n("flex bg-white dark:bg-slateDark-1",{variants:{radius:{none:"rounded-none",small:"rounded-[3px]",medium:"rounded",large:"rounded-md",full:"rounded-md"},size:{small:"w-[300px] min-h-[55px] p-3",medium:"w-[400px] min-h-[63px] p-3",large:"w-[400px] min-h-[84px] p-4","x-large":"w-[400px] min-h-[88px] p-4"},scaling:m({},s),color:{danger:"bg-red-3 dark:bg-redDark-3",warning:"bg-amber-3 dark:bg-amberDark-3",success:"bg-green-3 dark:bg-greenDark-3",information:"bg-sky-3 dark:bg-skyDark-3"}},defaultVariants:{radius:"medium",scaling:"100%",size:"medium"}}),x=n("[--viewport-padding:_25px] fixed flex flex-col outline-none gap-[10px]\n p-[var(--viewport-padding)] m-0 list-none z-[987654321]",{variants:{toastPosition:{top_center:"top-0 left-1/2 transform -translate-x-1/2",top_left:"top-0 left-0",top_right:"top-0 right-0",bottom_center:"bottom-0 left-1/2 transform -translate-x-1/2",bottom_left:"bottom-0 left-0",bottom_right:"bottom-0 right-0"}},defaultVariants:{toastPosition:"top_right"}}),f=e({radius:"medium",scaling:"100%",size:"medium",color:null}),g=function(){return o(f)},_=a((function(e,a){var o=e.className,n=e.children,s=e.openToast,g=e.radius,_=e.scaling,h=e.size,b=e.color,v=e.duration,j=void 0===v?3e3:v,w=e.toastPosition,y=void 0===w?"top_right":w,O=e.setOpenToast,k=c(e,["className","children","openToast","radius","scaling","size","color","duration","toastPosition","setOpenToast"]),P=r((function(){return{radius:g,size:h,scaling:_,color:b}}),[g,h,_,b]),z=i(u({radius:g,scaling:_,size:h,color:b}),"\n shadow-[hsl(206_22%_7%_/_35%)_0px_10px_38px_-10px,_hsl(206_22%_7%_/_20%)_0px_10px_20px_-15px] \n flex flex-col px-[15px] relative justify-center\n data-[state=open]:animate-slideIn \n data-[state=closed]:animate-hide \n data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] \n data-[swipe=cancel]:translate-x-0 \n data-[swipe=cancel]:transition-[transform_200ms_ease-out] \n data-[swipe=end]:animate-swipeOut\n ",o);return t.jsx(f.Provider,{value:P,children:t.jsxs(l,{swipeDirection:"right",duration:j,children:[t.jsx(d,m({ref:a,className:z,open:s,onOpenChange:O},k,{children:n})),t.jsx(p,{className:i(x({toastPosition:y}))})]})})}));_.displayName="Toast.Root";export{_ as ToastRoot,_ as default,u as toastVariants,x as toastViewportVariants,g as useToastContext};
|
2
|
+
//# sourceMappingURL=ToastRoot.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ToastRoot.js","sources":["../../../../lib/components/Toast/ToastRoot.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { forwardRef, createContext, useContext, useMemo, } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../../lib/utils/utils';\nimport { scalingVariants } from '../../../lib/constants';\nimport * as ToastPrimitive from '@radix-ui/react-toast';\nexport var toastVariants = cva('flex bg-white dark:bg-slateDark-1', {\n variants: {\n radius: {\n none: 'rounded-none',\n small: 'rounded-[3px]',\n medium: 'rounded',\n large: 'rounded-md',\n full: 'rounded-md',\n },\n size: {\n small: 'w-[300px] min-h-[55px] p-3',\n medium: 'w-[400px] min-h-[63px] p-3',\n large: 'w-[400px] min-h-[84px] p-4',\n 'x-large': 'w-[400px] min-h-[88px] p-4',\n },\n scaling: __assign({}, scalingVariants),\n color: {\n danger: 'bg-red-3 dark:bg-redDark-3',\n warning: 'bg-amber-3 dark:bg-amberDark-3',\n success: 'bg-green-3 dark:bg-greenDark-3',\n information: 'bg-sky-3 dark:bg-skyDark-3',\n },\n },\n defaultVariants: {\n radius: 'medium',\n scaling: '100%',\n size: 'medium',\n },\n});\nexport var toastViewportVariants = cva(\"[--viewport-padding:_25px] fixed flex flex-col outline-none gap-[10px]\\n p-[var(--viewport-padding)] m-0 list-none z-[987654321]\", {\n variants: {\n toastPosition: {\n top_center: 'top-0 left-1/2 transform -translate-x-1/2',\n top_left: 'top-0 left-0',\n top_right: 'top-0 right-0',\n bottom_center: 'bottom-0 left-1/2 transform -translate-x-1/2',\n bottom_left: 'bottom-0 left-0',\n bottom_right: 'bottom-0 right-0',\n },\n },\n defaultVariants: {\n toastPosition: 'top_right',\n },\n});\nvar ToastContext = createContext({\n radius: 'medium',\n scaling: '100%',\n size: 'medium',\n color: null,\n});\nexport var useToastContext = function () {\n return useContext(ToastContext);\n};\nexport var ToastRoot = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, openToast = _a.openToast, radius = _a.radius, scaling = _a.scaling, size = _a.size, color = _a.color, _b = _a.duration, duration = _b === void 0 ? 3000 : _b, _c = _a.toastPosition, toastPosition = _c === void 0 ? 'top_right' : _c, setOpenToast = _a.setOpenToast, props = __rest(_a, [\"className\", \"children\", \"openToast\", \"radius\", \"scaling\", \"size\", \"color\", \"duration\", \"toastPosition\", \"setOpenToast\"]);\n var contextValue = useMemo(function () { return ({ radius: radius, size: size, scaling: scaling, color: color }); }, [radius, size, scaling, color]);\n var toastRootStyle = \"\\n shadow-[hsl(206_22%_7%_/_35%)_0px_10px_38px_-10px,_hsl(206_22%_7%_/_20%)_0px_10px_20px_-15px] \\n flex flex-col px-[15px] relative justify-center\\n data-[state=open]:animate-slideIn \\n data-[state=closed]:animate-hide \\n data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] \\n data-[swipe=cancel]:translate-x-0 \\n data-[swipe=cancel]:transition-[transform_200ms_ease-out] \\n data-[swipe=end]:animate-swipeOut\\n \";\n var toastClassName = cn(toastVariants({ radius: radius, scaling: scaling, size: size, color: color }), toastRootStyle, className);\n return (_jsx(ToastContext.Provider, { value: contextValue, children: _jsxs(ToastPrimitive.Provider, { swipeDirection: \"right\", duration: duration, children: [_jsx(ToastPrimitive.Root, __assign({ ref: ref, className: toastClassName, open: openToast, onOpenChange: setOpenToast }, props, { children: children })), _jsx(ToastPrimitive.Viewport, { className: cn(toastViewportVariants({ toastPosition: toastPosition })) })] }) }));\n});\nToastRoot.displayName = 'Toast.Root';\nexport default ToastRoot;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","toastVariants","cva","variants","radius","none","small","medium","large","full","size","scaling","scalingVariants","color","danger","warning","success","information","defaultVariants","toastViewportVariants","toastPosition","top_center","top_left","top_right","bottom_center","bottom_left","bottom_right","ToastContext","createContext","useToastContext","useContext","ToastRoot","forwardRef","_a","ref","className","children","openToast","_b","duration","_c","setOpenToast","props","contextValue","useMemo","toastClassName","cn","_jsx","jsx","Provider","value","_jsxs","ToastPrimitive.Provider","swipeDirection","ToastPrimitive.Root","open","onOpenChange","ToastPrimitive.Viewport","displayName"],"mappings":"wbAAA,IAAIA,EAAsC,WAStC,OARAA,EAAWC,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,CACf,EACWH,EAASa,MAAMC,KAAMP,UAChC,EACIQ,EAAkC,SAAUX,EAAGY,GAC/C,IAAIb,EAAI,CAAA,EACR,IAAK,IAAIM,KAAKL,EAAOH,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,IAAMO,EAAEC,QAAQR,GAAK,IAC9EN,EAAEM,GAAKL,EAAEK,IACb,GAAS,MAALL,GAAqD,mBAAjCH,OAAOiB,sBACtB,KAAIb,EAAI,EAAb,IAAgBI,EAAIR,OAAOiB,sBAAsBd,GAAIC,EAAII,EAAED,OAAQH,IAC3DW,EAAEC,QAAQR,EAAEJ,IAAM,GAAKJ,OAAOS,UAAUS,qBAAqBP,KAAKR,EAAGK,EAAEJ,MACvEF,EAAEM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACX,EAOWiB,EAAgBC,EAAI,oCAAqC,CAChEC,SAAU,CACNC,OAAQ,CACJC,KAAM,eACNC,MAAO,gBACPC,OAAQ,UACRC,MAAO,aACPC,KAAM,cAEVC,KAAM,CACFJ,MAAO,6BACPC,OAAQ,6BACRC,MAAO,6BACP,UAAW,8BAEfG,QAAS9B,EAAS,CAAE,EAAE+B,GACtBC,MAAO,CACHC,OAAQ,6BACRC,QAAS,iCACTC,QAAS,iCACTC,YAAa,+BAGrBC,gBAAiB,CACbd,OAAQ,SACRO,QAAS,OACTD,KAAM,YAGHS,EAAwBjB,EAAI,sIAAuI,CAC1KC,SAAU,CACNiB,cAAe,CACXC,WAAY,4CACZC,SAAU,eACVC,UAAW,gBACXC,cAAe,+CACfC,YAAa,kBACbC,aAAc,qBAGtBR,gBAAiB,CACbE,cAAe,eAGnBO,EAAeC,EAAc,CAC7BxB,OAAQ,SACRO,QAAS,OACTD,KAAM,SACNG,MAAO,OAEAgB,EAAkB,WACzB,OAAOC,EAAWH,EACtB,EACWI,EAAYC,GAAW,SAAUC,EAAIC,GAC5C,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUC,EAAYJ,EAAGI,UAAWjC,EAAS6B,EAAG7B,OAAQO,EAAUsB,EAAGtB,QAASD,EAAOuB,EAAGvB,KAAMG,EAAQoB,EAAGpB,MAAOyB,EAAKL,EAAGM,SAAUA,OAAkB,IAAPD,EAAgB,IAAOA,EAAIE,EAAKP,EAAGb,cAAeA,OAAuB,IAAPoB,EAAgB,YAAcA,EAAIC,EAAeR,EAAGQ,aAAcC,EAAQ9C,EAAOqC,EAAI,CAAC,YAAa,WAAY,YAAa,SAAU,UAAW,OAAQ,QAAS,WAAY,gBAAiB,iBACtbU,EAAeC,GAAQ,WAAc,MAAA,CAAUxC,OAAQA,EAAQM,KAAMA,EAAMC,QAASA,EAASE,MAAOA,KAAa,CAACT,EAAQM,EAAMC,EAASE,IAEzIgC,EAAiBC,EAAG7C,EAAc,CAAEG,OAAQA,EAAQO,QAASA,EAASD,KAAMA,EAAMG,MAAOA,IADxE,sdACkGsB,GACvH,OAAQY,EAAIC,IAACrB,EAAasB,SAAU,CAAEC,MAAOP,EAAcP,SAAUe,EAAAA,KAAMC,EAAyB,CAAEC,eAAgB,QAASd,SAAUA,EAAUH,SAAU,CAACW,EAAIC,IAACM,EAAqBzE,EAAS,CAAEqD,IAAKA,EAAKC,UAAWU,EAAgBU,KAAMlB,EAAWmB,aAAcf,GAAgBC,EAAO,CAAEN,SAAUA,KAAcW,MAAKU,EAAyB,CAAEtB,UAAWW,EAAG3B,EAAsB,CAAEC,cAAeA,WACjZ,IACAW,EAAU2B,YAAc"}
|
@@ -1,53 +1,2 @@
|
|
1
|
-
var
|
2
|
-
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
-
s = arguments[i];
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
-
t[p] = s[p];
|
7
|
-
}
|
8
|
-
return t;
|
9
|
-
};
|
10
|
-
return __assign.apply(this, arguments);
|
11
|
-
};
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
-
var t = {};
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
-
t[p] = s[p];
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
-
t[p[i]] = s[p[i]];
|
20
|
-
}
|
21
|
-
return t;
|
22
|
-
};
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
-
import { forwardRef } from 'react';
|
25
|
-
import * as ToastPrimitive from '@radix-ui/react-toast';
|
26
|
-
import { cva } from 'class-variance-authority';
|
27
|
-
import { cn } from '../../../lib/utils/utils';
|
28
|
-
import { useToastContext } from './ToastRoot';
|
29
|
-
export var toastTitleVariants = cva('flex mb-[5px] text-slate-12 dark:text-slateDark-12 text-wrap break-words font-medium', {
|
30
|
-
variants: {
|
31
|
-
size: {
|
32
|
-
small: 'text-sm w-[220px]',
|
33
|
-
medium: 'text-sm w-[312px]',
|
34
|
-
large: 'text-xl w-[284px]',
|
35
|
-
'x-large': 'text-2xl w-[284px]',
|
36
|
-
},
|
37
|
-
color: {
|
38
|
-
danger: 'text-red-11',
|
39
|
-
warning: 'text-amber-11',
|
40
|
-
success: 'text-green-11',
|
41
|
-
information: 'text-sky-11',
|
42
|
-
},
|
43
|
-
},
|
44
|
-
defaultVariants: {
|
45
|
-
size: 'medium',
|
46
|
-
},
|
47
|
-
});
|
48
|
-
export var ToastTitle = forwardRef(function (_a, ref) {
|
49
|
-
var className = _a.className, children = _a.children, titleText = _a.titleText, props = __rest(_a, ["className", "children", "titleText"]);
|
50
|
-
var _b = useToastContext(), size = _b.size, color = _b.color;
|
51
|
-
return (_jsx(ToastPrimitive.Title, __assign({ ref: ref }, props, { children: _jsx("p", { className: cn(toastTitleVariants({ size: size, color: color }), className), children: titleText !== null && titleText !== void 0 ? titleText : children }) })));
|
52
|
-
});
|
53
|
-
ToastTitle.displayName = 'Toast.Title';
|
1
|
+
import{j as t}from"../../../../_virtual/jsx-runtime.js";import{forwardRef as e}from"react";import{Title as r}from"../../../../node_modules/@radix-ui/react-toast/dist/index.mjs.js";import{cva as o}from"../../../../node_modules/class-variance-authority/dist/index.mjs.js";import{cn as a}from"../../utils/utils.js";import{useToastContext as s}from"./ToastRoot.js";var i=function(){return i=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var a in e=arguments[r])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t},i.apply(this,arguments)},n=function(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(t);a<o.length;a++)e.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(r[o[a]]=t[o[a]])}return r},l=o("flex mb-[5px] text-slate-12 dark:text-slateDark-12 text-wrap break-words font-medium",{variants:{size:{small:"text-sm w-[220px]",medium:"text-sm w-[312px]",large:"text-xl w-[284px]","x-large":"text-2xl w-[284px]"},color:{danger:"text-red-11",warning:"text-amber-11",success:"text-green-11",information:"text-sky-11"}},defaultVariants:{size:"medium"}}),m=e((function(e,o){var m=e.className,x=e.children,c=e.titleText,p=n(e,["className","children","titleText"]),u=s(),d=u.size,f=u.color;return t.jsx(r,i({ref:o},p,{children:t.jsx("p",{className:a(l({size:d,color:f}),m),children:null!=c?c:x})}))}));m.displayName="Toast.Title";export{m as ToastTitle,l as toastTitleVariants};
|
2
|
+
//# sourceMappingURL=ToastTitle.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ToastTitle.js","sources":["../../../../lib/components/Toast/ToastTitle.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { forwardRef } from 'react';\nimport * as ToastPrimitive from '@radix-ui/react-toast';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../../lib/utils/utils';\nimport { useToastContext } from './ToastRoot';\nexport var toastTitleVariants = cva('flex mb-[5px] text-slate-12 dark:text-slateDark-12 text-wrap break-words font-medium', {\n variants: {\n size: {\n small: 'text-sm w-[220px]',\n medium: 'text-sm w-[312px]',\n large: 'text-xl w-[284px]',\n 'x-large': 'text-2xl w-[284px]',\n },\n color: {\n danger: 'text-red-11',\n warning: 'text-amber-11',\n success: 'text-green-11',\n information: 'text-sky-11',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n});\nexport var ToastTitle = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, titleText = _a.titleText, props = __rest(_a, [\"className\", \"children\", \"titleText\"]);\n var _b = useToastContext(), size = _b.size, color = _b.color;\n return (_jsx(ToastPrimitive.Title, __assign({ ref: ref }, props, { children: _jsx(\"p\", { className: cn(toastTitleVariants({ size: size, color: color }), className), children: titleText !== null && titleText !== void 0 ? titleText : children }) })));\n});\nToastTitle.displayName = 'Toast.Title';\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","toastTitleVariants","cva","variants","size","small","medium","large","color","danger","warning","success","information","defaultVariants","ToastTitle","forwardRef","_a","ref","className","children","titleText","props","_b","useToastContext","_jsx","ToastPrimitive.Title","jsx","cn","displayName"],"mappings":"yWAAA,IAAIA,EAAsC,WAStC,OARAA,EAAWC,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,CACf,EACWH,EAASa,MAAMC,KAAMP,UAChC,EACIQ,EAAkC,SAAUX,EAAGY,GAC/C,IAAIb,EAAI,CAAA,EACR,IAAK,IAAIM,KAAKL,EAAOH,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,IAAMO,EAAEC,QAAQR,GAAK,IAC9EN,EAAEM,GAAKL,EAAEK,IACb,GAAS,MAALL,GAAqD,mBAAjCH,OAAOiB,sBACtB,KAAIb,EAAI,EAAb,IAAgBI,EAAIR,OAAOiB,sBAAsBd,GAAIC,EAAII,EAAED,OAAQH,IAC3DW,EAAEC,QAAQR,EAAEJ,IAAM,GAAKJ,OAAOS,UAAUS,qBAAqBP,KAAKR,EAAGK,EAAEJ,MACvEF,EAAEM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACX,EAOWiB,EAAqBC,EAAI,uFAAwF,CACxHC,SAAU,CACNC,KAAM,CACFC,MAAO,oBACPC,OAAQ,oBACRC,MAAO,oBACP,UAAW,sBAEfC,MAAO,CACHC,OAAQ,cACRC,QAAS,gBACTC,QAAS,gBACTC,YAAa,gBAGrBC,gBAAiB,CACbT,KAAM,YAGHU,EAAaC,GAAW,SAAUC,EAAIC,GAC7C,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUC,EAAYJ,EAAGI,UAAWC,EAAQzB,EAAOoB,EAAI,CAAC,YAAa,WAAY,cACzHM,EAAKC,IAAmBnB,EAAOkB,EAAGlB,KAAMI,EAAQc,EAAGd,MACvD,OAAQgB,EAAAA,IAAKC,EAAsB5C,EAAS,CAAEoC,IAAKA,GAAOI,EAAO,CAAEF,SAAUK,EAAIE,IAAC,IAAK,CAAER,UAAWS,EAAG1B,EAAmB,CAAEG,KAAMA,EAAMI,MAAOA,IAAUU,GAAYC,SAAUC,QAA6CA,EAAYD,MAC5O,IACAL,EAAWc,YAAc"}
|
@@ -1,11 +1,2 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
import { ToastDescription as Description } from './ToastDescription';
|
4
|
-
import { ToastActionButton as ActionButton } from './ToastActionButton';
|
5
|
-
var Toast = {
|
6
|
-
Root: Root,
|
7
|
-
Title: Title,
|
8
|
-
Description: Description,
|
9
|
-
ActionButton: ActionButton,
|
10
|
-
};
|
11
|
-
export default Toast;
|
1
|
+
import{ToastRoot as o}from"./ToastRoot.js";import{ToastTitle as t}from"./ToastTitle.js";import{ToastDescription as i}from"./ToastDescription.js";import{ToastActionButton as r}from"./ToastActionButton.js";var s={Root:o,Title:t,Description:i,ActionButton:r};export{s as default};
|
2
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../lib/components/Toast/index.js"],"sourcesContent":["import { ToastRoot as Root } from './ToastRoot';\nimport { ToastTitle as Title } from './ToastTitle';\nimport { ToastDescription as Description } from './ToastDescription';\nimport { ToastActionButton as ActionButton } from './ToastActionButton';\nvar Toast = {\n Root: Root,\n Title: Title,\n Description: Description,\n ActionButton: ActionButton,\n};\nexport default Toast;\n"],"names":["Toast","Root","Title","Description","ActionButton"],"mappings":"4MAIG,IAACA,EAAQ,CACRC,KAAMA,EACNC,MAAOA,EACPC,YAAaA,EACbC,aAAcA"}
|
@@ -1,58 +1,2 @@
|
|
1
|
-
var
|
2
|
-
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
-
s = arguments[i];
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
-
t[p] = s[p];
|
7
|
-
}
|
8
|
-
return t;
|
9
|
-
};
|
10
|
-
return __assign.apply(this, arguments);
|
11
|
-
};
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
-
var t = {};
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
-
t[p] = s[p];
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
-
t[p[i]] = s[p[i]];
|
20
|
-
}
|
21
|
-
return t;
|
22
|
-
};
|
23
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
24
|
-
import React, { Children, forwardRef } from 'react';
|
25
|
-
import { cva } from 'class-variance-authority';
|
26
|
-
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
27
|
-
import { radiusVariants, toggleAppearanceStyle } from '../../../lib/constants';
|
28
|
-
import { scalingVariants } from '../../../lib/constants';
|
29
|
-
import { cn } from '../../../lib/utils/utils';
|
30
|
-
var toggleWithTextVariants = cva('flex items-center justify-center box-border font-medium', {
|
31
|
-
variants: {
|
32
|
-
radius: __assign({}, radiusVariants['base']),
|
33
|
-
size: {
|
34
|
-
small: 'h-6 px-2 text-xs gap-1',
|
35
|
-
medium: 'h-8 px-3 text-sm gap-2',
|
36
|
-
large: 'h-10 px-4 text-base gap-3',
|
37
|
-
},
|
38
|
-
scaling: __assign({}, scalingVariants),
|
39
|
-
},
|
40
|
-
defaultVariants: {
|
41
|
-
radius: 'medium',
|
42
|
-
size: 'medium',
|
43
|
-
scaling: '100%',
|
44
|
-
},
|
45
|
-
});
|
46
|
-
export var IconScaling = {
|
47
|
-
small: 'w-[14px]',
|
48
|
-
medium: 'w-4',
|
49
|
-
large: 'w-[18px]',
|
50
|
-
};
|
51
|
-
export var ToggleWithText = forwardRef(function (_a, ref) {
|
52
|
-
var className = _a.className, children = _a.children, radius = _a.radius, _b = _a.size, size = _b === void 0 ? 'medium' : _b, scaling = _a.scaling, _c = _a.color, color = _c === void 0 ? 'red' : _c, _d = _a.appearance, appearance = _d === void 0 ? 'surface' : _d, text = _a.text, props = __rest(_a, ["className", "children", "radius", "size", "scaling", "color", "appearance", "text"]);
|
53
|
-
return (_jsxs(TogglePrimitive.Root, __assign({ ref: ref, className: cn(toggleWithTextVariants({ radius: radius, size: size, scaling: scaling }), toggleAppearanceStyle(appearance, color, true, 'data-[state=on]:'), className) }, props, { children: [Children.map(children, function (child) {
|
54
|
-
return React.cloneElement(child, { className: IconScaling[size] });
|
55
|
-
}), text] })));
|
56
|
-
});
|
57
|
-
ToggleWithText.displayName = 'ToggleWithText';
|
58
|
-
export default ToggleWithText;
|
1
|
+
import{j as e}from"../../../../_virtual/jsx-runtime.js";import t,{forwardRef as r,Children as a}from"react";import{cva as s}from"../../../../node_modules/class-variance-authority/dist/index.mjs.js";import{Root as i}from"../../../../node_modules/@radix-ui/react-toggle/dist/index.mjs.js";import{radiusVariants as o,scalingVariants as n,toggleAppearanceStyle as l}from"../../constants.js";import{cn as m}from"../../utils/utils.js";var c=function(){return c=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},c.apply(this,arguments)},p=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(a=Object.getOwnPropertySymbols(e);s<a.length;s++)t.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(e,a[s])&&(r[a[s]]=e[a[s]])}return r},u=s("flex items-center justify-center box-border font-medium",{variants:{radius:c({},o.base),size:{small:"h-6 px-2 text-xs gap-1",medium:"h-8 px-3 text-sm gap-2",large:"h-10 px-4 text-base gap-3"},scaling:c({},n)},defaultVariants:{radius:"medium",size:"medium",scaling:"100%"}}),d={small:"w-[14px]",medium:"w-4",large:"w-[18px]"},f=r((function(r,s){var o=r.className,n=r.children,f=r.radius,x=r.size,g=void 0===x?"medium":x,j=r.scaling,y=r.color,b=void 0===y?"red":y,h=r.appearance,v=void 0===h?"surface":h,O=r.text,w=p(r,["className","children","radius","size","scaling","color","appearance","text"]);return e.jsxs(i,c({ref:s,className:m(u({radius:f,size:g,scaling:j}),l(v,b,!0,"data-[state=on]:"),o)},w,{children:[a.map(n,(function(e){return t.cloneElement(e,{className:d[g]})})),O]}))}));f.displayName="ToggleWithText";export{d as IconScaling,f as ToggleWithText,f as default};
|
2
|
+
//# sourceMappingURL=ToggleWithText.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ToggleWithText.js","sources":["../../../../lib/components/Toggle/ToggleWithText.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React, { Children, forwardRef } from 'react';\nimport { cva } from 'class-variance-authority';\nimport * as TogglePrimitive from '@radix-ui/react-toggle';\nimport { radiusVariants, toggleAppearanceStyle } from '../../../lib/constants';\nimport { scalingVariants } from '../../../lib/constants';\nimport { cn } from '../../../lib/utils/utils';\nvar toggleWithTextVariants = cva('flex items-center justify-center box-border font-medium', {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n size: {\n small: 'h-6 px-2 text-xs gap-1',\n medium: 'h-8 px-3 text-sm gap-2',\n large: 'h-10 px-4 text-base gap-3',\n },\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n radius: 'medium',\n size: 'medium',\n scaling: '100%',\n },\n});\nexport var IconScaling = {\n small: 'w-[14px]',\n medium: 'w-4',\n large: 'w-[18px]',\n};\nexport var ToggleWithText = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, radius = _a.radius, _b = _a.size, size = _b === void 0 ? 'medium' : _b, scaling = _a.scaling, _c = _a.color, color = _c === void 0 ? 'red' : _c, _d = _a.appearance, appearance = _d === void 0 ? 'surface' : _d, text = _a.text, props = __rest(_a, [\"className\", \"children\", \"radius\", \"size\", \"scaling\", \"color\", \"appearance\", \"text\"]);\n return (_jsxs(TogglePrimitive.Root, __assign({ ref: ref, className: cn(toggleWithTextVariants({ radius: radius, size: size, scaling: scaling }), toggleAppearanceStyle(appearance, color, true, 'data-[state=on]:'), className) }, props, { children: [Children.map(children, function (child) {\n return React.cloneElement(child, { className: IconScaling[size] });\n }), text] })));\n});\nToggleWithText.displayName = 'ToggleWithText';\nexport default ToggleWithText;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","toggleWithTextVariants","cva","variants","radius","radiusVariants","size","small","medium","large","scaling","scalingVariants","defaultVariants","IconScaling","ToggleWithText","forwardRef","_a","ref","className","children","_b","_c","color","_d","appearance","text","props","_jsxs","TogglePrimitive.Root","cn","toggleAppearanceStyle","Children","map","child","React","cloneElement","displayName"],"mappings":"6aAAA,IAAIA,EAAsC,WAStC,OARAA,EAAWC,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,CACf,EACWH,EAASa,MAAMC,KAAMP,UAChC,EACIQ,EAAkC,SAAUX,EAAGY,GAC/C,IAAIb,EAAI,CAAA,EACR,IAAK,IAAIM,KAAKL,EAAOH,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,IAAMO,EAAEC,QAAQR,GAAK,IAC9EN,EAAEM,GAAKL,EAAEK,IACb,GAAS,MAALL,GAAqD,mBAAjCH,OAAOiB,sBACtB,KAAIb,EAAI,EAAb,IAAgBI,EAAIR,OAAOiB,sBAAsBd,GAAIC,EAAII,EAAED,OAAQH,IAC3DW,EAAEC,QAAQR,EAAEJ,IAAM,GAAKJ,OAAOS,UAAUS,qBAAqBP,KAAKR,EAAGK,EAAEJ,MACvEF,EAAEM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACX,EAQIiB,EAAyBC,EAAI,0DAA2D,CACxFC,SAAU,CACNC,OAAQvB,EAAS,CAAA,EAAIwB,EAAqB,MAC1CC,KAAM,CACFC,MAAO,yBACPC,OAAQ,yBACRC,MAAO,6BAEXC,QAAS7B,EAAS,CAAE,EAAE8B,IAE1BC,gBAAiB,CACbR,OAAQ,SACRE,KAAM,SACNI,QAAS,UAGNG,EAAc,CACrBN,MAAO,WACPC,OAAQ,MACRC,MAAO,YAEAK,EAAiBC,GAAW,SAAUC,EAAIC,GACjD,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUf,EAASY,EAAGZ,OAAQgB,EAAKJ,EAAGV,KAAMA,OAAc,IAAPc,EAAgB,SAAWA,EAAIV,EAAUM,EAAGN,QAASW,EAAKL,EAAGM,MAAOA,OAAe,IAAPD,EAAgB,MAAQA,EAAIE,EAAKP,EAAGQ,WAAYA,OAAoB,IAAPD,EAAgB,UAAYA,EAAIE,EAAOT,EAAGS,KAAMC,EAAQ9B,EAAOoB,EAAI,CAAC,YAAa,WAAY,SAAU,OAAQ,UAAW,QAAS,aAAc,SACzX,OAAQW,EAAAA,KAAMC,EAAsB/C,EAAS,CAAEoC,IAAKA,EAAKC,UAAWW,EAAG5B,EAAuB,CAAEG,OAAQA,EAAQE,KAAMA,EAAMI,QAASA,IAAYoB,EAAsBN,EAAYF,GAAO,EAAM,oBAAqBJ,IAAcQ,EAAO,CAAEP,SAAU,CAACY,EAASC,IAAIb,GAAU,SAAUc,GAC5Q,OAAOC,EAAMC,aAAaF,EAAO,CAAEf,UAAWL,EAAYP,IAC1E,IAAgBmB,KAChB,IACAX,EAAesB,YAAc"}
|
@@ -1,58 +1,2 @@
|
|
1
|
-
var
|
2
|
-
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
-
s = arguments[i];
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
-
t[p] = s[p];
|
7
|
-
}
|
8
|
-
return t;
|
9
|
-
};
|
10
|
-
return __assign.apply(this, arguments);
|
11
|
-
};
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
-
var t = {};
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
-
t[p] = s[p];
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
-
t[p[i]] = s[p[i]];
|
20
|
-
}
|
21
|
-
return t;
|
22
|
-
};
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
-
import React, { Children, forwardRef } from 'react';
|
25
|
-
import { cva } from 'class-variance-authority';
|
26
|
-
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
27
|
-
import { radiusVariants, scalingVariants, toggleAppearanceStyle } from '../../../lib/constants';
|
28
|
-
import { cn } from '../../../lib/utils/utils';
|
29
|
-
export * from './ToggleWithText';
|
30
|
-
var toggleVariants = cva('grid place-content-center items-center justify-center box-border"', {
|
31
|
-
variants: {
|
32
|
-
radius: __assign({}, radiusVariants['base']),
|
33
|
-
size: {
|
34
|
-
small: 'w-6 h-6 p-[6px]',
|
35
|
-
medium: 'w-8 h-8 p-2',
|
36
|
-
large: 'w-10 h-10 p-[11px]',
|
37
|
-
},
|
38
|
-
scaling: __assign({}, scalingVariants),
|
39
|
-
},
|
40
|
-
defaultVariants: {
|
41
|
-
radius: 'medium',
|
42
|
-
size: 'medium',
|
43
|
-
scaling: '100%',
|
44
|
-
},
|
45
|
-
});
|
46
|
-
export var IconScaling = {
|
47
|
-
small: 'w-[14px]',
|
48
|
-
medium: 'w-4',
|
49
|
-
large: 'w-[18px]',
|
50
|
-
};
|
51
|
-
export var Toggle = forwardRef(function (_a, ref) {
|
52
|
-
var className = _a.className, children = _a.children, radius = _a.radius, _b = _a.size, size = _b === void 0 ? 'medium' : _b, scaling = _a.scaling, _c = _a.color, color = _c === void 0 ? 'red' : _c, _d = _a.appearance, appearance = _d === void 0 ? 'surface' : _d, props = __rest(_a, ["className", "children", "radius", "size", "scaling", "color", "appearance"]);
|
53
|
-
return (_jsx(TogglePrimitive.Root, __assign({ ref: ref, className: cn(toggleVariants({ radius: radius, size: size, scaling: scaling }), toggleAppearanceStyle(appearance, color, true, 'data-[state=on]:'), className) }, props, { children: Children.map(children, function (child) {
|
54
|
-
return React.cloneElement(child, { className: IconScaling[size] });
|
55
|
-
}) })));
|
56
|
-
});
|
57
|
-
Toggle.displayName = 'Toggle';
|
58
|
-
export default Toggle;
|
1
|
+
import{j as e}from"../../../../_virtual/jsx-runtime.js";import r,{forwardRef as t,Children as a}from"react";import{cva as i}from"../../../../node_modules/class-variance-authority/dist/index.mjs.js";import{Root as s}from"../../../../node_modules/@radix-ui/react-toggle/dist/index.mjs.js";import{radiusVariants as o,scalingVariants as n,toggleAppearanceStyle as l}from"../../constants.js";import{cn as c}from"../../utils/utils.js";export{ToggleWithText}from"./ToggleWithText.js";var m=function(){return m=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++)for(var i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);return e},m.apply(this,arguments)},p=function(e,r){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(e);i<a.length;i++)r.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(t[a[i]]=e[a[i]])}return t},u=i('grid place-content-center items-center justify-center box-border"',{variants:{radius:m({},o.base),size:{small:"w-6 h-6 p-[6px]",medium:"w-8 h-8 p-2",large:"w-10 h-10 p-[11px]"},scaling:m({},n)},defaultVariants:{radius:"medium",size:"medium",scaling:"100%"}}),d={small:"w-[14px]",medium:"w-4",large:"w-[18px]"},f=t((function(t,i){var o=t.className,n=t.children,f=t.radius,g=t.size,j=void 0===g?"medium":g,x=t.scaling,y=t.color,h=void 0===y?"red":y,v=t.appearance,b=void 0===v?"surface":v,O=p(t,["className","children","radius","size","scaling","color","appearance"]);return e.jsx(s,m({ref:i,className:c(u({radius:f,size:j,scaling:x}),l(b,h,!0,"data-[state=on]:"),o)},O,{children:a.map(n,(function(e){return r.cloneElement(e,{className:d[j]})}))}))}));f.displayName="Toggle";export{d as IconScaling,f as Toggle,f as default};
|
2
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../lib/components/Toggle/index.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport React, { Children, forwardRef } from 'react';\nimport { cva } from 'class-variance-authority';\nimport * as TogglePrimitive from '@radix-ui/react-toggle';\nimport { radiusVariants, scalingVariants, toggleAppearanceStyle } from '../../../lib/constants';\nimport { cn } from '../../../lib/utils/utils';\nexport * from './ToggleWithText';\nvar toggleVariants = cva('grid place-content-center items-center justify-center box-border\"', {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n size: {\n small: 'w-6 h-6 p-[6px]',\n medium: 'w-8 h-8 p-2',\n large: 'w-10 h-10 p-[11px]',\n },\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n radius: 'medium',\n size: 'medium',\n scaling: '100%',\n },\n});\nexport var IconScaling = {\n small: 'w-[14px]',\n medium: 'w-4',\n large: 'w-[18px]',\n};\nexport var Toggle = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, radius = _a.radius, _b = _a.size, size = _b === void 0 ? 'medium' : _b, scaling = _a.scaling, _c = _a.color, color = _c === void 0 ? 'red' : _c, _d = _a.appearance, appearance = _d === void 0 ? 'surface' : _d, props = __rest(_a, [\"className\", \"children\", \"radius\", \"size\", \"scaling\", \"color\", \"appearance\"]);\n return (_jsx(TogglePrimitive.Root, __assign({ ref: ref, className: cn(toggleVariants({ radius: radius, size: size, scaling: scaling }), toggleAppearanceStyle(appearance, color, true, 'data-[state=on]:'), className) }, props, { children: Children.map(children, function (child) {\n return React.cloneElement(child, { className: IconScaling[size] });\n }) })));\n});\nToggle.displayName = 'Toggle';\nexport default Toggle;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","toggleVariants","cva","variants","radius","radiusVariants","size","small","medium","large","scaling","scalingVariants","defaultVariants","IconScaling","Toggle","forwardRef","_a","ref","className","children","_b","_c","color","_d","appearance","props","_jsx","TogglePrimitive.Root","cn","toggleAppearanceStyle","Children","map","child","React","cloneElement","displayName"],"mappings":"6dAAA,IAAIA,EAAsC,WAStC,OARAA,EAAWC,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,CACf,EACWH,EAASa,MAAMC,KAAMP,UAChC,EACIQ,EAAkC,SAAUX,EAAGY,GAC/C,IAAIb,EAAI,CAAA,EACR,IAAK,IAAIM,KAAKL,EAAOH,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,IAAMO,EAAEC,QAAQR,GAAK,IAC9EN,EAAEM,GAAKL,EAAEK,IACb,GAAS,MAALL,GAAqD,mBAAjCH,OAAOiB,sBACtB,KAAIb,EAAI,EAAb,IAAgBI,EAAIR,OAAOiB,sBAAsBd,GAAIC,EAAII,EAAED,OAAQH,IAC3DW,EAAEC,QAAQR,EAAEJ,IAAM,GAAKJ,OAAOS,UAAUS,qBAAqBP,KAAKR,EAAGK,EAAEJ,MACvEF,EAAEM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACX,EAQIiB,EAAiBC,EAAI,oEAAqE,CAC1FC,SAAU,CACNC,OAAQvB,EAAS,CAAA,EAAIwB,EAAqB,MAC1CC,KAAM,CACFC,MAAO,kBACPC,OAAQ,cACRC,MAAO,sBAEXC,QAAS7B,EAAS,CAAE,EAAE8B,IAE1BC,gBAAiB,CACbR,OAAQ,SACRE,KAAM,SACNI,QAAS,UAGNG,EAAc,CACrBN,MAAO,WACPC,OAAQ,MACRC,MAAO,YAEAK,EAASC,GAAW,SAAUC,EAAIC,GACzC,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUf,EAASY,EAAGZ,OAAQgB,EAAKJ,EAAGV,KAAMA,OAAc,IAAPc,EAAgB,SAAWA,EAAIV,EAAUM,EAAGN,QAASW,EAAKL,EAAGM,MAAOA,OAAe,IAAPD,EAAgB,MAAQA,EAAIE,EAAKP,EAAGQ,WAAYA,OAAoB,IAAPD,EAAgB,UAAYA,EAAIE,EAAQ7B,EAAOoB,EAAI,CAAC,YAAa,WAAY,SAAU,OAAQ,UAAW,QAAS,eAC3V,OAAQU,EAAAA,IAAKC,EAAsB9C,EAAS,CAAEoC,IAAKA,EAAKC,UAAWU,EAAG3B,EAAe,CAAEG,OAAQA,EAAQE,KAAMA,EAAMI,QAASA,IAAYmB,EAAsBL,EAAYF,GAAO,EAAM,oBAAqBJ,IAAcO,EAAO,CAAEN,SAAUW,EAASC,IAAIZ,GAAU,SAAUa,GACtQ,OAAOC,EAAMC,aAAaF,EAAO,CAAEd,UAAWL,EAAYP,IACtE,MACA,IACAQ,EAAOqB,YAAc"}
|
@@ -1,54 +1,2 @@
|
|
1
|
-
var
|
2
|
-
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
-
s = arguments[i];
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
-
t[p] = s[p];
|
7
|
-
}
|
8
|
-
return t;
|
9
|
-
};
|
10
|
-
return __assign.apply(this, arguments);
|
11
|
-
};
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
-
var t = {};
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
-
t[p] = s[p];
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
-
t[p[i]] = s[p[i]];
|
20
|
-
}
|
21
|
-
return t;
|
22
|
-
};
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
-
import React, { Children, forwardRef, useContext, } from 'react';
|
25
|
-
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
26
|
-
import { cva } from 'class-variance-authority';
|
27
|
-
import { toggleAppearanceStyle } from '../../../lib/constants';
|
28
|
-
import { ToggleGroupContext } from './ToggleGroupRoot';
|
29
|
-
import { cn } from '../../../lib/utils/utils';
|
30
|
-
export var toggleGroupItemVariants = cva('grid place-content-center mr-[-1px] first:rounded-l last:rounded-r', {
|
31
|
-
variants: {
|
32
|
-
size: {
|
33
|
-
small: 'w-6 h-6 p-[6px]',
|
34
|
-
medium: 'w-8 h-8 p-2',
|
35
|
-
large: 'w-10 h-10 p-[11px]',
|
36
|
-
},
|
37
|
-
},
|
38
|
-
defaultVariants: {
|
39
|
-
size: 'medium',
|
40
|
-
},
|
41
|
-
});
|
42
|
-
export var IconScaling = {
|
43
|
-
small: 'w-[14px]',
|
44
|
-
medium: 'w-4',
|
45
|
-
large: 'w-[18px]',
|
46
|
-
};
|
47
|
-
export var ToggleGroupItem = forwardRef(function (_a, ref) {
|
48
|
-
var className = _a.className, children = _a.children, value = _a.value, props = __rest(_a, ["className", "children", "value"]);
|
49
|
-
var _b = useContext(ToggleGroupContext), size = _b.size, _c = _b.color, color = _c === void 0 ? 'red' : _c, _d = _b.appearance, appearance = _d === void 0 ? 'surface' : _d;
|
50
|
-
return (_jsx(ToggleGroupPrimitive.Item, __assign({ ref: ref, value: value, className: cn(toggleGroupItemVariants({ size: size }), toggleAppearanceStyle(appearance, color, true, 'data-[state=on]:'), className) }, props, { children: Children.map(children, function (child) {
|
51
|
-
return React.cloneElement(child, { className: IconScaling[size !== null && size !== void 0 ? size : 'medium'] });
|
52
|
-
}) })));
|
53
|
-
});
|
54
|
-
ToggleGroupItem.displayName = 'ToggleGroup.Item';
|
1
|
+
import{j as e}from"../../../../_virtual/jsx-runtime.js";import r,{forwardRef as t,useContext as o,Children as a}from"react";import{Item as n}from"../../../../node_modules/@radix-ui/react-toggle-group/dist/index.mjs.js";import{cva as s}from"../../../../node_modules/class-variance-authority/dist/index.mjs.js";import{toggleAppearanceStyle as i}from"../../constants.js";import{ToggleGroupContext as l}from"./ToggleGroupRoot.js";import{cn as m}from"../../utils/utils.js";var p=function(){return p=Object.assign||function(e){for(var r,t=1,o=arguments.length;t<o;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e},p.apply(this,arguments)},u=function(e,r){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(e);a<o.length;a++)r.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(t[o[a]]=e[o[a]])}return t},c=s("grid place-content-center mr-[-1px] first:rounded-l last:rounded-r",{variants:{size:{small:"w-6 h-6 p-[6px]",medium:"w-8 h-8 p-2",large:"w-10 h-10 p-[11px]"}},defaultVariants:{size:"medium"}}),d={small:"w-[14px]",medium:"w-4",large:"w-[18px]"},f=t((function(t,s){var f=t.className,j=t.children,g=t.value,v=u(t,["className","children","value"]),y=o(l),x=y.size,h=y.color,O=void 0===h?"red":h,w=y.appearance,b=void 0===w?"surface":w;return e.jsx(n,p({ref:s,value:g,className:m(c({size:x}),i(b,O,!0,"data-[state=on]:"),f)},v,{children:a.map(j,(function(e){return r.cloneElement(e,{className:d[null!=x?x:"medium"]})}))}))}));f.displayName="ToggleGroup.Item";export{d as IconScaling,f as ToggleGroupItem,c as toggleGroupItemVariants};
|
2
|
+
//# sourceMappingURL=ToggleGroupItem.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ToggleGroupItem.js","sources":["../../../../lib/components/ToggleGroup/ToggleGroupItem.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport React, { Children, forwardRef, useContext, } from 'react';\nimport * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { cva } from 'class-variance-authority';\nimport { toggleAppearanceStyle } from '../../../lib/constants';\nimport { ToggleGroupContext } from './ToggleGroupRoot';\nimport { cn } from '../../../lib/utils/utils';\nexport var toggleGroupItemVariants = cva('grid place-content-center mr-[-1px] first:rounded-l last:rounded-r', {\n variants: {\n size: {\n small: 'w-6 h-6 p-[6px]',\n medium: 'w-8 h-8 p-2',\n large: 'w-10 h-10 p-[11px]',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n});\nexport var IconScaling = {\n small: 'w-[14px]',\n medium: 'w-4',\n large: 'w-[18px]',\n};\nexport var ToggleGroupItem = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, value = _a.value, props = __rest(_a, [\"className\", \"children\", \"value\"]);\n var _b = useContext(ToggleGroupContext), size = _b.size, _c = _b.color, color = _c === void 0 ? 'red' : _c, _d = _b.appearance, appearance = _d === void 0 ? 'surface' : _d;\n return (_jsx(ToggleGroupPrimitive.Item, __assign({ ref: ref, value: value, className: cn(toggleGroupItemVariants({ size: size }), toggleAppearanceStyle(appearance, color, true, 'data-[state=on]:'), className) }, props, { children: Children.map(children, function (child) {\n return React.cloneElement(child, { className: IconScaling[size !== null && size !== void 0 ? size : 'medium'] });\n }) })));\n});\nToggleGroupItem.displayName = 'ToggleGroup.Item';\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","toggleGroupItemVariants","cva","variants","size","small","medium","large","defaultVariants","IconScaling","ToggleGroupItem","forwardRef","_a","ref","className","children","value","props","_b","useContext","ToggleGroupContext","_c","color","_d","appearance","_jsx","jsx","ToggleGroupPrimitive.Item","cn","toggleAppearanceStyle","Children","map","child","React","cloneElement","displayName"],"mappings":"odAAA,IAAIA,EAAsC,WAStC,OARAA,EAAWC,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,CACf,EACWH,EAASa,MAAMC,KAAMP,UAChC,EACIQ,EAAkC,SAAUX,EAAGY,GAC/C,IAAIb,EAAI,CAAA,EACR,IAAK,IAAIM,KAAKL,EAAOH,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,IAAMO,EAAEC,QAAQR,GAAK,IAC9EN,EAAEM,GAAKL,EAAEK,IACb,GAAS,MAALL,GAAqD,mBAAjCH,OAAOiB,sBACtB,KAAIb,EAAI,EAAb,IAAgBI,EAAIR,OAAOiB,sBAAsBd,GAAIC,EAAII,EAAED,OAAQH,IAC3DW,EAAEC,QAAQR,EAAEJ,IAAM,GAAKJ,OAAOS,UAAUS,qBAAqBP,KAAKR,EAAGK,EAAEJ,MACvEF,EAAEM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACX,EAQWiB,EAA0BC,EAAI,qEAAsE,CAC3GC,SAAU,CACNC,KAAM,CACFC,MAAO,kBACPC,OAAQ,cACRC,MAAO,uBAGfC,gBAAiB,CACbJ,KAAM,YAGHK,EAAc,CACrBJ,MAAO,WACPC,OAAQ,MACRC,MAAO,YAEAG,EAAkBC,GAAW,SAAUC,EAAIC,GAClD,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUC,EAAQJ,EAAGI,MAAOC,EAAQrB,EAAOgB,EAAI,CAAC,YAAa,WAAY,UACjHM,EAAKC,EAAWC,GAAqBhB,EAAOc,EAAGd,KAAMiB,EAAKH,EAAGI,MAAOA,OAAe,IAAPD,EAAgB,MAAQA,EAAIE,EAAKL,EAAGM,WAAYA,OAAoB,IAAPD,EAAgB,UAAYA,EACzK,OAAQE,EAAIC,IAACC,EAA2B9C,EAAS,CAAEgC,IAAKA,EAAKG,MAAOA,EAAOF,UAAWc,EAAG3B,EAAwB,CAAEG,KAAMA,IAASyB,EAAsBL,EAAYF,GAAO,EAAM,oBAAqBR,IAAcG,EAAO,CAAEF,SAAUe,EAASC,IAAIhB,GAAU,SAAUiB,GAChQ,OAAOC,EAAMC,aAAaF,EAAO,CAAElB,UAAWL,EAAYL,QAAmCA,EAAO,WAChH,MACA,IACAM,EAAgByB,YAAc"}
|
@@ -1,48 +1,2 @@
|
|
1
|
-
var
|
2
|
-
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
-
s = arguments[i];
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
-
t[p] = s[p];
|
7
|
-
}
|
8
|
-
return t;
|
9
|
-
};
|
10
|
-
return __assign.apply(this, arguments);
|
11
|
-
};
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
-
var t = {};
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
-
t[p] = s[p];
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
-
t[p[i]] = s[p[i]];
|
20
|
-
}
|
21
|
-
return t;
|
22
|
-
};
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
-
import { createContext, forwardRef } from 'react';
|
25
|
-
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
26
|
-
import { cva } from 'class-variance-authority';
|
27
|
-
import { scalingVariants } from '../../../lib/constants';
|
28
|
-
import { cn } from '../../../lib/utils/utils';
|
29
|
-
var toggleVariants = cva('inline-flex', {
|
30
|
-
variants: {
|
31
|
-
scaling: __assign({}, scalingVariants),
|
32
|
-
},
|
33
|
-
defaultVariants: {
|
34
|
-
scaling: '100%',
|
35
|
-
},
|
36
|
-
});
|
37
|
-
export var ToggleGroupContext = createContext({
|
38
|
-
size: 'medium',
|
39
|
-
color: 'red',
|
40
|
-
appearance: 'surface',
|
41
|
-
});
|
42
|
-
export var ToggleGroupRoot = forwardRef(function (_a, ref) {
|
43
|
-
var className = _a.className, children = _a.children, scaling = _a.scaling, size = _a.size, color = _a.color, appearance = _a.appearance, props = __rest(_a, ["className", "children", "scaling", "size", "color", "appearance"]);
|
44
|
-
var type = __assign({}, props).type;
|
45
|
-
var contextValue = { size: size, color: color, appearance: appearance };
|
46
|
-
return (_jsx(ToggleGroupContext.Provider, { value: contextValue, children: type === 'single' ? (_jsx(ToggleGroupPrimitive.Root, __assign({ className: cn(toggleVariants({ scaling: scaling }), className) }, props, { ref: ref, children: children }))) : (_jsx(ToggleGroupPrimitive.Root, __assign({ className: cn(toggleVariants({ scaling: scaling }), className) }, props, { ref: ref, children: children }))) }));
|
47
|
-
});
|
48
|
-
ToggleGroupRoot.displayName = 'ToggleGroup.Root';
|
1
|
+
import{j as r}from"../../../../_virtual/jsx-runtime.js";import{createContext as e,forwardRef as o}from"react";import{Root as a}from"../../../../node_modules/@radix-ui/react-toggle-group/dist/index.mjs.js";import{cva as t}from"../../../../node_modules/class-variance-authority/dist/index.mjs.js";import{scalingVariants as n}from"../../constants.js";import{cn as i}from"../../utils/utils.js";var s=function(){return s=Object.assign||function(r){for(var e,o=1,a=arguments.length;o<a;o++)for(var t in e=arguments[o])Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r},s.apply(this,arguments)},l=function(r,e){var o={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&e.indexOf(a)<0&&(o[a]=r[a]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(a=Object.getOwnPropertySymbols(r);t<a.length;t++)e.indexOf(a[t])<0&&Object.prototype.propertyIsEnumerable.call(r,a[t])&&(o[a[t]]=r[a[t]])}return o},c=t("inline-flex",{variants:{scaling:s({},n)},defaultVariants:{scaling:"100%"}}),p=e({size:"medium",color:"red",appearance:"surface"}),m=o((function(e,o){var t=e.className,n=e.children,m=e.scaling,u=e.size,f=e.color,d=e.appearance,j=l(e,["className","children","scaling","size","color","appearance"]),g=(s({},j).type,{size:u,color:f,appearance:d});return r.jsx(p.Provider,{value:g,children:r.jsx(a,s({className:i(c({scaling:m}),t)},j,{ref:o,children:n}))})}));m.displayName="ToggleGroup.Root";export{p as ToggleGroupContext,m as ToggleGroupRoot};
|
2
|
+
//# sourceMappingURL=ToggleGroupRoot.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ToggleGroupRoot.js","sources":["../../../../lib/components/ToggleGroup/ToggleGroupRoot.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createContext, forwardRef } from 'react';\nimport * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { cva } from 'class-variance-authority';\nimport { scalingVariants } from '../../../lib/constants';\nimport { cn } from '../../../lib/utils/utils';\nvar toggleVariants = cva('inline-flex', {\n variants: {\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n scaling: '100%',\n },\n});\nexport var ToggleGroupContext = createContext({\n size: 'medium',\n color: 'red',\n appearance: 'surface',\n});\nexport var ToggleGroupRoot = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, scaling = _a.scaling, size = _a.size, color = _a.color, appearance = _a.appearance, props = __rest(_a, [\"className\", \"children\", \"scaling\", \"size\", \"color\", \"appearance\"]);\n var type = __assign({}, props).type;\n var contextValue = { size: size, color: color, appearance: appearance };\n return (_jsx(ToggleGroupContext.Provider, { value: contextValue, children: type === 'single' ? (_jsx(ToggleGroupPrimitive.Root, __assign({ className: cn(toggleVariants({ scaling: scaling }), className) }, props, { ref: ref, children: children }))) : (_jsx(ToggleGroupPrimitive.Root, __assign({ className: cn(toggleVariants({ scaling: scaling }), className) }, props, { ref: ref, children: children }))) }));\n});\nToggleGroupRoot.displayName = 'ToggleGroup.Root';\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","toggleVariants","cva","variants","scaling","scalingVariants","defaultVariants","ToggleGroupContext","createContext","size","color","appearance","ToggleGroupRoot","forwardRef","_a","ref","className","children","props","contextValue","type","_jsx","Provider","value","ToggleGroupPrimitive.Root","cn","displayName"],"mappings":"sYAAA,IAAIA,EAAsC,WAStC,OARAA,EAAWC,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,CACf,EACWH,EAASa,MAAMC,KAAMP,UAChC,EACIQ,EAAkC,SAAUX,EAAGY,GAC/C,IAAIb,EAAI,CAAA,EACR,IAAK,IAAIM,KAAKL,EAAOH,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,IAAMO,EAAEC,QAAQR,GAAK,IAC9EN,EAAEM,GAAKL,EAAEK,IACb,GAAS,MAALL,GAAqD,mBAAjCH,OAAOiB,sBACtB,KAAIb,EAAI,EAAb,IAAgBI,EAAIR,OAAOiB,sBAAsBd,GAAIC,EAAII,EAAED,OAAQH,IAC3DW,EAAEC,QAAQR,EAAEJ,IAAM,GAAKJ,OAAOS,UAAUS,qBAAqBP,KAAKR,EAAGK,EAAEJ,MACvEF,EAAEM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACX,EAOIiB,EAAiBC,EAAI,cAAe,CACpCC,SAAU,CACNC,QAASvB,EAAS,CAAE,EAAEwB,IAE1BC,gBAAiB,CACbF,QAAS,UAGNG,EAAqBC,EAAc,CAC1CC,KAAM,SACNC,MAAO,MACPC,WAAY,YAELC,EAAkBC,GAAW,SAAUC,EAAIC,GAClD,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUb,EAAUU,EAAGV,QAASK,EAAOK,EAAGL,KAAMC,EAAQI,EAAGJ,MAAOC,EAAaG,EAAGH,WAAYO,EAAQtB,EAAOkB,EAAI,CAAC,YAAa,WAAY,UAAW,OAAQ,QAAS,eAE/MK,GADOtC,EAAS,CAAE,EAAEqC,GAAOE,KACZ,CAAEX,KAAMA,EAAMC,MAAOA,EAAOC,WAAYA,IAC3D,OAAQU,MAAKd,EAAmBe,SAAU,CAAEC,MAAOJ,EAAcF,SAA+BI,EAAAA,IAAKG,EAA2B3C,EAAS,CAAEmC,UAAWS,EAAGxB,EAAe,CAAEG,QAASA,IAAYY,IAAcE,EAAO,CAAEH,IAAKA,EAAKE,SAAUA,MAC9O,IACAL,EAAgBc,YAAc"}
|
@@ -1,7 +1,2 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
var ToggleGroup = {
|
4
|
-
Root: ToggleGroupRoot,
|
5
|
-
Item: ToggleGroupItem,
|
6
|
-
};
|
7
|
-
export default ToggleGroup;
|
1
|
+
import{ToggleGroupRoot as o}from"./ToggleGroupRoot.js";import{ToggleGroupItem as r}from"./ToggleGroupItem.js";var t={Root:o,Item:r};export{t as default};
|
2
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../lib/components/ToggleGroup/index.js"],"sourcesContent":["import { ToggleGroupRoot } from './ToggleGroupRoot';\nimport { ToggleGroupItem } from './ToggleGroupItem';\nvar ToggleGroup = {\n Root: ToggleGroupRoot,\n Item: ToggleGroupItem,\n};\nexport default ToggleGroup;\n"],"names":["ToggleGroup","Root","ToggleGroupRoot","Item","ToggleGroupItem"],"mappings":"8GAEG,IAACA,EAAc,CACdC,KAAMC,EACNC,KAAMC"}
|
@@ -1,71 +1,2 @@
|
|
1
|
-
var
|
2
|
-
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
-
s = arguments[i];
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
-
t[p] = s[p];
|
7
|
-
}
|
8
|
-
return t;
|
9
|
-
};
|
10
|
-
return __assign.apply(this, arguments);
|
11
|
-
};
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
-
var t = {};
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
-
t[p] = s[p];
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
-
t[p[i]] = s[p[i]];
|
20
|
-
}
|
21
|
-
return t;
|
22
|
-
};
|
23
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
24
|
-
import React from 'react';
|
25
|
-
import { cva } from 'class-variance-authority';
|
26
|
-
import { cn } from '../../../lib/utils/utils';
|
27
|
-
import { radiusVariants, scalingVariants } from '../../../lib/constants';
|
28
|
-
import { Switch as SwitchTheme, Theme } from '@radix-ui/themes';
|
29
|
-
import { Text } from '../../../lib/Typography/Text';
|
30
|
-
var toggleSwitchVariants = cva('', {
|
31
|
-
variants: {
|
32
|
-
scaling: __assign({}, scalingVariants),
|
33
|
-
radius: __assign({}, radiusVariants['base']),
|
34
|
-
size: {
|
35
|
-
small: 'w-[28px] h-[16px]',
|
36
|
-
medium: 'w-[35px] h-[20px]',
|
37
|
-
large: 'w-[42px] h-[24px]',
|
38
|
-
},
|
39
|
-
},
|
40
|
-
defaultVariants: {
|
41
|
-
radius: 'full',
|
42
|
-
size: 'medium',
|
43
|
-
},
|
44
|
-
});
|
45
|
-
var SwitchLabelVariants = cva('flex items-center justify-start text-slate-12 font-normal dark:text-white', {
|
46
|
-
variants: {
|
47
|
-
size: {
|
48
|
-
small: 'text-xs gap-2',
|
49
|
-
medium: 'text-sm gap-2',
|
50
|
-
large: 'text-base gap-3',
|
51
|
-
},
|
52
|
-
scaling: __assign({}, scalingVariants),
|
53
|
-
},
|
54
|
-
defaultVariants: {
|
55
|
-
size: 'medium',
|
56
|
-
scaling: '100%',
|
57
|
-
},
|
58
|
-
});
|
59
|
-
export var ToggleSwitch = React.forwardRef(function (_a, forwardedRef) {
|
60
|
-
var className = _a.className, _b = _a.color, color = _b === void 0 ? 'red' : _b, scaling = _a.scaling, size = _a.size, _c = _a.appearance, appearance = _c === void 0 ? 'surface' : _c, radius = _a.radius, tabIndex = _a.tabIndex, children = _a.children, switchProps = __rest(_a, ["className", "color", "scaling", "size", "appearance", "radius", "tabIndex", "children"]);
|
61
|
-
if (radius === 'medium' || radius === 'large')
|
62
|
-
radius = 'full';
|
63
|
-
var sizeTheme = '2';
|
64
|
-
if (size === 'small')
|
65
|
-
sizeTheme = '1';
|
66
|
-
if (size === 'large')
|
67
|
-
sizeTheme = '3';
|
68
|
-
return (_jsx(Theme, { className: "flex", accentColor: color, hasBackground: false, children: _jsxs(Text, { as: "label", className: cn('flex items-center', SwitchLabelVariants({ size: size, scaling: scaling })), children: [_jsx(SwitchTheme, __assign({ ref: forwardedRef }, switchProps, { variant: appearance, radius: radius, size: sizeTheme, color: color, className: cn(toggleSwitchVariants({ scaling: scaling, radius: radius, size: size }), className), "aria-label": "Switch" })), children] }) }));
|
69
|
-
});
|
70
|
-
ToggleSwitch.displayName = 'ToggleSwitch';
|
71
|
-
export default ToggleSwitch;
|
1
|
+
import{j as e}from"../../../../_virtual/jsx-runtime.js";import a from"react";import{cva as r}from"../../../../node_modules/class-variance-authority/dist/index.mjs.js";import{cn as s}from"../../utils/utils.js";import{scalingVariants as t,radiusVariants as i}from"../../constants.js";import{Text as l}from"../../Typography/Text/index.js";import{Switch as o}from"../../../../node_modules/@radix-ui/themes/dist/esm/components/switch.js";import{Theme as n}from"../../../../node_modules/@radix-ui/themes/dist/esm/components/theme.js";var m=function(){return m=Object.assign||function(e){for(var a,r=1,s=arguments.length;r<s;r++)for(var t in a=arguments[r])Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t]);return e},m.apply(this,arguments)},c=function(e,a){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&a.indexOf(s)<0&&(r[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(s=Object.getOwnPropertySymbols(e);t<s.length;t++)a.indexOf(s[t])<0&&Object.prototype.propertyIsEnumerable.call(e,s[t])&&(r[s[t]]=e[s[t]])}return r},d=r("",{variants:{scaling:m({},t),radius:m({},i.base),size:{small:"w-[28px] h-[16px]",medium:"w-[35px] h-[20px]",large:"w-[42px] h-[24px]"}},defaultVariants:{radius:"full",size:"medium"}}),p=r("flex items-center justify-start text-slate-12 font-normal dark:text-white",{variants:{size:{small:"text-xs gap-2",medium:"text-sm gap-2",large:"text-base gap-3"},scaling:m({},t)},defaultVariants:{size:"medium",scaling:"100%"}}),u=a.forwardRef((function(a,r){var t=a.className,i=a.color,u=void 0===i?"red":i,f=a.scaling,x=a.size,h=a.appearance,g=void 0===h?"surface":h,j=a.radius;a.tabIndex;var y=a.children,v=c(a,["className","color","scaling","size","appearance","radius","tabIndex","children"]);"medium"!==j&&"large"!==j||(j="full");var b="2";return"small"===x&&(b="1"),"large"===x&&(b="3"),e.jsx(n,{className:"flex",accentColor:u,hasBackground:!1,children:e.jsxs(l,{as:"label",className:s("flex items-center",p({size:x,scaling:f})),children:[e.jsx(o,m({ref:r},v,{variant:g,radius:j,size:b,color:u,className:s(d({scaling:f,radius:j,size:x}),t),"aria-label":"Switch"})),y]})})}));u.displayName="ToggleSwitch";export{u as ToggleSwitch,u as default};
|
2
|
+
//# sourceMappingURL=index.js.map
|