@robert-stackflow/oneui 0.6.21 → 0.6.23

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +30 -18
  2. package/README.md +270 -264
  3. package/components/AccountItem.module.css +103 -103
  4. package/components/AppShell.module.css +223 -223
  5. package/components/Badge.module.css +30 -30
  6. package/components/BarChart.module.css +35 -35
  7. package/components/Breadcrumb.module.css +97 -97
  8. package/components/Button.module.css +120 -120
  9. package/components/Checkbox.module.css +95 -95
  10. package/components/ContextMenu.d.ts +3 -1
  11. package/components/ContextMenu.js +24 -4
  12. package/components/ContributionCalendar.module.css +121 -121
  13. package/components/Control.module.css +86 -86
  14. package/components/DataTable.module.css +75 -75
  15. package/components/Dialog.module.css +139 -139
  16. package/components/EditableHeading.d.ts +12 -0
  17. package/components/EditableHeading.js +76 -0
  18. package/components/EditableHeading.module.css +16 -0
  19. package/components/HierarchyPicker.module.css +185 -185
  20. package/components/IconButton.d.ts +3 -1
  21. package/components/IconButton.js +13 -2
  22. package/components/IconButton.module.css +13 -0
  23. package/components/Indicator.module.css +83 -83
  24. package/components/Layout.d.ts +1 -0
  25. package/components/Layout.module.css +82 -82
  26. package/components/Markdown.module.css +227 -227
  27. package/components/MenuItem.module.css +172 -172
  28. package/components/NavBar.module.css +130 -130
  29. package/components/Popover.d.ts +5 -1
  30. package/components/Popover.js +59 -28
  31. package/components/Popover.module.css +52 -0
  32. package/components/Progress.module.css +33 -33
  33. package/components/RadioGroup.module.css +87 -87
  34. package/components/RangeSlider.module.css +141 -141
  35. package/components/ResizablePanel.module.css +101 -101
  36. package/components/ResourceCard.module.css +98 -98
  37. package/components/Segmented.module.css +85 -85
  38. package/components/SidebarNavigation.js +4 -2
  39. package/components/SidebarNavigation.module.css +7 -2
  40. package/components/Slider.module.css +19 -19
  41. package/components/Steps.module.css +176 -176
  42. package/components/Tab.module.css +148 -148
  43. package/components/Table.module.css +87 -87
  44. package/components/TableOfContents.module.css +252 -252
  45. package/components/ThemePicker.module.css +178 -178
  46. package/components/TimeColumns.module.css +47 -47
  47. package/components/Timeline.module.css +202 -202
  48. package/components/TreeTable.module.css +57 -57
  49. package/components/UptimeChart.module.css +15 -15
  50. package/components/index.d.ts +2 -0
  51. package/components/index.js +2 -0
  52. package/components/motion.d.ts +1 -0
  53. package/components/motion.js +16 -2
  54. package/package.json +1 -1
  55. package/styles/base.css +206 -206
  56. package/styles/blue.css +270 -270
  57. package/styles/minimal.css +319 -319
