@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,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { visuallyHidden } from "./lib/visually-hidden.js";
|
|
3
|
+
import { useLayoutEffect, useRef } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { prefersReducedMotion } from "@journ/lift";
|
|
6
|
+
import { animate } from "animejs";
|
|
7
|
+
//#region src/text-morph.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Plays text one character at a time. When the text changes, only the characters
|
|
10
|
+
* that differ drop in again. Screen readers get the whole string once.
|
|
11
|
+
*/
|
|
12
|
+
const TextMorph = ({ children: text, as: Component = "span", classNames, style, ...props }) => {
|
|
13
|
+
const root = useRef(null);
|
|
14
|
+
const previous = useRef(text);
|
|
15
|
+
useLayoutEffect(() => {
|
|
16
|
+
const before = [...previous.current];
|
|
17
|
+
previous.current = text;
|
|
18
|
+
if (!root.current || prefersReducedMotion()) return;
|
|
19
|
+
const chars = [...text];
|
|
20
|
+
const letters = root.current.querySelectorAll("[data-char]");
|
|
21
|
+
let order = 0;
|
|
22
|
+
for (const [index, char] of chars.entries()) {
|
|
23
|
+
const element = letters[index];
|
|
24
|
+
if (!element || char === before[index]) continue;
|
|
25
|
+
animate(element, {
|
|
26
|
+
opacity: [0, 1],
|
|
27
|
+
translateY: [6, 0],
|
|
28
|
+
duration: 220,
|
|
29
|
+
delay: order++ * 18,
|
|
30
|
+
ease: "outQuad"
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}, [text]);
|
|
34
|
+
return /* @__PURE__ */ jsxs(Component, {
|
|
35
|
+
ref: root,
|
|
36
|
+
"data-slot": "text-morph",
|
|
37
|
+
...props,
|
|
38
|
+
style: {
|
|
39
|
+
whiteSpace: "pre",
|
|
40
|
+
...style
|
|
41
|
+
},
|
|
42
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
43
|
+
"data-slot": "text-morph-label",
|
|
44
|
+
className: classNames?.label,
|
|
45
|
+
style: visuallyHidden,
|
|
46
|
+
children: text
|
|
47
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
48
|
+
"aria-hidden": true,
|
|
49
|
+
children: [...text].map((char, index) => /* @__PURE__ */ jsx("span", {
|
|
50
|
+
"data-char": true,
|
|
51
|
+
className: classNames?.char,
|
|
52
|
+
style: {
|
|
53
|
+
display: "inline-block",
|
|
54
|
+
whiteSpace: "pre"
|
|
55
|
+
},
|
|
56
|
+
children: char
|
|
57
|
+
}, index))
|
|
58
|
+
})]
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
//#endregion
|
|
62
|
+
export { TextMorph };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentPropsWithRef, ElementType } from "react";
|
|
2
|
+
//#region src/text-shimmer.d.ts
|
|
3
|
+
type TextShimmerProps = ComponentPropsWithRef<'span'> & {
|
|
4
|
+
/** The element to render, `span` by default. */
|
|
5
|
+
as?: ElementType;
|
|
6
|
+
};
|
|
7
|
+
declare const TextShimmer: ({ as: Component, ...props }: TextShimmerProps) => import("react").JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { TextShimmer, type TextShimmerProps };
|
package/dist/text.d.ts
ADDED
package/dist/text.js
ADDED
package/dist/textarea.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Input } from "./input.js";
|
|
2
|
+
import { ComponentPropsWithRef, ReactNode } from "react";
|
|
3
|
+
//#region src/time-range-parts.d.ts
|
|
4
|
+
type TimeRangeValue = {
|
|
5
|
+
start: string;
|
|
6
|
+
stop: string;
|
|
7
|
+
};
|
|
8
|
+
type RootProps = {
|
|
9
|
+
/** Times as "HH:mm". Empty strings while unset. */
|
|
10
|
+
value?: TimeRangeValue;
|
|
11
|
+
defaultValue?: TimeRangeValue;
|
|
12
|
+
onValueChange?: (value: TimeRangeValue) => void;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
declare const Root: ({ value, defaultValue, onValueChange, children }: RootProps) => import("react").JSX.Element;
|
|
16
|
+
type TimeFieldProps = Omit<ComponentPropsWithRef<typeof Input>, 'type' | 'value'>;
|
|
17
|
+
declare const Start: (props: TimeFieldProps) => import("react").JSX.Element;
|
|
18
|
+
declare const Stop: (props: TimeFieldProps) => import("react").JSX.Element;
|
|
19
|
+
/** The time between start and stop. A stop before the start means the next day. */
|
|
20
|
+
declare const Duration: (props: Omit<ComponentPropsWithRef<'output'>, 'children'>) => import("react").JSX.Element;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Duration, Root, type RootProps, Start, Stop, type TimeRangeValue };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Input } from "./input.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { createRequiredContext, useControllableState } from "@journ/lift";
|
|
5
|
+
import { formatDuration, minutesBetween } from "@journ/fitter-happier";
|
|
6
|
+
//#region src/time-range-parts.tsx
|
|
7
|
+
const [TimeRangeContext, useTimeRange] = createRequiredContext("TimeRange.Root");
|
|
8
|
+
const empty = {
|
|
9
|
+
start: "",
|
|
10
|
+
stop: ""
|
|
11
|
+
};
|
|
12
|
+
const Root = ({ value, defaultValue = empty, onValueChange, children }) => {
|
|
13
|
+
const [stored, setStored] = useControllableState(value, defaultValue, onValueChange);
|
|
14
|
+
const current = stored ?? empty;
|
|
15
|
+
return /* @__PURE__ */ jsx(TimeRangeContext, {
|
|
16
|
+
value: {
|
|
17
|
+
value: current,
|
|
18
|
+
change: (next) => setStored({
|
|
19
|
+
...current,
|
|
20
|
+
...next
|
|
21
|
+
})
|
|
22
|
+
},
|
|
23
|
+
children
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
/** Start and stop are the same field bound to a different edge of the range. */
|
|
27
|
+
const TimeField = ({ edge, ...props }) => {
|
|
28
|
+
const { value, change } = useTimeRange();
|
|
29
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
30
|
+
"data-slot": `time-range-${edge}`,
|
|
31
|
+
type: "time",
|
|
32
|
+
...props,
|
|
33
|
+
value: value[edge],
|
|
34
|
+
onChange: (event) => change({ [edge]: event.target.value })
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
const Start = (props) => /* @__PURE__ */ jsx(TimeField, {
|
|
38
|
+
edge: "start",
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
const Stop = (props) => /* @__PURE__ */ jsx(TimeField, {
|
|
42
|
+
edge: "stop",
|
|
43
|
+
...props
|
|
44
|
+
});
|
|
45
|
+
/** The time between start and stop. A stop before the start means the next day. */
|
|
46
|
+
const Duration = (props) => {
|
|
47
|
+
const { value } = useTimeRange();
|
|
48
|
+
const minutes = minutesBetween(value.start, value.stop);
|
|
49
|
+
return /* @__PURE__ */ jsx("output", {
|
|
50
|
+
"data-slot": "time-range-duration",
|
|
51
|
+
...props,
|
|
52
|
+
children: minutes === null ? "" : formatDuration(minutes)
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
//#endregion
|
|
56
|
+
export { Duration, Root, Start, Stop };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Duration, Root, RootProps, Start, Stop, TimeRangeValue } from "./time-range-parts.js";
|
|
2
|
+
//#region src/time-range.d.ts
|
|
3
|
+
declare const TimeRange: {
|
|
4
|
+
Root: typeof Root;
|
|
5
|
+
Start: typeof Start;
|
|
6
|
+
Stop: typeof Stop;
|
|
7
|
+
Duration: typeof Duration;
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { TimeRange, type RootProps as TimeRangeProps, type TimeRangeValue };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { Toaster, toast } from "sonner";
|
|
3
|
+
//#region src/toast-parts.d.ts
|
|
4
|
+
/** Unstyled: sonner's own look is turned off. Pass `toastOptions.classNames` to style it. */
|
|
5
|
+
declare const Provider: ({ toastOptions, ...props }: ComponentProps<typeof Toaster>) => import("react").JSX.Element;
|
|
6
|
+
declare const show: typeof toast;
|
|
7
|
+
declare const Root: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => import("react").ReactNode;
|
|
8
|
+
declare const Title: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>) => import("react").ReactNode;
|
|
9
|
+
declare const Description: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>) => import("react").ReactNode;
|
|
10
|
+
declare const Action: (props: import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>) => import("react").ReactNode;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Action, Description, Provider, Root, Title, show };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { part } from "./lib/part.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Toaster, toast } from "sonner";
|
|
5
|
+
//#region src/toast-parts.tsx
|
|
6
|
+
/** Unstyled: sonner's own look is turned off. Pass `toastOptions.classNames` to style it. */
|
|
7
|
+
const Provider = ({ toastOptions, ...props }) => /* @__PURE__ */ jsx(Toaster, {
|
|
8
|
+
position: "top-center",
|
|
9
|
+
...props,
|
|
10
|
+
toastOptions: {
|
|
11
|
+
unstyled: true,
|
|
12
|
+
...toastOptions
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const show = toast;
|
|
16
|
+
const Root = part("div", "toast");
|
|
17
|
+
const Title = part("p", "toast-title");
|
|
18
|
+
const Description = part("p", "toast-description");
|
|
19
|
+
const Action = part("button", "toast-action", { type: "button" });
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Action, Description, Provider, Root, Title, show };
|
package/dist/toast.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Action, Description, Provider, Root, Title, show } from "./toast-parts.js";
|
|
2
|
+
//#region src/toast.d.ts
|
|
3
|
+
type ToastParts = {
|
|
4
|
+
Provider: typeof Provider;
|
|
5
|
+
show: typeof show;
|
|
6
|
+
Root: typeof Root;
|
|
7
|
+
Title: typeof Title;
|
|
8
|
+
Description: typeof Description;
|
|
9
|
+
Action: typeof Action;
|
|
10
|
+
};
|
|
11
|
+
declare const Toast: ToastParts;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Toast };
|
package/dist/toast.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as RadixToggleGroup from "@radix-ui/react-toggle-group";
|
|
2
|
+
//#region src/toggle-group-parts.d.ts
|
|
3
|
+
declare const Root: (props: (RadixToggleGroup.ToggleGroupMultipleProps | RadixToggleGroup.ToggleGroupSingleProps) & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
|
|
4
|
+
declare const Item: (props: RadixToggleGroup.ToggleGroupItemProps & import("react").RefAttributes<HTMLButtonElement>) => import("react").ReactNode;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { Item, Root };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { part } from "./lib/part.js";
|
|
3
|
+
import * as RadixToggleGroup from "@radix-ui/react-toggle-group";
|
|
4
|
+
//#region src/toggle-group-parts.tsx
|
|
5
|
+
const Root = part(RadixToggleGroup.Root, "toggle-group");
|
|
6
|
+
const Item = part(RadixToggleGroup.Item, "toggle-group-item");
|
|
7
|
+
//#endregion
|
|
8
|
+
export { Item, Root };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/toggle-group.d.ts
|
|
2
|
+
declare const ToggleGroup: {
|
|
3
|
+
Root: (props: (import("@radix-ui/react-toggle-group").ToggleGroupMultipleProps | import("@radix-ui/react-toggle-group").ToggleGroupSingleProps) & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
|
|
4
|
+
Item: (props: import("@radix-ui/react-toggle-group").ToggleGroupItemProps & import("react").RefAttributes<HTMLButtonElement>) => import("react").ReactNode;
|
|
5
|
+
};
|
|
6
|
+
//#endregion
|
|
7
|
+
export { ToggleGroup };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from "react";
|
|
2
|
+
import * as RadixTooltip from "@radix-ui/react-tooltip";
|
|
3
|
+
//#region src/tooltip-parts.d.ts
|
|
4
|
+
declare const Provider: import("react").FC<RadixTooltip.TooltipProviderProps>;
|
|
5
|
+
/** Includes its own provider so a tooltip works without extra setup. */
|
|
6
|
+
declare const Root: ({ delayDuration, ...props }: ComponentPropsWithRef<typeof RadixTooltip.Root>) => import("react").JSX.Element;
|
|
7
|
+
declare const Trigger: import("react").ForwardRefExoticComponent<RadixTooltip.TooltipTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
declare const Content: (props: ComponentPropsWithRef<typeof RadixTooltip.Content>) => import("react").JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Content, Provider, Root, Trigger };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as RadixTooltip from "@radix-ui/react-tooltip";
|
|
4
|
+
//#region src/tooltip-parts.tsx
|
|
5
|
+
const Provider = RadixTooltip.Provider;
|
|
6
|
+
/** Includes its own provider so a tooltip works without extra setup. */
|
|
7
|
+
const Root = ({ delayDuration = 300, ...props }) => /* @__PURE__ */ jsx(RadixTooltip.Provider, {
|
|
8
|
+
delayDuration,
|
|
9
|
+
children: /* @__PURE__ */ jsx(RadixTooltip.Root, { ...props })
|
|
10
|
+
});
|
|
11
|
+
const Trigger = RadixTooltip.Trigger;
|
|
12
|
+
const Content = (props) => /* @__PURE__ */ jsx(RadixTooltip.Portal, { children: /* @__PURE__ */ jsx(RadixTooltip.Content, {
|
|
13
|
+
"data-slot": "tooltip-content",
|
|
14
|
+
...props
|
|
15
|
+
}) });
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Content, Provider, Root, Trigger };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Content, Root } from "./tooltip-parts.js";
|
|
2
|
+
//#region src/tooltip.d.ts
|
|
3
|
+
declare const Tooltip: {
|
|
4
|
+
Provider: import("react").FC<import("@radix-ui/react-tooltip").TooltipProviderProps>;
|
|
5
|
+
Root: typeof Root;
|
|
6
|
+
Trigger: import("react").ForwardRefExoticComponent<import("@radix-ui/react-tooltip").TooltipTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
Content: typeof Content;
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Tooltip };
|
package/dist/tooltip.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from "react";
|
|
2
|
+
//#region src/touch-target.d.ts
|
|
3
|
+
/** A hit-area element rendered before its children. Style it to grow the touch area without changing layout. */
|
|
4
|
+
declare const TouchTarget: ({ children, ...props }: ComponentPropsWithRef<'span'>) => import("react").JSX.Element;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { TouchTarget };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
//#region src/touch-target.tsx
|
|
3
|
+
/** A hit-area element rendered before its children. Style it to grow the touch area without changing layout. */
|
|
4
|
+
const TouchTarget = ({ children, ...props }) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
5
|
+
"aria-hidden": true,
|
|
6
|
+
"data-slot": "touch-target",
|
|
7
|
+
...props
|
|
8
|
+
}), children] });
|
|
9
|
+
//#endregion
|
|
10
|
+
export { TouchTarget };
|
package/package.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@journ/nude",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Unstyled, accessible React primitives for the web. They own behavior, state, focus and ARIA, and leave every visual decision to you.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/thommorais/kid-a.git",
|
|
9
|
+
"directory": "packages/nude"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"@journ/source": "./src/index.ts",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"default": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./*": {
|
|
23
|
+
"@journ/source": "./src/*.tsx",
|
|
24
|
+
"types": "./dist/*.d.ts",
|
|
25
|
+
"default": "./dist/*.js"
|
|
26
|
+
},
|
|
27
|
+
"./package.json": "./package.json"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@radix-ui/react-accordion": "^1.2.20",
|
|
34
|
+
"@radix-ui/react-alert-dialog": "^1.1.23",
|
|
35
|
+
"@radix-ui/react-avatar": "^1.2.6",
|
|
36
|
+
"@radix-ui/react-checkbox": "^1.3.11",
|
|
37
|
+
"@radix-ui/react-collapsible": "^1.1.20",
|
|
38
|
+
"@radix-ui/react-context-menu": "^2.3.7",
|
|
39
|
+
"@radix-ui/react-dialog": "^1.1.23",
|
|
40
|
+
"@radix-ui/react-dropdown-menu": "^2.1.24",
|
|
41
|
+
"@radix-ui/react-hover-card": "^1.1.23",
|
|
42
|
+
"@radix-ui/react-label": "^2.1.15",
|
|
43
|
+
"@radix-ui/react-navigation-menu": "^1.2.22",
|
|
44
|
+
"@radix-ui/react-one-time-password-field": "^0.1.16",
|
|
45
|
+
"@radix-ui/react-popover": "^1.1.23",
|
|
46
|
+
"@radix-ui/react-progress": "^1.1.16",
|
|
47
|
+
"@radix-ui/react-radio-group": "^1.4.7",
|
|
48
|
+
"@radix-ui/react-scroll-area": "^1.2.18",
|
|
49
|
+
"@radix-ui/react-select": "^2.3.7",
|
|
50
|
+
"@radix-ui/react-separator": "^1.1.15",
|
|
51
|
+
"@radix-ui/react-slider": "^1.4.7",
|
|
52
|
+
"@radix-ui/react-slot": "^1.3.3",
|
|
53
|
+
"@radix-ui/react-switch": "^1.3.7",
|
|
54
|
+
"@radix-ui/react-tabs": "^1.1.21",
|
|
55
|
+
"@radix-ui/react-toggle-group": "^1.1.19",
|
|
56
|
+
"@radix-ui/react-tooltip": "^1.2.16",
|
|
57
|
+
"@tanstack/react-table": "^9.2.4",
|
|
58
|
+
"animejs": "^4.5.0",
|
|
59
|
+
"cmdk": "^1.1.1",
|
|
60
|
+
"embla-carousel-react": "^8.6.0",
|
|
61
|
+
"react-markdown": "^10.1.0",
|
|
62
|
+
"sonner": "^2.0.8",
|
|
63
|
+
"vaul": "^1.1.2",
|
|
64
|
+
"@journ/lift": "0.1.0",
|
|
65
|
+
"@journ/fitter-happier": "0.1.0"
|
|
66
|
+
},
|
|
67
|
+
"peerDependencies": {
|
|
68
|
+
"react": "^19.0.0",
|
|
69
|
+
"react-dom": "^19.0.0"
|
|
70
|
+
},
|
|
71
|
+
"nx": {
|
|
72
|
+
"tags": [
|
|
73
|
+
"scope:primitives"
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"scripts": {
|
|
77
|
+
"build": "tsdown",
|
|
78
|
+
"test": "vitest run",
|
|
79
|
+
"typecheck": "tsc -b",
|
|
80
|
+
"lint": "oxlint",
|
|
81
|
+
"format:check": "oxfmt --check"
|
|
82
|
+
}
|
|
83
|
+
}
|