@tangible/ui 0.2.3 → 0.2.4

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.
@@ -33,6 +33,7 @@
33
33
  @use "./switch" as switch;
34
34
  @use "./sidebar" as sidebar;
35
35
  @use "./step-indicator" as stepindicator;
36
+ @use "./search-input" as searchinput;
36
37
  @use "./step-list" as steplist;
37
38
  @use "./table" as table;
38
39
  @use "./tabs" as tabs;
@@ -48,7 +49,7 @@
48
49
 
49
50
  // Components whose runtime markup renders the shared input-core classes
50
51
  // (.tui-input etc.) — requesting any of them pulls the input core in.
51
- $-input-dependents: (input, field, text-input, textarea, pager);
52
+ $-input-dependents: (input, field, text-input, textarea, pager, search-input);
52
53
 
53
54
  @function -needs-input($only) {
54
55
  @if $only == null {
@@ -95,6 +96,7 @@ $-input-dependents: (input, field, text-input, textarea, pager);
95
96
  @if -wants($only, radio) { @include radio.styles(); }
96
97
  @if -wants($only, rating) { @include rating.styles(); }
97
98
  @if -wants($only, progress) { @include progress.styles(); }
99
+ @if -wants($only, search-input) { @include searchinput.styles(); }
98
100
  @if -wants($only, segmented-control) { @include segmentedcontrol.styles(); }
99
101
  @if -wants($only, slider) { @include slider.styles(); }
100
102
  @if -wants($only, switch) { @include switch.styles(); }
@@ -174,6 +174,27 @@
174
174
  }
175
175
  }
176
176
 
177
+ // -------------------------------------------------------------------------
178
+ // Stacked layout (default)
179
+ // -------------------------------------------------------------------------
180
+ // The inner wrapper is a full-height flex column. This is what lets a
181
+ // trailing slot be pinned to the card's bottom edge via an auto margin
182
+ // (e.g. `Card.Foot` with `.tui-margin-block-start-auto`) — essential in
183
+ // card grids, where sibling cards set a taller row height and a short
184
+ // card's footer would otherwise float mid-card. `height: 100%` fills the
185
+ // grid/flex-stretched card so the free space the auto margin consumes
186
+ // actually exists. On a natural-height card the percentage resolves to
187
+ // content height (no free space), so this is inert until a card is
188
+ // stretched — no visual change to standalone cards.
189
+ //
190
+ // Scoped away from inline layout, which owns its own row flex in the
191
+ // container query below (the two selectors are mutually exclusive).
192
+ &:not(.is-layout-inline) .#{sys.$prefix}card__inner {
193
+ display: flex;
194
+ flex-direction: column;
195
+ height: 100%;
196
+ }
197
+
177
198
  // -------------------------------------------------------------------------
178
199
  // Inline layout (container query)
179
200
  // -------------------------------------------------------------------------
@@ -200,7 +200,7 @@
200
200
  flex: 1 1 0;
201
201
  min-width: 0;
202
202
  display: flex;
203
- align-items: baseline;
203
+ align-items: center;
204
204
  gap: 0.125em;
205
205
  }
206
206
 
@@ -223,6 +223,12 @@
223
223
  font: inherit;
224
224
  text-align: start;
