@robert-stackflow/oneui 0.6.22 → 0.6.24

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 +37 -24
  2. package/README.md +270 -270
  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/CommandPalette.d.ts +7 -1
  11. package/components/CommandPalette.js +22 -8
  12. package/components/ContextMenu.d.ts +3 -1
  13. package/components/ContextMenu.js +25 -4
  14. package/components/ContextMenuPanel.d.ts +2 -1
  15. package/components/ContextMenuPanel.js +3 -2
  16. package/components/ContributionCalendar.module.css +121 -121
  17. package/components/Control.module.css +86 -86
  18. package/components/DataTable.module.css +75 -75
  19. package/components/Dialog.d.ts +2 -1
  20. package/components/Dialog.js +3 -1
  21. package/components/Dialog.module.css +143 -139
  22. package/components/EditableHeading.d.ts +12 -0
  23. package/components/EditableHeading.js +76 -0
  24. package/components/EditableHeading.module.css +16 -0
  25. package/components/HierarchyPicker.module.css +185 -185
  26. package/components/Indicator.module.css +83 -83
  27. package/components/Layout.d.ts +1 -0
  28. package/components/Layout.module.css +82 -82
  29. package/components/Markdown.module.css +227 -227
  30. package/components/MenuItem.module.css +172 -172
  31. package/components/NavBar.module.css +130 -130
  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.d.ts +1 -0
  38. package/components/Segmented.js +6 -3
  39. package/components/Segmented.module.css +90 -85
  40. package/components/SidebarNavigation.js +4 -2
  41. package/components/SidebarNavigation.module.css +7 -2
  42. package/components/Slider.module.css +19 -19
  43. package/components/Steps.module.css +176 -176
  44. package/components/Tab.module.css +148 -148
  45. package/components/Table.module.css +87 -87
  46. package/components/TableOfContents.module.css +252 -252
  47. package/components/ThemePicker.module.css +178 -178
  48. package/components/TimeColumns.module.css +47 -47
  49. package/components/Timeline.module.css +202 -202
  50. package/components/TreeTable.module.css +57 -57
  51. package/components/UptimeChart.module.css +15 -15
  52. package/components/index.d.ts +2 -0
  53. package/components/index.js +2 -0
  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,98 +1,98 @@
