@tangible/ui 0.2.3 → 0.2.5

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 (52) hide show
  1. package/components/ColorPicker/ColorField.d.ts +31 -2
  2. package/components/ColorPicker/ColorField.js +100 -8
  3. package/components/Combobox/Combobox.d.ts +1 -1
  4. package/components/Combobox/Combobox.js +2 -2
  5. package/components/Combobox/types.d.ts +5 -0
  6. package/components/Field/Field.d.ts +13 -1
  7. package/components/Field/Field.js +5 -3
  8. package/components/GradientPicker/AngleDial.d.ts +14 -0
  9. package/components/GradientPicker/AngleDial.js +24 -0
  10. package/components/GradientPicker/GradientBar.d.ts +38 -0
  11. package/components/GradientPicker/GradientBar.js +130 -0
  12. package/components/GradientPicker/GradientPicker.d.ts +32 -0
  13. package/components/GradientPicker/GradientPicker.js +191 -0
  14. package/components/GradientPicker/index.d.ts +8 -0
  15. package/components/GradientPicker/index.js +8 -0
  16. package/components/GradientPicker/labels.d.ts +42 -0
  17. package/components/GradientPicker/labels.js +31 -0
  18. package/components/MultiCombobox/MultiCombobox.d.ts +1 -1
  19. package/components/MultiCombobox/MultiCombobox.js +2 -2
  20. package/components/MultiCombobox/types.d.ts +5 -0
  21. package/components/Pager/Pager.d.ts +8 -1
  22. package/components/Pager/Pager.js +10 -6
  23. package/components/SearchInput/SearchInput.d.ts +11 -0
  24. package/components/SearchInput/SearchInput.js +76 -0
  25. package/components/SearchInput/index.d.ts +2 -0
  26. package/components/SearchInput/index.js +1 -0
  27. package/components/SearchInput/types.d.ts +69 -0
  28. package/components/SearchInput/types.js +1 -0
  29. package/components/index.d.ts +4 -0
  30. package/components/index.js +2 -0
  31. package/icons/icons.svg +16 -16
  32. package/icons/lms/index.js +13 -13
  33. package/icons/system/index.js +3 -3
  34. package/package.json +9 -1
  35. package/styles/all.css +1 -1
  36. package/styles/all.expanded.css +332 -19
  37. package/styles/all.expanded.unlayered.css +332 -19
  38. package/styles/all.unlayered.css +1 -1
  39. package/styles/components/_bundle.scss +11 -1
  40. package/styles/components/button.scss +4 -3
  41. package/styles/components/card.scss +21 -0
  42. package/styles/components/color-picker.scss +18 -2
  43. package/styles/components/dropdown.scss +1 -0
  44. package/styles/components/gradient-picker.scss +296 -0
  45. package/styles/components/icon-button.scss +15 -8
  46. package/styles/components/pager.scss +11 -5
  47. package/styles/components/search-input.scss +104 -0
  48. package/styles/system/_checkerboard.scss +24 -0
  49. package/styles/system/index.scss +2 -1
  50. package/tui-manifest.json +199 -5
  51. package/utils/color/gradient.d.ts +42 -0
  52. package/utils/color/gradient.js +408 -0
