@omer-x/tailwind-ui-kit 1.0.0-alpha.43 → 1.0.0-alpha.44
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/README.md +23 -0
- package/dist/components/form/BaseAutocomplete.d.ts +1 -1
- package/dist/components/layout/BaseSeparator.d.ts +16 -0
- package/dist/components/layout/BaseSeparator.js +18 -0
- package/dist/components/layout/index.d.ts +2 -1
- package/dist/components/layout/index.js +3 -1
- package/dist/components/menu/BaseMenu.d.ts +1 -1
- package/dist/components/menu/BaseMenubar.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1644,6 +1644,29 @@ toastManager.add({ title: "Session expired", type: "error" });
|
|
|
1644
1644
|
|
|
1645
1645
|
### `@omer-x/tailwind-ui-kit/layout`
|
|
1646
1646
|
|
|
1647
|
+
#### `BaseSeparator`
|
|
1648
|
+
|
|
1649
|
+
A Base UI [`Separator`](https://base-ui.com/react/components/separator): a `1px` line between blocks that screen readers announce. Renders a `<div>` with `role="separator"`, `aria-orientation` and `data-orientation`. It has no color: give it one with `className`.
|
|
1650
|
+
|
|
1651
|
+
```tsx
|
|
1652
|
+
import { BaseSeparator } from "@omer-x/tailwind-ui-kit/layout";
|
|
1653
|
+
|
|
1654
|
+
<BaseSeparator className="bg-neutral-300" />
|
|
1655
|
+
|
|
1656
|
+
<nav className="flex items-center gap-3">
|
|
1657
|
+
<a href="/">Home</a>
|
|
1658
|
+
<BaseSeparator orientation="vertical" className="h-4 bg-neutral-300" />
|
|
1659
|
+
<a href="/pricing">Pricing</a>
|
|
1660
|
+
</nav>
|
|
1661
|
+
```
|
|
1662
|
+
|
|
1663
|
+
| Prop | Type | Default | Description |
|
|
1664
|
+
|------|------|---------|-------------|
|
|
1665
|
+
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | Horizontal: `h-px w-full`. Vertical: `w-px self-stretch` (the height of its flex row; set a height with `className` otherwise) |
|
|
1666
|
+
| `render` | `RenderProp<"div", SeparatorState>` | | The state is `{ orientation }`. E.g. `render={<hr />}` (add `border-0`: Tailwind's preflight gives `<hr>` a top border) |
|
|
1667
|
+
|
|
1668
|
+
Style each orientation with `data-[orientation=vertical]:…`.
|
|
1669
|
+
|
|
1647
1670
|
#### `Container`
|
|
1648
1671
|
|
|
1649
1672
|
Tailwind's `container`, centered with horizontal padding (`container mx-auto px-3`). Accepts all `<div>` props.
|
|
@@ -108,7 +108,7 @@ declare const _default: (<Item>({ onValueChange, onOpenChange, onItemHighlighted
|
|
|
108
108
|
InputGroup: ({ className, ...otherProps }: import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
109
109
|
render?: RenderProp<"div", AutocompleteInputState>;
|
|
110
110
|
}) => import("react").JSX.Element;
|
|
111
|
-
Input: ({ size, className, ...otherProps }: Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "
|
|
111
|
+
Input: ({ size, className, ...otherProps }: Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "size" | "value" | "defaultValue"> & {
|
|
112
112
|
size?: InputSize;
|
|
113
113
|
render?: RenderProp<"input", AutocompleteInputState>;
|
|
114
114
|
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RenderProp } from "../../utils/render.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
export type SeparatorState = {
|
|
4
|
+
orientation: "horizontal" | "vertical";
|
|
5
|
+
};
|
|
6
|
+
type BaseSeparatorProps = ComponentProps<"div"> & {
|
|
7
|
+
render?: RenderProp<"div", SeparatorState>;
|
|
8
|
+
/** @default "horizontal" */
|
|
9
|
+
orientation?: "horizontal" | "vertical";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* A `1px` line that screen readers announce. Renders a `<div>` with `role="separator"`,
|
|
13
|
+
* `aria-orientation` and `data-orientation`. Give it a color with `className`.
|
|
14
|
+
*/
|
|
15
|
+
declare const BaseSeparator: ({ orientation, className, ...otherProps }: BaseSeparatorProps) => import("react").JSX.Element;
|
|
16
|
+
export { BaseSeparator as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Separator } from "@base-ui/react/separator";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
// src/components/layout/BaseSeparator.tsx
|
|
6
|
+
/**
|
|
7
|
+
* A `1px` line that screen readers announce. Renders a `<div>` with `role="separator"`,
|
|
8
|
+
* `aria-orientation` and `data-orientation`. Give it a color with `className`.
|
|
9
|
+
*/
|
|
10
|
+
const BaseSeparator = ({ orientation = "horizontal", className, ...otherProps }) => /* @__PURE__ */ jsx(Separator, {
|
|
11
|
+
...otherProps,
|
|
12
|
+
orientation,
|
|
13
|
+
className: cn("shrink-0", {
|
|
14
|
+
"h-px w-full": orientation === "horizontal",
|
|
15
|
+
"w-px self-stretch": orientation === "vertical"
|
|
16
|
+
}, className)
|
|
17
|
+
});
|
|
18
|
+
export { BaseSeparator as default };
|
|
@@ -154,7 +154,7 @@ declare const _default: (<Payload>(props: BaseMenuProps<Payload>) => import("rea
|
|
|
154
154
|
closeDelay?: number;
|
|
155
155
|
nativeButton?: boolean;
|
|
156
156
|
}) => import("react").JSX.Element;
|
|
157
|
-
Input: (props: Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "
|
|
157
|
+
Input: (props: Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "value" | "defaultValue"> & {
|
|
158
158
|
render?: RenderProp<"input", MenuInputState>;
|
|
159
159
|
}) => import("react").JSX.Element;
|
|
160
160
|
Clear: (props: import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
@@ -169,7 +169,7 @@ declare const _default: (({ className, ...otherProps }: BaseMenubarProps) => imp
|
|
|
169
169
|
closeDelay?: number;
|
|
170
170
|
nativeButton?: boolean;
|
|
171
171
|
}) => import("react").JSX.Element;
|
|
172
|
-
Input: (props: Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "
|
|
172
|
+
Input: (props: Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "value" | "defaultValue"> & {
|
|
173
173
|
render?: RenderProp<"input", MenuInputState>;
|
|
174
174
|
}) => import("react").JSX.Element;
|
|
175
175
|
Clear: (props: import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|