@bitforgehq/ui 0.4.0 → 0.5.0-next.3

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 (80) hide show
  1. package/CHANGELOG.md +303 -0
  2. package/README.md +12 -12
  3. package/ai/MANIFEST.index.json +65 -2
  4. package/ai/MANIFEST.json +2221 -737
  5. package/ai/REFERENCE.index.json +161 -0
  6. package/ai/REFERENCE.json +1336 -27
  7. package/ai/UI_GUIDE.md +61 -20
  8. package/ai/components/app-frame.md +1 -1
  9. package/ai/components/chat-composer.md +357 -0
  10. package/ai/components/chat-message.md +251 -0
  11. package/ai/components/chat-thread.md +521 -0
  12. package/ai/components/checkbox.md +7 -0
  13. package/ai/components/combobox.md +12 -0
  14. package/ai/components/date-input.md +9 -0
  15. package/ai/components/datetime-input.md +2 -0
  16. package/ai/components/field.md +10 -0
  17. package/ai/components/file-input.md +498 -0
  18. package/ai/components/header.md +1 -1
  19. package/ai/components/image-input.md +368 -0
  20. package/ai/components/image-viewer.md +309 -0
  21. package/ai/components/media-card.md +478 -0
  22. package/ai/components/menu-button.md +2 -0
  23. package/ai/components/menu.md +10 -0
  24. package/ai/components/multi-combobox.md +7 -0
  25. package/ai/components/nav-group.md +10 -3
  26. package/ai/components/nav-item.md +11 -2
  27. package/ai/components/number-input.md +2 -7
  28. package/ai/components/popover.md +13 -0
  29. package/ai/components/radio-group.md +6 -0
  30. package/ai/components/segmented.md +14 -2
  31. package/ai/components/select.md +100 -42
  32. package/ai/components/sidebar-toggle.md +16 -9
  33. package/ai/components/sidebar.md +41 -13
  34. package/ai/components/tab-group.md +18 -2
  35. package/ai/components/table.md +17 -2
  36. package/ai/components/theme-menu-button.md +1 -0
  37. package/ai/components/time-input.md +2 -0
  38. package/ai/components/toolbar.md +7 -18
  39. package/ai/reference/bf-chat-composer-harness.md +64 -0
  40. package/ai/reference/bf-chat-message-role.md +27 -0
  41. package/ai/reference/bf-chat-message-status.md +28 -0
  42. package/ai/reference/bf-fade-in-directive.md +18 -0
  43. package/ai/reference/bf-file-input-harness.md +67 -0
  44. package/ai/reference/bf-file-input-variant.md +27 -0
  45. package/ai/reference/bf-image-input-harness.md +67 -0
  46. package/ai/reference/bf-image-input-shape.md +27 -0
  47. package/ai/reference/bf-image-viewer-actions-context.md +29 -0
  48. package/ai/reference/bf-image-viewer-harness.md +87 -0
  49. package/ai/reference/bf-image-viewer-image.md +25 -0
  50. package/ai/reference/bf-image-viewer-options.md +33 -0
  51. package/ai/reference/bf-image-viewer-origin.md +23 -0
  52. package/ai/reference/bf-image-viewer-ref.md +55 -0
  53. package/ai/reference/bf-image-viewer-service.md +32 -0
  54. package/ai/reference/bf-labels.md +105 -75
  55. package/ai/reference/bf-media-card-aspect.md +28 -0
  56. package/ai/reference/bf-media-card-harness.md +66 -0
  57. package/ai/reference/bf-motion-list-directive.md +22 -0
  58. package/ai/reference/bf-prose-directive.md +16 -0
  59. package/ai/reference/bf-rejected-file-reason.md +28 -0
  60. package/ai/reference/bf-rejected-file.md +28 -0
  61. package/ai/reference/bf-select-harness.md +14 -5
  62. package/ai/reference/bf-select-option.md +2 -0
  63. package/ai/reference/bf-size.md +3 -0
  64. package/ai/reference/bf_table_sort_select.md +23 -0
  65. package/ai/reference/provide-bf-labels.md +10 -3
  66. package/ai/reference/provide-bf-select.md +20 -0
  67. package/bin/bf-ui.js +1 -0
  68. package/fesm2022/bitforgehq-ui-overlay.mjs +2649 -606
  69. package/fesm2022/bitforgehq-ui-overlay.mjs.map +1 -1
  70. package/fesm2022/bitforgehq-ui-testing.mjs +356 -10
  71. package/fesm2022/bitforgehq-ui-testing.mjs.map +1 -1
  72. package/fesm2022/bitforgehq-ui.mjs +7531 -3989
  73. package/fesm2022/bitforgehq-ui.mjs.map +1 -1
  74. package/llms-full.txt +4151 -130
  75. package/llms.txt +31 -1
  76. package/package.json +1 -1
  77. package/theme.css +60 -0
  78. package/types/bitforgehq-ui-overlay.d.ts +684 -7
  79. package/types/bitforgehq-ui-testing.d.ts +434 -6
  80. package/types/bitforgehq-ui.d.ts +1473 -182