@@ -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
+ }
@@ -0,0 +1,24 @@
1
+ // =============================================================================
2
+ // Alpha checkerboard — the transparency indicator behind colour/gradient UI.
3
+ // Fixed neutral values on purpose: it must read underneath ARBITRARY user
4
+ // colours, so it can't defer to theme tokens.
5
+ //
6
+ // Used by GradientPicker (bar + stop swatches). ColorPicker/ColorField carry
7
+ // two older inline copies (one composited with the swatch colour in the same
8
+ // background-image list, which this mixin can't express) — consolidating those
9
+ // is tracked on the Component Roadmap.
10
+ // =============================================================================
11
+
12
+ @mixin alpha-checkerboard($cell: 8px) {
13
+ background-color: #fff;
14
+ background-image: linear-gradient(45deg, #ccc 25%, transparent 25%),
15
+ linear-gradient(-45deg, #ccc 25%, transparent 25%),
16
+ linear-gradient(45deg, transparent 75%, #ccc 75%),
17
+ linear-gradient(-45deg, transparent 75%, #ccc 75%);
18
+ background-size: $cell $cell;
19
+ background-position:
20
+ 0 0,
21
+ 0 calc($cell / 2),
22
+ calc($cell / 2) calc(-1 * $cell / 2),
23
+ calc(-1 * $cell / 2) 0;
24
+ }
@@ -2,4 +2,5 @@
2
2
  @forward "palettes";
3
3
  @forward "tokens";
4
4
  @forward "motion";
5
- @forward "control";
5
+ @forward "control";
6
+ @forward "checkerboard";
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.5",
3
+ "generated": "2026-08-14T23:33:51.838Z",
4
4
  "components": {
5
5
  "Accordion": {
6
6
  "props": {
@@ -312,7 +312,6 @@
312
312
  "--tui-button-bg-interact",
313
313
  "--tui-button-fg-interact",
314
314
  "--tui-button-border-interact",
315
- "--tui-button-fg-active",
316
315
  "--tui-button-icon-scale",
317
316
  "--tui-control-height-xs",
318
317
  "--tui-control-height-sm",
@@ -890,7 +889,8 @@
890
889
  "--tui-color-area-thumb-size",
891
890
  "--tui-color-slider-radius",
892
891
  "--tui-color-slider-height",
893
- "--tui-color-slider-thumb-size"
892
+ "--tui-color-slider-thumb-size",
893
+ "--tui-color-field-swatch-border"
894
894
  ],
895
895
  "story": {
896
896
  "title": "Forms/ColorPicker",
@@ -958,6 +958,11 @@
958
958
  "defaultValue": "true",
959
959
  "description": "Whether to open the listbox when the input receives focus."
960
960
  },
961
+ "id": {
962
+ "type": "string",
963
+ "required": false,
964
+ "description": "Optional input ID override, applied to the inner `<input>`.\nUseful for Field integration via htmlFor — Field.Control injects this."
965
+ },
961
966
  "clearable": {
962
967
  "type": "boolean",
963
968
  "required": false,
@@ -1213,6 +1218,83 @@
1213
1218
  "use": null,
1214
1219
  "notFor": null
1215
1220
  },
1221
+ "GradientPicker": {
1222
+ "props": {
1223
+ "value": {
1224
+ "type": "string",
1225
+ "required": false,
1226
+ "description": "Controlled value — a CSS gradient string."
1227
+ },
1228
+ "onValueChange": {
1229
+ "type": "(value: string) => void",
1230
+ "required": false
1231
+ },
1232
+ "alpha": {
1233
+ "type": "boolean",
1234
+ "required": false,
1235
+ "defaultValue": "true",
1236
+ "description": "Show alpha in the per-stop colour pickers."
1237
+ },
1238
+ "formats": {
1239
+ "type": "ColorFormat[]",
1240
+ "required": false,
1241
+ "defaultValue": "all",
1242
+ "description": "Formats offered in the per-stop colour pickers."
1243
+ },
1244
+ "disabled": {
1245
+ "type": "boolean",
1246
+ "required": false
1247
+ },
1248
+ "labels": {
1249
+ "type": "GradientPickerLabels",
1250
+ "required": false,
1251
+ "description": "Override any user-facing string for i18n."
1252
+ },
1253
+ "className": {
1254
+ "type": "string",
1255
+ "required": false
1256
+ },
1257
+ "id": {
1258
+ "type": "string",
1259
+ "required": false
1260
+ },
1261
+ "style": {
1262
+ "type": "CSSProperties",
1263
+ "required": false
1264
+ },
1265
+ "title": {
1266
+ "type": "string",
1267
+ "required": false
1268
+ },
1269
+ "rel": {
1270
+ "type": "string",
1271
+ "required": false
1272
+ },
1273
+ "onClick": {
1274
+ "type": "MouseEventHandler<HTMLDivElement>",
1275
+ "required": false
1276
+ }
1277
+ },
1278
+ "cssTokens": [
1279
+ "--tui-gradient-bar-height",
1280
+ "--tui-gradient-bar-radius",
1281
+ "--tui-gradient-bar-thumb-size",
1282
+ "--tui-angle-dial-size"
1283
+ ],
1284
+ "story": {
1285
+ "title": "Forms/GradientPicker",
1286
+ "tags": [
1287
+ "autodocs"
1288
+ ]
1289
+ },
1290
+ "subcomponents": null,
1291
+ "description": null,
1292
+ "gotchas": null,
1293
+ "examples": null,
1294
+ "related": null,
1295
+ "use": null,
1296
+ "notFor": null
1297
+ },
1216
1298
  "Icon": {
1217
1299
  "props": {
1218
1300
  "name": {
@@ -1380,7 +1462,9 @@
1380
1462
  "--tui-icon-button-border",
1381
1463
  "--tui-icon-button-radius",
1382
1464
  "--tui-icon-button-bg-interact",
1383
- "--tui-icon-button-fg-interact"
1465
+ "--tui-icon-button-fg-interact",
1466
+ "--tui-icon-button-bg-pressed",
1467
+ "--tui-icon-button-fg-pressed"
1384
1468
  ],
1385
1469
  "story": {
1386
1470
  "title": "Primitives/IconButton",
@@ -1637,6 +1721,11 @@
1637
1721
  "required": false,
1638
1722
  "description": "Maximum number of selections allowed.\nWhen reached, unselected options become disabled."
1639
1723
  },
1724
+ "id": {
1725
+ "type": "string",
1726
+ "required": false,
1727
+ "description": "Optional input ID override, applied to the inner `<input>`.\nUseful for Field integration via htmlFor — Field.Control injects this."
1728
+ },
1640
1729
  "clearable": {
1641
1730
  "type": "boolean",
1642
1731
  "required": false,
@@ -2033,6 +2122,12 @@
2033
2122
  "required": false,
2034
2123
  "description": "Available page size options"
2035
2124
  },
2125
+ "size": {
2126
+ "type": "\"sm\" | \"md\" | \"lg\"",
2127
+ "required": false,
2128
+ "defaultValue": "sm",
2129
+ "description": "Control size — joins the shared control-height ladder (sm/md/lg) that\nButton, IconButton, and the form controls use."
2130
+ },
2036
2131
  "mode": {
2037
2132
  "type": "\"simple\" | \"ends\" | \"full\" | \"smart\"",
2038
2133
  "required": false,
@@ -2364,6 +2459,105 @@
2364
2459
  "use": null,
2365
2460
  "notFor": null
2366
2461
  },
2462
+ "SearchInput": {
2463
+ "props": {
2464
+ "size": {
2465
+ "type": "\"sm\" | \"md\" | \"lg\"",
2466
+ "required": false,
2467
+ "defaultValue": "'md'",
2468
+ "description": "Control size."
2469
+ },
2470
+ "disabled": {
2471
+ "type": "boolean",
2472
+ "required": false
2473
+ },
2474
+ "className": {
2475
+ "type": "string",
2476
+ "required": false,
2477
+ "description": "Additional class name applied to the root wrapper element."
2478
+ },
2479
+ "id": {
2480
+ "type": "string",
2481
+ "required": false
2482
+ },
2483
+ "style": {
2484
+ "type": "CSSProperties",
2485
+ "required": false
2486
+ },
2487
+ "title": {
2488
+ "type": "string",
2489
+ "required": false
2490
+ },
2491
+ "role": {
2492
+ "type": "AriaRole",
2493
+ "required": false
2494
+ },
2495
+ "rel": {
2496
+ "type": "string",
2497
+ "required": false
2498
+ },
2499
+ "onClick": {
2500
+ "type": "MouseEventHandler<HTMLInputElement>",
2501
+ "required": false
2502
+ },
2503
+ "inputClassName": {
2504
+ "type": "string",
2505
+ "required": false,
2506
+ "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."
2507
+ },
2508
+ "value": {
2509
+ "type": "string",
2510
+ "required": false,
2511
+ "description": "Current value (controlled)."
2512
+ },
2513
+ "onValueChange": {
2514
+ "type": "(value: string) => void",
2515
+ "required": false,
2516
+ "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."
2517
+ },
2518
+ "searchLabel": {
2519
+ "type": "string",
2520
+ "required": false,
2521
+ "defaultValue": "Search",
2522
+ "description": "Accessible label for the submit button (only rendered when `onSearch` is\nset)."
2523
+ },
2524
+ "clearLabel": {
2525
+ "type": "string",
2526
+ "required": false,
2527
+ "defaultValue": "Clear search",
2528
+ "description": "Accessible label for the clear button."
2529
+ },
2530
+ "hideClear": {
2531
+ "type": "boolean",
2532
+ "required": false,
2533
+ "defaultValue": "false",
2534
+ "description": "Hide the clear button entirely (e.g. when search runs live and clearing\nhas no meaning)."
2535
+ },
2536
+ "searchIcon": {
2537
+ "type": "ReactNode",
2538
+ "required": false,
2539
+ "description": "Override the leading icon. Defaults to the `system/search` glyph."
2540
+ }
2541
+ },
2542
+ "cssTokens": [
2543
+ "--tui-search-input-button-radius"
2544
+ ],
2545
+ "story": {
2546
+ "title": "Forms/SearchInput",
2547
+ "tags": [
2548
+ "autodocs",
2549
+ "stable",
2550
+ "lms"
2551
+ ]
2552
+ },
2553
+ "subcomponents": null,
2554
+ "description": null,
2555
+ "gotchas": null,
2556
+ "examples": null,
2557
+ "related": null,
2558
+ "use": null,
2559
+ "notFor": null
2560
+ },
2367
2561
  "SegmentedControl": {
2368
2562
  "props": {
2369
2563
  "value": {
@@ -0,0 +1,42 @@
1
+ export type GradientType = 'linear' | 'radial' | 'conic';
2
+ export declare const GRADIENT_TYPES: GradientType[];
3
+ export type GradientStop = {
4
+ /** Any colour string parseColor accepts, or a `var(--x)` reference. */
5
+ color: string;
6
+ /** 0–100, percent along the gradient line. */
7
+ position: number;
8
+ };
9
+ export type Gradient = {
10
+ type: GradientType;
11
+ /** Linear: direction in degrees. Conic: the `from` angle (parsed and
12
+ * re-emitted so it round-trips, even while the UI has no control for it). */
13
+ angle: number;
14
+ /** Radial ellipse radii, percent of the box. */
15
+ sizeX: number;
16
+ sizeY: number;
17
+ /** Radial / conic centre, percent. */
18
+ posX: number;
19
+ posY: number;
20
+ stops: GradientStop[];
21
+ };
22
+ export type ParsedGradient = {
23
+ kind: 'gradient';
24
+ gradient: Gradient;
25
+ } | {
26
+ kind: 'invalid';
27
+ raw: string;
28
+ };
29
+ export declare const DEFAULT_GRADIENT: Gradient;
30
+ export declare function parseGradient(value: string | null | undefined): ParsedGradient;
31
+ /** Stops → the comma list used inside any gradient function. */
32
+ export declare function formatStops(stops: GradientStop[]): string;
33
+ export declare function formatGradient(g: Gradient): string;
34
+ /** Mirror the stops end-to-end (the "reverse" affordance). */
35
+ export declare function reverseStops(stops: GradientStop[]): GradientStop[];
36
+ /**
37
+ * The colour at a position along the stops, interpolated in sRGB — used to
38
+ * seed a newly added stop so it doesn't visibly change the gradient. Stops
39
+ * whose colour can't be resolved (`var(--x)`) end the maths: the nearest
40
+ * stop's colour string is returned verbatim instead.
41
+ */
42
+ export declare function colorAtPosition(stops: GradientStop[], position: number): string;