@giddaa-housing/ui 3.4.0 → 3.5.0
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/css/generated/shared.css +1 -1
- package/dist/accordion.js +1 -1
- package/dist/activity-timeline.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/auth-layout.js +1 -1
- package/dist/avatar.js +1 -1
- package/dist/badge.js +1 -1
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/bullet-chart.js +1 -1
- package/dist/button-group.js +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar.js +2 -2
- package/dist/call-card.js +1 -1
- package/dist/card.js +1 -1
- package/dist/carousel.js +2 -2
- package/dist/chart.js +1 -1
- package/dist/chat.js +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/collapsible.js +1 -1
- package/dist/combobox-B7cKFJ9V.js +398 -0
- package/dist/combobox.d.ts +2 -2
- package/dist/combobox.js +1 -308
- package/dist/cta.js +1 -1
- package/dist/currency-selector.js +2 -2
- package/dist/data-table.d.ts +1 -1
- package/dist/data-table.js +1 -1
- package/dist/date-picker.d.ts +4 -3
- package/dist/date-picker.js +7 -17
- package/dist/details-card.js +1 -1
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/dropzone.js +1 -1
- package/dist/editorial-card.js +2 -4
- package/dist/empty-state.js +1 -1
- package/dist/field.js +1 -1
- package/dist/file-upload.js +1 -1
- package/dist/filter.js +1 -1
- package/dist/footer.js +1 -1
- package/dist/funnel-chart.js +1 -1
- package/dist/gallery-indicator.js +1 -1
- package/dist/icons-C9JXR5Xv.d.ts +111 -0
- package/dist/icons.d.ts +2 -93
- package/dist/icons.js +37 -1
- package/dist/image.d.ts +59 -0
- package/dist/image.js +53 -0
- package/dist/infinite-scroll.js +3 -29
- package/dist/infotip.js +1 -1
- package/dist/input-group.js +1 -1
- package/dist/input-otp.js +1 -1
- package/dist/input.js +1 -1
- package/dist/item.js +1 -1
- package/dist/kpi-card.js +1 -1
- package/dist/label.js +1 -1
- package/dist/line-chart.js +1 -1
- package/dist/list-item.js +1 -1
- package/dist/map-indicator.js +1 -1
- package/dist/match.js +1 -1
- package/dist/media-gallery-hero.js +6 -3
- package/dist/media-player.js +5 -13
- package/dist/message.js +2 -12
- package/dist/mobile-sidebar.js +1 -1
- package/dist/multi-step-form.js +2 -2
- package/dist/number-input.js +1 -1
- package/dist/page-header.js +1 -1
- package/dist/pagination.js +1 -1
- package/dist/password-input.js +1 -1
- package/dist/phone-input.js +11 -17
- package/dist/photo-gallery.js +6 -3
- package/dist/picker-CsnHtbe4.d.ts +14 -0
- package/dist/{picker-xSTzeYhc.js → picker-DmIiQKLJ.js} +2 -7
- package/dist/pie-chart.js +1 -1
- package/dist/popover-DSlPeH7x.d.ts +20 -0
- package/dist/popover.d.ts +1 -19
- package/dist/popover.js +1 -1
- package/dist/price-tag.d.ts +1 -1
- package/dist/price-tag.js +50 -22
- package/dist/progress.js +1 -1
- package/dist/property-listing-card.d.ts +63 -1
- package/dist/property-listing-card.js +97 -28
- package/dist/purchase-option-card.js +1 -1
- package/dist/radar-chart.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/review-block.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/scatter-chart.js +1 -1
- package/dist/scroll-spy.js +3 -3
- package/dist/search-input.js +1 -1
- package/dist/select.js +1 -1
- package/dist/separator.js +1 -1
- package/dist/sheet.js +1 -1
- package/dist/sidebar.js +3 -16
- package/dist/skeleton.js +1 -1
- package/dist/slider.js +1 -1
- package/dist/sonar.js +1 -1
- package/dist/sparkline.js +1 -1
- package/dist/stepper.js +1 -1
- package/dist/styles.css +42 -2
- package/dist/switch.js +1 -1
- package/dist/table-card.js +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tag.js +1 -1
- package/dist/testimonial-block.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/theme-switcher.js +1 -1
- package/dist/time-picker.d.ts +3 -2
- package/dist/time-picker.js +5 -7
- package/dist/toast.js +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/top-navbar.js +1 -1
- package/dist/tree-map.js +1 -1
- package/dist/utils/cn.d.ts +5 -0
- package/dist/utils/cn.js +33 -0
- package/dist/utils/format.d.ts +45 -0
- package/dist/utils/format.js +70 -0
- package/dist/utils/phone.d.ts +98 -0
- package/dist/utils/phone.js +93 -0
- package/dist/utils/use-intersection.d.ts +9 -0
- package/dist/utils/use-intersection.js +29 -0
- package/dist/utils/use-is-mobile.d.ts +5 -0
- package/dist/utils/use-is-mobile.js +16 -0
- package/dist/utils/use-reduced-motion.d.ts +5 -0
- package/dist/{use-reduced-motion-BDvOK14x.js → utils/use-reduced-motion.js} +2 -2
- package/dist/utils/use-uncontrolled.d.ts +11 -0
- package/dist/{use-uncontrolled-CLfM1XbB.js → utils/use-uncontrolled.js} +2 -2
- package/dist/video-player-dialog.d.ts +12 -2
- package/dist/video-player-dialog.js +47 -7
- package/dist/waterfall-chart.js +1 -1
- package/package.json +9 -1
- package/dist/cn-BI_4DMBf.js +0 -23
package/dist/radio-group.js
CHANGED
package/dist/review-block.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from "./utils/cn.js";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
5
5
|
import { useRender } from "@base-ui/react/use-render";
|
package/dist/rich-text-editor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { AlignCenter, AlignJustify, AlignLeft, AlignRight, Baseline, Bold, ChevronDown, Code2, Image as Image$1, Italic, Link2, List, ListOrdered, Quote, Redo2, Underline, Undo2 } from "./icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
4
|
import { useComponentSize } from "./size-context.js";
|
|
5
5
|
import { Button } from "./button.js";
|
|
6
6
|
import { Input } from "./input.js";
|
package/dist/scatter-chart.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from "./utils/cn.js";
|
|
3
3
|
import { SizeProvider, useComponentSize } from "./size-context.js";
|
|
4
4
|
import { ChartContainer, cartesianAxisProps } from "./chart.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/dist/scroll-spy.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from "./utils/cn.js";
|
|
3
3
|
import { useComponentSize } from "./size-context.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useReducedMotion } from "./utils/use-reduced-motion.js";
|
|
5
|
+
import { useUncontrolled } from "./utils/use-uncontrolled.js";
|
|
6
6
|
import { resolveTabsListVariant, tabsIndicatorClassName, tabsListVariants, tabsTriggerClassName } from "./tabs.js";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import * as React from "react";
|
package/dist/search-input.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Search, X } from "./icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
4
|
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "./input-group.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import * as React from "react";
|
package/dist/select.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Check, ChevronDown, ChevronUp } from "./icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
4
|
import { SizeProvider, useComponentSize } from "./size-context.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { cva } from "class-variance-authority";
|
package/dist/separator.js
CHANGED
package/dist/sheet.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { X } from "./icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
4
|
import { SizeProvider } from "./size-context.js";
|
|
5
5
|
import { Button } from "./button.js";
|
|
6
6
|
import { DialogNestingProvider, useDialogNestingDepth } from "./dialog-nesting.js";
|
package/dist/sidebar.js
CHANGED
|
@@ -1,32 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Menu } from "./icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
4
|
import { Separator } from "./separator.js";
|
|
5
5
|
import { Button } from "./button.js";
|
|
6
6
|
import { Input } from "./input.js";
|
|
7
|
-
import {
|
|
7
|
+
import { useUncontrolled } from "./utils/use-uncontrolled.js";
|
|
8
8
|
import { Skeleton } from "./skeleton.js";
|
|
9
9
|
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.js";
|
|
10
10
|
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "./sheet.js";
|
|
11
|
+
import { useIsMobile } from "./utils/use-is-mobile.js";
|
|
11
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
13
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
13
14
|
import { useRender } from "@base-ui/react/use-render";
|
|
14
15
|
import { cva } from "class-variance-authority";
|
|
15
16
|
import * as React from "react";
|
|
16
|
-
//#region src/lib/use-mobile.ts
|
|
17
|
-
const DEFAULT_MOBILE_BREAKPOINT = 1024;
|
|
18
|
-
function useIsMobile(breakpoint = DEFAULT_MOBILE_BREAKPOINT) {
|
|
19
|
-
const [isMobile, setIsMobile] = React.useState(false);
|
|
20
|
-
React.useEffect(() => {
|
|
21
|
-
const mediaQuery = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
|
|
22
|
-
const update = () => setIsMobile(window.innerWidth < breakpoint);
|
|
23
|
-
update();
|
|
24
|
-
mediaQuery.addEventListener("change", update);
|
|
25
|
-
return () => mediaQuery.removeEventListener("change", update);
|
|
26
|
-
}, [breakpoint]);
|
|
27
|
-
return isMobile;
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
17
|
//#region src/sidebar.tsx
|
|
31
18
|
const SIDEBAR_LS_KEY = "sidebar_state";
|
|
32
19
|
const SIDEBAR_WIDTH = "17.5rem";
|
package/dist/skeleton.js
CHANGED
package/dist/slider.js
CHANGED
package/dist/sonar.js
CHANGED
package/dist/sparkline.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from "./utils/cn.js";
|
|
3
3
|
import { useComponentSize } from "./size-context.js";
|
|
4
4
|
import { ChartContainer, ChartTooltip, ChartTooltipContent } from "./chart.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/dist/stepper.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Check } from "./icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { cva } from "class-variance-authority";
|
|
6
6
|
import * as React from "react";
|
package/dist/styles.css
CHANGED
|
@@ -480,6 +480,15 @@
|
|
|
480
480
|
.bottom-16 {
|
|
481
481
|
bottom: calc(var(--spacing) * 16);
|
|
482
482
|
}
|
|
483
|
+
.bottom-20 {
|
|
484
|
+
bottom: calc(var(--spacing) * 20);
|
|
485
|
+
}
|
|
486
|
+
.bottom-24 {
|
|
487
|
+
bottom: calc(var(--spacing) * 24);
|
|
488
|
+
}
|
|
489
|
+
.bottom-28 {
|
|
490
|
+
bottom: calc(var(--spacing) * 28);
|
|
491
|
+
}
|
|
483
492
|
.bottom-\[18px\] {
|
|
484
493
|
bottom: 18px;
|
|
485
494
|
}
|
|
@@ -6463,6 +6472,16 @@
|
|
|
6463
6472
|
}
|
|
6464
6473
|
}
|
|
6465
6474
|
}
|
|
6475
|
+
.hover\:bg-black\/60 {
|
|
6476
|
+
&:hover {
|
|
6477
|
+
@media (hover: hover) {
|
|
6478
|
+
background-color: color-mix(in srgb, #000 60%, transparent);
|
|
6479
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
6480
|
+
background-color: color-mix(in oklab, var(--color-black) 60%, transparent);
|
|
6481
|
+
}
|
|
6482
|
+
}
|
|
6483
|
+
}
|
|
6484
|
+
}
|
|
6466
6485
|
.hover\:bg-black\/80 {
|
|
6467
6486
|
&:hover {
|
|
6468
6487
|
@media (hover: hover) {
|
|
@@ -7159,9 +7178,19 @@
|
|
|
7159
7178
|
border-radius: var(--radius-xl);
|
|
7160
7179
|
}
|
|
7161
7180
|
}
|
|
7162
|
-
.has-data-\[slot\=combobox-chip\]\:px-1 {
|
|
7181
|
+
.has-data-\[slot\=combobox-chip\]\:px-1\.5 {
|
|
7163
7182
|
&:has(*[data-slot="combobox-chip"]) {
|
|
7164
|
-
padding-inline: var(--spacing);
|
|
7183
|
+
padding-inline: calc(var(--spacing) * 1.5);
|
|
7184
|
+
}
|
|
7185
|
+
}
|
|
7186
|
+
.has-data-\[slot\=combobox-chip\]\:px-2 {
|
|
7187
|
+
&:has(*[data-slot="combobox-chip"]) {
|
|
7188
|
+
padding-inline: calc(var(--spacing) * 2);
|
|
7189
|
+
}
|
|
7190
|
+
}
|
|
7191
|
+
.has-data-\[slot\=combobox-chip\]\:px-2\.5 {
|
|
7192
|
+
&:has(*[data-slot="combobox-chip"]) {
|
|
7193
|
+
padding-inline: calc(var(--spacing) * 2.5);
|
|
7165
7194
|
}
|
|
7166
7195
|
}
|
|
7167
7196
|
.has-data-\[slot\=combobox-chip-remove\]\:pr-0 {
|
|
@@ -8342,6 +8371,11 @@
|
|
|
8342
8371
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
8343
8372
|
}
|
|
8344
8373
|
}
|
|
8374
|
+
.data-\[grown\=true\]\:rounded-2xl {
|
|
8375
|
+
&[data-grown="true"] {
|
|
8376
|
+
border-radius: var(--radius-2xl);
|
|
8377
|
+
}
|
|
8378
|
+
}
|
|
8345
8379
|
.data-\[interactive\=true\]\:cursor-pointer {
|
|
8346
8380
|
&[data-interactive="true"] {
|
|
8347
8381
|
cursor: pointer;
|
|
@@ -11240,6 +11274,12 @@
|
|
|
11240
11274
|
pointer-events: none;
|
|
11241
11275
|
}
|
|
11242
11276
|
}
|
|
11277
|
+
.\[\&_svg\]\:size-3 {
|
|
11278
|
+
& svg {
|
|
11279
|
+
width: calc(var(--spacing) * 3);
|
|
11280
|
+
height: calc(var(--spacing) * 3);
|
|
11281
|
+
}
|
|
11282
|
+
}
|
|
11243
11283
|
.\[\&_svg\]\:size-3\.5 {
|
|
11244
11284
|
& svg {
|
|
11245
11285
|
width: calc(var(--spacing) * 3.5);
|
package/dist/switch.js
CHANGED
package/dist/table-card.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from "./utils/cn.js";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
5
5
|
import { useRender } from "@base-ui/react/use-render";
|
package/dist/table.js
CHANGED
package/dist/tabs.js
CHANGED
package/dist/tag.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { X } from "./icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
4
|
import { useComponentSize } from "./size-context.js";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { cva } from "class-variance-authority";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ArrowUpRight, Play, Star } from "./icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
4
|
import { Avatar, AvatarFallback, AvatarImage } from "./avatar.js";
|
|
5
5
|
import { buttonVariants } from "./button.js";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
package/dist/textarea.js
CHANGED
package/dist/theme-switcher.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ChevronDown, Monitor, Moon, Sun } from "./icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
4
|
import { useComponentSize } from "./size-context.js";
|
|
5
5
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger } from "./dropdown-menu.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/dist/time-picker.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { n as InputSize } from "./input-CfoEJ8A6.js";
|
|
2
|
+
import { t as PickerPlacementProps } from "./picker-CsnHtbe4.js";
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
//#region src/time-picker.d.ts
|
|
4
|
-
interface TimePickerProps {
|
|
5
|
+
interface TimePickerProps extends PickerPlacementProps {
|
|
5
6
|
value?: string;
|
|
6
7
|
onChange?: (time: string | undefined) => void;
|
|
7
8
|
format?: "12h" | "24h";
|
|
@@ -11,6 +12,6 @@ interface TimePickerProps {
|
|
|
11
12
|
placeholder?: string;
|
|
12
13
|
className?: string;
|
|
13
14
|
}
|
|
14
|
-
declare function TimePicker({ value, onChange, format, disabled, size, placeholder, className }: TimePickerProps): React.JSX.Element;
|
|
15
|
+
declare function TimePicker({ value, onChange, format, disabled, size, placeholder, className, ...placement }: TimePickerProps): React.JSX.Element;
|
|
15
16
|
//#endregion
|
|
16
17
|
export { TimePicker, type TimePickerProps };
|
package/dist/time-picker.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Clock } from "./icons.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
|
+
import { useReducedMotion } from "./utils/use-reduced-motion.js";
|
|
5
5
|
import { Popover, PopoverContent } from "./popover.js";
|
|
6
|
-
import { n as
|
|
6
|
+
import { n as PickerTrigger, t as PickerFooter } from "./picker-DmIiQKLJ.js";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import * as React from "react";
|
|
9
9
|
//#region src/lib/time-picker-paint.ts
|
|
@@ -239,7 +239,7 @@ function TimeColumn({ label, items, value, onChange }) {
|
|
|
239
239
|
})]
|
|
240
240
|
});
|
|
241
241
|
}
|
|
242
|
-
function TimePicker({ value, onChange, format = "12h", disabled = false, size, placeholder = "Select time", className }) {
|
|
242
|
+
function TimePicker({ value, onChange, format = "12h", disabled = false, size, placeholder = "Select time", className, ...placement }) {
|
|
243
243
|
const [open, setOpen] = React.useState(false);
|
|
244
244
|
const [pending, setPending] = React.useState(() => parseTimeString(value, format));
|
|
245
245
|
function handleOpenChange(next) {
|
|
@@ -273,10 +273,8 @@ function TimePicker({ value, onChange, format = "12h", disabled = false, size, p
|
|
|
273
273
|
className
|
|
274
274
|
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
275
275
|
showArrow: false,
|
|
276
|
-
align: "center",
|
|
277
|
-
side: "bottom",
|
|
278
|
-
collisionAvoidance: PICKER_COLLISION_AVOIDANCE,
|
|
279
276
|
className: "min-w-(--anchor-width) gap-0 overflow-hidden rounded-2xl p-0 border border-line-subtle",
|
|
277
|
+
...placement,
|
|
280
278
|
children: [
|
|
281
279
|
/* @__PURE__ */ jsx("div", {
|
|
282
280
|
className: "flex w-full items-center justify-center gap-2 border-b border-line-subtle",
|
package/dist/toast.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Check, Info, X } from "./icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
4
|
import { Button } from "./button.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { Toast } from "@base-ui/react/toast";
|
package/dist/tooltip.js
CHANGED
package/dist/top-navbar.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ArrowUpRight, ChevronDown } from "./icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
4
|
import { MobileSidebar } from "./mobile-sidebar.js";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { mergeProps } from "@base-ui/react/merge-props";
|
package/dist/tree-map.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from "./utils/cn.js";
|
|
3
3
|
import { useComponentSize } from "./size-context.js";
|
|
4
4
|
import { ChartCard, ChartContainer, ChartDescription, ChartHeader, ChartTitle, ChartTooltip, ChartTooltipContent } from "./chart.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/dist/utils/cn.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import { extendTailwindMerge } from "tailwind-merge";
|
|
3
|
+
//#region src/utils/cn.ts
|
|
4
|
+
/**
|
|
5
|
+
* The class merger every component in this package uses.
|
|
6
|
+
*
|
|
7
|
+
* Published because overriding a component's classes safely means merging them
|
|
8
|
+
* the same way it does. `clsx` alone leaves both `text-gdt-sm` and your
|
|
9
|
+
* `text-gdt-lg` on the element and lets source order decide; a stock
|
|
10
|
+
* `tailwind-merge` does not know the `text-gdt-*` scale is a font size and
|
|
11
|
+
* keeps both for a different reason. This one is configured for the design
|
|
12
|
+
* tokens, so the last class wins the way you meant it to.
|
|
13
|
+
*/
|
|
14
|
+
const twMerge = extendTailwindMerge({ extend: { classGroups: { "font-size": [{ text: [
|
|
15
|
+
"gdt-display",
|
|
16
|
+
"gdt-h1",
|
|
17
|
+
"gdt-h2",
|
|
18
|
+
"gdt-h3",
|
|
19
|
+
"gdt-h4",
|
|
20
|
+
"gdt-h5",
|
|
21
|
+
"gdt-xl",
|
|
22
|
+
"gdt-lg",
|
|
23
|
+
"gdt-md",
|
|
24
|
+
"gdt-sm",
|
|
25
|
+
"gdt-xs",
|
|
26
|
+
"gdt-subtext",
|
|
27
|
+
"gdt-capitalized"
|
|
28
|
+
] }] } } });
|
|
29
|
+
function cn(...inputs) {
|
|
30
|
+
return twMerge(clsx(inputs));
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { cn };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//#region src/utils/format.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Formatters the components here already use, published because the same
|
|
4
|
+
* values get written outside a component as often as inside one — a duration
|
|
5
|
+
* in a table cell, initials on a server-rendered avatar, a date in an export.
|
|
6
|
+
*
|
|
7
|
+
* Every one is a pure function with no React and no styling, so a server-only
|
|
8
|
+
* module can import them.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Seconds as a clock: `3723` → `"1:02:03"`, `95` → `"1:35"`. The hours part is
|
|
12
|
+
* dropped below an hour rather than padded to `0:01:35`, so a short clip does
|
|
13
|
+
* not read as if it might be long.
|
|
14
|
+
*
|
|
15
|
+
* Anything that is not a finite number is `"0:00"` — a media element reports
|
|
16
|
+
* `NaN` for its duration until it has loaded metadata, and the alternative is
|
|
17
|
+
* `NaN:NaN` on screen for the first few frames.
|
|
18
|
+
*/
|
|
19
|
+
declare function formatDuration(value: number | undefined): string;
|
|
20
|
+
/**
|
|
21
|
+
* A date written out in full: `"08 August 2026"`. Day before month, because
|
|
22
|
+
* the product's audience reads it that way and `"8/8/2026"` is ambiguous
|
|
23
|
+
* between two conventions where a spelled month is not.
|
|
24
|
+
*/
|
|
25
|
+
declare function formatDate(value: Date, locale?: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* A time of day, 24-hour: `"14:05"`. A string passes through untouched, so a
|
|
28
|
+
* caller that already has the wording it wants — `"Yesterday"`, `"just now"` —
|
|
29
|
+
* can hand it over without this second-guessing it.
|
|
30
|
+
*/
|
|
31
|
+
declare function formatTimestamp(value: Date | string, locale?: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* A `datetime` attribute's value for a `<time>` element. A `Date` becomes ISO;
|
|
34
|
+
* a string is assumed to already be in a machine-readable form and passes
|
|
35
|
+
* through, matching {@link formatTimestamp}.
|
|
36
|
+
*/
|
|
37
|
+
declare function toDateTimeAttribute(value: Date | string): string;
|
|
38
|
+
/**
|
|
39
|
+
* The first letter of the first two words: `"Daniel Ikoyo"` → `"DI"`. Two and
|
|
40
|
+
* not three, because a monogram is a fallback for a missing photo and a third
|
|
41
|
+
* letter starts to compete with the name beside it.
|
|
42
|
+
*/
|
|
43
|
+
declare function getInitials(name: string): string;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { formatDate, formatDuration, formatTimestamp, getInitials, toDateTimeAttribute };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
//#region src/utils/format.ts
|
|
2
|
+
/**
|
|
3
|
+
* Formatters the components here already use, published because the same
|
|
4
|
+
* values get written outside a component as often as inside one — a duration
|
|
5
|
+
* in a table cell, initials on a server-rendered avatar, a date in an export.
|
|
6
|
+
*
|
|
7
|
+
* Every one is a pure function with no React and no styling, so a server-only
|
|
8
|
+
* module can import them.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Seconds as a clock: `3723` → `"1:02:03"`, `95` → `"1:35"`. The hours part is
|
|
12
|
+
* dropped below an hour rather than padded to `0:01:35`, so a short clip does
|
|
13
|
+
* not read as if it might be long.
|
|
14
|
+
*
|
|
15
|
+
* Anything that is not a finite number is `"0:00"` — a media element reports
|
|
16
|
+
* `NaN` for its duration until it has loaded metadata, and the alternative is
|
|
17
|
+
* `NaN:NaN` on screen for the first few frames.
|
|
18
|
+
*/
|
|
19
|
+
function formatDuration(value) {
|
|
20
|
+
if (!Number.isFinite(value)) return "0:00";
|
|
21
|
+
const safeValue = Math.max(0, Math.floor(value ?? 0));
|
|
22
|
+
const hours = Math.floor(safeValue / 3600);
|
|
23
|
+
const minutes = Math.floor(safeValue % 3600 / 60);
|
|
24
|
+
const seconds = safeValue % 60;
|
|
25
|
+
if (hours > 0) return `${hours}:${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}`;
|
|
26
|
+
return `${minutes}:${String(seconds).padStart(2, "0")}`;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A date written out in full: `"08 August 2026"`. Day before month, because
|
|
30
|
+
* the product's audience reads it that way and `"8/8/2026"` is ambiguous
|
|
31
|
+
* between two conventions where a spelled month is not.
|
|
32
|
+
*/
|
|
33
|
+
function formatDate(value, locale = "en-GB") {
|
|
34
|
+
return value.toLocaleDateString(locale, {
|
|
35
|
+
day: "2-digit",
|
|
36
|
+
month: "long",
|
|
37
|
+
year: "numeric"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A time of day, 24-hour: `"14:05"`. A string passes through untouched, so a
|
|
42
|
+
* caller that already has the wording it wants — `"Yesterday"`, `"just now"` —
|
|
43
|
+
* can hand it over without this second-guessing it.
|
|
44
|
+
*/
|
|
45
|
+
function formatTimestamp(value, locale) {
|
|
46
|
+
if (typeof value === "string") return value;
|
|
47
|
+
return value.toLocaleTimeString(locale ? [locale] : [], {
|
|
48
|
+
hour: "2-digit",
|
|
49
|
+
minute: "2-digit",
|
|
50
|
+
hour12: false
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A `datetime` attribute's value for a `<time>` element. A `Date` becomes ISO;
|
|
55
|
+
* a string is assumed to already be in a machine-readable form and passes
|
|
56
|
+
* through, matching {@link formatTimestamp}.
|
|
57
|
+
*/
|
|
58
|
+
function toDateTimeAttribute(value) {
|
|
59
|
+
return value instanceof Date ? value.toISOString() : value;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The first letter of the first two words: `"Daniel Ikoyo"` → `"DI"`. Two and
|
|
63
|
+
* not three, because a monogram is a fallback for a missing photo and a third
|
|
64
|
+
* letter starts to compete with the name beside it.
|
|
65
|
+
*/
|
|
66
|
+
function getInitials(name) {
|
|
67
|
+
return name.trim().split(/\s+/).slice(0, 2).map((part) => part[0]?.toUpperCase()).join("");
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { formatDate, formatDuration, formatTimestamp, getInitials, toDateTimeAttribute };
|