@eodparks/ui 0.0.0-stage → 0.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/LICENSE +21 -0
- package/dist/accordion.d.ts +36 -0
- package/dist/accordion.js +57 -0
- package/dist/alert-dialog.d.ts +50 -0
- package/dist/alert-dialog.js +149 -0
- package/dist/alert.d.ts +23 -0
- package/dist/alert.js +87 -0
- package/dist/avatar.d.ts +35 -0
- package/dist/avatar.js +118 -0
- package/dist/badge.d.ts +27 -0
- package/dist/badge.js +148 -0
- package/dist/button-C2CCxHu1.d.ts +15 -0
- package/dist/button-DEsRlveL.js +86 -0
- package/dist/button.d.ts +2 -0
- package/dist/button.js +1 -0
- package/dist/calendar-DhsRPq2D.d.ts +23 -0
- package/dist/calendar-kbn4gZ1a.js +110 -0
- package/dist/calendar.d.ts +2 -0
- package/dist/calendar.js +1 -0
- package/dist/card-tkP52GwZ.js +77 -0
- package/dist/card.d.ts +18 -0
- package/dist/card.js +1 -0
- package/dist/chart.d.ts +52 -0
- package/dist/chart.js +163 -0
- package/dist/checkbox.d.ts +7 -0
- package/dist/checkbox.js +26 -0
- package/dist/cn-B-fHM4Ov.js +12 -0
- package/dist/collapsible.d.ts +10 -0
- package/dist/collapsible.js +23 -0
- package/dist/command.d.ts +38 -0
- package/dist/command.js +124 -0
- package/dist/date-picker.d.ts +46 -0
- package/dist/date-picker.js +159 -0
- package/dist/dialog-JjpMFEDR.js +117 -0
- package/dist/dialog.d.ts +2 -0
- package/dist/dialog.js +3 -0
- package/dist/dropdown-menu-B_VG1VXX.js +116 -0
- package/dist/dropdown-menu-CZ8xcq1d.d.ts +38 -0
- package/dist/dropdown-menu.d.ts +2 -0
- package/dist/dropdown-menu.js +1 -0
- package/dist/empty-state-B11Uq0U_.js +66 -0
- package/dist/empty-state.d.ts +15 -0
- package/dist/empty-state.js +1 -0
- package/dist/error-state.d.ts +48 -0
- package/dist/error-state.js +139 -0
- package/dist/field-Cwhz73-_.d.ts +15 -0
- package/dist/field-D-n7O1n6.js +63 -0
- package/dist/field.d.ts +2 -0
- package/dist/field.js +1 -0
- package/dist/focus-ring-BpxMbGAn.js +3 -0
- package/dist/form-actions.d.ts +21 -0
- package/dist/form-actions.js +41 -0
- package/dist/forms/formik.d.ts +20 -0
- package/dist/forms/formik.js +50 -0
- package/dist/forms/rhf.d.ts +32 -0
- package/dist/forms/rhf.js +114 -0
- package/dist/icon-button-XAjcFsZ2.js +14 -0
- package/dist/icon-button.d.ts +9 -0
- package/dist/icon-button.js +1 -0
- package/dist/icon.d.ts +15 -0
- package/dist/icon.js +21 -0
- package/dist/index-Ct4mPvuB.d.ts +29 -0
- package/dist/input-BxjcqQS1.js +49 -0
- package/dist/input-group.d.ts +12 -0
- package/dist/input-group.js +26 -0
- package/dist/input.d.ts +15 -0
- package/dist/input.js +1 -0
- package/dist/label-BrOAJU1p.js +31 -0
- package/dist/label-CUAiaBbm.d.ts +13 -0
- package/dist/label.d.ts +2 -0
- package/dist/label.js +1 -0
- package/dist/native-select.d.ts +8 -0
- package/dist/native-select.js +41 -0
- package/dist/page-header.d.ts +19 -0
- package/dist/page-header.js +51 -0
- package/dist/pagination.d.ts +47 -0
- package/dist/pagination.js +131 -0
- package/dist/password-input.d.ts +14 -0
- package/dist/password-input.js +41 -0
- package/dist/popover.d.ts +19 -0
- package/dist/popover.js +54 -0
- package/dist/popup-CLsuJ-AA.js +6 -0
- package/dist/progress.d.ts +8 -0
- package/dist/progress.js +36 -0
- package/dist/radio-group.d.ts +14 -0
- package/dist/radio-group.js +25 -0
- package/dist/scroll-area.d.ts +16 -0
- package/dist/scroll-area.js +52 -0
- package/dist/select-Cq_JDuYO.js +266 -0
- package/dist/select.d.ts +40 -0
- package/dist/select.js +1 -0
- package/dist/separator.d.ts +8 -0
- package/dist/separator.js +38 -0
- package/dist/sheet.d.ts +27 -0
- package/dist/sheet.js +95 -0
- package/dist/skeleton.d.ts +19 -0
- package/dist/skeleton.js +45 -0
- package/dist/spinner.d.ts +13 -0
- package/dist/spinner.js +44 -0
- package/dist/switch.d.ts +7 -0
- package/dist/switch.js +19 -0
- package/dist/table.d.ts +24 -0
- package/dist/table.js +75 -0
- package/dist/tabs.d.ts +24 -0
- package/dist/tabs.js +74 -0
- package/dist/textarea.d.ts +5 -0
- package/dist/textarea.js +15 -0
- package/dist/theme-toggle.d.ts +11 -0
- package/dist/theme-toggle.js +50 -0
- package/dist/toast.d.ts +12 -0
- package/dist/toast.js +105 -0
- package/dist/tooltip-BsVKZDXs.js +47 -0
- package/dist/tooltip.d.ts +18 -0
- package/dist/tooltip.js +1 -0
- package/dist/typography-Dy3PCTrL.js +34 -0
- package/dist/typography.d.ts +11 -0
- package/dist/typography.js +1 -0
- package/dist/visually-hidden-BrCs6ZEy.js +11 -0
- package/dist/visually-hidden.d.ts +3 -0
- package/dist/visually-hidden.js +1 -0
- package/docs/accessibility.md +95 -0
- package/docs/accordion.md +89 -0
- package/docs/alert-dialog.md +157 -0
- package/docs/alert.md +70 -0
- package/docs/avatar.md +57 -0
- package/docs/badge.md +51 -0
- package/docs/button.md +121 -0
- package/docs/calendar.md +116 -0
- package/docs/card.md +74 -0
- package/docs/chart.md +93 -0
- package/docs/checkbox.md +119 -0
- package/docs/collapsible.md +76 -0
- package/docs/command.md +114 -0
- package/docs/date-picker.md +177 -0
- package/docs/dialog.md +110 -0
- package/docs/dropdown-menu.md +126 -0
- package/docs/empty-state.md +65 -0
- package/docs/error-state.md +59 -0
- package/docs/field.md +54 -0
- package/docs/form-actions.md +55 -0
- package/docs/forms/formik.md +42 -0
- package/docs/forms/rhf.md +64 -0
- package/docs/icon-button.md +84 -0
- package/docs/icon.md +77 -0
- package/docs/input-group.md +47 -0
- package/docs/input.md +46 -0
- package/docs/label.md +33 -0
- package/docs/layout.md +102 -0
- package/docs/llms.txt +72 -0
- package/docs/native-select.md +87 -0
- package/docs/page-header.md +61 -0
- package/docs/pagination.md +107 -0
- package/docs/password-input.md +30 -0
- package/docs/popover.md +103 -0
- package/docs/progress.md +53 -0
- package/docs/radio-group.md +119 -0
- package/docs/scroll-area.md +85 -0
- package/docs/select.md +106 -0
- package/docs/separator.md +38 -0
- package/docs/sheet.md +118 -0
- package/docs/skeleton.md +50 -0
- package/docs/spinner.md +46 -0
- package/docs/switch.md +92 -0
- package/docs/table.md +87 -0
- package/docs/tabs.md +96 -0
- package/docs/textarea.md +38 -0
- package/docs/theme-toggle.md +76 -0
- package/docs/toast.md +95 -0
- package/docs/tooltip.md +101 -0
- package/docs/typography.md +96 -0
- package/docs/visually-hidden.md +44 -0
- package/layer.css +22 -0
- package/package.json +275 -3
- package/skills/eod-ui/SKILL.md +37 -0
- package/styles.css +2 -0
- package/README.md +0 -3
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// src/internal/focus-ring.ts
|
|
2
|
+
const focusRing = "focus-visible:outline-hidden focus-visible:ring-(length:--focus-ring-width) focus-visible:ring-ring focus-visible:ring-offset-[length:var(--focus-ring-offset)] focus-visible:ring-offset-background";
|
|
3
|
+
export { focusRing as t };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PartProps } from "@ui-sdk/react/primitive";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
type FormActionsProps = Omit<PartProps<"div">, "children"> & {
|
|
4
|
+
/** The save label. */
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
/** `false` disables Save until something changed. Leave it out for a form with nothing to compare. */
|
|
7
|
+
dirty?: boolean;
|
|
8
|
+
/** Save shows its pending state and ignores presses. */
|
|
9
|
+
saving?: boolean;
|
|
10
|
+
/** The outcome of the last save, shown beside the buttons. */
|
|
11
|
+
status?: "saved" | "error";
|
|
12
|
+
/** The text of the outcome. */
|
|
13
|
+
message?: ReactNode;
|
|
14
|
+
/** The Cancel label; without it there is no Cancel button. */
|
|
15
|
+
cancel?: ReactNode;
|
|
16
|
+
onCancel?: () => void;
|
|
17
|
+
/** Keeps the bar at the bottom edge of its scroll container. */
|
|
18
|
+
sticky?: boolean;
|
|
19
|
+
};
|
|
20
|
+
declare function FormActions({ children, dirty, saving, status, message, cancel, onCancel, sticky, className, ...props }: FormActionsProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
21
|
+
export { FormActions, type FormActionsProps };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { renderElement } from "@ui-sdk/react/primitive";
|
|
2
|
+
import { t as Button } from "./button-DEsRlveL.js";
|
|
3
|
+
import { t as cn } from "./cn-B-fHM4Ov.js";
|
|
4
|
+
import { n as textVariants } from "./typography-Dy3PCTrL.js";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
// src/patterns/form-actions/form-actions.tsx
|
|
7
|
+
function FormActions({ children = "Save changes", dirty = true, saving = false, status, message, cancel, onCancel, sticky = false, className, ...props }) {
|
|
8
|
+
return renderElement("div", {
|
|
9
|
+
"data-sticky": sticky ? "" : void 0,
|
|
10
|
+
...props,
|
|
11
|
+
"data-slot": "form-actions",
|
|
12
|
+
className: cn("flex flex-wrap items-center justify-end gap-2", sticky && "sticky bottom-0 border-t bg-background p-4", className),
|
|
13
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14
|
+
/* @__PURE__ */ jsxs("div", {
|
|
15
|
+
className: "me-auto flex min-w-0 flex-col",
|
|
16
|
+
children: [/* @__PURE__ */ jsx("output", {
|
|
17
|
+
className: cn(textVariants({ variant: "small" }), "text-muted-foreground"),
|
|
18
|
+
children: status === "saved" && message
|
|
19
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
20
|
+
role: "alert",
|
|
21
|
+
className: cn(textVariants({ variant: "small" }), "text-destructive"),
|
|
22
|
+
children: status === "error" && message
|
|
23
|
+
})]
|
|
24
|
+
}),
|
|
25
|
+
cancel && /* @__PURE__ */ jsx(Button, {
|
|
26
|
+
type: "button",
|
|
27
|
+
variant: "outline",
|
|
28
|
+
disabled: saving,
|
|
29
|
+
onClick: onCancel,
|
|
30
|
+
children: cancel
|
|
31
|
+
}),
|
|
32
|
+
/* @__PURE__ */ jsx(Button, {
|
|
33
|
+
type: "submit",
|
|
34
|
+
disabled: !dirty,
|
|
35
|
+
pending: saving,
|
|
36
|
+
children
|
|
37
|
+
})
|
|
38
|
+
] })
|
|
39
|
+
}, props.render);
|
|
40
|
+
}
|
|
41
|
+
export { FormActions };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from "react";
|
|
2
|
+
import { s as FieldProps } from "../field-Cwhz73-_.js";
|
|
3
|
+
type Control = {
|
|
4
|
+
name: string;
|
|
5
|
+
value: unknown;
|
|
6
|
+
onValueChange: (value: never) => void;
|
|
7
|
+
onBlur: () => void;
|
|
8
|
+
invalid: boolean;
|
|
9
|
+
};
|
|
10
|
+
type FormikFieldProps = Omit<FieldProps, "children" | "name" | "invalid"> & {
|
|
11
|
+
name: string;
|
|
12
|
+
label?: ReactNode;
|
|
13
|
+
description?: ReactNode;
|
|
14
|
+
/** Marks the label; the schema stays the source of truth, the control is not made `required`. */
|
|
15
|
+
required?: boolean;
|
|
16
|
+
/** One control, which gets `name`, `value`, `onValueChange` and `onBlur`, or a function of them. */
|
|
17
|
+
children: ReactElement | ((control: Control) => ReactNode);
|
|
18
|
+
};
|
|
19
|
+
declare function FormikField({ name, label, description, required, children, ...props }: FormikFieldProps): import("react").JSX.Element;
|
|
20
|
+
export { FormikField, type FormikFieldProps };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { useField, useFormikContext } from "formik";
|
|
2
|
+
import { cloneElement, isValidElement, useEffect, useRef } from "react";
|
|
3
|
+
import { a as FieldLabel, n as FieldDescription, r as FieldError, t as Field } from "../field-D-n7O1n6.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
// src/forms/formik.tsx
|
|
6
|
+
function FormikField({ name, label, description, required, children, ...props }) {
|
|
7
|
+
const [field, meta, helpers] = useField(name);
|
|
8
|
+
const { submitCount, isValidating } = useFormikContext();
|
|
9
|
+
const root = useRef(null);
|
|
10
|
+
const handled = useRef(0);
|
|
11
|
+
const invalid = Boolean(meta.touched && meta.error);
|
|
12
|
+
const control = {
|
|
13
|
+
name,
|
|
14
|
+
value: field.value ?? "",
|
|
15
|
+
onValueChange: (value) => void helpers.setValue(value),
|
|
16
|
+
onBlur: () => void helpers.setTouched(true),
|
|
17
|
+
invalid
|
|
18
|
+
};
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (submitCount === handled.current || isValidating) return;
|
|
21
|
+
handled.current = submitCount;
|
|
22
|
+
if (!meta.error) return;
|
|
23
|
+
const first = root.current?.closest("form")?.querySelector("[aria-invalid=true]");
|
|
24
|
+
if (first && root.current?.contains(first)) first.focus();
|
|
25
|
+
});
|
|
26
|
+
const body = typeof children === "function" ? children(control) : isValidElement(children) ? cloneElement(children, {
|
|
27
|
+
name,
|
|
28
|
+
value: control.value,
|
|
29
|
+
onValueChange: control.onValueChange,
|
|
30
|
+
onBlur: control.onBlur,
|
|
31
|
+
...required && { "aria-required": true }
|
|
32
|
+
}) : children;
|
|
33
|
+
return /* @__PURE__ */ jsxs(Field, {
|
|
34
|
+
ref: root,
|
|
35
|
+
name,
|
|
36
|
+
invalid,
|
|
37
|
+
...props,
|
|
38
|
+
children: [
|
|
39
|
+
label && /* @__PURE__ */ jsx(FieldLabel, { children: label }),
|
|
40
|
+
body,
|
|
41
|
+
description && /* @__PURE__ */ jsx(FieldDescription, { children: description }),
|
|
42
|
+
invalid && /* @__PURE__ */ jsx(FieldError, {
|
|
43
|
+
match: true,
|
|
44
|
+
role: "alert",
|
|
45
|
+
children: meta.error
|
|
46
|
+
})
|
|
47
|
+
]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
export { FormikField };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { PartProps } from "@ui-sdk/react/primitive";
|
|
2
|
+
import { ComponentProps, ReactElement, Ref } from "react";
|
|
3
|
+
import { ControllerProps, FieldPath, FieldValues } from "react-hook-form";
|
|
4
|
+
import { t as Label } from "../label-CUAiaBbm.js";
|
|
5
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>({ children, watch, getValues, getErrors, getFieldState, setError, clearErrors, setValue, setValues, trigger, formState, resetField, reset, resetDefaultValues, handleSubmit, unregister, control, register, setFocus, subscribe }: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
6
|
+
declare function FormField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ render, ...props }: ControllerProps<TFieldValues, TName>): import("react").JSX.Element;
|
|
7
|
+
declare function useFormField(): {
|
|
8
|
+
id: string;
|
|
9
|
+
orientation: "vertical" | "horizontal";
|
|
10
|
+
required: boolean | undefined;
|
|
11
|
+
error: import("react-hook-form").FieldError | undefined;
|
|
12
|
+
invalid: boolean;
|
|
13
|
+
formItemId: string;
|
|
14
|
+
formDescriptionId: string;
|
|
15
|
+
formMessageId: string;
|
|
16
|
+
name: string;
|
|
17
|
+
ref?: Ref<unknown>;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
};
|
|
20
|
+
type FormItemProps = PartProps<"div"> & {
|
|
21
|
+
orientation?: "vertical" | "horizontal";
|
|
22
|
+
/** Marks the label and sets `aria-required` on the control; the schema stays the validator. */
|
|
23
|
+
required?: boolean;
|
|
24
|
+
};
|
|
25
|
+
declare function FormItem({ orientation, required, className, ...props }: FormItemProps): import("react").JSX.Element;
|
|
26
|
+
declare function FormLabel({ className, ...props }: ComponentProps<typeof Label>): import("react").JSX.Element;
|
|
27
|
+
declare function FormControl({ children }: {
|
|
28
|
+
children: ReactElement;
|
|
29
|
+
}): ReactElement<Record<string, unknown>, string | import("react").JSXElementConstructor<any>>;
|
|
30
|
+
declare function FormDescription({ className, ...props }: PartProps<"p">): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
31
|
+
declare function FormMessage({ className, children, ...props }: PartProps<"p">): ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
|
32
|
+
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { renderElement } from "@ui-sdk/react/primitive";
|
|
2
|
+
import { Children, cloneElement, createContext, isValidElement, use, useId } from "react";
|
|
3
|
+
import { Controller, FormProvider, useFormContext, useFormState } from "react-hook-form";
|
|
4
|
+
import { t as cn } from "../cn-B-fHM4Ov.js";
|
|
5
|
+
import { c as descriptionClass, d as layout, f as secondColumn, l as errorClass, u as labelLayout } from "../field-D-n7O1n6.js";
|
|
6
|
+
import { t as Label } from "../label-BrOAJU1p.js";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
// src/forms/rhf.tsx
|
|
9
|
+
const Form = FormProvider;
|
|
10
|
+
const FieldContext = createContext(null);
|
|
11
|
+
const ItemContext = createContext(null);
|
|
12
|
+
function FormField({ render, ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(Controller, {
|
|
14
|
+
...props,
|
|
15
|
+
render: (args) => /* @__PURE__ */ jsx(FieldContext, {
|
|
16
|
+
value: {
|
|
17
|
+
name: props.name,
|
|
18
|
+
ref: args.field.ref,
|
|
19
|
+
disabled: args.field.disabled
|
|
20
|
+
},
|
|
21
|
+
children: render(args)
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function useFormField() {
|
|
26
|
+
const field = use(FieldContext);
|
|
27
|
+
const item = use(ItemContext);
|
|
28
|
+
const { getFieldState } = useFormContext();
|
|
29
|
+
const formState = useFormState({ name: field?.name });
|
|
30
|
+
if (!field || !item) throw new Error("useFormField must be used inside FormField and FormItem");
|
|
31
|
+
const { error, invalid } = getFieldState(field.name, formState);
|
|
32
|
+
return {
|
|
33
|
+
...field,
|
|
34
|
+
id: item.id,
|
|
35
|
+
orientation: item.orientation,
|
|
36
|
+
required: item.required,
|
|
37
|
+
error,
|
|
38
|
+
invalid,
|
|
39
|
+
formItemId: `${item.id}-form-item`,
|
|
40
|
+
formDescriptionId: `${item.id}-form-item-description`,
|
|
41
|
+
formMessageId: `${item.id}-form-item-message`
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function FormItem({ orientation = "vertical", required, className, ...props }) {
|
|
45
|
+
const id = useId();
|
|
46
|
+
return /* @__PURE__ */ jsx(ItemContext, {
|
|
47
|
+
value: {
|
|
48
|
+
id,
|
|
49
|
+
orientation,
|
|
50
|
+
required
|
|
51
|
+
},
|
|
52
|
+
children: renderElement("div", {
|
|
53
|
+
...props,
|
|
54
|
+
"data-slot": "form-item",
|
|
55
|
+
"data-orientation": orientation,
|
|
56
|
+
className: cn("group/field", layout({ orientation }), className)
|
|
57
|
+
}, props.render)
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function FormLabel({ className, ...props }) {
|
|
61
|
+
const { formItemId, invalid, required } = useFormField();
|
|
62
|
+
return /* @__PURE__ */ jsx(Label, {
|
|
63
|
+
"data-slot": "form-label",
|
|
64
|
+
required,
|
|
65
|
+
...invalid && { "data-invalid": "" },
|
|
66
|
+
htmlFor: formItemId,
|
|
67
|
+
className: cn(labelLayout, className),
|
|
68
|
+
...props
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
const join = (...ids) => ids.filter(Boolean).join(" ") || void 0;
|
|
72
|
+
function composeRefs(...refs) {
|
|
73
|
+
return (node) => {
|
|
74
|
+
for (const ref of refs) if (typeof ref === "function") ref(node);
|
|
75
|
+
else if (ref) ref.current = node;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function FormControl({ children }) {
|
|
79
|
+
const { ref, disabled, required, error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
80
|
+
const child = Children.only(children);
|
|
81
|
+
if (!isValidElement(child)) throw new Error("FormControl needs exactly one element child");
|
|
82
|
+
const own = child.props["aria-describedby"];
|
|
83
|
+
return cloneElement(child, {
|
|
84
|
+
id: formItemId,
|
|
85
|
+
"aria-describedby": join(own, formDescriptionId, error ? formMessageId : void 0),
|
|
86
|
+
"aria-invalid": !!error,
|
|
87
|
+
...required && { "aria-required": true },
|
|
88
|
+
...disabled && { disabled: true },
|
|
89
|
+
ref: composeRefs(ref, child.props.ref)
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function FormDescription({ className, ...props }) {
|
|
93
|
+
const { formDescriptionId } = useFormField();
|
|
94
|
+
return renderElement("p", {
|
|
95
|
+
id: formDescriptionId,
|
|
96
|
+
...props,
|
|
97
|
+
"data-slot": "form-description",
|
|
98
|
+
className: cn(descriptionClass, className)
|
|
99
|
+
}, props.render);
|
|
100
|
+
}
|
|
101
|
+
function FormMessage({ className, children, ...props }) {
|
|
102
|
+
const { error, formMessageId } = useFormField();
|
|
103
|
+
const body = error ? String(error.message ?? "") : typeof children === "function" ? children({}) : children;
|
|
104
|
+
if (!body) return null;
|
|
105
|
+
return renderElement("p", {
|
|
106
|
+
id: formMessageId,
|
|
107
|
+
role: "alert",
|
|
108
|
+
...props,
|
|
109
|
+
"data-slot": "form-message",
|
|
110
|
+
className: cn(errorClass, secondColumn, className),
|
|
111
|
+
children: body
|
|
112
|
+
}, props.render);
|
|
113
|
+
}
|
|
114
|
+
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { t as Button } from "./button-DEsRlveL.js";
|
|
2
|
+
import { o as TooltipTrigger, r as TooltipContent, t as Tooltip } from "./tooltip-BsVKZDXs.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
// src/icon-button/icon-button.tsx
|
|
5
|
+
function IconButton({ size = "icon", ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsxs(Tooltip, {
|
|
7
|
+
type: "label",
|
|
8
|
+
children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx(Button, {
|
|
9
|
+
...props,
|
|
10
|
+
size
|
|
11
|
+
}) }), /* @__PURE__ */ jsx(TooltipContent, { children: props["aria-label"] })]
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export { IconButton as t };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { n as ButtonProps } from "./button-C2CCxHu1.js";
|
|
2
|
+
type IconButtonProps = Omit<ButtonProps, "size" | "variant" | "aria-label"> & {
|
|
3
|
+
/** Names the button and is shown as its tooltip. */
|
|
4
|
+
"aria-label": string;
|
|
5
|
+
variant?: Exclude<ButtonProps["variant"], "link">;
|
|
6
|
+
size?: "icon" | "icon-sm" | "icon-xs";
|
|
7
|
+
};
|
|
8
|
+
declare function IconButton({ size, ...props }: IconButtonProps): import("react").JSX.Element;
|
|
9
|
+
export { IconButton, type IconButtonProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as IconButton } from "./icon-button-XAjcFsZ2.js";
|
package/dist/icon.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LucideIcon, LucideProps } from "lucide-react";
|
|
2
|
+
declare const sizes: {
|
|
3
|
+
readonly 16: "size-4";
|
|
4
|
+
readonly 20: "size-5";
|
|
5
|
+
readonly 24: "size-6";
|
|
6
|
+
};
|
|
7
|
+
type IconProps = Omit<LucideProps, "size" | "role" | "aria-label" | "aria-hidden"> & {
|
|
8
|
+
/** A `lucide-react` icon component, such as `TrashIcon`. */
|
|
9
|
+
icon: LucideIcon;
|
|
10
|
+
size?: keyof typeof sizes;
|
|
11
|
+
/** Names the icon when nothing else does. Without it the icon is hidden from assistive technology. */
|
|
12
|
+
label?: string;
|
|
13
|
+
};
|
|
14
|
+
declare function Icon({ icon: Glyph, size, label, className, ...props }: IconProps): import("react").JSX.Element;
|
|
15
|
+
export { Icon, type IconProps };
|
package/dist/icon.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { t as cn } from "./cn-B-fHM4Ov.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
// src/icon/icon.tsx
|
|
4
|
+
const sizes = {
|
|
5
|
+
16: "size-4",
|
|
6
|
+
20: "size-5",
|
|
7
|
+
24: "size-6"
|
|
8
|
+
};
|
|
9
|
+
function Icon({ icon: Glyph, size = 16, label, className, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx(Glyph, {
|
|
11
|
+
...props,
|
|
12
|
+
"data-slot": "icon",
|
|
13
|
+
"data-size": size,
|
|
14
|
+
...label ? {
|
|
15
|
+
role: "img",
|
|
16
|
+
"aria-label": label
|
|
17
|
+
} : { "aria-hidden": true },
|
|
18
|
+
className: cn("shrink-0", sizes[size], className)
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
export { Icon };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Dialog as Dialog$1, DialogClose as DialogClose$1, DialogContent as DialogContent$1, DialogController, DialogDescription as DialogDescription$1, DialogTitle as DialogTitle$1, DialogTrigger as DialogTrigger$1, createDialogController } from "@ui-sdk/react/dialog";
|
|
2
|
+
import { PartProps } from "@ui-sdk/react/primitive";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
import { ComponentProps } from "react";
|
|
5
|
+
type DialogProps = ComponentProps<typeof Dialog$1>;
|
|
6
|
+
declare function Dialog({ onOpenChange, ...props }: DialogProps): import("react").JSX.Element;
|
|
7
|
+
type DialogTriggerProps = ComponentProps<typeof DialogTrigger$1>;
|
|
8
|
+
declare function DialogTrigger(props: DialogTriggerProps): import("react").JSX.Element;
|
|
9
|
+
declare const dialogContentVariants: (props?: ({
|
|
10
|
+
size?: "sm" | "lg" | "md" | "xl" | null | undefined;
|
|
11
|
+
inline?: boolean | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
+
type UIContentProps = ComponentProps<typeof DialogContent$1>;
|
|
14
|
+
type DialogContentProps = Omit<UIContentProps, "inline"> & Omit<VariantProps<typeof dialogContentVariants>, "inline"> & {
|
|
15
|
+
showCloseButton?: boolean;
|
|
16
|
+
closeLabel?: string;
|
|
17
|
+
inline?: boolean;
|
|
18
|
+
};
|
|
19
|
+
declare function DialogContent({ size, inline, showCloseButton, closeLabel, className, children, ...props }: DialogContentProps): import("react").JSX.Element;
|
|
20
|
+
declare function DialogHeader({ className, ...props }: PartProps<"div">): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
21
|
+
declare function DialogBody({ className, ...props }: PartProps<"div">): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
22
|
+
declare function DialogFooter({ className, ...props }: PartProps<"div">): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
23
|
+
type DialogTitleProps = ComponentProps<typeof DialogTitle$1>;
|
|
24
|
+
declare function DialogTitle({ className, ...props }: DialogTitleProps): import("react").JSX.Element;
|
|
25
|
+
type DialogDescriptionProps = ComponentProps<typeof DialogDescription$1>;
|
|
26
|
+
declare function DialogDescription({ className, ...props }: DialogDescriptionProps): import("react").JSX.Element;
|
|
27
|
+
type DialogCloseProps = ComponentProps<typeof DialogClose$1>;
|
|
28
|
+
declare function DialogClose(props: DialogCloseProps): import("react").JSX.Element;
|
|
29
|
+
export { DialogTriggerProps as _, DialogClose as a, DialogContentProps as c, DialogFooter as d, DialogHeader as f, DialogTrigger as g, DialogTitleProps as h, DialogBody as i, DialogDescription as l, DialogTitle as m, createDialogController as n, DialogCloseProps as o, DialogProps as p, Dialog as r, DialogContent as s, DialogController as t, DialogDescriptionProps as u, dialogContentVariants as v };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Input as Input$1, InputClear as InputClear$1, InputGroup } from "@ui-sdk/react/input";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { XIcon } from "lucide-react";
|
|
4
|
+
import { n as withBase, t as cn } from "./cn-B-fHM4Ov.js";
|
|
5
|
+
import { t as focusRing } from "./focus-ring-BpxMbGAn.js";
|
|
6
|
+
import { n as textVariants } from "./typography-Dy3PCTrL.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
// src/input/input.tsx
|
|
9
|
+
const sizes = {
|
|
10
|
+
sm: "h-(--control-h-sm) px-2.5",
|
|
11
|
+
default: "h-(--control-h) px-3",
|
|
12
|
+
lg: "h-(--control-h-lg) px-3"
|
|
13
|
+
};
|
|
14
|
+
const box = cn(textVariants({ variant: "small" }), "w-full min-w-0 rounded-control border border-input bg-background text-foreground", "not-data-disabled:hover:border-muted-foreground aria-invalid:border-destructive data-invalid:border-destructive", "aria-invalid:hover:border-destructive data-invalid:hover:border-destructive", "data-disabled:cursor-not-allowed data-disabled:opacity-50");
|
|
15
|
+
const groupBox = cn(box, "flex items-center gap-2 has-[[aria-invalid=true]]:border-destructive has-[[data-invalid]]:border-destructive has-[[aria-invalid=true]]:hover:border-destructive has-[[data-invalid]]:hover:border-destructive", "has-[input:focus-visible]:outline-hidden has-[input:focus-visible]:ring-(length:--focus-ring-width) has-[input:focus-visible]:ring-ring has-[input:focus-visible]:ring-offset-[length:var(--focus-ring-offset)] has-[input:focus-visible]:ring-offset-background");
|
|
16
|
+
const bareInput = "in-data-[slot=input-group]:h-full in-data-[slot=input-group]:flex-1 in-data-[slot=input-group]:border-0 in-data-[slot=input-group]:bg-transparent in-data-[slot=input-group]:read-only:bg-transparent in-data-[slot=input-group]:px-0 in-data-[slot=input-group]:focus-visible:ring-0 in-data-[slot=input-group]:focus-visible:ring-offset-0 in-data-[slot=input-group]:data-disabled:opacity-100";
|
|
17
|
+
const iconButton = "inline-flex size-6 shrink-0 items-center justify-center rounded-item text-muted-foreground hover:text-foreground disabled:cursor-not-allowed [&_svg]:size-4";
|
|
18
|
+
const inputVariants = cva([
|
|
19
|
+
box,
|
|
20
|
+
"placeholder:text-muted-foreground read-only:bg-muted",
|
|
21
|
+
"file:me-3 file:border-0 file:bg-transparent file:font-medium",
|
|
22
|
+
focusRing,
|
|
23
|
+
bareInput
|
|
24
|
+
], {
|
|
25
|
+
variants: { size: sizes },
|
|
26
|
+
defaultVariants: { size: "default" }
|
|
27
|
+
});
|
|
28
|
+
const groupSize = sizes;
|
|
29
|
+
function InputClear({ className, children, ...props }) {
|
|
30
|
+
return /* @__PURE__ */ jsx(InputClear$1, {
|
|
31
|
+
className: withBase(cn(iconButton, focusRing), className),
|
|
32
|
+
...props,
|
|
33
|
+
children: children ?? /* @__PURE__ */ jsx(XIcon, { "aria-hidden": "true" })
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function Input({ size = "default", clearable, clearLabel = "Clear", className, ...props }) {
|
|
37
|
+
const input = /* @__PURE__ */ jsx(Input$1, {
|
|
38
|
+
"data-size": size,
|
|
39
|
+
...props,
|
|
40
|
+
className: withBase(inputVariants({ size }), clearable && typeof className === "string" ? void 0 : className)
|
|
41
|
+
});
|
|
42
|
+
if (!clearable) return input;
|
|
43
|
+
return /* @__PURE__ */ jsxs(InputGroup, {
|
|
44
|
+
"data-size": size,
|
|
45
|
+
className: cn(groupBox, groupSize[size ?? "default"], typeof className === "string" && className),
|
|
46
|
+
children: [input, /* @__PURE__ */ jsx(InputClear, { "aria-label": clearLabel })]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export { groupSize as a, groupBox as i, InputClear as n, iconButton as o, box as r, inputVariants as s, Input as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InputGroup as InputGroup$1 } from "@ui-sdk/react/input";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { PartProps } from "@ui-sdk/react/primitive";
|
|
4
|
+
import { ComponentProps } from "react";
|
|
5
|
+
declare const groupVariants: (props?: ({
|
|
6
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
type InputGroupProps = Omit<ComponentProps<typeof InputGroup$1>, "size"> & VariantProps<typeof groupVariants>;
|
|
9
|
+
declare function InputGroup({ size, className, ...props }: InputGroupProps): import("react").JSX.Element;
|
|
10
|
+
type AddonProps = PartProps<"span">;
|
|
11
|
+
declare function InputGroupAddon({ className, ...props }: AddonProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
12
|
+
export { InputGroup, InputGroupAddon, type InputGroupProps };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { InputGroup as InputGroup$1 } from "@ui-sdk/react/input";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { renderElement } from "@ui-sdk/react/primitive";
|
|
4
|
+
import { n as withBase, t as cn } from "./cn-B-fHM4Ov.js";
|
|
5
|
+
import { a as groupSize, i as groupBox } from "./input-BxjcqQS1.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
// src/input-group/input-group.tsx
|
|
8
|
+
const groupVariants = cva(groupBox, {
|
|
9
|
+
variants: { size: groupSize },
|
|
10
|
+
defaultVariants: { size: "default" }
|
|
11
|
+
});
|
|
12
|
+
function InputGroup({ size = "default", className, ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(InputGroup$1, {
|
|
14
|
+
"data-size": size,
|
|
15
|
+
...props,
|
|
16
|
+
className: withBase(groupVariants({ size }), className)
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function InputGroupAddon({ className, ...props }) {
|
|
20
|
+
return renderElement("span", {
|
|
21
|
+
...props,
|
|
22
|
+
"data-slot": "input-group-addon",
|
|
23
|
+
className: cn("flex shrink-0 items-center gap-1 text-muted-foreground [&_svg]:pointer-events-none [&_svg]:size-4", className)
|
|
24
|
+
}, props.render);
|
|
25
|
+
}
|
|
26
|
+
export { InputGroup, InputGroupAddon };
|
package/dist/input.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Input as Input$1, InputClear as InputClear$1 } from "@ui-sdk/react/input";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { ComponentProps } from "react";
|
|
4
|
+
declare const inputVariants: (props?: ({
|
|
5
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
type InputProps = Omit<ComponentProps<typeof Input$1>, "size"> & VariantProps<typeof inputVariants> & {
|
|
8
|
+
/** Adds a button that empties the input; it shows only while there is text. */
|
|
9
|
+
clearable?: boolean;
|
|
10
|
+
/** The accessible name of the clear button. */
|
|
11
|
+
clearLabel?: string;
|
|
12
|
+
};
|
|
13
|
+
declare function InputClear({ className, children, ...props }: ComponentProps<typeof InputClear$1>): import("react").JSX.Element;
|
|
14
|
+
declare function Input({ size, clearable, clearLabel, className, ...props }: InputProps): import("react").JSX.Element;
|
|
15
|
+
export { Input, InputClear, type InputProps, inputVariants };
|
package/dist/input.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as Input, n as InputClear, s as inputVariants } from "./input-BxjcqQS1.js";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Label as Label$1 } from "@ui-sdk/react/label";
|
|
2
|
+
import { n as withBase, t as cn } from "./cn-B-fHM4Ov.js";
|
|
3
|
+
import { n as textVariants } from "./typography-Dy3PCTrL.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
// src/label/label.tsx
|
|
6
|
+
/** Shared with `FieldLabel`, so a label looks the same inside and outside a Field. */
|
|
7
|
+
const labelClass = cn(textVariants({ variant: "label" }), "data-disabled:cursor-not-allowed data-disabled:opacity-50");
|
|
8
|
+
function Label({ required, optional, optionalText = "optional", disabled, className, children, ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsxs(Label$1, {
|
|
10
|
+
...props,
|
|
11
|
+
...disabled && { "data-disabled": "" },
|
|
12
|
+
className: withBase(labelClass, className),
|
|
13
|
+
children: [
|
|
14
|
+
children,
|
|
15
|
+
required && /* @__PURE__ */ jsx("span", {
|
|
16
|
+
"aria-hidden": "true",
|
|
17
|
+
className: "ms-1 text-destructive",
|
|
18
|
+
children: "*"
|
|
19
|
+
}),
|
|
20
|
+
optional && /* @__PURE__ */ jsxs("span", {
|
|
21
|
+
className: "font-normal text-muted-foreground",
|
|
22
|
+
children: [
|
|
23
|
+
" (",
|
|
24
|
+
optionalText,
|
|
25
|
+
")"
|
|
26
|
+
]
|
|
27
|
+
})
|
|
28
|
+
]
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
export { labelClass as n, Label as t };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Label as Label$1 } from "@ui-sdk/react/label";
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
type LabelProps = Omit<ComponentProps<typeof Label$1>, "children"> & {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
/** Shows the mark only; put `required` on the control too. */
|
|
6
|
+
required?: boolean;
|
|
7
|
+
optional?: boolean;
|
|
8
|
+
/** The text after an optional label. */
|
|
9
|
+
optionalText?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare function Label({ required, optional, optionalText, disabled, className, children, ...props }: LabelProps): import("react").JSX.Element;
|
|
13
|
+
export { LabelProps as n, Label as t };
|
package/dist/label.d.ts
ADDED
package/dist/label.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as Label } from "./label-BrOAJU1p.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
type NativeSelectProps = Omit<ComponentProps<"select">, "size"> & {
|
|
3
|
+
size?: "default" | "sm";
|
|
4
|
+
};
|
|
5
|
+
declare function NativeSelect({ size, className, ...props }: NativeSelectProps): import("react").JSX.Element;
|
|
6
|
+
declare function NativeSelectOption({ className, ...props }: ComponentProps<"option">): import("react").JSX.Element;
|
|
7
|
+
declare function NativeSelectOptGroup({ className, ...props }: ComponentProps<"optgroup">): import("react").JSX.Element;
|
|
8
|
+
export { NativeSelect, NativeSelectOptGroup, NativeSelectOption, type NativeSelectProps };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useFieldControl } from "@ui-sdk/react/field";
|
|
2
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
3
|
+
import { t as cn } from "./cn-B-fHM4Ov.js";
|
|
4
|
+
import { t as focusRing } from "./focus-ring-BpxMbGAn.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
// src/native-select/native-select.tsx
|
|
7
|
+
const selectClass = cn("h-(--control-h) w-full min-w-0 appearance-none truncate rounded-control border border-input bg-background ps-3 pe-9 text-sm text-foreground transition-colors outline-hidden", "data-[size=sm]:h-(--control-h-sm) data-[size=sm]:ps-2.5 data-[size=sm]:pe-8", "has-[option[value='']:checked]:text-muted-foreground", "not-disabled:hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50", "aria-invalid:border-destructive data-invalid:border-destructive", focusRing);
|
|
8
|
+
function NativeSelect({ size = "default", className, ...props }) {
|
|
9
|
+
const field = useFieldControl();
|
|
10
|
+
const own = {
|
|
11
|
+
name: field?.name,
|
|
12
|
+
...props,
|
|
13
|
+
"data-slot": "native-select",
|
|
14
|
+
"data-size": size,
|
|
15
|
+
className: cn(selectClass, className)
|
|
16
|
+
};
|
|
17
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
18
|
+
"data-slot": "native-select-wrapper",
|
|
19
|
+
className: "relative w-full min-w-0",
|
|
20
|
+
children: [/* @__PURE__ */ jsx("select", { ...field ? field.props(own) : own }), /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
21
|
+
"aria-hidden": "true",
|
|
22
|
+
"data-slot": "native-select-icon",
|
|
23
|
+
className: cn("pointer-events-none absolute top-1/2 size-4 -translate-y-1/2 opacity-50", size === "sm" ? "end-2.5" : "end-3")
|
|
24
|
+
})]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function NativeSelectOption({ className, ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx("option", {
|
|
29
|
+
"data-slot": "native-select-option",
|
|
30
|
+
className: cn("bg-popover text-popover-foreground", className),
|
|
31
|
+
...props
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function NativeSelectOptGroup({ className, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ jsx("optgroup", {
|
|
36
|
+
"data-slot": "native-select-optgroup",
|
|
37
|
+
className: cn("bg-popover text-popover-foreground", className),
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export { NativeSelect, NativeSelectOptGroup, NativeSelectOption };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PartProps } from "@ui-sdk/react/primitive";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
type PageHeaderProps = Omit<PartProps<"header">, "title"> & {
|
|
4
|
+
/** The page's `h1`. Use one header per page. */
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
/** Above the title: a Breadcrumb navigation. */
|
|
8
|
+
breadcrumb?: ReactNode;
|
|
9
|
+
/** Above the title: a `PageHeaderBack` link to the parent. */
|
|
10
|
+
back?: ReactNode;
|
|
11
|
+
/** Buttons at the inline end of the title row. */
|
|
12
|
+
actions?: ReactNode;
|
|
13
|
+
/** Below the title row: a tab list or section navigation. */
|
|
14
|
+
tabs?: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
declare function PageHeader({ title, description, breadcrumb, back, actions, tabs, render, className, ...props }: PageHeaderProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
17
|
+
/** A link to the parent page. Pass the destination's name as children and the route link with `render`. */
|
|
18
|
+
declare function PageHeaderBack({ children, render, className, ...props }: PartProps<"a">): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
19
|
+
export { PageHeader, PageHeaderBack, type PageHeaderProps };
|