@agregio-solutions/design-system 1.102.6 → 2.0.0

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 (51) hide show
  1. package/dist/design-system.cjs +542 -623
  2. package/dist/design-system.js +7756 -27691
  3. package/dist/packages/components/Button/doc.md +33 -2
  4. package/dist/packages/components/Combobox/Combobox.d.ts +2 -2
  5. package/dist/packages/components/Combobox/doc.md +0 -4
  6. package/dist/packages/components/DataTable/DataTable.d.ts +15 -6
  7. package/dist/packages/components/DataTable/DataTableRow/DataTableRow.d.ts +1 -6
  8. package/dist/packages/components/DataTable/doc.md +495 -389
  9. package/dist/packages/components/DatePicker/DatePicker.d.ts +2 -2
  10. package/dist/packages/components/DatePicker/doc.md +0 -1
  11. package/dist/packages/components/DateRangePicker/DateRangePicker.d.ts +2 -2
  12. package/dist/packages/components/DateRangePicker/doc.md +0 -1
  13. package/dist/packages/components/Drawer/Drawer.d.ts +7 -24
  14. package/dist/packages/components/Drawer/doc.md +136 -106
  15. package/dist/packages/components/Dropdown/Dropdown.d.ts +1 -7
  16. package/dist/packages/components/Dropdown/doc.md +2 -29
  17. package/dist/packages/components/FileUpload/doc.md +0 -2
  18. package/dist/packages/components/Filter/Filter.d.ts +24 -10
  19. package/dist/packages/components/Filter/doc.md +31 -1
  20. package/dist/packages/components/Modal/doc.md +1 -2
  21. package/dist/packages/components/Navigation/Navigation.d.ts +2 -1
  22. package/dist/packages/components/Navigation/doc.md +14 -9
  23. package/dist/packages/components/NavigationItem/NavigationItem.d.ts +4 -0
  24. package/dist/packages/components/NavigationItem/doc.md +15 -3
  25. package/dist/packages/components/PageLayout/doc.md +190 -149
  26. package/dist/packages/components/Select/Select.d.ts +1 -1
  27. package/dist/packages/components/Select/doc.md +0 -9
  28. package/dist/packages/components/Slider/Slider.d.ts +3 -9
  29. package/dist/packages/components/Slider/doc.md +1 -4
  30. package/dist/packages/components/Tabs/Tab/Tab.d.ts +0 -5
  31. package/dist/packages/components/TextInput/TextInput.d.ts +2 -2
  32. package/dist/packages/components/TextInput/doc.md +0 -22
  33. package/dist/packages/components/TimeField/TimeField.d.ts +2 -2
  34. package/dist/packages/components/TimeField/doc.md +0 -1
  35. package/dist/packages/components/TimePicker/TimePicker.d.ts +2 -2
  36. package/dist/packages/components/Timeline/Timeline.styled.d.ts +15 -20
  37. package/dist/packages/components/Timeline/components/BlockLineContainer/BlockLineContainer.styled.d.ts +23 -27
  38. package/dist/packages/components/Timeline/components/GroupLineContainer/GroupLineContainer.styled.d.ts +3 -4
  39. package/dist/packages/components/Timeline/components/TimelineRange/TimelineRange.styled.d.ts +12 -16
  40. package/dist/packages/components/Timeline/doc.md +38 -1
  41. package/dist/packages/components/YearMonthPicker/YearMonthPicker.d.ts +2 -2
  42. package/dist/packages/components/YearMonthPicker/doc.md +0 -1
  43. package/dist/packages/ds-design-tokens/index.d.ts +1 -2
  44. package/dist/packages/ds-design-tokens/src/tokens.style.d.ts +138 -135
  45. package/dist/packages/index.d.ts +3 -4
  46. package/dist/packages/internal-components/FormGroupWrapper/FormGroupWrapper.d.ts +0 -12
  47. package/dist/public_docs/index.md +4 -1
  48. package/dist/public_docs/migration-guide-v2.md +444 -0
  49. package/package.json +6 -8
  50. package/dist/packages/ds-design-tokens/src/fontSize.style.d.ts +0 -60
  51. package/dist/packages/mui/mui-theme.d.ts +0 -3
@@ -438,6 +438,31 @@ export const LinkWithTarget: StoryObj<typeof Button> = {
438
438
  },
439
439
  };
440
440
 
