@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,95 +1,95 @@
1
- .checkbox {
2
- display: inline-flex;
3
- align-items: center;
4
- gap: 9px;
5
- cursor: pointer;
6
- position: relative;
7
- user-select: none;
8
- }
9
- .checkbox input[type="checkbox"] {
10
- position: absolute;
11
- left: 0;
12
- width: 18px;
13
- height: 18px;
14
- margin: 0;
15
- opacity: 0;
16
- }
17
- .checkMark {
18
- width: 18px;
19
- height: 18px;
20
- flex-shrink: 0;
21
- border: 1px solid color-mix(in srgb, var(--fg) 25%, var(--surface));
22
- border-radius: 5px;
23
- background: var(--field);
24
- display: grid;
25
- place-items: center;
26
- pointer-events: none;
27
- transition:
28
- background-color var(--motion-hover),
29
- border-color var(--motion-hover),
30
- box-shadow var(--motion-hover),
31
- transform var(--motion-press);
32
- }
33
- .checkMark svg {
34
- width: 16px;
35
- height: 16px;
36
- fill: none;
37
- stroke: currentColor;
38
- stroke-width: 1.8;
39
- stroke-linecap: round;
40
- stroke-linejoin: round;
41
- }
42
- .checkMark path {
43
- stroke-dasharray: 1;
44
- stroke-dashoffset: 1;
45
- opacity: 0;
46
- transition:
47
- stroke-dashoffset var(--motion-panel) var(--ease),
48
- opacity var(--motion-hover);
49
- }
50
- .checkbox:hover input:not(:disabled) + .checkMark {
51
- border-color: var(--muted);
52
- }
53
- .checkbox:active input:not(:disabled) + .checkMark {
54
- transform: scale(0.92);
55
- }
56
- .checkbox input:checked + .checkMark {
57
- background: var(--accent-fill, var(--accent));
58
- color: var(--on-accent-fill, var(--on-accent));
59
- border-color: var(--accent-fill, var(--accent));
60
- }
61
- .checkbox input:checked + .checkMark path {
62
- stroke-dashoffset: 0;
63
- opacity: 1;
64
- }
65
- .checkbox input:focus-visible + .checkMark {
66
- box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-ink, var(--accent)) 14%, transparent);
67
- border-color: var(--accent-ink, var(--accent));
68
- }
69
- .checkbox[data-disabled="true"] {
70
- cursor: not-allowed;
71
- }
72
- .checkbox input:disabled ~ span {
73
- opacity: 0.4;
74
- }
75
-
76
- .checkbox[data-indeterminate="true"] .checkMark {
77
- background: var(--accent);
78
- border-color: var(--accent);
79
- color: var(--on-accent);
80
- }
81
- .checkbox[data-indeterminate="true"] .checkMark svg {
82
- opacity: 1;
83
- transform: scale(1);
84
- }
85
- .checkbox[data-indeterminate="true"] .checkMark path {
86
- stroke-dashoffset: 0;
87
- opacity: 1;
88
- }
89
-
90
- .checkbox input[aria-invalid="true"] + .checkMark {
91
- border-color: var(--danger);
92
- }
93
- .checkbox input[aria-invalid="true"]:focus-visible + .checkMark {
94
- box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 12%, transparent);
95
- }
1
+ .checkbox {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ gap: 9px;
5
+ cursor: pointer;
6
+ position: relative;
7
+ user-select: none;
8
+ }
9
+ .checkbox input[type="checkbox"] {
10
+ position: absolute;
11
+ left: 0;
12
+ width: 18px;
13
+ height: 18px;
14
+ margin: 0;
15
+ opacity: 0;
16
+ }
17
+ .checkMark {
18
+ width: 18px;
19
+ height: 18px;
20
+ flex-shrink: 0;
21
+ border: 1px solid color-mix(in srgb, var(--fg) 25%, var(--surface));
22
+ border-radius: 5px;
23
+ background: var(--field);
24
+ display: grid;
25
+ place-items: center;
26
+ pointer-events: none;
27
+ transition:
28
+ background-color var(--motion-hover),
29
+ border-color var(--motion-hover),
30
+ box-shadow var(--motion-hover),
31
+ transform var(--motion-press);
32
+ }
33
+ .checkMark svg {
34
+ width: 16px;
35
+ height: 16px;
36
+ fill: none;
37
+ stroke: currentColor;
38
+ stroke-width: 1.8;
39
+ stroke-linecap: round;
40
+ stroke-linejoin: round;
41
+ }
42
+ .checkMark path {
43
+ stroke-dasharray: 1;
44
+ stroke-dashoffset: 1;
45
+ opacity: 0;
46
+ transition:
47
+ stroke-dashoffset var(--motion-panel) var(--ease),
48
+ opacity var(--motion-hover);
49
+ }
50
+ .checkbox:hover input:not(:disabled) + .checkMark {
51
+ border-color: var(--muted);
52
+ }
53
+ .checkbox:active input:not(:disabled) + .checkMark {
54
+ transform: scale(0.92);
55
+ }
56
+ .checkbox input:checked + .checkMark {
57
+ background: var(--accent-fill, var(--accent));
58
+ color: var(--on-accent-fill, var(--on-accent));
59
+ border-color: var(--accent-fill, var(--accent));
60
+ }
61
+ .checkbox input:checked + .checkMark path {
62
+ stroke-dashoffset: 0;
63
+ opacity: 1;
64
+ }
65
+ .checkbox input:focus-visible + .checkMark {
66
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-ink, var(--accent)) 14%, transparent);
67
+ border-color: var(--accent-ink, var(--accent));
68
+ }
69
+ .checkbox[data-disabled="true"] {
70
+ cursor: not-allowed;
71
+ }
72
+ .checkbox input:disabled ~ span {
73
+ opacity: 0.4;
74
+ }
75
+
76
+ .checkbox[data-indeterminate="true"] .checkMark {
77
+ background: var(--accent);
78
+ border-color: var(--accent);
79
+ color: var(--on-accent);
80
+ }
81
+ .checkbox[data-indeterminate="true"] .checkMark svg {
82
+ opacity: 1;
83
+ transform: scale(1);
84
+ }
85
+ .checkbox[data-indeterminate="true"] .checkMark path {
86
+ stroke-dashoffset: 0;
87
+ opacity: 1;
88
+ }
89
+
90
+ .checkbox input[aria-invalid="true"] + .checkMark {
91
+ border-color: var(--danger);
92
+ }
93
+ .checkbox input[aria-invalid="true"]:focus-visible + .checkMark {
94
+ box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 12%, transparent);
95
+ }
@@ -1,9 +1,11 @@
1
1
  import { type ReactNode } from "react";
