margo-ui 1.4.0 → 1.5.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/README.md +1 -1
- package/package.json +2 -2
- package/src/components/button/button.tsx +1 -1
- package/src/components/button/style.ts +6 -6
- package/src/components/code/code.tsx +16 -0
- package/src/components/code/style.ts +3 -0
- package/src/components/code/type.ts +8 -0
- package/src/components/spinner/spinner.tsx +1 -1
- package/src/components/spinner/type.ts +1 -1
- package/src/components/table/style.ts +1 -1
- package/src/components/tooltip/type.ts +1 -4
- package/src/index.ts +2 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# margo-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React UI kit built on Tailwind CSS v4 design tokens, themeable through plain CSS custom properties.
|
|
4
4
|
|
|
5
5
|
Package: [npmjs.com/package/margo-ui](https://www.npmjs.com/package/margo-ui)
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "margo-ui",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.5.0",
|
|
4
|
+
"description": "React UI kit built on Tailwind CSS v4 design tokens, themeable through plain CSS custom properties.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
7
7
|
"ui",
|
|
@@ -77,7 +77,7 @@ Button.IconLabel = ({
|
|
|
77
77
|
className,
|
|
78
78
|
}: ButtonIconLabelProps) => (
|
|
79
79
|
<span
|
|
80
|
-
style={{ "--button-gap": gap } as CSSProperties}
|
|
80
|
+
style={{ "--margo-button-gap": gap } as CSSProperties}
|
|
81
81
|
className={cn(
|
|
82
82
|
buttonGridClassName,
|
|
83
83
|
side === "start" && "[direction:rtl]",
|
|
@@ -20,13 +20,13 @@ export const buttonLabelClassName =
|
|
|
20
20
|
export const buttonGridClassName =
|
|
21
21
|
"grid items-center gap-0 transition-[grid-template-columns,gap] duration-[180ms] ease-in-out";
|
|
22
22
|
|
|
23
|
-
export const buttonGridForwardClassName = `grid-cols-[1rem_0fr] group-hover/button:grid-cols-[1rem_1fr] group-hover/button:gap-(--button-gap)
|
|
24
|
-
group-focus-visible/button:grid-cols-[1rem_1fr] group-focus-visible/button:gap-(--button-gap)
|
|
25
|
-
group-data-[margo-open=true]/button:grid-cols-[1rem_1fr] group-data-[margo-open=true]/button:gap-(--button-gap)`;
|
|
23
|
+
export const buttonGridForwardClassName = `grid-cols-[1rem_0fr] group-hover/button:grid-cols-[1rem_1fr] group-hover/button:gap-(--margo-button-gap)
|
|
24
|
+
group-focus-visible/button:grid-cols-[1rem_1fr] group-focus-visible/button:gap-(--margo-button-gap)
|
|
25
|
+
group-data-[margo-open=true]/button:grid-cols-[1rem_1fr] group-data-[margo-open=true]/button:gap-(--margo-button-gap)`;
|
|
26
26
|
|
|
27
|
-
export const buttonGridReverseClassName = `grid-cols-[auto_0rem] group-hover/button:grid-cols-[auto_1rem] group-hover/button:gap-(--button-gap)
|
|
28
|
-
group-focus-visible/button:grid-cols-[auto_1rem] group-focus-visible/button:gap-(--button-gap)
|
|
29
|
-
group-data-[margo-open=true]/button:grid-cols-[auto_1rem] group-data-[margo-open=true]/button:gap-(--button-gap)`;
|
|
27
|
+
export const buttonGridReverseClassName = `grid-cols-[auto_0rem] group-hover/button:grid-cols-[auto_1rem] group-hover/button:gap-(--margo-button-gap)
|
|
28
|
+
group-focus-visible/button:grid-cols-[auto_1rem] group-focus-visible/button:gap-(--margo-button-gap)
|
|
29
|
+
group-data-[margo-open=true]/button:grid-cols-[auto_1rem] group-data-[margo-open=true]/button:gap-(--margo-button-gap)`;
|
|
30
30
|
|
|
31
31
|
export const buttonSlotClassName = `min-w-0 overflow-hidden opacity-0 transition-opacity duration-[180ms] ease-in
|
|
32
32
|
group-hover/button:opacity-100 group-focus-visible/button:opacity-100 group-data-[margo-open=true]/button:opacity-100`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Tag } from "react-renderable";
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../utils/cn/cn.js";
|
|
4
|
+
import { codeBaseClassName, codeFilledClassName } from "./style.js";
|
|
5
|
+
|
|
6
|
+
import type { ElementType } from "react";
|
|
7
|
+
import type { CodeProps } from "./type.js";
|
|
8
|
+
|
|
9
|
+
export const Code = <T extends ElementType = "code">({ filled = false, className, children, ...rest }: CodeProps<T>) => (
|
|
10
|
+
<Tag
|
|
11
|
+
{...Tag.forward<T>(rest, "code")}
|
|
12
|
+
className={cn(codeBaseClassName, filled && codeFilledClassName, className)}
|
|
13
|
+
>
|
|
14
|
+
{children}
|
|
15
|
+
</Tag>
|
|
16
|
+
);
|
|
@@ -8,9 +8,9 @@ import type { SpinnerProps } from "./type.js";
|
|
|
8
8
|
|
|
9
9
|
export const Spinner = <T extends ElementType = "span">({ className, label = "Loading", ...rest }: SpinnerProps<T>) => (
|
|
10
10
|
<Tag
|
|
11
|
+
aria-label={label}
|
|
11
12
|
{...Tag.forward<T>(rest, "span")}
|
|
12
13
|
role="status"
|
|
13
|
-
aria-label={label}
|
|
14
14
|
className={cn(spinnerBaseClassName, className)}
|
|
15
15
|
>
|
|
16
16
|
<svg viewBox="0 0 24 24" aria-hidden className={spinnerIconClassName}>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const tableWrapperClassName = "w-full overflow-x-auto rounded-lg border-2 border-border";
|
|
1
|
+
export const tableWrapperClassName = "w-full overflow-x-auto overscroll-x-none rounded-lg border-2 border-border";
|
|
2
2
|
|
|
3
3
|
export const tableBaseClassName = "w-full border-collapse text-xs text-on-main";
|
|
4
4
|
|
|
@@ -11,7 +11,4 @@ export type TooltipOwnProps = {
|
|
|
11
11
|
children?: ReactNode;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
export type TooltipProps<T extends ElementType = "div"> =
|
|
15
|
-
TagProps<T, TooltipOwnProps>,
|
|
16
|
-
"aria-label"
|
|
17
|
-
>;
|
|
14
|
+
export type TooltipProps<T extends ElementType = "div"> = TagProps<T, TooltipOwnProps>;
|
package/src/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { Button } from "./components/button/button.js";
|
|
|
3
3
|
export { ButtonMicro } from "./components/button_micro/button_micro.js";
|
|
4
4
|
export { Card } from "./components/card/card.js";
|
|
5
5
|
export { Chip } from "./components/chip/chip.js";
|
|
6
|
+
export { Code } from "./components/code/code.js";
|
|
6
7
|
export { Dialog } from "./components/dialog/dialog.js";
|
|
7
8
|
export { Header } from "./components/header/header.js";
|
|
8
9
|
export { Layer } from "./components/layer/layer.js";
|
|
@@ -42,6 +43,7 @@ export type {
|
|
|
42
43
|
export type { ButtonMicroProps } from "./components/button_micro/type.js";
|
|
43
44
|
export type { CardProps } from "./components/card/type.js";
|
|
44
45
|
export type { ChipProps } from "./components/chip/type.js";
|
|
46
|
+
export type { CodeOwnProps, CodeProps } from "./components/code/type.js";
|
|
45
47
|
export type { DialogBodyProps, DialogFooterProps, DialogProps } from "./components/dialog/type.js";
|
|
46
48
|
export type {
|
|
47
49
|
HeaderLeadingProps,
|