@ekanos/ui 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 +124 -0
- package/dist/ai-prompt-input.d.ts +187 -0
- package/dist/ai-prompt-input.js +2411 -0
- package/dist/alert.d.ts +12 -0
- package/dist/alert.js +92 -0
- package/dist/badge.d.ts +12 -0
- package/dist/badge.js +60 -0
- package/dist/button.d.ts +13 -0
- package/dist/button.js +64 -0
- package/dist/card.d.ts +18 -0
- package/dist/card.js +108 -0
- package/dist/dialog.d.ts +19 -0
- package/dist/dialog.js +897 -0
- package/dist/dropdown-menu.d.ts +27 -0
- package/dist/dropdown-menu.js +941 -0
- package/dist/form.d.ts +27 -0
- package/dist/form.js +156 -0
- package/dist/icon.d.ts +47 -0
- package/dist/icon.js +763 -0
- package/dist/if.d.ts +38 -0
- package/dist/if.js +15 -0
- package/dist/input.d.ts +5 -0
- package/dist/input.js +28 -0
- package/dist/label.d.ts +5 -0
- package/dist/label.js +27 -0
- package/dist/select.d.ts +25 -0
- package/dist/select.js +944 -0
- package/dist/separator.d.ts +6 -0
- package/dist/separator.js +35 -0
- package/dist/skeleton.d.ts +5 -0
- package/dist/skeleton.js +22 -0
- package/dist/spinner.d.ts +27 -0
- package/dist/spinner.js +49 -0
- package/dist/tooltip.d.ts +9 -0
- package/dist/tooltip.js +74 -0
- package/dist/trans.d.ts +39 -0
- package/dist/trans.js +9 -0
- package/dist/utils.d.ts +23 -0
- package/dist/utils.js +83 -0
- package/package.json +150 -0
package/dist/if.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The falsy values a condition may legitimately carry.
|
|
6
|
+
*
|
|
7
|
+
* This mirrors JavaScript's own falsy set as far as the type system can
|
|
8
|
+
* express it: `NaN` has no literal type, and `0n` is deliberately omitted so
|
|
9
|
+
* the emitted declaration stays usable by consumers whose `lib` predates
|
|
10
|
+
* ES2020 bigint literals.
|
|
11
|
+
*/
|
|
12
|
+
type Falsy = false | null | undefined | 0 | '';
|
|
13
|
+
/** What a condition of type `Condition` narrows to once it passes. */
|
|
14
|
+
type Truthy<Condition> = Exclude<Condition, Falsy>;
|
|
15
|
+
type IfProps<Condition> = {
|
|
16
|
+
/** Rendered when truthy; otherwise `fallback` is rendered. */
|
|
17
|
+
condition: Condition;
|
|
18
|
+
/**
|
|
19
|
+
* Either static content, or a render function handed the condition narrowed
|
|
20
|
+
* to its truthy form — `condition={user}` passes a `User` to the callback,
|
|
21
|
+
* not a `User | undefined`.
|
|
22
|
+
*/
|
|
23
|
+
children: ReactNode | ((value: Truthy<Condition>) => ReactNode);
|
|
24
|
+
/** Rendered when `condition` is falsy. Nothing renders when omitted. */
|
|
25
|
+
fallback?: ReactNode | (() => ReactNode);
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Conditional renderer, so a branch reads as markup instead of a ternary.
|
|
29
|
+
*
|
|
30
|
+
* Deliberately hook-free: this ships from a module with no `'use client'`
|
|
31
|
+
* directive, so it must stay renderable from a React Server Component.
|
|
32
|
+
*
|
|
33
|
+
* `ReactNode` does not include functions, which makes `typeof x === 'function'`
|
|
34
|
+
* a sound discriminator between static content and a render callback.
|
|
35
|
+
*/
|
|
36
|
+
declare function If<Condition>({ condition, children, fallback, }: IfProps<Condition>): React.JSX.Element;
|
|
37
|
+
|
|
38
|
+
export { If, type IfProps };
|
package/dist/if.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// src/_impl/if.tsx
|
|
2
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
+
function If({
|
|
4
|
+
condition,
|
|
5
|
+
children,
|
|
6
|
+
fallback
|
|
7
|
+
}) {
|
|
8
|
+
if (condition) {
|
|
9
|
+
return /* @__PURE__ */ jsx(Fragment, { children: typeof children === "function" ? children(condition) : children });
|
|
10
|
+
}
|
|
11
|
+
return /* @__PURE__ */ jsx(Fragment, { children: typeof fallback === "function" ? fallback() : fallback });
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
If
|
|
15
|
+
};
|
package/dist/input.d.ts
ADDED
package/dist/input.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// ../ui/src/lib/utils/cn.ts
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
function cn(...inputs) {
|
|
5
|
+
return twMerge(clsx(inputs));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// ../ui/src/shadcn/input.tsx
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
function Input({ className, type, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
"input",
|
|
13
|
+
{
|
|
14
|
+
type,
|
|
15
|
+
"data-slot": "input",
|
|
16
|
+
className: cn(
|
|
17
|
+
"border-input selection:bg-primary selection:text-primary-foreground file:text-foreground placeholder:text-muted-foreground dark:bg-input/30 h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
18
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
19
|
+
"aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
|
|
20
|
+
className
|
|
21
|
+
),
|
|
22
|
+
...props
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
Input
|
|
28
|
+
};
|
package/dist/label.d.ts
ADDED
package/dist/label.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
// ../ui/src/lib/utils/cn.ts
|
|
4
|
+
import { clsx } from "clsx";
|
|
5
|
+
import { twMerge } from "tailwind-merge";
|
|
6
|
+
function cn(...inputs) {
|
|
7
|
+
return twMerge(clsx(inputs));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// ../ui/src/shadcn/label.tsx
|
|
11
|
+
import { jsx } from "react/jsx-runtime";
|
|
12
|
+
function Label({ className, ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
"label",
|
|
15
|
+
{
|
|
16
|
+
"data-slot": "label",
|
|
17
|
+
className: cn(
|
|
18
|
+
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
19
|
+
className
|
|
20
|
+
),
|
|
21
|
+
...props
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
Label
|
|
27
|
+
};
|
package/dist/select.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Select as Select$1 } from '@base-ui/react/select';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Base UI's `<Select.Value>` renders the label of the selected item only when
|
|
6
|
+
* the root is given an `items` map — otherwise it stringifies the raw value, so
|
|
7
|
+
* a trigger shows `12months` instead of `12 months`. Deriving `items` from the
|
|
8
|
+
* `SelectItem` children a caller already declares keeps the Radix-era API
|
|
9
|
+
* (`<SelectValue />` shows the selected item's content) working everywhere
|
|
10
|
+
* without every call site restating its options.
|
|
11
|
+
*/
|
|
12
|
+
declare function Select<Value, Multiple extends boolean | undefined = false>({ children, items, ...props }: Select$1.Root.Props<Value, Multiple>): React.JSX.Element;
|
|
13
|
+
declare function SelectGroup({ className, ...props }: Select$1.Group.Props): React.JSX.Element;
|
|
14
|
+
declare function SelectValue({ className, ...props }: Select$1.Value.Props): React.JSX.Element;
|
|
15
|
+
declare function SelectTrigger({ className, size, children, ...props }: Select$1.Trigger.Props & {
|
|
16
|
+
size?: 'sm' | 'default';
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
declare function SelectContent({ className, children, side, sideOffset, align, alignOffset, alignItemWithTrigger, ...props }: Select$1.Popup.Props & Pick<Select$1.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset' | 'alignItemWithTrigger'>): React.JSX.Element;
|
|
19
|
+
declare function SelectLabel({ className, ...props }: Select$1.GroupLabel.Props): React.JSX.Element;
|
|
20
|
+
declare function SelectItem({ className, children, ...props }: Select$1.Item.Props): React.JSX.Element;
|
|
21
|
+
declare function SelectSeparator({ className, ...props }: Select$1.Separator.Props): React.JSX.Element;
|
|
22
|
+
declare function SelectScrollUpButton({ className, ...props }: Select$1.ScrollUpArrow.Props): React.JSX.Element;
|
|
23
|
+
declare function SelectScrollDownButton({ className, ...props }: Select$1.ScrollDownArrow.Props): React.JSX.Element;
|
|
24
|
+
|
|
25
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
|