margo-ui 1.3.4 → 1.4.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/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export const buttonBaseClassName = `group/button flex h-8 w-fit shrink-0 items-center px-2 rounded-lg border-2 text-on-main
|
|
2
2
|
hover:border-on-main hover:text-on-main focus-visible:margo-border-gradient-primary
|
|
3
|
-
focus-visible:outline focus-visible:outline-offset-1 focus-visible:outline-on-main shadow-button
|
|
3
|
+
focus-visible:outline focus-visible:outline-offset-1 focus-visible:outline-on-main shadow-button
|
|
4
|
+
select-none origin-center transition-transform duration-[160ms] ease-out active:scale-[0.95]`;
|
|
4
5
|
|
|
5
6
|
export const buttonSurfaceClassName = "border-border bg-main";
|
|
6
7
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export const itemBaseClassName = `group/item flex w-full cursor-pointer items-center gap-1 rounded-lg border-2 px-3 py-2 text-on-main
|
|
2
2
|
text-sm focus-visible:margo-border-gradient-primary focus-visible:outline select-none
|
|
3
|
-
focus-visible:outline-offset-1 focus-visible:outline-on-main
|
|
3
|
+
focus-visible:outline-offset-1 focus-visible:outline-on-main
|
|
4
|
+
origin-center bg-border/20 transition-transform duration-[160ms] ease-out active:scale-[0.98]`;
|
|
4
5
|
|
|
5
6
|
export const itemSurfaceClassName = `border-transparent text-medium hover:border-border hover:text-on-main
|
|
6
7
|
hover:shadow-item focus-visible:shadow-item`;
|
package/src/css/grid.css
CHANGED
|
@@ -63,6 +63,24 @@
|
|
|
63
63
|
row-gap: var(--margo-grid-gutter-y);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
/*
|
|
67
|
+
* Row subgrid: the item spans N rows of its parent grid and shares those tracks
|
|
68
|
+
* with its siblings, so sibling boxes with different content lengths keep their
|
|
69
|
+
* internal sections — dividers, footers, actions — on the exact same lines.
|
|
70
|
+
* Must be applied to every sibling that has to align, all with the same N, and
|
|
71
|
+
* each must expose exactly N children (wrap what belongs together).
|
|
72
|
+
*
|
|
73
|
+
* The rows inherit the parent row-gap; override it on the item (same value on
|
|
74
|
+
* every sibling) when the internal spacing differs from the layout gutter.
|
|
75
|
+
*
|
|
76
|
+
* Use on: cards in a row whose separators must line up.
|
|
77
|
+
*/
|
|
78
|
+
@utility margo-grid-sub-rows-* {
|
|
79
|
+
display: grid;
|
|
80
|
+
grid-template-rows: subgrid;
|
|
81
|
+
grid-row-end: span --value(integer);
|
|
82
|
+
}
|
|
83
|
+
|
|
66
84
|
/*
|
|
67
85
|
* Standalone 12-column grid: same line names and gutters, but no max-width and
|
|
68
86
|
* no side padding — it fills whatever box it is placed in.
|
package/src/css/variables.css
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
--margo-color-primary: #57e550;
|
|
54
54
|
--margo-color-primary-darken: #45b93f;
|
|
55
55
|
--margo-color-secondary: #d3d3d3;
|
|
56
|
-
--margo-color-medium: #
|
|
56
|
+
--margo-color-medium: #808080;
|
|
57
57
|
--margo-color-border: #cecece;
|
|
58
58
|
|
|
59
59
|
--margo-shadow-card: 0 8px 6px -4px rgb(220, 220, 220, 0.5);
|
|
@@ -13,14 +13,14 @@ import "./ripple.css";
|
|
|
13
13
|
export const Ripple = ({ children, disabled = false, rippleClassName = "bg-primary-darken" }: RippleProps) => {
|
|
14
14
|
const { endRipple, ripple, startRipple } = useRipple();
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const handlePointerUp = (event: PointerEvent<HTMLElement>) => {
|
|
17
17
|
if (!disabled) startRipple(event);
|
|
18
|
-
children.props.
|
|
18
|
+
children.props.onPointerUp?.(event);
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
return cloneElement(children, {
|
|
22
22
|
className: cn("relative overflow-hidden", children.props.className),
|
|
23
|
-
|
|
23
|
+
onPointerUp: handlePointerUp,
|
|
24
24
|
children: (
|
|
25
25
|
<>
|
|
26
26
|
{children.props.children}
|
package/src/hoc/ripple/type.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { PointerEvent, PointerEventHandler, ReactElement, ReactNode } from
|
|
|
3
3
|
export type RippleChildProps = {
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
className?: string;
|
|
6
|
-
|
|
6
|
+
onPointerUp?: PointerEventHandler<HTMLElement>;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export type RippleProps = {
|