@economic/taco 2.27.2 → 2.28.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. package/dist/components/Calendar/Calendar.d.ts +4 -9
  2. package/dist/components/Checkbox/Checkbox.d.ts +2 -2
  3. package/dist/components/Icon/components/LinkExternal.d.ts +3 -0
  4. package/dist/components/Icon/components/index.d.ts +1 -1
  5. package/dist/components/Input/Input.d.ts +1 -1
  6. package/dist/components/List/List.d.ts +28 -0
  7. package/dist/components/List/components/Button.d.ts +8 -0
  8. package/dist/components/List/components/Collapsible.d.ts +10 -0
  9. package/dist/components/List/components/Group.d.ts +7 -0
  10. package/dist/components/List/components/Item.d.ts +22 -0
  11. package/dist/components/List/components/Link.d.ts +8 -0
  12. package/dist/components/List/components/Toggle.d.ts +8 -0
  13. package/dist/components/Menu/components/Item.d.ts +1 -1
  14. package/dist/components/Menu/components/Link.d.ts +1 -1
  15. package/dist/components/Navigation2/components/Link.d.ts +1 -1
  16. package/dist/components/Select2/components/Option.d.ts +2 -2
  17. package/dist/components/Select2/components/Search.d.ts +1 -1
  18. package/dist/components/Switch/Switch.d.ts +2 -2
  19. package/dist/components/Tag/Tag.d.ts +1 -1
  20. package/dist/esm/index.css +63 -51
  21. package/dist/esm/packages/taco/src/components/Calendar/Calendar.js +62 -39
  22. package/dist/esm/packages/taco/src/components/Calendar/Calendar.js.map +1 -1
  23. package/dist/esm/packages/taco/src/components/Checkbox/Checkbox.js.map +1 -1
  24. package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js.map +1 -1
  25. package/dist/esm/packages/taco/src/components/Drawer/components/Content.js +1 -1
  26. package/dist/esm/packages/taco/src/components/Drawer/components/Content.js.map +1 -1
  27. package/dist/esm/packages/taco/src/components/Icon/components/LinkExternal.js +22 -0
  28. package/dist/esm/packages/taco/src/components/Icon/components/LinkExternal.js.map +1 -0
  29. package/dist/esm/packages/taco/src/components/Icon/components/index.js +2 -0
  30. package/dist/esm/packages/taco/src/components/Icon/components/index.js.map +1 -1
  31. package/dist/esm/packages/taco/src/components/List/List.js +21 -0
  32. package/dist/esm/packages/taco/src/components/List/List.js.map +1 -0
  33. package/dist/esm/packages/taco/src/components/List/components/Button.js +12 -0
  34. package/dist/esm/packages/taco/src/components/List/components/Button.js.map +1 -0
  35. package/dist/esm/packages/taco/src/components/List/components/Collapsible.js +30 -0
  36. package/dist/esm/packages/taco/src/components/List/components/Collapsible.js.map +1 -0
  37. package/dist/esm/packages/taco/src/components/List/components/Group.js +11 -0
  38. package/dist/esm/packages/taco/src/components/List/components/Group.js.map +1 -0
  39. package/dist/esm/packages/taco/src/components/List/components/Item.js +40 -0
  40. package/dist/esm/packages/taco/src/components/List/components/Item.js.map +1 -0
  41. package/dist/esm/packages/taco/src/components/List/components/Link.js +17 -0
  42. package/dist/esm/packages/taco/src/components/List/components/Link.js.map +1 -0
  43. package/dist/esm/packages/taco/src/components/List/components/Toggle.js +94 -0
  44. package/dist/esm/packages/taco/src/components/List/components/Toggle.js.map +1 -0
  45. package/dist/esm/packages/taco/src/components/Provider/Localization.js +2 -2
  46. package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
  47. package/dist/esm/packages/taco/src/components/Switch/Switch.js.map +1 -1
  48. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js +1 -1
  49. package/dist/esm/packages/taco/src/index.js +2 -1
  50. package/dist/esm/packages/taco/src/index.js.map +1 -1
  51. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/Body.js +1 -1
  52. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/Body.js.map +1 -1
  53. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Selection.js +2 -2
  54. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Selection.js.map +1 -1
  55. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.js +1 -1
  56. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.js.map +1 -1
  57. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.js +1 -1
  58. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/Print.js +1 -1
  59. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/Print.js.map +1 -1
  60. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Search/Search.js +2 -2
  61. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Search/Search.js.map +1 -1
  62. package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -1
  63. package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js +12 -45
  64. package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js.map +1 -1
  65. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js +3 -7
  66. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js.map +1 -1
  67. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableServerLoadingListener.js +2 -1
  68. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableServerLoadingListener.js.map +1 -1
  69. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js +1 -1
  70. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js.map +1 -1
  71. package/dist/index.css +63 -51
  72. package/dist/index.d.ts +1 -0
  73. package/dist/primitives/Table/types.d.ts +7 -6
  74. package/dist/primitives/Table/useTableDataLoader.d.ts +4 -5
  75. package/dist/primitives/Table/useTableManager/listeners/useTableSearchListener.d.ts +1 -2
  76. package/dist/taco.cjs.development.js +366 -179
  77. package/dist/taco.cjs.development.js.map +1 -1
  78. package/dist/taco.cjs.production.min.js +1 -1
  79. package/dist/taco.cjs.production.min.js.map +1 -1
  80. package/package.json +4 -3
