@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,86 +1,86 @@
1
- .surface {
2
- height: var(--control-height);
3
- min-width: 0;
4
- border: 1px solid var(--control-border, var(--line));
5
- border-radius: var(--field-radius);
6
- background: var(--field);
7
- color: var(--fg);
8
- font-size: var(--field-font-size);
9
- line-height: var(--field-line-height);
10
- outline: none;
11
- transition:
12
- border-color var(--motion-hover),
13
- box-shadow var(--motion-hover),
14
- background-color var(--motion-hover);
15
- }
16
- .surface:hover:where(
17
- :not(
18
- :disabled,
19
- [data-disabled="true"],
20
- [aria-disabled="true"],
21
- [readonly],
22
- [aria-readonly="true"],
23
- [data-readonly="true"],
24
- [data-disabled="true"] *,
25
- [aria-disabled="true"] *,
26
- [data-readonly="true"] *,
27
- fieldset:disabled *,
28
- :has(input:disabled, textarea:disabled)
29
- )
30
- ) {
31
- border-color: var(
32
- --field-hover-border,
33
- color-mix(in srgb, var(--fg) var(--field-hover-strength), var(--surface))
34
- );
35
- }
36
- .surface[data-focus="true"],
37
- .surface:focus,
38
- .surface:focus-visible,
39
- .surface:focus-within,
40
- .surface[aria-expanded="true"] {
41
- outline: none;
42
- border-color: var(--field-focus-border);
43
- box-shadow: 0 0 0 var(--field-focus-width)
44
- color-mix(in srgb, var(--accent-ink, var(--accent)) var(--field-focus-strength), transparent);
45
- }
46
- .surface[aria-invalid="true"] {
47
- border-color: var(--danger);
48
- }
49
- .surface[aria-invalid="true"][data-focus="true"],
50
- .surface[aria-invalid="true"]:focus-within {
51
- box-shadow: 0 0 0 var(--field-focus-width)
52
- color-mix(in srgb, var(--danger) var(--field-focus-strength), transparent);
53
- }
54
- .surface:disabled,
55
- .surface[data-disabled="true"] {
56
- opacity: var(--field-disabled-opacity);
57
- cursor: not-allowed;
58
- }
59
- .surface[data-disabled="true"] input:disabled {
60
- opacity: 1;
61
- }
62
- .surface input {
63
- outline: none;
64
- color: inherit;
65
- font-family: inherit;
66
- line-height: inherit;
67
- }
68
- .surface input:focus-visible {
69
- outline: none;
70
- }
71
- .surface::placeholder,
72
- .surface input::placeholder {
73
- color: var(--placeholder);
74
- opacity: 1;
75
- }
76
- .surface[readonly],
77
- .surface[aria-readonly="true"],
78
- .surface:has(input[readonly]) {
79
- background: var(--field-readonly);
80
- }
81
- @media (max-width: 600px) {
82
- .surface:has(input),
83
- .surface:is(input, textarea) {
84
- font-size: 16px;
85
- }
86
- }
1
+ .surface {
2
+ height: var(--control-height);
3
+ min-width: 0;
4
+ border: 1px solid var(--control-border, var(--line));
5
+ border-radius: var(--field-radius);
6
+ background: var(--field);
7
+ color: var(--fg);
8
+ font-size: var(--field-font-size);
9
+ line-height: var(--field-line-height);
10
+ outline: none;
11
+ transition:
12
+ border-color var(--motion-hover),
13
+ box-shadow var(--motion-hover),
14
+ background-color var(--motion-hover);
15
+ }
16
+ .surface:hover:where(
17
+ :not(
18
+ :disabled,
19
+ [data-disabled="true"],
20
+ [aria-disabled="true"],
21
+ [readonly],
22
+ [aria-readonly="true"],
23
+ [data-readonly="true"],
24
+ [data-disabled="true"] *,
25
+ [aria-disabled="true"] *,
26
+ [data-readonly="true"] *,
27
+ fieldset:disabled *,
28
+ :has(input:disabled, textarea:disabled)
29
+ )
30
+ ) {
31
+ border-color: var(
32
+ --field-hover-border,
33
+ color-mix(in srgb, var(--fg) var(--field-hover-strength), var(--surface))
34
+ );
35
+ }
36
+ .surface[data-focus="true"],
37
+ .surface:focus,
38
+ .surface:focus-visible,
39
+ .surface:focus-within,
40
+ .surface[aria-expanded="true"] {
41
+ outline: none;
42
+ border-color: var(--field-focus-border);
43
+ box-shadow: 0 0 0 var(--field-focus-width)
44
+ color-mix(in srgb, var(--accent-ink, var(--accent)) var(--field-focus-strength), transparent);
45
+ }
46
+ .surface[aria-invalid="true"] {
47
+ border-color: var(--danger);
48
+ }
49
+ .surface[aria-invalid="true"][data-focus="true"],
50
+ .surface[aria-invalid="true"]:focus-within {
51
+ box-shadow: 0 0 0 var(--field-focus-width)
52
+ color-mix(in srgb, var(--danger) var(--field-focus-strength), transparent);
53
+ }
54
+ .surface:disabled,
55
+ .surface[data-disabled="true"] {
56
+ opacity: var(--field-disabled-opacity);
57
+ cursor: not-allowed;
58
+ }
59
+ .surface[data-disabled="true"] input:disabled {
60
+ opacity: 1;
61
+ }
62
+ .surface input {
63
+ outline: none;
64
+ color: inherit;
65
+ font-family: inherit;
66
+ line-height: inherit;
67
+ }
68
+ .surface input:focus-visible {
69
+ outline: none;
70
+ }
71
+ .surface::placeholder,
72
+ .surface input::placeholder {
73
+ color: var(--placeholder);
74
+ opacity: 1;
75
+ }
76
+ .surface[readonly],
77
+ .surface[aria-readonly="true"],
78
+ .surface:has(input[readonly]) {
79
+ background: var(--field-readonly);
80
+ }
81
+ @media (max-width: 600px) {
82
+ .surface:has(input),
83
+ .surface:is(input, textarea) {
84
+ font-size: 16px;
85
+ }
86
+ }
@@ -1,75 +1,75 @@
1
- .container {
2
- min-width: 0;
3
- }
4
- .toolbar {
5
- display: flex;
6
- justify-content: flex-end;
7
- align-items: center;
8
- gap: 8px;
9
- flex-wrap: wrap;
10
- margin-bottom: 12px;
11
- }
12
- .columnMenu {
13
- display: flex;
14
- flex-direction: column;
15
- }
16
- .scroll {
17
- composes: scroll from "./Table.module.css";
18
- }
19
- .table {
20
- composes: table from "./Table.module.css";
21
- }
22
- .heading {
23
- display: flex;
24
- align-items: center;
25
- justify-content: space-between;
26
- gap: 8px;
27
- }
28
- .sort,
29
- .filter {
30
- display: inline-flex;
31
- align-items: center;
32
- gap: 7px;
33
- border: 0;
34
- background: transparent;
35
- padding: 4px;
36
- border-radius: 5px;
37
- color: inherit;
38
- }
39
- .sort:hover,
40
- .filter:hover {
41
- background: var(--hover);
42
- color: var(--fg);
43
- }
44
- .sort svg,
45
- .filter svg {
46
- width: 14px;
47
- height: 14px;
48
- }
49
- .filter[data-active="true"] {
50
- color: var(--accent-ink, var(--accent));
51
- background: var(--selected);
52
- }
53
- .filterPanel {
54
- max-height: 300px;
55
- overflow: auto;
56
- }
57
- .selection {
58
- width: 44px;
59
- }
60
- .selection label > span:last-child {
61
- position: absolute;
62
- width: 1px;
63
- height: 1px;
64
- overflow: hidden;
65
- clip-path: inset(50%);
66
- }
67
-
68
- .filterReset {
69
- display: flex;
70
- justify-content: flex-end;
71
- margin-top: 6px;
72
- padding-top: 6px;
73
- border-top: var(--separator-width) var(--separator-style)
74
- var(--separator-color);
75
- }
1
+ .container {
2
+ min-width: 0;
3
+ }
4
+ .toolbar {
5
+ display: flex;
6
+ justify-content: flex-end;
7
+ align-items: center;
8
+ gap: 8px;
9
+ flex-wrap: wrap;
10
+ margin-bottom: 12px;
11
+ }
12
+ .columnMenu {
13
+ display: flex;
14
+ flex-direction: column;
15
+ }
16
+ .scroll {
17
+ composes: scroll from "./Table.module.css";
18
+ }
19
+ .table {
20
+ composes: table from "./Table.module.css";
21
+ }
22
+ .heading {
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: space-between;
26
+ gap: 8px;
27
+ }
28
+ .sort,
29
+ .filter {
30
+ display: inline-flex;
31
+ align-items: center;
32
+ gap: 7px;
33
+ border: 0;
34
+ background: transparent;
35
+ padding: 4px;
36
+ border-radius: 5px;
37
+ color: inherit;
38
+ }
39
+ .sort:hover,
40
+ .filter:hover {
41
+ background: var(--hover);
42
+ color: var(--fg);
43
+ }
44
+ .sort svg,
45
+ .filter svg {
46
+ width: 14px;
47
+ height: 14px;
48
+ }
49
+ .filter[data-active="true"] {
50
+ color: var(--accent-ink, var(--accent));
51
+ background: var(--selected);
52
+ }
53
+ .filterPanel {
54
+ max-height: 300px;
55
+ overflow: auto;
56
+ }
57
+ .selection {
58
+ width: 44px;
59
+ }
60
+ .selection label > span:last-child {
61
+ position: absolute;
62
+ width: 1px;
63
+ height: 1px;
64
+ overflow: hidden;
65
+ clip-path: inset(50%);
66
+ }
67
+
68
+ .filterReset {
69
+ display: flex;
70
+ justify-content: flex-end;
71
+ margin-top: 6px;
72
+ padding-top: 6px;
73
+ border-top: var(--separator-width) var(--separator-style)
74
+ var(--separator-color);
75
+ }
@@ -1,6 +1,7 @@
1
1
  import { type ReactNode, type RefObject } from "react";
