lsp-uikit 1.4.17 → 1.4.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ import { VariantProps } from 'class-variance-authority';
4
4
  import * as React from 'react';
5
5
 
6
6
  declare const alertVariants: (props?: ({
7
- variant?: "success" | "destructive" | "default" | "warning" | null | undefined;
7
+ variant?: "default" | "destructive" | "success" | "warning" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  declare function Alert({ className, variant, hideDefaultIcon, children, ...props }: React.ComponentProps<'div'> & VariantProps<typeof alertVariants> & {
10
10
  hideDefaultIcon?: boolean;
@@ -4,7 +4,7 @@ import { VariantProps } from 'class-variance-authority';
4
4
  import * as React from 'react';
5
5
 
6
6
  declare const badgeVariants: (props?: ({
7
- variant?: "primary" | "primary_ghost" | "primary_outline" | "success" | "success_ghost" | "success_outline" | "purple" | "purple_ghost" | "purple_outline" | "secondary" | "destructive" | "destructive_ghost" | "destructive_outline" | "outline" | null | undefined;
7
+ variant?: "destructive" | "outline" | "secondary" | "primary" | "primary_ghost" | "primary_outline" | "success" | "success_ghost" | "success_outline" | "purple" | "purple_ghost" | "purple_outline" | "destructive_ghost" | "destructive_outline" | null | undefined;
8
8
  rounded?: "sm" | "md" | "full" | null | undefined;
9
9
  textOverflow?: "default" | "hidden" | null | undefined;
10
10
  hover?: boolean | null | undefined;
@@ -4,8 +4,8 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const buttonVariants: (props?: ({
7
- variant?: "secondary" | "destructive" | "outline" | "default" | "default_invert" | "destructive_invert" | "ghost" | "link" | "clear" | null | undefined;
8
- size?: "sm" | "default" | "lg" | "icon" | null | undefined;
7
+ variant?: "default" | "default_invert" | "destructive" | "destructive_invert" | "outline" | "secondary" | "ghost" | "link" | "clear" | null | undefined;
8
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  interface ButtonProps extends React.ComponentProps<'button'>, VariantProps<typeof buttonVariants> {
11
11
  asChild?: boolean;
@@ -1,4 +1,5 @@
1
1
  import { FC } from 'react';
2
+ import { DayPicker } from 'react-day-picker';
2
3
 
3
4
  interface DatesStringRange {
4
5
  from?: string;
@@ -10,7 +11,7 @@ type Props = {
10
11
  onApply: (datesRange: DatesStringRange | undefined) => void;
11
12
  triggerClassName?: string;
12
13
  className?: string;
13
- };
14
+ } & React.ComponentProps<typeof DayPicker>;
14
15
  declare const DateRangePicker: FC<Props>;
15
16
 
16
17
  export { DateRangePicker };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as o,Fragment as r}from"react/jsx-runtime";import{format as t,subDays as a}from"date-fns";import{CalendarIcon as n}from"lucide-react";import{useState as l,useEffect as i}from"react";import{cn as d}from"../../lib/utils/cn.js";import{Button as s}from"../button/button.js";import{Calendar as c}from"../calendar/calendar.js";import{Popover as m,PopoverTrigger as f,PopoverContent as y}from"../popover/popover.js";const p=p=>{const{className:h,datesRange:u,withDatesMacroses:v,triggerClassName:w,onApply:g}=p,[M,N]=l(!1),[L,x]=l();i(()=>{x({from:u?.from?new Date(u?.from):void 0,to:u?.to?new Date(u?.to):void 0})},[u]);const C=e=>{const o=new Date;let r=new Date(o);"week"===e&&(r=a(o,6)),"month"===e&&(r=a(o,30)),"year"===e&&(r=a(o,365)),g({from:t(r,"yyyy-MM-dd"),to:t(o,"yyyy-MM-dd")}),N(!1)};return e("div",{className:d("grid gap-2",h),children:o(m,{open:M,onOpenChange:N,children:[e(f,{asChild:!0,children:o(s,{id:"date",variant:"outline",className:d("justify-start text-left font-normal",!u&&"text-muted-foreground",w),children:[e(n,{}),L?.from?L.to?o(r,{children:[t(L.from,"LLL dd, y")," -"," ",t(L.to,"LLL dd, y")]}):t(L.from,"LLL dd, y"):e("span",{children:"Укажите даты"})]})}),e(y,{className:"w-fit p-0",align:"start",children:o("div",{className:"flex w-full flex-col",children:[v&&o("div",{className:"flex w-full items-center gap-2 p-3",children:[e(s,{variant:"secondary",onClick:()=>C("week"),children:"7 дней"}),e(s,{variant:"secondary",onClick:()=>C("month"),children:"30 дней"}),e(s,{variant:"secondary",onClick:()=>C("year"),children:"Год"})]}),e(c,{autoFocus:!0,mode:"range",defaultMonth:L?.from,selected:L,onSelect:x,numberOfMonths:2}),o("div",{className:"flex w-full gap-3 p-3",children:[e(s,{className:"w-full",onClick:()=>{g(void 0),N(!1)},variant:"outline",size:"sm",children:"Сбросить период"}),e(s,{disabled:!L?.from||!L.to,className:"w-full",onClick:()=>{g({from:t(L.from,"yyyy-MM-dd"),to:t(L.to,"yyyy-MM-dd")}),N(!1)},size:"sm",children:"Применить"})]})]})})]})})};export{p as DateRangePicker};
2
+ import{jsx as e,jsxs as o,Fragment as r}from"react/jsx-runtime";import{format as t,subDays as a}from"date-fns";import{CalendarIcon as n}from"lucide-react";import{useState as l,useEffect as i}from"react";import{cn as d}from"../../lib/utils/cn.js";import{Button as s}from"../button/button.js";import{Calendar as c}from"../calendar/calendar.js";import{Popover as m,PopoverTrigger as f,PopoverContent as y}from"../popover/popover.js";const p=p=>{const{className:h,datesRange:u,withDatesMacroses:v,triggerClassName:w,onApply:g,...M}=p,[N,L]=l(!1),[x,C]=l();i(()=>{C({from:u?.from?new Date(u?.from):void 0,to:u?.to?new Date(u?.to):void 0})},[u]);const k=e=>{const o=new Date;let r=new Date(o);"week"===e&&(r=a(o,6)),"month"===e&&(r=a(o,30)),"year"===e&&(r=a(o,365)),g({from:t(r,"yyyy-MM-dd"),to:t(o,"yyyy-MM-dd")}),L(!1)};return e("div",{className:d("grid gap-2",h),children:o(m,{open:N,onOpenChange:L,children:[e(f,{asChild:!0,children:o(s,{id:"date",variant:"outline",className:d("justify-start text-left font-normal",!u&&"text-muted-foreground",w),children:[e(n,{}),x?.from?x.to?o(r,{children:[t(x.from,"LLL dd, y")," -"," ",t(x.to,"LLL dd, y")]}):t(x.from,"LLL dd, y"):e("span",{children:"Укажите даты"})]})}),e(y,{className:"w-fit p-0",align:"start",children:o("div",{className:"flex w-full flex-col",children:[v&&o("div",{className:"flex w-full items-center gap-2 p-3",children:[e(s,{variant:"secondary",onClick:()=>k("week"),children:"7 дней"}),e(s,{variant:"secondary",onClick:()=>k("month"),children:"30 дней"}),e(s,{variant:"secondary",onClick:()=>k("year"),children:"Год"})]}),e(c,{...M,autoFocus:!0,mode:"range",defaultMonth:x?.from,selected:x,onSelect:C,numberOfMonths:2}),o("div",{className:"flex w-full gap-3 p-3",children:[e(s,{className:"w-full",onClick:()=>{g(void 0),L(!1)},variant:"outline",size:"sm",children:"Сбросить период"}),e(s,{disabled:!x?.from||!x.to,className:"w-full",onClick:()=>{g({from:t(x.from,"yyyy-MM-dd"),to:t(x.to,"yyyy-MM-dd")}),L(!1)},size:"sm",children:"Применить"})]})]})})]})})};export{p as DateRangePicker};
@@ -46,8 +46,8 @@ declare function SidebarGroupContent({ className, ...props }: React.ComponentPro
46
46
  declare function SidebarMenu({ className, ...props }: React.ComponentProps<'ul'>): react_jsx_runtime.JSX.Element;
47
47
  declare function SidebarMenuItem({ className, ...props }: React.ComponentProps<'li'>): react_jsx_runtime.JSX.Element;
48
48
  declare const sidebarMenuButtonVariants: (props?: ({
49
- variant?: "outline" | "default" | null | undefined;
50
- size?: "sm" | "default" | "lg" | null | undefined;
49
+ variant?: "default" | "outline" | null | undefined;
50
+ size?: "default" | "sm" | "lg" | null | undefined;
51
51
  } & class_variance_authority_types.ClassProp) | undefined) => string;
52
52
  declare function SidebarMenuButton({ asChild, isActive, variant, size, tooltip, className, ...props }: React.ComponentProps<'button'> & {
53
53
  asChild?: boolean;
@@ -5,8 +5,8 @@ import { VariantProps } from 'class-variance-authority';
5
5
  import * as React from 'react';
6
6
 
7
7
  declare const toggleVariants: (props?: ({
8
- variant?: "outline" | "default" | null | undefined;
9
- size?: "sm" | "default" | "lg" | null | undefined;
8
+ variant?: "default" | "outline" | null | undefined;
9
+ size?: "default" | "sm" | "lg" | null | undefined;
10
10
  } & class_variance_authority_types.ClassProp) | undefined) => string;
11
11
  declare function Toggle({ className, variant, size, ...props }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>): react_jsx_runtime.JSX.Element;
12
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lsp-uikit",
3
- "version": "1.4.17",
3
+ "version": "1.4.18",
4
4
  "description": "LevelSkill.Pro UI components based on ShadCN and Tailwind CSS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",