lsp-uikit 1.5.12 → 1.5.13
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.
- package/dist/components/alert/alert.d.ts +1 -1
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/date-range-picker/date-range-picker.d.ts +1 -0
- package/dist/components/date-range-picker/date-range-picker.js +1 -1
- package/package.json +1 -1
|
@@ -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?: "default" | "
|
|
7
|
+
variant?: "default" | "error" | "info" | "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;
|
|
@@ -5,7 +5,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
5
5
|
|
|
6
6
|
declare const badgeVariants: (props?: ({
|
|
7
7
|
size?: "default" | "lg" | "sm" | null | undefined;
|
|
8
|
-
variant?: "
|
|
8
|
+
variant?: "success" | "warning" | "primary" | "primary_ghost" | "primary_outline" | "success_ghost" | "success_outline" | "warning_ghost" | "warning_outline" | "secondary" | "destructive" | "destructive_ghost" | "destructive_outline" | "outline" | null | undefined;
|
|
9
9
|
rounded?: "sm" | "md" | "full" | null | undefined;
|
|
10
10
|
textOverflow?: "default" | "hidden" | null | undefined;
|
|
11
11
|
hovered?: boolean | null | undefined;
|
|
@@ -4,7 +4,7 @@ import { Button as Button$1 } from '@base-ui/react/button';
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
6
|
declare const buttonVariants: (props?: ({
|
|
7
|
-
variant?: "default" | "
|
|
7
|
+
variant?: "default" | "warning" | "secondary" | "destructive" | "outline" | "link" | "default_invert" | "destructive_invert" | "warning_invert" | "ghost" | "clear" | null | undefined;
|
|
8
8
|
size?: "default" | "lg" | "sm" | "icon" | "icon-lg" | "icon-sm" | "icon-xl" | "icon-xs" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
interface ButtonProps extends Button$1.Props, VariantProps<typeof buttonVariants> {
|
|
@@ -13,6 +13,7 @@ type Props = {
|
|
|
13
13
|
onApply: (datesRange: DatesStringRange | undefined) => void;
|
|
14
14
|
render?: Popover.Trigger.Props['render'];
|
|
15
15
|
triggerClassName?: string;
|
|
16
|
+
align?: 'center' | 'start' | 'end';
|
|
16
17
|
onChange?: (datesRange: DatesStringRange | undefined) => void;
|
|
17
18
|
} & DayPickerProps;
|
|
18
19
|
declare const DateRangePicker: FC<Props>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{format as r,subDays as t}from"date-fns";import{useState as n,useEffect as a}from"react";import{LuCalendarFold as i}from"react-icons/lu";import{cn as d}from"../../lib/utils/cn.js";import{Button as l}from"../button/button.js";import{Calendar as s}from"../calendar/calendar.js";import{Popover as m,PopoverTrigger as c,PopoverContent as y}from"../popover/popover.js";const f=f=>{const{className:M,datesRange:p,withDatesMacroses:h,triggerClassName:u,render:v,onApply:w,onChange:
|
|
2
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{format as r,subDays as t}from"date-fns";import{useState as n,useEffect as a}from"react";import{LuCalendarFold as i}from"react-icons/lu";import{cn as d}from"../../lib/utils/cn.js";import{Button as l}from"../button/button.js";import{Calendar as s}from"../calendar/calendar.js";import{Popover as m,PopoverTrigger as c,PopoverContent as y}from"../popover/popover.js";const f=f=>{const{className:M,datesRange:p,withDatesMacroses:h,triggerClassName:u,render:v,align:g="start",onApply:w,onChange:N,...x}=f,[C,k]=n(!1),[j,b]=n();a(()=>{b({from:p?.from?new Date(p?.from):void 0,to:p?.to?new Date(p?.to):void 0})},[p]);const z=e=>{const o=new Date;let n=new Date(o);"week"===e&&(n=t(o,6)),"month"===e&&(n=t(o,30)),"year"===e&&(n=t(o,365)),w({from:r(n,"yyyy-MM-dd"),to:r(o,"yyyy-MM-dd")}),k(!1)};return e("div",{className:d("grid gap-2",M),children:o(m,{open:C,onOpenChange:k,children:[o(c,{render:v??e(l,{id:"date",variant:"secondary",className:d("justify-start text-left font-normal",!p&&"text-muted-foreground",u)}),children:[e(i,{}),j?.from?j.to?`${r(j.from,"dd MMM yyyy")} - ${r(j.to,"dd MMM yyyy")}`:r(j.from,"dd MMM yyyy"):"Укажите даты"]}),e(y,{className:"w-fit p-0",align:g,children:o("div",{className:"flex w-full flex-col",children:[h&&o("div",{className:"flex w-full items-center gap-2 p-3",children:[e(l,{size:"sm",variant:"secondary",onClick:()=>z("week"),children:"7 дней"}),e(l,{size:"sm",variant:"secondary",onClick:()=>z("month"),children:"30 дней"}),e(l,{size:"sm",variant:"secondary",onClick:()=>z("year"),children:"Год"})]}),e(s,{...x,mode:"range",defaultMonth:j?.from,selected:j,onSelect:e=>{if(!e?.from||!e?.to)return b(void 0),void N?.(void 0);b(e),N?.({from:r(e.from,"yyyy-MM-dd"),to:r(e.to,"yyyy-MM-dd")})},numberOfMonths:2}),o("div",{className:"flex w-full gap-3 p-3",children:[e(l,{className:"w-full",onClick:()=>{w(void 0),k(!1)},variant:"outline",size:"sm",children:"Сбросить период"}),e(l,{variant:"default_invert",disabled:!j?.from||!j.to,className:"w-full",onClick:()=>{w({from:r(j.from,"yyyy-MM-dd"),to:r(j.to,"yyyy-MM-dd")}),k(!1)},size:"sm",children:"Применить"})]})]})})]})})};export{f as DateRangePicker};
|