225
225
  border-radius: var(--#{sys.$prefix}radius-sm);
226
+ // Inset the rounded input (and its focus tint) from the field-group edge so
227
+ // the pill doesn't run into the border. Mirrors the swatch's sizing: the
228
+ // group is fixed at control-height-md, so the input keeps that height minus
229
+ // the two insets.
230
+ margin-block: var(--#{sys.$prefix}spacing-xxs);
231
+ min-height: calc(var(--#{sys.$prefix}control-height-md, 2.5rem) - 2 * var(--#{sys.$prefix}spacing-xxs));
226
232
 
227
233
  // The group carries the :focus-within ring; each field additionally shows a
228
234
  // subtle tint so a sighted keyboard user can tell WHICH channel has focus.
@@ -76,6 +76,7 @@
76
76
  // Button's `.tui-interface .tui-button` rule which is also 0,2,0.
77
77
  .#{sys.$prefix}interface .#{sys.$prefix}dropdown__item {
78
78
  // Override Button's sizing/layout
79
+ display: flex;
79
80
  justify-content: flex-start;
80
81
  width: 100%;
81
82
  min-width: 0;
@@ -37,9 +37,11 @@
37
37
  // --tui-pager-item-border.
38
38
  --#{sys.$prefix}button-border: var(--#{sys.$prefix}pager-item-border, var(--#{sys.$prefix}color-border));
39
39
  border-color: var(--#{sys.$prefix}button-border);
40
- font-size: var(--#{sys.$prefix}typography-size-sm);
40
+ // Compact page-number width. Font-size and height come from the shared
41
+ // control ladder — Button's own control-sizing for the items, and the
42
+ // control-sizing mixin for the ellipsis below — so the whole nav scales
43
+ // with `size` and honours a context's --tui-control-height-* override.
41
44
  padding-inline: 0.85em;
42
- padding-block: 0.4em;
43
45
 
44
46
  // Connected button group: remove inner radii
45
47
  &:not(:first-child) {
@@ -54,10 +56,14 @@
54
56
  }
55
57
  }
56
58
 
57
- // Ellipsis: non-interactive, styled to match outline buttons. The border
58
- // reads the bridged Button token defined on the group above — not
59
- // Button's --_border internal, which only exists on actual Buttons.
59
+ // Ellipsis: non-interactive, styled to match outline buttons. It's a plain
60
+ // <span> (not a Button), so it needs the control ladder applied directly
61
+ // to match the sibling buttons' height at each size tier (keyed on the
62
+ // `is-size-*` class the component adds). The border reads the bridged
63
+ // Button token defined on the group above — not Button's --_border
64
+ // internal, which only exists on actual Buttons.
60
65
  .#{sys.$prefix}pager__ellipsis {
66
+ @include sys.control-sizing(sys.$prefix);
61
67
  display: inline-flex;
62
68
  align-items: center;
63
69
  justify-content: center;
@@ -0,0 +1,104 @@
1
+ @use "../system" as sys;
2
+
3
+ /* @tui-tokens
4
+ --tui-search-input-button-radius
5
+ */
6
+
7
+ // =============================================================================
8
+ // SearchInput Styles
9
+ // =============================================================================
10
+ //
11
+ // SearchInput reuses the shared input-group chrome (see TextInput styles and
12
+ // the input core). The only bespoke elements are the two owned in-field
13
+ // buttons — the clear (×) button in the suffix slot and, when `onSearch` is
14
+ // set, the submit button in the prefix slot. Both are styled here after the
15
+ // removable-chip idiom (`tui-chip__remove`): bare, brightening on hover/focus.
16
+ //
17
+ // Component API tokens (never defined here, only read via fallback):
18
+ // --tui-search-input-button-radius Clear/submit button hit-area radius
19
+ //
20
+ // =============================================================================
21
+
22
+ @mixin styles() {
23
+ // Shared reset for both in-field buttons.
24
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-input__clear,
25
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-input__submit {
26
+ display: inline-flex;
27
+ align-items: center;
28
+ justify-content: center;
29
+ flex: none;
30
+ // Hit-area floor: em-relative padding alone lands ~21px at size="sm"
31
+ // (14px control font), under the 24px WCAG 2.5.5 minimum. Pin a 1.5rem
32
+ // (24px) floor so the target stays reachable at every size; the glyph
33
+ // still sizes with the control text inside the padded box.
34
+ min-inline-size: 1.5rem;
35
+ min-block-size: 1.5rem;
36
+ padding: 0.1875em;
37
+ border: 0;
38
+ border-radius: var(--#{sys.$prefix}search-input-button-radius, var(--#{sys.$prefix}radius-full, 999px));
39
+ background: transparent;
40
+ color: inherit;
41
+ cursor: pointer;
42
+ line-height: 0;
43
+ transition-duration: var(--#{sys.$prefix}motion-duration);
44
+ transition-timing-function: var(--#{sys.$prefix}motion-timing);
45
+ transition-property: opacity, color, outline-color;
46
+
47
+ &:focus-visible {
48
+ outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
49
+ outline-offset: var(--#{sys.$prefix}focus-ring-offset);
50
+ }
51
+
52
+ // Forced-colors: the transparent button is invisible without a system
53
+ // colour; give the glyph a button-text colour and a real focus outline.
54
+ @media (forced-colors: active) {
55
+ color: ButtonText;
56
+
57
+ &:focus-visible {
58
+ outline-color: Highlight;
59
+ }
60
+ }
61
+ }
62
+
63
+ // Clear (×): secondary affordance — muted at rest, brightens on interaction.
64
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-input__clear {
65
+ opacity: 0.65;
66
+
67
+ .#{sys.$prefix}icon {
68
+ font-size: 1.125em;
69
+ }
70
+
71
+ @media (hover: hover) {
72
+ &:hover {
73
+ opacity: 1;
74
+ color: var(--#{sys.$prefix}color-fg);
75
+ }
76
+ }
77
+
78
+ &:focus-visible {
79
+ opacity: 1;
80
+ color: var(--#{sys.$prefix}color-fg);
81
+ }
82
+ }
83
+
84
+ // Submit: the leading magnifier turned interactive. It should read like the
85
+ // decorative prefix icon it replaces (same muted colour, full opacity), just
86
+ // darkening on hover/focus to signal it's actionable.
87
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-input__submit {
88
+ color: var(--#{sys.$prefix}color-fg-secondary);
89
+
90
+ .#{sys.$prefix}icon {
91
+ font-size: 1em;
92
+ }
93
+
94
+ @media (hover: hover) {
95
+ &:hover {
96
+ color: var(--#{sys.$prefix}color-fg);
97
+ }
98
+ }
99
+
100
+ &:focus-visible {
101
+ color: var(--#{sys.$prefix}color-fg);
102
+ }
103
+ }
104
+ }
package/tui-manifest.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.2.3",
3
- "generated": "2026-07-31T21:16:56.443Z",
2
+ "version": "0.2.4",
3
+ "generated": "2026-08-01T17:54:44.092Z",
4
4
  "components": {
5
5
  "Accordion": {
6
6
  "props": {
@@ -2033,6 +2033,12 @@
2033
2033
  "required": false,
2034
2034
  "description": "Available page size options"
2035
2035
  },
2036
+ "size": {
2037
+ "type": "\"sm\" | \"md\" | \"lg\"",
2038
+ "required": false,
2039
+ "defaultValue": "sm",
2040
+ "description": "Control size — joins the shared control-height ladder (sm/md/lg) that\nButton, IconButton, and the form controls use."
2041
+ },
2036
2042
  "mode": {
2037
2043
  "type": "\"simple\" | \"ends\" | \"full\" | \"smart\"",
2038
2044
  "required": false,
@@ -2364,6 +2370,105 @@
2364
2370
  "use": null,
2365
2371
  "notFor": null
2366
2372
  },
2373
+ "SearchInput": {
2374
+ "props": {
2375
+ "size": {
2376
+ "type": "\"sm\" | \"md\" | \"lg\"",
2377
+ "required": false,
2378
+ "defaultValue": "'md'",
2379
+ "description": "Control size."
2380
+ },
2381
+ "disabled": {
2382
+ "type": "boolean",
2383
+ "required": false
2384
+ },
2385
+ "className": {
2386
+ "type": "string",
2387
+ "required": false,
2388
+ "description": "Additional class name applied to the root wrapper element."
2389
+ },
2390
+ "id": {
2391
+ "type": "string",
2392
+ "required": false
2393
+ },
2394
+ "style": {
2395
+ "type": "CSSProperties",
2396
+ "required": false
2397
+ },
2398
+ "title": {
2399
+ "type": "string",
2400
+ "required": false
2401
+ },
2402
+ "role": {
2403
+ "type": "AriaRole",
2404
+ "required": false
2405
+ },
2406
+ "rel": {
2407
+ "type": "string",
2408
+ "required": false
2409
+ },
2410
+ "onClick": {
2411
+ "type": "MouseEventHandler<HTMLInputElement>",
2412
+ "required": false
2413
+ },
2414
+ "inputClassName": {
2415
+ "type": "string",
2416
+ "required": false,
2417
+ "description": "Class name applied directly to the `<input>` element.\nUse for utilities like `tui-input-reset` (removes browser-native search\ndecoration, clear buttons, and spinners) that must target the input itself."
2418
+ },
2419
+ "value": {
2420
+ "type": "string",
2421
+ "required": false,
2422
+ "description": "Current value (controlled)."
2423
+ },
2424
+ "onValueChange": {
2425
+ "type": "(value: string) => void",
2426
+ "required": false,
2427
+ "description": "Called with the current string value on every change — typing and the clear\nbutton alike (clearing fires it with `''`).\n@remarks SearchInput is a value component (like Combobox/Select), not a thin\nnative wrapper: it owns controlled/uncontrolled state and the clear button,\nso it exposes `onValueChange` rather than a native `onChange` event. Reach\nfor {@link TextInput } directly if you need the raw change event."
2428
+ },
2429
+ "searchLabel": {
2430
+ "type": "string",
2431
+ "required": false,
2432
+ "defaultValue": "Search",
2433
+ "description": "Accessible label for the submit button (only rendered when `onSearch` is\nset)."
2434
+ },
2435
+ "clearLabel": {
2436
+ "type": "string",
2437
+ "required": false,
2438
+ "defaultValue": "Clear search",
2439
+ "description": "Accessible label for the clear button."
2440
+ },
2441
+ "hideClear": {
2442
+ "type": "boolean",
2443
+ "required": false,
2444
+ "defaultValue": "false",
2445
+ "description": "Hide the clear button entirely (e.g. when search runs live and clearing\nhas no meaning)."
2446
+ },
2447
+ "searchIcon": {
2448
+ "type": "ReactNode",
2449
+ "required": false,
2450
+ "description": "Override the leading icon. Defaults to the `system/search` glyph."
2451
+ }
2452
+ },
2453
+ "cssTokens": [
2454
+ "--tui-search-input-button-radius"
2455
+ ],
2456
+ "story": {
2457
+ "title": "Forms/SearchInput",
2458
+ "tags": [
2459
+ "autodocs",
2460
+ "stable",
2461
+ "lms"
2462
+ ]
2463
+ },
2464
+ "subcomponents": null,
2465
+ "description": null,
2466
+ "gotchas": null,
2467
+ "examples": null,
2468
+ "related": null,
2469
+ "use": null,
2470
+ "notFor": null
2471
+ },
2367
2472
  "SegmentedControl": {
2368
2473
  "props": {
2369
2474
  "value": {