@@ -1,185 +1,185 @@
1
- .trigger {
2
- width: 280px;
3
- max-width: 100%;
4
- min-width: 0;
5
- }
6
- .search {
7
- margin: 3px 3px 8px;
8
- }
9
- .tree {
10
- composes: stack from "./OptionList.module.css";
11
- max-height: 292px;
12
- min-height: 0;
13
- flex-shrink: 1;
14
- overflow: auto;
15
- padding: 2px;
16
- }
17
- .row {
18
- padding-left: calc(var(--menu-item-padding-x) + var(--level, 0) * 18px);
19
- }
20
- .row:focus-visible {
21
- outline: none;
22
- box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-ink, var(--accent)) 35%, transparent);
23
- }
24
- .expander,
25
- .spacer {
26
- display: inline-grid;
27
- place-items: center;
28
- flex: 0 0 18px;
29
- width: 18px;
30
- height: 20px;
31
- }
32
- .expander {
33
- padding: 0;
34
- border: 0;
35
- border-radius: 4px;
36
- background: transparent;
37
- color: var(--muted);
38
- }
39
- .expander:hover {
40
- background: var(--selected);
41
- }
42
- .expander svg {
43
- width: 13px;
44
- height: 13px;
45
- transform: rotate(-90deg);
46
- transition: transform var(--motion-chevron) var(--ease);
47
- }
48
- .expander[data-expanded="true"] svg {
49
- transform: rotate(0deg);
50
- }
51
- .mixed {
52
- display: grid;
53
- place-items: center;
54
- width: 16px;
55
- height: 16px;
56
- border: 1px solid var(--accent);
57
- border-radius: 4px;
58
- background: var(--accent);
59
- color: var(--on-accent);
60
- }
61
- .mixed svg {
62
- width: 12px;
63
- height: 12px;
64
- }
65
- .empty,
66
- .status {
67
- padding: 16px 10px;
68
- color: var(--muted);
69
- font-size: 12px;
70
- }
71
- .error {
72
- color: var(--danger);
73
- padding: 6px 10px;
74
- font-size: 12px;
75
- display: flex;
76
- gap: 8px;
77
- align-items: center;
78
- flex-wrap: wrap;
79
- }
80
- .error span {
81
- min-width: 0;
82
- overflow-wrap: anywhere;
83
- }
84
- .footer {
85
- display: flex;
86
- justify-content: space-between;
87
- align-items: center;
88
- gap: 12px;
89
- padding: 8px 3px 1px;
90
- margin-top: 6px;
91
- border-top: var(--separator-width) var(--separator-style)
92
- var(--separator-color);
93
- font-size: 11px;
94
- color: var(--muted);
95
- }
96
- .footerActions {
97
- display: flex;
98
- align-items: center;
99
- gap: 8px;
100
- }
101
- .columns {
102
- display: flex;
103
- min-height: 0;
104
- flex-shrink: 1;
105
- max-height: 300px;
106
- overflow: auto;
107
- overscroll-behavior: contain;
108
- }
109
- .column {
110
- composes: stack from "./OptionList.module.css";
111
- flex: 1 0 170px;
112
- min-width: 170px;
113
- min-height: 0;
114
- max-height: 292px;
115
- overflow: auto;
116
- padding: 2px 5px;
117
- animation: columnIn 160ms var(--ease);
118
- }
119
- .column + .column {
120
- border-left: var(--separator-width) var(--separator-style)
121
- var(--separator-color);
122
- }
123
- .treeRow {
124
- position: relative;
125
- animation: rowIn 140ms var(--ease);
126
- }
127
- .categoryRow {
128
- --tree-elbow-gap: 6px;
129
- --tree-stem-inset: 12px;
130
- min-height: 42px;
131
- }
132
- .categoryRow[data-branch="true"] [data-menu-label] {
133
- font-weight: 600;
134
- }
135
- .categoryRow [data-menu-icon] {
136
- width: 26px;
137
- height: 26px;
138
- flex-basis: 26px;
139
- border-radius: 7px;
140
- background: var(--field);
141
- border: 1px solid var(--line);
142
- color: var(--muted);
143
- }
144
- .categoryRow[data-branch="true"] [data-menu-icon] {
145
- background: var(--selected);
146
- color: var(--accent-ink, var(--accent));
147
- }
148
- .categoryRow [data-menu-trailing] > span {
149
- border-radius: 999px;
150
- }
151
- .categoryRow .mixed {
152
- border-radius: 999px;
153
- }
154
- .treeRow[aria-disabled="true"] .expander {
155
- pointer-events: none;
156
- }
157
- @keyframes rowIn {
158
- from {
159
- opacity: 0;
160
- transform: translateY(-3px);
161
- }
162
- to {
163
- opacity: 1;
164
- transform: none;
165
- }
166
- }
167
- @keyframes columnIn {
168
- from {
169
- opacity: 0;
170
- transform: translateX(6px);
171
- }
172
- to {
173
- opacity: 1;
174
- transform: none;
175
- }
176
- }
177
- @media (prefers-reduced-motion: reduce) {
178
- .column,
179
- .treeRow {
180
- animation: none;
181
- }
182
- .expander svg {
183
- transition: none;
184
- }
185
- }
1
+ .trigger {
2
+ width: 280px;
3
+ max-width: 100%;
4
+ min-width: 0;
5
+ }
6
+ .search {
7
+ margin: 3px 3px 8px;
8
+ }
9
+ .tree {
10
+ composes: stack from "./OptionList.module.css";
11
+ max-height: 292px;
12
+ min-height: 0;
13
+ flex-shrink: 1;
14
+ overflow: auto;
15
+ padding: 2px;
16
+ }
17
+ .row {
18
+ padding-left: calc(var(--menu-item-padding-x) + var(--level, 0) * 18px);
19
+ }
20
+ .row:focus-visible {
21
+ outline: none;
22
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-ink, var(--accent)) 35%, transparent);
23
+ }
24
+ .expander,
25
+ .spacer {
26
+ display: inline-grid;
27
+ place-items: center;
28
+ flex: 0 0 18px;
29
+ width: 18px;
30
+ height: 20px;
31
+ }
32
+ .expander {
33
+ padding: 0;
34
+ border: 0;
35
+ border-radius: 4px;
36
+ background: transparent;
37
+ color: var(--muted);
38
+ }
39
+ .expander:hover {
40
+ background: var(--selected);
41
+ }
42
+ .expander svg {
43
+ width: 13px;
44
+ height: 13px;
45
+ transform: rotate(-90deg);
46
+ transition: transform var(--motion-chevron) var(--ease);
47
+ }
48
+ .expander[data-expanded="true"] svg {
49
+ transform: rotate(0deg);
50
+ }
51
+ .mixed {
52
+ display: grid;
53
+ place-items: center;
54
+ width: 16px;
55
+ height: 16px;
56
+ border: 1px solid var(--accent);
57
+ border-radius: 4px;
58
+ background: var(--accent);
59
+ color: var(--on-accent);
60
+ }
61
+ .mixed svg {
62
+ width: 12px;
63
+ height: 12px;
64
+ }
65
+ .empty,
66
+ .status {
67
+ padding: 16px 10px;
68
+ color: var(--muted);
69
+ font-size: 12px;
70
+ }
71
+ .error {
72
+ color: var(--danger);
73
+ padding: 6px 10px;
74
+ font-size: 12px;
75
+ display: flex;
76
+ gap: 8px;
77
+ align-items: center;
78
+ flex-wrap: wrap;
79
+ }
80
+ .error span {
81
+ min-width: 0;
82
+ overflow-wrap: anywhere;
83
+ }
84
+ .footer {
85
+ display: flex;
86
+ justify-content: space-between;
87
+ align-items: center;
88
+ gap: 12px;
89
+ padding: 8px 3px 1px;
90
+ margin-top: 6px;
91
+ border-top: var(--separator-width) var(--separator-style)
92
+ var(--separator-color);
93
+ font-size: 11px;
94
+ color: var(--muted);
95
+ }
96
+ .footerActions {
97
+ display: flex;
98
+ align-items: center;
99
+ gap: 8px;
100
+ }
101
+ .columns {
102
+ display: flex;
103
+ min-height: 0;
104
+ flex-shrink: 1;
105
+ max-height: 300px;
106
+ overflow: auto;
107
+ overscroll-behavior: contain;
108
+ }
109
+ .column {
110
+ composes: stack from "./OptionList.module.css";
111
+ flex: 1 0 170px;
112
+ min-width: 170px;
113
+ min-height: 0;
114
+ max-height: 292px;
115
+ overflow: auto;
116
+ padding: 2px 5px;
117
+ animation: columnIn 160ms var(--ease);
118
+ }
119
+ .column + .column {
120
+ border-left: var(--separator-width) var(--separator-style)
121
+ var(--separator-color);
122
+ }
123
+ .treeRow {
124
+ position: relative;
125
+ animation: rowIn 140ms var(--ease);
126
+ }
127
+ .categoryRow {
128
+ --tree-elbow-gap: 6px;
129
+ --tree-stem-inset: 12px;
130
+ min-height: 42px;
131
+ }
132
+ .categoryRow[data-branch="true"] [data-menu-label] {
133
+ font-weight: 600;
134
+ }
135
+ .categoryRow [data-menu-icon] {
136
+ width: 26px;
137
+ height: 26px;
138
+ flex-basis: 26px;
139
+ border-radius: 7px;
140
+ background: var(--field);
141
+ border: 1px solid var(--line);
142
+ color: var(--muted);
143
+ }
144
+ .categoryRow[data-branch="true"] [data-menu-icon] {
145
+ background: var(--selected);
146
+ color: var(--accent-ink, var(--accent));
147
+ }
148
+ .categoryRow [data-menu-trailing] > span {
149
+ border-radius: 999px;
150
+ }
151
+ .categoryRow .mixed {
152
+ border-radius: 999px;
153
+ }
154
+ .treeRow[aria-disabled="true"] .expander {
155
+ pointer-events: none;
156
+ }
157
+ @keyframes rowIn {
158
+ from {
159
+ opacity: 0;
160
+ transform: translateY(-3px);
161
+ }
162
+ to {
163
+ opacity: 1;
164
+ transform: none;
165
+ }
166
+ }
167
+ @keyframes columnIn {
168
+ from {
169
+ opacity: 0;
170
+ transform: translateX(6px);
171
+ }
172
+ to {
173
+ opacity: 1;
174
+ transform: none;
175
+ }
176
+ }
177
+ @media (prefers-reduced-motion: reduce) {
178
+ .column,
179
+ .treeRow {
180
+ animation: none;
181
+ }
182
+ .expander svg {
183
+ transition: none;
184
+ }
185
+ }
@@ -1,7 +1,9 @@
1
1
  import type { ComponentPropsWithRef } from "react";
