@stackone/malachite 2.111.1 → 2.113.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 +5 -1
- package/dist/assets/icons/arrow_line_left.svg.js +6 -0
- package/dist/assets/icons/arrow_line_left.svg.js.map +1 -0
- package/dist/assets/icons/arrow_line_right.svg.js +6 -0
- package/dist/assets/icons/arrow_line_right.svg.js.map +1 -0
- package/dist/assets/icons/book.svg.js +6 -0
- package/dist/assets/icons/book.svg.js.map +1 -0
- package/dist/assets/icons/book_open.svg.js +6 -0
- package/dist/assets/icons/book_open.svg.js.map +1 -0
- package/dist/components/Accordion.js +66 -64
- package/dist/components/Accordion.js.map +1 -1
- package/dist/components/ActionMenu.js +97 -96
- package/dist/components/ActionMenu.js.map +1 -1
- package/dist/components/BannerButton.js +44 -0
- package/dist/components/BannerButton.js.map +1 -0
- package/dist/components/Button.js.map +1 -1
- package/dist/components/CopyButton.js +37 -0
- package/dist/components/CopyButton.js.map +1 -0
- package/dist/components/CustomIcons/ArrowLineLeftIcon.js +21 -0
- package/dist/components/CustomIcons/ArrowLineLeftIcon.js.map +1 -0
- package/dist/components/CustomIcons/ArrowLineRightIcon.js +21 -0
- package/dist/components/CustomIcons/ArrowLineRightIcon.js.map +1 -0
- package/dist/components/CustomIcons/BookIcon.js +16 -0
- package/dist/components/CustomIcons/BookIcon.js.map +1 -0
- package/dist/components/CustomIcons/BookOpenIcon.js +21 -0
- package/dist/components/CustomIcons/BookOpenIcon.js.map +1 -0
- package/dist/components/CustomIcons/index.js +363 -351
- package/dist/components/CustomIcons/index.js.map +1 -1
- package/dist/components/DividerToggle.js +68 -0
- package/dist/components/DividerToggle.js.map +1 -0
- package/dist/components/FormSteps.js +110 -0
- package/dist/components/FormSteps.js.map +1 -0
- package/dist/components/Input/Input.js +202 -178
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/KeyValueList.js +36 -35
- package/dist/components/KeyValueList.js.map +1 -1
- package/dist/components/actionMenuStyles.js +70 -51
- package/dist/components/actionMenuStyles.js.map +1 -1
- package/dist/components/buttonStyles.js +2 -0
- package/dist/components/buttonStyles.js.map +1 -1
- package/dist/components/chromeStyles.js +2 -3
- package/dist/components/chromeStyles.js.map +1 -1
- package/dist/index.d.ts +273 -117
- package/dist/index.js +451 -435
- package/dist/index.js.map +1 -1
- package/dist/tailwind.css.js +1 -1
- package/dist/theme.js +12 -9
- package/dist/theme.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import
|
|
4
|
-
import { textOf as
|
|
5
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as d, useContext as p } from "react";
|
|
3
|
+
import u from "./Typography/EllipsisText.js";
|
|
4
|
+
import { textOf as b } from "./childrenText.js";
|
|
5
|
+
const f = {
|
|
6
6
|
small: {
|
|
7
7
|
row: "min-h-[36px]",
|
|
8
8
|
label: "w-[140px] px-[12px] py-[8px]",
|
|
@@ -13,58 +13,59 @@ const n = {
|
|
|
13
13
|
label: "w-[200px] p-[16px]",
|
|
14
14
|
value: "py-[16px] pr-[16px]"
|
|
15
15
|
}
|
|
16
|
-
},
|
|
17
|
-
label:
|
|
18
|
-
className:
|
|
19
|
-
children:
|
|
20
|
-
truncate:
|
|
21
|
-
tooltip:
|
|
16
|
+
}, s = d("medium"), m = d(!1), v = { row: "", label: "w-[140px] py-[7px]", value: "py-[7px]" }, h = ({
|
|
17
|
+
label: a,
|
|
18
|
+
className: l = "",
|
|
19
|
+
children: r,
|
|
20
|
+
truncate: t = !1,
|
|
21
|
+
tooltip: x
|
|
22
22
|
}) => {
|
|
23
|
-
const
|
|
24
|
-
return /* @__PURE__ */
|
|
23
|
+
const i = p(m), n = p(s), o = i ? v : f[n];
|
|
24
|
+
return /* @__PURE__ */ c(
|
|
25
25
|
"div",
|
|
26
26
|
{
|
|
27
|
-
className: `flex ${
|
|
27
|
+
className: `flex ${o.row} w-full items-start ${i ? "" : "border-0 border-b border-solid border-[var(--malachite-card-border)] last:border-b-0"} ${l}`,
|
|
28
28
|
children: [
|
|
29
|
-
/* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */ e(
|
|
30
30
|
"dt",
|
|
31
31
|
{
|
|
32
|
-
className: `m-0 shrink-0 ${
|
|
33
|
-
children:
|
|
32
|
+
className: `m-0 shrink-0 ${o.label} text-[13px] leading-[1.6] tracking-[0.13px] text-[var(--malachite-text-secondary)]`,
|
|
33
|
+
children: a
|
|
34
34
|
}
|
|
35
35
|
),
|
|
36
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ e(
|
|
37
37
|
"dd",
|
|
38
38
|
{
|
|
39
|
-
className: `m-0 flex min-w-0 flex-1 flex-wrap items-center gap-[6px] ${
|
|
40
|
-
children:
|
|
41
|
-
|
|
39
|
+
className: `m-0 flex min-w-0 flex-1 flex-wrap items-center gap-[6px] ${o.value} text-[13px] leading-[1.6] tracking-[0.13px] text-[var(--malachite-text-primary)]`,
|
|
40
|
+
children: t ? /* @__PURE__ */ e(
|
|
41
|
+
u,
|
|
42
42
|
{
|
|
43
43
|
maxWidth: "100%",
|
|
44
|
-
tooltip:
|
|
44
|
+
tooltip: x !== void 0 ? x : b(r),
|
|
45
45
|
tooltipWhenTruncated: !0,
|
|
46
|
-
children:
|
|
46
|
+
children: r
|
|
47
47
|
}
|
|
48
|
-
) :
|
|
48
|
+
) : r
|
|
49
49
|
}
|
|
50
50
|
)
|
|
51
51
|
]
|
|
52
52
|
}
|
|
53
53
|
);
|
|
54
|
-
},
|
|
55
|
-
className:
|
|
56
|
-
children:
|
|
57
|
-
size:
|
|
58
|
-
|
|
54
|
+
}, w = ({
|
|
55
|
+
className: a = "",
|
|
56
|
+
children: l,
|
|
57
|
+
size: r = "medium",
|
|
58
|
+
plain: t = !1
|
|
59
|
+
}) => /* @__PURE__ */ e(s.Provider, { value: r, children: /* @__PURE__ */ e(m.Provider, { value: t, children: /* @__PURE__ */ e(
|
|
59
60
|
"dl",
|
|
60
61
|
{
|
|
61
|
-
className: `m-0 flex w-full flex-col overflow-hidden rounded-lg border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-background)] ${
|
|
62
|
-
children:
|
|
62
|
+
className: `m-0 flex w-full flex-col ${t ? "px-[14px] py-[4px]" : "overflow-hidden rounded-lg border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-background)]"} ${a}`,
|
|
63
|
+
children: l
|
|
63
64
|
}
|
|
64
|
-
) });
|
|
65
|
-
|
|
65
|
+
) }) });
|
|
66
|
+
w.Row = h;
|
|
66
67
|
export {
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
w as KeyValueList,
|
|
69
|
+
w as default
|
|
69
70
|
};
|
|
70
71
|
//# sourceMappingURL=KeyValueList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueList.js","sources":["../../src/components/KeyValueList.tsx"],"sourcesContent":["import React, { createContext, useContext } from 'react';\nimport EllipsisText from './Typography/EllipsisText';\nimport { textOf } from './childrenText';\n\nexport type KeyValueListSize = 'small' | 'medium';\n\nexport interface KeyValueListProps {\n className?: string;\n children: React.ReactNode;\n /** `small` tightens the rows for a list inside a dialog or panel. */\n size?: KeyValueListSize;\n}\n\nexport interface KeyValueListRowProps {\n label: React.ReactNode;\n className?: string;\n children: React.ReactNode;\n /**\n * Keep the value to one line, cut with an ellipsis at the cell's width. For inline content:\n * block/flex children (Tag, AppLogo) are clipped without an ellipsis, so use their own truncate.\n */\n truncate?: boolean;\n /**\n * Shown on hover/focus when a `truncate` value is actually cut off. Defaults to the value\n * itself when it is text (strings/numbers); give one for any other value, or none is shown.\n * Pass `null` to turn the tooltip off.\n */\n tooltip?: React.ReactNode;\n}\n\nconst SIZE_ROW: Record<KeyValueListSize, { row: string; label: string; value: string }> = {\n small: {\n row: 'min-h-[36px]',\n label: 'w-[140px] px-[12px] py-[8px]',\n value: 'py-[8px] pr-[12px]',\n },\n medium: {\n row: 'min-h-[52px]',\n label: 'w-[200px] p-[16px]',\n value: 'py-[16px] pr-[16px]',\n },\n};\n\nconst SizeContext = createContext<KeyValueListSize>('medium');\n\nconst Row: React.FC<KeyValueListRowProps> = ({\n label,\n className = '',\n children,\n truncate = false,\n tooltip,\n}) => {\n const
|
|
1
|
+
{"version":3,"file":"KeyValueList.js","sources":["../../src/components/KeyValueList.tsx"],"sourcesContent":["import React, { createContext, useContext } from 'react';\nimport EllipsisText from './Typography/EllipsisText';\nimport { textOf } from './childrenText';\n\nexport type KeyValueListSize = 'small' | 'medium';\n\nexport interface KeyValueListProps {\n className?: string;\n children: React.ReactNode;\n /** `small` tightens the rows for a list inside a dialog or panel. */\n size?: KeyValueListSize;\n /**\n * Rows with no frame and no rules between them, for a list that sits inside a card which\n * frames it already, rather than a box inside a box.\n */\n plain?: boolean;\n}\n\nexport interface KeyValueListRowProps {\n label: React.ReactNode;\n className?: string;\n children: React.ReactNode;\n /**\n * Keep the value to one line, cut with an ellipsis at the cell's width. For inline content:\n * block/flex children (Tag, AppLogo) are clipped without an ellipsis, so use their own truncate.\n */\n truncate?: boolean;\n /**\n * Shown on hover/focus when a `truncate` value is actually cut off. Defaults to the value\n * itself when it is text (strings/numbers); give one for any other value, or none is shown.\n * Pass `null` to turn the tooltip off.\n */\n tooltip?: React.ReactNode;\n}\n\nconst SIZE_ROW: Record<KeyValueListSize, { row: string; label: string; value: string }> = {\n small: {\n row: 'min-h-[36px]',\n label: 'w-[140px] px-[12px] py-[8px]',\n value: 'py-[8px] pr-[12px]',\n },\n medium: {\n row: 'min-h-[52px]',\n label: 'w-[200px] p-[16px]',\n value: 'py-[16px] pr-[16px]',\n },\n};\n\nconst SizeContext = createContext<KeyValueListSize>('medium');\nconst PlainContext = createContext(false);\n\nconst PLAIN_ROW = { row: '', label: 'w-[140px] py-[7px]', value: 'py-[7px]' };\n\nconst Row: React.FC<KeyValueListRowProps> = ({\n label,\n className = '',\n children,\n truncate = false,\n tooltip,\n}) => {\n const plain = useContext(PlainContext);\n const sizeName = useContext(SizeContext);\n const size = plain ? PLAIN_ROW : SIZE_ROW[sizeName];\n return (\n <div\n className={`flex ${size.row} w-full items-start ${plain ? '' : 'border-0 border-b border-solid border-[var(--malachite-card-border)] last:border-b-0'} ${className}`}\n >\n <dt\n className={`m-0 shrink-0 ${size.label} text-[13px] leading-[1.6] tracking-[0.13px] text-[var(--malachite-text-secondary)]`}\n >\n {label}\n </dt>\n <dd\n className={`m-0 flex min-w-0 flex-1 flex-wrap items-center gap-[6px] ${size.value} text-[13px] leading-[1.6] tracking-[0.13px] text-[var(--malachite-text-primary)]`}\n >\n {truncate ? (\n <EllipsisText\n maxWidth=\"100%\"\n tooltip={tooltip !== undefined ? tooltip : textOf(children)}\n tooltipWhenTruncated\n >\n {children}\n </EllipsisText>\n ) : (\n children\n )}\n </dd>\n </div>\n );\n};\n\nconst KeyValueList: React.FC<KeyValueListProps> & { Row: typeof Row } = ({\n className = '',\n children,\n size = 'medium',\n plain = false,\n}) => (\n <SizeContext.Provider value={size}>\n <PlainContext.Provider value={plain}>\n <dl\n className={`m-0 flex w-full flex-col ${plain ? 'px-[14px] py-[4px]' : 'overflow-hidden rounded-lg border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-background)]'} ${className}`}\n >\n {children}\n </dl>\n </PlainContext.Provider>\n </SizeContext.Provider>\n);\n\nKeyValueList.Row = Row;\n\nexport default KeyValueList;\nexport { KeyValueList };\n"],"names":["SIZE_ROW","SizeContext","createContext","PlainContext","PLAIN_ROW","Row","label","className","children","truncate","tooltip","plain","useContext","sizeName","size","jsxs","jsx","EllipsisText","textOf","KeyValueList"],"mappings":";;;;AAmCA,MAAMA,IAAoF;AAAA,EACtF,OAAO;AAAA,IACH,KAAK;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAEX,QAAQ;AAAA,IACJ,KAA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AAa,UAAb,EAAsB,OAAOQ,GAC1B,UAAA,gBAAAK;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,WAAW,4BAA4BL,IAAQ,uBAAuB,4HAA4H,IAAIJ,CAAS;AAAA,IAE9M,UAAAC;AAAA,EAAA;AACL,EAAA,CACJ,EAAA,CACJ;AAGJW,EAAa,MAAMd;"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { MENU_SPECS as o } from "./floatingMenuGeometry.js";
|
|
2
|
-
import { injectStyleSheet as
|
|
3
|
-
import { SELECTED_OPTION_BACKGROUND as
|
|
4
|
-
import { ensureOverlayStyles as
|
|
5
|
-
import { SELECTED_ROW_FOREGROUND as E, SELECTED_ROW_BACKGROUND as
|
|
6
|
-
const
|
|
2
|
+
import { injectStyleSheet as S } from "./injectStyleSheet.js";
|
|
3
|
+
import { SELECTED_OPTION_BACKGROUND as b } from "./optionRowStyles.js";
|
|
4
|
+
import { ensureOverlayStyles as p } from "./portalOverlay.js";
|
|
5
|
+
import { SELECTED_ROW_FOREGROUND as E, SELECTED_ROW_BACKGROUND as g } from "./selectedRow.js";
|
|
6
|
+
const B = {
|
|
7
7
|
small: { icon: 16, iconBox: "text-[16px] [&_svg]:size-[16px]!" },
|
|
8
8
|
xsmall: { icon: 11, iconBox: "text-[11px] [&_svg]:size-[11px]!" }
|
|
9
|
-
},
|
|
9
|
+
}, u = {
|
|
10
10
|
minWidth: 0,
|
|
11
11
|
overflow: "hidden",
|
|
12
12
|
textOverflow: "ellipsis"
|
|
13
|
-
},
|
|
13
|
+
}, X = {
|
|
14
14
|
position: "absolute",
|
|
15
15
|
width: 1,
|
|
16
16
|
height: 1,
|
|
@@ -18,62 +18,63 @@ const P = {
|
|
|
18
18
|
overflow: "hidden",
|
|
19
19
|
clipPath: "inset(50%)",
|
|
20
20
|
whiteSpace: "nowrap"
|
|
21
|
-
},
|
|
21
|
+
}, O = {
|
|
22
|
+
flexShrink: 0,
|
|
22
23
|
padding: "6px 10px",
|
|
23
24
|
fontSize: "var(--malachite-font-size-small, 13px)",
|
|
24
25
|
color: "var(--malachite-text-dimmed, rgb(161, 161, 161))",
|
|
25
26
|
userSelect: "none"
|
|
26
|
-
},
|
|
27
|
-
...
|
|
27
|
+
}, m = {
|
|
28
|
+
...O,
|
|
28
29
|
color: "var(--malachite-text-secondary, rgb(123, 123, 123))",
|
|
29
30
|
overflow: "hidden",
|
|
30
31
|
textOverflow: "ellipsis",
|
|
31
32
|
whiteSpace: "nowrap"
|
|
32
33
|
}, V = {
|
|
33
|
-
...
|
|
34
|
+
...m,
|
|
34
35
|
fontSize: "calc(var(--malachite-font-size-small, 13px) - 1px)"
|
|
35
|
-
}, W = { color: "inherit", fontSize: "inherit" },
|
|
36
|
-
...
|
|
36
|
+
}, W = { color: "inherit", fontSize: "inherit" }, K = {
|
|
37
|
+
...u,
|
|
37
38
|
display: "flex",
|
|
38
39
|
flexDirection: "column",
|
|
39
40
|
gap: 2
|
|
40
41
|
}, c = {
|
|
41
|
-
...
|
|
42
|
+
...u,
|
|
42
43
|
whiteSpace: "normal",
|
|
43
44
|
fontSize: "var(--malachite-font-size-xsmall, 11px)"
|
|
44
|
-
},
|
|
45
|
+
}, I = {
|
|
45
46
|
...c,
|
|
46
47
|
color: "var(--malachite-text-secondary, rgb(123, 123, 123))"
|
|
47
|
-
},
|
|
48
|
+
}, L = { ...c, color: "inherit" }, l = "malachite-actionmenu-item-description", F = (e) => e.danger === "hover" ? c : e.danger || e.current ? L : I, T = {
|
|
48
49
|
display: "inline-flex",
|
|
49
50
|
flexShrink: 0,
|
|
50
51
|
width: 14,
|
|
51
52
|
marginLeft: "auto"
|
|
52
|
-
},
|
|
53
|
-
...
|
|
54
|
-
color:
|
|
53
|
+
}, _ = "var(--malachite-accent-foreground, rgb(2, 122, 66))", N = {
|
|
54
|
+
...T,
|
|
55
|
+
color: _
|
|
55
56
|
}, y = {
|
|
56
57
|
warning: "var(--malachite-warning-foreground, rgb(150, 88, 10))",
|
|
57
|
-
accent:
|
|
58
|
-
},
|
|
58
|
+
accent: _
|
|
59
|
+
}, x = (e) => !!e.danger || !!e.disabled || !!e.current, f = (e) => x(e) ? void 0 : e.intent, R = (e, t) => t && e.checked === !0 && !!e.group && !x(e) && !e.intent, j = (e, t) => R(e, t) ? N : T, v = { display: "inline-flex", flexShrink: 0 }, w = {
|
|
59
60
|
...v,
|
|
60
61
|
color: "var(--malachite-text-dimmed, rgb(161, 161, 161))"
|
|
61
|
-
},
|
|
62
|
+
}, Z = (e) => e.danger === "hover" || f(e) ? v : w, d = "malachite-actionmenu-item-icon", r = "malachite-actionmenu-item", C = "data-malachite-actionmenu-tag", q = { display: "inline-flex", flexShrink: 0 }, J = { [C]: "" }, s = "data-chosen", $ = [
|
|
62
63
|
`.${r} { background: transparent; }`,
|
|
63
64
|
`.${r}:not(:disabled):hover { background: var(--malachite-card-dimmed-background, rgb(247, 247, 247)); }`,
|
|
64
65
|
// As a Dropdown's selected option, keeping its ground on hover.
|
|
65
|
-
`.${r}[${s}], .${r}[${s}]:not(:disabled):hover { background: ${
|
|
66
|
+
`.${r}[${s}], .${r}[${s}]:not(:disabled):hover { background: ${b}; }`,
|
|
66
67
|
`.${r}:focus-visible { outline: 2px solid var(--malachite-text-primary, rgb(10, 10, 10)); outline-offset: -2px; }`
|
|
67
|
-
], a = `.${r}[data-danger="hover"]`, n = `${a}:not(:disabled):is(:hover, :focus-visible)`,
|
|
68
|
+
], a = `.${r}[data-danger="hover"]`, n = `${a}:not(:disabled):is(:hover, :focus-visible)`, A = [
|
|
68
69
|
`${a} { color: var(--malachite-text-primary, rgb(10, 10, 10)); }`,
|
|
69
70
|
`${a}[data-tone="muted"] { color: var(--malachite-text-secondary, rgb(123, 123, 123)); }`,
|
|
70
71
|
`${a} > .${d} { color: var(--malachite-text-dimmed, rgb(161, 161, 161)); }`,
|
|
71
|
-
`${a}[aria-current] { color: ${E}; background: ${
|
|
72
|
+
`${a}[aria-current] { color: ${E}; background: ${g}; }`,
|
|
72
73
|
`${n} { color: var(--malachite-text-destructive, rgb(237, 53, 54)); background: var(--malachite-error-background-glass, rgba(197, 63, 63, 0.08)); }`,
|
|
73
74
|
`${n} > .${d} { color: inherit; }`,
|
|
74
75
|
`${a}:not([aria-current]) .${l} { color: var(--malachite-text-secondary, rgb(123, 123, 123)); }`,
|
|
75
76
|
`${n} .${l} { color: inherit; }`
|
|
76
|
-
],
|
|
77
|
+
], D = () => S("malachite-actionmenu-danger-hover-styles", A), Q = () => (p(), D(), S("malachite-actionmenu-item-styles-v2", $)), k = {
|
|
77
78
|
default: "var(--malachite-text-primary, rgb(10, 10, 10))",
|
|
78
79
|
muted: "var(--malachite-text-secondary, rgb(123, 123, 123))"
|
|
79
80
|
}, Y = (e, t) => {
|
|
@@ -83,14 +84,16 @@ const P = {
|
|
|
83
84
|
return;
|
|
84
85
|
if (e.current)
|
|
85
86
|
return E;
|
|
86
|
-
const i =
|
|
87
|
-
return i ? y[i] :
|
|
88
|
-
},
|
|
87
|
+
const i = f(e);
|
|
88
|
+
return i ? y[i] : k[t];
|
|
89
|
+
}, ee = (e, t = "default") => e.type === "text" ? m : e.type === "divider" ? {
|
|
89
90
|
height: 1,
|
|
91
|
+
flexShrink: 0,
|
|
90
92
|
background: "var(--malachite-card-border, rgb(232, 232, 232))",
|
|
91
93
|
margin: "4px 0"
|
|
92
94
|
} : {
|
|
93
95
|
display: "flex",
|
|
96
|
+
flexShrink: 0,
|
|
94
97
|
alignItems: "center",
|
|
95
98
|
gap: 8,
|
|
96
99
|
padding: "6px 10px",
|
|
@@ -98,7 +101,7 @@ const P = {
|
|
|
98
101
|
fontSize: "var(--malachite-font-size-small, 13px)",
|
|
99
102
|
fontWeight: 400,
|
|
100
103
|
color: Y(e, t),
|
|
101
|
-
background: e.current && e.danger !== "hover" ?
|
|
104
|
+
background: e.current && e.danger !== "hover" ? g : void 0,
|
|
102
105
|
cursor: e.disabled ? "not-allowed" : "pointer",
|
|
103
106
|
opacity: e.disabled ? 0.5 : 1,
|
|
104
107
|
userSelect: "none",
|
|
@@ -108,12 +111,27 @@ const P = {
|
|
|
108
111
|
textAlign: "left",
|
|
109
112
|
textDecoration: "none",
|
|
110
113
|
boxSizing: "border-box",
|
|
111
|
-
width: "100%"
|
|
112
|
-
|
|
114
|
+
width: "100%",
|
|
115
|
+
// The rule beside an indented row sits in its margin, so the row lets it show; the label keeps its own ellipsis.
|
|
116
|
+
...e.indent ? {
|
|
117
|
+
position: "relative",
|
|
118
|
+
overflow: "visible",
|
|
119
|
+
marginLeft: h,
|
|
120
|
+
width: `calc(100% - ${h}px)`
|
|
121
|
+
} : {}
|
|
122
|
+
}, h = 18, te = {
|
|
123
|
+
position: "absolute",
|
|
124
|
+
left: -10,
|
|
125
|
+
top: -1,
|
|
126
|
+
bottom: -1,
|
|
127
|
+
width: 1,
|
|
128
|
+
background: "var(--malachite-card-border, rgb(232, 232, 232))"
|
|
129
|
+
}, M = {
|
|
113
130
|
display: "flex",
|
|
114
131
|
flexDirection: "column",
|
|
132
|
+
flexShrink: 0,
|
|
115
133
|
gap: 2
|
|
116
|
-
},
|
|
134
|
+
}, re = (e) => ({
|
|
117
135
|
position: "fixed",
|
|
118
136
|
top: (e == null ? void 0 : e.top) ?? 0,
|
|
119
137
|
left: (e == null ? void 0 : e.left) ?? 0,
|
|
@@ -125,34 +143,35 @@ const P = {
|
|
|
125
143
|
borderRadius: o.options.radius,
|
|
126
144
|
boxShadow: o.options.shadow,
|
|
127
145
|
padding: o.options.padding,
|
|
128
|
-
...
|
|
146
|
+
...M,
|
|
129
147
|
visibility: e ? "visible" : "hidden",
|
|
130
148
|
opacity: e ? 1 : 0
|
|
131
149
|
});
|
|
132
150
|
export {
|
|
133
151
|
s as CHOSEN_ATTR,
|
|
134
152
|
l as DESCRIPTION_CLASS,
|
|
135
|
-
|
|
153
|
+
O as EMPTY_ITEM_STYLE,
|
|
136
154
|
V as HEADING_ITEM_STYLE,
|
|
155
|
+
te as INDENT_RULE_STYLE,
|
|
137
156
|
r as ITEM_CLASS,
|
|
138
157
|
d as ITEM_ICON_CLASS,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
158
|
+
K as ITEM_TEXT_STYLE,
|
|
159
|
+
u as LABEL_STYLE,
|
|
160
|
+
M as MENU_COLUMN_STYLE,
|
|
142
161
|
C as TAG_HOST_ATTR,
|
|
143
|
-
|
|
144
|
-
|
|
162
|
+
J as TAG_HOST_PROPS,
|
|
163
|
+
q as TAG_HOST_STYLE,
|
|
145
164
|
W as TEXT_ITEM_LABEL_STYLE,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
165
|
+
m as TEXT_ITEM_STYLE,
|
|
166
|
+
B as TRIGGER_SIZES,
|
|
167
|
+
X as VISUALLY_HIDDEN_STYLE,
|
|
168
|
+
j as checkSlotStyle,
|
|
169
|
+
F as descriptionStyle,
|
|
170
|
+
Q as ensureActionMenuStyles,
|
|
171
|
+
D as ensureDangerOnHoverStyles,
|
|
172
|
+
R as isChosen,
|
|
173
|
+
Z as itemIconStyle,
|
|
174
|
+
ee as itemStyle,
|
|
175
|
+
re as menuStyle
|
|
157
176
|
};
|
|
158
177
|
//# sourceMappingURL=actionMenuStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actionMenuStyles.js","sources":["../../src/components/actionMenuStyles.ts"],"sourcesContent":["import type React from 'react';\nimport type { ActionMenuIntent, ActionMenuItem } from './actionMenuTypes';\nimport { MENU_SPECS, type MenuGeometry } from './floatingMenuGeometry';\nimport { injectStyleSheet } from './injectStyleSheet';\nimport { SELECTED_OPTION_BACKGROUND } from './optionRowStyles';\nimport { ensureOverlayStyles } from './portalOverlay';\nimport { SELECTED_ROW_BACKGROUND, SELECTED_ROW_FOREGROUND } from './selectedRow';\n\nexport const TRIGGER_SIZES: Record<'small' | 'xsmall', { icon: number; iconBox: string }> = {\n small: { icon: 16, iconBox: 'text-[16px] [&_svg]:size-[16px]!' },\n xsmall: { icon: 11, iconBox: 'text-[11px] [&_svg]:size-[11px]!' },\n};\n\nexport const LABEL_STYLE: React.CSSProperties = {\n minWidth: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n};\n\n// Not `sr-only`: the menu portals outside the shadow root's stylesheet.\nexport const VISUALLY_HIDDEN_STYLE: React.CSSProperties = {\n position: 'absolute',\n width: 1,\n height: 1,\n margin: -1,\n overflow: 'hidden',\n clipPath: 'inset(50%)',\n whiteSpace: 'nowrap',\n};\n\nexport const EMPTY_ITEM_STYLE: React.CSSProperties = {\n padding: '6px 10px',\n fontSize: 'var(--malachite-font-size-small, 13px)',\n color: 'var(--malachite-text-dimmed, rgb(161, 161, 161))',\n userSelect: 'none',\n};\n\nexport const TEXT_ITEM_STYLE: React.CSSProperties = {\n ...EMPTY_ITEM_STYLE,\n color: 'var(--malachite-text-secondary, rgb(123, 123, 123))',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n};\n\n// A text row naming the choices under it sits a notch smaller, so it reads as their heading.\nexport const HEADING_ITEM_STYLE: React.CSSProperties = {\n ...TEXT_ITEM_STYLE,\n fontSize: 'calc(var(--malachite-font-size-small, 13px) - 1px)',\n};\n\nexport const TEXT_ITEM_LABEL_STYLE: React.CSSProperties = { color: 'inherit', fontSize: 'inherit' };\n\nexport const ITEM_TEXT_STYLE: React.CSSProperties = {\n ...LABEL_STYLE,\n display: 'flex',\n flexDirection: 'column',\n gap: 2,\n};\n\nconst DESCRIPTION_BASE: React.CSSProperties = {\n ...LABEL_STYLE,\n whiteSpace: 'normal',\n fontSize: 'var(--malachite-font-size-xsmall, 11px)',\n};\n\nconst DESCRIPTION_STYLE: React.CSSProperties = {\n ...DESCRIPTION_BASE,\n color: 'var(--malachite-text-secondary, rgb(123, 123, 123))',\n};\n\nconst ROW_DESCRIPTION_STYLE: React.CSSProperties = { ...DESCRIPTION_BASE, color: 'inherit' };\n\nexport const DESCRIPTION_CLASS = 'malachite-actionmenu-item-description';\n\nexport const descriptionStyle = (item: ActionItem): React.CSSProperties => {\n if (item.danger === 'hover') {\n return DESCRIPTION_BASE;\n }\n return item.danger || item.current ? ROW_DESCRIPTION_STYLE : DESCRIPTION_STYLE;\n};\n\nconst CHECK_SLOT_STYLE: React.CSSProperties = {\n display: 'inline-flex',\n flexShrink: 0,\n width: 14,\n marginLeft: 'auto',\n};\n\nconst ACCENT_FOREGROUND = 'var(--malachite-accent-foreground, rgb(2, 122, 66))';\n\nconst CHOSEN_SLOT_STYLE: React.CSSProperties = {\n ...CHECK_SLOT_STYLE,\n color: ACCENT_FOREGROUND,\n};\n\nconst INTENT_TEXT: Record<ActionMenuIntent, string> = {\n warning: 'var(--malachite-warning-foreground, rgb(150, 88, 10))',\n accent: ACCENT_FOREGROUND,\n};\n\n// A row with a paint of its own (danger, disabled, current) takes neither an intent nor the chosen tint.\nconst ownPaint = (item: ActionItem): boolean =>\n Boolean(item.danger) || Boolean(item.disabled) || Boolean(item.current);\n\nconst activeIntent = (item: ActionItem): ActionMenuIntent | undefined =>\n ownPaint(item) ? undefined : item.intent;\n\n// In a highlighted menu, the picked choice of a named set takes the green, unless the row has a\n// paint of its own or an intent.\nexport const isChosen = (item: ActionItem, highlight: boolean): boolean =>\n highlight && item.checked === true && Boolean(item.group) && !ownPaint(item) && !item.intent;\n\nexport const checkSlotStyle = (item: ActionItem, highlight: boolean): React.CSSProperties =>\n isChosen(item, highlight) ? CHOSEN_SLOT_STYLE : CHECK_SLOT_STYLE;\n\nconst ITEM_ICON_LAYOUT: React.CSSProperties = { display: 'inline-flex', flexShrink: 0 };\n\nconst ITEM_ICON_STYLE: React.CSSProperties = {\n ...ITEM_ICON_LAYOUT,\n color: 'var(--malachite-text-dimmed, rgb(161, 161, 161))',\n};\n\nexport const itemIconStyle = (item: ActionItem): React.CSSProperties =>\n item.danger === 'hover' || activeIntent(item) ? ITEM_ICON_LAYOUT : ITEM_ICON_STYLE;\n\nexport const ITEM_ICON_CLASS = 'malachite-actionmenu-item-icon';\n\nexport const ITEM_CLASS = 'malachite-actionmenu-item';\n\nexport const TAG_HOST_ATTR = 'data-malachite-actionmenu-tag' as const;\n\nexport const TAG_HOST_STYLE: React.CSSProperties = { display: 'inline-flex', flexShrink: 0 };\n\nexport const TAG_HOST_PROPS = { [TAG_HOST_ATTR]: '' };\n\nexport const CHOSEN_ATTR = 'data-chosen' as const;\n\nconst ITEM_RULES = [\n `.${ITEM_CLASS} { background: transparent; }`,\n `.${ITEM_CLASS}:not(:disabled):hover { background: var(--malachite-card-dimmed-background, rgb(247, 247, 247)); }`,\n // As a Dropdown's selected option, keeping its ground on hover.\n `.${ITEM_CLASS}[${CHOSEN_ATTR}], .${ITEM_CLASS}[${CHOSEN_ATTR}]:not(:disabled):hover { background: ${SELECTED_OPTION_BACKGROUND}; }`,\n `.${ITEM_CLASS}:focus-visible { outline: 2px solid var(--malachite-text-primary, rgb(10, 10, 10)); outline-offset: -2px; }`,\n];\n\nconst DANGER_ON_HOVER = `.${ITEM_CLASS}[data-danger=\"hover\"]`;\nconst DANGER_ON_HOVER_ACTIVE = `${DANGER_ON_HOVER}:not(:disabled):is(:hover, :focus-visible)`;\n\nconst DANGER_ON_HOVER_RULES = [\n `${DANGER_ON_HOVER} { color: var(--malachite-text-primary, rgb(10, 10, 10)); }`,\n `${DANGER_ON_HOVER}[data-tone=\"muted\"] { color: var(--malachite-text-secondary, rgb(123, 123, 123)); }`,\n `${DANGER_ON_HOVER} > .${ITEM_ICON_CLASS} { color: var(--malachite-text-dimmed, rgb(161, 161, 161)); }`,\n `${DANGER_ON_HOVER}[aria-current] { color: ${SELECTED_ROW_FOREGROUND}; background: ${SELECTED_ROW_BACKGROUND}; }`,\n `${DANGER_ON_HOVER_ACTIVE} { color: var(--malachite-text-destructive, rgb(237, 53, 54)); background: var(--malachite-error-background-glass, rgba(197, 63, 63, 0.08)); }`,\n `${DANGER_ON_HOVER_ACTIVE} > .${ITEM_ICON_CLASS} { color: inherit; }`,\n `${DANGER_ON_HOVER}:not([aria-current]) .${DESCRIPTION_CLASS} { color: var(--malachite-text-secondary, rgb(123, 123, 123)); }`,\n `${DANGER_ON_HOVER_ACTIVE} .${DESCRIPTION_CLASS} { color: inherit; }`,\n];\n\nexport const ensureDangerOnHoverStyles = (): CSSStyleSheet | null =>\n injectStyleSheet('malachite-actionmenu-danger-hover-styles', DANGER_ON_HOVER_RULES);\n\nexport const ensureActionMenuStyles = (): CSSStyleSheet | null => {\n ensureOverlayStyles();\n ensureDangerOnHoverStyles();\n // New id: a sheet an older malachite copy cached under the old one lacks the chosen rules.\n return injectStyleSheet('malachite-actionmenu-item-styles-v2', ITEM_RULES);\n};\n\nexport type ActionMenuTone = 'default' | 'muted';\n\nconst ITEM_TEXT: Record<ActionMenuTone, string> = {\n default: 'var(--malachite-text-primary, rgb(10, 10, 10))',\n muted: 'var(--malachite-text-secondary, rgb(123, 123, 123))',\n};\n\ntype ActionItem = Exclude<ActionMenuItem, { type: 'text' } | { type: 'divider' }>;\n\nconst actionItemColor = (item: ActionItem, tone: ActionMenuTone): string | undefined => {\n if (item.danger === true) {\n return 'var(--malachite-text-destructive, rgb(237, 53, 54))';\n }\n if (item.danger === 'hover') {\n return undefined;\n }\n if (item.current) {\n return SELECTED_ROW_FOREGROUND;\n }\n const intent = activeIntent(item);\n return intent ? INTENT_TEXT[intent] : ITEM_TEXT[tone];\n};\n\nexport const itemStyle = (\n item: ActionMenuItem,\n tone: ActionMenuTone = 'default',\n): React.CSSProperties => {\n if (item.type === 'text') {\n return TEXT_ITEM_STYLE;\n }\n if (item.type === 'divider') {\n return {\n height: 1,\n background: 'var(--malachite-card-border, rgb(232, 232, 232))',\n margin: '4px 0',\n };\n }\n return {\n display: 'flex',\n alignItems: 'center',\n gap: 8,\n padding: '6px 10px',\n borderRadius: 8,\n fontSize: 'var(--malachite-font-size-small, 13px)',\n fontWeight: 400,\n color: actionItemColor(item, tone),\n background: item.current && item.danger !== 'hover' ? SELECTED_ROW_BACKGROUND : undefined,\n cursor: item.disabled ? 'not-allowed' : 'pointer',\n opacity: item.disabled ? 0.5 : 1,\n userSelect: 'none',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n border: 'none',\n textAlign: 'left',\n textDecoration: 'none',\n boxSizing: 'border-box',\n width: '100%',\n };\n};\n\n// The menu's rows, and a set of choices among them, stack the same way.\nexport const MENU_COLUMN_STYLE: React.CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: 2,\n};\n\nexport const menuStyle = (position: MenuGeometry | null): React.CSSProperties => ({\n position: 'fixed',\n top: position?.top ?? 0,\n left: position?.left ?? 0,\n width: position?.width,\n maxHeight: position?.maxHeight,\n overflowY: 'auto',\n background: MENU_SPECS.options.background,\n border: MENU_SPECS.options.border,\n borderRadius: MENU_SPECS.options.radius,\n boxShadow: MENU_SPECS.options.shadow,\n padding: MENU_SPECS.options.padding,\n ...MENU_COLUMN_STYLE,\n visibility: position ? 'visible' : 'hidden',\n opacity: position ? 1 : 0,\n});\n"],"names":["TRIGGER_SIZES","LABEL_STYLE","VISUALLY_HIDDEN_STYLE","EMPTY_ITEM_STYLE","TEXT_ITEM_STYLE","HEADING_ITEM_STYLE","TEXT_ITEM_LABEL_STYLE","ITEM_TEXT_STYLE","DESCRIPTION_BASE","DESCRIPTION_STYLE","ROW_DESCRIPTION_STYLE","DESCRIPTION_CLASS","descriptionStyle","item","CHECK_SLOT_STYLE","ACCENT_FOREGROUND","CHOSEN_SLOT_STYLE","INTENT_TEXT","ownPaint","activeIntent","isChosen","highlight","checkSlotStyle","ITEM_ICON_LAYOUT","ITEM_ICON_STYLE","itemIconStyle","ITEM_ICON_CLASS","ITEM_CLASS","TAG_HOST_ATTR","TAG_HOST_STYLE","TAG_HOST_PROPS","CHOSEN_ATTR","ITEM_RULES","SELECTED_OPTION_BACKGROUND","DANGER_ON_HOVER","DANGER_ON_HOVER_ACTIVE","DANGER_ON_HOVER_RULES","SELECTED_ROW_FOREGROUND","SELECTED_ROW_BACKGROUND","ensureDangerOnHoverStyles","injectStyleSheet","ensureActionMenuStyles","ensureOverlayStyles","ITEM_TEXT","actionItemColor","tone","intent","itemStyle","MENU_COLUMN_STYLE","menuStyle","position","MENU_SPECS"],"mappings":";;;;;AAQO,MAAMA,IAA+E;AAAA,EACxF,OAAO,EAAE,MAAM,IAAI,SAAS,mCAAA;AAAA,EAC5B,QAAQ,EAAE,MAAM,IAAI,SAAS,mCAAA;AACjC,GAEaC,IAAmC;AAAA,EAC5C,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAClB,GAGaC,IAA6C;AAAA,EACtD,UAAU;AAAA,EACV,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,UAAU;AAAA,EACV,YAAY;AAChB,GAEaC,IAAwC;AAAA,EACjD,SAAS;AAAA,EACT,UAAU;AAAA,EACV,OAAO;AAAA,EACP,YAAY;AAChB,GAEaC,IAAuC;AAAA,EAChD,GAAGD;AAAA,EACH,OAAO;AAAA,EACP,UAAU;AAAA,EACV,cAAc;AAAA,EACd,YAAY;AAChB,GAGaE,IAA0C;AAAA,EACnD,GAAGD;AAAA,EACH,UAAU;AACd,GAEaE,IAA6C,EAAE,OAAO,WAAW,UAAU,UAAA,GAE3EC,IAAuC;AAAA,EAChD,GAAGN;AAAA,EACH,SAAS;AAAA,EACT,eAAe;AAAA,EACf,KAAK;AACT,GAEMO,IAAwC;AAAA,EAC1C,GAAGP;AAAA,EACH,YAAY;AAAA,EACZ,UAAU;AACd,GAEMQ,IAAyC;AAAA,EAC3C,GAAGD;AAAA,EACH,OAAO;AACX,GAEME,IAA6C,EAAE,GAAGF,GAAkB,OAAO,UAAA,GAEpEG,IAAoB,yCAEpBC,IAAmB,CAACC,MACzBA,EAAK,WAAW,UACTL,IAEJK,EAAK,UAAUA,EAAK,UAAUH,IAAwBD,GAG3DK,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AAAA,GAKFmC,IAAyC;AAAA,EAClD,SAAS;AAAA,EACT,eAAe;AAAA,EACf,KAAK;AACT,GAEaC,KAAY,CAACC,OAAwD;AAAA,EAC9E,UAAU;AAAA,EACV,MAAKA,KAAA,gBAAAA,EAAU,QAAO;AAAA,EACtB,OAAMA,KAAA,gBAAAA,EAAU,SAAQ;AAAA,EACxB,OAAOA,KAAA,gBAAAA,EAAU;AAAA,EACjB,WAAWA,KAAA,gBAAAA,EAAU;AAAA,EACrB,WAAW;AAAA,EACX,YAAYC,EAAW,QAAQ;AAAA,EAC/B,QAAQA,EAAW,QAAQ;AAAA,EAC3B,cAAcA,EAAW,QAAQ;AAAA,EACjC,WAAWA,EAAW,QAAQ;AAAA,EAC9B,SAASA,EAAW,QAAQ;AAAA,EAC5B,GAAGH;AAAA,EACH,YAAYE,IAAW,YAAY;AAAA,EACnC,SAASA,IAAW,IAAI;AAC5B;"}
|
|
1
|
+
{"version":3,"file":"actionMenuStyles.js","sources":["../../src/components/actionMenuStyles.ts"],"sourcesContent":["import type React from 'react';\nimport type { ActionMenuIntent, ActionMenuItem } from './actionMenuTypes';\nimport { MENU_SPECS, type MenuGeometry } from './floatingMenuGeometry';\nimport { injectStyleSheet } from './injectStyleSheet';\nimport { SELECTED_OPTION_BACKGROUND } from './optionRowStyles';\nimport { ensureOverlayStyles } from './portalOverlay';\nimport { SELECTED_ROW_BACKGROUND, SELECTED_ROW_FOREGROUND } from './selectedRow';\n\nexport const TRIGGER_SIZES: Record<'small' | 'xsmall', { icon: number; iconBox: string }> = {\n small: { icon: 16, iconBox: 'text-[16px] [&_svg]:size-[16px]!' },\n xsmall: { icon: 11, iconBox: 'text-[11px] [&_svg]:size-[11px]!' },\n};\n\nexport const LABEL_STYLE: React.CSSProperties = {\n minWidth: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n};\n\n// Not `sr-only`: the menu portals outside the shadow root's stylesheet.\nexport const VISUALLY_HIDDEN_STYLE: React.CSSProperties = {\n position: 'absolute',\n width: 1,\n height: 1,\n margin: -1,\n overflow: 'hidden',\n clipPath: 'inset(50%)',\n whiteSpace: 'nowrap',\n};\n\n// Every row keeps its height: the menu scrolls once it reaches its max height, rather than\n// squeezing its rows until they overlap.\nexport const EMPTY_ITEM_STYLE: React.CSSProperties = {\n flexShrink: 0,\n padding: '6px 10px',\n fontSize: 'var(--malachite-font-size-small, 13px)',\n color: 'var(--malachite-text-dimmed, rgb(161, 161, 161))',\n userSelect: 'none',\n};\n\nexport const TEXT_ITEM_STYLE: React.CSSProperties = {\n ...EMPTY_ITEM_STYLE,\n color: 'var(--malachite-text-secondary, rgb(123, 123, 123))',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n};\n\n// A text row naming the choices under it sits a notch smaller, so it reads as their heading.\nexport const HEADING_ITEM_STYLE: React.CSSProperties = {\n ...TEXT_ITEM_STYLE,\n fontSize: 'calc(var(--malachite-font-size-small, 13px) - 1px)',\n};\n\nexport const TEXT_ITEM_LABEL_STYLE: React.CSSProperties = { color: 'inherit', fontSize: 'inherit' };\n\nexport const ITEM_TEXT_STYLE: React.CSSProperties = {\n ...LABEL_STYLE,\n display: 'flex',\n flexDirection: 'column',\n gap: 2,\n};\n\nconst DESCRIPTION_BASE: React.CSSProperties = {\n ...LABEL_STYLE,\n whiteSpace: 'normal',\n fontSize: 'var(--malachite-font-size-xsmall, 11px)',\n};\n\nconst DESCRIPTION_STYLE: React.CSSProperties = {\n ...DESCRIPTION_BASE,\n color: 'var(--malachite-text-secondary, rgb(123, 123, 123))',\n};\n\nconst ROW_DESCRIPTION_STYLE: React.CSSProperties = { ...DESCRIPTION_BASE, color: 'inherit' };\n\nexport const DESCRIPTION_CLASS = 'malachite-actionmenu-item-description';\n\nexport const descriptionStyle = (item: ActionItem): React.CSSProperties => {\n if (item.danger === 'hover') {\n return DESCRIPTION_BASE;\n }\n return item.danger || item.current ? ROW_DESCRIPTION_STYLE : DESCRIPTION_STYLE;\n};\n\nconst CHECK_SLOT_STYLE: React.CSSProperties = {\n display: 'inline-flex',\n flexShrink: 0,\n width: 14,\n marginLeft: 'auto',\n};\n\nconst ACCENT_FOREGROUND = 'var(--malachite-accent-foreground, rgb(2, 122, 66))';\n\nconst CHOSEN_SLOT_STYLE: React.CSSProperties = {\n ...CHECK_SLOT_STYLE,\n color: ACCENT_FOREGROUND,\n};\n\nconst INTENT_TEXT: Record<ActionMenuIntent, string> = {\n warning: 'var(--malachite-warning-foreground, rgb(150, 88, 10))',\n accent: ACCENT_FOREGROUND,\n};\n\n// A row with a paint of its own (danger, disabled, current) takes neither an intent nor the chosen tint.\nconst ownPaint = (item: ActionItem): boolean =>\n Boolean(item.danger) || Boolean(item.disabled) || Boolean(item.current);\n\nconst activeIntent = (item: ActionItem): ActionMenuIntent | undefined =>\n ownPaint(item) ? undefined : item.intent;\n\n// In a highlighted menu, the picked choice of a named set takes the green, unless the row has a\n// paint of its own or an intent.\nexport const isChosen = (item: ActionItem, highlight: boolean): boolean =>\n highlight && item.checked === true && Boolean(item.group) && !ownPaint(item) && !item.intent;\n\nexport const checkSlotStyle = (item: ActionItem, highlight: boolean): React.CSSProperties =>\n isChosen(item, highlight) ? CHOSEN_SLOT_STYLE : CHECK_SLOT_STYLE;\n\nconst ITEM_ICON_LAYOUT: React.CSSProperties = { display: 'inline-flex', flexShrink: 0 };\n\nconst ITEM_ICON_STYLE: React.CSSProperties = {\n ...ITEM_ICON_LAYOUT,\n color: 'var(--malachite-text-dimmed, rgb(161, 161, 161))',\n};\n\nexport const itemIconStyle = (item: ActionItem): React.CSSProperties =>\n item.danger === 'hover' || activeIntent(item) ? ITEM_ICON_LAYOUT : ITEM_ICON_STYLE;\n\nexport const ITEM_ICON_CLASS = 'malachite-actionmenu-item-icon';\n\nexport const ITEM_CLASS = 'malachite-actionmenu-item';\n\nexport const TAG_HOST_ATTR = 'data-malachite-actionmenu-tag' as const;\n\nexport const TAG_HOST_STYLE: React.CSSProperties = { display: 'inline-flex', flexShrink: 0 };\n\nexport const TAG_HOST_PROPS = { [TAG_HOST_ATTR]: '' };\n\nexport const CHOSEN_ATTR = 'data-chosen' as const;\n\nconst ITEM_RULES = [\n `.${ITEM_CLASS} { background: transparent; }`,\n `.${ITEM_CLASS}:not(:disabled):hover { background: var(--malachite-card-dimmed-background, rgb(247, 247, 247)); }`,\n // As a Dropdown's selected option, keeping its ground on hover.\n `.${ITEM_CLASS}[${CHOSEN_ATTR}], .${ITEM_CLASS}[${CHOSEN_ATTR}]:not(:disabled):hover { background: ${SELECTED_OPTION_BACKGROUND}; }`,\n `.${ITEM_CLASS}:focus-visible { outline: 2px solid var(--malachite-text-primary, rgb(10, 10, 10)); outline-offset: -2px; }`,\n];\n\nconst DANGER_ON_HOVER = `.${ITEM_CLASS}[data-danger=\"hover\"]`;\nconst DANGER_ON_HOVER_ACTIVE = `${DANGER_ON_HOVER}:not(:disabled):is(:hover, :focus-visible)`;\n\nconst DANGER_ON_HOVER_RULES = [\n `${DANGER_ON_HOVER} { color: var(--malachite-text-primary, rgb(10, 10, 10)); }`,\n `${DANGER_ON_HOVER}[data-tone=\"muted\"] { color: var(--malachite-text-secondary, rgb(123, 123, 123)); }`,\n `${DANGER_ON_HOVER} > .${ITEM_ICON_CLASS} { color: var(--malachite-text-dimmed, rgb(161, 161, 161)); }`,\n `${DANGER_ON_HOVER}[aria-current] { color: ${SELECTED_ROW_FOREGROUND}; background: ${SELECTED_ROW_BACKGROUND}; }`,\n `${DANGER_ON_HOVER_ACTIVE} { color: var(--malachite-text-destructive, rgb(237, 53, 54)); background: var(--malachite-error-background-glass, rgba(197, 63, 63, 0.08)); }`,\n `${DANGER_ON_HOVER_ACTIVE} > .${ITEM_ICON_CLASS} { color: inherit; }`,\n `${DANGER_ON_HOVER}:not([aria-current]) .${DESCRIPTION_CLASS} { color: var(--malachite-text-secondary, rgb(123, 123, 123)); }`,\n `${DANGER_ON_HOVER_ACTIVE} .${DESCRIPTION_CLASS} { color: inherit; }`,\n];\n\nexport const ensureDangerOnHoverStyles = (): CSSStyleSheet | null =>\n injectStyleSheet('malachite-actionmenu-danger-hover-styles', DANGER_ON_HOVER_RULES);\n\nexport const ensureActionMenuStyles = (): CSSStyleSheet | null => {\n ensureOverlayStyles();\n ensureDangerOnHoverStyles();\n // New id: a sheet an older malachite copy cached under the old one lacks the chosen rules.\n return injectStyleSheet('malachite-actionmenu-item-styles-v2', ITEM_RULES);\n};\n\nexport type ActionMenuTone = 'default' | 'muted';\n\nconst ITEM_TEXT: Record<ActionMenuTone, string> = {\n default: 'var(--malachite-text-primary, rgb(10, 10, 10))',\n muted: 'var(--malachite-text-secondary, rgb(123, 123, 123))',\n};\n\ntype ActionItem = Exclude<ActionMenuItem, { type: 'text' } | { type: 'divider' }>;\n\nconst actionItemColor = (item: ActionItem, tone: ActionMenuTone): string | undefined => {\n if (item.danger === true) {\n return 'var(--malachite-text-destructive, rgb(237, 53, 54))';\n }\n if (item.danger === 'hover') {\n return undefined;\n }\n if (item.current) {\n return SELECTED_ROW_FOREGROUND;\n }\n const intent = activeIntent(item);\n return intent ? INTENT_TEXT[intent] : ITEM_TEXT[tone];\n};\n\nexport const itemStyle = (\n item: ActionMenuItem,\n tone: ActionMenuTone = 'default',\n): React.CSSProperties => {\n if (item.type === 'text') {\n return TEXT_ITEM_STYLE;\n }\n if (item.type === 'divider') {\n return {\n height: 1,\n flexShrink: 0,\n background: 'var(--malachite-card-border, rgb(232, 232, 232))',\n margin: '4px 0',\n };\n }\n return {\n display: 'flex',\n flexShrink: 0,\n alignItems: 'center',\n gap: 8,\n padding: '6px 10px',\n borderRadius: 8,\n fontSize: 'var(--malachite-font-size-small, 13px)',\n fontWeight: 400,\n color: actionItemColor(item, tone),\n background: item.current && item.danger !== 'hover' ? SELECTED_ROW_BACKGROUND : undefined,\n cursor: item.disabled ? 'not-allowed' : 'pointer',\n opacity: item.disabled ? 0.5 : 1,\n userSelect: 'none',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n border: 'none',\n textAlign: 'left',\n textDecoration: 'none',\n boxSizing: 'border-box',\n width: '100%',\n // The rule beside an indented row sits in its margin, so the row lets it show; the label keeps its own ellipsis.\n ...(item.indent\n ? {\n position: 'relative',\n overflow: 'visible',\n marginLeft: INDENT_PX,\n width: `calc(100% - ${INDENT_PX}px)`,\n }\n : {}),\n };\n};\n\nconst INDENT_PX = 18;\n\n// Runs the full height of the row and over the gap to the next, so a run of indented rows reads as one rule.\nexport const INDENT_RULE_STYLE: React.CSSProperties = {\n position: 'absolute',\n left: -(INDENT_PX / 2) - 1,\n top: -1,\n bottom: -1,\n width: 1,\n background: 'var(--malachite-card-border, rgb(232, 232, 232))',\n};\n\n// The menu's rows, and a set of choices among them, stack the same way.\nexport const MENU_COLUMN_STYLE: React.CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n flexShrink: 0,\n gap: 2,\n};\n\nexport const menuStyle = (position: MenuGeometry | null): React.CSSProperties => ({\n position: 'fixed',\n top: position?.top ?? 0,\n left: position?.left ?? 0,\n width: position?.width,\n maxHeight: position?.maxHeight,\n overflowY: 'auto',\n background: MENU_SPECS.options.background,\n border: MENU_SPECS.options.border,\n borderRadius: MENU_SPECS.options.radius,\n boxShadow: MENU_SPECS.options.shadow,\n padding: MENU_SPECS.options.padding,\n ...MENU_COLUMN_STYLE,\n visibility: position ? 'visible' : 'hidden',\n opacity: position ? 1 : 0,\n});\n"],"names":["TRIGGER_SIZES","LABEL_STYLE","VISUALLY_HIDDEN_STYLE","EMPTY_ITEM_STYLE","TEXT_ITEM_STYLE","HEADING_ITEM_STYLE","TEXT_ITEM_LABEL_STYLE","ITEM_TEXT_STYLE","DESCRIPTION_BASE","DESCRIPTION_STYLE","ROW_DESCRIPTION_STYLE","DESCRIPTION_CLASS","descriptionStyle","item","CHECK_SLOT_STYLE","ACCENT_FOREGROUND","CHOSEN_SLOT_STYLE","INTENT_TEXT","ownPaint","activeIntent","isChosen","highlight","checkSlotStyle","ITEM_ICON_LAYOUT","ITEM_ICON_STYLE","itemIconStyle","ITEM_ICON_CLASS","ITEM_CLASS","TAG_HOST_ATTR","TAG_HOST_STYLE","TAG_HOST_PROPS","CHOSEN_ATTR","ITEM_RULES","SELECTED_OPTION_BACKGROUND","DANGER_ON_HOVER","DANGER_ON_HOVER_ACTIVE","DANGER_ON_HOVER_RULES","SELECTED_ROW_FOREGROUND","SELECTED_ROW_BACKGROUND","ensureDangerOnHoverStyles","injectStyleSheet","ensureActionMenuStyles","ensureOverlayStyles","ITEM_TEXT","actionItemColor","tone","intent","itemStyle","INDENT_PX","INDENT_RULE_STYLE","MENU_COLUMN_STYLE","menuStyle","position","MENU_SPECS"],"mappings":";;;;;AAQO,MAAMA,IAA+E;AAAA,EACxF,OAAO,EAAE,MAAM,IAAI,SAAS,mCAAA;AAAA,EAC5B,QAAQ,EAAE,MAAM,IAAI,SAAS,mCAAA;AACjC,GAEaC,IAAmC;AAAA,EAC5C,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAClB,GAGaC,IAA6C;AAAA,EACtD,UAAU;AAAA,EACV,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,UAAU;AAAA,EACV,YAAY;AAChB,GAIaC,IAAwC;AAAA,EACjD,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,UAAU;AAAA,EACV,OAAO;AAAA,EACP,YAAY;AAChB,GAEaC,IAAuC;AAAA,EAChD,GAAGD;AAAA,EACH,OAAO;AAAA,EACP,UAAU;AAAA,EACV,cAAc;AAAA,EACd,YAAY;AAChB,GAGaE,IAA0C;AAAA,EACnD,GAAGD;AAAA,EACH,UAAU;AACd,GAEaE,IAA6C,EAAE,OAAO,WAAW,UAAU,UAAA,GAE3EC,IAAuC;AAAA,EAChD,GAAGN;AAAA,EACH,SAAS;AAAA,EACT,eAAe;AAAA,EACf,KAAK;AACT,GAEMO,IAAwC;AAAA,EAC1C,GAAGP;AAAA,EACH,YAAY;AAAA,EACZ,UAAU;AACd,G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${t.neutral} btn-muted`;
|
|
84
|
+
case "subtle":
|
|
85
|
+
return `${e} ${t.neutral} btn-subtle`;
|
|
84
86
|
case "no-style":
|
|
85
87
|
return `${e} ${t.neutral} btn-no-style border-none`;
|
|
86
88
|
default:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buttonStyles.js","sources":["../../src/components/buttonStyles.ts"],"sourcesContent":["import type { ButtonRadius, ButtonSize, ButtonVariant } from './Button';\n\n// Geometry from the Figma component library, which is variant-independent.\n// `min-h` not `h`: Tailwind emits `h-*` after `min-h-*`, so a hard height would beat a\n// consumer's own `h-*`. Paired with `whitespace-nowrap` (as Figma has it) so a long label\n// cannot wrap into a line the height would clip.\nexport const getSizeClasses = (size: ButtonSize) => {\n switch (size) {\n // Figma has no text X-Small button, only the icon-only square — nothing to align to.\n case 'xsmall':\n return '[--btn-px:calc(var(--spacing)*2)] px-[var(--btn-px)] py-1 text-xs';\n case 'small':\n return 'min-h-[var(--malachite-control-height-small,28px)] [--btn-px:10px] px-[var(--btn-px)] text-[length:var(--malachite-font-size-small,13px)] leading-[16px] whitespace-nowrap';\n case 'medium':\n return 'min-h-[var(--malachite-control-height-medium,32px)] [--btn-px:10px] px-[var(--btn-px)] text-[length:var(--malachite-font-size-small,13px)] leading-[16px] whitespace-nowrap';\n case 'large':\n return 'min-h-[var(--malachite-control-height-large,42px)] [--btn-px:12px] px-[var(--btn-px)] text-[length:var(--malachite-font-size-15,15px)] leading-[18px] whitespace-nowrap';\n default:\n return 'min-h-[var(--malachite-control-height-large,42px)] [--btn-px:12px] px-[var(--btn-px)] text-[length:var(--malachite-font-size-15,15px)] leading-[18px] whitespace-nowrap';\n }\n};\n\n// `rounded-*` reads the malachite radius tokens via `@theme`, so these follow the theme.\n// An explicit `radius` prop still wins, via getRadiusClass.\nexport const getDefaultRadiusClass = (size: ButtonSize, iconOnly: boolean): string => {\n switch (size) {\n // Only the square rounds at 8px — text buttons at this size keep their 6px corner.\n case 'xsmall':\n return iconOnly ? 'rounded-lg' : 'rounded-md';\n case 'small':\n return 'rounded-[var(--malachite-radius-10,10px)]';\n case 'medium':\n return 'rounded-xl';\n case 'large':\n return 'rounded-[var(--malachite-radius-xxl,14px)]';\n default:\n return 'rounded-[var(--malachite-radius-xxl,14px)]';\n }\n};\n\n// Figma pairs a 6px icon gap with the 13px tiers and 8px with the 15px tier.\nexport const getIconGapClass = (size: ButtonSize, position: 'start' | 'end'): string => {\n const start = position === 'start';\n switch (size) {\n case 'small':\n case 'medium':\n return start ? 'mr-[6px]' : 'ml-[6px]';\n default:\n return start ? 'mr-2' : 'ml-2';\n }\n};\n\nexport const getRadiusClass = (radius: ButtonRadius): string => {\n switch (radius) {\n case 'md':\n return 'rounded-md';\n case 'lg':\n return 'rounded-lg';\n case 'xl':\n return 'rounded-xl';\n default:\n return 'rounded-xl';\n }\n};\n\n// Focus ring: a `focus-visible` outline (keyboard only), coloured to match the variant.\n// Uses `outline` rather than Tailwind's `ring-*` because ring composes `--tw-ring-*`\n// custom properties via box-shadow that rely on document-level @property registration\n// and silently don't paint inside a shadow root (same class of issue as transform\n// utilities). The classes are full literals so Tailwind's JIT can generate them.\nconst FOCUS_OUTLINE = {\n neutral: 'focus-visible:[outline:2px_solid_var(--malachite-text-primary)]',\n destructive: 'focus-visible:[outline:2px_solid_var(--malachite-text-destructive)]',\n success: 'focus-visible:[outline:2px_solid_var(--malachite-text-success)]',\n warning: 'focus-visible:[outline:2px_solid_var(--malachite-text-warning)]',\n error: 'focus-visible:[outline:2px_solid_var(--malachite-text-error)]',\n assistant: 'focus-visible:[outline:2px_solid_var(--malachite-assistant-foreground)]',\n accent: 'focus-visible:[outline:2px_solid_var(--malachite-accent-foreground)]',\n};\n\nexport const getVariantClasses = (variant: ButtonVariant, radiusClass: string): string => {\n const baseClasses = `font-medium transition-[color,background-color,border-color,opacity,box-shadow] duration-200 ease-in-out outline-none focus-visible:outline-offset-2 border border-solid ${radiusClass} cursor-pointer`;\n\n switch (variant) {\n case 'filled':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-filled shadow-default`;\n\n case 'outline':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-outline shadow-default`;\n\n case 'surface':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-surface shadow-default`;\n\n case 'assistant':\n return `${baseClasses} ${FOCUS_OUTLINE.assistant} btn-assistant shadow-default`;\n\n case 'destructive':\n return `${baseClasses} ${FOCUS_OUTLINE.destructive} btn-destructive`;\n\n case 'success':\n return `${baseClasses} ${FOCUS_OUTLINE.success} btn-glass-success`;\n\n case 'warning':\n return `${baseClasses} ${FOCUS_OUTLINE.warning} btn-glass-warning`;\n\n case 'error':\n return `${baseClasses} ${FOCUS_OUTLINE.error} btn-glass-error`;\n\n case 'ghost':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-ghost`;\n\n case 'row-outline':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-row-outline`;\n\n case 'quiet':\n return `${baseClasses} ${FOCUS_OUTLINE.accent} btn-quiet`;\n\n case 'muted':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-muted`;\n\n case 'no-style':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-no-style border-none`;\n\n default:\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-filled shadow-default`;\n }\n};\n"],"names":["getSizeClasses","size","getDefaultRadiusClass","iconOnly","getIconGapClass","position","start","getRadiusClass","radius","FOCUS_OUTLINE","getVariantClasses","variant","radiusClass","baseClasses"],"mappings":"AAMO,MAAMA,IAAiB,CAACC,MAAqB;AAChD,UAAQA,GAAA;AAAA;AAAA,IAEJ,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX;AACI,aAAO;AAAA,EAAA;AAEnB,GAIaC,IAAwB,CAACD,GAAkBE,MAA8B;AAClF,UAAQF,GAAA;AAA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AK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,KAAK;AAAA,IAEhD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,IAElD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,IAElD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,MAAM;AAAA,IAEjD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,IAElD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,IAElD;AACI,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,EAAA;AAE1D;"}
|
|
1
|
+
{"version":3,"file":"buttonStyles.js","sources":["../../src/components/buttonStyles.ts"],"sourcesContent":["import type { ButtonRadius, ButtonSize, ButtonVariant } from './Button';\n\n// Geometry from the Figma component library, which is variant-independent.\n// `min-h` not `h`: Tailwind emits `h-*` after `min-h-*`, so a hard height would beat a\n// consumer's own `h-*`. Paired with `whitespace-nowrap` (as Figma has it) so a long label\n// cannot wrap into a line the height would clip.\nexport const getSizeClasses = (size: ButtonSize) => {\n switch (size) {\n // Figma has no text X-Small button, only the icon-only square — nothing to align to.\n case 'xsmall':\n return '[--btn-px:calc(var(--spacing)*2)] px-[var(--btn-px)] py-1 text-xs';\n case 'small':\n return 'min-h-[var(--malachite-control-height-small,28px)] [--btn-px:10px] px-[var(--btn-px)] text-[length:var(--malachite-font-size-small,13px)] leading-[16px] whitespace-nowrap';\n case 'medium':\n return 'min-h-[var(--malachite-control-height-medium,32px)] [--btn-px:10px] px-[var(--btn-px)] text-[length:var(--malachite-font-size-small,13px)] leading-[16px] whitespace-nowrap';\n case 'large':\n return 'min-h-[var(--malachite-control-height-large,42px)] [--btn-px:12px] px-[var(--btn-px)] text-[length:var(--malachite-font-size-15,15px)] leading-[18px] whitespace-nowrap';\n default:\n return 'min-h-[var(--malachite-control-height-large,42px)] [--btn-px:12px] px-[var(--btn-px)] text-[length:var(--malachite-font-size-15,15px)] leading-[18px] whitespace-nowrap';\n }\n};\n\n// `rounded-*` reads the malachite radius tokens via `@theme`, so these follow the theme.\n// An explicit `radius` prop still wins, via getRadiusClass.\nexport const getDefaultRadiusClass = (size: ButtonSize, iconOnly: boolean): string => {\n switch (size) {\n // Only the square rounds at 8px — text buttons at this size keep their 6px corner.\n case 'xsmall':\n return iconOnly ? 'rounded-lg' : 'rounded-md';\n case 'small':\n return 'rounded-[var(--malachite-radius-10,10px)]';\n case 'medium':\n return 'rounded-xl';\n case 'large':\n return 'rounded-[var(--malachite-radius-xxl,14px)]';\n default:\n return 'rounded-[var(--malachite-radius-xxl,14px)]';\n }\n};\n\n// Figma pairs a 6px icon gap with the 13px tiers and 8px with the 15px tier.\nexport const getIconGapClass = (size: ButtonSize, position: 'start' | 'end'): string => {\n const start = position === 'start';\n switch (size) {\n case 'small':\n case 'medium':\n return start ? 'mr-[6px]' : 'ml-[6px]';\n default:\n return start ? 'mr-2' : 'ml-2';\n }\n};\n\nexport const getRadiusClass = (radius: ButtonRadius): string => {\n switch (radius) {\n case 'md':\n return 'rounded-md';\n case 'lg':\n return 'rounded-lg';\n case 'xl':\n return 'rounded-xl';\n default:\n return 'rounded-xl';\n }\n};\n\n// Focus ring: a `focus-visible` outline (keyboard only), coloured to match the variant.\n// Uses `outline` rather than Tailwind's `ring-*` because ring composes `--tw-ring-*`\n// custom properties via box-shadow that rely on document-level @property registration\n// and silently don't paint inside a shadow root (same class of issue as transform\n// utilities). The classes are full literals so Tailwind's JIT can generate them.\nconst FOCUS_OUTLINE = {\n neutral: 'focus-visible:[outline:2px_solid_var(--malachite-text-primary)]',\n destructive: 'focus-visible:[outline:2px_solid_var(--malachite-text-destructive)]',\n success: 'focus-visible:[outline:2px_solid_var(--malachite-text-success)]',\n warning: 'focus-visible:[outline:2px_solid_var(--malachite-text-warning)]',\n error: 'focus-visible:[outline:2px_solid_var(--malachite-text-error)]',\n assistant: 'focus-visible:[outline:2px_solid_var(--malachite-assistant-foreground)]',\n accent: 'focus-visible:[outline:2px_solid_var(--malachite-accent-foreground)]',\n};\n\nexport const getVariantClasses = (variant: ButtonVariant, radiusClass: string): string => {\n const baseClasses = `font-medium transition-[color,background-color,border-color,opacity,box-shadow] duration-200 ease-in-out outline-none focus-visible:outline-offset-2 border border-solid ${radiusClass} cursor-pointer`;\n\n switch (variant) {\n case 'filled':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-filled shadow-default`;\n\n case 'outline':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-outline shadow-default`;\n\n case 'surface':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-surface shadow-default`;\n\n case 'assistant':\n return `${baseClasses} ${FOCUS_OUTLINE.assistant} btn-assistant shadow-default`;\n\n case 'destructive':\n return `${baseClasses} ${FOCUS_OUTLINE.destructive} btn-destructive`;\n\n case 'success':\n return `${baseClasses} ${FOCUS_OUTLINE.success} btn-glass-success`;\n\n case 'warning':\n return `${baseClasses} ${FOCUS_OUTLINE.warning} btn-glass-warning`;\n\n case 'error':\n return `${baseClasses} ${FOCUS_OUTLINE.error} btn-glass-error`;\n\n case 'ghost':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-ghost`;\n\n case 'row-outline':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-row-outline`;\n\n case 'quiet':\n return `${baseClasses} ${FOCUS_OUTLINE.accent} btn-quiet`;\n\n case 'muted':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-muted`;\n\n case 'subtle':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-subtle`;\n\n case 'no-style':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-no-style border-none`;\n\n default:\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-filled shadow-default`;\n }\n};\n"],"names":["getSizeClasses","size","getDefaultRadiusClass","iconOnly","getIconGapClass","position","start","getRadiusClass","radius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,IAElD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,IAElD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,SAAS;AAAA,IAEpD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,WAAW;AAAA,IAEtD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,IAElD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,IAElD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,KAAK;AAAA,IAEhD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,IAElD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,IAElD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,MAAM;AAAA,IAEjD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,IAElD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,IAElD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,IAElD;AACI,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,EAAA;AAE1D;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
const r = "border-[var(--malachite-card-border,rgb(232,232,232))]", o = "[scrollbar-width:none] [&::-webkit-scrollbar]:hidden", t = "transition-colors hover:bg-[var(--malachite-buttonlist-hover-background,rgb(245,245,245))]"
|
|
1
|
+
const r = "border-[var(--malachite-card-border,rgb(232,232,232))]", o = "[scrollbar-width:none] [&::-webkit-scrollbar]:hidden", t = "transition-colors hover:bg-[var(--malachite-buttonlist-hover-background,rgb(245,245,245))]";
|
|
2
2
|
export {
|
|
3
3
|
r as BORDER,
|
|
4
4
|
o as NO_SCROLLBAR,
|
|
5
|
-
t as ROW_HOVER
|
|
6
|
-
a as ROW_HOVER_COLOR
|
|
5
|
+
t as ROW_HOVER
|
|
7
6
|
};
|
|
8
7
|
//# sourceMappingURL=chromeStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chromeStyles.js","sources":["../../src/components/chromeStyles.ts"],"sourcesContent":["export const BORDER = 'border-[var(--malachite-card-border,rgb(232,232,232))]';\n\nexport const NO_SCROLLBAR = '[scrollbar-width:none] [&::-webkit-scrollbar]:hidden';\n\nexport const ROW_HOVER =\n 'transition-colors hover:bg-[var(--malachite-buttonlist-hover-background,rgb(245,245,245))]';\n\nexport const ROW_HOVER_COLOR = 'var(--malachite-buttonlist-hover-background,rgb(245,245,245))';\n"],"names":["BORDER","NO_SCROLLBAR","ROW_HOVER"
|
|
1
|
+
{"version":3,"file":"chromeStyles.js","sources":["../../src/components/chromeStyles.ts"],"sourcesContent":["export const BORDER = 'border-[var(--malachite-card-border,rgb(232,232,232))]';\n\nexport const NO_SCROLLBAR = '[scrollbar-width:none] [&::-webkit-scrollbar]:hidden';\n\nexport const ROW_HOVER =\n 'transition-colors hover:bg-[var(--malachite-buttonlist-hover-background,rgb(245,245,245))]';\n\nexport const ROW_HOVER_COLOR = 'var(--malachite-buttonlist-hover-background,rgb(245,245,245))';\n"],"names":["BORDER","NO_SCROLLBAR","ROW_HOVER"],"mappings":"AAAO,MAAMA,IAAS,0DAETC,IAAe,wDAEfC,IACT;"}
|