1
- .card {
2
- display: flex;
3
- flex-direction: column;
4
- padding: 24px;
5
- color: var(--fg);
6
- text-decoration: none;
7
- transition:
8
- border-color var(--motion-hover),
9
- box-shadow var(--motion-hover);
10
- }
11
- .card:hover {
12
- border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
13
- box-shadow: var(--shadow);
14
- }
15
- .header {
16
- display: flex;
17
- align-items: center;
18
- gap: 12px;
19
- min-width: 0;
20
- }
21
- .icon {
22
- width: 40px;
23
- height: 40px;
24
- flex: none;
25
- border-radius: var(--radius);
26
- display: grid;
27
- place-items: center;
28
- background: var(--selected);
29
- color: var(--accent-ink, var(--accent));
30
- }
31
- .icon svg {
32
- width: 20px;
33
- height: 20px;
34
- }
35
- .heading {
36
- flex: 1;
37
- min-width: 0;
38
- }
39
- .heading h3 {
40
- font-size: 15px;
41
- font-weight: 600;
42
- color: var(--fg);
43
- overflow: hidden;
44
- text-overflow: ellipsis;
45
- white-space: nowrap;
46
- }
47
- .heading p {
48
- font-size: 12px;
49
- color: var(--muted);
50
- margin-top: 3px;
51
- overflow: hidden;
52
- text-overflow: ellipsis;
53
- white-space: nowrap;
54
- }
55
- .description {
56
- font-size: 13px;
57
- line-height: 1.7;
58
- margin: 18px 0 0;
59
- color: var(--muted);
60
- display: -webkit-box;
61
- -webkit-line-clamp: 2;
62
- -webkit-box-orient: vertical;
63
- overflow: hidden;
64
- }
65
- .footer {
66
- display: flex;
67
- align-items: center;
68
- justify-content: space-between;
69
- gap: 12px;
70
- margin-top: auto;
71
- padding-top: 20px;
72
- color: var(--muted);
73
- }
74
- .facts {
75
- display: flex;
76
- align-items: center;
77
- flex-wrap: wrap;
78
- gap: 6px 14px;
79
- font-size: 12px;
80
- }
81
- .facts > span + span {
82
- padding-left: 14px;
83
- border-left: 1px solid var(--line);
84
- }
85
- @media (max-width: 600px) {
86
- .card {
87
- padding: 18px;
88
- }
89
- .header {
90
- gap: 10px;
91
- }
92
- .facts {
93
- gap: 6px 10px;
94
- }
95
- .facts > span + span {
96
- padding-left: 10px;
97
- }
98
- }
1
+ .card {
2
+ display: flex;
3
+ flex-direction: column;
4
+ padding: 24px;
5
+ color: var(--fg);
6
+ text-decoration: none;
7
+ transition:
8
+ border-color var(--motion-hover),
9
+ box-shadow var(--motion-hover);
10
+ }
11
+ .card:hover {
12
+ border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
13
+ box-shadow: var(--shadow);
14
+ }
15
+ .header {
16
+ display: flex;
17
+ align-items: center;
18
+ gap: 12px;
19
+ min-width: 0;
20
+ }
21
+ .icon {
22
+ width: 40px;
23
+ height: 40px;
24
+ flex: none;
25
+ border-radius: var(--radius);
26
+ display: grid;
27
+ place-items: center;
28
+ background: var(--selected);
29
+ color: var(--accent-ink, var(--accent));
30
+ }
31
+ .icon svg {
32
+ width: 20px;
33
+ height: 20px;
34
+ }
35
+ .heading {
36
+ flex: 1;
37
+ min-width: 0;
38
+ }
39
+ .heading h3 {
40
+ font-size: 15px;
41
+ font-weight: 600;
42
+ color: var(--fg);
43
+ overflow: hidden;
44
+ text-overflow: ellipsis;
45
+ white-space: nowrap;
46
+ }
47
+ .heading p {
48
+ font-size: 12px;
49
+ color: var(--muted);
50
+ margin-top: 3px;
51
+ overflow: hidden;
52
+ text-overflow: ellipsis;
53
+ white-space: nowrap;
54
+ }
55
+ .description {
56
+ font-size: 13px;
57
+ line-height: 1.7;
58
+ margin: 18px 0 0;
59
+ color: var(--muted);
60
+ display: -webkit-box;
61
+ -webkit-line-clamp: 2;
62
+ -webkit-box-orient: vertical;
63
+ overflow: hidden;
64
+ }
65
+ .footer {
66
+ display: flex;
67
+ align-items: center;
68
+ justify-content: space-between;
69
+ gap: 12px;
70
+ margin-top: auto;
71
+ padding-top: 20px;
72
+ color: var(--muted);
73
+ }
74
+ .facts {
75
+ display: flex;
76
+ align-items: center;
77
+ flex-wrap: wrap;
78
+ gap: 6px 14px;
79
+ font-size: 12px;
80
+ }
81
+ .facts > span + span {
82
+ padding-left: 14px;
83
+ border-left: 1px solid var(--line);
84
+ }
85
+ @media (max-width: 600px) {
86
+ .card {
87
+ padding: 18px;
88
+ }
89
+ .header {
90
+ gap: 10px;
91
+ }
92
+ .facts {
93
+ gap: 6px 10px;
94
+ }
95
+ .facts > span + span {
96
+ padding-left: 10px;
97
+ }
98
+ }
@@ -6,6 +6,7 @@ export declare function Segmented<T extends string>({ value, onChange, options,
6
6
  value: T;
7
7
  label: ReactNode;
8
8
  textValue?: string;
9
+ count?: number | string;
9
10
  disabled?: boolean;
10
11
  }[];
11
12
  label: string;
@@ -63,7 +63,7 @@ function Segmented({
63
63
  "aria-label": label,
64
64
  children: [
65
65
  /* @__PURE__ */ jsx("span", { className: s.indicator, "aria-hidden": "true", "data-segment-indicator": true }),
66
- options.map((option, index) => /* @__PURE__ */ jsx(
66
+ options.map((option, index) => /* @__PURE__ */ jsxs(
67
67
  "button",
68
68
  {
69
69
  type: "button",
@@ -71,13 +71,16 @@ function Segmented({
71
71
  if (node) buttons.current.set(option.value, node);
72
72
  else buttons.current.delete(option.value);
73
73
  },
74
- "aria-label": option.textValue,
74
+ "aria-label": option.textValue && option.count !== void 0 ? `${option.textValue} ${option.count}` : option.textValue,
75
75
  "aria-pressed": value === option.value,
76
76
  disabled: option.disabled,
77
77
  tabIndex: (options.some((item) => item.value === value && !item.disabled) ? value === option.value : option === options.find((item) => !item.disabled)) ? 0 : -1,
78
78
  onKeyDown: (event) => keyboard(event, index),
79
79
  onClick: () => onChange(option.value),
80
- children: option.label
80
+ children: [
81
+ option.label,
82
+ option.count !== void 0 && /* @__PURE__ */ jsx("span", { className: s.count, children: option.count })
83
+ ]
81
84
  },
82
85
  option.value
83
86
  ))
@@ -1,85 +1,90 @@
1
- .segmented {
2
- position: relative;
3
- isolation: isolate;
4
- display: inline-flex;
5
- width: max-content;
6
- align-self: flex-start;
7
- gap: 3px;
8
- padding: 3px;
9
- background: var(--soft);
10
- border: 1px solid var(--line);
11
- border-radius: calc(var(--radius) - 2px);
12
- }
13
- .indicator {
14
- opacity: var(--segment-opacity, 0);
15
- position: absolute;
16
- left: 0;
17
- top: 0;
18
- width: var(--segment-width, 0px);
19
- height: var(--segment-height, 0px);
20
- transform: translate(var(--segment-x, 0px), var(--segment-y, 0px));
21
- border-radius: calc(var(--radius) - 5px);
22
- background: var(--surface);
23
- box-shadow: 0 1px 3px #0000000d;
24
- pointer-events: none;
25
- z-index: 0;
26
- }
27
- .segmented[data-ready="true"] .indicator {
28
- transition:
29
- transform var(--motion-segment) var(--ease),
30
- width var(--motion-segment) var(--ease),
31
- height var(--motion-segment) var(--ease);
32
- }
33
- .segmented button {
34
- position: relative;
35
- z-index: 1;
36
- display: flex;
37
- align-items: center;
38
- justify-content: center;
39
- gap: 6px;
40
- min-height: 26px;
41
- border: 0;
42
- padding: 4px 12px;
43
- border-radius: calc(var(--radius) - 5px);
44
- background: transparent;
45
- color: var(--muted);
46
- font-size: 12px;
47
- transition:
48
- color var(--motion-hover) var(--ease),
49
- scale var(--motion-press) var(--ease);
50
- }
51
- .segmented button[aria-pressed="true"] {
52
- color: var(--fg);
53
- }
54
- .segmented button:active:not(:disabled) {
55
- scale: 0.97;
56
- }
57
- .segmented {
58
- max-width: 100%;
59
- overflow: auto;
60
- border-radius: var(--segment-radius);
61
- background: var(--segment-background);
62
- }
63
- .segmented button {
64
- min-height: var(--segment-height-min);
65
- font-size: var(--field-font-size);
66
- white-space: nowrap;
67
- cursor: pointer;
68
- }
69
- .segmented button[aria-pressed="true"] {
70
- color: var(--segment-selected-color);
71
- }
72
- .segmented button:disabled {
73
- opacity: 0.45;
74
- cursor: not-allowed;
75
- }
76
- .segmented button svg {
77
- width: 16px;
78
- height: 16px;
79
- }
80
- .segmented button:focus-visible {
81
- outline-offset: -2px;
82
- }
83
-
84
- .segmented[data-full-width] { width: 100%; align-self: stretch; }
85
- .segmented[data-full-width] button { flex: 1; min-width: 0; }
1
+ .segmented {
2
+ position: relative;
3
+ isolation: isolate;
4
+ display: inline-flex;
5
+ width: max-content;
6
+ align-self: flex-start;
7
+ gap: 3px;
8
+ padding: 3px;
9
+ background: var(--soft);
10
+ border: 1px solid var(--line);
11
+ border-radius: calc(var(--radius) - 2px);
12
+ }
13
+ .count {
14
+ font-size: 0.85em;
15
+ font-variant-numeric: tabular-nums;
16
+ opacity: 0.65;
17
+ }
18
+ .indicator {
19
+ opacity: var(--segment-opacity, 0);
20
+ position: absolute;
21
+ left: 0;
22
+ top: 0;
23
+ width: var(--segment-width, 0px);
24
+ height: var(--segment-height, 0px);
25
+ transform: translate(var(--segment-x, 0px), var(--segment-y, 0px));
26
+ border-radius: calc(var(--radius) - 5px);
27
+ background: var(--surface);
28
+ box-shadow: 0 1px 3px #0000000d;
29
+ pointer-events: none;
30
+ z-index: 0;
31
+ }
32
+ .segmented[data-ready="true"] .indicator {
33
+ transition:
34
+ transform var(--motion-segment) var(--ease),
35
+ width var(--motion-segment) var(--ease),
36
+ height var(--motion-segment) var(--ease);
37
+ }
38
+ .segmented button {
39
+ position: relative;
40
+ z-index: 1;
41
+ display: flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ gap: 6px;
45
+ min-height: 26px;
46
+ border: 0;
47
+ padding: 4px 12px;
48
+ border-radius: calc(var(--radius) - 5px);
49
+ background: transparent;
50
+ color: var(--muted);
51
+ font-size: 12px;
52
+ transition:
53
+ color var(--motion-hover) var(--ease),
54
+ scale var(--motion-press) var(--ease);
55
+ }
56
+ .segmented button[aria-pressed="true"] {
57
+ color: var(--fg);
58
+ }
59
+ .segmented button:active:not(:disabled) {
60
+ scale: 0.97;
61
+ }
62
+ .segmented {
63
+ max-width: 100%;
64
+ overflow: auto;
65
+ border-radius: var(--segment-radius);
66
+ background: var(--segment-background);
67
+ }
68
+ .segmented button {
69
+ min-height: var(--segment-height-min);
70
+ font-size: var(--field-font-size);
71
+ white-space: nowrap;
72
+ cursor: pointer;
73
+ }
74
+ .segmented button[aria-pressed="true"] {
75
+ color: var(--segment-selected-color);
76
+ }
77
+ .segmented button:disabled {
78
+ opacity: 0.45;
79
+ cursor: not-allowed;
80
+ }
81
+ .segmented button svg {
82
+ width: 16px;
83
+ height: 16px;
84
+ }
85
+ .segmented button:focus-visible {
86
+ outline-offset: -2px;
87
+ }
88
+
89
+ .segmented[data-full-width] { width: 100%; align-self: stretch; }
90
+ .segmented[data-full-width] button { flex: 1; min-width: 0; }
@@ -91,6 +91,8 @@ function SidebarNavigation({
91
91
  if (!visible || !rect) return;
92
92
  const bounds = node.getBoundingClientRect();
93
93
  node.style.setProperty("--nav-track-y", `${rect.top - bounds.top}px`);
94
+ node.style.setProperty("--nav-track-x", `${rect.left - bounds.left}px`);
95
+ node.style.setProperty("--nav-track-width", `${rect.width}px`);
94
96
  node.style.setProperty("--nav-track-height", `${rect.height}px`);
95
97
  if (!node.dataset.ready) {
96
98
  node.getBoundingClientRect();
@@ -268,7 +270,7 @@ function Branch({
268
270
  className: s.item,
269
271
  "data-navigation-item": true,
270
272
  "data-has-icon": Boolean(item.icon) || void 0,
271
- title: item.label,
273
+ title: compact ? item.label : void 0,
272
274
  disabled: item.disabled,
273
275
  "aria-current": active === item.id ? "page" : void 0,
274
276
  onClick: () => onNavigate(item.path),
@@ -288,7 +290,7 @@ function Branch({
288
290
  "aria-disabled": item.disabled || void 0,
289
291
  tabIndex: item.disabled ? -1 : void 0,
290
292
  "aria-current": active === item.id ? "page" : void 0,
291
- title: item.label,
293
+ title: compact ? item.label : void 0,
292
294
  onClick: (event) => {
293
295
  if (item.disabled) event.preventDefault();
294
296
  else navigate(event, item.path);
@@ -77,6 +77,9 @@
77
77
  .tree:not([data-ready]) .row:has(> .item[aria-current="page"]) {
78
78
  background: var(--selected);
79
79
  }
80
+ .row:has(> .item:active:not(:disabled):not([aria-disabled="true"])) {
81
+ background: var(--selected);
82
+ }
80
83
  .item,
81
84
  .navigationButton {
82
85
  position: relative;
@@ -219,8 +222,8 @@
219
222
  position: absolute;
220
223
  z-index: -1;
221
224
  top: 0;
222
- left: 0;
223
- right: 0;
225
+ left: var(--nav-track-x, 0);
226
+ width: var(--nav-track-width, 100%);
224
227
  height: var(--nav-track-height, 0);
225
228
  border-radius: var(--nav-radius, 8px);
226
229
  background: var(--selected);
@@ -245,6 +248,8 @@
245
248
  }
246
249
  .tree[data-ready] > .track {
247
250
  transition:
251
+ left var(--motion-segment, 240ms) var(--ease),
252
+ width var(--motion-segment, 240ms) var(--ease),
248
253
  transform var(--motion-segment, 240ms) var(--ease),
249
254
  height var(--motion-segment, 240ms) var(--ease),
250
255
  opacity var(--motion-hover, 160ms) var(--ease);
@@ -1,19 +1,19 @@
1
- .field {
2
- display: grid;
3
- gap: 12px;
4
- }
5
- .field label {
6
- display: flex;
7
- justify-content: space-between;
8
- font-size: 12px;
9
- }
10
- .field label span {
11
- color: var(--muted);
12
- font-variant-numeric: tabular-nums;
13
- }
14
- .field input {
15
- width: 100%;
16
- margin: 6px 0;
17
- accent-color: var(--accent-ink, var(--accent));
18
- cursor: pointer;
19
- }
1
+ .field {
2
+ display: grid;
3
+ gap: 12px;
4
+ }
5
+ .field label {
6
+ display: flex;
7
+ justify-content: space-between;
8
+ font-size: 12px;
9
+ }
10
+ .field label span {
11
+ color: var(--muted);
12
+ font-variant-numeric: tabular-nums;
13
+ }
14
+ .field input {
15
+ width: 100%;
16
+ margin: 6px 0;
17
+ accent-color: var(--accent-ink, var(--accent));
18
+ cursor: pointer;
19
+ }