@cognite/aura 0.3.3 → 0.3.4
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/index.d.ts +3 -1
- package/dist/components/index.js +31 -30
- package/dist/components/ui/core/{date-time-pickers/shared/calendar-header → calendar}/calendar-header.js +4 -4
- package/dist/components/ui/core/{date-time-pickers/shared/calendar → calendar}/calendar.js +13 -13
- package/dist/components/ui/core/calendar/constants.d.ts +1 -0
- package/dist/components/ui/core/data-grid/data-grid-cell.d.ts +10 -0
- package/dist/components/ui/core/data-grid/data-grid-header-row.d.ts +13 -0
- package/dist/components/ui/core/data-grid/data-grid-row.d.ts +18 -0
- package/dist/components/ui/core/data-grid/data-grid.d.ts +43 -0
- package/dist/components/ui/core/data-grid/data-grid.fixtures.d.ts +12 -0
- package/dist/components/ui/core/data-grid/data-grid.utils.d.ts +9 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +1 -1
- package/dist/components/ui/core/date-time-pickers/date-picker/types.d.ts +2 -1
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +1 -1
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +2 -1
- package/dist/components/ui/core/date-time-pickers/date-time-picker/index.d.ts +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/types.d.ts +36 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +1 -1
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +7 -6
- package/dist/components/ui/core/date-time-pickers/index.d.ts +3 -1
- package/dist/components/ui/core/date-time-pickers/index.js +6 -5
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.d.ts +3 -2
- package/dist/components/ui/core/date-time-pickers/shared/constants.d.ts +3 -8
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.d.ts +3 -2
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.d.ts +3 -2
- package/dist/components/ui/core/date-time-pickers/time-picker/types.d.ts +5 -4
- package/dist/components/ui/core/date-time-pickers/time-range-picker/index.d.ts +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/types.d.ts +40 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/utils/format-utils.d.ts +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.d.ts +3 -3
- package/dist/components/ui/core/overflow-list/overflow-list.utils.d.ts +52 -0
- package/dist/components/ui/core/slider/slider.d.ts +9 -0
- package/dist/components/ui/core/slider/slider.js +40 -0
- package/dist/index.d.ts +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.source.css +3 -0
- package/package.json +20 -2
- /package/dist/components/ui/core/{date-time-pickers/shared/calendar-header → calendar}/calendar-header.d.ts +0 -0
- /package/dist/components/ui/core/{date-time-pickers/utils → calendar}/calendar-utils.d.ts +0 -0
- /package/dist/components/ui/core/{date-time-pickers/utils → calendar}/calendar-utils.js +0 -0
- /package/dist/components/ui/core/{date-time-pickers/shared/calendar → calendar}/calendar.d.ts +0 -0
|
@@ -19,12 +19,14 @@ export { RadioGroup, RadioGroupItem, RadioGroupItemControl, RadioGroupItemDescri
|
|
|
19
19
|
export { Badge, badgeVariants } from './ui/core/badge/badge';
|
|
20
20
|
export { Banner, BannerAction, BannerActions, BannerClose, BannerIcon, BannerStatus, BannerTitle, } from './ui/core/banner/banner';
|
|
21
21
|
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbEllipsisButton, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbPageButton, BreadcrumbSeparator, } from './ui/core/breadcrumb/breadcrumb';
|
|
22
|
+
export { type CollapseStrategy } from './ui/core/overflow-list/overflow-list.utils';
|
|
22
23
|
export { Topbar, TopbarAction, TopbarBreadcrumbs, TopbarCenter, TopbarIcon, TopbarLeft, TopbarMetadata, TopbarRight, TopbarThemeSwitcher, type TopbarTheme, } from './ui/core/topbar/topbar';
|
|
23
24
|
export { Collapsible, CollapsibleContent, CollapsibleTrigger, } from './ui/core/collapsible/collapsible';
|
|
24
25
|
export { HoverCard, HoverCardTrigger, HoverCardContent, } from './ui/core/hover-card/hover-card';
|
|
25
26
|
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, } from './ui/core/select/select';
|
|
26
27
|
export { SegmentedControl, SegmentedControlButton, SegmentedControlContent, SegmentedControlList, segmentedControlButtonVariants, segmentedControlListVariants, } from './ui/core/segmented-control/segmented-control';
|
|
27
28
|
export { Skeleton } from './ui/core/skeleton/skeleton';
|
|
29
|
+
export { Slider } from './ui/core/slider/slider';
|
|
28
30
|
export { Switch } from './ui/core/switch/switch';
|
|
29
31
|
export { Toaster, toast } from './ui/core/sonner-toast/sonner-toast';
|
|
30
32
|
export { Combobox } from './ui/core/combobox/combobox';
|
|
@@ -50,6 +52,6 @@ export { Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverHeade
|
|
|
50
52
|
export { Pagination, PaginationContent, PaginationEllipsis, PaginationFirst, PaginationItem, PaginationLast, PaginationLink, PaginationNext, PaginationPrevious, PaginationResultsPerPage, PaginationResultsPerPageLabel, PaginationSelectTrigger, PaginationStatus, PaginationTeleport, } from './ui/core/pagination/pagination';
|
|
51
53
|
export { Sources, SourcesTitle, Source } from './ui/core/sources/sources';
|
|
52
54
|
export { DatePicker, DateRangePicker, DateTimeRangePicker, TimePicker, } from './ui/core/date-time-pickers';
|
|
53
|
-
export type { DatePickerProps, DateRangePickerProps, DateTimeRangePickerProps, ShortcutItem, TimeFormat, TimePickerProps, } from './ui/core/date-time-pickers';
|
|
55
|
+
export type { AmPm, DatePickerProps, DateRangePickerProps, DateTimeRangePickerProps, ShortcutItem, TimeFormat, TimePickerProps, } from './ui/core/date-time-pickers';
|
|
54
56
|
export { PortalContainerContext } from '../lib/portal-container-context';
|
|
55
57
|
export type { ComponentMeta, ComponentStatusType } from '../lib/types';
|
package/dist/components/index.js
CHANGED
|
@@ -26,33 +26,34 @@ import { HoverCard as nt, HoverCardContent as rt, HoverCardTrigger as it } from
|
|
|
26
26
|
import { Select as at, SelectContent as ot, SelectGroup as st, SelectItem as ct, SelectLabel as lt, SelectScrollDownButton as ut, SelectScrollUpButton as dt, SelectSeparator as ft, SelectTrigger as pt, SelectValue as mt } from "./ui/core/select/select.js";
|
|
27
27
|
import { SegmentedControl as ht, SegmentedControlButton as gt, SegmentedControlContent as _t, SegmentedControlList as vt, segmentedControlButtonVariants as yt, segmentedControlListVariants as bt } from "./ui/core/segmented-control/segmented-control.js";
|
|
28
28
|
import { Skeleton as xt } from "./ui/core/skeleton/skeleton.js";
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
|
|
29
|
+
import { Slider as St } from "./ui/core/slider/slider.js";
|
|
30
|
+
import { Switch as Ct } from "./ui/core/switch/switch.js";
|
|
31
|
+
import { Toaster as wt, toast as Tt } from "./ui/core/sonner-toast/sonner-toast.js";
|
|
32
|
+
import { Dialog as Et, DialogClose as Dt, DialogContent as Ot, DialogDescription as kt, DialogFooter as At, DialogHeader as jt, DialogOverlay as Mt, DialogPortal as Nt, DialogTitle as Pt, DialogTrigger as Ft } from "./ui/core/dialog/dialog.js";
|
|
33
|
+
import { Command as It, CommandDialog as Lt, CommandEmpty as Rt, CommandGroup as zt, CommandInput as Bt, CommandItem as Vt, CommandList as Ht, CommandSeparator as Ut, CommandShortcut as Wt } from "./ui/core/command/command.js";
|
|
34
|
+
import { Popover as Gt, PopoverClose as Kt, PopoverContent as qt, PopoverDescription as Jt, PopoverHeader as Yt, PopoverHeaderContent as Xt, PopoverSlot as Zt, PopoverTitle as Qt, PopoverTrigger as $t } from "./ui/core/popover/popover.js";
|
|
35
|
+
import { Combobox as en } from "./ui/core/combobox/combobox.js";
|
|
36
|
+
import { Input as tn } from "./ui/core/input/input.js";
|
|
37
|
+
import { Kbd as nn, KbdGroup as rn } from "./ui/core/kbd/kbd.js";
|
|
38
|
+
import { Progress as an } from "./ui/core/progress/progress.js";
|
|
39
|
+
import { Textarea as on } from "./ui/core/textarea/textarea.js";
|
|
40
|
+
import { Tabs as sn, TabsLabel as cn, TabsList as ln, TabsPanel as un, TabsTrigger as dn, tabsListVariants as fn, tabsTriggerVariants as pn } from "./ui/core/tabs/tabs.js";
|
|
41
|
+
import { Toggle as mn, toggleVariants as hn } from "./ui/core/toggle/toggle.js";
|
|
42
|
+
import { InputGroup as gn, InputGroupAddon as _n, InputGroupButton as vn, InputGroupInput as yn, InputGroupText as bn, InputGroupTextarea as xn } from "./ui/core/input-group/input-group.js";
|
|
43
|
+
import { Alert as Sn, AlertActions as Cn, AlertButton as wn, AlertClose as Tn, AlertDescription as En, AlertTitle as Dn } from "./ui/core/alert/alert.js";
|
|
44
|
+
import { EmptyState as On, EmptyStateActions as kn, EmptyStateDescription as An, EmptyStateIcon as jn, EmptyStateTitle as Mn } from "./ui/core/empty-state/empty-state.js";
|
|
45
|
+
import { Message as Nn, MessageAction as Pn, MessageActions as Fn, MessageContent as In, MessageResponse as Ln } from "./ui/core/message/message.js";
|
|
46
|
+
import { PromptInput as Rn, PromptInputActionMenu as zn, PromptInputActionMenuContent as Bn, PromptInputActionMenuItem as Vn, PromptInputActionMenuTrigger as Hn, PromptInputBody as Un, PromptInputButton as Wn, PromptInputCommand as Gn, PromptInputCommandEmpty as Kn, PromptInputCommandGroup as qn, PromptInputCommandInput as Jn, PromptInputCommandItem as Yn, PromptInputCommandList as Xn, PromptInputCommandSeparator as Zn, PromptInputFooter as Qn, PromptInputHeader as $n, PromptInputHoverCard as er, PromptInputHoverCardContent as tr, PromptInputHoverCardTrigger as nr, PromptInputModelSelect as rr, PromptInputModelSelectContent as ir, PromptInputModelSelectItem as ar, PromptInputModelSelectTrigger as or, PromptInputModelSelectValue as sr, PromptInputProvider as cr, PromptInputSubmit as lr, PromptInputTab as ur, PromptInputTabBody as dr, PromptInputTabItem as fr, PromptInputTabLabel as pr, PromptInputTabsList as mr, PromptInputTextarea as hr, PromptInputTools as gr, usePromptInputController as _r } from "./ui/core/prompt-input/prompt-input.js";
|
|
47
|
+
import { Count as vr, countVariants as yr } from "./ui/core/count/count.js";
|
|
48
|
+
import { InlineCitation as br, InlineCitationCard as xr, InlineCitationCardBody as Sr, InlineCitationCardTrigger as Cr, InlineCitationGroup as wr, InlineCitationLink as Tr, InlineCitationQuote as Er, InlineCitationSource as Dr, InlineCitationText as Or } from "./ui/core/inline-citation/inline-citation.js";
|
|
49
|
+
import { Reasoning as kr, ReasoningContent as Ar, ReasoningHeader as jr, ReasoningItem as Mr } from "./ui/core/reasoning/reasoning.js";
|
|
50
|
+
import { ScrollArea as Nr, ScrollBar as Pr } from "./ui/core/scroll-area/scroll-area.js";
|
|
51
|
+
import { Search as Fr } from "./ui/core/search/search.js";
|
|
52
|
+
import { PaginationTeleport as Ir } from "./ui/core/pagination/pagination-teleport.js";
|
|
53
|
+
import { Pagination as Lr, PaginationContent as Rr, PaginationEllipsis as zr, PaginationFirst as Br, PaginationItem as Vr, PaginationLast as Hr, PaginationLink as Ur, PaginationNext as Wr, PaginationPrevious as Gr, PaginationResultsPerPage as Kr, PaginationResultsPerPageLabel as qr, PaginationSelectTrigger as Jr, PaginationStatus as Yr } from "./ui/core/pagination/pagination.js";
|
|
54
|
+
import { Source as Xr, Sources as Zr, SourcesTitle as Qr } from "./ui/core/sources/sources.js";
|
|
55
|
+
import { DatePicker as $r } from "./ui/core/date-time-pickers/date-picker/date-picker.js";
|
|
56
|
+
import { TimePicker as ei } from "./ui/core/date-time-pickers/time-picker/time-picker.js";
|
|
57
|
+
import { DateRangePicker as ti } from "./ui/core/date-time-pickers/date-range-picker/date-range-picker.js";
|
|
58
|
+
import { DateTimeRangePicker as ni } from "./ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js";
|
|
59
|
+
export { e as Accordion, t as AccordionContent, n as AccordionItem, r as AccordionTrigger, d as ActionToolbar, f as ActionToolbarAction, p as ActionToolbarActionClear, m as ActionToolbarActions, h as ActionToolbarPrimaryAction, g as ActionToolbarSelection, _ as ActionToolbarSelectionSummary, Sn as Alert, Cn as AlertActions, wn as AlertButton, Tn as AlertClose, En as AlertDescription, Dn as AlertTitle, Q as Avatar, $ as AvatarFallback, ee as AvatarIcon, te as AvatarImage, ge as Badge, je as Banner, Me as BannerAction, Ne as BannerActions, Pe as BannerClose, Fe as BannerIcon, Ie as BannerStatus, Le as BannerTitle, Re as Breadcrumb, ze as BreadcrumbEllipsis, Be as BreadcrumbEllipsisButton, Ve as BreadcrumbItem, He as BreadcrumbLink, Ue as BreadcrumbList, We as BreadcrumbPage, Ge as BreadcrumbPageButton, Ke as BreadcrumbSeparator, i as Button, J as ButtonGroup, Y as ButtonGroupSeparator, X as ButtonGroupText, F as Card, I as CardActions, L as CardContent, R as CardDescription, z as CardFooter, B as CardFooterEnd, V as CardFooterStart, H as CardHeader, U as CardHeaderCenter, W as CardHeaderEnd, G as CardHeaderStart, K as CardTitle, re as CheckboxGroup, ie as CheckboxItem, ae as CheckboxItemControl, oe as CheckboxItemDescription, se as CheckboxItemLabel, ce as CheckboxMetadata, fe as CodeBlock, pe as CodeBlockCollapseButton, me as CodeBlockCopyButton, he as CodeBlockDownloadButton, ve as Collapsible, ye as CollapsibleContent, be as CollapsibleTrigger, en as Combobox, It as Command, Lt as CommandDialog, Rt as CommandEmpty, zt as CommandGroup, Bt as CommandInput, Vt as CommandItem, Ht as CommandList, Ut as CommandSeparator, Wt as CommandShortcut, vr as Count, $r as DatePicker, ti as DateRangePicker, ni as DateTimeRangePicker, Et as Dialog, Dt as DialogClose, Ot as DialogContent, kt as DialogDescription, At as DialogFooter, jt as DialogHeader, Mt as DialogOverlay, Nt as DialogPortal, Pt as DialogTitle, Ft as DialogTrigger, v as DropdownMenu, y as DropdownMenuCheckboxItem, b as DropdownMenuContent, x as DropdownMenuGroup, S as DropdownMenuHeader, C as DropdownMenuItem, w as DropdownMenuLabel, T as DropdownMenuPortal, E as DropdownMenuRadioGroup, D as DropdownMenuRadioItem, O as DropdownMenuSectionLabel, k as DropdownMenuSeparator, A as DropdownMenuShortcut, j as DropdownMenuSub, M as DropdownMenuSubContent, N as DropdownMenuSubTrigger, P as DropdownMenuTrigger, On as EmptyState, kn as EmptyStateActions, An as EmptyStateDescription, jn as EmptyStateIcon, Mn as EmptyStateTitle, le as HelperText, nt as HoverCard, rt as HoverCardContent, it as HoverCardTrigger, br as InlineCitation, xr as InlineCitationCard, Sr as InlineCitationCardBody, Cr as InlineCitationCardTrigger, wr as InlineCitationGroup, Tr as InlineCitationLink, Er as InlineCitationQuote, Dr as InlineCitationSource, Or as InlineCitationText, tn as Input, gn as InputGroup, _n as InputGroupAddon, vn as InputGroupButton, yn as InputGroupInput, bn as InputGroupText, xn as InputGroupTextarea, nn as Kbd, rn as KbdGroup, ne as Label, ue as Loader, Nn as Message, Pn as MessageAction, Fn as MessageActions, In as MessageContent, Ln as MessageResponse, Lr as Pagination, Rr as PaginationContent, zr as PaginationEllipsis, Br as PaginationFirst, Vr as PaginationItem, Hr as PaginationLast, Ur as PaginationLink, Wr as PaginationNext, Gr as PaginationPrevious, Kr as PaginationResultsPerPage, qr as PaginationResultsPerPageLabel, Jr as PaginationSelectTrigger, Yr as PaginationStatus, Ir as PaginationTeleport, Gt as Popover, Kt as PopoverClose, qt as PopoverContent, Jt as PopoverDescription, Yt as PopoverHeader, Xt as PopoverHeaderContent, Zt as PopoverSlot, Qt as PopoverTitle, $t as PopoverTrigger, o as PortalContainerContext, an as Progress, Rn as PromptInput, zn as PromptInputActionMenu, Bn as PromptInputActionMenuContent, Vn as PromptInputActionMenuItem, Hn as PromptInputActionMenuTrigger, Un as PromptInputBody, Wn as PromptInputButton, Gn as PromptInputCommand, Kn as PromptInputCommandEmpty, qn as PromptInputCommandGroup, Jn as PromptInputCommandInput, Yn as PromptInputCommandItem, Xn as PromptInputCommandList, Zn as PromptInputCommandSeparator, Qn as PromptInputFooter, $n as PromptInputHeader, er as PromptInputHoverCard, tr as PromptInputHoverCardContent, nr as PromptInputHoverCardTrigger, rr as PromptInputModelSelect, ir as PromptInputModelSelectContent, ar as PromptInputModelSelectItem, or as PromptInputModelSelectTrigger, sr as PromptInputModelSelectValue, cr as PromptInputProvider, lr as PromptInputSubmit, ur as PromptInputTab, dr as PromptInputTabBody, fr as PromptInputTabItem, pr as PromptInputTabLabel, mr as PromptInputTabsList, hr as PromptInputTextarea, gr as PromptInputTools, Ee as RadioGroup, De as RadioGroupItem, Oe as RadioGroupItemControl, ke as RadioGroupItemDescription, Ae as RadioGroupItemLabel, kr as Reasoning, Ar as ReasoningContent, jr as ReasoningHeader, Mr as ReasoningItem, Nr as ScrollArea, Pr as ScrollBar, Fr as Search, ht as SegmentedControl, gt as SegmentedControlButton, _t as SegmentedControlContent, vt as SegmentedControlList, at as Select, ot as SelectContent, st as SelectGroup, ct as SelectItem, lt as SelectLabel, ut as SelectScrollDownButton, dt as SelectScrollUpButton, ft as SelectSeparator, pt as SelectTrigger, mt as SelectValue, q as Separator, de as Shimmer, xt as Skeleton, St as Slider, Xr as Source, Zr as Sources, Qr as SourcesTitle, Ct as Switch, sn as Tabs, cn as TabsLabel, ln as TabsList, un as TabsPanel, dn as TabsTrigger, on as Textarea, ei as TimePicker, wt as Toaster, mn as Toggle, xe as Tool, Se as ToolContent, Ce as ToolHeader, we as ToolInput, Te as ToolOutput, s as Tooltip, c as TooltipContent, l as TooltipProvider, u as TooltipTrigger, qe as Topbar, Je as TopbarAction, Ye as TopbarBreadcrumbs, Xe as TopbarCenter, Ze as TopbarIcon, Qe as TopbarLeft, $e as TopbarMetadata, et as TopbarRight, tt as TopbarThemeSwitcher, _e as badgeVariants, Z as buttonGroupVariants, a as buttonVariants, yr as countVariants, yt as segmentedControlButtonVariants, bt as segmentedControlListVariants, fn as tabsListVariants, pn as tabsTriggerVariants, Tt as toast, hn as toggleVariants, _r as usePromptInputController };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { cn as e } from "
|
|
2
|
-
import { Button as t } from "
|
|
3
|
-
import { DropdownMenu as n, DropdownMenuContent as r, DropdownMenuItem as i, DropdownMenuTrigger as a } from "
|
|
1
|
+
import { cn as e } from "../../../../lib/utils.js";
|
|
2
|
+
import { Button as t } from "../button/button.js";
|
|
3
|
+
import { DropdownMenu as n, DropdownMenuContent as r, DropdownMenuItem as i, DropdownMenuTrigger as a } from "../dropdown-menu/dropdown-menu.js";
|
|
4
4
|
import { IconChevronDown as o, IconChevronLeft as s, IconChevronRight as c } from "@tabler/icons-react";
|
|
5
5
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
6
|
import d from "dayjs";
|
|
7
|
-
//#region libs/aura/src/components/ui/core/
|
|
7
|
+
//#region libs/aura/src/components/ui/core/calendar/calendar-header.tsx
|
|
8
8
|
var f = Array.from({ length: 12 }, (e, t) => d().month(t).format("MMMM")), p = d().year() - 50, m = d().year() + 10, h = Array.from({ length: m - p + 1 }, (e, t) => p + t), g = ({ label: e, items: s, onSelect: c }) => /* @__PURE__ */ u(n, {
|
|
9
9
|
modal: !1,
|
|
10
10
|
children: [/* @__PURE__ */ l(a, { render: /* @__PURE__ */ u(t, {
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { cn as e } from "
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { cn as e } from "../../../../lib/utils.js";
|
|
2
|
+
import { CalendarHeader as t } from "./calendar-header.js";
|
|
3
|
+
import { getCalendarDays as n, getWeekNumbers as r, getWeekdayNames as i, isDateInRange as a, isOutsideMonth as o, isSameDay as s, isToday as c } from "./calendar-utils.js";
|
|
4
4
|
import l from "react";
|
|
5
5
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
6
|
-
//#region libs/aura/src/components/ui/core/
|
|
6
|
+
//#region libs/aura/src/components/ui/core/calendar/calendar.tsx
|
|
7
7
|
function f({ isOutsideMonth: t, isSelected: n, isToday: r, isRangeStart: i, isRangeEnd: a, isInRange: o, isInHoverRange: s }) {
|
|
8
8
|
return e("w-9 h-9 flex items-center justify-center text-sm font-medium cursor-pointer select-none relative transition-colors", "focus-visible:ring-2 focus-visible:ring-border focus-visible:outline-none", i && a && "rounded-lg", i && !a && "rounded-l-lg", a && !i && "rounded-r-lg", n && "bg-primary-background text-foreground-on-primary hover:bg-primary-background", !n && t && "text-muted-foreground/50", !n && !t && (o || s) ? "text-foreground" : !n && !t && "text-secondary-foreground", !n && (o || s) && "bg-accent-background", !n && "hover:bg-accent-background hover:rounded-lg hover:text-foreground", r && !n && "border border-border rounded-lg");
|
|
9
9
|
}
|
|
10
10
|
var p = ({ displayedMonth: p, selectedRange: m, hoverDate: h, displayWeekNumber: g = !1, onDateClick: _, onMonthChange: v, onDateHover: y, className: b }) => {
|
|
11
|
-
let [x, S] = m, C =
|
|
11
|
+
let [x, S] = m, C = n(p), w = i(), T = g ? r(C) : [], E = () => {
|
|
12
12
|
v(p.subtract(1, "month"));
|
|
13
13
|
}, D = () => {
|
|
14
14
|
v(p.add(1, "month"));
|
|
15
15
|
}, O = (e) => {
|
|
16
16
|
let t = {
|
|
17
|
-
isOutsideMonth:
|
|
18
|
-
isToday:
|
|
19
|
-
isSelected:
|
|
20
|
-
isRangeStart:
|
|
21
|
-
isRangeEnd:
|
|
22
|
-
isInRange:
|
|
17
|
+
isOutsideMonth: o(e, p),
|
|
18
|
+
isToday: c(e),
|
|
19
|
+
isSelected: s(e, x) || s(e, S),
|
|
20
|
+
isRangeStart: s(e, x),
|
|
21
|
+
isRangeEnd: s(e, S),
|
|
22
|
+
isInRange: a(e, x, S),
|
|
23
23
|
isInHoverRange: !1
|
|
24
24
|
};
|
|
25
|
-
return h && x && !S && (t.isInHoverRange =
|
|
25
|
+
return h && x && !S && (t.isInHoverRange = a(e, x.isBefore(h) ? x : h, x.isBefore(h) ? h : x)), t;
|
|
26
26
|
};
|
|
27
27
|
return /* @__PURE__ */ d("div", {
|
|
28
28
|
"data-slot": "calendar",
|
|
29
29
|
className: e("flex flex-col gap-4", b),
|
|
30
|
-
children: [/* @__PURE__ */ u(
|
|
30
|
+
children: [/* @__PURE__ */ u(t, {
|
|
31
31
|
displayedMonth: p,
|
|
32
32
|
onPrevMonth: E,
|
|
33
33
|
onNextMonth: D,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DAYS_IN_WEEK = 7;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentProps, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
|
+
type DataGridCellProps = ComponentProps<'div'> & {
|
|
3
|
+
isPinned?: boolean;
|
|
4
|
+
isLastPinned?: boolean;
|
|
5
|
+
colIndex?: number;
|
|
6
|
+
textValue?: string;
|
|
7
|
+
truncate?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const DataGridCell: ForwardRefExoticComponent<DataGridCellProps & RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export { DataGridCell, type DataGridCellProps };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { HeaderGroup } from '@tanstack/react-table';
|
|
3
|
+
type DataGridHeaderRowProps<TData> = {
|
|
4
|
+
headerGroup: HeaderGroup<TData>;
|
|
5
|
+
headerRowIndex: number;
|
|
6
|
+
resolvedHeaderHeight: number;
|
|
7
|
+
gridTemplateColumns: string;
|
|
8
|
+
pinnedColumnIds: Set<string>;
|
|
9
|
+
lastPinnedColumnId: string | undefined;
|
|
10
|
+
pinnedLeftByColumnId: Map<string, number>;
|
|
11
|
+
};
|
|
12
|
+
declare function DataGridHeaderRow<TData>({ headerGroup, headerRowIndex, resolvedHeaderHeight, gridTemplateColumns, pinnedColumnIds, lastPinnedColumnId, pinnedLeftByColumnId, }: DataGridHeaderRowProps<TData>): ReactElement;
|
|
13
|
+
export { DataGridHeaderRow, type DataGridHeaderRowProps };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { Row } from '@tanstack/react-table';
|
|
3
|
+
import { VirtualItem } from '@tanstack/react-virtual';
|
|
4
|
+
type DataGridRowProps<TData> = {
|
|
5
|
+
row: Row<TData>;
|
|
6
|
+
virtualRow: VirtualItem;
|
|
7
|
+
headerGroupCount: number;
|
|
8
|
+
gridTemplateColumns: string;
|
|
9
|
+
pinnedColumnIds: Set<string>;
|
|
10
|
+
lastPinnedColumnId: string | undefined;
|
|
11
|
+
pinnedLeftByColumnId: Map<string, number>;
|
|
12
|
+
customCellColumnIds: Set<string>;
|
|
13
|
+
maxDepth: number;
|
|
14
|
+
hasExpanding: boolean;
|
|
15
|
+
onRowClick?: (row: Row<TData>) => void;
|
|
16
|
+
};
|
|
17
|
+
declare function DataGridRow<TData>({ row, virtualRow, headerGroupCount, gridTemplateColumns, pinnedColumnIds, lastPinnedColumnId, pinnedLeftByColumnId, customCellColumnIds, maxDepth, hasExpanding, onRowClick, }: DataGridRowProps<TData>): ReactElement;
|
|
18
|
+
export { DataGridRow, type DataGridRowProps };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ReactElement, ReactNode, RefObject } from 'react';
|
|
2
|
+
import { ColumnDef, ExpandedState, FilterFnOption, Row, SortingState } from '@tanstack/react-table';
|
|
3
|
+
type DataGridSize = 'default' | 'compact';
|
|
4
|
+
type DataGridHandle = {
|
|
5
|
+
scrollToRow: (index: number) => void;
|
|
6
|
+
resetSorting: () => void;
|
|
7
|
+
};
|
|
8
|
+
type DataGridBaseProps<TData> = {
|
|
9
|
+
data: TData[];
|
|
10
|
+
columns: ColumnDef<TData>[];
|
|
11
|
+
getRowId?: (originalRow: TData, index: number) => string;
|
|
12
|
+
rowCount?: number;
|
|
13
|
+
globalFilterFn?: FilterFnOption<TData>;
|
|
14
|
+
enableSorting?: boolean;
|
|
15
|
+
manualSorting?: boolean;
|
|
16
|
+
sorting?: SortingState;
|
|
17
|
+
defaultSorting?: SortingState;
|
|
18
|
+
onSortingChange?: (value: SortingState) => void;
|
|
19
|
+
getSubRows?: (row: TData, index: number) => TData[] | undefined;
|
|
20
|
+
expanded?: ExpandedState;
|
|
21
|
+
defaultExpanded?: ExpandedState;
|
|
22
|
+
onExpandedChange?: (value: ExpandedState) => void;
|
|
23
|
+
getRowCanExpand?: (row: Row<TData>) => boolean;
|
|
24
|
+
maxDepth?: number;
|
|
25
|
+
pinnedColumns?: string[];
|
|
26
|
+
gridRef?: RefObject<DataGridHandle | null>;
|
|
27
|
+
size?: DataGridSize;
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
className?: string;
|
|
30
|
+
onRowClick?: (row: Row<TData>) => void;
|
|
31
|
+
rowHeight?: number;
|
|
32
|
+
headerHeight?: number;
|
|
33
|
+
};
|
|
34
|
+
type DataGridAccessibleNameProps = {
|
|
35
|
+
'aria-label': string;
|
|
36
|
+
'aria-labelledby'?: string;
|
|
37
|
+
} | {
|
|
38
|
+
'aria-labelledby': string;
|
|
39
|
+
'aria-label'?: string;
|
|
40
|
+
};
|
|
41
|
+
type DataGridProps<TData> = DataGridBaseProps<TData> & DataGridAccessibleNameProps;
|
|
42
|
+
declare function DataGrid<TData>({ data, columns, getRowId, rowCount, globalFilterFn, enableSorting, manualSorting, sorting, defaultSorting, onSortingChange, getSubRows, expanded, defaultExpanded, onExpandedChange, getRowCanExpand, maxDepth, pinnedColumns, gridRef, size, children, className, onRowClick, rowHeight, headerHeight, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, }: DataGridProps<TData>): ReactElement;
|
|
43
|
+
export { DataGrid, type DataGridHandle };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ColumnDef } from '@tanstack/react-table';
|
|
2
|
+
type AssetRow = {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
type: string;
|
|
6
|
+
status: 'Running' | 'Stopped' | 'Needs attention';
|
|
7
|
+
area: string;
|
|
8
|
+
updated: string;
|
|
9
|
+
};
|
|
10
|
+
declare const assetRows: AssetRow[];
|
|
11
|
+
declare const assetColumns: ColumnDef<AssetRow>[];
|
|
12
|
+
export { type AssetRow, assetColumns, assetRows };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ColumnDef } from '@tanstack/react-table';
|
|
2
|
+
declare const PINNED_COLUMN_Z_INDEX = 10;
|
|
3
|
+
declare function getAriaSort(sortDirection: false | 'asc' | 'desc', canSort: boolean): 'ascending' | 'descending' | 'none' | undefined;
|
|
4
|
+
declare function getTextValue(value: unknown): string | undefined;
|
|
5
|
+
declare function isAccessorColumn<TData>(def: ColumnDef<TData>): boolean;
|
|
6
|
+
declare function isFromIgnoredCellTarget(target?: EventTarget | null): boolean;
|
|
7
|
+
declare function isFromExpandToggleTarget(target?: EventTarget | null): boolean;
|
|
8
|
+
declare function collectCustomCellColumnIds<TData>(columns: ColumnDef<TData>[]): Set<string>;
|
|
9
|
+
export { PINNED_COLUMN_Z_INDEX, collectCustomCellColumnIds, getAriaSort, getTextValue, isAccessorColumn, isFromExpandToggleTarget, isFromIgnoredCellTarget, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn as e } from "../../../../../lib/utils.js";
|
|
2
2
|
import { Popover as t, PopoverContent as n, PopoverTrigger as r } from "../../popover/popover.js";
|
|
3
|
-
import { Calendar as i } from "
|
|
3
|
+
import { Calendar as i } from "../../calendar/calendar.js";
|
|
4
4
|
import { DateTimeInput as a } from "../shared/date-time-input/date-time-input.js";
|
|
5
5
|
import { ShortcutsPanel as o } from "../shared/shortcuts-panel/shortcuts-panel.js";
|
|
6
6
|
import { useDatePicker as s } from "./use-date-picker.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Dayjs } from 'dayjs';
|
|
2
|
+
import { ShortcutValueDayjs } from '../shared/shortcuts-panel/shortcuts-panel';
|
|
2
3
|
export interface UseDatePickerProps {
|
|
3
4
|
value: Dayjs | null;
|
|
4
5
|
onChange: (date: Dayjs | null) => void;
|
|
@@ -11,7 +12,7 @@ export interface UseDatePickerReturn {
|
|
|
11
12
|
handleOpenChange: (open: boolean) => void;
|
|
12
13
|
handleDateClick: (date: Dayjs) => void;
|
|
13
14
|
handleMonthChange: (month: Dayjs) => void;
|
|
14
|
-
handleApplyShortcut: (shortcutValue:
|
|
15
|
+
handleApplyShortcut: (shortcutValue: ShortcutValueDayjs) => void;
|
|
15
16
|
inputRef: React.RefObject<HTMLDivElement>;
|
|
16
17
|
popoverRef: React.RefObject<HTMLDivElement>;
|
|
17
18
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn as e } from "../../../../../lib/utils.js";
|
|
2
2
|
import { Popover as t, PopoverContent as n, PopoverTrigger as r } from "../../popover/popover.js";
|
|
3
|
-
import { Calendar as i } from "
|
|
3
|
+
import { Calendar as i } from "../../calendar/calendar.js";
|
|
4
4
|
import { DateTimeInput as a } from "../shared/date-time-input/date-time-input.js";
|
|
5
5
|
import { ShortcutsPanel as o } from "../shared/shortcuts-panel/shortcuts-panel.js";
|
|
6
6
|
import { useDateRangePicker as s } from "./use-date-range-picker.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Dayjs } from 'dayjs';
|
|
2
2
|
import { RangeSelectionStep } from '../shared/hooks/use-range-step-manager';
|
|
3
|
+
import { ShortcutValueDayjs } from '../shared/shortcuts-panel/shortcuts-panel';
|
|
3
4
|
export type { RangeSelectionStep };
|
|
4
5
|
export interface UseDateRangePickerProps {
|
|
5
6
|
value: [Dayjs | null, Dayjs | null];
|
|
@@ -18,7 +19,7 @@ export interface UseDateRangePickerReturn {
|
|
|
18
19
|
handleMonthChange: (month: Dayjs) => void;
|
|
19
20
|
handleDateHover: (date: Dayjs | null) => void;
|
|
20
21
|
handleSetStep: (step: RangeSelectionStep) => void;
|
|
21
|
-
handleApplyShortcut: (range:
|
|
22
|
+
handleApplyShortcut: (range: ShortcutValueDayjs) => void;
|
|
22
23
|
inputRef: React.RefObject<HTMLDivElement>;
|
|
23
24
|
popoverRef: React.RefObject<HTMLDivElement>;
|
|
24
25
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { DateTimePickerProps, UseDateTimePickerProps, UseDateTimePickerReturn, } from './types';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
import { ShortcutItem, ShortcutValueDayjs } from '../shared/shortcuts-panel/shortcuts-panel';
|
|
3
|
+
import { AmPm, TimeFormat } from '../utils/format-utils';
|
|
4
|
+
export interface UseDateTimePickerProps {
|
|
5
|
+
value: Dayjs | null;
|
|
6
|
+
onChange: (datetime: Dayjs | null) => void;
|
|
7
|
+
timeFormat?: TimeFormat;
|
|
8
|
+
defaultDate?: Dayjs;
|
|
9
|
+
}
|
|
10
|
+
export interface UseDateTimePickerReturn {
|
|
11
|
+
isOpen: boolean;
|
|
12
|
+
displayedMonth: Dayjs;
|
|
13
|
+
tempDate: Dayjs | null;
|
|
14
|
+
hour: number;
|
|
15
|
+
minute: number;
|
|
16
|
+
amPm: AmPm;
|
|
17
|
+
displayValue: Dayjs | null;
|
|
18
|
+
canApply: boolean;
|
|
19
|
+
handleOpenChange: (open: boolean) => void;
|
|
20
|
+
handleApply: () => void;
|
|
21
|
+
handleDateClick: (date: Dayjs) => void;
|
|
22
|
+
handleMonthChange: (month: Dayjs) => void;
|
|
23
|
+
handleHourChange: (hour: number) => void;
|
|
24
|
+
handleMinuteChange: (minute: number) => void;
|
|
25
|
+
handleAmPmChange: (amPm: AmPm) => void;
|
|
26
|
+
handleApplyShortcut: (shortcutValue: ShortcutValueDayjs) => void;
|
|
27
|
+
inputRef: React.RefObject<HTMLDivElement>;
|
|
28
|
+
popoverRef: React.RefObject<HTMLDivElement>;
|
|
29
|
+
}
|
|
30
|
+
export interface DateTimePickerProps extends UseDateTimePickerProps {
|
|
31
|
+
format?: string;
|
|
32
|
+
placeholder?: string;
|
|
33
|
+
displayWeekNumber?: boolean;
|
|
34
|
+
shortcuts?: ShortcutItem[];
|
|
35
|
+
className?: string;
|
|
36
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { UseDateTimePickerProps, UseDateTimePickerReturn } from './types';
|
|
2
|
+
export type { UseDateTimePickerProps, UseDateTimePickerReturn };
|
|
3
|
+
export declare const useDateTimePicker: ({ value, onChange, timeFormat, defaultDate, }: UseDateTimePickerProps) => UseDateTimePickerReturn;
|
package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn as e } from "../../../../../lib/utils.js";
|
|
2
2
|
import { Button as t } from "../../button/button.js";
|
|
3
3
|
import { Popover as ee, PopoverContent as te, PopoverTrigger as n } from "../../popover/popover.js";
|
|
4
|
-
import { Calendar as r } from "
|
|
4
|
+
import { Calendar as r } from "../../calendar/calendar.js";
|
|
5
5
|
import { DateTimeInput as i } from "../shared/date-time-input/date-time-input.js";
|
|
6
6
|
import { ShortcutsPanel as a } from "../shared/shortcuts-panel/shortcuts-panel.js";
|
|
7
7
|
import { convert12HourTo24Hour as o } from "../utils/time-utils.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Dayjs } from 'dayjs';
|
|
2
2
|
import { RangeSelectionStep } from '../shared/hooks/use-range-step-manager';
|
|
3
|
-
import {
|
|
3
|
+
import { ShortcutValueDayjs } from '../shared/shortcuts-panel/shortcuts-panel';
|
|
4
|
+
import { AmPm, TimeFormat } from '../utils/format-utils';
|
|
4
5
|
export type { RangeSelectionStep };
|
|
5
6
|
export interface UseDateTimeRangePickerProps {
|
|
6
7
|
value: [Dayjs | null, Dayjs | null];
|
|
@@ -19,8 +20,8 @@ export interface UseDateTimeRangePickerReturn {
|
|
|
19
20
|
tempStartMinute: number;
|
|
20
21
|
tempEndHour: number;
|
|
21
22
|
tempEndMinute: number;
|
|
22
|
-
startAmPm:
|
|
23
|
-
endAmPm:
|
|
23
|
+
startAmPm: AmPm;
|
|
24
|
+
endAmPm: AmPm;
|
|
24
25
|
handleOpenChange: (open: boolean) => void;
|
|
25
26
|
handleSetStep: (step: RangeSelectionStep) => void;
|
|
26
27
|
handleDateClick: (date: Dayjs) => void;
|
|
@@ -30,12 +31,12 @@ export interface UseDateTimeRangePickerReturn {
|
|
|
30
31
|
handleStartMinuteChange: (minute: number) => void;
|
|
31
32
|
handleEndHourChange: (hour: number) => void;
|
|
32
33
|
handleEndMinuteChange: (minute: number) => void;
|
|
33
|
-
handleStartAmPmChange: (value:
|
|
34
|
-
handleEndAmPmChange: (value:
|
|
34
|
+
handleStartAmPmChange: (value: AmPm) => void;
|
|
35
|
+
handleEndAmPmChange: (value: AmPm) => void;
|
|
35
36
|
handleNext: () => void;
|
|
36
37
|
handleApply: () => void;
|
|
37
38
|
handleBack: () => void;
|
|
38
|
-
handleApplyShortcut: (range:
|
|
39
|
+
handleApplyShortcut: (range: ShortcutValueDayjs) => void;
|
|
39
40
|
popoverRef: React.RefObject<HTMLDivElement>;
|
|
40
41
|
inputRef: React.RefObject<HTMLDivElement>;
|
|
41
42
|
}
|
|
@@ -7,4 +7,6 @@ export type { DateRangePickerProps } from './date-range-picker';
|
|
|
7
7
|
export { DateTimeRangePicker } from './date-time-range-picker';
|
|
8
8
|
export type { DateTimeRangePickerProps } from './date-time-range-picker';
|
|
9
9
|
export type { ShortcutItem } from './date-time-range-picker';
|
|
10
|
-
export type { TimeFormat } from './utils/format-utils';
|
|
10
|
+
export type { AmPm, TimeFormat } from './utils/format-utils';
|
|
11
|
+
export { Calendar } from '../calendar/calendar';
|
|
12
|
+
export type { CalendarProps } from '../calendar/calendar';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { Calendar as e } from "../calendar/calendar.js";
|
|
2
|
+
import { DatePicker as t } from "./date-picker/date-picker.js";
|
|
3
|
+
import { TimePicker as n } from "./time-picker/time-picker.js";
|
|
4
|
+
import { DateRangePicker as r } from "./date-range-picker/date-range-picker.js";
|
|
5
|
+
import { DateTimeRangePicker as i } from "./date-time-range-picker/date-time-range-picker.js";
|
|
6
|
+
export { e as Calendar, t as DatePicker, r as DateRangePicker, i as DateTimeRangePicker, n as TimePicker };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
+
import { AmPm } from '../../utils/format-utils';
|
|
2
3
|
export type AmPmScrollProps = {
|
|
3
|
-
value:
|
|
4
|
-
onChange: (value:
|
|
4
|
+
value: AmPm | null;
|
|
5
|
+
onChange: (value: AmPm) => void;
|
|
5
6
|
className?: string;
|
|
6
7
|
};
|
|
7
8
|
export declare const AmPmScroll: FC<AmPmScrollProps>;
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
* Shared numeric constants for date/time picker components.
|
|
3
|
-
* Colors and typography are applied via Tailwind utility classes — no CSS
|
|
4
|
-
* variable strings are exported from here.
|
|
5
|
-
*/
|
|
1
|
+
import { AmPm } from '../utils/format-utils';
|
|
6
2
|
export declare const HOURS_IN_DAY = 24;
|
|
7
3
|
export declare const HOURS_IN_12H = 12;
|
|
8
4
|
export declare const MINUTES_IN_HOUR = 60;
|
|
9
5
|
export declare const MINUTE_INCREMENT = 1;
|
|
10
|
-
export declare const DAYS_IN_WEEK = 7;
|
|
11
6
|
export declare const DEFAULT_START_HOUR = 9;
|
|
12
7
|
export declare const DEFAULT_END_HOUR = 17;
|
|
13
8
|
export declare const DEFAULT_MINUTE = 0;
|
|
14
9
|
export declare const START_OF_DAY_HOUR = 0;
|
|
15
10
|
export declare const END_OF_DAY_HOUR = 23;
|
|
16
11
|
export declare const END_OF_DAY_MINUTE = 59;
|
|
17
|
-
export declare const DEFAULT_START_AMPM:
|
|
18
|
-
export declare const DEFAULT_END_AMPM:
|
|
12
|
+
export declare const DEFAULT_START_AMPM: AmPm;
|
|
13
|
+
export declare const DEFAULT_END_AMPM: AmPm;
|
|
19
14
|
export declare const NOON_HOUR = 12;
|
|
20
15
|
export declare const MIDNIGHT_HOUR = 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TimeFormat } from '../../utils/format-utils';
|
|
1
|
+
import { AmPm, TimeFormat } from '../../utils/format-utils';
|
|
2
2
|
export interface UseTimeStateOptions {
|
|
3
3
|
initialHour?: number;
|
|
4
4
|
initialMinute?: number;
|
|
@@ -7,11 +7,11 @@ export interface UseTimeStateOptions {
|
|
|
7
7
|
export interface UseTimeStateReturn {
|
|
8
8
|
hour: number;
|
|
9
9
|
minute: number;
|
|
10
|
-
amPm:
|
|
10
|
+
amPm: AmPm;
|
|
11
11
|
hour24: number;
|
|
12
12
|
handleHourChange: (hour: number) => void;
|
|
13
13
|
handleMinuteChange: (minute: number) => void;
|
|
14
|
-
handleAmPmChange: (amPm:
|
|
14
|
+
handleAmPmChange: (amPm: AmPm) => void;
|
|
15
15
|
resetTime: (hour: number, minute: number) => void;
|
|
16
16
|
}
|
|
17
17
|
export declare const useTimeState: ({ initialHour, initialMinute, timeFormat, }?: UseTimeStateOptions) => UseTimeStateReturn;
|
package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { Dayjs } from 'dayjs';
|
|
3
|
+
export type ShortcutValueDayjs = Dayjs | [Dayjs | null, Dayjs | null];
|
|
3
4
|
export interface ShortcutItem {
|
|
4
5
|
id?: string;
|
|
5
6
|
label: string;
|
|
6
|
-
getValue: () =>
|
|
7
|
+
getValue: () => ShortcutValueDayjs;
|
|
7
8
|
}
|
|
8
9
|
export interface ShortcutsPanelProps {
|
|
9
10
|
shortcuts?: ShortcutItem[];
|
|
10
|
-
onShortcutClick: (value:
|
|
11
|
+
onShortcutClick: (value: ShortcutValueDayjs) => void;
|
|
11
12
|
className?: string;
|
|
12
13
|
}
|
|
13
14
|
export declare const ShortcutsPanel: FC<ShortcutsPanelProps>;
|
package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
+
import { AmPm } from '../../utils/format-utils';
|
|
2
3
|
type TimePickerPanelBaseProps = {
|
|
3
4
|
hour: number;
|
|
4
5
|
minute: number;
|
|
@@ -8,8 +9,8 @@ type TimePickerPanelBaseProps = {
|
|
|
8
9
|
};
|
|
9
10
|
export type TimePickerPanelProps = TimePickerPanelBaseProps & ({
|
|
10
11
|
timeFormat: '12h';
|
|
11
|
-
amPm:
|
|
12
|
-
onAmPmChange: (amPm:
|
|
12
|
+
amPm: AmPm;
|
|
13
|
+
onAmPmChange: (amPm: AmPm) => void;
|
|
13
14
|
} | {
|
|
14
15
|
timeFormat?: '24h';
|
|
15
16
|
amPm?: undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Dayjs } from 'dayjs';
|
|
2
|
-
import {
|
|
2
|
+
import { ShortcutValueDayjs } from '../shared/shortcuts-panel/shortcuts-panel';
|
|
3
|
+
import { AmPm, TimeFormat } from '../utils/format-utils';
|
|
3
4
|
export interface UseTimePickerProps {
|
|
4
5
|
value: Dayjs | null;
|
|
5
6
|
onChange: (time: Dayjs | null) => void;
|
|
@@ -10,14 +11,14 @@ export interface UseTimePickerReturn {
|
|
|
10
11
|
isOpen: boolean;
|
|
11
12
|
hour: number;
|
|
12
13
|
minute: number;
|
|
13
|
-
amPm:
|
|
14
|
+
amPm: AmPm;
|
|
14
15
|
displayValue: Dayjs | null;
|
|
15
16
|
handleOpenChange: (open: boolean) => void;
|
|
16
17
|
handleApply: () => void;
|
|
17
18
|
handleHourChange: (hour: number) => void;
|
|
18
19
|
handleMinuteChange: (minute: number) => void;
|
|
19
|
-
handleAmPmChange: (amPm:
|
|
20
|
-
handleApplyShortcut: (shortcutValue:
|
|
20
|
+
handleAmPmChange: (amPm: AmPm) => void;
|
|
21
|
+
handleApplyShortcut: (shortcutValue: ShortcutValueDayjs) => void;
|
|
21
22
|
inputRef: React.RefObject<HTMLDivElement>;
|
|
22
23
|
popoverRef: React.RefObject<HTMLDivElement>;
|
|
23
24
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { TimeRangePickerProps, UseTimeRangePickerProps, UseTimeRangePickerReturn, } from './types';
|