@skiddph/prui 0.9.1 → 0.10.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/dist/app.js +1 -1
- package/dist/chunks/{auth-shell-DQJ4UmUv.js → auth-shell-a-3J0_PB.js} +131 -131
- package/dist/core/input.d.ts +4 -0
- package/dist/core/input.js +40 -27
- package/dist/core/select.d.ts +25 -9
- package/dist/core/select.js +236 -153
- package/dist/index.js +1 -1
- package/dist/prui-utilities.css +1 -1
- package/dist/prui.css +1 -1
- package/package.json +1 -1
package/dist/core/input.d.ts
CHANGED
|
@@ -12,6 +12,10 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
|
|
|
12
12
|
size?: InputSize;
|
|
13
13
|
/** Visual variant: outlined (default) or filled. */
|
|
14
14
|
variant?: "default" | "filled";
|
|
15
|
+
/** Icon rendered inside the field's leading edge. */
|
|
16
|
+
icon?: React.ReactNode;
|
|
17
|
+
/** Icon rendered inside the field's trailing edge. */
|
|
18
|
+
trailingIcon?: React.ReactNode;
|
|
15
19
|
}
|
|
16
20
|
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
17
21
|
export declare const inputPropsMeta: PropsMeta;
|
package/dist/core/input.js
CHANGED
|
@@ -1,46 +1,59 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { resolveSurface as
|
|
4
|
-
import { cn as
|
|
5
|
-
const
|
|
1
|
+
import { jsx as a, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import { resolveSurface as R, withSurface as j } from "./surface.js";
|
|
4
|
+
import { cn as u } from "./cn.js";
|
|
5
|
+
const p = "prui-f-control prui-input w-full bg-[var(--prui-s-bg,var(--prui-background))] text-[var(--prui-s-fg,var(--prui-fg))] placeholder:text-[var(--prui-dim)] border border-[var(--prui-line)] rounded-[var(--prui-s-radius,var(--prui-radius))] text-sm outline-none transition-colors focus:border-[var(--prui-brand)] focus:ring-2 focus:ring-[var(--prui-brand)]/30 disabled:opacity-50 disabled:cursor-not-allowed", z = {
|
|
6
6
|
sm: "h-8 px-2.5",
|
|
7
7
|
md: "h-9 px-3",
|
|
8
8
|
lg: "h-11 px-4 text-base"
|
|
9
|
-
},
|
|
10
|
-
({ className:
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
}, C = d.forwardRef(
|
|
10
|
+
({ className: r, style: n, type: l = "text", size: o = "md", variant: c = "default", icon: e, trailingIcon: t, bg: m, fg: f, radius: g, texture: x, textureColor: v, elevation: y, ...b }, h) => {
|
|
11
|
+
const w = R({ bg: m, fg: f, radius: g, texture: x, textureColor: v, elevation: y }), s = j(
|
|
12
|
+
u(
|
|
13
|
+
p,
|
|
14
|
+
z[o],
|
|
15
|
+
c === "filled" && "bg-[var(--prui-s-bg,var(--prui-raise))] border-transparent",
|
|
16
|
+
e && "pl-9",
|
|
17
|
+
t && "pr-9",
|
|
18
|
+
r
|
|
19
|
+
),
|
|
20
|
+
n,
|
|
21
|
+
w
|
|
22
|
+
), i = /* @__PURE__ */ a("input", { ref: h, type: l, className: s.className, style: s.style, ...b });
|
|
23
|
+
return !e && !t ? i : /* @__PURE__ */ N("span", { className: "relative inline-flex w-full", children: [
|
|
24
|
+
e ? /* @__PURE__ */ a("span", { "aria-hidden": !0, className: "pointer-events-none absolute left-3 top-1/2 flex -translate-y-1/2 items-center text-[var(--prui-dim)] [&>svg]:h-4 [&>svg]:w-4", children: e }) : null,
|
|
25
|
+
i,
|
|
26
|
+
t ? /* @__PURE__ */ a("span", { "aria-hidden": !0, className: "pointer-events-none absolute right-3 top-1/2 flex -translate-y-1/2 items-center text-[var(--prui-dim)] [&>svg]:h-4 [&>svg]:w-4", children: t }) : null
|
|
27
|
+
] });
|
|
17
28
|
}
|
|
18
29
|
);
|
|
19
|
-
|
|
20
|
-
const
|
|
30
|
+
C.displayName = "Input";
|
|
31
|
+
const P = {
|
|
21
32
|
name: "Input",
|
|
22
33
|
props: [
|
|
23
34
|
{ name: "type", type: "string", default: "'text'", control: "select", options: ["text", "password", "email", "number", "search"] },
|
|
24
35
|
{ name: "size", type: "'sm' | 'md' | 'lg'", default: "'md'", control: "select", options: ["sm", "md", "lg"] },
|
|
25
36
|
{ name: "variant", type: "'default' | 'filled'", default: "'default'", control: "select", options: ["default", "filled"] },
|
|
37
|
+
{ name: "icon", type: "ReactNode", default: "undefined", control: "none", description: "Icon inside the leading edge (padding adjusts)." },
|
|
38
|
+
{ name: "trailingIcon", type: "ReactNode", default: "undefined", control: "none", description: "Icon inside the trailing edge." },
|
|
26
39
|
{ name: "value", type: "string", default: null, control: "text" },
|
|
27
40
|
{ name: "placeholder", type: "string", default: "undefined", control: "text" },
|
|
28
41
|
{ name: "disabled", type: "boolean", default: "false", control: "boolean" },
|
|
29
42
|
{ name: "onChange", type: "(e) => void", default: null, control: "none" }
|
|
30
43
|
]
|
|
31
|
-
},
|
|
32
|
-
({ className:
|
|
44
|
+
}, I = d.forwardRef(
|
|
45
|
+
({ className: r, style: n, ...l }, o) => /* @__PURE__ */ a(
|
|
33
46
|
"textarea",
|
|
34
47
|
{
|
|
35
|
-
ref:
|
|
36
|
-
style:
|
|
37
|
-
className:
|
|
38
|
-
...
|
|
48
|
+
ref: o,
|
|
49
|
+
style: n,
|
|
50
|
+
className: u(p, "h-auto min-h-20 resize-y px-3 py-2", r),
|
|
51
|
+
...l
|
|
39
52
|
}
|
|
40
53
|
)
|
|
41
54
|
);
|
|
42
|
-
|
|
43
|
-
const
|
|
55
|
+
I.displayName = "Textarea";
|
|
56
|
+
const k = {
|
|
44
57
|
name: "Textarea",
|
|
45
58
|
props: [
|
|
46
59
|
{ name: "value", type: "string", default: null, control: "textarea" },
|
|
@@ -50,8 +63,8 @@ const T = {
|
|
|
50
63
|
]
|
|
51
64
|
};
|
|
52
65
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
66
|
+
C as Input,
|
|
67
|
+
I as Textarea,
|
|
68
|
+
P as inputPropsMeta,
|
|
69
|
+
k as textareaPropsMeta
|
|
57
70
|
};
|
package/dist/core/select.d.ts
CHANGED
|
@@ -1,28 +1,44 @@
|
|
|
1
1
|
import { PropsMeta } from './props-meta';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
/**
|
|
4
|
-
* Select: a native-feeling single
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Select: a native-feeling single/multiple select listbox.
|
|
5
|
+
*
|
|
6
|
+
* - searchable: a filter input pins to the top of the listbox; typing
|
|
7
|
+
* narrows the options in place (works with the options prop and with
|
|
8
|
+
* compound <SelectItem> children alike).
|
|
9
|
+
* - multiple: multi-select — clicking toggles without closing; value and
|
|
10
|
+
* onChange become string[] and the trigger shows the first selected
|
|
11
|
+
* label plus a +N count.
|
|
12
|
+
*
|
|
13
|
+
* Keyboard: Enter/Space/ArrowDown open, ArrowUp/Down/Home/End move,
|
|
14
|
+
* Enter/Space pick, Escape (topmost overlay only) closes and restores
|
|
15
|
+
* focus, Tab closes, printable-character typeahead jumps. Non-modal: no
|
|
16
|
+
* scroll lock. The listbox portals to the body and anchors under the
|
|
17
|
+
* trigger, so no ancestor can clip or displace it.
|
|
8
18
|
*/
|
|
9
19
|
export interface SelectOption {
|
|
10
20
|
label: string;
|
|
11
21
|
value: string;
|
|
12
22
|
disabled?: boolean;
|
|
13
23
|
}
|
|
14
|
-
export interface SelectProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onChange" | "value"> {
|
|
24
|
+
export interface SelectProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onChange" | "value" | "defaultValue" | "multiple"> {
|
|
15
25
|
options?: SelectOption[];
|
|
16
|
-
|
|
17
|
-
|
|
26
|
+
/** string in single mode, string[] with multiple. */
|
|
27
|
+
value?: string | string[];
|
|
28
|
+
defaultValue?: string | string[];
|
|
18
29
|
placeholder?: string;
|
|
19
30
|
disabled?: boolean;
|
|
20
31
|
name?: string;
|
|
21
|
-
|
|
32
|
+
/** Emits string in single mode, string[] with multiple. */
|
|
33
|
+
onChange?: (value: string | string[]) => void;
|
|
22
34
|
onOpenChange?: (open: boolean) => void;
|
|
35
|
+
/** Type-to-filter the options inside the listbox. */
|
|
36
|
+
searchable?: boolean;
|
|
37
|
+
/** Multi-select: value/onChange become string[], items toggle. */
|
|
38
|
+
multiple?: boolean;
|
|
23
39
|
}
|
|
24
40
|
export declare const Select: {
|
|
25
|
-
({ options, value: valueProp, defaultValue, placeholder, disabled, name,
|
|
41
|
+
({ options, value: valueProp, defaultValue, placeholder, disabled, name, onChange, onOpenChange, searchable, multiple, id, children, ...rest }: SelectProps): React.JSX.Element;
|
|
26
42
|
displayName: string;
|
|
27
43
|
};
|
|
28
44
|
export type SelectTriggerProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
|