@journ/nude 0.1.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/LICENSE +21 -0
- package/README.md +59 -0
- package/dist/accordion-parts.d.ts +15 -0
- package/dist/accordion-parts.js +19 -0
- package/dist/accordion.d.ts +10 -0
- package/dist/accordion.js +10 -0
- package/dist/alert-dialog-parts.d.ts +13 -0
- package/dist/alert-dialog-parts.js +15 -0
- package/dist/alert-dialog.d.ts +14 -0
- package/dist/alert-dialog.js +15 -0
- package/dist/alert.d.ts +11 -0
- package/dist/alert.js +12 -0
- package/dist/animated-size.d.ts +18 -0
- package/dist/animated-size.js +55 -0
- package/dist/avatar-parts.d.ts +10 -0
- package/dist/avatar-parts.js +14 -0
- package/dist/avatar.d.ts +9 -0
- package/dist/avatar.js +9 -0
- package/dist/badge.d.ts +4 -0
- package/dist/badge.js +5 -0
- package/dist/breadcrumbs.d.ts +11 -0
- package/dist/breadcrumbs.js +15 -0
- package/dist/bulk-bar.d.ts +8 -0
- package/dist/bulk-bar.js +9 -0
- package/dist/button.d.ts +13 -0
- package/dist/button.js +21 -0
- package/dist/calendar-parts.d.ts +81 -0
- package/dist/calendar-parts.js +213 -0
- package/dist/calendar.d.ts +17 -0
- package/dist/calendar.js +17 -0
- package/dist/card.d.ts +12 -0
- package/dist/card.js +13 -0
- package/dist/carousel-parts.d.ts +29 -0
- package/dist/carousel-parts.js +98 -0
- package/dist/carousel.d.ts +11 -0
- package/dist/carousel.js +11 -0
- package/dist/checkbox-parts.d.ts +7 -0
- package/dist/checkbox-parts.js +9 -0
- package/dist/checkbox.d.ts +7 -0
- package/dist/checkbox.js +8 -0
- package/dist/chip.d.ts +22 -0
- package/dist/chip.js +29 -0
- package/dist/collapsible-parts.d.ts +7 -0
- package/dist/collapsible-parts.js +9 -0
- package/dist/collapsible.d.ts +8 -0
- package/dist/collapsible.js +9 -0
- package/dist/combobox-parts.d.ts +85 -0
- package/dist/combobox-parts.js +61 -0
- package/dist/combobox.d.ts +84 -0
- package/dist/combobox.js +21 -0
- package/dist/command-palette-parts.d.ts +22 -0
- package/dist/command-palette-parts.js +56 -0
- package/dist/command-palette.d.ts +64 -0
- package/dist/command-palette.js +18 -0
- package/dist/composer.d.ts +7 -0
- package/dist/composer.js +8 -0
- package/dist/context-menu-parts.d.ts +8 -0
- package/dist/context-menu-parts.js +10 -0
- package/dist/context-menu.d.ts +12 -0
- package/dist/context-menu.js +13 -0
- package/dist/currency-input-parts.d.ts +22 -0
- package/dist/currency-input-parts.js +57 -0
- package/dist/currency-input.d.ts +8 -0
- package/dist/currency-input.js +8 -0
- package/dist/data-table-parts.d.ts +101 -0
- package/dist/data-table-parts.js +220 -0
- package/dist/data-table.d.ts +12 -0
- package/dist/data-table.js +12 -0
- package/dist/date-input-parts.d.ts +15 -0
- package/dist/date-input-parts.js +54 -0
- package/dist/date-input.d.ts +8 -0
- package/dist/date-input.js +8 -0
- package/dist/date-picker-parts.d.ts +29 -0
- package/dist/date-picker-parts.js +33 -0
- package/dist/date-picker.d.ts +29 -0
- package/dist/date-picker.js +15 -0
- package/dist/date-range-picker-parts.d.ts +37 -0
- package/dist/date-range-picker-parts.js +63 -0
- package/dist/date-range-picker.d.ts +29 -0
- package/dist/date-range-picker.js +15 -0
- package/dist/description-list.d.ts +8 -0
- package/dist/description-list.js +9 -0
- package/dist/dialog-parts.d.ts +12 -0
- package/dist/dialog-parts.js +14 -0
- package/dist/dialog.d.ts +14 -0
- package/dist/dialog.js +15 -0
- package/dist/divider.d.ts +5 -0
- package/dist/divider.js +9 -0
- package/dist/drawer-parts.d.ts +24 -0
- package/dist/drawer-parts.js +14 -0
- package/dist/drawer.d.ts +27 -0
- package/dist/drawer.js +15 -0
- package/dist/dropdown-menu-parts.d.ts +8 -0
- package/dist/dropdown-menu-parts.js +10 -0
- package/dist/dropdown-menu.d.ts +12 -0
- package/dist/dropdown-menu.js +13 -0
- package/dist/empty-state.d.ts +10 -0
- package/dist/empty-state.js +11 -0
- package/dist/field-parts.d.ts +15 -0
- package/dist/field-parts.js +63 -0
- package/dist/field.d.ts +11 -0
- package/dist/field.js +11 -0
- package/dist/file-dropzone-parts.d.ts +34 -0
- package/dist/file-dropzone-parts.js +108 -0
- package/dist/file-dropzone.d.ts +10 -0
- package/dist/file-dropzone.js +10 -0
- package/dist/heading.d.ts +9 -0
- package/dist/heading.js +12 -0
- package/dist/hover-card-parts.d.ts +8 -0
- package/dist/hover-card-parts.js +12 -0
- package/dist/hover-card.d.ts +9 -0
- package/dist/hover-card.js +9 -0
- package/dist/icon-button.d.ts +6 -0
- package/dist/icon-button.js +5 -0
- package/dist/icon.d.ts +7 -0
- package/dist/icon.js +12 -0
- package/dist/index.d.ts +94 -0
- package/dist/index.js +87 -0
- package/dist/input.d.ts +4 -0
- package/dist/input.js +5 -0
- package/dist/lib/commit-on.d.ts +15 -0
- package/dist/lib/commit-on.js +17 -0
- package/dist/lib/menu-parts.d.ts +21 -0
- package/dist/lib/menu-parts.js +23 -0
- package/dist/lib/modal-content.d.ts +17 -0
- package/dist/lib/modal-content.js +17 -0
- package/dist/lib/modal-parts.d.ts +6 -0
- package/dist/lib/modal-parts.js +7 -0
- package/dist/lib/part.d.ts +6 -0
- package/dist/lib/part.js +13 -0
- package/dist/lib/picker.d.ts +44 -0
- package/dist/lib/picker.js +75 -0
- package/dist/lib/visually-hidden.d.ts +6 -0
- package/dist/lib/visually-hidden.js +15 -0
- package/dist/link.d.ts +9 -0
- package/dist/link.js +12 -0
- package/dist/markdown.d.ts +10 -0
- package/dist/markdown.js +10 -0
- package/dist/message.d.ts +13 -0
- package/dist/message.js +15 -0
- package/dist/month-picker-parts.d.ts +19 -0
- package/dist/month-picker-parts.js +38 -0
- package/dist/month-picker.d.ts +15 -0
- package/dist/month-picker.js +15 -0
- package/dist/month-stepper-parts.d.ts +16 -0
- package/dist/month-stepper-parts.js +52 -0
- package/dist/month-stepper.d.ts +10 -0
- package/dist/month-stepper.js +10 -0
- package/dist/multiple-selector-parts.d.ts +39 -0
- package/dist/multiple-selector-parts.js +118 -0
- package/dist/multiple-selector.d.ts +76 -0
- package/dist/multiple-selector.js +23 -0
- package/dist/nav-bar.d.ts +7 -0
- package/dist/nav-bar.js +8 -0
- package/dist/navigation-menu-parts.d.ts +18 -0
- package/dist/navigation-menu-parts.js +25 -0
- package/dist/navigation-menu.d.ts +12 -0
- package/dist/navigation-menu.js +12 -0
- package/dist/otp-input-parts.d.ts +9 -0
- package/dist/otp-input-parts.js +11 -0
- package/dist/otp-input.d.ts +8 -0
- package/dist/otp-input.js +9 -0
- package/dist/page-header.d.ts +8 -0
- package/dist/page-header.js +9 -0
- package/dist/page.d.ts +8 -0
- package/dist/page.js +9 -0
- package/dist/pagination.d.ts +13 -0
- package/dist/pagination.js +24 -0
- package/dist/pill-select.d.ts +4 -0
- package/dist/pill-select.js +5 -0
- package/dist/popover-parts.d.ts +9 -0
- package/dist/popover-parts.js +13 -0
- package/dist/popover.d.ts +10 -0
- package/dist/popover.js +10 -0
- package/dist/portal.d.ts +15 -0
- package/dist/portal.js +20 -0
- package/dist/progress-parts.d.ts +11 -0
- package/dist/progress-parts.js +32 -0
- package/dist/progress.d.ts +8 -0
- package/dist/progress.js +8 -0
- package/dist/quantity-input-parts.d.ts +21 -0
- package/dist/quantity-input-parts.js +86 -0
- package/dist/quantity-input.d.ts +10 -0
- package/dist/quantity-input.js +10 -0
- package/dist/radio-parts.d.ts +13 -0
- package/dist/radio-parts.js +17 -0
- package/dist/radio.d.ts +8 -0
- package/dist/radio.js +8 -0
- package/dist/scroll-area-parts.d.ts +17 -0
- package/dist/scroll-area-parts.js +21 -0
- package/dist/scroll-area.d.ts +10 -0
- package/dist/scroll-area.js +10 -0
- package/dist/select-parts.d.ts +26 -0
- package/dist/select-parts.js +38 -0
- package/dist/select.d.ts +14 -0
- package/dist/select.js +14 -0
- package/dist/sheet-parts.d.ts +15 -0
- package/dist/sheet-parts.js +15 -0
- package/dist/sheet.d.ts +14 -0
- package/dist/sheet.js +16 -0
- package/dist/sidebar.d.ts +14 -0
- package/dist/sidebar.js +17 -0
- package/dist/skeleton.d.ts +4 -0
- package/dist/skeleton.js +5 -0
- package/dist/slider-parts.d.ts +9 -0
- package/dist/slider-parts.js +11 -0
- package/dist/slider.d.ts +9 -0
- package/dist/slider.js +10 -0
- package/dist/spinner.d.ts +6 -0
- package/dist/spinner.js +23 -0
- package/dist/stack-parts.d.ts +22 -0
- package/dist/stack-parts.js +125 -0
- package/dist/stack.d.ts +10 -0
- package/dist/stack.js +10 -0
- package/dist/stat.d.ts +9 -0
- package/dist/stat.js +10 -0
- package/dist/step-button.d.ts +11 -0
- package/dist/step-button.js +13 -0
- package/dist/stepper-parts.d.ts +19 -0
- package/dist/stepper-parts.js +44 -0
- package/dist/stepper.d.ts +11 -0
- package/dist/stepper.js +11 -0
- package/dist/switch-parts.d.ts +6 -0
- package/dist/switch-parts.js +8 -0
- package/dist/switch.d.ts +7 -0
- package/dist/switch.js +8 -0
- package/dist/table.d.ts +12 -0
- package/dist/table.js +13 -0
- package/dist/tabs-parts.d.ts +8 -0
- package/dist/tabs-parts.js +10 -0
- package/dist/tabs.d.ts +9 -0
- package/dist/tabs.js +10 -0
- package/dist/tag-input-parts.d.ts +30 -0
- package/dist/tag-input-parts.js +99 -0
- package/dist/tag-input.d.ts +10 -0
- package/dist/tag-input.js +10 -0
- package/dist/text-morph.d.ts +17 -0
- package/dist/text-morph.js +62 -0
- package/dist/text-shimmer.d.ts +9 -0
- package/dist/text-shimmer.js +8 -0
- package/dist/text.d.ts +4 -0
- package/dist/text.js +5 -0
- package/dist/textarea.d.ts +4 -0
- package/dist/textarea.js +5 -0
- package/dist/time-range-parts.d.ts +22 -0
- package/dist/time-range-parts.js +56 -0
- package/dist/time-range.d.ts +10 -0
- package/dist/time-range.js +10 -0
- package/dist/toast-parts.d.ts +12 -0
- package/dist/toast-parts.js +21 -0
- package/dist/toast.d.ts +13 -0
- package/dist/toast.js +12 -0
- package/dist/toggle-group-parts.d.ts +6 -0
- package/dist/toggle-group-parts.js +8 -0
- package/dist/toggle-group.d.ts +7 -0
- package/dist/toggle-group.js +8 -0
- package/dist/tooltip-parts.d.ts +10 -0
- package/dist/tooltip-parts.js +17 -0
- package/dist/tooltip.d.ts +10 -0
- package/dist/tooltip.js +10 -0
- package/dist/touch-target.d.ts +6 -0
- package/dist/touch-target.js +10 -0
- package/package.json +83 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Frame, Header, Heading, Months, Next, Previous, Years } from "./calendar-parts.js";
|
|
2
|
+
import { Root, RootProps } from "./month-picker-parts.js";
|
|
3
|
+
//#region src/month-picker.d.ts
|
|
4
|
+
declare const MonthPicker: {
|
|
5
|
+
Root: typeof Root;
|
|
6
|
+
Frame: typeof Frame;
|
|
7
|
+
Header: typeof Header;
|
|
8
|
+
Heading: typeof Heading;
|
|
9
|
+
Previous: typeof Previous;
|
|
10
|
+
Next: typeof Next;
|
|
11
|
+
Months: typeof Months;
|
|
12
|
+
Years: typeof Years;
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { MonthPicker, type RootProps as MonthPickerProps };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Frame, Header, Heading, Months, Next, Previous, Years } from "./calendar-parts.js";
|
|
2
|
+
import { Root } from "./month-picker-parts.js";
|
|
3
|
+
//#region src/month-picker.tsx
|
|
4
|
+
const MonthPicker = {
|
|
5
|
+
Root,
|
|
6
|
+
Frame,
|
|
7
|
+
Header,
|
|
8
|
+
Heading,
|
|
9
|
+
Previous,
|
|
10
|
+
Next,
|
|
11
|
+
Months,
|
|
12
|
+
Years
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { MonthPicker };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IconButtonProps } from "./icon-button.js";
|
|
2
|
+
import { ComponentPropsWithRef } from "react";
|
|
3
|
+
//#region src/month-stepper-parts.d.ts
|
|
4
|
+
type RootProps = Omit<ComponentPropsWithRef<'div'>, 'defaultValue'> & {
|
|
5
|
+
value?: Date;
|
|
6
|
+
defaultValue?: Date;
|
|
7
|
+
onValueChange?: (month: Date) => void;
|
|
8
|
+
locale?: string;
|
|
9
|
+
};
|
|
10
|
+
/** Always reports the first day of the month. */
|
|
11
|
+
declare const Root: ({ value, defaultValue, onValueChange, locale, ...props }: RootProps) => import("react").JSX.Element;
|
|
12
|
+
declare const Previous: (props: IconButtonProps) => import("react").JSX.Element;
|
|
13
|
+
declare const Next: (props: IconButtonProps) => import("react").JSX.Element;
|
|
14
|
+
declare const Label: (props: ComponentPropsWithRef<'span'>) => import("react").JSX.Element;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Label, Next, Previous, Root, type RootProps };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { StepButton } from "./step-button.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { createRequiredContext, useControllableState } from "@journ/lift";
|
|
5
|
+
import { addMonths, formatMonthYear, startOfMonth } from "@journ/fitter-happier";
|
|
6
|
+
//#region src/month-stepper-parts.tsx
|
|
7
|
+
const [MonthStepperContext, useMonthStepper] = createRequiredContext("MonthStepper.Root");
|
|
8
|
+
/** Always reports the first day of the month. */
|
|
9
|
+
const Root = ({ value, defaultValue, onValueChange, locale = "en", ...props }) => {
|
|
10
|
+
const [selected, setSelected] = useControllableState(value ? startOfMonth(value) : void 0, startOfMonth(defaultValue ?? /* @__PURE__ */ new Date()), onValueChange);
|
|
11
|
+
const month = selected ?? startOfMonth(/* @__PURE__ */ new Date());
|
|
12
|
+
return /* @__PURE__ */ jsx(MonthStepperContext, {
|
|
13
|
+
value: {
|
|
14
|
+
month,
|
|
15
|
+
locale,
|
|
16
|
+
step: (months) => setSelected(addMonths(month, months))
|
|
17
|
+
},
|
|
18
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
19
|
+
"data-slot": "month-stepper",
|
|
20
|
+
...props
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
const Previous = (props) => {
|
|
25
|
+
const { step } = useMonthStepper();
|
|
26
|
+
return /* @__PURE__ */ jsx(StepButton, {
|
|
27
|
+
"data-slot": "month-stepper-previous",
|
|
28
|
+
"aria-label": "Previous month",
|
|
29
|
+
...props,
|
|
30
|
+
onStep: () => step(-1)
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
const Next = (props) => {
|
|
34
|
+
const { step } = useMonthStepper();
|
|
35
|
+
return /* @__PURE__ */ jsx(StepButton, {
|
|
36
|
+
"data-slot": "month-stepper-next",
|
|
37
|
+
"aria-label": "Next month",
|
|
38
|
+
...props,
|
|
39
|
+
onStep: () => step(1)
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
const Label = (props) => {
|
|
43
|
+
const { month, locale } = useMonthStepper();
|
|
44
|
+
return /* @__PURE__ */ jsx("span", {
|
|
45
|
+
"data-slot": "month-stepper-label",
|
|
46
|
+
"aria-live": "polite",
|
|
47
|
+
...props,
|
|
48
|
+
children: props.children ?? formatMonthYear(month, locale)
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
|
+
export { Label, Next, Previous, Root };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Label, Next, Previous, Root } from "./month-stepper-parts.js";
|
|
2
|
+
//#region src/month-stepper.d.ts
|
|
3
|
+
declare const MonthStepper: {
|
|
4
|
+
Root: typeof Root;
|
|
5
|
+
Previous: typeof Previous;
|
|
6
|
+
Label: typeof Label;
|
|
7
|
+
Next: typeof Next;
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { MonthStepper };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Empty, Frame, Group, Input as Input$1, ItemIndicator, List, Option } from "./combobox-parts.js";
|
|
2
|
+
import { ComponentPropsWithRef, ElementType, ReactNode } from "react";
|
|
3
|
+
//#region src/multiple-selector-parts.d.ts
|
|
4
|
+
declare const Trigger: (props: ComponentPropsWithRef<'button'>) => import("react").JSX.Element, PickerValue: ({ placeholder, children, ...props }: import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
}) => import("react").JSX.Element;
|
|
7
|
+
declare const useMultipleSelector: any;
|
|
8
|
+
type RootProps = {
|
|
9
|
+
value?: string[];
|
|
10
|
+
defaultValue?: string[];
|
|
11
|
+
onValueChange?: (value: string[]) => void;
|
|
12
|
+
/** Values that are always selected and cannot be removed. */
|
|
13
|
+
fixed?: string[];
|
|
14
|
+
/** The most values that can be selected. */
|
|
15
|
+
max?: number;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* A combobox that keeps its drawer open and collects values. A value is also its
|
|
20
|
+
* label. Build the list from Combobox's parts, plus `Create` to allow new values.
|
|
21
|
+
*/
|
|
22
|
+
declare const Root: ({ value, defaultValue, onValueChange, fixed, max, children }: RootProps) => import("react").JSX.Element;
|
|
23
|
+
/** The count of chosen values, or `children` when given. */
|
|
24
|
+
declare const Value: ({ placeholder, children, ...props }: ComponentPropsWithRef<typeof PickerValue>) => import("react").JSX.Element;
|
|
25
|
+
type TagsProps = {
|
|
26
|
+
/** The chip rendered per value. It receives `removeLabel`, `onRemove` and the value as children. */
|
|
27
|
+
components?: {
|
|
28
|
+
Tag?: ElementType;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
/** One chip per chosen value, with a remove button unless the value is fixed. */
|
|
32
|
+
declare const Tags: ({ components }: TagsProps) => any;
|
|
33
|
+
declare const Input: (props: ComponentPropsWithRef<typeof Input$1>) => import("react").JSX.Element;
|
|
34
|
+
/** Toggles its value. Fixed values are locked, and unchosen values lock once `max` is reached. */
|
|
35
|
+
declare const Item: ({ value, disabled, ...props }: Omit<ComponentPropsWithRef<typeof Option>, 'checked' | 'onPick'>) => import("react").JSX.Element;
|
|
36
|
+
/** Offers the typed text as a new value. Hidden when empty, already chosen, or the selection is full. */
|
|
37
|
+
declare const Create: ({ children, ...props }: Omit<ComponentPropsWithRef<typeof Option>, 'value' | 'checked' | 'onPick'>) => import("react").JSX.Element | null;
|
|
38
|
+
//#endregion
|
|
39
|
+
export { Create, Empty, Frame, Group, Input, Item, ItemIndicator, List, Root, type RootProps, Tags, Trigger, Value, useMultipleSelector };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Chip } from "./chip.js";
|
|
3
|
+
import { createPicker } from "./lib/picker.js";
|
|
4
|
+
import { Empty, Frame, Group, Input as Input$1, ItemIndicator, List, Option } from "./combobox-parts.js";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { createRequiredContext } from "@journ/lift";
|
|
8
|
+
//#region src/multiple-selector-parts.tsx
|
|
9
|
+
const { Provider, Trigger, Value: PickerValue, usePickerState } = createPicker("MultipleSelector", "multiple-selector", {
|
|
10
|
+
closeOnSelect: false,
|
|
11
|
+
isEmpty: (value) => !value || value.length === 0
|
|
12
|
+
});
|
|
13
|
+
const [SelectionContext, useMultipleSelector] = createRequiredContext("MultipleSelector.Root");
|
|
14
|
+
const none = [];
|
|
15
|
+
/**
|
|
16
|
+
* A combobox that keeps its drawer open and collects values. A value is also its
|
|
17
|
+
* label. Build the list from Combobox's parts, plus `Create` to allow new values.
|
|
18
|
+
*/
|
|
19
|
+
const Root = ({ value, defaultValue = none, onValueChange, fixed = none, max, children }) => {
|
|
20
|
+
const { state, actions } = usePickerState(value, defaultValue, onValueChange);
|
|
21
|
+
const [search, setSearch] = useState("");
|
|
22
|
+
const selected = [.../* @__PURE__ */ new Set([...fixed, ...state.value ?? none])];
|
|
23
|
+
const full = max !== void 0 && selected.length >= max;
|
|
24
|
+
const set = (next) => actions.select(next);
|
|
25
|
+
const remove = (item) => {
|
|
26
|
+
if (!fixed.includes(item) && selected.includes(item)) set(selected.filter((existing) => existing !== item));
|
|
27
|
+
};
|
|
28
|
+
return /* @__PURE__ */ jsx(Provider, {
|
|
29
|
+
state: {
|
|
30
|
+
value: selected,
|
|
31
|
+
open: state.open
|
|
32
|
+
},
|
|
33
|
+
actions: {
|
|
34
|
+
...actions,
|
|
35
|
+
setOpen: (open) => {
|
|
36
|
+
if (!open) setSearch("");
|
|
37
|
+
actions.setOpen(open);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
children: /* @__PURE__ */ jsx(SelectionContext, {
|
|
41
|
+
value: {
|
|
42
|
+
selected,
|
|
43
|
+
fixed,
|
|
44
|
+
full,
|
|
45
|
+
search,
|
|
46
|
+
setSearch,
|
|
47
|
+
remove,
|
|
48
|
+
toggle: (item) => selected.includes(item) ? remove(item) : !full && set([...selected, item]),
|
|
49
|
+
create: (text) => {
|
|
50
|
+
const item = text.trim();
|
|
51
|
+
setSearch("");
|
|
52
|
+
if (item && !full && !selected.some((existing) => existing.toLowerCase() === item.toLowerCase())) set([...selected, item]);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
children
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
/** The count of chosen values, or `children` when given. */
|
|
60
|
+
const Value = ({ placeholder, children, ...props }) => {
|
|
61
|
+
const { selected } = useMultipleSelector();
|
|
62
|
+
return /* @__PURE__ */ jsx(PickerValue, {
|
|
63
|
+
placeholder,
|
|
64
|
+
...props,
|
|
65
|
+
children: children ?? `${selected.length} selected`
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
/** One chip per chosen value, with a remove button unless the value is fixed. */
|
|
69
|
+
const Tags = ({ components }) => {
|
|
70
|
+
const { selected, fixed, remove } = useMultipleSelector();
|
|
71
|
+
const Tag = components?.Tag ?? Chip.Tag;
|
|
72
|
+
return selected.map((item) => /* @__PURE__ */ jsx(Tag, {
|
|
73
|
+
removeLabel: `Remove ${item}`,
|
|
74
|
+
onRemove: fixed.includes(item) ? void 0 : () => remove(item),
|
|
75
|
+
children: item
|
|
76
|
+
}, item));
|
|
77
|
+
};
|
|
78
|
+
const Input = (props) => {
|
|
79
|
+
const { search, setSearch } = useMultipleSelector();
|
|
80
|
+
return /* @__PURE__ */ jsx(Input$1, {
|
|
81
|
+
...props,
|
|
82
|
+
value: search,
|
|
83
|
+
onValueChange: setSearch
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
/** Toggles its value. Fixed values are locked, and unchosen values lock once `max` is reached. */
|
|
87
|
+
const Item = ({ value, disabled, ...props }) => {
|
|
88
|
+
const { selected, fixed, full, toggle } = useMultipleSelector();
|
|
89
|
+
const checked = selected.includes(value);
|
|
90
|
+
return /* @__PURE__ */ jsx(Option, {
|
|
91
|
+
...props,
|
|
92
|
+
value,
|
|
93
|
+
checked,
|
|
94
|
+
disabled: disabled || fixed.includes(value) || full && !checked,
|
|
95
|
+
onPick: toggle
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
/** Offers the typed text as a new value. Hidden when empty, already chosen, or the selection is full. */
|
|
99
|
+
const Create = ({ children = "Create", ...props }) => {
|
|
100
|
+
const { selected, full, search, create } = useMultipleSelector();
|
|
101
|
+
const typed = search.trim();
|
|
102
|
+
if (!typed || full || selected.some((existing) => existing.toLowerCase() === typed.toLowerCase())) return null;
|
|
103
|
+
return /* @__PURE__ */ jsxs(Option, {
|
|
104
|
+
...props,
|
|
105
|
+
forceMount: true,
|
|
106
|
+
value: `__create__${typed}`,
|
|
107
|
+
checked: false,
|
|
108
|
+
onPick: () => create(typed),
|
|
109
|
+
children: [
|
|
110
|
+
children,
|
|
111
|
+
" “",
|
|
112
|
+
typed,
|
|
113
|
+
"”"
|
|
114
|
+
]
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
//#endregion
|
|
118
|
+
export { Create, Empty, Frame, Group, Input, Item, ItemIndicator, List, Root, Tags, Trigger, Value, useMultipleSelector };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { ModalContentProps } from "./lib/modal-content.js";
|
|
2
|
+
import { ItemIndicator } from "./combobox-parts.js";
|
|
3
|
+
import { Create, Input, Item, Root, RootProps, Tags, Value, useMultipleSelector } from "./multiple-selector-parts.js";
|
|
4
|
+
//#region src/multiple-selector.d.ts
|
|
5
|
+
declare const MultipleSelector: {
|
|
6
|
+
Root: typeof Root;
|
|
7
|
+
Trigger: (props: import("react").ComponentPropsWithRef<'button'>) => import("react").JSX.Element;
|
|
8
|
+
Value: typeof Value;
|
|
9
|
+
Tags: typeof Tags;
|
|
10
|
+
Content: ({ classNames, overlayRef, ...props }: ModalContentProps<{
|
|
11
|
+
Root: typeof import("vaul").Root;
|
|
12
|
+
NestedRoot: typeof import("vaul").NestedRoot;
|
|
13
|
+
Content: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
Overlay: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
Trigger: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
Portal: typeof import("vaul").Portal;
|
|
17
|
+
Handle: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
18
|
+
preventCycle?: boolean | undefined;
|
|
19
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
Close: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
21
|
+
Title: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
22
|
+
Description: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
23
|
+
}>) => import("react").JSX.Element;
|
|
24
|
+
Title: (props: import("@radix-ui/react-dialog").DialogTitleProps & import("react").RefAttributes<HTMLHeadingElement>) => import("react").ReactNode;
|
|
25
|
+
Description: (props: import("@radix-ui/react-dialog").DialogDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>) => import("react").ReactNode;
|
|
26
|
+
Frame: (props: {
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
} & Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
29
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
30
|
+
} & {
|
|
31
|
+
asChild?: boolean;
|
|
32
|
+
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
33
|
+
label?: string;
|
|
34
|
+
shouldFilter?: boolean;
|
|
35
|
+
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
36
|
+
defaultValue?: string;
|
|
37
|
+
value?: string;
|
|
38
|
+
onValueChange?: (value: string) => void;
|
|
39
|
+
loop?: boolean;
|
|
40
|
+
disablePointerSelection?: boolean;
|
|
41
|
+
vimBindings?: boolean;
|
|
42
|
+
} & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
|
|
43
|
+
Input: typeof Input;
|
|
44
|
+
List: (props: {
|
|
45
|
+
children?: React.ReactNode;
|
|
46
|
+
} & Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
47
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
48
|
+
} & {
|
|
49
|
+
asChild?: boolean;
|
|
50
|
+
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
51
|
+
label?: string;
|
|
52
|
+
} & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
|
|
53
|
+
Empty: (props: {
|
|
54
|
+
children?: React.ReactNode;
|
|
55
|
+
} & Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
56
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
57
|
+
} & {
|
|
58
|
+
asChild?: boolean;
|
|
59
|
+
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
|
|
60
|
+
Group: (props: {
|
|
61
|
+
children?: React.ReactNode;
|
|
62
|
+
} & Omit<Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
63
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
64
|
+
} & {
|
|
65
|
+
asChild?: boolean;
|
|
66
|
+
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "heading" | "value"> & {
|
|
67
|
+
heading?: React.ReactNode;
|
|
68
|
+
value?: string;
|
|
69
|
+
forceMount?: boolean;
|
|
70
|
+
} & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
|
|
71
|
+
Item: typeof Item;
|
|
72
|
+
ItemIndicator: typeof ItemIndicator;
|
|
73
|
+
Create: typeof Create;
|
|
74
|
+
};
|
|
75
|
+
//#endregion
|
|
76
|
+
export { MultipleSelector, type RootProps as MultipleSelectorProps, useMultipleSelector };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Content, Description, Title } from "./drawer-parts.js";
|
|
2
|
+
import { Empty, Frame, Group, ItemIndicator, List } from "./combobox-parts.js";
|
|
3
|
+
import { Create, Input, Item, Root, Tags, Trigger, Value, useMultipleSelector } from "./multiple-selector-parts.js";
|
|
4
|
+
//#region src/multiple-selector.tsx
|
|
5
|
+
const MultipleSelector = {
|
|
6
|
+
Root,
|
|
7
|
+
Trigger,
|
|
8
|
+
Value,
|
|
9
|
+
Tags,
|
|
10
|
+
Content,
|
|
11
|
+
Title,
|
|
12
|
+
Description,
|
|
13
|
+
Frame,
|
|
14
|
+
Input,
|
|
15
|
+
List,
|
|
16
|
+
Empty,
|
|
17
|
+
Group,
|
|
18
|
+
Item,
|
|
19
|
+
ItemIndicator,
|
|
20
|
+
Create
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { MultipleSelector, useMultipleSelector };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/nav-bar.d.ts
|
|
2
|
+
declare const NavBar: {
|
|
3
|
+
Root: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>) => import("react").ReactNode;
|
|
4
|
+
Item: (props: import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) => import("react").ReactNode;
|
|
5
|
+
};
|
|
6
|
+
//#endregion
|
|
7
|
+
export { NavBar };
|
package/dist/nav-bar.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from "react";
|
|
2
|
+
import * as RadixNav from "@radix-ui/react-navigation-menu";
|
|
3
|
+
//#region src/navigation-menu-parts.d.ts
|
|
4
|
+
type RootProps = ComponentPropsWithRef<typeof RadixNav.Root> & {
|
|
5
|
+
classNames?: {
|
|
6
|
+
viewportPosition?: string;
|
|
7
|
+
viewport?: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
/** Includes the viewport, the panel that Content opens into. */
|
|
11
|
+
declare const Root: ({ classNames, children, ...props }: RootProps) => import("react").JSX.Element;
|
|
12
|
+
declare const List: (props: RadixNav.NavigationMenuListProps & import("react").RefAttributes<HTMLUListElement>) => import("react").ReactNode;
|
|
13
|
+
declare const Item: import("react").ForwardRefExoticComponent<RadixNav.NavigationMenuItemProps & import("react").RefAttributes<HTMLLIElement>>;
|
|
14
|
+
declare const Trigger: (props: RadixNav.NavigationMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>) => import("react").ReactNode;
|
|
15
|
+
declare const Content: (props: RadixNav.NavigationMenuContentProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
|
|
16
|
+
declare const Link: (props: RadixNav.NavigationMenuLinkProps & import("react").RefAttributes<HTMLAnchorElement>) => import("react").ReactNode;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Content, Item, Link, List, Root, Trigger };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { part } from "./lib/part.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import * as RadixNav from "@radix-ui/react-navigation-menu";
|
|
5
|
+
//#region src/navigation-menu-parts.tsx
|
|
6
|
+
/** Includes the viewport, the panel that Content opens into. */
|
|
7
|
+
const Root = ({ classNames, children, ...props }) => /* @__PURE__ */ jsxs(RadixNav.Root, {
|
|
8
|
+
"data-slot": "navigation-menu",
|
|
9
|
+
...props,
|
|
10
|
+
children: [children, /* @__PURE__ */ jsx("div", {
|
|
11
|
+
"data-slot": "navigation-menu-viewport-position",
|
|
12
|
+
className: classNames?.viewportPosition,
|
|
13
|
+
children: /* @__PURE__ */ jsx(RadixNav.Viewport, {
|
|
14
|
+
"data-slot": "navigation-menu-viewport",
|
|
15
|
+
className: classNames?.viewport
|
|
16
|
+
})
|
|
17
|
+
})]
|
|
18
|
+
});
|
|
19
|
+
const List = part(RadixNav.List, "navigation-menu-list");
|
|
20
|
+
const Item = RadixNav.Item;
|
|
21
|
+
const Trigger = part(RadixNav.Trigger, "navigation-menu-trigger");
|
|
22
|
+
const Content = part(RadixNav.Content, "navigation-menu-content");
|
|
23
|
+
const Link = part(RadixNav.Link, "navigation-menu-link");
|
|
24
|
+
//#endregion
|
|
25
|
+
export { Content, Item, Link, List, Root, Trigger };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Root } from "./navigation-menu-parts.js";
|
|
2
|
+
//#region src/navigation-menu.d.ts
|
|
3
|
+
declare const NavigationMenu: {
|
|
4
|
+
Root: typeof Root;
|
|
5
|
+
List: (props: import("@radix-ui/react-navigation-menu").NavigationMenuListProps & import("react").RefAttributes<HTMLUListElement>) => import("react").ReactNode;
|
|
6
|
+
Item: import("react").ForwardRefExoticComponent<import("@radix-ui/react-navigation-menu").NavigationMenuItemProps & import("react").RefAttributes<HTMLLIElement>>;
|
|
7
|
+
Trigger: (props: import("@radix-ui/react-navigation-menu").NavigationMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>) => import("react").ReactNode;
|
|
8
|
+
Content: (props: import("@radix-ui/react-navigation-menu").NavigationMenuContentProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
|
|
9
|
+
Link: (props: import("@radix-ui/react-navigation-menu").NavigationMenuLinkProps & import("react").RefAttributes<HTMLAnchorElement>) => import("react").ReactNode;
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { NavigationMenu };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as RadixOtp from "@radix-ui/react-one-time-password-field";
|
|
2
|
+
//#region src/otp-input-parts.d.ts
|
|
3
|
+
declare const Root: (props: Omit<RadixOtp.OneTimePasswordFieldProps, "ref"> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
|
|
4
|
+
/** One box per character. Render as many as the code is long. */
|
|
5
|
+
declare const Slot: (props: Omit<RadixOtp.OneTimePasswordFieldInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>) => import("react").ReactNode;
|
|
6
|
+
/** Submits the whole code with a surrounding form. Render it once, after the slots. */
|
|
7
|
+
declare const Hidden: import("react").ForwardRefExoticComponent<Omit<RadixOtp.OneTimePasswordFieldHiddenInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Hidden, Root, Slot };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { part } from "./lib/part.js";
|
|
3
|
+
import * as RadixOtp from "@radix-ui/react-one-time-password-field";
|
|
4
|
+
//#region src/otp-input-parts.tsx
|
|
5
|
+
const Root = part(RadixOtp.Root, "otp-input");
|
|
6
|
+
/** One box per character. Render as many as the code is long. */
|
|
7
|
+
const Slot = part(RadixOtp.Input, "otp-input-slot");
|
|
8
|
+
/** Submits the whole code with a surrounding form. Render it once, after the slots. */
|
|
9
|
+
const Hidden = RadixOtp.HiddenInput;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Hidden, Root, Slot };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/otp-input.d.ts
|
|
2
|
+
declare const OtpInput: {
|
|
3
|
+
Root: (props: Omit<import("@radix-ui/react-one-time-password-field").OneTimePasswordFieldProps, "ref"> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
|
|
4
|
+
Slot: (props: Omit<import("@radix-ui/react-one-time-password-field").OneTimePasswordFieldInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>) => import("react").ReactNode;
|
|
5
|
+
Hidden: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-one-time-password-field").OneTimePasswordFieldHiddenInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { OtpInput };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/page-header.d.ts
|
|
2
|
+
declare const PageHeader: {
|
|
3
|
+
Root: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>) => import("react").ReactNode;
|
|
4
|
+
Title: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>) => import("react").ReactNode;
|
|
5
|
+
Actions: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => import("react").ReactNode;
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { PageHeader };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { part } from "./lib/part.js";
|
|
2
|
+
//#region src/page-header.tsx
|
|
3
|
+
const PageHeader = {
|
|
4
|
+
Root: part("header", "page-header"),
|
|
5
|
+
Title: part("h1", "page-header-title"),
|
|
6
|
+
Actions: part("div", "page-header-actions")
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { PageHeader };
|
package/dist/page.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/page.d.ts
|
|
2
|
+
declare const Page: {
|
|
3
|
+
Root: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => import("react").ReactNode;
|
|
4
|
+
Content: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>) => import("react").ReactNode;
|
|
5
|
+
Footer: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => import("react").ReactNode;
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { Page };
|
package/dist/page.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from "react";
|
|
2
|
+
//#region src/pagination.d.ts
|
|
3
|
+
declare const Gap: (props: ComponentPropsWithRef<'span'>) => import("react").JSX.Element;
|
|
4
|
+
declare const Pagination: {
|
|
5
|
+
Root: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>) => import("react").ReactNode;
|
|
6
|
+
Previous: (props: import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) => import("react").ReactNode;
|
|
7
|
+
List: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => import("react").ReactNode;
|
|
8
|
+
Page: (props: import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) => import("react").ReactNode;
|
|
9
|
+
Gap: typeof Gap;
|
|
10
|
+
Next: (props: import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) => import("react").ReactNode;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Pagination };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { part } from "./lib/part.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/pagination.tsx
|
|
4
|
+
const Root = part("nav", "pagination", { "aria-label": "Pagination" });
|
|
5
|
+
const List = part("div", "pagination-list");
|
|
6
|
+
const Previous = part("a", "pagination-previous", { children: "Previous" });
|
|
7
|
+
const Next = part("a", "pagination-next", { children: "Next" });
|
|
8
|
+
const Page = part("a", "pagination-page");
|
|
9
|
+
const Gap = (props) => /* @__PURE__ */ jsx("span", {
|
|
10
|
+
"data-slot": "pagination-gap",
|
|
11
|
+
"aria-hidden": true,
|
|
12
|
+
...props,
|
|
13
|
+
children: "…"
|
|
14
|
+
});
|
|
15
|
+
const Pagination = {
|
|
16
|
+
Root,
|
|
17
|
+
Previous,
|
|
18
|
+
List,
|
|
19
|
+
Page,
|
|
20
|
+
Gap,
|
|
21
|
+
Next
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { Pagination };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from "react";
|
|
2
|
+
import * as RadixPopover from "@radix-ui/react-popover";
|
|
3
|
+
//#region src/popover-parts.d.ts
|
|
4
|
+
declare const Root: import("react").FC<RadixPopover.PopoverProps>;
|
|
5
|
+
declare const Trigger: import("react").ForwardRefExoticComponent<RadixPopover.PopoverTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const Close: import("react").ForwardRefExoticComponent<RadixPopover.PopoverCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const Content: (props: ComponentPropsWithRef<typeof RadixPopover.Content>) => import("react").JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Close, Content, Root, Trigger };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as RadixPopover from "@radix-ui/react-popover";
|
|
4
|
+
//#region src/popover-parts.tsx
|
|
5
|
+
const Root = RadixPopover.Root;
|
|
6
|
+
const Trigger = RadixPopover.Trigger;
|
|
7
|
+
const Close = RadixPopover.Close;
|
|
8
|
+
const Content = (props) => /* @__PURE__ */ jsx(RadixPopover.Portal, { children: /* @__PURE__ */ jsx(RadixPopover.Content, {
|
|
9
|
+
"data-slot": "popover-content",
|
|
10
|
+
...props
|
|
11
|
+
}) });
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Close, Content, Root, Trigger };
|