@giddaa-housing/ui 3.0.1 → 3.2.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/css/giddaa.css +173 -2
- package/css/preset.css +8 -1
- package/css/theme.css +4 -1
- package/dist/accordion.js +2 -2
- package/dist/activity-timeline.js +5 -5
- package/dist/alert.js +1 -1
- package/dist/auth-layout.js +18 -18
- package/dist/bar-chart.d.ts +1 -1
- package/dist/breadcrumb.js +3 -3
- package/dist/bullet-chart.d.ts +1 -1
- package/dist/button-group.d.ts +1 -1
- package/dist/button.js +2 -2
- package/dist/calendar.js +3 -3
- package/dist/call-card.js +1 -1
- package/dist/carousel.d.ts +1 -1
- package/dist/carousel.js +3 -3
- package/dist/chart.d.ts +1 -1
- package/dist/chart.js +1 -1
- package/dist/chat.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/combobox.d.ts +1 -1
- package/dist/combobox.js +6 -6
- package/dist/cta.js +3 -3
- package/dist/currency-selector.d.ts +10 -8
- package/dist/currency-selector.js +247 -28
- package/dist/data-table.js +2 -2
- package/dist/date-picker.js +6 -6
- package/dist/dialog.js +2 -2
- package/dist/dropdown-menu.d.ts +1 -1
- package/dist/dropdown-menu.js +20 -20
- package/dist/dropzone.js +1 -1
- package/dist/editorial-card.d.ts +20 -11
- package/dist/editorial-card.js +67 -2
- package/dist/file-upload.js +1 -1
- package/dist/filter.js +1 -1
- package/dist/footer.d.ts +4 -2
- package/dist/footer.js +38 -34
- package/dist/funnel-chart.d.ts +1 -1
- package/dist/heatmap-chart.d.ts +1 -1
- package/dist/icons.d.ts +93 -0
- package/dist/icons.js +905 -0
- package/dist/infinite-scroll.js +1 -1
- package/dist/input-group.js +4 -5
- package/dist/input-otp.js +2 -2
- package/dist/input-size-context.js +4 -2
- package/dist/input.js +1 -1
- package/dist/kpi-card.js +1 -1
- package/dist/line-chart.d.ts +1 -1
- package/dist/mask-input.d.ts +61 -0
- package/dist/mask-input.js +0 -0
- package/dist/match.js +1 -1
- package/dist/media-gallery-hero.js +1 -1
- package/dist/media-player.js +59 -48
- package/dist/message.js +1 -1
- package/dist/mobile-sidebar.d.ts +57 -0
- package/dist/mobile-sidebar.js +196 -0
- package/dist/multi-step-form.js +2 -2
- package/dist/number-input.d.ts +1 -1
- package/dist/number-input.js +3 -3
- package/dist/pagination.js +4 -4
- package/dist/password-input.js +1 -1
- package/dist/phone-input.d.ts +1 -1
- package/dist/phone-input.js +4 -4
- package/dist/photo-gallery.js +3 -3
- package/dist/pie-chart.d.ts +1 -1
- package/dist/popover.d.ts +1 -1
- package/dist/price-tag.js +1 -1
- package/dist/radar-chart.d.ts +1 -1
- package/dist/rich-text-editor.d.ts +1 -1
- package/dist/rich-text-editor.js +4 -4
- package/dist/scatter-chart.d.ts +1 -1
- package/dist/search-input.js +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/select.js +6 -6
- package/dist/sheet.js +2 -2
- package/dist/sidebar.js +1 -1
- package/dist/{size-context-D4mYvcg8.d.ts → size-context-BX6kAdVj.d.ts} +2 -1
- package/dist/size-context.d.ts +2 -2
- package/dist/size-context.js +5 -2
- package/dist/sparkline.d.ts +1 -1
- package/dist/stepper.js +2 -2
- package/dist/styles.css +681 -128
- package/dist/table.js +2 -2
- package/dist/tabs.d.ts +1 -1
- package/dist/tag.d.ts +1 -1
- package/dist/tag.js +1 -1
- package/dist/testimonial-block.js +1 -1
- package/dist/theme-switcher.d.ts +31 -0
- package/dist/theme-switcher.js +78 -0
- package/dist/time-picker.js +2 -2
- package/dist/toast.d.ts +38 -10
- package/dist/toast.js +55 -52
- package/dist/top-navbar.d.ts +100 -0
- package/dist/top-navbar.js +295 -0
- package/dist/tree-map.d.ts +1 -1
- package/dist/video-player-dialog.d.ts +57 -0
- package/dist/video-player-dialog.js +188 -0
- package/dist/waterfall-chart.d.ts +1 -1
- package/package.json +25 -2
package/dist/infinite-scroll.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { Loader2 } from "./icons.js";
|
|
2
3
|
import { t as cn } from "./cn-BI_4DMBf.js";
|
|
3
|
-
import { Loader2 } from "lucide-react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
//#region src/lib/use-intersection.ts
|
package/dist/input-group.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as cn } from "./cn-BI_4DMBf.js";
|
|
3
|
-
import { SizeProvider
|
|
3
|
+
import { SizeProvider } from "./size-context.js";
|
|
4
4
|
import { Button } from "./button.js";
|
|
5
|
-
import { InputSizeProvider } from "./input-size-context.js";
|
|
5
|
+
import { InputSizeProvider, useInputComponentSize } from "./input-size-context.js";
|
|
6
6
|
import { Input } from "./input.js";
|
|
7
7
|
import { Textarea } from "./textarea.js";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
import { cva } from "class-variance-authority";
|
|
10
10
|
//#region src/input-group.tsx
|
|
11
|
-
const inputGroupVariants = cva("group/input-group relative flex w-full min-w-0 items-center rounded-full has-[textarea]:rounded-xl has-data-[align=block-end]:rounded-xl has-data-[align=block-start]:rounded-xl border border-line bg-canvas transition-[background-color,border-color,box-shadow,color] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:border-line-subtle has-disabled:bg-surface has-disabled:text-fg-caption-placeholder focus-within:border-line-focus focus-within:inset-ring-1 focus-within:inset-ring-line-focus has-[[data-slot][aria-invalid=true]]:border-line-danger has-[[data-slot][aria-invalid=true]]:inset-shadow-none has-[[data-slot][aria-invalid=true]]:focus-within:border-line-danger has-[[data-slot][aria-invalid=true]]:focus-within:inset-ring-line-danger has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:group-data-[size=sm]/input-group:pl-2 has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:group-data-[size=md]/input-group:pl-2.5 has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:group-data-[size=lg]/input-group:pl-3 has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:group-data-[size=xl]/input-group:pl-3 has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:group-data-[size=sm]/input-group:pr-2 has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:group-data-[size=md]/input-group:pr-2.5 has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:group-data-[size=lg]/input-group:pr-3 has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:group-data-[size=xl]/input-group:pr-3", {
|
|
11
|
+
const inputGroupVariants = cva("group/input-group relative flex w-full min-w-0 items-center overflow-hidden rounded-full has-[textarea]:rounded-xl has-data-[align=block-end]:rounded-xl has-data-[align=block-start]:rounded-xl border border-line bg-canvas transition-[background-color,border-color,box-shadow,color] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:border-line-subtle has-disabled:bg-surface has-disabled:text-fg-caption-placeholder focus-within:border-line-focus focus-within:inset-ring-1 focus-within:inset-ring-line-focus has-[[data-slot][aria-invalid=true]]:border-line-danger has-[[data-slot][aria-invalid=true]]:inset-shadow-none has-[[data-slot][aria-invalid=true]]:focus-within:border-line-danger has-[[data-slot][aria-invalid=true]]:focus-within:inset-ring-line-danger has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:group-data-[size=sm]/input-group:pl-2 has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:group-data-[size=md]/input-group:pl-2.5 has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:group-data-[size=lg]/input-group:pl-3 has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:group-data-[size=xl]/input-group:pl-3 has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:group-data-[size=sm]/input-group:pr-2 has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:group-data-[size=md]/input-group:pr-2.5 has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:group-data-[size=lg]/input-group:pr-3 has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:group-data-[size=xl]/input-group:pr-3", {
|
|
12
12
|
variants: { size: {
|
|
13
13
|
sm: "h-8",
|
|
14
14
|
md: "h-10",
|
|
@@ -18,8 +18,7 @@ const inputGroupVariants = cva("group/input-group relative flex w-full min-w-0 i
|
|
|
18
18
|
defaultVariants: { size: "md" }
|
|
19
19
|
});
|
|
20
20
|
function InputGroup({ className, size, ...props }) {
|
|
21
|
-
const
|
|
22
|
-
const resolvedSize = size ?? inheritedSize;
|
|
21
|
+
const resolvedSize = useInputComponentSize(size);
|
|
23
22
|
return /* @__PURE__ */ jsx(SizeProvider, {
|
|
24
23
|
size: resolvedSize === "xl" ? void 0 : resolvedSize,
|
|
25
24
|
children: /* @__PURE__ */ jsx(InputSizeProvider, {
|
package/dist/input-otp.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { Minus } from "./icons.js";
|
|
2
3
|
import { t as cn } from "./cn-BI_4DMBf.js";
|
|
3
4
|
import { InputSizeProvider, useInputComponentSize } from "./input-size-context.js";
|
|
4
|
-
import { MinusIcon } from "lucide-react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { cva } from "class-variance-authority";
|
|
7
7
|
import { OTPField } from "@base-ui/react/otp-field";
|
|
@@ -49,7 +49,7 @@ function InputOTPSeparator({ children, className, ...props }) {
|
|
|
49
49
|
"data-slot": "input-otp-separator",
|
|
50
50
|
className: cn("flex items-center justify-center px-1 text-fg-secondary [&_svg:not([class*='size-'])]:size-4", className),
|
|
51
51
|
...props,
|
|
52
|
-
children: children ?? /* @__PURE__ */ jsx(
|
|
52
|
+
children: children ?? /* @__PURE__ */ jsx(Minus, {})
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
//#endregion
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { useInheritedComponentSize } from "./size-context.js";
|
|
2
3
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
3
4
|
import { createContext, useContext } from "react";
|
|
4
5
|
//#region src/input-size-context.tsx
|
|
@@ -11,8 +12,9 @@ function InputSizeProvider({ children, size }) {
|
|
|
11
12
|
});
|
|
12
13
|
}
|
|
13
14
|
function useInputComponentSize(size, fallback = "md") {
|
|
14
|
-
const
|
|
15
|
-
|
|
15
|
+
const inheritedInputSize = useContext(InputSizeContext);
|
|
16
|
+
const inheritedComponentSize = useInheritedComponentSize();
|
|
17
|
+
return size ?? inheritedInputSize ?? inheritedComponentSize ?? fallback;
|
|
16
18
|
}
|
|
17
19
|
//#endregion
|
|
18
20
|
export { InputSizeProvider, useInputComponentSize };
|
package/dist/input.js
CHANGED
|
@@ -5,7 +5,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
import { cva } from "class-variance-authority";
|
|
6
6
|
import { Input as Input$1 } from "@base-ui/react/input";
|
|
7
7
|
//#region src/input.tsx
|
|
8
|
-
const inputVariants = cva("flex w-full min-w-0 rounded-full border border-line bg-canvas text-fg-primary transition-[background-color,border-color,box-shadow,color] outline-none file:inline-flex file:border-0 file:bg-transparent file:font-normal file:text-fg-primary placeholder:text-fg-caption-placeholder hover:border-line-strong focus-visible:border-line-focus focus-visible:inset-ring-1 focus-visible:inset-ring-line-focus disabled:pointer-events-none disabled:cursor-not-allowed disabled:border-line-subtle disabled:bg-surface disabled:text-fg-caption-placeholder disabled:placeholder:text-fg-caption-placeholder aria-invalid:border-line-danger aria-invalid:text-fg-danger aria-invalid:placeholder:text-fg-danger aria-invalid:shadow-none aria-invalid:focus-visible:border-line-danger aria-invalid:focus-visible:inset-ring-line-danger", {
|
|
8
|
+
const inputVariants = cva("flex w-full min-w-0 rounded-full border border-line bg-canvas text-fg-primary transition-[background-color,border-color,box-shadow,color] outline-none file:inline-flex file:border-0 file:bg-transparent file:font-normal file:text-fg-primary placeholder:text-fg-caption-placeholder hover:border-line-strong focus-visible:border-line-focus focus-visible:inset-ring-1 focus-visible:inset-ring-line-focus disabled:pointer-events-none disabled:cursor-not-allowed disabled:border-line-subtle disabled:bg-surface disabled:text-fg-caption-placeholder disabled:placeholder:text-fg-caption-placeholder aria-invalid:border-line-danger aria-invalid:text-fg-danger aria-invalid:placeholder:text-fg-danger aria-invalid:shadow-none aria-invalid:focus-visible:border-line-danger aria-invalid:focus-visible:inset-ring-line-danger autofill:border-line autofill:bg-canvas autofill:[-webkit-text-fill-color:var(--color-fg-primary)] autofill:[box-shadow:0_0_0_1000px_var(--color-canvas)_inset]", {
|
|
9
9
|
variants: { size: {
|
|
10
10
|
sm: "h-8 px-3 text-gdt-xs font-normal file:text-gdt-xs",
|
|
11
11
|
md: "h-10 px-3.5 text-gdt-sm font-normal file:text-gdt-sm",
|
package/dist/kpi-card.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { ArrowDown, ArrowUp, ArrowUpRight } from "./icons.js";
|
|
2
3
|
import { t as cn } from "./cn-BI_4DMBf.js";
|
|
3
4
|
import { Skeleton } from "./skeleton.js";
|
|
4
|
-
import { ArrowDown, ArrowUp, ArrowUpRight } from "lucide-react";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
7
7
|
import { useRender } from "@base-ui/react/use-render";
|
package/dist/line-chart.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ComponentSize } from "./size-context-
|
|
1
|
+
import { t as ComponentSize } from "./size-context-BX6kAdVj.js";
|
|
2
2
|
import { ChartConfig } from "./chart.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Area, AreaChart as AreaChart$1, CartesianGrid, Line, LineChart as LineChart$1, XAxis, YAxis } from "recharts";
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { t as Input } from "./input-CfoEJ8A6.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
//#region src/mask-input.d.ts
|
|
4
|
+
type MaskToken = {
|
|
5
|
+
pattern: RegExp;
|
|
6
|
+
transform?: (char: string) => string;
|
|
7
|
+
};
|
|
8
|
+
declare const defaultTokens: Record<string, MaskToken>;
|
|
9
|
+
declare const maskPresets: {
|
|
10
|
+
creditCard: string;
|
|
11
|
+
cvc: string;
|
|
12
|
+
date: string;
|
|
13
|
+
phoneNg: string;
|
|
14
|
+
time: string;
|
|
15
|
+
};
|
|
16
|
+
type MaskPreset = keyof typeof maskPresets;
|
|
17
|
+
type MaskInputOptions = {
|
|
18
|
+
allowNegative?: boolean;
|
|
19
|
+
currency?: string;
|
|
20
|
+
decimalScale?: number;
|
|
21
|
+
fixedDecimalScale?: boolean;
|
|
22
|
+
locale?: string;
|
|
23
|
+
mask?: string;
|
|
24
|
+
max?: number;
|
|
25
|
+
min?: number;
|
|
26
|
+
numeric?: boolean;
|
|
27
|
+
preset?: MaskPreset;
|
|
28
|
+
prefix?: string;
|
|
29
|
+
suffix?: string;
|
|
30
|
+
thousandSeparator?: boolean;
|
|
31
|
+
tokens?: Record<string, MaskToken>;
|
|
32
|
+
};
|
|
33
|
+
type MaskedValue = {
|
|
34
|
+
/** What the input displays: affixes, separators and all. */
|
|
35
|
+
masked: string;
|
|
36
|
+
/** The characters the user owns — token characters, or a plain number string. */
|
|
37
|
+
unmasked: string;
|
|
38
|
+
/** `unmasked` parsed, or `null` while it isn't a finished number. */
|
|
39
|
+
number: number | null;
|
|
40
|
+
/** Parallel to `masked`: true where the character came from `unmasked`. */
|
|
41
|
+
editable: boolean[];
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Format a value exactly as `MaskInput` would — useful for rendering the same
|
|
45
|
+
* amounts outside an input (table cells, summaries) without duplicating rules.
|
|
46
|
+
*/
|
|
47
|
+
declare function formatMaskValue(input: string | number, options?: MaskInputOptions): MaskedValue;
|
|
48
|
+
type MaskInputProps = Omit<React.ComponentProps<typeof Input>, "value" | "defaultValue" | "onChange" | "prefix" | "min" | "max"> & MaskInputOptions & {
|
|
49
|
+
/** Controlled value. Accepts either the masked or the unmasked form. */
|
|
50
|
+
value?: string | number;
|
|
51
|
+
/** Uncontrolled initial value. */
|
|
52
|
+
defaultValue?: string | number;
|
|
53
|
+
/** Reject a keystroke by returning `false`. Runs on every proposed change with the partial value, so allow in-progress input. */
|
|
54
|
+
validate?: (value: MaskedValue) => boolean;
|
|
55
|
+
/** Fires whenever the value changes, with the display and raw forms. */
|
|
56
|
+
onValueChange?: (value: MaskedValue) => void;
|
|
57
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
58
|
+
};
|
|
59
|
+
declare function MaskInput({ allowNegative, currency, decimalScale, defaultValue, fixedDecimalScale, inputMode, locale, mask, max, min, numeric, onBlur, onChange, onClick, onKeyDown, onValueChange, preset, prefix, ref, suffix, thousandSeparator, tokens, validate, value, ...props }: MaskInputProps): React.JSX.Element;
|
|
60
|
+
//#endregion
|
|
61
|
+
export { MaskInput, type MaskInputOptions, type MaskInputProps, type MaskPreset, type MaskToken, type MaskedValue, formatMaskValue, defaultTokens as maskInputTokens, maskPresets };
|
|
Binary file
|
package/dist/match.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { ChevronDown } from "./icons.js";
|
|
2
3
|
import { t as cn } from "./cn-BI_4DMBf.js";
|
|
3
4
|
import { CircularProgress } from "./progress.js";
|
|
4
|
-
import { ChevronDown } from "lucide-react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { cva } from "class-variance-authority";
|
|
7
7
|
//#region src/match.tsx
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { Play } from "./icons.js";
|
|
2
3
|
import { t as cn } from "./cn-BI_4DMBf.js";
|
|
3
4
|
import { buttonVariants } from "./button.js";
|
|
4
5
|
import { Carousel, CarouselContent, CarouselItem, useCarousel } from "./carousel.js";
|
|
5
6
|
import { GalleryIndicator } from "./gallery-indicator.js";
|
|
6
7
|
import { ReviewBlock } from "./review-block.js";
|
|
7
|
-
import { Play } from "lucide-react";
|
|
8
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { cva } from "class-variance-authority";
|
|
10
10
|
//#region src/media-gallery-hero.tsx
|
package/dist/media-player.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { Captions, CaptionsOff, Maximize, Minimize, Pause, PictureInPicture2, Play, RefreshCcw, Repeat2, RotateCcw, RotateCw, Settings, TriangleAlert, Volume1, Volume2, VolumeX } from "./icons.js";
|
|
2
3
|
import { t as cn } from "./cn-BI_4DMBf.js";
|
|
3
4
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./dropdown-menu.js";
|
|
4
5
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.js";
|
|
5
|
-
import { Captions, CaptionsOff, Maximize, Minimize, Pause, PictureInPicture2, Play, RefreshCcw, Repeat2, RotateCcw, RotateCw, Settings, TriangleAlert, Volume1, Volume2, VolumeX } from "lucide-react";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import { Slider } from "@base-ui/react/slider";
|
|
@@ -20,6 +20,9 @@ const DEFAULT_PLAYBACK_RATES = [
|
|
|
20
20
|
];
|
|
21
21
|
const CONTROLS_HIDE_DELAY = 2500;
|
|
22
22
|
const SEEK_PREVIEW_WIDTH = 160;
|
|
23
|
+
const SEEK_CHAPTER_GAP = 3;
|
|
24
|
+
const SEEK_THUMB_SIZE = 14;
|
|
25
|
+
const SEEK_THUMB_INSET = SEEK_THUMB_SIZE / 2;
|
|
23
26
|
const MediaPlayerContext = React.createContext({
|
|
24
27
|
onMenuOpenChange: () => {},
|
|
25
28
|
portalContainer: null,
|
|
@@ -73,11 +76,8 @@ function clamp(value, min, max) {
|
|
|
73
76
|
}
|
|
74
77
|
function getSeekValueFromPointer(event, min, max) {
|
|
75
78
|
const rect = event.currentTarget.getBoundingClientRect();
|
|
76
|
-
const
|
|
77
|
-
return
|
|
78
|
-
percent: percent * 100,
|
|
79
|
-
value: min + percent * (max - min)
|
|
80
|
-
};
|
|
79
|
+
const travel = Math.max(rect.width - SEEK_THUMB_SIZE, 1);
|
|
80
|
+
return min + clamp((event.clientX - rect.left - SEEK_THUMB_INSET) / travel, 0, 1) * (max - min);
|
|
81
81
|
}
|
|
82
82
|
function MediaPlayer({ mediaStore, ...props }) {
|
|
83
83
|
const audio = props.audio ?? (hasAudioChild(props.children) ? true : void 0);
|
|
@@ -272,7 +272,7 @@ function MediaPlayerVideo({ className, ref, ...props }) {
|
|
|
272
272
|
setRef(ref, node);
|
|
273
273
|
}, [ref]),
|
|
274
274
|
"data-slot": "media-player-video",
|
|
275
|
-
className: cn("block aspect-video size-full object-cover", "group-data-[fullscreen]/media-player:aspect-auto group-data-[fullscreen]/media-player:object-contain", className),
|
|
275
|
+
className: cn("block aspect-video size-full rounded-[inherit] object-cover", "group-data-[fullscreen]/media-player:aspect-auto group-data-[fullscreen]/media-player:object-contain", className),
|
|
276
276
|
playsInline: true,
|
|
277
277
|
...props
|
|
278
278
|
});
|
|
@@ -646,24 +646,28 @@ function MediaPlayerSeek({ className, disabled, onValueChange, "aria-label": ari
|
|
|
646
646
|
detail: void 0
|
|
647
647
|
});
|
|
648
648
|
};
|
|
649
|
+
const toFraction = (value) => canSeek ? (clamp(value, min, max) - min) / (max - min) : 0;
|
|
650
|
+
const toTrackOffset = (fraction) => {
|
|
651
|
+
if (fraction <= 0) return "0px";
|
|
652
|
+
if (fraction >= 1) return "100%";
|
|
653
|
+
return `calc(${SEEK_THUMB_INSET}px + ${fraction} * (100% - ${SEEK_THUMB_SIZE}px))`;
|
|
654
|
+
};
|
|
649
655
|
const previewValue = dragValue ?? hoverValue;
|
|
650
|
-
const previewPercent = previewValue !== null && canSeek ? (clamp(previewValue, min, max) - min) / (max - min) * 100 : 0;
|
|
651
656
|
const previewChapter = previewValue !== null ? chapterCues?.find((cue) => previewValue >= cue.startTime && previewValue < cue.endTime) : void 0;
|
|
652
657
|
const previewCoordValues = previewCoords?.map(Number);
|
|
653
658
|
const hasSpriteCoords = previewCoordValues?.length === 4 && (previewCoordValues[2] ?? 0) > 0;
|
|
654
659
|
const previewScale = hasSpriteCoords ? SEEK_PREVIEW_WIDTH / (previewCoordValues?.[2] ?? 1) : 1;
|
|
655
660
|
const previewClampPx = previewImage ? 84 : 32;
|
|
656
661
|
const controlRect = withTime && previewValue !== null ? controlRef.current?.getBoundingClientRect() : void 0;
|
|
657
|
-
const previewLeft = controlRect ? clamp(controlRect.left +
|
|
658
|
-
const
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
}));
|
|
662
|
+
const previewLeft = controlRect ? clamp(controlRect.left + SEEK_THUMB_INSET + toFraction(previewValue ?? 0) * (controlRect.width - SEEK_THUMB_SIZE), controlRect.left + previewClampPx, controlRect.right - previewClampPx) : 0;
|
|
663
|
+
const playedFraction = toFraction(displayTime);
|
|
664
|
+
const chapterStops = canSeek ? (chapterCues ?? []).map((cue) => toFraction(cue.startTime)).filter((fraction) => fraction > 0 && fraction < 1).sort((a, b) => a - b).map(toTrackOffset) : [];
|
|
665
|
+
const trackMask = chapterStops.length ? `linear-gradient(to right, #000 0, ${chapterStops.flatMap((offset) => [
|
|
666
|
+
`#000 calc(${offset} - ${SEEK_CHAPTER_GAP / 2}px)`,
|
|
667
|
+
`transparent calc(${offset} - ${SEEK_CHAPTER_GAP / 2}px)`,
|
|
668
|
+
`transparent calc(${offset} + ${SEEK_CHAPTER_GAP / 2}px)`,
|
|
669
|
+
`#000 calc(${offset} + ${SEEK_CHAPTER_GAP / 2}px)`
|
|
670
|
+
]).join(", ")}, #000 100%)` : void 0;
|
|
667
671
|
return /* @__PURE__ */ jsxs(Slider.Root, {
|
|
668
672
|
thumbAlignment: "edge",
|
|
669
673
|
"data-slot": "media-player-seek",
|
|
@@ -735,45 +739,52 @@ function MediaPlayerSeek({ className, disabled, onValueChange, "aria-label": ari
|
|
|
735
739
|
]
|
|
736
740
|
}), portalContainer ?? document.body), /* @__PURE__ */ jsxs(Slider.Control, {
|
|
737
741
|
ref: controlRef,
|
|
738
|
-
className: "flex h-8 w-full items-center",
|
|
742
|
+
className: "relative flex h-8 w-full items-center",
|
|
739
743
|
onPointerLeave: () => {
|
|
740
744
|
if (dragValue === null) clearPreview();
|
|
741
745
|
},
|
|
742
746
|
onPointerMove: (event) => {
|
|
743
747
|
if (resolvedDisabled || dragValue !== null) return;
|
|
744
748
|
const next = getSeekValueFromPointer(event, min, max);
|
|
745
|
-
setHoverValue(next
|
|
746
|
-
previewAt(next
|
|
749
|
+
setHoverValue(next);
|
|
750
|
+
previewAt(next);
|
|
747
751
|
},
|
|
748
|
-
children: [/* @__PURE__ */
|
|
749
|
-
className: "relative
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
752
|
+
children: [/* @__PURE__ */ jsxs(Slider.Track, {
|
|
753
|
+
className: "relative h-2 w-full overflow-hidden rounded-full bg-line-subtle/65",
|
|
754
|
+
style: trackMask ? {
|
|
755
|
+
maskImage: trackMask,
|
|
756
|
+
WebkitMaskImage: trackMask
|
|
757
|
+
} : void 0,
|
|
758
|
+
children: [
|
|
759
|
+
canSeek && buffered?.map(([bufferStart, bufferEnd]) => /* @__PURE__ */ jsx("span", {
|
|
760
|
+
"data-slot": "media-player-seek-buffered",
|
|
761
|
+
className: "absolute inset-y-0 bg-fg-on-brand/25",
|
|
762
|
+
style: {
|
|
763
|
+
left: toTrackOffset(toFraction(bufferStart)),
|
|
764
|
+
right: `calc(100% - ${toTrackOffset(toFraction(bufferEnd))})`
|
|
765
|
+
}
|
|
766
|
+
}, `${bufferStart}-${bufferEnd}`)),
|
|
767
|
+
/* @__PURE__ */ jsx("span", {
|
|
768
|
+
"data-slot": "media-player-seek-progress",
|
|
769
|
+
className: "absolute inset-y-0 left-0 bg-surface-brand",
|
|
770
|
+
style: { width: SEEK_THUMB_INSET }
|
|
771
|
+
}),
|
|
772
|
+
/* @__PURE__ */ jsx("span", {
|
|
773
|
+
"data-slot": "media-player-seek-progress",
|
|
774
|
+
"data-dragging": dragValue !== null || void 0,
|
|
775
|
+
className: "absolute inset-y-0 origin-left bg-surface-brand transition-transform duration-200 ease-linear data-[dragging=true]:transition-none",
|
|
776
|
+
style: {
|
|
777
|
+
left: SEEK_THUMB_INSET,
|
|
778
|
+
transform: `scaleX(${playedFraction})`,
|
|
779
|
+
width: `calc(100% - ${SEEK_THUMB_SIZE}px)`
|
|
780
|
+
}
|
|
781
|
+
})
|
|
782
|
+
]
|
|
773
783
|
}), /* @__PURE__ */ jsx(Slider.Thumb, {
|
|
774
784
|
getAriaLabel: () => ariaLabel ?? "Media timeline",
|
|
775
785
|
getAriaValueText: (_formatted, value) => `${formatTime(value)} of ${formatTime(max)}`,
|
|
776
|
-
className: cn("
|
|
786
|
+
className: cn("group/seek-thumb size-[14px] rounded-full outline-none", "transition-[inset-inline-start] duration-200 ease-linear data-[dragging]:transition-none"),
|
|
787
|
+
children: /* @__PURE__ */ jsx("span", { className: cn("block size-full rounded-full border-2 border-surface-brand bg-surface-overlay shadow-2", "transition-[scale] duration-[var(--duration-motion-press)] ease-gdt-out group-data-[dragging]/seek-thumb:scale-125 motion-reduce:group-data-[dragging]/seek-thumb:scale-100", "group-has-[:focus-visible]/seek-thumb:[filter:drop-shadow(0_0_0.25rem_var(--color-line-focus))]") })
|
|
777
788
|
})]
|
|
778
789
|
})]
|
|
779
790
|
});
|
|
@@ -888,7 +899,7 @@ function MediaPlayerError({ children, className, ...props }) {
|
|
|
888
899
|
return /* @__PURE__ */ jsx("div", {
|
|
889
900
|
"data-slot": "media-player-error",
|
|
890
901
|
role: "alert",
|
|
891
|
-
className: cn("absolute inset-0 z-20 flex flex-col items-center justify-center gap-1 bg-canvas/85 px-6 text-center text-fg-primary backdrop-blur-sm
|
|
902
|
+
className: cn("absolute inset-0 z-20 flex flex-col items-center justify-center gap-1 rounded-[inherit] bg-canvas/85 px-6 text-center text-fg-primary backdrop-blur-sm", className),
|
|
892
903
|
...props,
|
|
893
904
|
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
894
905
|
/* @__PURE__ */ jsx(TriangleAlert, {
|
package/dist/message.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { CheckCheck } from "./icons.js";
|
|
2
3
|
import { t as cn } from "./cn-BI_4DMBf.js";
|
|
3
|
-
import { CheckCheck } from "lucide-react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
6
6
|
import { useRender } from "@base-ui/react/use-render";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./collapsible.js";
|
|
2
|
+
import { Sheet, SheetBody, SheetClose, SheetContent, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from "./sheet.js";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
//#region src/mobile-sidebar.d.ts
|
|
6
|
+
type MobileSidebarRootProps = React.ComponentProps<typeof Sheet>;
|
|
7
|
+
declare function MobileSidebarRoot(props: MobileSidebarRootProps): React.JSX.Element;
|
|
8
|
+
declare function MobileSidebarTrigger({ className, children, ...props }: React.ComponentProps<typeof SheetTrigger>): React.JSX.Element;
|
|
9
|
+
type MobileSidebarContentProps = Omit<Extract<React.ComponentProps<typeof SheetContent>, {
|
|
10
|
+
side?: "left" | "right";
|
|
11
|
+
}>, "side" | "size">;
|
|
12
|
+
declare function MobileSidebarContent({ className, showCloseButton, ...props }: MobileSidebarContentProps): React.JSX.Element;
|
|
13
|
+
declare function MobileSidebarHeader({ className, ...props }: React.ComponentProps<typeof SheetHeader>): React.JSX.Element;
|
|
14
|
+
declare function MobileSidebarTitle({ className, ...props }: React.ComponentProps<typeof SheetTitle>): React.JSX.Element;
|
|
15
|
+
declare function MobileSidebarClose({ className, children, ...props }: React.ComponentProps<typeof SheetClose>): React.JSX.Element;
|
|
16
|
+
declare function MobileSidebarBody({ className, ...props }: React.ComponentProps<typeof SheetBody>): React.JSX.Element;
|
|
17
|
+
declare function MobileSidebarFooter({ className, ...props }: React.ComponentProps<typeof SheetFooter>): React.JSX.Element;
|
|
18
|
+
declare function MobileSidebarNav({ className, ...props }: React.ComponentProps<"nav">): React.JSX.Element;
|
|
19
|
+
declare function MobileSidebarList({ className, ...props }: React.ComponentProps<"ul">): React.JSX.Element;
|
|
20
|
+
declare function MobileSidebarItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
|
21
|
+
type MobileSidebarLinkProps = useRender.ComponentProps<"a"> & {
|
|
22
|
+
active?: boolean;
|
|
23
|
+
icon?: React.ReactNode;
|
|
24
|
+
};
|
|
25
|
+
declare function MobileSidebarLink({ active, icon, className, children, render, ...props }: MobileSidebarLinkProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
26
|
+
declare function MobileSidebarGroup({ className, ...props }: React.ComponentProps<typeof Collapsible>): React.JSX.Element;
|
|
27
|
+
type MobileSidebarGroupTriggerProps = React.ComponentProps<typeof CollapsibleTrigger> & {
|
|
28
|
+
active?: boolean;
|
|
29
|
+
icon?: React.ReactNode;
|
|
30
|
+
};
|
|
31
|
+
declare function MobileSidebarGroupTrigger({ active, icon, className, children, ...props }: MobileSidebarGroupTriggerProps): React.JSX.Element;
|
|
32
|
+
declare function MobileSidebarGroupPanel({ className, ...props }: React.ComponentProps<typeof CollapsibleContent>): React.JSX.Element;
|
|
33
|
+
declare function MobileSidebarSubList({ className, ...props }: React.ComponentProps<"ul">): React.JSX.Element;
|
|
34
|
+
declare function MobileSidebarSubheading({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
|
35
|
+
declare function MobileSidebarSubLink({ className, render, ...props }: useRender.ComponentProps<"a">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
36
|
+
declare const MobileSidebar: {
|
|
37
|
+
Root: typeof MobileSidebarRoot;
|
|
38
|
+
Trigger: typeof MobileSidebarTrigger;
|
|
39
|
+
Content: typeof MobileSidebarContent;
|
|
40
|
+
Header: typeof MobileSidebarHeader;
|
|
41
|
+
Title: typeof MobileSidebarTitle;
|
|
42
|
+
Close: typeof MobileSidebarClose;
|
|
43
|
+
Body: typeof MobileSidebarBody;
|
|
44
|
+
Footer: typeof MobileSidebarFooter;
|
|
45
|
+
Nav: typeof MobileSidebarNav;
|
|
46
|
+
List: typeof MobileSidebarList;
|
|
47
|
+
Item: typeof MobileSidebarItem;
|
|
48
|
+
Link: typeof MobileSidebarLink;
|
|
49
|
+
Group: typeof MobileSidebarGroup;
|
|
50
|
+
GroupTrigger: typeof MobileSidebarGroupTrigger;
|
|
51
|
+
GroupPanel: typeof MobileSidebarGroupPanel;
|
|
52
|
+
SubList: typeof MobileSidebarSubList;
|
|
53
|
+
Subheading: typeof MobileSidebarSubheading;
|
|
54
|
+
SubLink: typeof MobileSidebarSubLink;
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
57
|
+
export { MobileSidebar, MobileSidebarBody, MobileSidebarClose, MobileSidebarContent, type MobileSidebarContentProps, MobileSidebarFooter, MobileSidebarGroup, MobileSidebarGroupPanel, MobileSidebarGroupTrigger, type MobileSidebarGroupTriggerProps, MobileSidebarHeader, MobileSidebarItem, MobileSidebarLink, type MobileSidebarLinkProps, MobileSidebarList, MobileSidebarNav, MobileSidebarRoot, type MobileSidebarRootProps, MobileSidebarSubLink, MobileSidebarSubList, MobileSidebarSubheading, MobileSidebarTitle, MobileSidebarTrigger };
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ChevronDown, Menu, X } from "./icons.js";
|
|
3
|
+
import { t as cn } from "./cn-BI_4DMBf.js";
|
|
4
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./collapsible.js";
|
|
5
|
+
import { Sheet, SheetBody, SheetClose, SheetContent, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from "./sheet.js";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
8
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
9
|
+
//#region src/mobile-sidebar.tsx
|
|
10
|
+
function MobileSidebarRoot(props) {
|
|
11
|
+
return /* @__PURE__ */ jsx(Sheet, { ...props });
|
|
12
|
+
}
|
|
13
|
+
function MobileSidebarTrigger({ className, children, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(SheetTrigger, {
|
|
15
|
+
"data-slot": "mobile-sidebar-trigger",
|
|
16
|
+
className: cn("inline-flex size-10 items-center justify-center rounded-lg text-fg-secondary outline-none transition-[background-color,color,translate] duration-(--duration-motion-press) ease-gdt-out hover:bg-surface hover:text-fg-primary focus-visible:shadow-[0_0_0_2px_var(--color-line-focus)] active:translate-y-px motion-reduce:active:translate-y-0", className),
|
|
17
|
+
...props,
|
|
18
|
+
children: children ?? /* @__PURE__ */ jsx(Menu, {
|
|
19
|
+
"aria-hidden": "true",
|
|
20
|
+
className: "size-6"
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function MobileSidebarContent({ className, showCloseButton = false, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx(SheetContent, {
|
|
26
|
+
"data-slot": "mobile-sidebar-content",
|
|
27
|
+
side: "right",
|
|
28
|
+
size: "sm",
|
|
29
|
+
showCloseButton,
|
|
30
|
+
className: cn("h-dvh w-[min(100vw,24.375rem)] rounded-none border-y-0 border-r-0 bg-canvas [--sheet-padding-x:1.25rem] [--sheet-padding-top:0.8125rem]", className),
|
|
31
|
+
...props
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function MobileSidebarHeader({ className, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ jsx(SheetHeader, {
|
|
36
|
+
"data-slot": "mobile-sidebar-header",
|
|
37
|
+
className: cn("min-h-16 flex-row items-center justify-between gap-4 px-5 py-[13px]", className),
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function MobileSidebarTitle({ className, ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsx(SheetTitle, {
|
|
43
|
+
"data-slot": "mobile-sidebar-title",
|
|
44
|
+
className: cn("sr-only", className),
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function MobileSidebarClose({ className, children, ...props }) {
|
|
49
|
+
return /* @__PURE__ */ jsx(SheetClose, {
|
|
50
|
+
"data-slot": "mobile-sidebar-close",
|
|
51
|
+
className: cn("inline-flex size-8 shrink-0 items-center justify-center rounded-lg text-fg-primary outline-none transition-[background-color,translate] duration-(--duration-motion-press) ease-gdt-out hover:bg-surface focus-visible:shadow-[0_0_0_2px_var(--color-line-focus)] active:translate-y-px motion-reduce:active:translate-y-0", className),
|
|
52
|
+
...props,
|
|
53
|
+
children: children ?? /* @__PURE__ */ jsx(X, {
|
|
54
|
+
"aria-hidden": "true",
|
|
55
|
+
className: "size-5"
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function MobileSidebarBody({ className, ...props }) {
|
|
60
|
+
return /* @__PURE__ */ jsx(SheetBody, {
|
|
61
|
+
"data-slot": "mobile-sidebar-body",
|
|
62
|
+
className: cn("flex flex-col px-5 py-3", className),
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function MobileSidebarFooter({ className, ...props }) {
|
|
67
|
+
return /* @__PURE__ */ jsx(SheetFooter, {
|
|
68
|
+
"data-slot": "mobile-sidebar-footer",
|
|
69
|
+
className: cn("flex-col items-stretch gap-3 px-5 py-4 [&>*]:w-full", className),
|
|
70
|
+
...props
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function MobileSidebarNav({ className, ...props }) {
|
|
74
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
75
|
+
"data-slot": "mobile-sidebar-nav",
|
|
76
|
+
className,
|
|
77
|
+
...props
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function MobileSidebarList({ className, ...props }) {
|
|
81
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
82
|
+
"data-slot": "mobile-sidebar-list",
|
|
83
|
+
className: cn("flex flex-col", className),
|
|
84
|
+
...props
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function MobileSidebarItem({ className, ...props }) {
|
|
88
|
+
return /* @__PURE__ */ jsx("li", {
|
|
89
|
+
"data-slot": "mobile-sidebar-item",
|
|
90
|
+
className: cn("min-w-0", className),
|
|
91
|
+
...props
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function MobileSidebarLink({ active = false, icon, className, children, render, ...props }) {
|
|
95
|
+
return useRender({
|
|
96
|
+
defaultTagName: "a",
|
|
97
|
+
props: mergeProps({
|
|
98
|
+
"aria-current": active ? "page" : void 0,
|
|
99
|
+
className: cn("group/mobile-sidebar-link grid min-h-11 w-full grid-cols-1 items-center rounded-xl px-2 py-2.5 text-left text-gdt-md font-semibold text-fg-primary outline-none transition-colors hover:bg-surface focus-visible:shadow-[0_0_0_2px_var(--color-line-focus)]", active && "bg-surface-brand-subtle text-fg-brand", className),
|
|
100
|
+
children: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("span", {
|
|
101
|
+
className: cn("grid min-w-0 items-center", icon ? "grid-cols-[1.25rem_minmax(0,1fr)] gap-3" : "grid-cols-1"),
|
|
102
|
+
children: [icon ? /* @__PURE__ */ jsx("span", {
|
|
103
|
+
className: "flex size-5 items-center justify-center [&>svg]:size-5",
|
|
104
|
+
children: icon
|
|
105
|
+
}) : null, /* @__PURE__ */ jsx("span", {
|
|
106
|
+
className: "min-w-0 truncate",
|
|
107
|
+
children
|
|
108
|
+
})]
|
|
109
|
+
}) })
|
|
110
|
+
}, props),
|
|
111
|
+
render,
|
|
112
|
+
state: {
|
|
113
|
+
slot: "mobile-sidebar-link",
|
|
114
|
+
active
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function MobileSidebarGroup({ className, ...props }) {
|
|
119
|
+
return /* @__PURE__ */ jsx(Collapsible, {
|
|
120
|
+
"data-slot": "mobile-sidebar-group",
|
|
121
|
+
className: cn("min-w-0", className),
|
|
122
|
+
...props
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function MobileSidebarGroupTrigger({ active = false, icon, className, children, ...props }) {
|
|
126
|
+
return /* @__PURE__ */ jsxs(CollapsibleTrigger, {
|
|
127
|
+
"data-slot": "mobile-sidebar-group-trigger",
|
|
128
|
+
"data-active": active || void 0,
|
|
129
|
+
className: cn("grid min-h-11 w-full grid-cols-[minmax(0,1fr)_auto] items-center gap-3 rounded-xl px-2 py-2.5 text-left text-gdt-md font-semibold text-fg-primary outline-none transition-colors hover:bg-surface focus-visible:shadow-[0_0_0_2px_var(--color-line-focus)]", active && "bg-surface-brand-subtle text-fg-brand", className),
|
|
130
|
+
...props,
|
|
131
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
132
|
+
className: cn("grid min-w-0 items-center", icon ? "grid-cols-[1.25rem_minmax(0,1fr)] gap-3" : "grid-cols-1"),
|
|
133
|
+
children: [icon ? /* @__PURE__ */ jsx("span", {
|
|
134
|
+
className: "flex size-5 items-center justify-center [&>svg]:size-5",
|
|
135
|
+
children: icon
|
|
136
|
+
}) : null, /* @__PURE__ */ jsx("span", {
|
|
137
|
+
className: "min-w-0 truncate",
|
|
138
|
+
children
|
|
139
|
+
})]
|
|
140
|
+
}), /* @__PURE__ */ jsx(ChevronDown, {
|
|
141
|
+
"aria-hidden": "true",
|
|
142
|
+
className: "size-4 shrink-0 text-current transition-transform duration-(--duration-motion-press) ease-gdt-out group-data-[panel-open]/collapsible-trigger:rotate-180 motion-reduce:transition-none"
|
|
143
|
+
})]
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function MobileSidebarGroupPanel({ className, ...props }) {
|
|
147
|
+
return /* @__PURE__ */ jsx(CollapsibleContent, {
|
|
148
|
+
"data-slot": "mobile-sidebar-group-panel",
|
|
149
|
+
className: cn("overflow-hidden", className),
|
|
150
|
+
...props
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function MobileSidebarSubList({ className, ...props }) {
|
|
154
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
155
|
+
"data-slot": "mobile-sidebar-sub-list",
|
|
156
|
+
className: cn("ml-8 flex flex-col pb-1", className),
|
|
157
|
+
...props
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
function MobileSidebarSubheading({ className, ...props }) {
|
|
161
|
+
return /* @__PURE__ */ jsx("li", {
|
|
162
|
+
"data-slot": "mobile-sidebar-subheading",
|
|
163
|
+
className: cn("px-2 pt-1.5 text-gdt-capitalized font-semibold uppercase text-fg-brand", className),
|
|
164
|
+
...props
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
function MobileSidebarSubLink({ className, render, ...props }) {
|
|
168
|
+
return useRender({
|
|
169
|
+
defaultTagName: "a",
|
|
170
|
+
props: mergeProps({ className: cn("block rounded-lg px-2 py-1.5 text-gdt-sm font-medium text-fg-secondary outline-none transition-colors hover:bg-surface hover:text-fg-primary focus-visible:shadow-[0_0_0_2px_var(--color-line-focus)]", className) }, props),
|
|
171
|
+
render,
|
|
172
|
+
state: { slot: "mobile-sidebar-sub-link" }
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
const MobileSidebar = {
|
|
176
|
+
Root: MobileSidebarRoot,
|
|
177
|
+
Trigger: MobileSidebarTrigger,
|
|
178
|
+
Content: MobileSidebarContent,
|
|
179
|
+
Header: MobileSidebarHeader,
|
|
180
|
+
Title: MobileSidebarTitle,
|
|
181
|
+
Close: MobileSidebarClose,
|
|
182
|
+
Body: MobileSidebarBody,
|
|
183
|
+
Footer: MobileSidebarFooter,
|
|
184
|
+
Nav: MobileSidebarNav,
|
|
185
|
+
List: MobileSidebarList,
|
|
186
|
+
Item: MobileSidebarItem,
|
|
187
|
+
Link: MobileSidebarLink,
|
|
188
|
+
Group: MobileSidebarGroup,
|
|
189
|
+
GroupTrigger: MobileSidebarGroupTrigger,
|
|
190
|
+
GroupPanel: MobileSidebarGroupPanel,
|
|
191
|
+
SubList: MobileSidebarSubList,
|
|
192
|
+
Subheading: MobileSidebarSubheading,
|
|
193
|
+
SubLink: MobileSidebarSubLink
|
|
194
|
+
};
|
|
195
|
+
//#endregion
|
|
196
|
+
export { MobileSidebar, MobileSidebarBody, MobileSidebarClose, MobileSidebarContent, MobileSidebarFooter, MobileSidebarGroup, MobileSidebarGroupPanel, MobileSidebarGroupTrigger, MobileSidebarHeader, MobileSidebarItem, MobileSidebarLink, MobileSidebarList, MobileSidebarNav, MobileSidebarRoot, MobileSidebarSubLink, MobileSidebarSubList, MobileSidebarSubheading, MobileSidebarTitle, MobileSidebarTrigger };
|