2
2
  import type { ContextMenuItem } from "./menuTypes";
3
- export declare function ContextMenu({ items, children, label, disabled: requestedDisabled, onOpenChange, }: {
3
+ export declare function ContextMenu({ items, children, label, disabled: requestedDisabled, onOpenChange, triggerMode, }: {
4
4
  items: ContextMenuItem[];
5
5
  children: ReactNode;
6
6
  label?: string;
7
7
  disabled?: boolean;
8
8
  onOpenChange?(open: boolean): void;
9
+ /** Click mode supports an ordinary button trigger with the same nested menu behavior. */
10
+ triggerMode?: "context" | "click";
9
11
  }): import("react").JSX.Element;
@@ -20,9 +20,12 @@ function ContextMenu({
20
20
  children,
21
21
  label = "\u53F3\u952E\u83DC\u5355\u533A\u57DF",
22
22
  disabled: requestedDisabled = false,
23
- onOpenChange
23
+ onOpenChange,
24
+ triggerMode = "context"
24
25
  }) {
25
- const owner = useSurfacePortal(), portalHost = owner?.host || document.body, disabled = requestedDisabled || owner?.active === false;
26
+ const [hydrated, setHydrated] = useState(false);
27
+ useEffect(() => setHydrated(true), []);
28
+ const owner = useSurfacePortal(), portalHost = hydrated ? owner?.host || document.body : null, disabled = requestedDisabled || owner?.active === false;
26
29
  const host = useRef(null), root = useRef(null), restore = useRef(null), hover = useRef(void 0), searchTimer = useRef(void 0), search = useRef(""), pointerHistory = useRef([]), hoverCandidate = useRef(void 0), revision = useRef(0), desired = useRef(false), callback = useRef(onOpenChange);
27
30
  callback.current = onOpenChange;
28
31
  const [open, setOpen] = useState(false), [point, setPoint] = useState({ x: 0, y: 0 }), [path, setPath] = useState([]), [focusLevel, setFocusLevel] = useState(null), [busy, setBusy] = useState(), [error, setError] = useState("");
@@ -63,6 +66,7 @@ function ContextMenu({
63
66
  };
64
67
  useLayoutEffect(() => {
65
68
  const node = root.current;
69
+ if (!node) return;
66
70
  cancelMotion(node);
67
71
  node.style.opacity = "1";
68
72
  node.style.translate = "0 0";
@@ -151,6 +155,7 @@ function ContextMenu({
151
155
  const { layers, exited } = useMenuLayers(levels);
152
156
  useLayoutEffect(() => {
153
157
  const node = root.current;
158
+ if (!node) return;
154
159
  if (!open && !layers.length && node.matches(":popover-open"))
155
160
  node.hidePopover();
156
161
  }, [open, layers.length]);
@@ -296,7 +301,16 @@ function ContextMenu({
296
301
  className: s.host,
297
302
  role: "group",
298
303
  "aria-label": label,
299
- tabIndex: disabled ? void 0 : 0,
304
+ tabIndex: disabled || triggerMode === "click" ? void 0 : 0,
305
+ onClick: triggerMode === "click" ? (e) => {
306
+ if (disabled) return;
307
+ if (open) {
308
+ close();
309
+ return;
310
+ }
311
+ const rect = e.currentTarget.getBoundingClientRect();
312
+ show(rect.left, rect.bottom + 6);
313
+ } : void 0,
300
314
  onContextMenu: (e) => {
301
315
  if (disabled) return;
302
316
  e.preventDefault();
@@ -305,6 +319,12 @@ function ContextMenu({
305
319
  show(e.clientX, e.clientY);
306
320
  },
307
321
  onKeyDown: (e) => {
322
+ if (triggerMode === "click" && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
323
+ e.preventDefault();
324
+ const rect = e.currentTarget.getBoundingClientRect();
325
+ show(rect.left, rect.bottom + 6);
326
+ return;
327
+ }
308
328
  if (e.key === "ContextMenu" || e.shiftKey && e.key === "F10") {
309
329
  e.preventDefault();
310
330
  const rect = e.currentTarget.getBoundingClientRect();
@@ -314,7 +334,7 @@ function ContextMenu({
314
334
  children
315
335
  }
316
336
  ),
317
- createPortal(
337
+ portalHost && createPortal(
318
338
  /* @__PURE__ */ jsx(
319
339
  "div",
320
340
  {
@@ -1,121 +1,121 @@
1
- .calendar {
2
- container-type: inline-size;
3
- --calendar-cell: 13px;
4
- --calendar-gap: 3px;
5
- min-width: 0;
6
- border: 1px solid var(--line);
7
- border-radius: var(--radius);
8
- padding: 20px;
9
- background: var(--surface);
10
- }
11
- .header,
12
- .footer {
13
- display: flex;
14
- align-items: center;
15
- justify-content: space-between;
16
- gap: 14px;
17
- }
18
- .header {
19
- margin-bottom: 16px;
20
- }
21
- .header > span,
22
- .footer {
23
- font-size: 11px;
24
- color: var(--muted);
25
- }
26
- .scroll {
27
- --calendar-cell: clamp(
28
- 9px,
29
- calc((100cqw - 32px) / var(--calendar-weeks) - var(--calendar-gap)),
30
- 13px
31
- );
32
- overflow: auto;
33
- padding: 3px 2px 6px;
34
- }
35
- .months,
36
- .row {
37
- display: grid;
38
- column-gap: var(--calendar-gap);
39
- width: max-content;
40
- align-items: center;
41
- }
42
- .months {
43
- height: 22px;
44
- font-size: 10px;
45
- color: var(--muted);
46
- }
47
- .months > span {
48
- grid-row: 1;
49
- white-space: nowrap;
50
- }
51
- .row {
52
- height: calc(var(--calendar-cell) + var(--calendar-gap));
53
- }
54
- .weekday {
55
- font-size: 10px;
56
- color: var(--muted);
57
- }
58
- .day,
59
- .pad {
60
- width: var(--calendar-cell);
61
- height: var(--calendar-cell);
62
- }
63
- .day {
64
- display: block;
65
- padding: 0;
66
- border: 1px solid color-mix(in srgb, var(--fg) 6%, transparent);
67
- border-radius: 3px;
68
- background: color-mix(in srgb, var(--fg) 8%, var(--surface));
69
- transition:
70
- transform var(--motion-press),
71
- box-shadow var(--motion-hover);
72
- }
73
- .day[data-level="1"] {
74
- background: color-mix(in srgb, var(--calendar-color) 25%, var(--surface));
75
- }
76
- .day[data-level="2"] {
77
- background: color-mix(in srgb, var(--calendar-color) 45%, var(--surface));
78
- }
79
- .day[data-level="3"] {
80
- background: color-mix(in srgb, var(--calendar-color) 70%, var(--surface));
81
- }
82
- .day[data-level="4"] {
83
- background: var(--calendar-color);
84
- }
85
- .day[data-future="true"] {
86
- opacity: 0.3;
87
- cursor: default;
88
- }
89
- .day[data-missing="true"] {
90
- background: repeating-linear-gradient(
91
- 135deg,
92
- transparent,
93
- transparent 2px,
94
- color-mix(in srgb, var(--fg) 12%, var(--surface)) 2px,
95
- color-mix(in srgb, var(--fg) 12%, var(--surface)) 3px
96
- );
97
- }
98
- .day:hover:not([data-future="true"]) {
99
- transform: scale(1.12);
100
- }
101
- .day:focus-visible,
102
- .day[aria-selected="true"] {
103
- outline: 2px solid var(--accent-ink, var(--accent));
104
- outline-offset: 1px;
105
- }
106
- .footer {
107
- margin-top: 12px;
108
- min-height: 18px;
109
- }
110
- .legend {
111
- display: flex;
112
- align-items: center;
113
- gap: 4px;
114
- margin-left: auto;
115
- }
116
- .legend > span {
117
- margin: 0 3px;
118
- }
119
- .legend .day {
120
- cursor: default;
121
- }
1
+ .calendar {
2
+ container-type: inline-size;
3
+ --calendar-cell: 13px;
4
+ --calendar-gap: 3px;
5
+ min-width: 0;
6
+ border: 1px solid var(--line);
7
+ border-radius: var(--radius);
8
+ padding: 20px;
9
+ background: var(--surface);
10
+ }
11
+ .header,
12
+ .footer {
13
+ display: flex;
14
+ align-items: center;
15
+ justify-content: space-between;
16
+ gap: 14px;
17
+ }
18
+ .header {
19
+ margin-bottom: 16px;
20
+ }
21
+ .header > span,
22
+ .footer {
23
+ font-size: 11px;
24
+ color: var(--muted);
25
+ }
26
+ .scroll {
27
+ --calendar-cell: clamp(
28
+ 9px,
29
+ calc((100cqw - 32px) / var(--calendar-weeks) - var(--calendar-gap)),
30
+ 13px
31
+ );
32
+ overflow: auto;
33
+ padding: 3px 2px 6px;
34
+ }
35
+ .months,
36
+ .row {
37
+ display: grid;
38
+ column-gap: var(--calendar-gap);
39
+ width: max-content;
40
+ align-items: center;
41
+ }
42
+ .months {
43
+ height: 22px;
44
+ font-size: 10px;
45
+ color: var(--muted);
46
+ }
47
+ .months > span {
48
+ grid-row: 1;
49
+ white-space: nowrap;
50
+ }
51
+ .row {
52
+ height: calc(var(--calendar-cell) + var(--calendar-gap));
53
+ }
54
+ .weekday {
55
+ font-size: 10px;
56
+ color: var(--muted);
57
+ }
58
+ .day,
59
+ .pad {
60
+ width: var(--calendar-cell);
61
+ height: var(--calendar-cell);
62
+ }
63
+ .day {
64
+ display: block;
65
+ padding: 0;
66
+ border: 1px solid color-mix(in srgb, var(--fg) 6%, transparent);
67
+ border-radius: 3px;
68
+ background: color-mix(in srgb, var(--fg) 8%, var(--surface));
69
+ transition:
70
+ transform var(--motion-press),
71
+ box-shadow var(--motion-hover);
72
+ }
73
+ .day[data-level="1"] {
74
+ background: color-mix(in srgb, var(--calendar-color) 25%, var(--surface));
75
+ }
76
+ .day[data-level="2"] {
77
+ background: color-mix(in srgb, var(--calendar-color) 45%, var(--surface));
78
+ }
79
+ .day[data-level="3"] {
80
+ background: color-mix(in srgb, var(--calendar-color) 70%, var(--surface));
81
+ }
82
+ .day[data-level="4"] {
83
+ background: var(--calendar-color);
84
+ }
85
+ .day[data-future="true"] {
86
+ opacity: 0.3;
87
+ cursor: default;
88
+ }
89
+ .day[data-missing="true"] {
90
+ background: repeating-linear-gradient(
91
+ 135deg,
92
+ transparent,
93
+ transparent 2px,
94
+ color-mix(in srgb, var(--fg) 12%, var(--surface)) 2px,
95
+ color-mix(in srgb, var(--fg) 12%, var(--surface)) 3px
96
+ );
97
+ }
98
+ .day:hover:not([data-future="true"]) {
99
+ transform: scale(1.12);
100
+ }
101
+ .day:focus-visible,
102
+ .day[aria-selected="true"] {
103
+ outline: 2px solid var(--accent-ink, var(--accent));
104
+ outline-offset: 1px;
105
+ }
106
+ .footer {
107
+ margin-top: 12px;
108
+ min-height: 18px;
109
+ }
110
+ .legend {
111
+ display: flex;
112
+ align-items: center;
113
+ gap: 4px;
114
+ margin-left: auto;
115
+ }
116
+ .legend > span {
117
+ margin: 0 3px;
118
+ }
119
+ .legend .day {
120
+ cursor: default;
121
+ }
@@ -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
+ }