2
- export declare function IconButton({ label, loading, children, variant, size, ...props }: ComponentPropsWithRef<"button"> & {
2
+ export declare function IconButton({ label, loading, children, variant, size, disclosure, ...props }: ComponentPropsWithRef<"button"> & {
3
3
  label: string;
4
4
  loading?: boolean;
5
5
  variant?: "primary" | "secondary" | "ghost" | "danger";
6
6
  size?: "small" | "normal";
7
+ /** Add a spaced disclosure chevron, driven by aria-expanded. */
8
+ disclosure?: boolean;
7
9
  }): import("react").JSX.Element;
@@ -1,7 +1,8 @@
1
1
  "use client";
2
- import { jsx } from "react/jsx-runtime";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { Spinner } from "./Spinner.js";
4
4
  import { Tooltip } from "./Tooltip.js";
5
+ import { DisclosureChevron } from "./DisclosureChevron.js";
5
6
  import s from "./IconButton.module.css";
6
7
  function IconButton({
7
8
  label,
@@ -9,6 +10,7 @@ function IconButton({
9
10
  children,
10
11
  variant = "ghost",
11
12
  size = "normal",
13
+ disclosure = false,
12
14
  ...props
13
15
  }) {
14
16
  return /* @__PURE__ */ jsx(Tooltip, { content: label, children: /* @__PURE__ */ jsx(
@@ -20,9 +22,18 @@ function IconButton({
20
22
  "aria-busy": loading || void 0,
21
23
  "data-variant": variant,
22
24
  "data-size": size,
25
+ "data-disclosure": disclosure || void 0,
23
26
  disabled: props.disabled || loading,
24
27
  className: `${s.iconButton} ${props.className || ""}`,
25
- children: /* @__PURE__ */ jsx("span", { className: s.icon, children: loading ? /* @__PURE__ */ jsx(Spinner, { decorative: true }) : children })
28
+ children: /* @__PURE__ */ jsxs("span", { className: s.icon, children: [
29
+ loading ? /* @__PURE__ */ jsx(Spinner, { decorative: true }) : children,
30
+ disclosure && /* @__PURE__ */ jsx(
31
+ DisclosureChevron,
32
+ {
33
+ expanded: props["aria-expanded"] === true || props["aria-expanded"] === "true"
34
+ }
35
+ )
36
+ ] })
26
37
  }
27
38
  ) });
28
39
  }
@@ -40,3 +40,16 @@
40
40
  color: var(--danger);
41
41
  background: var(--danger-soft);
42
42
  }
43
+ .iconButton[data-disclosure] {
44
+ width: auto;
45
+ padding-inline: 7px;
46
+ }
47
+ .iconButton[data-disclosure] .icon {
48
+ display: flex;
49
+ align-items: center;
50
+ gap: 3px;
51
+ }
52
+ .iconButton[data-disclosure][aria-expanded="true"] {
53
+ color: var(--accent-ink, var(--fg));
54
+ background: var(--hover);
55
+ }
@@ -1,83 +1,83 @@
1
- .indicator {
2
- position: relative;
3
- isolation: isolate;
4
- display: flex;
5
- flex-direction: column;
6
- gap: 18px;
7
- align-self: start;
8
- min-width: 0;
9
- }
10
- .group {
11
- display: flex;
12
- flex-direction: column;
13
- gap: 4px;
14
- }
15
- .groupLabel {
16
- font-size: 11px;
17
- color: var(--muted);
18
- padding: 4px 12px 6px;
19
- }
20
- .indicator button {
21
- position: relative;
22
- display: flex;
23
- align-items: center;
24
- gap: 9px;
25
- width: 100%;
26
- text-align: left;
27
- border: 0;
28
- background: transparent;
29
- padding: 10px 12px 10px 16px;
30
- min-height: 38px;
31
- border-radius: 7px;
32
- color: var(--muted);
33
- font-size: 12px;
34
- transition: color var(--motion-hover);
35
- }
36
- .indicator button > span {
37
- overflow: hidden;
38
- text-overflow: ellipsis;
39
- white-space: nowrap;
40
- }
41
- .indicator button:hover:not(:disabled) {
42
- color: var(--fg);
43
- }
44
- .indicator button[aria-current="page"] {
45
- color: var(--navigation-active-color, var(--fg));
46
- }
47
- .indicator button:focus-visible {
48
- outline-offset: -2px;
49
- }
50
- .indicator svg {
51
- width: 15px;
52
- height: 15px;
53
- }
54
- .track {
55
- position: absolute;
56
- z-index: -1;
57
- pointer-events: none;
58
- left: 0;
59
- right: 0;
60
- top: 0;
61
- height: var(--indicator-height, 38px);
62
- transform: translateY(var(--indicator-y, 0px));
63
- opacity: var(--indicator-opacity, 0);
64
- border-radius: 7px;
65
- background: var(--selected);
66
- }
67
- .track::before {
68
- content: "";
69
- position: absolute;
70
- left: 4px;
71
- top: 50%;
72
- height: 14px;
73
- width: 3px;
74
- transform: translateY(-50%);
75
- border-radius: 3px;
76
- background: var(--navigation-indicator-color, var(--accent-ink, var(--accent)));
77
- }
78
- .indicator[data-ready="true"] .track {
79
- transition:
80
- transform var(--motion-segment) var(--ease),
81
- height var(--motion-segment) var(--ease),
82
- opacity var(--motion-hover);
83
- }
1
+ .indicator {
2
+ position: relative;
3
+ isolation: isolate;
4
+ display: flex;
5
+ flex-direction: column;
6
+ gap: 18px;
7
+ align-self: start;
8
+ min-width: 0;
9
+ }
10
+ .group {
11
+ display: flex;
12
+ flex-direction: column;
13
+ gap: 4px;
14
+ }
15
+ .groupLabel {
16
+ font-size: 11px;
17
+ color: var(--muted);
18
+ padding: 4px 12px 6px;
19
+ }
20
+ .indicator button {
21
+ position: relative;
22
+ display: flex;
23
+ align-items: center;
24
+ gap: 9px;
25
+ width: 100%;
26
+ text-align: left;
27
+ border: 0;
28
+ background: transparent;
29
+ padding: 10px 12px 10px 16px;
30
+ min-height: 38px;
31
+ border-radius: 7px;
32
+ color: var(--muted);
33
+ font-size: 12px;
34
+ transition: color var(--motion-hover);
35
+ }
36
+ .indicator button > span {
37
+ overflow: hidden;
38
+ text-overflow: ellipsis;
39
+ white-space: nowrap;
40
+ }
41
+ .indicator button:hover:not(:disabled) {
42
+ color: var(--fg);
43
+ }
44
+ .indicator button[aria-current="page"] {
45
+ color: var(--navigation-active-color, var(--fg));
46
+ }
47
+ .indicator button:focus-visible {
48
+ outline-offset: -2px;
49
+ }
50
+ .indicator svg {
51
+ width: 15px;
52
+ height: 15px;
53
+ }
54
+ .track {
55
+ position: absolute;
56
+ z-index: -1;
57
+ pointer-events: none;
58
+ left: 0;
59
+ right: 0;
60
+ top: 0;
61
+ height: var(--indicator-height, 38px);
62
+ transform: translateY(var(--indicator-y, 0px));
63
+ opacity: var(--indicator-opacity, 0);
64
+ border-radius: 7px;
65
+ background: var(--selected);
66
+ }
67
+ .track::before {
68
+ content: "";
69
+ position: absolute;
70
+ left: 4px;
71
+ top: 50%;
72
+ height: 14px;
73
+ width: 3px;
74
+ transform: translateY(-50%);
75
+ border-radius: 3px;
76
+ background: var(--navigation-indicator-color, var(--accent-ink, var(--accent)));
77
+ }
78
+ .indicator[data-ready="true"] .track {
79
+ transition:
80
+ transform var(--motion-segment) var(--ease),
81
+ height var(--motion-segment) var(--ease),
82
+ opacity var(--motion-hover);
83
+ }
@@ -1,6 +1,7 @@
1
1
  import type { CSSProperties, ElementType, HTMLAttributes, ReactNode, Ref } from "react";
2
2
  type Space = number | "xs" | "sm" | "md" | "lg" | "xl";
3
3
  type LayoutProps = HTMLAttributes<HTMLElement> & {
4
+ ref?: Ref<HTMLElement>;
4
5
  as?: ElementType;
5
6
  to?: string;
6
7
  href?: string;