@motifx-community/ui 0.1.0-beta.0 → 0.1.0-beta.1

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.

Potentially problematic release.


This version of @motifx-community/ui might be problematic. Click here for more details.

Files changed (96) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/components/dropdown/DropDown.d.ts +14 -0
  3. package/dist/components/dropdown/drop-down-props.d.ts +5 -0
  4. package/dist/components/scheduler/view/AgendaView.d.ts +1 -1
  5. package/dist/core/ui-strings.d.ts +2 -0
  6. package/dist/generated/tokens.d.ts +40 -0
  7. package/dist/index.js +133 -15
  8. package/dist/index.js.map +1 -1
  9. package/dist/locales/en.json +1 -0
  10. package/dist/locales/tr.json +1 -0
  11. package/dist/parts/data/DataItems.d.ts +5 -0
  12. package/dist/parts/data/KeyedItems.d.ts +2 -0
  13. package/dist/styles.css +87 -3
  14. package/dist/tokens/index.d.ts +40 -0
  15. package/dist/tokens/index.js +40 -0
  16. package/dist/tokens/index.js.map +1 -1
  17. package/docs/accordion.md +1 -1
  18. package/docs/actionsheet.md +1 -1
  19. package/docs/avatar.md +1 -1
  20. package/docs/badge.md +1 -1
  21. package/docs/bottomsheet.md +1 -1
  22. package/docs/breadcrumb.md +1 -1
  23. package/docs/button.md +1 -1
  24. package/docs/buttongroup.md +1 -1
  25. package/docs/calendar.md +1 -1
  26. package/docs/card.md +1 -1
  27. package/docs/checkbox.md +1 -1
  28. package/docs/chip.md +1 -1
  29. package/docs/colorbox.md +1 -1
  30. package/docs/combobox.md +1 -1
  31. package/docs/control.md +1 -1
  32. package/docs/datagrid-api.md +1 -1
  33. package/docs/datagrid-bands.md +1 -1
  34. package/docs/datagrid-drag-select.md +1 -1
  35. package/docs/datagrid-drag.md +1 -1
  36. package/docs/datagrid-editing.md +1 -1
  37. package/docs/datagrid-filtering.md +1 -1
  38. package/docs/datagrid-forms.md +1 -1
  39. package/docs/datagrid-grouping.md +1 -1
  40. package/docs/datagrid-layout.md +1 -1
  41. package/docs/datagrid-lookups.md +1 -1
  42. package/docs/datagrid-master-detail.md +1 -1
  43. package/docs/datagrid-scrolling.md +1 -1
  44. package/docs/datagrid-selection.md +1 -1
  45. package/docs/datagrid.md +1 -1
  46. package/docs/datebox.md +1 -1
  47. package/docs/drawer.md +1 -1
  48. package/docs/dropdown.md +11 -5
  49. package/docs/filterbuilder.md +1 -1
  50. package/docs/formlayout.md +1 -1
  51. package/docs/home.md +1 -1
  52. package/docs/keyboard.md +1 -1
  53. package/docs/layout.md +1 -1
  54. package/docs/listbox.md +1 -1
  55. package/docs/lookup.md +86 -2
  56. package/docs/menus.md +1 -1
  57. package/docs/numberbox.md +1 -1
  58. package/docs/pagination.md +1 -1
  59. package/docs/progress.md +1 -1
  60. package/docs/radiogroup.md +1 -1
  61. package/docs/rating.md +1 -1
  62. package/docs/scheduler-agenda.md +1 -1
  63. package/docs/scheduler-big-data.md +1 -1
  64. package/docs/scheduler-editing.md +1 -1
  65. package/docs/scheduler-form.md +1 -1
  66. package/docs/scheduler-icalendar.md +1 -1
  67. package/docs/scheduler-mobile.md +1 -1
  68. package/docs/scheduler-recurrence.md +1 -1
  69. package/docs/scheduler-resources.md +1 -1
  70. package/docs/scheduler-timeline.md +1 -1
  71. package/docs/scheduler.md +1 -1
  72. package/docs/showcase.md +1 -1
  73. package/docs/skeleton.md +1 -1
  74. package/docs/slider.md +1 -1
  75. package/docs/switch.md +1 -1
  76. package/docs/tabdocs-dock.md +1 -1
  77. package/docs/tabdocs-drag.md +1 -1
  78. package/docs/tabdocs-menus.md +1 -1
  79. package/docs/tabdocs-mobile.md +1 -1
  80. package/docs/tabdocs-tabs.md +1 -1
  81. package/docs/tabdocs-windows.md +1 -1
  82. package/docs/tabdocs-workspace.md +1 -1
  83. package/docs/tabdocs.md +1 -1
  84. package/docs/tabs.md +1 -1
  85. package/docs/tagbox.md +1 -1
  86. package/docs/textarea.md +1 -1
  87. package/docs/textbox.md +1 -1
  88. package/docs/toast.md +1 -1
  89. package/docs/tokens.md +9 -1
  90. package/docs/toolbar.md +1 -1
  91. package/docs/tooltip.md +1 -1
  92. package/docs/treeview.md +1 -1
  93. package/docs/window.md +1 -1
  94. package/llms-full.txt +181 -83
  95. package/llms.txt +1 -1
  96. package/package.json +2 -2