2
- export declare function Dialog({ open: requestedOpen, onClose, title, children, footer, wide, size, role, descriptionId, busy, variant, headerIcon, tone, initialFocus, onAfterClose, className, returnFocus, fallbackFocus, portalContainer, closeLabel, }: {
2
+ export declare function Dialog({ open: requestedOpen, onClose, title, children, footer, wide, size, role, descriptionId, busy, variant, headerIcon, tone, initialFocus, onAfterClose, className, returnFocus, fallbackFocus, portalContainer, closeLabel, placement, }: {
3
3
  open: boolean;
4
+ placement?: "center" | "top";
4
5
  onClose(): void;
5
6
  title: ReactNode;
6
7
  children: ReactNode;
@@ -41,7 +41,8 @@ function Dialog({
41
41
  returnFocus,
42
42
  fallbackFocus,
43
43
  portalContainer,
44
- closeLabel = "\u5173\u95ED\u5F39\u7A97"
44
+ closeLabel = "\u5173\u95ED\u5F39\u7A97",
45
+ placement = "center"
45
46
  }) {
46
47
  const defaultRoot = usePortalRoot();
47
48
  const portalRoot = portalContainer ?? defaultRoot;
@@ -119,6 +120,7 @@ function Dialog({
119
120
  "aria-busy": busy || void 0,
120
121
  role,
121
122
  "data-variant": variant,
123
+ "data-placement": placement,
122
124
  "data-tone": content.tone,
123
125
  "data-header-icon": !!content.headerIcon,
124
126
  className: `${s.dialog} ${className} ${wide || size === "large" ? s.wide : ""} ${size === "small" ? s.small : ""} ${closing ? s.closing : ""}`,
@@ -1,139 +1,143 @@
1
- .dialog {
2
- width: min(var(--dialog-width), calc(100vw - 32px));
3
- max-height: calc(100dvh - var(--dialog-inset));
4
- padding: 0;
5
- color: var(--fg);
6
- background: var(--surface);
7
- border: 1px solid var(--line);
8
- border-radius: calc(var(--radius) + 3px);
9
- box-shadow: var(--shadow-dialog);
10
- overflow: auto;
11
- }
12
-
13
- .dialog::backdrop {
14
- background: var(--overlay);
15
- backdrop-filter: blur(3px);
16
- animation: fade-in var(--popup-enter);
17
- }
18
- .dialogHeader {
19
- display: flex;
20
- align-items: flex-start;
21
- justify-content: space-between;
22
- gap: 16px;
23
- padding: 24px 24px 20px;
24
- }
25
- .dialogHeading {
26
- display: flex;
27
- align-items: center;
28
- gap: 14px;
29
- min-width: 0;
30
- }
31
- .dialogHeading h2 {
32
- min-width: 0;
33
- overflow-wrap: anywhere;
34
- font-size: 18px;
35
- font-weight: 600;
36
- line-height: 1.5;
37
- }
38
- .dialogHeader > button {
39
- flex-shrink: 0;
40
- margin-top: -3px;
41
- margin-right: -6px;
42
- color: var(--muted);
43
- }
44
- .dialogIcon {
45
- display: inline-flex;
46
- align-items: center;
47
- justify-content: center;
48
- flex: 0 0 21px;
49
- width: 21px;
50
- height: 25px;
51
- color: var(--dialog-tone, var(--accent-ink, var(--accent)));
52
- }
53
- .dialogIcon > svg {
54
- width: 21px;
55
- height: 21px;
56
- stroke-width: 1.7;
57
- }
58
- .dialog[data-tone="info"] {
59
- --dialog-tone: var(--accent-ink, var(--accent));
60
- }
61
- .dialog[data-tone="success"] {
62
- --dialog-tone: var(--success);
63
- }
64
- .dialog[data-tone="warning"] {
65
- --dialog-tone: var(--warning);
66
- }
67
- .dialog[data-tone="danger"] {
68
- --dialog-tone: var(--danger);
69
- }
70
- .dialogBody {
71
- padding: 0 24px 24px;
72
- }
73
- .dialogBody > p {
74
- color: var(--muted);
75
- font-size: 12px;
76
- line-height: 1.8;
77
- }
78
- .dialogFooter {
79
- flex-wrap: wrap;
80
- display: flex;
81
- justify-content: flex-end;
82
- gap: 8px;
83
- padding: 14px 24px;
84
- border-top: var(--separator-width) var(--separator-style)
85
- var(--separator-color);
86
- background: var(--canvas);
87
- }
88
- .wide {
89
- width: min(var(--dialog-wide-width), calc(100vw - 32px));
90
- }
91
- .small {
92
- width: min(420px, calc(100vw - 32px));
93
- }
94
- .dialog:is([data-variant="message"], [data-variant="confirm"]) .dialogHeader {
95
- padding: 22px 24px 12px;
96
- }
97
- .dialog:is([data-variant="message"], [data-variant="confirm"]) .dialogHeading {
98
- gap: 10px;
99
- }
100
- .dialog:is([data-variant="message"], [data-variant="confirm"])
101
- .dialogHeader
102
- h2 {
103
- font-size: 17px;
104
- }
105
- .dialog:is([data-variant="message"], [data-variant="confirm"]) .dialogBody {
106
- padding: 0 24px 24px;
107
- }
108
- .closing {
109
- pointer-events: none;
110
- }
111
- .dialog.closing::backdrop {
112
- background: transparent;
113
- backdrop-filter: blur(0);
114
- transition:
115
- background var(--popup-exit),
116
- backdrop-filter var(--popup-exit);
117
- }
118
-
119
- @media (max-width: 600px) {
120
- .dialog {
121
- max-height: calc(100dvh - 24px);
122
- }
123
- .dialogBody {
124
- padding: 0 20px 20px;
125
- }
126
- .dialogHeader,
127
- .dialogFooter {
128
- padding: 18px 20px;
129
- }
130
- }
131
-
132
- @keyframes fade-in {
133
- from {
134
- opacity: 0;
135
- }
136
- to {
137
- opacity: 1;
138
- }
139
- }
1
+ .dialog {
2
+ width: min(var(--dialog-width), calc(100vw - 32px));
3
+ max-height: calc(100dvh - var(--dialog-inset));
4
+ padding: 0;
5
+ color: var(--fg);
6
+ background: var(--surface);
7
+ border: 1px solid var(--line);
8
+ border-radius: calc(var(--radius) + 3px);
9
+ box-shadow: var(--shadow-dialog);
10
+ overflow: auto;
11
+ }
12
+
13
+ .dialog::backdrop {
14
+ background: var(--overlay);
15
+ backdrop-filter: blur(3px);
16
+ animation: fade-in var(--popup-enter);
17
+ }
18
+ .dialog[data-placement="top"] {
19
+ margin-top: min(10dvh, 96px);
20
+ margin-bottom: auto;
21
+ }
22
+ .dialogHeader {
23
+ display: flex;
24
+ align-items: flex-start;
25
+ justify-content: space-between;
26
+ gap: 16px;
27
+ padding: 24px 24px 20px;
28
+ }
29
+ .dialogHeading {
30
+ display: flex;
31
+ align-items: center;
32
+ gap: 14px;
33
+ min-width: 0;
34
+ }
35
+ .dialogHeading h2 {
36
+ min-width: 0;
37
+ overflow-wrap: anywhere;
38
+ font-size: 18px;
39
+ font-weight: 600;
40
+ line-height: 1.5;
41
+ }
42
+ .dialogHeader > button {
43
+ flex-shrink: 0;
44
+ margin-top: -3px;
45
+ margin-right: -6px;
46
+ color: var(--muted);
47
+ }
48
+ .dialogIcon {
49
+ display: inline-flex;
50
+ align-items: center;
51
+ justify-content: center;
52
+ flex: 0 0 21px;
53
+ width: 21px;
54
+ height: 25px;
55
+ color: var(--dialog-tone, var(--accent-ink, var(--accent)));
56
+ }
57
+ .dialogIcon > svg {
58
+ width: 21px;
59
+ height: 21px;
60
+ stroke-width: 1.7;
61
+ }
62
+ .dialog[data-tone="info"] {
63
+ --dialog-tone: var(--accent-ink, var(--accent));
64
+ }
65
+ .dialog[data-tone="success"] {
66
+ --dialog-tone: var(--success);
67
+ }
68
+ .dialog[data-tone="warning"] {
69
+ --dialog-tone: var(--warning);
70
+ }
71
+ .dialog[data-tone="danger"] {
72
+ --dialog-tone: var(--danger);
73
+ }
74
+ .dialogBody {
75
+ padding: 0 24px 24px;
76
+ }
77
+ .dialogBody > p {
78
+ color: var(--muted);
79
+ font-size: 12px;
80
+ line-height: 1.8;
81
+ }
82
+ .dialogFooter {
83
+ flex-wrap: wrap;
84
+ display: flex;
85
+ justify-content: flex-end;
86
+ gap: 8px;
87
+ padding: 14px 24px;
88
+ border-top: var(--separator-width) var(--separator-style)
89
+ var(--separator-color);
90
+ background: var(--canvas);
91
+ }
92
+ .wide {
93
+ width: min(var(--dialog-wide-width), calc(100vw - 32px));
94
+ }
95
+ .small {
96
+ width: min(420px, calc(100vw - 32px));
97
+ }
98
+ .dialog:is([data-variant="message"], [data-variant="confirm"]) .dialogHeader {
99
+ padding: 22px 24px 12px;
100
+ }
101
+ .dialog:is([data-variant="message"], [data-variant="confirm"]) .dialogHeading {
102
+ gap: 10px;
103
+ }
104
+ .dialog:is([data-variant="message"], [data-variant="confirm"])
105
+ .dialogHeader
106
+ h2 {
107
+ font-size: 17px;
108
+ }
109
+ .dialog:is([data-variant="message"], [data-variant="confirm"]) .dialogBody {
110
+ padding: 0 24px 24px;
111
+ }
112
+ .closing {
113
+ pointer-events: none;
114
+ }
115
+ .dialog.closing::backdrop {
116
+ background: transparent;
117
+ backdrop-filter: blur(0);
118
+ transition:
119
+ background var(--popup-exit),
120
+ backdrop-filter var(--popup-exit);
121
+ }
122
+
123
+ @media (max-width: 600px) {
124
+ .dialog {
125
+ max-height: calc(100dvh - 24px);
126
+ }
127
+ .dialogBody {
128
+ padding: 0 20px 20px;
129
+ }
130
+ .dialogHeader,
131
+ .dialogFooter {
132
+ padding: 18px 20px;
133
+ }
134
+ }
135
+
136
+ @keyframes fade-in {
137
+ from {
138
+ opacity: 0;
139
+ }
140
+ to {
141
+ opacity: 1;
142
+ }
143
+ }
@@ -0,0 +1,12 @@
1
+ export type EditableHeadingProps = {
2
+ value: string;
3
+ onChange(value: string): void;
4
+ label: string;
5
+ placeholder?: string;
6
+ readOnly?: boolean;
7
+ maxLength?: number;
8
+ order?: 1 | 2 | 3 | 4 | 5 | 6;
9
+ fz?: number;
10
+ };
11
+ /** A plain-text heading edited directly, without replacing it with a form field. */
12
+ export declare function EditableHeading({ value, onChange, label, placeholder, readOnly, maxLength, order, fz, }: EditableHeadingProps): import("react").JSX.Element;