@stackone/malachite 2.73.0 → 2.75.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/COMPONENTS.md +6 -4
- package/dist/components/AvatarGroup.js +74 -0
- package/dist/components/AvatarGroup.js.map +1 -0
- package/dist/components/Button.js +79 -190
- package/dist/components/Button.js.map +1 -1
- package/dist/components/ButtonSpinner.js +36 -0
- package/dist/components/ButtonSpinner.js.map +1 -0
- package/dist/components/Flex.js +14 -13
- package/dist/components/Flex.js.map +1 -1
- package/dist/components/SplitButton.js +91 -0
- package/dist/components/SplitButton.js.map +1 -0
- package/dist/components/Surface.js +88 -84
- package/dist/components/Surface.js.map +1 -1
- package/dist/components/Typography/EllipsisText.js +18 -16
- package/dist/components/Typography/EllipsisText.js.map +1 -1
- package/dist/components/buttonStyles.js +93 -0
- package/dist/components/buttonStyles.js.map +1 -0
- package/dist/components/floatingMenuGeometry.js.map +1 -1
- package/dist/index.d.ts +66 -5
- package/dist/index.js +469 -465
- package/dist/index.js.map +1 -1
- package/dist/tailwind.css.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
const r = () => /* @__PURE__ */ e(
|
|
3
|
+
"svg",
|
|
4
|
+
{
|
|
5
|
+
className: "animate-spin motion-reduce:animate-none -ml-1 mr-2 h-4 w-4",
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
fill: "none",
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
children: [
|
|
10
|
+
/* @__PURE__ */ o(
|
|
11
|
+
"circle",
|
|
12
|
+
{
|
|
13
|
+
className: "opacity-25 motion-reduce:opacity-100",
|
|
14
|
+
cx: "12",
|
|
15
|
+
cy: "12",
|
|
16
|
+
r: "10",
|
|
17
|
+
stroke: "currentColor",
|
|
18
|
+
strokeWidth: "4"
|
|
19
|
+
}
|
|
20
|
+
),
|
|
21
|
+
/* @__PURE__ */ o(
|
|
22
|
+
"path",
|
|
23
|
+
{
|
|
24
|
+
className: "opacity-75 motion-reduce:opacity-0",
|
|
25
|
+
fill: "currentColor",
|
|
26
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
export {
|
|
33
|
+
r as ButtonSpinner,
|
|
34
|
+
r as default
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=ButtonSpinner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonSpinner.js","sources":["../../src/components/ButtonSpinner.tsx"],"sourcesContent":["export const ButtonSpinner = () => (\n <svg\n className=\"animate-spin motion-reduce:animate-none -ml-1 mr-2 h-4 w-4\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n className=\"opacity-25 motion-reduce:opacity-100\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75 motion-reduce:opacity-0\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n);\n\nexport default ButtonSpinner;\n"],"names":["ButtonSpinner","jsxs","jsx"],"mappings":";AAAO,MAAMA,IAAgB,MACzB,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,WAAU;AAAA,IACV,OAAM;AAAA,IACN,MAAK;AAAA,IACL,SAAQ;AAAA,IAER,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,WAAU;AAAA,UACV,IAAG;AAAA,UACH,IAAG;AAAA,UACH,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA,QAAA;AAAA,MAAA;AAAA,MAEhB,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,WAAU;AAAA,UACV,MAAK;AAAA,UACL,GAAE;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AACJ;"}
|
package/dist/components/Flex.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as v } from "react/jsx-runtime";
|
|
2
|
-
import { FlexDirection as
|
|
3
|
-
const
|
|
2
|
+
import { FlexDirection as a, FlexAlign as h, FlexJustify as y, FlexGapSize as e } from "./flexTypes.js";
|
|
3
|
+
const F = (t) => {
|
|
4
4
|
switch (t) {
|
|
5
5
|
case e.XSmall:
|
|
6
6
|
return 8;
|
|
@@ -11,23 +11,24 @@ const y = (t) => {
|
|
|
11
11
|
case e.Large:
|
|
12
12
|
return 36;
|
|
13
13
|
}
|
|
14
|
-
},
|
|
15
|
-
justify: t =
|
|
16
|
-
align: o =
|
|
14
|
+
}, D = ({
|
|
15
|
+
justify: t = y.Center,
|
|
16
|
+
align: o = h.Center,
|
|
17
17
|
gapSize: i,
|
|
18
|
-
direction:
|
|
18
|
+
direction: r = a.Horizontal,
|
|
19
19
|
fullHeight: n = !1,
|
|
20
20
|
grow: s = !1,
|
|
21
21
|
shrink: c = !1,
|
|
22
22
|
wrap: f = !1,
|
|
23
23
|
width: d,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
as: x = "div",
|
|
25
|
+
id: u,
|
|
26
|
+
children: m,
|
|
27
|
+
className: p = ""
|
|
27
28
|
}) => {
|
|
28
|
-
const l = i ?
|
|
29
|
+
const l = i ? F(i) : void 0, g = {
|
|
29
30
|
display: "flex",
|
|
30
|
-
flexDirection:
|
|
31
|
+
flexDirection: r === a.Vertical ? "column" : "row",
|
|
31
32
|
flexWrap: f ? "wrap" : void 0,
|
|
32
33
|
justifyContent: t,
|
|
33
34
|
alignItems: o,
|
|
@@ -37,9 +38,9 @@ const y = (t) => {
|
|
|
37
38
|
minWidth: c ? 0 : void 0,
|
|
38
39
|
width: d || void 0
|
|
39
40
|
};
|
|
40
|
-
return /* @__PURE__ */ v(
|
|
41
|
+
return /* @__PURE__ */ v(x, { id: u, className: p, style: g, children: m });
|
|
41
42
|
};
|
|
42
43
|
export {
|
|
43
|
-
|
|
44
|
+
D as default
|
|
44
45
|
};
|
|
45
46
|
//# sourceMappingURL=Flex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flex.js","sources":["../../src/components/Flex.tsx"],"sourcesContent":["import React from 'react';\nimport { FlexAlign, FlexDirection, FlexGapSize, FlexJustify } from './flexTypes';\n\
|
|
1
|
+
{"version":3,"file":"Flex.js","sources":["../../src/components/Flex.tsx"],"sourcesContent":["import React from 'react';\nimport { FlexAlign, FlexDirection, FlexGapSize, FlexJustify } from './flexTypes';\n\ninterface FlexProps {\n justify?: FlexJustify;\n align?: FlexAlign;\n gapSize?: FlexGapSize;\n direction?: FlexDirection;\n fullHeight?: boolean;\n grow?: boolean;\n shrink?: boolean;\n wrap?: boolean;\n width?: string;\n id?: string;\n /** `span` for content inside a button, such as a clickable `Surface.Row`. */\n as?: 'div' | 'span';\n children?: React.ReactNode;\n className?: string;\n}\n\nconst getGapSize = (size: FlexGapSize): number => {\n switch (size) {\n case FlexGapSize.XSmall:\n return 8;\n case FlexGapSize.Small:\n return 12;\n case FlexGapSize.Medium:\n return 24;\n case FlexGapSize.Large:\n return 36;\n }\n};\n\nconst Flex: React.FC<FlexProps> = ({\n justify = FlexJustify.Center,\n align = FlexAlign.Center,\n gapSize,\n direction = FlexDirection.Horizontal,\n fullHeight = false,\n grow = false,\n shrink = false,\n wrap = false,\n width,\n as = 'div',\n id,\n children,\n className = '',\n}) => {\n const gapSizeValue = gapSize ? getGapSize(gapSize) : undefined;\n\n // Convert direction to CSS flex-direction\n const flexDirection = direction === FlexDirection.Vertical ? 'column' : 'row';\n\n const baseStyle: React.CSSProperties = {\n display: 'flex',\n flexDirection,\n flexWrap: wrap ? 'wrap' : undefined,\n justifyContent: justify,\n alignItems: align,\n gap: gapSizeValue ? `${gapSizeValue}px` : undefined,\n height: fullHeight ? '100%' : undefined,\n flex: grow ? 1 : undefined,\n minWidth: shrink ? 0 : undefined,\n width: width || undefined,\n };\n\n const Tag = as;\n return (\n <Tag id={id} className={className} style={baseStyle}>\n {children}\n </Tag>\n );\n};\n\nexport default Flex;\n"],"names":["getGapSize","size","FlexGapSize","Flex","justify","FlexJustify","align","FlexAlign","gapSize","direction","FlexDirection","fullHeight","grow","shrink","wrap","width","as","id","children","className","gapSizeValue","baseStyle"],"mappings":";;AAoBA,MAAMA,IAAa,CAACC,MAA8B;AAC9C,UAAQA,GAAA;AAAA,IACJ,KAAKC,EAAY;AACb,aAAO;AAAA,IACX,KAAKA,EAAY;AACb,aAAO;AAAA,IACX,KAAKA,EAAY;AACb,aAAO;AAAA,IACX,KAAKA,EAAY;AACb,aAAO;AAAA,EAAA;AAEnB,GAEMC,IAA4B,CAAC;AAAA,EAC/B,SAAAC,IAAUC,EAAY;AAAA,EACtB,OAAAC,IAAQC,EAAU;AAAA,EAClB,SAAAC;AAAA,EACA,WAAAC,IAAYC,EAAc;AAAA,EAC1B,YAAAC,IAAa;AAAA,EACb,MAAAC,IAAO;AAAA,EACP,QAAAC,IAAS;AAAA,EACT,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,IAAAC,IAAK;AAAA,EACL,IAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAChB,MAAM;AACF,QAAMC,IAAeZ,IAAUR,EAAWQ,CAAO,IAAI,QAK/Ca,IAAiC;AAAA,IACnC,SAAS;AAAA,IACT,eAJkBZ,MAAcC,EAAc,WAAW,WAAW;AAAA,IAKpE,UAAUI,IAAO,SAAS;AAAA,IAC1B,gBAAgBV;AAAA,IAChB,YAAYE;AAAA,IACZ,KAAKc,IAAe,GAAGA,CAAY,OAAO;AAAA,IAC1C,QAAQT,IAAa,SAAS;AAAA,IAC9B,MAAMC,IAAO,IAAI;AAAA,IACjB,UAAUC,IAAS,IAAI;AAAA,IACvB,OAAOE,KAAS;AAAA,EAAA;AAIpB,2BADYC,GAEP,EAAI,IAAAC,GAAQ,WAAAE,GAAsB,OAAOE,GACrC,UAAAH,GACL;AAER;"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as R } from "react";
|
|
3
|
+
import { ButtonSpinner as k } from "./ButtonSpinner.js";
|
|
4
|
+
import G from "./CustomIcons/CaretDownIcon.js";
|
|
5
|
+
import M from "./CustomIcons/CaretUpIcon.js";
|
|
6
|
+
import { getIconOnlySizeClasses as $, getIconSizeClass as D } from "./buttonSizing.js";
|
|
7
|
+
import { getSizeClasses as T, getVariantClasses as _, getDefaultRadiusClass as z } from "./buttonStyles.js";
|
|
8
|
+
const A = "relative rounded-e-none border-e-0 focus-visible:z-[1]", U = "relative rounded-s-none border-s-0 before:absolute before:inset-y-0 before:start-0 before:w-px before:bg-current before:opacity-25", V = R(
|
|
9
|
+
({
|
|
10
|
+
variant: p = "filled",
|
|
11
|
+
size: t = "medium",
|
|
12
|
+
children: b,
|
|
13
|
+
leading: n,
|
|
14
|
+
trailing: r,
|
|
15
|
+
onClick: C,
|
|
16
|
+
type: x = "button",
|
|
17
|
+
loading: o = !1,
|
|
18
|
+
disabled: h = !1,
|
|
19
|
+
flexGrow: l = !1,
|
|
20
|
+
menuLabel: N,
|
|
21
|
+
menuOpen: a,
|
|
22
|
+
onMenuClick: S,
|
|
23
|
+
menuIcon: g,
|
|
24
|
+
menuHasPopup: v = !0,
|
|
25
|
+
menuRef: y,
|
|
26
|
+
menuTrigger: i,
|
|
27
|
+
className: c = "",
|
|
28
|
+
style: I
|
|
29
|
+
}, j) => {
|
|
30
|
+
const s = h || o, B = z(t, !1), f = _(p, B), m = s ? "cursor-not-allowed" : "", E = [
|
|
31
|
+
"flex items-center justify-center",
|
|
32
|
+
T(t),
|
|
33
|
+
f,
|
|
34
|
+
A,
|
|
35
|
+
l ? "flex-1" : "",
|
|
36
|
+
m
|
|
37
|
+
].filter(Boolean).join(" "), w = [
|
|
38
|
+
"flex items-center justify-center p-0",
|
|
39
|
+
$(t),
|
|
40
|
+
f,
|
|
41
|
+
U,
|
|
42
|
+
D(t),
|
|
43
|
+
m
|
|
44
|
+
].filter(Boolean).join(" "), u = /* @__PURE__ */ e(
|
|
45
|
+
"button",
|
|
46
|
+
{
|
|
47
|
+
ref: y,
|
|
48
|
+
type: "button",
|
|
49
|
+
disabled: s,
|
|
50
|
+
"aria-label": N,
|
|
51
|
+
"aria-haspopup": v ? "menu" : void 0,
|
|
52
|
+
"aria-expanded": a,
|
|
53
|
+
onClick: S,
|
|
54
|
+
className: w,
|
|
55
|
+
children: g ?? (a ? /* @__PURE__ */ e(M, {}) : /* @__PURE__ */ e(G, {}))
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
return /* @__PURE__ */ d(
|
|
59
|
+
"span",
|
|
60
|
+
{
|
|
61
|
+
className: `inline-flex items-stretch${l ? " w-full" : ""}${c ? ` ${c}` : ""}`,
|
|
62
|
+
style: I,
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ d(
|
|
65
|
+
"button",
|
|
66
|
+
{
|
|
67
|
+
ref: j,
|
|
68
|
+
type: x,
|
|
69
|
+
disabled: s,
|
|
70
|
+
onClick: C,
|
|
71
|
+
className: E,
|
|
72
|
+
children: [
|
|
73
|
+
n ? /* @__PURE__ */ e("span", { className: "btn-leading inline-flex shrink-0 items-center me-2", children: n }) : null,
|
|
74
|
+
o ? /* @__PURE__ */ e(k, {}) : null,
|
|
75
|
+
b,
|
|
76
|
+
r ? /* @__PURE__ */ e("span", { className: "btn-trailing inline-flex shrink-0 items-center ms-2", children: r }) : null
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
i ? i(u) : u
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
V.displayName = "SplitButton";
|
|
87
|
+
export {
|
|
88
|
+
V as SplitButton,
|
|
89
|
+
V as default
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=SplitButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SplitButton.js","sources":["../../src/components/SplitButton.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport type { ButtonSize, ButtonVariant } from './Button';\nimport ButtonSpinner from './ButtonSpinner';\nimport CaretDownIcon from './CustomIcons/CaretDownIcon';\nimport CaretUpIcon from './CustomIcons/CaretUpIcon';\nimport { getIconOnlySizeClasses, getIconSizeClass } from './buttonSizing';\nimport { getDefaultRadiusClass, getSizeClasses, getVariantClasses } from './buttonStyles';\n\nexport interface SplitButtonProps {\n variant?: ButtonVariant;\n size?: ButtonSize;\n children?: React.ReactNode;\n leading?: React.ReactNode;\n trailing?: React.ReactNode;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n /** The trigger segment is always `type=\"button\"`. */\n type?: 'button' | 'submit' | 'reset';\n loading?: boolean;\n disabled?: boolean;\n flexGrow?: boolean;\n /** Accessible name of the chevron segment. */\n menuLabel: string;\n /** Drives `aria-expanded`; the chevron points up while open. */\n menuOpen?: boolean;\n onMenuClick?: React.MouseEventHandler<HTMLButtonElement>;\n menuIcon?: React.ReactNode;\n /** `false` for a trigger that opens something other than a menu. */\n menuHasPopup?: boolean;\n menuRef?: React.Ref<HTMLButtonElement>;\n /** Wraps the trigger segment, e.g. as a `Popover`'s `trigger`. */\n menuTrigger?: (segment: React.ReactElement) => React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n}\n\n// The seam is the trigger's own text colour, so it reads on every variant.\nconst MAIN_SEGMENT = 'relative rounded-e-none border-e-0 focus-visible:z-[1]';\nconst TRIGGER_SEGMENT =\n 'relative rounded-s-none border-s-0 before:absolute before:inset-y-0 before:start-0 before:w-px before:bg-current before:opacity-25';\n\n/** A primary action and a menu trigger in one pill; each segment is its own button. */\nexport const SplitButton = forwardRef<HTMLButtonElement, SplitButtonProps>(\n (\n {\n variant = 'filled',\n size = 'medium',\n children,\n leading,\n trailing,\n onClick,\n type = 'button',\n loading = false,\n disabled = false,\n flexGrow = false,\n menuLabel,\n menuOpen,\n onMenuClick,\n menuIcon,\n menuHasPopup = true,\n menuRef,\n menuTrigger,\n className = '',\n style,\n },\n ref,\n ) => {\n const isInactive = disabled || loading;\n const radiusClass = getDefaultRadiusClass(size, false);\n const variantClasses = getVariantClasses(variant, radiusClass);\n const inactiveClass = isInactive ? 'cursor-not-allowed' : '';\n\n const mainClasses = [\n 'flex items-center justify-center',\n getSizeClasses(size),\n variantClasses,\n MAIN_SEGMENT,\n flexGrow ? 'flex-1' : '',\n inactiveClass,\n ]\n .filter(Boolean)\n .join(' ');\n\n const triggerClasses = [\n 'flex items-center justify-center p-0',\n getIconOnlySizeClasses(size),\n variantClasses,\n TRIGGER_SEGMENT,\n getIconSizeClass(size),\n inactiveClass,\n ]\n .filter(Boolean)\n .join(' ');\n\n const trigger = (\n <button\n ref={menuRef}\n type=\"button\"\n disabled={isInactive}\n aria-label={menuLabel}\n aria-haspopup={menuHasPopup ? 'menu' : undefined}\n aria-expanded={menuOpen}\n onClick={onMenuClick}\n className={triggerClasses}\n >\n {menuIcon ?? (menuOpen ? <CaretUpIcon /> : <CaretDownIcon />)}\n </button>\n );\n\n return (\n <span\n className={`inline-flex items-stretch${flexGrow ? ' w-full' : ''}${className ? ` ${className}` : ''}`}\n style={style}\n >\n <button\n ref={ref}\n type={type}\n disabled={isInactive}\n onClick={onClick}\n className={mainClasses}\n >\n {leading ? (\n <span className=\"btn-leading inline-flex shrink-0 items-center me-2\">\n {leading}\n </span>\n ) : null}\n {loading ? <ButtonSpinner /> : null}\n {children}\n {trailing ? (\n <span className=\"btn-trailing inline-flex shrink-0 items-center ms-2\">\n {trailing}\n </span>\n ) : null}\n </button>\n {menuTrigger ? menuTrigger(trigger) : trigger}\n </span>\n );\n },\n);\n\nSplitButton.displayName = 'SplitButton';\n\nexport default SplitButton;\n"],"names":["MAIN_SEGMENT","TRIGGER_SEGMENT","SplitButton","forwardRef","variant","size","children","leading","trailing","onClick","type","loading","disabled","flexGrow","menuLabel","menuOpen","onMenuClick","menuIcon","menuHasPopup","menuRef","menuTrigger","className","style","ref","isInactive","radiusClass","getDefaultRadiusClass","variantClasses","getVariantClasses","inactiveClass","mainClasses","getSizeClasses","triggerClasses","getIconOnlySizeClasses","getIconSizeClass","trigger","jsx","CaretUpIcon","CaretDownIcon","jsxs","ButtonSpinner"],"mappings":";;;;;;;AAoCA,MAAMA,IAAe,0DACfC,IACF,sIAGSC,IAAcC;AAAA,EACvB,CACI;AAAA,IACI,SAAAC,IAAU;AAAA,IACV,MAAAC,IAAO;AAAA,IACP,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,SAAAC,IAAU;AAAA,IACV,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,SAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,OAAAC;AAAA,EAAA,GAEJC,MACC;AACD,UAAMC,IAAaZ,KAAYD,GACzBc,IAAcC,EAAsBrB,GAAM,EAAK,GAC/CsB,IAAiBC,EAAkBxB,GAASqB,CAAW,GACvDI,IAAgBL,IAAa,uBAAuB,IAEpDM,IAAc;AAAA,MAChB;AAAA,MACAC,EAAe1B,CAAI;AAAA,MACnBsB;AAAA,MACA3B;AAAA,MACAa,IAAW,WAAW;AAAA,MACtBgB;AAAA,IAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,GAEPG,IAAiB;AAAA,MACnB;AAAA,MACAC,EAAuB5B,CAAI;AAAA,MAC3BsB;AAAA,MACA1B;AAAA,MACAiC,EAAiB7B,CAAI;AAAA,MACrBwB;AAAA,IAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,GAEPM,IACF,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,KAAKjB;AAAA,QACL,MAAK;AAAA,QACL,UAAUK;AAAA,QACV,cAAYV;AAAA,QACZ,iBAAeI,IAAe,SAAS;AAAA,QACvC,iBAAeH;AAAA,QACf,SAASC;AAAA,QACT,WAAWgB;AAAA,QAEV,gBAAajB,IAAW,gBAAAqB,EAACC,GAAA,CAAA,CAAY,sBAAMC,GAAA,EAAc;AAAA,MAAA;AAAA,IAAA;AAIlE,WACI,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,WAAW,4BAA4B1B,IAAW,YAAY,EAAE,GAAGQ,IAAY,IAAIA,CAAS,KAAK,EAAE;AAAA,QACnG,OAAAC;AAAA,QAEA,UAAA;AAAA,UAAA,gBAAAiB;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,KAAAhB;AAAA,cACA,MAAAb;AAAA,cACA,UAAUc;AAAA,cACV,SAAAf;AAAA,cACA,WAAWqB;AAAA,cAEV,UAAA;AAAA,gBAAAvB,IACG,gBAAA6B,EAAC,QAAA,EAAK,WAAU,sDACX,aACL,IACA;AAAA,gBACHzB,IAAU,gBAAAyB,EAACI,GAAA,CAAA,CAAc,IAAK;AAAA,gBAC9BlC;AAAA,gBACAE,IACG,gBAAA4B,EAAC,QAAA,EAAK,WAAU,uDACX,aACL,IACA;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,UAEPhB,IAAcA,EAAYe,CAAO,IAAIA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGlD;AACJ;AAEAjC,EAAY,cAAc;"}
|
|
@@ -1,79 +1,80 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { FOCUS_RING_INSET as
|
|
6
|
-
import { resolveRel as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { FOREGROUND_RESET as
|
|
10
|
-
const
|
|
1
|
+
import { jsx as o, jsxs as O } from "react/jsx-runtime";
|
|
2
|
+
import q from "react";
|
|
3
|
+
import { DisclosureArrow as J } from "./DisclosureArrow.js";
|
|
4
|
+
import { paintOnChild as M } from "./asChild.js";
|
|
5
|
+
import { FOCUS_RING_INSET as j } from "./focusRing.js";
|
|
6
|
+
import { resolveRel as I } from "./linkRel.js";
|
|
7
|
+
import { isRenderableNode as Q } from "./renderableNode.js";
|
|
8
|
+
import { safeHref as Y } from "./safeHref.js";
|
|
9
|
+
import { FOREGROUND_RESET as Z, SELECTED_TEXT_CONTEXT as ee, SELECTED_ROW_ACCENT as ae, SELECTED_ROW_FOREGROUND as re, SELECTED_ROW_BACKGROUND as B } from "./selectedRow.js";
|
|
10
|
+
const oe = {
|
|
11
11
|
none: "",
|
|
12
12
|
compact: "px-[16px] py-[8px]"
|
|
13
|
-
},
|
|
13
|
+
}, te = {
|
|
14
14
|
default: "",
|
|
15
15
|
muted: "bg-[var(--malachite-card-dimmed-background)]",
|
|
16
16
|
success: "bg-[var(--malachite-tag-success-background)]",
|
|
17
17
|
error: "bg-[var(--malachite-tag-error-background)]"
|
|
18
|
-
},
|
|
18
|
+
}, le = {
|
|
19
19
|
success: "var(--malachite-tag-success-foreground)",
|
|
20
20
|
error: "var(--malachite-tag-error-foreground)"
|
|
21
|
-
},
|
|
21
|
+
}, ie = "opacity-0 transition-opacity group-[:hover]/row:opacity-100 group-focus-within/row:opacity-100 has-[[aria-expanded=true]]:opacity-100 [@media(hover:none)]:opacity-100", ne = "0px 0px 4px 0px rgba(0,0,0,0.08), 0px 4px 4px 0px rgba(0,0,0,0.08), 0px 4px 10px 0px rgba(0,0,0,0.05)", F = (t) => {
|
|
22
22
|
const {
|
|
23
23
|
children: a,
|
|
24
24
|
divider: r = !1,
|
|
25
25
|
disabled: e = !1,
|
|
26
26
|
selected: n,
|
|
27
|
-
selection:
|
|
28
|
-
tone:
|
|
29
|
-
inset:
|
|
27
|
+
selection: s,
|
|
28
|
+
tone: d = "default",
|
|
29
|
+
inset: p = "none",
|
|
30
30
|
className: f = "",
|
|
31
|
-
style:
|
|
31
|
+
style: N
|
|
32
32
|
} = t, c = t.asChild === !0, {
|
|
33
33
|
onClick: l,
|
|
34
34
|
href: b,
|
|
35
35
|
target: u,
|
|
36
|
-
rel:
|
|
37
|
-
trailing:
|
|
38
|
-
revealTrailing:
|
|
36
|
+
rel: T,
|
|
37
|
+
trailing: $,
|
|
38
|
+
revealTrailing: D,
|
|
39
39
|
role: i
|
|
40
|
-
} = c ? {} : t, h =
|
|
40
|
+
} = c ? {} : t, h = Y(b), x = c ? void 0 : t["aria-label"], v = c ? void 0 : t["aria-labelledby"], y = c ? void 0 : t.tabIndex, w = !!(l || h), G = e && (w || c) ? "" : "transition-colors hover:bg-[var(--malachite-buttonlist-hover-background)]", U = d !== "default", W = te[d], S = !c && Q($), R = oe[p], X = R && !S ? "" : "p-0", A = [
|
|
41
41
|
"w-full text-left border-0",
|
|
42
|
-
|
|
42
|
+
W,
|
|
43
43
|
r ? "border-b border-solid border-[var(--malachite-card-border)]" : "",
|
|
44
|
-
|
|
45
|
-
].filter(Boolean).join(" "),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
].filter(Boolean).join(" "),
|
|
49
|
-
backgroundImage: `linear-gradient(${
|
|
50
|
-
color:
|
|
51
|
-
boxShadow: `inset 2px 0 0 ${
|
|
52
|
-
...
|
|
53
|
-
} : {},
|
|
54
|
-
color:
|
|
55
|
-
"--malachite-ctx-text-primary":
|
|
56
|
-
} : {}, ...
|
|
44
|
+
G
|
|
45
|
+
].filter(Boolean).join(" "), k = [
|
|
46
|
+
w ? `appearance-none ${U ? "" : "bg-transparent"} ${X} ${j}` : "",
|
|
47
|
+
w && !e ? "cursor-pointer" : ""
|
|
48
|
+
].filter(Boolean).join(" "), C = [A, k, S ? "" : R, f].filter(Boolean).join(" "), H = s ? s !== "announce" : i !== "checkbox", z = s !== "tint", K = n === !0 && H ? {
|
|
49
|
+
backgroundImage: `linear-gradient(${B}, ${B})`,
|
|
50
|
+
color: re,
|
|
51
|
+
...z ? { boxShadow: `inset 2px 0 0 ${ae}` } : {},
|
|
52
|
+
...ee
|
|
53
|
+
} : {}, _ = le[d], g = { ..._ ? {
|
|
54
|
+
color: _,
|
|
55
|
+
"--malachite-ctx-text-primary": _
|
|
56
|
+
} : {}, ...K, ...N }, m = i === "checkbox" && n === "mixed" ? "mixed" : i === "radio" || i === "checkbox" ? n === !0 : void 0, E = m === void 0 && n === !0 ? !0 : void 0, L = {
|
|
57
57
|
role: i,
|
|
58
|
-
"aria-checked":
|
|
58
|
+
"aria-checked": m,
|
|
59
59
|
"aria-current": E,
|
|
60
60
|
"aria-label": x,
|
|
61
61
|
"aria-labelledby": v,
|
|
62
62
|
"aria-disabled": i && e ? !0 : void 0
|
|
63
63
|
};
|
|
64
64
|
if (c)
|
|
65
|
-
return
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
65
|
+
return M(a, C, g);
|
|
66
|
+
if (S) {
|
|
67
|
+
const V = h && !e ? /* @__PURE__ */ o(
|
|
68
68
|
"a",
|
|
69
69
|
{
|
|
70
70
|
href: h,
|
|
71
71
|
target: u,
|
|
72
|
-
rel:
|
|
72
|
+
rel: I(T, u),
|
|
73
73
|
onClick: l,
|
|
74
|
-
className: `${
|
|
74
|
+
className: `${k} border-0 flex-1 min-w-0 text-left no-underline text-inherit`,
|
|
75
75
|
role: i,
|
|
76
|
-
|
|
76
|
+
tabIndex: y,
|
|
77
|
+
"aria-checked": m,
|
|
77
78
|
"aria-current": E,
|
|
78
79
|
"aria-label": x,
|
|
79
80
|
"aria-labelledby": v,
|
|
@@ -85,9 +86,10 @@ const ee = {
|
|
|
85
86
|
type: "button",
|
|
86
87
|
onClick: l,
|
|
87
88
|
disabled: e,
|
|
88
|
-
className: `${
|
|
89
|
+
className: `${k} border-0 flex-1 min-w-0 text-left`,
|
|
89
90
|
role: i,
|
|
90
|
-
|
|
91
|
+
tabIndex: y,
|
|
92
|
+
"aria-checked": m,
|
|
91
93
|
"aria-current": E,
|
|
92
94
|
"aria-label": x,
|
|
93
95
|
"aria-labelledby": v,
|
|
@@ -96,26 +98,26 @@ const ee = {
|
|
|
96
98
|
) : (
|
|
97
99
|
// The set goes here, not on the wrapper: `radio` and `checkbox` make their
|
|
98
100
|
// descendants presentational, which would bury a control in the trailing slot.
|
|
99
|
-
/* @__PURE__ */ o("div", { className: "flex-1 min-w-0", ...
|
|
101
|
+
/* @__PURE__ */ o("div", { className: "flex-1 min-w-0", ...L, children: a })
|
|
100
102
|
);
|
|
101
|
-
return /* @__PURE__ */
|
|
103
|
+
return /* @__PURE__ */ O(
|
|
102
104
|
"div",
|
|
103
105
|
{
|
|
104
106
|
className: [
|
|
105
|
-
|
|
107
|
+
A,
|
|
106
108
|
"flex items-center",
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
R,
|
|
110
|
+
D ? "group/row" : "",
|
|
109
111
|
f
|
|
110
112
|
].filter(Boolean).join(" "),
|
|
111
113
|
style: g,
|
|
112
114
|
children: [
|
|
113
|
-
|
|
115
|
+
V,
|
|
114
116
|
/* @__PURE__ */ o(
|
|
115
117
|
"div",
|
|
116
118
|
{
|
|
117
|
-
className: `shrink-0 flex items-center ${
|
|
118
|
-
children:
|
|
119
|
+
className: `shrink-0 flex items-center ${D ? ie : ""}`,
|
|
120
|
+
children: $
|
|
119
121
|
}
|
|
120
122
|
)
|
|
121
123
|
]
|
|
@@ -127,12 +129,13 @@ const ee = {
|
|
|
127
129
|
{
|
|
128
130
|
href: h,
|
|
129
131
|
target: u,
|
|
130
|
-
rel:
|
|
132
|
+
rel: I(T, u),
|
|
131
133
|
onClick: l,
|
|
132
|
-
className: `${
|
|
134
|
+
className: `${C} no-underline text-inherit`,
|
|
133
135
|
style: g,
|
|
134
136
|
role: i,
|
|
135
|
-
|
|
137
|
+
tabIndex: y,
|
|
138
|
+
"aria-checked": m,
|
|
136
139
|
"aria-current": E,
|
|
137
140
|
"aria-label": x,
|
|
138
141
|
"aria-labelledby": v,
|
|
@@ -144,37 +147,38 @@ const ee = {
|
|
|
144
147
|
type: "button",
|
|
145
148
|
onClick: l,
|
|
146
149
|
disabled: e,
|
|
147
|
-
className:
|
|
150
|
+
className: C,
|
|
148
151
|
style: g,
|
|
149
152
|
role: i,
|
|
150
|
-
|
|
153
|
+
tabIndex: y,
|
|
154
|
+
"aria-checked": m,
|
|
151
155
|
"aria-current": E,
|
|
152
156
|
"aria-label": x,
|
|
153
157
|
"aria-labelledby": v,
|
|
154
158
|
children: a
|
|
155
159
|
}
|
|
156
|
-
) : /* @__PURE__ */ o("div", { className:
|
|
157
|
-
},
|
|
160
|
+
) : /* @__PURE__ */ o("div", { className: C, style: g, ...L, children: a });
|
|
161
|
+
}, ce = ({ children: t, className: a = "", style: r }) => /* @__PURE__ */ o("div", { className: a, style: r, onClick: (e) => e.stopPropagation(), children: t }), Ee = 39, se = Object.assign(
|
|
158
162
|
({
|
|
159
163
|
header: t,
|
|
160
164
|
children: a,
|
|
161
165
|
expanded: r,
|
|
162
166
|
onToggle: e,
|
|
163
167
|
sticky: n = !1,
|
|
164
|
-
stickyTopOffset:
|
|
165
|
-
divider:
|
|
166
|
-
tone:
|
|
168
|
+
stickyTopOffset: s = 0,
|
|
169
|
+
divider: d = !1,
|
|
170
|
+
tone: p = "default",
|
|
167
171
|
"aria-label": f,
|
|
168
|
-
className:
|
|
172
|
+
className: N = "",
|
|
169
173
|
style: c
|
|
170
174
|
}) => {
|
|
171
|
-
const l =
|
|
172
|
-
return /* @__PURE__ */
|
|
173
|
-
/* @__PURE__ */
|
|
175
|
+
const l = q.useId(), b = e ? () => e(!r) : void 0;
|
|
176
|
+
return /* @__PURE__ */ O(F, { divider: d, tone: p, className: N, style: c, children: [
|
|
177
|
+
/* @__PURE__ */ O(
|
|
174
178
|
"div",
|
|
175
179
|
{
|
|
176
180
|
className: `group flex items-center w-full ${b ? "cursor-pointer" : ""} ${n && r ? "sticky z-[1] bg-[var(--malachite-card-background)]" : ""}`,
|
|
177
|
-
style: n && r ? { top:
|
|
181
|
+
style: n && r ? { top: s } : void 0,
|
|
178
182
|
onClick: b,
|
|
179
183
|
role: "presentation",
|
|
180
184
|
children: [
|
|
@@ -182,14 +186,14 @@ const ee = {
|
|
|
182
186
|
"button",
|
|
183
187
|
{
|
|
184
188
|
type: "button",
|
|
185
|
-
className: `appearance-none bg-transparent border-0 p-0 flex items-center cursor-pointer ${
|
|
189
|
+
className: `appearance-none bg-transparent border-0 p-0 flex items-center cursor-pointer ${j}`,
|
|
186
190
|
"aria-expanded": r,
|
|
187
191
|
"aria-controls": l,
|
|
188
192
|
"aria-label": f,
|
|
189
193
|
onClick: (u) => {
|
|
190
194
|
u.stopPropagation(), b();
|
|
191
195
|
},
|
|
192
|
-
children: /* @__PURE__ */ o(
|
|
196
|
+
children: /* @__PURE__ */ o(J, { expanded: r })
|
|
193
197
|
}
|
|
194
198
|
) }),
|
|
195
199
|
t
|
|
@@ -199,34 +203,34 @@ const ee = {
|
|
|
199
203
|
r && /* @__PURE__ */ o("div", { id: l, children: a })
|
|
200
204
|
] });
|
|
201
205
|
},
|
|
202
|
-
{ Controls:
|
|
203
|
-
),
|
|
206
|
+
{ Controls: ce }
|
|
207
|
+
), P = ({
|
|
204
208
|
children: t,
|
|
205
209
|
padding: a = !1,
|
|
206
210
|
overflow: r = "hidden",
|
|
207
211
|
role: e,
|
|
208
212
|
"aria-label": n,
|
|
209
|
-
"aria-labelledby":
|
|
210
|
-
className:
|
|
211
|
-
style:
|
|
213
|
+
"aria-labelledby": s,
|
|
214
|
+
className: d = "",
|
|
215
|
+
style: p
|
|
212
216
|
}) => /* @__PURE__ */ o(
|
|
213
217
|
"div",
|
|
214
218
|
{
|
|
215
|
-
className: `w-full rounded-[var(--malachite-radius-xxl,14px)] ${r === "clip" ? "overflow-clip" : r === "visible" ? "overflow-visible" : "overflow-hidden"} bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)] ${a ? "py-3 px-4" : ""} ${
|
|
216
|
-
style: { boxShadow:
|
|
219
|
+
className: `w-full rounded-[var(--malachite-radius-xxl,14px)] ${r === "clip" ? "overflow-clip" : r === "visible" ? "overflow-visible" : "overflow-hidden"} bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)] ${a ? "py-3 px-4" : ""} ${d}`,
|
|
220
|
+
style: { boxShadow: ne, ...Z, ...p },
|
|
217
221
|
role: e,
|
|
218
222
|
"aria-label": n,
|
|
219
|
-
"aria-labelledby":
|
|
223
|
+
"aria-labelledby": s,
|
|
220
224
|
children: t
|
|
221
225
|
}
|
|
222
226
|
);
|
|
223
|
-
|
|
224
|
-
|
|
227
|
+
P.Row = F;
|
|
228
|
+
P.ExpandableRow = se;
|
|
225
229
|
export {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
230
|
+
Ee as EXPANDABLE_ROW_LEAD_PX,
|
|
231
|
+
P as Surface,
|
|
232
|
+
se as SurfaceExpandableRow,
|
|
233
|
+
F as SurfaceRow,
|
|
234
|
+
P as default
|
|
231
235
|
};
|
|
232
236
|
//# sourceMappingURL=Surface.js.map
|