441
+ export const ShouldFindTheDisabledButtonByItsText: StoryObj<typeof Button> = {
442
+ args: {
443
+ ...Playground.args,
444
+ disabled: true,
445
+ },
446
+ play: async ({ canvasElement }) => {
447
+ const canvas = within(canvasElement);
448
+ await expect(canvas.getByText("[Insert name]")).toBeDisabled();
449
+ },
450
+ };
451
+
452
+ export const ShouldFindTheLoadingButtonByItsText: StoryObj<typeof Button> = {
453
+ args: {
454
+ ...Playground.args,
455
+ isLoading: true,
456
+ },
457
+ play: async ({ canvasElement }) => {
458
+ const canvas = within(canvasElement);
459
+ await expect(canvas.getByText("[Insert name]")).toHaveAttribute(
460
+ "aria-disabled",
461
+ "true",
462
+ );
463
+ },
464
+ };
465
+
441
466
  export const LoadingKeepsTheButtonFocusable: StoryObj<typeof Button> = {
442
467
  args: {
443
468
  ...Playground.args,
@@ -480,6 +505,8 @@ export const LoadingLinkIsDisabled: StoryObj<typeof Button> = {
480
505
  };
481
506
 
482
507
  const HOLD_DURATION = 300;
508
+ // How the browser serializes the "transparent" keyword in a computed style
509
+ const TRANSPARENT = "rgba(0, 0, 0, 0)";
483
510
 
484
511
  // `userEvent.pointer` does not drive React Aria's press events here, so we
485
512
  // dispatch the pointer events ourselves to press without releasing.
@@ -526,7 +553,9 @@ export const HoldReleasedTooEarly: StoryObj<typeof Button> = {
526
553
 
527
554
  await pressWithoutReleasing(button);
528
555
  await someTime(HOLD_DURATION / 3);
529
- await expect(canvas.getByText("[Insert name]")).not.toBeVisible();
556
+ await expect(getComputedStyle(button).webkitTextFillColor).toBe(
557
+ TRANSPARENT,
558
+ );
530
559
  // The progress must be in the accessibility tree while the label is hidden
531
560
  await expect(
532
561
  canvas.getByRole("progressbar", { name: "Keep holding to confirm" }),
@@ -535,7 +564,9 @@ export const HoldReleasedTooEarly: StoryObj<typeof Button> = {
535
564
  await release(button);
536
565
  await someTime(HOLD_DURATION * 2);
537
566
  await expect(args.onClick).not.toHaveBeenCalled();
538
- await expect(canvas.getByText("[Insert name]")).toBeVisible();
567
+ await expect(getComputedStyle(button).webkitTextFillColor).not.toBe(
568
+ TRANSPARENT,
569
+ );
539
570
  await expect(canvas.queryByRole("progressbar")).not.toBeInTheDocument();
540
571
  },
541
572
  };
@@ -3,7 +3,7 @@ import { Props as FormGroupWrapperProps } from '../../internal-components/FormGr
3
3
  import { Props as SelectItemProps } from '../SelectItem/SelectItem';
4
4
  import { Props as LabelProps } from '../Label/Label';
5
5
  export type ComboboxItem = SelectItemProps;
6
- export type Props = Pick<LabelProps, "label" | "labelIconRight" | "labelIconRightTooltip" | "required"> & Pick<FormGroupWrapperProps, "description" | "helperText" | "helperTextIcon" | "errorHelperText" | "errorHelperTextIcon" | "successHelperText" | "successHelperTextIcon" | "warningHelperText" | "warningHelperTextIcon" | "orientation"> & {
6
+ export type Props = Pick<LabelProps, "label" | "labelIconRight" | "labelIconRightTooltip" | "required"> & Pick<FormGroupWrapperProps, "helperText" | "helperTextIcon" | "errorHelperText" | "errorHelperTextIcon" | "successHelperText" | "successHelperTextIcon" | "warningHelperText" | "warningHelperTextIcon" | "orientation"> & {
7
7
  /**
8
8
  * Required id, used mainly to link the label to the field.
9
9
  */
@@ -91,7 +91,7 @@ export type Props = Pick<LabelProps, "label" | "labelIconRight" | "labelIconRigh
91
91
  */
92
92
  triggerContentRight?: React.ReactNode;
93
93
  };
94
- declare const Combobox: React.ForwardRefExoticComponent<Pick<LabelProps, "label" | "required" | "labelIconRight" | "labelIconRightTooltip"> & Pick<FormGroupWrapperProps, "orientation" | "description" | "helperText" | "helperTextIcon" | "errorHelperText" | "errorHelperTextIcon" | "successHelperText" | "successHelperTextIcon" | "warningHelperText" | "warningHelperTextIcon"> & {
94
+ declare const Combobox: React.ForwardRefExoticComponent<Pick<LabelProps, "label" | "required" | "labelIconRight" | "labelIconRightTooltip"> & Pick<FormGroupWrapperProps, "orientation" | "helperText" | "helperTextIcon" | "errorHelperText" | "errorHelperTextIcon" | "successHelperText" | "successHelperTextIcon" | "warningHelperText" | "warningHelperTextIcon"> & {
95
95
  /**
96
96
  * Required id, used mainly to link the label to the field.
97
97
  */
@@ -23,7 +23,6 @@ const meta: Meta<typeof Combobox> = {
23
23
  argTypes: {
24
24
  helperText: { control: { type: "text" } },
25
25
  label: { control: { type: "text" } },
26
- description: { control: { type: "text" } },
27
26
  errorHelperText: { control: { type: "text" } },
28
27
  successHelperText: { control: { type: "text" } },
29
28
  items: { control: false },
@@ -60,7 +59,6 @@ export const Playground: StoryObj<typeof Combobox> = {
60
59
  labelIconRight: "help_outline",
61
60
  labelIconRightTooltip: "Additional information",
62
61
  required: true,
63
- description: "[Insert description]",
64
62
  helperText: "[Insert helper]",
65
63
  helperTextIcon: "help_outline",
66
64
  fullWidth: true,
@@ -72,7 +70,6 @@ export const Playground: StoryObj<typeof Combobox> = {
72
70
  const canvas = within(canvasElement);
73
71
  await canvas.findByTitle("Required");
74
72
  await canvas.findByText("[Insert label]");
75
- await canvas.findByText("[Insert description]");
76
73
  await canvas.findByText("[Insert helper]");
77
74
  },
78
75
  };
@@ -142,7 +139,6 @@ export const WithWarning: StoryObj<typeof Combobox> = {
142
139
  export const Horizontal: StoryObj<typeof Combobox> = {
143
140
  args: {
144
141
  ...Playground.args,
145
- description: undefined,
146
142
  orientation: "horizontal",
147
143
  wrapperProps: undefined,
148
144
  fullWidth: false,
@@ -1,6 +1,8 @@
1
1
  import { default as React } from 'react';
2
- import { PaginationState, Row, Table } from '@tanstack/react-table';
3
- type Props<TData> = {
2
+ import { PaginationState, ReactTable, Row, RowData, Table_RowPagination, TableFeatures, TableState_All } from '@tanstack/react-table';
3
+ /** Requires `rowPaginationFeature`. */
4
+ type OptionalPaginationApi<TFeatures extends TableFeatures, TData extends RowData> = Partial<Pick<Table_RowPagination<TFeatures, TData>, "getRowCount" | "setPageIndex" | "setPageSize">>;
5
+ type Props<TFeatures extends TableFeatures, TData extends RowData> = {
4
6
  /**
5
7
  * The CSS className for the element.
6
8
  */
@@ -10,18 +12,25 @@ type Props<TData> = {
10
12
  */
11
13
  style?: React.CSSProperties;
12
14
  /**
13
- * The table instance given by `react-table`.
15
+ * The table instance given by `react-table` `useTable`.
16
+ * The pagination and filtering APIs are read when the table registers their
17
+ * feature, and ignored otherwise.
18
+ * Call `useTable` without a state selector: `table.state` only holds the
19
+ * slices the selector keeps, and this component reads the filtering ones.
14
20
  */
15
- table: Table<TData>;
21
+ table: ReactTable<TFeatures, TData> & OptionalPaginationApi<TFeatures, TData> & {
22
+ state: TableState_All;
23
+ };
16
24
  /**
17
25
  * The pagination state given by `react-table`.
26
+ * Requires the table to register `rowPaginationFeature`.
18
27
  */
19
28
  pagination?: PaginationState;
20
29
  /**
21
30
  * The function to render the sub component custom UI.
22
31
  */
23
32
  renderSubComponent?: (props: {
24
- row: Row<TData>;
33
+ row: Row<TFeatures, TData>;
25
34
  }) => React.ReactNode;
26
35
  /**
27
36
  * The list of available page sizes.
@@ -33,5 +42,5 @@ type Props<TData> = {
33
42
  */
34
43
  size?: "small" | "default" | "large";
35
44
  };
36
- export default function DataTable<TData>({ table, pagination, renderSubComponent, itemsPerPageOptions, size, ...divProps }: Props<TData>): React.JSX.Element;
45
+ export default function DataTable<TFeatures extends TableFeatures, TData extends RowData>({ table, pagination, renderSubComponent, itemsPerPageOptions, size, ...divProps }: Props<TFeatures, TData>): React.JSX.Element;
37
46
  export {};
@@ -1,10 +1,5 @@
1
1
  import { default as React } from 'react';
2
2
  export type Props = {
3
- /**
4
- * The level of the row, mainly to change its background color. Defaults to "root".
5
- * @deprecated sub rows styling are now handled internally
6
- */
7
- depth?: number;
8
3
  /**
9
4
  * The CSS className for the element.
10
5
  */
@@ -15,4 +10,4 @@ export type Props = {
15
10
  style?: React.CSSProperties;
16
11
  children?: React.ReactNode;
17
12
  };
18
- export default function DataTableRow({ children, depth, ...otherProps }: Props): React.JSX.Element;
13
+ export default function DataTableRow({ children, ...otherProps }: Props): React.JSX.Element;