@@ -8,6 +8,7 @@
8
8
  "close": "Close",
9
9
  "loading": "Loading…",
10
10
  "noItems": "No items",
11
+ "notInList": "Not found in the list",
11
12
  "search": "Search",
12
13
  "notifications": "Notifications",
13
14
  "previousMonth": "Previous month",
@@ -8,6 +8,7 @@
8
8
  "close": "Kapat",
9
9
  "loading": "Yükleniyor…",
10
10
  "noItems": "Öğe yok",
11
+ "notInList": "Listede bulunamadı",
11
12
  "search": "Ara",
12
13
  "notifications": "Bildirimler",
13
14
  "previousMonth": "Önceki ay",
@@ -1,6 +1,7 @@
1
1
  import { type Event as MotifEvent, type IDisposable } from '@motifx/core';
2
2
  import type { data } from '@motifx-community/data';
3
3
  import type { ItemSource } from '../list/item-source';
4
+ import type { KeyedItem } from './keyed-item';
4
5
  type Source<T> = data.DataSource<T, unknown>;
5
6
  /**
6
7
  * The items of a list control, from an array in memory or from a `DataSource` of the data layer
@@ -42,6 +43,10 @@ export declare class DataItems<T> implements ItemSource<T>, IDisposable {
42
43
  */
43
44
  find(value: unknown, valueOf: (item: T) => unknown, same?: (a: unknown, b: unknown) => boolean): Promise<T | undefined>;
44
45
  findLoaded(value: unknown, valueOf: (item: T) => unknown, same?: (a: unknown, b: unknown) => boolean): T | undefined;
46
+ /** What is known of the item `find` asked the data source for: still asked for, found, or not in the source. */
47
+ known(value: unknown): KeyedItem<T> | undefined;
48
+ /** Asks the data source again for the item of `value` after its request failed. */
49
+ retry(value: unknown): Promise<T | undefined>;
45
50
  reload(): Promise<void>;
46
51
  dispose(): void;
47
52
  private detach;
