@recursica/mantine-adapter 0.40.0 → 0.41.0
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 +13 -0
- package/dist/index.d.ts +104 -5
- package/dist/mantine-adapter.cjs +2 -2
- package/dist/mantine-adapter.cjs.map +1 -1
- package/dist/mantine-adapter.css +1 -1
- package/dist/mantine-adapter.js +2356 -2106
- package/dist/mantine-adapter.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FileInput/FILEINPUT_IMPLEMENTATION_NOTES.md +148 -0
- package/src/components/FileInput/FileInput.module.css +269 -47
- package/src/components/FileInput/FileInput.stories.tsx +296 -4
- package/src/components/FileInput/FileInput.tsx +408 -5
- package/src/components/FileInput/USAGE.md +112 -4
package/package.json
CHANGED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# FileInput Implementation Notes
|
|
2
|
+
|
|
3
|
+
## Architecture overview
|
|
4
|
+
|
|
5
|
+
`FileInput` replaces the previous "coming soon" stub with a fully custom composite, the same way
|
|
6
|
+
`FileUpload` was built (see `../FileUpload/FILEUPLOAD_IMPLEMENTATION_NOTES.md`). It shares
|
|
7
|
+
`FileUpload`'s selection/validation contract (`accept`/`maxSize`/`maxFiles`, `onFilesRejected`,
|
|
8
|
+
`readOnly`) via a common `RecursicaFileUploadItem` type and near-identical `handleFiles`/drag
|
|
9
|
+
logic, but is presented as a single-line, `TextField`-shaped control rather than a dropzone —
|
|
10
|
+
Forge's own `file-input` token set is shaped almost identically to `text-field`'s (border-radius,
|
|
11
|
+
horizontal/vertical padding, icon-size, icon-text-gap, min-height, placeholder-opacity, a full
|
|
12
|
+
`text_*` type-style block), confirming the design intent directly rather than needing to guess it
|
|
13
|
+
from the reference screenshot alone.
|
|
14
|
+
|
|
15
|
+
The control is one clickable, focusable `<div role="button">` containing:
|
|
16
|
+
|
|
17
|
+
1. **A leading icon** — the upload icon by default, overridable via `icon`.
|
|
18
|
+
2. **A content area** — placeholder text when empty, or a horizontally scrollable row of `Chip`s
|
|
19
|
+
(reusing `FileUpload`'s chip, same as its file list) once one or more files are selected —
|
|
20
|
+
single- and multiple-file mode render identically here; only the selection/replace behavior
|
|
21
|
+
differs (see "`multiple` defaults to `false`" below).
|
|
22
|
+
3. **A trailing "clear" `Button`** — shown whenever a file is selected; clears the entire current
|
|
23
|
+
selection (see "Trailing clear button" below).
|
|
24
|
+
4. **A hidden `<input type="file">`**, triggered programmatically — same approach as
|
|
25
|
+
`FileUpload`'s dropzone, not the "invisible overlay input" pattern some styled file inputs use
|
|
26
|
+
(that pattern would need every interactive child — chip remove icons, the clear icon — to sit
|
|
27
|
+
at a higher stacking context than the overlay just to receive its own clicks; keeping the input
|
|
28
|
+
hidden and driving it via `ref.click()` avoids that entirely).
|
|
29
|
+
|
|
30
|
+
## The stub's exemption comments described a schema that no longer exists
|
|
31
|
+
|
|
32
|
+
Before writing any CSS, the stub `FileInput.module.css`'s 43 `recursica-ignore` comments were
|
|
33
|
+
checked against `packages/official-release/recursica_variables_scoped.css` directly, rather than
|
|
34
|
+
trusted as the token inventory. They didn't match — the stub encoded a `states.default`/
|
|
35
|
+
`states.focus`-shaped schema (mirroring the same stale-plugin-export drift documented in
|
|
36
|
+
`docs/alignment/ALIGNMENT_2026-08-11.md` §3.2 for other components) that the current export has
|
|
37
|
+
never had for `file-input`. The real schema (40 variables, matching that report's own L5 count)
|
|
38
|
+
has:
|
|
39
|
+
|
|
40
|
+
- **Flat, non-state-scoped base properties and colors** (`properties_border-size`,
|
|
41
|
+
`properties_colors_{background-color,border-color,leading-icon,text-color,trailing-icon}`) —
|
|
42
|
+
much closer to `TextField`'s shape than `FileUpload`'s.
|
|
43
|
+
- **Only two states — `disabled` and `error`.** No `default` state (the flat properties above
|
|
44
|
+
are the default) and no `focus` state at all.
|
|
45
|
+
- **`layouts.{stacked,side-by-side}` each carrying their own `max-width`/`min-width`/
|
|
46
|
+
`top-bottom-margin`** — three properties per layout, not the single flat `max-width`/
|
|
47
|
+
`min-width` an early draft of this component assumed.
|
|
48
|
+
|
|
49
|
+
Every token actually referenced in `FileInput.module.css` was re-verified against this real list
|
|
50
|
+
(38 applied + 2 exempted = 40, zero gap on either adapter).
|
|
51
|
+
|
|
52
|
+
## No forge-defined focus state — generic ring, same fallback as TextField
|
|
53
|
+
|
|
54
|
+
Since `file-input` has no `states.focus` axis, `:focus-visible` on the root falls back to the
|
|
55
|
+
generic `--recursica_brand_states_focus_*` box-shadow ring, exactly like `TextField`/`DatePicker`
|
|
56
|
+
already do for the same reason.
|
|
57
|
+
|
|
58
|
+
## Disabled/error border-size intentionally unused
|
|
59
|
+
|
|
60
|
+
Unlike `FileUpload` (which has no border-size token at all to choose from), `file-input`'s export
|
|
61
|
+
does define real per-state `border-size` variables for `disabled` and `error`. They're
|
|
62
|
+
`recursica-ignore`d anyway and the flat `properties_border-size` is applied uniformly instead —
|
|
63
|
+
same house policy `TextField`/`DatePicker` already follow (a border that changes thickness across
|
|
64
|
+
states shifts the layout), just applied here to real rather than phantom tokens.
|
|
65
|
+
|
|
66
|
+
## Why the root is a focusable, clickable `<div>` (a deliberate divergence from FileUpload)
|
|
67
|
+
|
|
68
|
+
`FileUpload`'s dropzone deliberately has no `onClick`/`role="button"`/`tabIndex` of its own — the
|
|
69
|
+
separate "Browse files" `<Button>` is its sole click/keyboard affordance, avoiding a
|
|
70
|
+
nested-interactive-element ambiguity (see `FILEUPLOAD_IMPLEMENTATION_NOTES.md`, "Not a nested
|
|
71
|
+
interactive element"). `FileInput` has no separate Browse button in the reference design — the
|
|
72
|
+
box itself plays that role, the same way a real `<input type="file">` is its own focusable,
|
|
73
|
+
clickable, `Enter`/`Space`-activatable control. So it needs to be one directly: `role="button"`,
|
|
74
|
+
`tabIndex={0}` when interactive, `onClick`/`onKeyDown` (`Enter`/`Space`) both call the same
|
|
75
|
+
`openFilePicker`, and an explicit `aria-label` (`browseLabel`, defaulting to `"Choose file"`)
|
|
76
|
+
since there's no native `<label for>` association available for a custom `div` the way a real
|
|
77
|
+
`<input>` gets one implicitly.
|
|
78
|
+
|
|
79
|
+
## `multiple` defaults to `false`, unlike `FileUpload`'s `true`
|
|
80
|
+
|
|
81
|
+
The reference design shows "Single File" and "Multiple Files" as two distinct, deliberately-named
|
|
82
|
+
usages, and a single-line `TextField`-shaped control reads most naturally as single-value by
|
|
83
|
+
default — matching a native `<input type="file">`, which is single-file unless `multiple` is set.
|
|
84
|
+
`FileUpload`'s dropzone is the opposite by design (it defaults to accepting a batch).
|
|
85
|
+
|
|
86
|
+
## Single-file mode replaces; it doesn't append
|
|
87
|
+
|
|
88
|
+
`onFilesAdded`/`onFileRemove` keep the exact same shape as `FileUpload`'s, but single-file mode's
|
|
89
|
+
effective cap is hardcoded to 1 (`currentCount` is never read from the existing `files` prop in
|
|
90
|
+
that mode) rather than counting the file already there — picking a new file is meant to replace
|
|
91
|
+
the old one, not be rejected as "over the limit." This is a documentation convention, not special
|
|
92
|
+
component state: see USAGE.md §2 for the "handlers typically replace, not append" note for
|
|
93
|
+
single-file consumers. Dropping more than one file onto a single-file control still routes the
|
|
94
|
+
extras to `onFilesRejected` via the same effective-cap-of-1 logic, with the default
|
|
95
|
+
`maxFilesMessage` reading `"Only one file is allowed"` instead of `FileUpload`'s
|
|
96
|
+
`"Maximum of N files allowed"` phrasing.
|
|
97
|
+
|
|
98
|
+
## Trailing clear button
|
|
99
|
+
|
|
100
|
+
The clear-all affordance shown whenever `files.length > 0` is a real shared `Button`
|
|
101
|
+
(`variant="text" size="small"`, icon-only), not a bespoke `<span role="button">` — it gets real
|
|
102
|
+
button semantics and keyboard handling for free, the same reasoning as `Tree`'s expand/collapse
|
|
103
|
+
button (see `Tree.module.css`'s `.expandButton`). It's rendered through Button's own tokened
|
|
104
|
+
color/disabled states, so `file-input`'s own `properties_colors_trailing-icon` token (and its
|
|
105
|
+
`disabled`/`error` state variants) is `recursica-ignore`d rather than applied — it has no
|
|
106
|
+
"clear button is disabled" state of its own anyway, since `disabled` already omits interactivity
|
|
107
|
+
entirely. Clicking/activating it calls `onFileRemove` once per currently-selected file (reusing
|
|
108
|
+
the same callback `FileUpload`'s individual chip removal uses, rather than introducing a separate
|
|
109
|
+
`onClear` prop) — in single-file mode that's one call; in multiple-file mode it clears everything
|
|
110
|
+
at once, distinct from a chip's own individual remove icon.
|
|
111
|
+
|
|
112
|
+
## Why each chip is wrapped with its own `stopPropagation`
|
|
113
|
+
|
|
114
|
+
`FileUpload`'s chip list sits _below_ its dropzone, entirely outside the click-to-browse surface,
|
|
115
|
+
so a click on a chip's body never risks also opening the file picker. `FileInput`'s chip row lives
|
|
116
|
+
_inside_ the same clickable root, so each chip is wrapped in a thin `<span onClick={(e) =>
|
|
117
|
+
e.stopPropagation()}>` — blank space within the row (and the leading icon/placeholder/filename
|
|
118
|
+
text) still bubbles up to open the picker, but clicking directly on a chip's body doesn't also
|
|
119
|
+
trigger it. Chip's own remove icon already calls `stopPropagation` internally (see `Chip.tsx`), so
|
|
120
|
+
it needed no changes for this.
|
|
121
|
+
|
|
122
|
+
## Keyboard navigation for the chip row
|
|
123
|
+
|
|
124
|
+
Same roving-tabindex model as `FileUpload`'s file list (`activeChipIndex`, `removeIconRefs`,
|
|
125
|
+
Left/Right/Up/Down roving, focus-survives-removal `useEffect`) — reused rather than reinvented,
|
|
126
|
+
and applies in single-file mode too (a one-chip roving group is a no-op but needs no special
|
|
127
|
+
casing). The only addition specific to `FileInput` is that `Tab` reaches the root control itself
|
|
128
|
+
first (since it's the click/keyboard surface for opening the picker), _then_ the chip row's
|
|
129
|
+
roving group, _then_ the trailing clear button as its own stop.
|
|
130
|
+
|
|
131
|
+
## The chip row scrolls horizontally instead of wrapping or clipping
|
|
132
|
+
|
|
133
|
+
`.chipRow` uses `overflow-x: auto; overflow-y: hidden` rather than `FileUpload`'s file list, which
|
|
134
|
+
wraps onto multiple lines below the dropzone — `FileInput` is a fixed single-line, `min-height`d
|
|
135
|
+
control, so wrapping would grow it vertically. Enough chips to overflow the control's own width
|
|
136
|
+
scroll horizontally within it instead (mouse wheel/trackpad or a native scrollbar), same tradeoff
|
|
137
|
+
already made for `.value`'s ellipsis truncation.
|
|
138
|
+
|
|
139
|
+
## Read-only vs disabled
|
|
140
|
+
|
|
141
|
+
`readOnly` renders the same content (placeholder/filename/chip row) but the root loses its
|
|
142
|
+
`role="button"` interactivity (no `tabIndex`, no click/keyboard/drag handlers), chips render with
|
|
143
|
+
no `removeLabel`/`onRemove` (so `Chip` itself renders no remove icon, same as `FileUpload`'s
|
|
144
|
+
read-only chips), and the trailing clear icon is omitted entirely. `disabled` keeps the control
|
|
145
|
+
structurally the same but inert (`tabIndex={-1}`, `aria-disabled`, no handlers, native `<input>`
|
|
146
|
+
disabled) — both are computed together as a single `interactive` flag used throughout, but remain
|
|
147
|
+
independently toggleable props (a `readOnly` control is never simultaneously `disabled` in
|
|
148
|
+
practice, but nothing enforces that at the type level, matching `FileUpload`'s own convention).
|
|
@@ -1,50 +1,272 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_properties_text_font-family */
|
|
17
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_properties_text_font-size */
|
|
18
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_properties_text_font-style */
|
|
19
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_properties_text_font-weight */
|
|
20
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_properties_text_letter-spacing */
|
|
21
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_properties_text_line-height */
|
|
22
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_properties_text_text-decoration */
|
|
23
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_properties_text_text-transform */
|
|
24
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_properties_vertical-padding */
|
|
25
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_layouts_side-by-side_properties_top-bottom-margin */
|
|
26
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_layouts_stacked_properties_top-bottom-margin */
|
|
27
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_states_default_properties_border-size */
|
|
1
|
+
/* EXEMPTIONS:
|
|
2
|
+
- The disabled/error states' own border-size variables are ignored so the border never changes
|
|
3
|
+
thickness across states and shifts the layout — same house policy as TextField/DatePicker.
|
|
4
|
+
The flat, state-agnostic properties_border-size token below is applied uniformly instead.
|
|
5
|
+
- There is no forge-defined focus state for file-input (no `states.focus` axis, unlike its
|
|
6
|
+
disabled/error siblings) — the generic recursica_brand_states_focus_* ring is used instead,
|
|
7
|
+
same fallback TextField/DatePicker use for the same reason.
|
|
8
|
+
- properties_icon-text-gap doubles as the gap between chips: file-input has no dedicated
|
|
9
|
+
chip-gap token (unlike file-upload's properties_item-gap).
|
|
10
|
+
- The trailing clear-all affordance is now a real shared `Button` (icon-only, "text" variant)
|
|
11
|
+
rather than a bespoke span, so it gets its own real button semantics/keyboard handling —
|
|
12
|
+
same pattern as Tree's expand/collapse button. It renders through Button's own tokened
|
|
13
|
+
color states (including disabled), so file-input's own trailing-icon color tokens — which
|
|
14
|
+
have no "clear button is disabled/errored" equivalent state of their own anyway — are no
|
|
15
|
+
longer consumed here. */
|
|
28
16
|
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_states_disabled_properties_border-size */
|
|
29
17
|
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_states_error_properties_border-size */
|
|
30
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-
|
|
31
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_states_default_properties_colors_background */
|
|
32
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_states_default_properties_colors_border-color */
|
|
33
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_states_default_properties_colors_leading-icon */
|
|
34
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_states_default_properties_colors_text */
|
|
35
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_states_default_properties_colors_trailing-icon */
|
|
36
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_states_disabled_properties_colors_background */
|
|
37
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_states_disabled_properties_colors_border-color */
|
|
38
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_states_disabled_properties_colors_leading-icon */
|
|
39
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_states_disabled_properties_colors_text */
|
|
40
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_states_disabled_properties_colors_trailing-icon */
|
|
41
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_states_error_properties_colors_background */
|
|
42
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_states_error_properties_colors_border-color */
|
|
43
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_states_error_properties_colors_leading-icon */
|
|
44
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_states_error_properties_colors_text */
|
|
18
|
+
/* recursica-ignore: --recursica_ui-kit_components_file-input_properties_colors_trailing-icon */
|
|
45
19
|
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_states_error_properties_colors_trailing-icon */
|
|
46
|
-
/* recursica-ignore: --recursica_ui-kit_components_file-
|
|
47
|
-
|
|
48
|
-
/*
|
|
49
|
-
|
|
50
|
-
|
|
20
|
+
/* recursica-ignore: --recursica_ui-kit_components_file-input_variants_states_disabled_properties_colors_trailing-icon */
|
|
21
|
+
|
|
22
|
+
/* LAYOUT SPACING OVERRIDES:
|
|
23
|
+
- Sets the --form-control-margin-bottom spacing hook to map component-specific layout tokens.
|
|
24
|
+
- Also sets the --file-input-control-{max,min}-width hooks consumed inline in FileInput.tsx,
|
|
25
|
+
since max-width/min-width are split per layout variant (same shape as TextField). */
|
|
26
|
+
.layoutOverride {
|
|
27
|
+
--form-control-margin-bottom: var(
|
|
28
|
+
--recursica_ui-kit_components_file-input_variants_layouts_stacked_properties_top-bottom-margin
|
|
29
|
+
);
|
|
30
|
+
--file-input-control-max-width: var(
|
|
31
|
+
--recursica_ui-kit_components_file-input_variants_layouts_stacked_properties_max-width
|
|
32
|
+
);
|
|
33
|
+
--file-input-control-min-width: var(
|
|
34
|
+
--recursica_ui-kit_components_file-input_variants_layouts_stacked_properties_min-width
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.layoutOverride[data-form-layout="side-by-side"] {
|
|
39
|
+
--form-control-margin-bottom: var(
|
|
40
|
+
--recursica_ui-kit_components_file-input_variants_layouts_side-by-side_properties_top-bottom-margin
|
|
41
|
+
);
|
|
42
|
+
--file-input-control-max-width: var(
|
|
43
|
+
--recursica_ui-kit_components_file-input_variants_layouts_side-by-side_properties_max-width
|
|
44
|
+
);
|
|
45
|
+
--file-input-control-min-width: var(
|
|
46
|
+
--recursica_ui-kit_components_file-input_variants_layouts_side-by-side_properties_min-width
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* HARDCODED VALUES:
|
|
51
|
+
- border-style: solid. Native structural rendering rule (matches TextField).
|
|
52
|
+
- outline: none. Bypassing the browser focus ring to rely strictly on the state cascade below.
|
|
53
|
+
- .root's cursor/position/overflow: structural, not a design-token concern. */
|
|
54
|
+
|
|
55
|
+
.root {
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
position: relative;
|
|
59
|
+
box-sizing: border-box;
|
|
60
|
+
width: 100%;
|
|
61
|
+
max-width: var(--file-input-control-max-width);
|
|
62
|
+
min-width: var(--file-input-control-min-width);
|
|
63
|
+
min-height: var(
|
|
64
|
+
--recursica_ui-kit_components_file-input_properties_min-height
|
|
65
|
+
);
|
|
66
|
+
gap: var(--recursica_ui-kit_components_file-input_properties_icon-text-gap);
|
|
67
|
+
padding-top: var(
|
|
68
|
+
--recursica_ui-kit_components_file-input_properties_vertical-padding
|
|
69
|
+
);
|
|
70
|
+
padding-bottom: var(
|
|
71
|
+
--recursica_ui-kit_components_file-input_properties_vertical-padding
|
|
72
|
+
);
|
|
73
|
+
padding-left: var(
|
|
74
|
+
--recursica_ui-kit_components_file-input_properties_horizontal-padding
|
|
75
|
+
);
|
|
76
|
+
padding-right: var(
|
|
77
|
+
--recursica_ui-kit_components_file-input_properties_horizontal-padding
|
|
78
|
+
);
|
|
79
|
+
border-width: var(
|
|
80
|
+
--recursica_ui-kit_components_file-input_properties_border-size
|
|
81
|
+
);
|
|
82
|
+
border-style: solid;
|
|
83
|
+
border-radius: var(
|
|
84
|
+
--recursica_ui-kit_components_file-input_properties_border-radius
|
|
85
|
+
);
|
|
86
|
+
background-color: var(
|
|
87
|
+
--recursica_ui-kit_components_file-input_properties_colors_background-color
|
|
88
|
+
);
|
|
89
|
+
border-color: var(
|
|
90
|
+
--recursica_ui-kit_components_file-input_properties_colors_border-color
|
|
91
|
+
);
|
|
92
|
+
color: var(
|
|
93
|
+
--recursica_ui-kit_components_file-input_properties_colors_text-color
|
|
94
|
+
);
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
outline: none;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.root[data-disabled="true"],
|
|
100
|
+
.root[data-readonly="true"] {
|
|
101
|
+
cursor: default;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.root > * {
|
|
105
|
+
position: relative;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* Dragging-over state: reuses the generic hover overlay recipe (see Button.module.css) for the
|
|
109
|
+
background, and the shared "selected" border bridge var FormControlWrapper already exposes —
|
|
110
|
+
file-input has no color tokens of its own for this state. Same recipe as FileUpload's
|
|
111
|
+
dropzone; see "Dragging-over visual state" in FILEINPUT_IMPLEMENTATION_NOTES.md. */
|
|
112
|
+
.root::after {
|
|
113
|
+
content: "";
|
|
114
|
+
position: absolute;
|
|
115
|
+
inset: 0;
|
|
116
|
+
border-radius: inherit;
|
|
117
|
+
z-index: 0;
|
|
118
|
+
pointer-events: none;
|
|
119
|
+
transition: opacity 150ms ease;
|
|
120
|
+
opacity: 0;
|
|
121
|
+
background-color: var(--recursica_brand_states_hover_color);
|
|
122
|
+
}
|
|
123
|
+
.root[data-dragging="true"] {
|
|
124
|
+
border-color: var(--form-field-border-selected);
|
|
125
|
+
}
|
|
126
|
+
.root[data-dragging="true"]::after {
|
|
127
|
+
opacity: var(--recursica_brand_states_hover_opacity);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.leadingIcon {
|
|
131
|
+
display: flex;
|
|
132
|
+
flex: none;
|
|
133
|
+
width: var(--recursica_ui-kit_components_file-input_properties_icon-size);
|
|
134
|
+
height: var(--recursica_ui-kit_components_file-input_properties_icon-size);
|
|
135
|
+
color: var(
|
|
136
|
+
--recursica_ui-kit_components_file-input_properties_colors_leading-icon
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
.leadingIcon svg {
|
|
140
|
+
width: 100%;
|
|
141
|
+
height: 100%;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.content {
|
|
145
|
+
display: flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
flex: 1 1 auto;
|
|
148
|
+
min-width: 0; /* HARDCODE: lets the value/chip row actually shrink and ellipsize */
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.value {
|
|
153
|
+
font-family: var(
|
|
154
|
+
--recursica_ui-kit_components_file-input_properties_text_font-family
|
|
155
|
+
);
|
|
156
|
+
font-size: var(
|
|
157
|
+
--recursica_ui-kit_components_file-input_properties_text_font-size
|
|
158
|
+
);
|
|
159
|
+
font-style: var(
|
|
160
|
+
--recursica_ui-kit_components_file-input_properties_text_font-style
|
|
161
|
+
);
|
|
162
|
+
font-weight: var(
|
|
163
|
+
--recursica_ui-kit_components_file-input_properties_text_font-weight
|
|
164
|
+
);
|
|
165
|
+
letter-spacing: var(
|
|
166
|
+
--recursica_ui-kit_components_file-input_properties_text_letter-spacing
|
|
167
|
+
);
|
|
168
|
+
line-height: var(
|
|
169
|
+
--recursica_ui-kit_components_file-input_properties_text_line-height
|
|
170
|
+
);
|
|
171
|
+
text-decoration: var(
|
|
172
|
+
--recursica_ui-kit_components_file-input_properties_text_text-decoration
|
|
173
|
+
);
|
|
174
|
+
text-transform: var(
|
|
175
|
+
--recursica_ui-kit_components_file-input_properties_text_text-transform
|
|
176
|
+
);
|
|
177
|
+
width: 100%;
|
|
178
|
+
white-space: nowrap;
|
|
179
|
+
text-overflow: ellipsis;
|
|
180
|
+
/* HARDCODE: x-only clipping — clipping y too (plain overflow: hidden) cuts off descenders
|
|
181
|
+
(e.g. the "g" in "image.png"); same fix as Chip.module.css's .children. */
|
|
182
|
+
overflow-x: clip;
|
|
183
|
+
overflow-y: visible;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.value[data-placeholder="true"] {
|
|
187
|
+
opacity: var(
|
|
188
|
+
--recursica_ui-kit_components_file-input_properties_placeholder-opacity
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.chipRow {
|
|
193
|
+
display: flex;
|
|
194
|
+
align-items: center;
|
|
195
|
+
flex-wrap: nowrap;
|
|
196
|
+
/* HARDCODE: x-only scroll — the chip list can exceed the control's own width (more files than
|
|
197
|
+
fit on one line), so it scrolls horizontally within the control instead of wrapping/growing
|
|
198
|
+
it or clipping the overflow away. */
|
|
199
|
+
overflow-x: auto;
|
|
200
|
+
overflow-y: hidden;
|
|
201
|
+
gap: var(--recursica_ui-kit_components_file-input_properties_icon-text-gap);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.chipWrapper {
|
|
205
|
+
display: flex;
|
|
206
|
+
min-width: 0;
|
|
207
|
+
flex: none;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* Structural placement only — the button's own "text" variant/size="small" tokens (including its
|
|
211
|
+
own disabled state) own its visual appearance, same as Tree's .expandButton. */
|
|
212
|
+
.trailingIcon {
|
|
213
|
+
position: relative;
|
|
214
|
+
z-index: 1;
|
|
215
|
+
flex: none;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/* -------------------------------------
|
|
219
|
+
STATE CASCADE ARCHITECTURE
|
|
220
|
+
-------------------------------------- */
|
|
221
|
+
|
|
222
|
+
/* Focus State Mapping (Triggered internally via browser pseudo-class on the root control) */
|
|
223
|
+
/* file-input has no per-component focus colors (see EXEMPTIONS above); apply the generic focus
|
|
224
|
+
ring tokens as a box-shadow ring instead of a color swap (matches TextField/DatePicker). */
|
|
225
|
+
.root:focus-visible {
|
|
226
|
+
box-shadow:
|
|
227
|
+
0 0 0 var(--recursica_brand_states_focus_border-size)
|
|
228
|
+
var(--recursica_brand_states_focus_color),
|
|
229
|
+
0 0 var(--recursica_brand_states_focus_blur)
|
|
230
|
+
var(--recursica_brand_states_focus_margin)
|
|
231
|
+
var(--recursica_brand_states_focus_color);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/* Error State Mapping (Propagated strictly down from the wrapper DOM context) */
|
|
235
|
+
.root[data-error="true"] {
|
|
236
|
+
border-color: var(
|
|
237
|
+
--recursica_ui-kit_components_file-input_variants_states_error_properties_colors_border-color
|
|
238
|
+
) !important;
|
|
239
|
+
background-color: var(
|
|
240
|
+
--recursica_ui-kit_components_file-input_variants_states_error_properties_colors_background-color
|
|
241
|
+
) !important;
|
|
242
|
+
color: var(
|
|
243
|
+
--recursica_ui-kit_components_file-input_variants_states_error_properties_colors_text-color
|
|
244
|
+
) !important;
|
|
245
|
+
}
|
|
246
|
+
.root[data-error="true"] .leadingIcon {
|
|
247
|
+
color: var(
|
|
248
|
+
--recursica_ui-kit_components_file-input_variants_states_error_properties_colors_leading-icon
|
|
249
|
+
) !important;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* Disabled State Mapping (Propagated strictly down from the wrapper DOM context) */
|
|
253
|
+
.root[data-disabled="true"] {
|
|
254
|
+
border-color: var(
|
|
255
|
+
--recursica_ui-kit_components_file-input_variants_states_disabled_properties_colors_border-color
|
|
256
|
+
) !important;
|
|
257
|
+
background-color: var(
|
|
258
|
+
--recursica_ui-kit_components_file-input_variants_states_disabled_properties_colors_background-color
|
|
259
|
+
) !important;
|
|
260
|
+
color: var(
|
|
261
|
+
--recursica_ui-kit_components_file-input_variants_states_disabled_properties_colors_text-color
|
|
262
|
+
) !important;
|
|
263
|
+
opacity: var(
|
|
264
|
+
--recursica_ui-kit_components_file-input_variants_states_disabled_properties_opacity
|
|
265
|
+
) !important;
|
|
266
|
+
cursor: not-allowed;
|
|
267
|
+
}
|
|
268
|
+
.root[data-disabled="true"] .leadingIcon {
|
|
269
|
+
color: var(
|
|
270
|
+
--recursica_ui-kit_components_file-input_variants_states_disabled_properties_colors_leading-icon
|
|
271
|
+
) !important;
|
|
272
|
+
}
|