@robert-stackflow/oneui 0.6.38 → 0.6.39
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/CHANGELOG.md +10 -0
- package/README.md +329 -319
- package/components/Combobox.js +1 -0
- package/components/ContributionCalendar.module.css +127 -127
- package/components/Dialog.module.css +153 -153
- package/components/IconButton.module.css +92 -92
- package/components/MenuItem.d.ts +1 -1
- package/components/MenuItem.js +2 -0
- package/components/MenuItem.module.css +9 -0
- package/components/MenuItemContent.d.ts +2 -1
- package/components/MenuItemContent.js +2 -1
- package/components/SelectOptionContent.js +1 -0
- package/components/types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
.iconButton {
|
|
2
|
-
position: relative;
|
|
3
|
-
display: grid;
|
|
4
|
-
place-items: center;
|
|
5
|
-
width: 32px;
|
|
6
|
-
height: 32px;
|
|
7
|
-
padding: 0;
|
|
8
|
-
border: 0;
|
|
9
|
-
background: transparent;
|
|
10
|
-
border-radius: calc(var(--radius) - 3px);
|
|
11
|
-
color: var(--muted);
|
|
12
|
-
transition:
|
|
13
|
-
background var(--motion-hover),
|
|
14
|
-
color var(--motion-hover),
|
|
15
|
-
opacity var(--motion-hover);
|
|
16
|
-
}
|
|
17
|
-
.iconButton:hover:not(:disabled):not([aria-disabled="true"]) {
|
|
18
|
-
color: var(--fg);
|
|
19
|
-
background: var(--hover);
|
|
20
|
-
}
|
|
21
|
-
.icon {
|
|
22
|
-
display: contents;
|
|
23
|
-
}
|
|
24
|
-
.iconButton[data-size="small"] {
|
|
25
|
-
width: 30px;
|
|
26
|
-
height: 30px;
|
|
27
|
-
min-width: 30px;
|
|
28
|
-
}
|
|
29
|
-
.iconButton[data-has-text] {
|
|
30
|
-
display: inline-flex;
|
|
31
|
-
align-items: center;
|
|
32
|
-
justify-content: center;
|
|
33
|
-
width: auto;
|
|
34
|
-
gap: 6px;
|
|
35
|
-
padding-inline: 9px;
|
|
36
|
-
font-size: 13px;
|
|
37
|
-
line-height: 1.4;
|
|
38
|
-
}
|
|
39
|
-
.iconButton[data-has-text] .icon {
|
|
40
|
-
display: inline-flex;
|
|
41
|
-
align-items: center;
|
|
42
|
-
justify-content: center;
|
|
43
|
-
flex-shrink: 0;
|
|
44
|
-
gap: 3px;
|
|
45
|
-
}
|
|
46
|
-
.text {
|
|
47
|
-
white-space: nowrap;
|
|
48
|
-
font-variant-numeric: tabular-nums;
|
|
49
|
-
}
|
|
50
|
-
.iconButton[data-variant="primary"] {
|
|
51
|
-
background: var(--accent-fill, var(--accent));
|
|
52
|
-
color: var(--on-accent-fill, var(--on-accent));
|
|
53
|
-
}
|
|
54
|
-
.iconButton[data-variant="primary"]:hover:not(:disabled) {
|
|
55
|
-
background: var(--accent-fill-hover, var(--accent));
|
|
56
|
-
}
|
|
57
|
-
.iconButton[data-variant="secondary"] {
|
|
58
|
-
border: 1px solid var(--border);
|
|
59
|
-
background: var(--surface);
|
|
60
|
-
}
|
|
61
|
-
.iconButton[data-variant="danger"] {
|
|
62
|
-
color: var(--danger);
|
|
63
|
-
background: var(--danger-soft);
|
|
64
|
-
}
|
|
65
|
-
.iconButton[data-disclosure] {
|
|
66
|
-
width: auto;
|
|
67
|
-
padding-inline: 7px;
|
|
68
|
-
}
|
|
69
|
-
.iconButton[data-disclosure] .icon {
|
|
70
|
-
display: flex;
|
|
71
|
-
align-items: center;
|
|
72
|
-
gap: 3px;
|
|
73
|
-
}
|
|
74
|
-
.iconButton[data-disclosure][aria-expanded="true"] {
|
|
75
|
-
color: var(--accent-ink, var(--fg));
|
|
76
|
-
background: var(--hover);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/* Toggle tools use the theme selection surface, without a second outlined button. */
|
|
80
|
-
.iconButton[data-variant="ghost"][aria-pressed="true"] {
|
|
81
|
-
background: var(--selected);
|
|
82
|
-
color: var(--fg);
|
|
83
|
-
}
|
|
84
|
-
.iconButton[data-variant="ghost"][aria-pressed="true"]:hover:not(:disabled) {
|
|
85
|
-
background: color-mix(in srgb, var(--selected) 70%, var(--hover));
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.iconButton:disabled,
|
|
89
|
-
.iconButton[aria-disabled="true"] {
|
|
90
|
-
opacity: 0.35;
|
|
91
|
-
cursor: not-allowed;
|
|
92
|
-
}
|
|
1
|
+
.iconButton {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: grid;
|
|
4
|
+
place-items: center;
|
|
5
|
+
width: 32px;
|
|
6
|
+
height: 32px;
|
|
7
|
+
padding: 0;
|
|
8
|
+
border: 0;
|
|
9
|
+
background: transparent;
|
|
10
|
+
border-radius: calc(var(--radius) - 3px);
|
|
11
|
+
color: var(--muted);
|
|
12
|
+
transition:
|
|
13
|
+
background var(--motion-hover),
|
|
14
|
+
color var(--motion-hover),
|
|
15
|
+
opacity var(--motion-hover);
|
|
16
|
+
}
|
|
17
|
+
.iconButton:hover:not(:disabled):not([aria-disabled="true"]) {
|
|
18
|
+
color: var(--fg);
|
|
19
|
+
background: var(--hover);
|
|
20
|
+
}
|
|
21
|
+
.icon {
|
|
22
|
+
display: contents;
|
|
23
|
+
}
|
|
24
|
+
.iconButton[data-size="small"] {
|
|
25
|
+
width: 30px;
|
|
26
|
+
height: 30px;
|
|
27
|
+
min-width: 30px;
|
|
28
|
+
}
|
|
29
|
+
.iconButton[data-has-text] {
|
|
30
|
+
display: inline-flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
width: auto;
|
|
34
|
+
gap: 6px;
|
|
35
|
+
padding-inline: 9px;
|
|
36
|
+
font-size: 13px;
|
|
37
|
+
line-height: 1.4;
|
|
38
|
+
}
|
|
39
|
+
.iconButton[data-has-text] .icon {
|
|
40
|
+
display: inline-flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
flex-shrink: 0;
|
|
44
|
+
gap: 3px;
|
|
45
|
+
}
|
|
46
|
+
.text {
|
|
47
|
+
white-space: nowrap;
|
|
48
|
+
font-variant-numeric: tabular-nums;
|
|
49
|
+
}
|
|
50
|
+
.iconButton[data-variant="primary"] {
|
|
51
|
+
background: var(--accent-fill, var(--accent));
|
|
52
|
+
color: var(--on-accent-fill, var(--on-accent));
|
|
53
|
+
}
|
|
54
|
+
.iconButton[data-variant="primary"]:hover:not(:disabled) {
|
|
55
|
+
background: var(--accent-fill-hover, var(--accent));
|
|
56
|
+
}
|
|
57
|
+
.iconButton[data-variant="secondary"] {
|
|
58
|
+
border: 1px solid var(--border);
|
|
59
|
+
background: var(--surface);
|
|
60
|
+
}
|
|
61
|
+
.iconButton[data-variant="danger"] {
|
|
62
|
+
color: var(--danger);
|
|
63
|
+
background: var(--danger-soft);
|
|
64
|
+
}
|
|
65
|
+
.iconButton[data-disclosure] {
|
|
66
|
+
width: auto;
|
|
67
|
+
padding-inline: 7px;
|
|
68
|
+
}
|
|
69
|
+
.iconButton[data-disclosure] .icon {
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
gap: 3px;
|
|
73
|
+
}
|
|
74
|
+
.iconButton[data-disclosure][aria-expanded="true"] {
|
|
75
|
+
color: var(--accent-ink, var(--fg));
|
|
76
|
+
background: var(--hover);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* Toggle tools use the theme selection surface, without a second outlined button. */
|
|
80
|
+
.iconButton[data-variant="ghost"][aria-pressed="true"] {
|
|
81
|
+
background: var(--selected);
|
|
82
|
+
color: var(--fg);
|
|
83
|
+
}
|
|
84
|
+
.iconButton[data-variant="ghost"][aria-pressed="true"]:hover:not(:disabled) {
|
|
85
|
+
background: color-mix(in srgb, var(--selected) 70%, var(--hover));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.iconButton:disabled,
|
|
89
|
+
.iconButton[aria-disabled="true"] {
|
|
90
|
+
opacity: 0.35;
|
|
91
|
+
cursor: not-allowed;
|
|
92
|
+
}
|
package/components/MenuItem.d.ts
CHANGED
|
@@ -17,4 +17,4 @@ export type MenuItemProps = Omit<HTMLAttributes<HTMLElement>, "children" | "pref
|
|
|
17
17
|
selection?: "check" | "checkbox" | "radio";
|
|
18
18
|
tone?: "default" | "danger";
|
|
19
19
|
};
|
|
20
|
-
export declare function MenuItem({ as, asChild, children, prefix, label, description, icon, reserveIcon, shortcut, trailing, meta, selected, active, disabled, selection, tone, className, ...props }: MenuItemProps): import("react").JSX.Element;
|
|
20
|
+
export declare function MenuItem({ as, asChild, children, prefix, label, description, descriptionLines, icon, reserveIcon, shortcut, trailing, meta, selected, active, disabled, selection, tone, className, ...props }: MenuItemProps): import("react").JSX.Element;
|
package/components/MenuItem.js
CHANGED
|
@@ -14,6 +14,7 @@ function MenuItem({
|
|
|
14
14
|
prefix,
|
|
15
15
|
label,
|
|
16
16
|
description,
|
|
17
|
+
descriptionLines,
|
|
17
18
|
icon,
|
|
18
19
|
reserveIcon = false,
|
|
19
20
|
shortcut,
|
|
@@ -34,6 +35,7 @@ function MenuItem({
|
|
|
34
35
|
{
|
|
35
36
|
label,
|
|
36
37
|
description,
|
|
38
|
+
descriptionLines,
|
|
37
39
|
icon,
|
|
38
40
|
reserveIcon
|
|
39
41
|
}
|
|
@@ -118,6 +118,15 @@
|
|
|
118
118
|
white-space: nowrap;
|
|
119
119
|
text-align: right;
|
|
120
120
|
}
|
|
121
|
+
.description[data-lines="2"],
|
|
122
|
+
.description[data-lines="3"] {
|
|
123
|
+
display: -webkit-box;
|
|
124
|
+
-webkit-box-orient: vertical;
|
|
125
|
+
-webkit-line-clamp: 2;
|
|
126
|
+
white-space: pre-line;
|
|
127
|
+
overflow-wrap: anywhere;
|
|
128
|
+
}
|
|
129
|
+
.description[data-lines="3"] { -webkit-line-clamp: 3; }
|
|
121
130
|
.shortcut ~ .trailing:empty {
|
|
122
131
|
display: none;
|
|
123
132
|
}
|
|
@@ -2,7 +2,8 @@ import type { ReactNode } from "react";
|
|
|
2
2
|
export type MenuItemContentProps = {
|
|
3
3
|
label: ReactNode;
|
|
4
4
|
description?: ReactNode;
|
|
5
|
+
descriptionLines?: 1 | 2 | 3;
|
|
5
6
|
icon?: ReactNode;
|
|
6
7
|
reserveIcon?: boolean;
|
|
7
8
|
};
|
|
8
|
-
export declare function MenuItemContent({ label, description, icon, reserveIcon, }: MenuItemContentProps): import("react").JSX.Element;
|
|
9
|
+
export declare function MenuItemContent({ label, description, descriptionLines, icon, reserveIcon, }: MenuItemContentProps): import("react").JSX.Element;
|
|
@@ -4,6 +4,7 @@ import s from "./MenuItem.module.css";
|
|
|
4
4
|
function MenuItemContent({
|
|
5
5
|
label,
|
|
6
6
|
description,
|
|
7
|
+
descriptionLines = 1,
|
|
7
8
|
icon,
|
|
8
9
|
reserveIcon = false
|
|
9
10
|
}) {
|
|
@@ -11,7 +12,7 @@ function MenuItemContent({
|
|
|
11
12
|
(icon || reserveIcon) && /* @__PURE__ */ jsx("span", { className: s.leading, "data-menu-icon": true, "aria-hidden": "true", children: icon }),
|
|
12
13
|
/* @__PURE__ */ jsxs("span", { className: s.copy, children: [
|
|
13
14
|
/* @__PURE__ */ jsx("span", { className: s.label, "data-menu-label": true, children: label }),
|
|
14
|
-
description && /* @__PURE__ */ jsx("span", { className: s.description, children: description })
|
|
15
|
+
description && /* @__PURE__ */ jsx("span", { className: s.description, "data-lines": descriptionLines, title: typeof description === "string" ? description : void 0, children: description })
|
|
15
16
|
] })
|
|
16
17
|
] });
|
|
17
18
|
}
|
package/components/types.d.ts
CHANGED