@@ -52,6 +52,8 @@ export declare class KeyedItems<T = unknown> {
52
52
  get(key: unknown): KeyedItem<T> | undefined;
53
53
  /** Asks for the keys not known yet; resolves once every one of them is found or missing. */
54
54
  request(keys: Iterable<unknown>): Promise<void>;
55
+ /** Asks again for the keys whose last request failed (and for those never asked for). */
56
+ retry(keys: Iterable<unknown>): Promise<void>;
55
57
  /** Keeps what an editor chose for a key: its item, or its text. It shows at once, without a request. */
56
58
  remember(key: unknown, itemOrText: T | string): void;
57
59
  /** Items among those known whose text is exactly `text` (case aside, in the locale). */
package/dist/styles.css CHANGED
@@ -404,8 +404,11 @@
404
404
  --mx-drop-down-field-box-cursor: default;
405
405
  --mx-drop-down-search-variant: outline;
406
406
  --mx-drop-down-search-size: sm;
407
+ --mx-drop-down-value-missing-text-decoration: underline;
407
408
  --mx-drop-down-chevron-icon: var(--mx-icon-chevron-down);
408
409
  --mx-drop-down-chevron-open-rotate: 0.5turn;
410
+ --mx-drop-down-spinner-border-end-color: rgb(0 0 0 / 0);
411
+ --mx-drop-down-spinner-shape-display: initial;
409
412
  --mx-field-width: 16rem;
410
413
  --mx-field-variant: outline;
411
414
  --mx-field-label-mode: top;
@@ -1695,6 +1698,9 @@
1695
1698
  --mx-drop-down-field-frame-focus-border-width: var(--mx-border-width-1);
1696
1699
  --mx-drop-down-field-frame-border-bottom-color: var(--mx-color-stroke-control-default);
1697
1700
  --mx-drop-down-chevron-size: var(--mx-icon-size-sm);
1701
+ --mx-drop-down-spinner-size: var(--mx-icon-size-sm);
1702
+ --mx-drop-down-spinner-border-width: var(--mx-border-width-2);
1703
+ --mx-drop-down-spinner-radius: var(--mx-radius-full);
1698
1704
  --mx-field-border-width: var(--mx-border-width-1);
1699
1705
  --mx-field-gap: var(--mx-space-2);
1700
1706
  --mx-field-label-gap: var(--mx-space-1);
@@ -3014,8 +3020,10 @@
3014
3020
  --mx-drop-down-field-box-pressed-color: var(--mx-color-fg-primary);
3015
3021
  --mx-drop-down-field-frame-focus-border-bottom-color: var(--mx-color-accent-solid);
3016
3022
  --mx-drop-down-value-placeholder-color: var(--mx-color-fg-secondary);
3023
+ --mx-drop-down-value-missing-color: var(--mx-color-fg-secondary);
3017
3024
  --mx-drop-down-chevron-color: var(--mx-color-fg-secondary);
3018
3025
  --mx-drop-down-chevron-disabled-color: var(--mx-color-fg-disabled);
3026
+ --mx-drop-down-spinner-color: var(--mx-color-fg-secondary);
3019
3027
  --mx-field-box-bg: var(--mx-color-fill-control-default);
3020
3028
  --mx-field-box-color: var(--mx-color-fg-primary);
3021
3029
  --mx-field-box-hover-bg: var(--mx-color-fill-control-secondary);
@@ -4562,6 +4570,10 @@
4562
4570
  --mx-drop-down-field-box-shadow: 0px 0px 0px 0px rgb(0 0 0 / 0);
4563
4571
  --mx-drop-down-field-frame-focus-border-width: 3px;
4564
4572
  --mx-drop-down-search-variant: filled;
4573
+ --mx-drop-down-spinner-border-width: initial;
4574
+ --mx-drop-down-spinner-border-end-color: initial;
4575
+ --mx-drop-down-spinner-radius: initial;
4576
+ --mx-drop-down-spinner-shape-display: block;
4565
4577
  --mx-field-variant: filled;
4566
4578
  --mx-field-label-mode: floating;
4567
4579
  --mx-field-notch: cut;
@@ -6588,11 +6600,19 @@
6588
6600
  .mx-drop-down, .mx-drop-down__popup {
6589
6601
  --_drop-down-popup-gap: var(--mx-drop-down-popup-gap);
6590
6602
  --_drop-down-value-placeholder-color: var(--mx-drop-down-value-placeholder-color);
6603
+ --_drop-down-value-missing-color: var(--mx-drop-down-value-missing-color);
6604
+ --_drop-down-value-missing-text-decoration: var(--mx-drop-down-value-missing-text-decoration);
6591
6605
  --_drop-down-chevron-size: var(--mx-drop-down-chevron-size);
6592
6606
  --_drop-down-chevron-color: var(--mx-drop-down-chevron-color);
6593
6607
  --_drop-down-chevron-icon: var(--mx-drop-down-chevron-icon);
6594
6608
  --_drop-down-chevron-disabled-color: var(--mx-drop-down-chevron-disabled-color);
6609
+ --_drop-down-spinner-size: var(--mx-drop-down-spinner-size);
6610
+ --_drop-down-spinner-border-width: var(--mx-drop-down-spinner-border-width);
6611
+ --_drop-down-spinner-border-end-color: var(--mx-drop-down-spinner-border-end-color);
6612
+ --_drop-down-spinner-radius: var(--mx-drop-down-spinner-radius);
6613
+ --_drop-down-spinner-color: var(--mx-drop-down-spinner-color);
6595
6614
  --_drop-down-chevron-open-rotate: var(--mx-drop-down-chevron-open-rotate);
6615
+ --_drop-down-spinner-shape-display: var(--mx-drop-down-spinner-shape-display);
6596
6616
  }
6597
6617
 
6598
6618
  .mx-field {
@@ -7821,7 +7841,7 @@
7821
7841
  --_slider-stop-active-bg: var(--mx-slider-stop-active-bg);
7822
7842
  }
7823
7843
 
7824
- .mx-spinner, .mx-button__spinner {
7844
+ .mx-spinner, .mx-button__spinner, .mx-drop-down__spinner {
7825
7845
  --_spinner-gap: var(--mx-spinner-gap);
7826
7846
  --_spinner-cover-padding: var(--mx-spinner-cover-padding);
7827
7847
  --_spinner-cover-background: var(--mx-spinner-cover-background);
@@ -10766,8 +10786,10 @@
10766
10786
  }
10767
10787
 
10768
10788
  /* DropDown: the field shows the chosen item; the list opens on a popup below it. The box's pointer
10769
- and the popup's search box are places. Only the layout is here: the chosen item's text and the
10770
- arrow are units of the drop-down's schema (`$units`), painted by units.css. */
10789
+ and the popup's search box are places. Only the layout is here: the chosen item's text, the
10790
+ arrow and the spinner are units of the drop-down's schema (`$units`), painted by units.css.
10791
+ JS writes data-loading on the root while the value's item is asked for, data-missing on the
10792
+ text when the data source does not have the key. */
10771
10793
  @layer mx.components {
10772
10794
  .mx-drop-down__display {
10773
10795
  display: flex;
@@ -10796,6 +10818,42 @@
10796
10818
  transition: rotate var(--mx-motion-duration-fast) var(--mx-motion-easing-standard);
10797
10819
  }
10798
10820
 
10821
+ /* While the value's item is asked for: the spinner in the arrow's place, no clear button. */
10822
+ .mx-drop-down__spinner {
10823
+ display: none;
10824
+ position: relative;
10825
+ flex: none;
10826
+ animation: mx-drop-down-spin var(--_spinner-duration) linear infinite;
10827
+ }
10828
+
10829
+ /* A shape that becomes the next one, where the language draws the spinner as one (the spinner's shapes). */
10830
+ .mx-drop-down__spinner::before {
10831
+ content: '';
10832
+ position: absolute;
10833
+ inset: 0;
10834
+ clip-path: var(--_spinner-shape-1);
10835
+ animation: mx-spinner-morph var(--_spinner-morph-duration) infinite;
10836
+ }
10837
+
10838
+ .mx-drop-down[data-loading] > :where(.mx-field__box) > * > .mx-drop-down__spinner {
10839
+ display: block;
10840
+ }
10841
+
10842
+ .mx-drop-down[data-loading] > :where(.mx-field__box) > * > :is(.mx-drop-down__chevron, .mx-drop-down__clear) {
10843
+ display: none;
10844
+ }
10845
+
10846
+ /* A key the data source does not have: the key itself, muted and underlined (`missing`); the title tells why. */
10847
+ .mx-drop-down__text[data-missing] {
10848
+ text-decoration-style: dotted;
10849
+ }
10850
+
10851
+ @keyframes mx-drop-down-spin {
10852
+ to {
10853
+ rotate: 1turn;
10854
+ }
10855
+ }
10856
+
10799
10857
  /* The search box stays; the list scrolls. */
10800
10858
  .mx-drop-down__popup {
10801
10859
  display: flex;
@@ -21412,6 +21470,11 @@
21412
21470
  color: var(--_drop-down-value-placeholder-color, inherit);
21413
21471
  }
21414
21472
 
21473
+ .mx-drop-down__text[data-missing] {
21474
+ color: var(--_drop-down-value-missing-color, inherit);
21475
+ text-decoration-line: var(--_drop-down-value-missing-text-decoration, none);
21476
+ }
21477
+
21415
21478
  .mx-drop-down__chevron {
21416
21479
  inline-size: var(--_drop-down-chevron-size, auto);
21417
21480
  block-size: var(--_drop-down-chevron-size, auto);
@@ -21427,6 +21490,27 @@
21427
21490
  color: var(--_drop-down-chevron-disabled-color, var(--_drop-down-chevron-color, inherit));
21428
21491
  }
21429
21492
 
21493
+ .mx-drop-down__spinner {
21494
+ inline-size: var(--_drop-down-spinner-size, auto);
21495
+ block-size: var(--_drop-down-spinner-size, auto);
21496
+ border-style: solid;
21497
+ border-block-start-width: var(--_drop-down-spinner-border-width, 0px);
21498
+ border-inline-end-width: var(--_drop-down-spinner-border-width, 0px);
21499
+ border-block-end-width: var(--_drop-down-spinner-border-width, 0px);
21500
+ border-inline-start-width: var(--_drop-down-spinner-border-width, 0px);
21501
+ border-inline-end-color: var(--_drop-down-spinner-border-end-color, currentcolor);
21502
+ border-start-start-radius: var(--_drop-down-spinner-radius, 0px);
21503
+ border-start-end-radius: var(--_drop-down-spinner-radius, 0px);
21504
+ border-end-start-radius: var(--_drop-down-spinner-radius, 0px);
21505
+ border-end-end-radius: var(--_drop-down-spinner-radius, 0px);
21506
+ color: var(--_drop-down-spinner-color, inherit);
21507
+ }
21508
+
21509
+ .mx-drop-down__spinner::before {
21510
+ display: var(--_drop-down-spinner-shape-display, none);
21511
+ background-color: currentcolor;
21512
+ }
21513
+
21430
21514
  :where(.mx-field) > .mx-field__box {
21431
21515
  min-block-size: var(--_box-height);
21432
21516
  padding-inline-end: var(--_padding-end);
@@ -6351,6 +6351,16 @@ export declare const tokens: {
6351
6351
  readonly type: 'color';
6352
6352
  readonly layer: 'component';
6353
6353
  };
6354
+ readonly 'drop-down.value.missing.color': {
6355
+ readonly cssVar: '--mx-drop-down-value-missing-color';
6356
+ readonly type: 'color';
6357
+ readonly layer: 'component';
6358
+ };
6359
+ readonly 'drop-down.value.missing.text-decoration': {
6360
+ readonly cssVar: '--mx-drop-down-value-missing-text-decoration';
6361
+ readonly type: 'keyword';
6362
+ readonly layer: 'component';
6363
+ };
6354
6364
  readonly 'drop-down.chevron.size': {
6355
6365
  readonly cssVar: '--mx-drop-down-chevron-size';
6356
6366
  readonly type: 'dimension';
@@ -6376,6 +6386,36 @@ export declare const tokens: {
6376
6386
  readonly type: 'color';
6377
6387
  readonly layer: 'component';
6378
6388
  };
6389
+ readonly 'drop-down.spinner.size': {
6390
+ readonly cssVar: '--mx-drop-down-spinner-size';
6391
+ readonly type: 'dimension';
6392
+ readonly layer: 'component';
6393
+ };
6394
+ readonly 'drop-down.spinner.border-width': {
6395
+ readonly cssVar: '--mx-drop-down-spinner-border-width';
6396
+ readonly type: 'dimension';
6397
+ readonly layer: 'component';
6398
+ };
6399
+ readonly 'drop-down.spinner.border-end-color': {
6400
+ readonly cssVar: '--mx-drop-down-spinner-border-end-color';
6401
+ readonly type: 'color';
6402
+ readonly layer: 'component';
6403
+ };
6404
+ readonly 'drop-down.spinner.radius': {
6405
+ readonly cssVar: '--mx-drop-down-spinner-radius';
6406
+ readonly type: 'dimension';
6407
+ readonly layer: 'component';
6408
+ };
6409
+ readonly 'drop-down.spinner.color': {
6410
+ readonly cssVar: '--mx-drop-down-spinner-color';
6411
+ readonly type: 'color';
6412
+ readonly layer: 'component';
6413
+ };
6414
+ readonly 'drop-down.spinner-shape.display': {
6415
+ readonly cssVar: '--mx-drop-down-spinner-shape-display';
6416
+ readonly type: 'keyword';
6417
+ readonly layer: 'component';
6418
+ };
6379
6419
  readonly 'field.width': {
6380
6420
  readonly cssVar: '--mx-field-width';
6381
6421
  readonly type: 'dimension';
@@ -6347,6 +6347,16 @@ var componentTokens = {
6347
6347
  type: "color",
6348
6348
  layer: "component"
6349
6349
  },
6350
+ "drop-down.value.missing.color": {
6351
+ cssVar: "--mx-drop-down-value-missing-color",
6352
+ type: "color",
6353
+ layer: "component"
6354
+ },
6355
+ "drop-down.value.missing.text-decoration": {
6356
+ cssVar: "--mx-drop-down-value-missing-text-decoration",
6357
+ type: "keyword",
6358
+ layer: "component"
6359
+ },
6350
6360
  "drop-down.chevron.size": {
6351
6361
  cssVar: "--mx-drop-down-chevron-size",
6352
6362
  type: "dimension",
@@ -6372,6 +6382,36 @@ var componentTokens = {
6372
6382
  type: "color",
6373
6383
  layer: "component"
6374
6384
  },
6385
+ "drop-down.spinner.size": {
6386
+ cssVar: "--mx-drop-down-spinner-size",
6387
+ type: "dimension",
6388
+ layer: "component"
6389
+ },
6390
+ "drop-down.spinner.border-width": {
6391
+ cssVar: "--mx-drop-down-spinner-border-width",
6392
+ type: "dimension",
6393
+ layer: "component"
6394
+ },
6395
+ "drop-down.spinner.border-end-color": {
6396
+ cssVar: "--mx-drop-down-spinner-border-end-color",
6397
+ type: "color",
6398
+ layer: "component"
6399
+ },
6400
+ "drop-down.spinner.radius": {
6401
+ cssVar: "--mx-drop-down-spinner-radius",
6402
+ type: "dimension",
6403
+ layer: "component"
6404
+ },
6405
+ "drop-down.spinner.color": {
6406
+ cssVar: "--mx-drop-down-spinner-color",
6407
+ type: "color",
6408
+ layer: "component"
6409
+ },
6410
+ "drop-down.spinner-shape.display": {
6411
+ cssVar: "--mx-drop-down-spinner-shape-display",
6412
+ type: "keyword",
6413
+ layer: "component"
6414
+ },
6375
6415
  "field.width": {
6376
6416
  cssVar: "--mx-field-width",
6377
6417
  type: "dimension",