package/dist/index.css CHANGED
@@ -200,73 +200,35 @@
200
200
  @apply -mr-2 ml-0;
201
201
  }
202
202
 
203
- [data-taco='calendar'] .DayPicker-wrapper {
204
- @apply relative select-none flex-row;
203
+ [data-taco='calendar'] .rdp {
204
+ @apply select-none;
205
205
  }
206
-
207
- [data-taco='calendar'] .DayPicker-Months {
208
- @apply flex flex-wrap justify-center;
209
- }
210
-
211
- [data-taco='calendar'] .DayPicker-Month {
212
- @apply m-0 flex border-collapse select-none flex-col;
213
- }
214
-
215
- [data-taco='calendar'] .DayPicker-Weekdays {
216
- @apply flex h-10 items-center;
217
- }
218
-
219
- [data-taco='calendar'] .DayPicker-WeekdaysRow {
220
- @apply flex w-full justify-between;
206
+ [data-taco='calendar'] .rdp-head {
207
+ @apply h-6;
221
208
  }
222
209
 
223
- [data-taco='calendar'] .DayPicker-Weekday {
224
- @apply text-grey-700 flex-grow text-center uppercase;
210
+ [data-taco='calendar'] .rdp-head_cell {
211
+ @apply text-grey-700 flex-grow text-center font-medium uppercase;
225
212
  }
226
213
 
227
- [data-taco='calendar'] .DayPicker-Weekday abbr[title] {
228
- @apply no-underline;
214
+ [data-taco='calendar'] .rdp-day {
215
+ @apply hover:wcag-grey-200 flex h-10 w-10 cursor-pointer items-center justify-center rounded-full;
229
216
  }
230
217
 
231
- [data-taco='calendar'] .DayPicker-Body {
232
- @apply flex flex-col;
233
- }
234
-
235
- [data-taco='calendar'] .DayPicker-Week {
236
- @apply flex w-full justify-between;
237
- }
238
-
239
- [data-taco='calendar'] .DayPicker-Day {
240
- @apply flex h-10 w-10 cursor-pointer items-center justify-center rounded-full;
241
- }
242
-
243
- [data-taco='calendar'] .DayPicker--interactionDisabled .DayPicker-Day {
244
- @apply cursor-default;
245
- }
246
-
247
- [data-taco='calendar'] .DayPicker-Footer {
248
- @apply pt-1 text-center;
249
- }
250
-
251
- [data-taco='calendar'] .DayPicker-TodayButton {
252
- @apply cursor-pointer border-none bg-transparent text-xs text-blue-500;
218
+ [data-taco='calendar'] .rdp-day_today {
219
+ @apply font-bold text-blue-500;
253
220
  }
254
221
 
255
- [data-taco='calendar'] .DayPicker-TodayButton:hover {
256
- @apply text-blue-300;
222
+ [data-taco='calendar'] .rdp-day_selected {
223
+ @apply wcag-grey-200;
257
224
  }
258
225
 
259
226
  /* Default modifiers */
260
-
261
- [data-taco='calendar'] .DayPicker-Day--today {
262
- @apply font-bold text-blue-500;
263
- }
264
-
265
227
  [data-taco='calendar'] .DayPicker-Day--outside {
266
228
  @apply text-grey-300 cursor-default;
267
229
  }
268
230
 
269
- [data-taco='calendar'] .DayPicker-Day--disabled {
231
+ [data-taco='calendar'] .rdp-day_disabled {
270
232
  @apply text-grey-300 pointer-events-none cursor-default;
271
233
  }
272
234
 
@@ -456,6 +418,56 @@
456
418
  @apply mb-0;
457
419
  }
458
420
 
421
+ [data-taco='list'] {
422
+ @apply flex flex-col gap-y-2;
423
+ }
424
+
425
+ [data-taco='list-item'] {
426
+ @apply border-grey-300 flex w-full items-center gap-x-3 rounded-lg border bg-white p-3 text-left;
427
+ }
428
+
429
+ [data-taco='list-item']:focus-visible {
430
+ @apply yt-focus z-10;
431
+ }
432
+
433
+ [data-taco='list-item']:not([aria-disabled]):hover {
434
+ @apply cursor-pointer bg-black/[0.08];
435
+ }
436
+
437
+ [data-taco='list-item'][aria-disabled] {
438
+ @apply pointer-events-none opacity-50;
439
+ }
440
+
441
+ [data-taco='list-item-collapsible']:has([data-taco='list-item']:focus-visible) {
442
+ @apply z-10;
443
+ }
444
+
445
+ [data-taco='list-item-collapsible'] > [data-taco='list-item'][aria-expanded='true']:not(:focus-visible) {
446
+ @apply rounded-b-none border-b-transparent;
447
+ }
448
+
449
+ [data-taco='list-item-collapsible'] > div {
450
+ @apply border-grey-300 rounded-b-lg border border-t-0 bg-white p-3;
451
+ }
452
+
453
+ [data-taco='list-group'] {
454
+ @apply flex flex-col;
455
+ }
456
+
457
+ [data-taco='list-group'] > [data-taco='list-item']:not(:first-child):not(:focus-visible),
458
+ [data-taco='list-group'] > [data-taco='list-item-collapsible']:not(:first-child) [data-taco='list-item']:not(:focus-visible) {
459
+ @apply !rounded-t-none border-t-transparent;
460
+ }
461
+
462
+ [data-taco='list-group'] > [data-taco='list-item']:not(:last-child):not(:focus-visible),
463
+ [data-taco='list-group'] > [data-taco='list-item-collapsible']:not(:last-child) [data-taco='list-item']:not(:focus-visible) {
464
+ @apply !rounded-b-none;
465
+ }
466
+
467
+ [data-taco='list-group'] > [data-taco='list-item-collapsible']:not(:last-child) > div {
468
+ @apply rounded-b-none;
469
+ }
470
+
459
471
  .yt-navigation__item a,
460
472
  .yt-navigation__item .yt-navigation__item__postfix {
461
473
  @apply text-black;
package/dist/index.d.ts CHANGED
@@ -22,6 +22,7 @@ export * from './components/HoverCard/HoverCard';
22
22
  export * from './components/Icon/Icon';
23
23
  export * from './components/IconButton/IconButton';
24
24
  export * from './components/Input/Input';
25
+ export * from './components/List/List';
25
26
  export * from './components/Listbox/Listbox';
26
27
  export * from './components/Menu/Menu';
27
28
  export * from './components/ModeSwitch/ModeSwitch';
@@ -3,6 +3,7 @@ import { ColumnFilter as ReactTableColumnFilter, ColumnFiltersState as ReactTabl
3
3
  import { FontSize, FontSizes, ValueOf } from '../../types';
4
4
  import { MenuProps } from '../../components/Menu/Menu';
5
5
  import { MenuItemProps } from '../../components/Menu/components/Item';
6
+ declare type TODO = any;
6
7
  export declare type TableRef = HTMLTableElement & {
7
8
  instance: {
8
9
  resetFiltering: () => void;
@@ -80,16 +81,15 @@ export declare type TableShortcutHandlerObject<TType = unknown> = {
80
81
  meta?: boolean;
81
82
  shift?: boolean;
82
83
  };
83
- export declare type TableFilterHandler = (filters: TableColumnFilter[]) => void | Promise<void>;
84
+ export declare type TableFilterHandler = (filters: TableColumnFilter[]) => void;
84
85
  export declare type TableFontSize = keyof typeof FontSizes;
85
86
  export declare type TablePreset = 'complex' | 'list' | 'simple';
86
87
  export declare type TableRowExpansionRenderer<TType = unknown> = (row: TType) => (() => JSX.Element) | null;
87
88
  export declare type TableScrollToIndexHandler = (index: number, options?: {
88
89
  align: 'start' | 'center' | 'end' | 'auto';
89
90
  }) => void;
90
- export declare type TableSearchHandler = (search: string | undefined) => void | Promise<void>;
91
- export declare type TableServerLoadPageHandler = (pageIndex: number, sorting: TableColumnSort[], filters: TableColumnFilter[]) => Promise<void>;
92
- export declare type TableServerLoadAllHandler = (sorting: TableColumnSort[], filters: TableColumnFilter[]) => Promise<void>;
91
+ export declare type TableServerLoadPageHandler = (pageIndex: number, sorting: TableColumnSort[], filters: TableColumnFilter[], search: string | undefined) => Promise<void>;
92
+ export declare type TableServerLoadAllHandler = (sorting: TableColumnSort[], filters: TableColumnFilter[], search: string | undefined) => Promise<void>;
93
93
  export declare enum TableServerLoadAllState {
94
94
  Incomplete = 0,
95
95
  Loading = 1,
@@ -97,7 +97,7 @@ export declare enum TableServerLoadAllState {
97
97
  }
98
98
  export declare type TableSettingsHandler = (settings: TableSettings) => void | Promise<void>;
99
99
  export declare type TableShortcuts<TType = unknown> = Record<string, TableShortcutHandlerFn<TType> | TableShortcutHandlerObject<TType>>;
100
- export declare type TableSortHandler = (sorting: TableColumnSort[]) => void | Promise<void>;
100
+ export declare type TableSortHandler = (sorting: TableColumnSort[]) => void;
101
101
  export declare type TableCustomSettingsRenderer = (props: TableSettings) => React.ReactElement<MenuItemProps>[];
102
102
  export declare type TableEmptyStateRenderer = () => JSX.Element | null;
103
103
  export declare type TableSettings = {
@@ -172,7 +172,7 @@ export declare type TableCommonProps<TType = unknown> = TableFeatureProps & {
172
172
  onRowGoto?: TableRowGotoHandler;
173
173
  onRowSelect?: TableRowSelectHandler<TType>;
174
174
  onChangeFilter?: TableFilterHandler;
175
- onChangeSearch?: TableSearchHandler;
175
+ onChangeSearch?: TODO;
176
176
  onChangeSettings?: TableSettingsHandler;
177
177
  onChangeSort?: TableSortHandler;
178
178
  };
@@ -374,3 +374,4 @@ export declare type TableTexts = {
374
374
  tooltip: string;
375
375
  };
376
376
  };
377
+ export {};
@@ -1,10 +1,10 @@
1
- import { TableColumnFilter, TableColumnSort, TableFilterHandler, TableServerLoadPageHandler, TableServerLoadAllHandler, TableSortHandler, TableSearchHandler } from './types';
1
+ import { TableColumnFilter, TableColumnSort, TableFilterHandler, TableServerLoadPageHandler, TableServerLoadAllHandler, TableSortHandler } from './types';
2
2
  export declare const DEFAULT_PAGE_SIZE = 100;
3
- export declare type useTableDataPageFetcher<TType = unknown> = (pageIndex: number, pageSize: number, sorting: TableColumnSort[], filters: TableColumnFilter[]) => Promise<{
3
+ export declare type useTableDataPageFetcher<TType = unknown> = (pageIndex: number, pageSize: number, sorting: TableColumnSort[], filters: TableColumnFilter[], search: string | undefined) => Promise<{
4
4
  data: TType[];
5
5
  length: number;
6
6
  }>;
7
- export declare type useTableDataAllFetcher<TType = unknown> = (sorting: TableColumnSort[], filters: TableColumnFilter[]) => Promise<{
7
+ export declare type useTableDataAllFetcher<TType = unknown> = (sorting: TableColumnSort[], filters: TableColumnFilter[], search: string | undefined) => Promise<{
8
8
  data: TType[];
9
9
  length: number;
10
10
  }>;
@@ -17,8 +17,7 @@ export declare type useTableDataLoaderValues<TType = unknown> = {
17
17
  loadAll: TableServerLoadAllHandler;
18
18
  loadPage: TableServerLoadPageHandler;
19
19
  onChangeFilter: TableFilterHandler;
20
- onChangeSearch: TableSearchHandler;
21
20
  onChangeSort: TableSortHandler;
22
21
  pageSize: number;
23
22
  };
24
- export declare function useTableDataLoader<TType = unknown>(fetchPage: useTableDataPageFetcher<TType>, fetchAll: useTableDataAllFetcher<TType>, options?: useTableDataLoaderOptions): [useTableDataLoaderValues<TType>, () => void];
23
+ export declare function useTableDataLoader<TType = unknown>(fetch: useTableDataPageFetcher<TType>, fetchAll: useTableDataAllFetcher<TType>, options?: useTableDataLoaderOptions): [useTableDataLoaderValues<TType>, () => void];
@@ -1,3 +1,2 @@
1
1
  import { Table as ReactTable } from '@tanstack/react-table';
2
- import { TableSearchHandler } from '../../types';
3
- export declare function useTableSearchListener<TType = unknown>(table: ReactTable<TType>, onChangeSearch?: TableSearchHandler): void;
2
+ export declare function useTableSearchListener<TType = unknown>(table: ReactTable<TType>): void;