@@ -4,8 +4,11 @@ Test harness for the select: reads its label and options and picks one
4
4
 
5
5
  Class from `@bitforgehq/ui/testing` · since 0.3.0
6
6
 
7
- Harness for `bf-select`. It works by option label, so a test never needs the native option
8
- values (an object option's native value is its index).
7
+ Harness for `bf-select`, in both modes: the styled list under a mouse (its options render in the
8
+ CDK overlay container while open, found through the field's `aria-controls`) and the native
9
+ `<select>` under a coarse pointer. It also drives the native select with `data-bf-select` that a
10
+ stacked `bf-table` renders as its Sort by select without `provideBfSelect()`. It works by option
11
+ label, so a test never needs the option values (an object option's native value is its index).
9
12
 
10
13
  ```ts
11
14
  import { BfSelectHarness } from '@bitforgehq/ui/testing';
@@ -23,6 +26,11 @@ class BfSelectHarness extends ComponentHarness
23
26
 
24
27
  The visible label without the required mark, else the `aria-label`.
25
28
 
29
+ ### `isOpen(): Promise<boolean>`
30
+
31
+ Whether the styled option list is open (`aria-expanded`). Always false for the native select,
32
+ whose list belongs to the platform.
33
+
26
34
  ### `getValueLabel(): Promise<string>`
27
35
 
28
36
  The selected option's label, `''` while nothing is selected.
@@ -35,7 +43,8 @@ The labels of the options, in order, without the placeholder.
35
43
 
36
44
  Chooses the option with this label, as a user would: the select's `value` becomes that
37
45
  option's value. Throws, leaving the value as it is, for an unknown or disabled option and
38
- while the select itself is disabled.
46
+ while the select itself is disabled. On a read-only select it changes nothing, in both modes:
47
+ the styled list does not open, and the native select restores the shown option.
39
48
 
40
49
  | Parameter | Type | Description |
41
50
  | --------- | -------- | ------------------- |
@@ -63,11 +72,11 @@ The help text under the select; it is hidden while an error shows.
63
72
 
64
73
  ### `focus(): Promise<void>`
65
74
 
66
- Focuses the native select.
75
+ Focuses the field, or the native select.
67
76
 
68
77
  ### `blur(): Promise<void>`
69
78
 
70
- Blurs the native select, which marks a bound form field touched.
79
+ Blurs the field, or the native select, which marks a bound form field touched.
71
80
 
72
81
  ## Used by
73
82
 
@@ -4,6 +4,8 @@ One choice of a select with its value, its label and a disabled flag
4
4
 
5
5
  Interface from `@bitforgehq/ui` · since 0.1.0
6
6
 
7
+ Also exported from `@bitforgehq/ui/overlay`.
8
+
7
9
  One choice of `bf-select`; `value` is any type (a string by default).
8
10
 
9
11
  ```ts
@@ -27,6 +27,7 @@ type BfSize = 'sm' | 'md' | 'lg'
27
27
  - [bf-button](../components/button.md)
28
28
  - [BfButtonSize](bf-button-size.md)
29
29
  - [bf-calendar](../components/calendar.md)
30
+ - [bf-chat-composer](../components/chat-composer.md)
30
31
  - [bf-checkbox](../components/checkbox.md)
31
32
  - [bf-chip](../components/chip.md)
32
33
  - [bf-combobox](../components/combobox.md)
@@ -36,7 +37,9 @@ type BfSize = 'sm' | 'md' | 'lg'
36
37
  - [BfDefaultsOptions](bf-defaults-options.md)
37
38
  - [BfFieldControlState](bf-field-control-state.md)
38
39
  - [BfFieldSize](bf-field-size.md)
40
+ - [bf-file-input](../components/file-input.md)
39
41
  - [bf-icon-button](../components/icon-button.md)
42
+ - [bf-image-input](../components/image-input.md)
40
43
  - [bf-input](../components/input.md)
41
44
  - [bf-menu-button](../components/menu-button.md)
42
45
  - [bf-menu](../components/menu.md)
@@ -0,0 +1,23 @@
1
+ # BF_TABLE_SORT_SELECT
2
+
3
+ The component a stacked table renders as its Sort by select
4
+
5
+ Injection token from `@bitforgehq/ui` · since 0.5.0
6
+
7
+ The component a stacked `bf-table` renders as its Sort by select; `null` (the default) keeps the
8
+ built-in native `<select>`. `provideBfSelect()` from `@bitforgehq/ui/overlay` sets it to the
9
+ styled `bf-select`, so the core entry never imports the overlay entry. A component given here
10
+ must take the inputs `label` (string), `options` (`BfSelectOption<string>[]`) and `value`
11
+ (string) and emit the picked value from the output `changed`. The table adds its layout classes
12
+ to the component's host with `classList`, so the component must not overwrite its host
13
+ `className` or `class` attribute directly.
14
+
15
+ ```ts
16
+ import { BF_TABLE_SORT_SELECT } from '@bitforgehq/ui';
17
+ ```
18
+
19
+ ## Signature
20
+
21
+ ```ts
22
+ const BF_TABLE_SORT_SELECT: InjectionToken<Type<unknown> | null>
23
+ ```
@@ -17,9 +17,16 @@ every string. In a component's `providers` it covers that sub-tree's widgets and
17
17
  `dateInputUnavailable`, `timeInputHour`, `timeInputMinute`, `timeInputSecond`,
18
18
  `timeInputDayPeriod`, `timeInputOpenList`, `timeInputInvalid`, `timeInputMin`, `timeInputMax`,
19
19
  `chart`, `chartLegend`, `chartValues`, `chartShowData`, `chartHideData`, `chartCategory`,
20
- `chartValue`, `chartEmpty`, `chartError`, `listItemUnread`, `validation`); the overlay services (`ok`, `cancel`,
21
- `actions`, `sheet`, `modal`, `close`, `expand`, `collapse`, `sheetPosition`, `dialog`,
22
- `notifications`) are root singletons and pick it up only when the caller passes its injector:
20
+ `chartValue`, `chartEmpty`, `chartError`, `listItemUnread`,
21
+ `fileInputChoose`, `fileInputDropHint`, `fileInputDropzone`, `fileInputTapToChoose`, `fileInputRemove`,
22
+ `fileInputDismiss`, `fileInputAdded`, `fileInputNotAdded`, `fileInputRemoved`, `fileInputCount`,
23
+ `fileRejectedType`, `fileRejectedSize`, `fileRejectedCount`,
24
+ `imageInputChoose`, `imageInputUpload`, `imageInputReplace`, `imageInputRemove`,
25
+ `chatThread`, `chatJumpToLatest`, `chatMessageStopped`, `chatMessageFailed`, `chatComposer`,
26
+ `chatSend`, `chatStop`, `mediaCardSelect`, `imageLoadFailed`, `validation`); the overlay
27
+ services (`ok`, `cancel`, `actions`, `sheet`, `modal`, `close`, `expand`, `collapse`,
28
+ `sheetPosition`, `dialog`, `notifications`, `imageViewer`, `imageViewerPrevious`,
29
+ `imageViewerNext`, `imageViewerPosition`) are root singletons and pick it up only when the caller passes its injector:
23
30
  `open(…, { injector: inject(Injector) })`.
24
31
 
25
32
  ```ts
@@ -0,0 +1,20 @@
1
+ # provideBfSelect
2
+
3
+ Makes a stacked table's Sort by select the styled bf-select, app-wide
4
+
5
+ Function from `@bitforgehq/ui/overlay` · since 0.5.0
6
+
7
+ Makes the library's built-in selects use the styled `bf-select`: a stacked `bf-table` then
8
+ renders its Sort by select as a `bf-select` (the native `<select>` under a coarse pointer, as
9
+ `bf-select` itself does) instead of the plain native one. Add it to
10
+ `ApplicationConfig.providers`.
11
+
12
+ ```ts
13
+ import { provideBfSelect } from '@bitforgehq/ui/overlay';
14
+ ```
15
+
16
+ ## Signature
17
+
18
+ ```ts
19
+ function provideBfSelect(): EnvironmentProviders
20
+ ```
package/bin/bf-ui.js CHANGED
@@ -120,6 +120,7 @@ const PAIRS = [
120
120
  { fg: 'primary-strong', bg: 'surface', min: TEXT, use: 'text button hover, radio dot' },
121
121
  { fg: 'primary-strong', bg: 'surface-sunken', min: NON_TEXT, use: 'segment cue, progress' },
122
122
  { fg: 'primary-strong', bg: 'surface-muted', min: NON_TEXT, use: 'read-only toggle and radio' },
123
+ { fg: 'text', bg: 'primary-soft', min: TEXT, use: 'chat user message bubble' },
123
124
  { fg: 'text', bg: 'primary-soft-pressed', min: TEXT, use: 'outline button pressed' },
124
125
  { fg: 'ring', bg: 'bg', min: NON_TEXT, use: 'focus ring' },
125
126
  { fg: 'ring', bg: 'surface', min: NON_TEXT, use: 'focus ring on a card' },