@aivenio/aquarium 1.0.0 → 1.2.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 (70) hide show
  1. package/dist/_variables.scss +20 -2
  2. package/dist/_variables_timescale.scss +20 -2
  3. package/dist/atoms.cjs +4881 -657
  4. package/dist/atoms.mjs +4873 -656
  5. package/dist/src/common/Alert/Alert.d.ts +1 -1
  6. package/dist/src/common/Alert/Alert.js +3 -3
  7. package/dist/src/common/Banner/Banner.d.ts +5 -1
  8. package/dist/src/common/Banner/Banner.js +10 -5
  9. package/dist/src/common/DataList/DataList.d.ts +24 -0
  10. package/dist/src/common/DataList/DataList.js +54 -0
  11. package/dist/src/common/DropdownMenu/DropdownMenu.d.ts +10 -3
  12. package/dist/src/common/DropdownMenu/DropdownMenu.js +14 -2
  13. package/dist/src/common/Modal/Modal.js +3 -3
  14. package/dist/src/common/Table/Table.d.ts +8 -3
  15. package/dist/src/common/Table/Table.js +20 -10
  16. package/dist/src/common/Timeline/Timeline.d.ts +18 -0
  17. package/dist/src/common/Timeline/Timeline.js +43 -0
  18. package/dist/src/common/Typography/Typography.d.ts +2 -1
  19. package/dist/src/common/Typography/Typography.js +15 -3
  20. package/dist/src/components/Alert/Alert.js +2 -2
  21. package/dist/src/components/Banner/Banner.d.ts +3 -1
  22. package/dist/src/components/Banner/Banner.js +3 -3
  23. package/dist/src/components/Box/Box.d.ts +5 -1
  24. package/dist/src/components/Box/Box.js +6 -2
  25. package/dist/src/components/Carousel/Carousel.d.ts +16 -0
  26. package/dist/src/components/Carousel/Carousel.js +89 -0
  27. package/dist/src/components/Chip/Chip.d.ts +1 -0
  28. package/dist/src/components/Chip/Chip.js +2 -2
  29. package/dist/src/components/DataList/DataList.d.ts +13 -0
  30. package/dist/src/components/DataList/DataList.js +24 -0
  31. package/dist/src/components/DataTable/DataTable.d.ts +5 -89
  32. package/dist/src/components/DataTable/DataTable.js +13 -28
  33. package/dist/src/components/Dialog/Dialog.js +35 -12
  34. package/dist/src/components/Dropdown/Dropdown.js +1 -1
  35. package/dist/src/components/DropdownMenu/DropdownMenu.d.ts +15 -1
  36. package/dist/src/components/DropdownMenu/DropdownMenu.js +26 -13
  37. package/dist/src/components/DropdownMenu/utils.d.ts +4 -0
  38. package/dist/src/components/DropdownMenu/utils.js +20 -0
  39. package/dist/src/components/Modal/Modal.js +16 -8
  40. package/dist/src/components/Section/Section.d.ts +4 -0
  41. package/dist/src/components/Section/Section.js +14 -13
  42. package/dist/src/components/Skeleton/Skeleton.d.ts +7 -2
  43. package/dist/src/components/Skeleton/Skeleton.js +5 -4
  44. package/dist/src/components/Table/Table.js +2 -2
  45. package/dist/src/components/Template/Template.d.ts +23 -0
  46. package/dist/src/components/Template/Template.js +23 -0
  47. package/dist/src/components/Timeline/Timeline.d.ts +27 -0
  48. package/dist/src/components/Timeline/Timeline.js +41 -0
  49. package/dist/src/components/index.d.ts +8 -1
  50. package/dist/src/components/index.js +9 -2
  51. package/dist/src/utils/Blueprint.d.ts +7 -0
  52. package/dist/src/utils/Blueprint.js +31 -0
  53. package/dist/src/utils/table/types.d.ts +129 -0
  54. package/dist/src/utils/table/types.js +6 -0
  55. package/dist/src/utils/table/useScrollTarget.d.ts +2 -0
  56. package/dist/src/utils/table/useScrollTarget.js +16 -0
  57. package/dist/src/{common/Table/Table.utils.d.ts → utils/table/useTableSelect.d.ts} +0 -3
  58. package/dist/src/utils/table/useTableSelect.js +27 -0
  59. package/dist/src/utils/table/useTableSort.d.ts +2 -0
  60. package/dist/src/utils/table/useTableSort.js +19 -0
  61. package/dist/styles.css +102 -26
  62. package/dist/styles_timescaledb.css +102 -26
  63. package/dist/system.cjs +3188 -2173
  64. package/dist/system.mjs +3182 -2173
  65. package/dist/tsconfig.module.tsbuildinfo +1 -1
  66. package/dist/types/ActionType.d.ts +2 -0
  67. package/dist/types/tailwindGenerated.d.ts +1 -1
  68. package/dist/types/utils.d.ts +3 -0
  69. package/package.json +3 -3
  70. package/dist/src/common/Table/Table.utils.js +0 -41
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ declare type BlueprintProps = {
3
+ width?: React.CSSProperties['width'];
4
+ height?: React.CSSProperties['height'];
5
+ };
6
+ export declare const Blueprint: React.FC<BlueprintProps>;
7
+ export {};
@@ -0,0 +1,31 @@
1
+ import React, { useState, useLayoutEffect } from 'react';
2
+ export const Blueprint = (props) => {
3
+ const [width, setWidth] = useState();
4
+ const [height, setHeight] = useState();
5
+ const ref = React.useRef(null);
6
+ useLayoutEffect(() => {
7
+ const updateSize = () => {
8
+ var _a, _b;
9
+ setHeight((_a = ref.current) === null || _a === void 0 ? void 0 : _a.clientHeight);
10
+ setWidth((_b = ref.current) === null || _b === void 0 ? void 0 : _b.clientWidth);
11
+ };
12
+ updateSize();
13
+ window.addEventListener('resize', updateSize);
14
+ return () => window.removeEventListener('resize', updateSize);
15
+ }, []);
16
+ return (React.createElement("div", { ref: ref, style: {
17
+ color: 'white',
18
+ width: props.width,
19
+ height: props.height,
20
+ padding: 16,
21
+ textAlign: 'center',
22
+ backgroundColor: 'rgb(3, 153, 227)',
23
+ backgroundImage: 'linear-gradient(rgba(255,255,255,0.2) 2px, transparent 2px), linear-gradient(90deg, rgba(255,255,255,0.2) 2px, transparent 1px), linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.1) 1px, transparent 1px)',
24
+ backgroundSize: '100px 100px, 100px 100px, 20px 20px, 20px 20px',
25
+ backgroundPosition: '-2px -2px, -2px -2px, -1px -1px, -1px -1px',
26
+ } },
27
+ width,
28
+ " x ",
29
+ height));
30
+ };
31
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQmx1ZXByaW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3V0aWxzL0JsdWVwcmludC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFB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sT0FBTyxFQUFFLEVBQUU7WUFDWCxTQUFTLEVBQUUsUUFBUTtZQUNuQixlQUFlLEVBQUUsa0JBQWtCO1lBQ25DLGVBQWUsRUFDYixpUUFBaVE7WUFDblEsY0FBYyxFQUFFLGdEQUFnRDtZQUNoRSxrQkFBa0IsRUFBRSw0Q0FBNEM7U0FDakU7UUFFQSxLQUFLOztRQUFLLE1BQU0sQ0FDYixDQUNQLENBQUM7QUFDSixDQUFDLENBQUMifQ==
@@ -0,0 +1,129 @@
1
+ import React, { AriaAttributes } from 'react';
2
+ import { ChipStatus } from '../../../src/components/Chip/Chip';
3
+ import { ActionType } from '../../../types/ActionType';
4
+ import { RequireAtLeastOne } from '../../../types/utils';
5
+ import { Weight } from '../../../src/components/Template/Template';
6
+ export declare type TextAlign = 'left' | 'center' | 'right';
7
+ export declare type SortDirection = AriaAttributes['aria-sort'];
8
+ export declare type Column = {
9
+ /**
10
+ * Type of the column.
11
+ */
12
+ type: 'text' | 'number' | 'action' | 'custom' | 'status' | 'item';
13
+ /**
14
+ * Display name for the column.
15
+ */
16
+ headerName: string;
17
+ };
18
+ declare type Formatter<R, K extends keyof R, V = R[K]> = (value: V, row: R, index: number, rows: R[]) => string;
19
+ export declare type FieldColumn<T, K extends keyof T = keyof T> = K extends keyof T ? {
20
+ /**
21
+ * Name of the property field that this column represents in the data rows.
22
+ */
23
+ field: K;
24
+ /**
25
+ * When true, user will be able to sort data rows by clicking this column header.
26
+ */
27
+ sortable?: boolean;
28
+ /**
29
+ * Formatter function. Use for example for formatting dates or capitalizing words.
30
+ * Sorting will still be based on the unformatted value.
31
+ */
32
+ formatter?: Formatter<T, K>;
33
+ } : never;
34
+ export declare type TextColumn<R> = FieldColumn<R> & {
35
+ /**
36
+ * Type of the column.
37
+ */
38
+ type: 'text';
39
+ };
40
+ export declare type NumberColumn<R> = FieldColumn<R> & {
41
+ /**
42
+ * Type of the column.
43
+ */
44
+ type: 'number';
45
+ };
46
+ export declare type ActionColumn<R> = {
47
+ /**
48
+ * Type of the column.
49
+ */
50
+ type: 'action';
51
+ /**
52
+ * Callback function that resolves to Button props.
53
+ */
54
+ action: (row: R, index: number, rows: R[]) => ActionType;
55
+ };
56
+ export declare type CustomColumn<R> = {
57
+ /**
58
+ * Type of the column.
59
+ */
60
+ type: 'custom';
61
+ /**
62
+ * Unsafe render method. Consider consulting the designer instead of using this.
63
+ * Using render callback will also disallow sorting on that column.
64
+ */
65
+ UNSAFE_render: (row: R, index: number, rows: R[]) => React.ReactNode;
66
+ };
67
+ export declare type TableItem = RequireAtLeastOne<{
68
+ title: React.ReactNode;
69
+ caption?: React.ReactNode;
70
+ image?: string;
71
+ imageAlt?: string;
72
+ imageSize?: number;
73
+ }, 'caption' | 'image'>;
74
+ declare type ItemColumn<T> = Column & {
75
+ /**
76
+ * Type of the column.
77
+ */
78
+ type: 'item';
79
+ /**
80
+ * Callback function that resolves to TableItem props
81
+ */
82
+ item: (row: T, index: number, rows: T[]) => TableItem;
83
+ };
84
+ declare type StatusColumn<R> = {
85
+ /**
86
+ * Type of the column.
87
+ */
88
+ type: 'status';
89
+ /**
90
+ * Callback function that resolves to StatusChip props
91
+ */
92
+ status: (row: R, index: number, rows: R[]) => {
93
+ status: ChipStatus;
94
+ text: string | number;
95
+ };
96
+ };
97
+ declare type ListColumn = Column & {
98
+ /**
99
+ * Width of the column. Number for pixels and string for percentages
100
+ */
101
+ width?: number | Weight;
102
+ };
103
+ declare type TableColumn = Column & {
104
+ /**
105
+ * Width of the column. Number for pixels and string for percentages
106
+ */
107
+ width?: number | `${number}%`;
108
+ };
109
+ export declare type DataListColumn<R extends DataTableRow> = DataColumn<R, ListColumn>;
110
+ export declare type DataTableColumn<R extends DataTableRow> = DataColumn<R, TableColumn>;
111
+ declare type DataColumn<R extends DataTableRow, C extends Column> = C & (TextColumn<R> | CustomColumn<R> | StatusColumn<R> | NumberColumn<R> | ActionColumn<R> | ItemColumn<R>);
112
+ export declare type DataTableRow = Record<string, any> & {
113
+ /**
114
+ * Assigned ID for each data row.
115
+ * Used as a key. Use something unqiue derived from the data, not index.
116
+ */
117
+ id: string | number;
118
+ };
119
+ export declare type Sort<R extends DataTableRow> = {
120
+ key: keyof R;
121
+ direction: SortDirection;
122
+ };
123
+ export declare const toSortDirection: (direction: SortDirection | undefined) => 'asc' | 'desc' | false;
124
+ declare type CellProps = {
125
+ key: string;
126
+ align: TextAlign;
127
+ };
128
+ export declare const cellProps: <C extends Column>(column: C) => CellProps;
129
+ export {};
@@ -0,0 +1,6 @@
1
+ export const toSortDirection = (direction) => direction === 'ascending' ? 'asc' : direction === 'descending' ? 'desc' : false;
2
+ export const cellProps = (column) => ({
3
+ key: column.headerName,
4
+ align: column.type === 'number' || column.type === 'action' ? 'right' : 'left',
5
+ });
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvdXRpbHMvdGFibGUvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBNklBLE1BQU0sQ0FBQyxNQUFNLGVBQWUsR0FBRyxDQUFDLFNBQW9DLEVBQTBCLEVBQUUsQ0FDOUYsU0FBUyxLQUFLLFdBQVcsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxTQUFTLEtBQUssWUFBWSxDQUFDLENBQUMsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQztBQU9sRixNQUFNLENBQUMsTUFBTSxTQUFTLEdBQUcsQ0FBbUIsTUFBUyxFQUFhLEVBQUUsQ0FBQyxDQUFDO0lBQ3BFLEdBQUcsRUFBRSxNQUFNLENBQUMsVUFBVTtJQUN0QixLQUFLLEVBQUUsTUFBTSxDQUFDLElBQUksS0FBSyxRQUFRLElBQUksTUFBTSxDQUFDLElBQUksS0FBSyxRQUFRLENBQUMsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUMsTUFBTTtDQUMvRSxDQUFDLENBQUMifQ==
@@ -0,0 +1,2 @@
1
+ import React, { RefObject } from 'react';
2
+ export declare const useScrollTarget: <T extends HTMLElement>(callback?: () => void) => React.RefObject<T>;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ export const useScrollTarget = (callback) => {
3
+ const targetRef = React.useRef(null);
4
+ React.useLayoutEffect(() => {
5
+ const observer = new IntersectionObserver((entries) => entries[0].isIntersecting && callback && callback(), {
6
+ root: null,
7
+ rootMargin: `0px 0px 200px 0px`,
8
+ });
9
+ if (targetRef.current) {
10
+ observer.observe(targetRef.current);
11
+ }
12
+ return () => observer.disconnect();
13
+ }, []);
14
+ return targetRef;
15
+ };
16
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlU2Nyb2xsVGFyZ2V0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3V0aWxzL3RhYmxlL3VzZVNjcm9sbFRhcmdldC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQW9CLE1BQU0sT0FBTyxDQUFDO0FBRXpDLE1BQU0sQ0FBQyxNQUFNLGVBQWUsR0FBRyxDQUF3QixRQUFxQixFQUFnQixFQUFFO0lBQzVGLE1BQU0sU0FBUyxHQUFHLEtBQUssQ0FBQyxNQUFNLENBQUksSUFBSSxDQUFDLENBQUM7SUFFeEMsS0FBSyxDQUFDLGVBQWUsQ0FBQyxHQUFHLEVBQUU7UUFDekIsTUFBTSxRQUFRLEdBQUcsSUFBSSxvQkFBb0IsQ0FBQyxDQUFDLE9BQU8sRUFBRSxFQUFFLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLGNBQWMsSUFBSSxRQUFRLElBQUksUUFBUSxFQUFFLEVBQUU7WUFDMUcsSUFBSSxFQUFFLElBQUk7WUFDVixVQUFVLEVBQUUsbUJBQW1CO1NBQ2hDLENBQUMsQ0FBQztRQUNILElBQUksU0FBUyxDQUFDLE9BQU8sRUFBRTtZQUNyQixRQUFRLENBQUMsT0FBTyxDQUFDLFNBQVMsQ0FBQyxPQUFPLENBQUMsQ0FBQztTQUNyQztRQUNELE9BQU8sR0FBRyxFQUFFLENBQUMsUUFBUSxDQUFDLFVBQVUsRUFBRSxDQUFDO0lBQ3JDLENBQUMsRUFBRSxFQUFFLENBQUMsQ0FBQztJQUVQLE9BQU8sU0FBUyxDQUFDO0FBQ25CLENBQUMsQ0FBQyJ9
@@ -1,5 +1,3 @@
1
- import React, { RefObject, AriaAttributes } from 'react';
2
- export declare type SortDirection = AriaAttributes['aria-sort'];
3
1
  declare type AnyObject = {
4
2
  [key: string]: any;
5
3
  };
@@ -15,5 +13,4 @@ declare type TableSelectControls = {
15
13
  selectOnlyOne: (dot: AnyObject) => void;
16
14
  };
17
15
  export declare const useTableSelect: (data: AnyObject[], { key }: TableSelectOptions) => TableSelectControls;
18
- export declare const useScrollTarget: <T extends HTMLElement>(callback?: () => void) => React.RefObject<T>;
19
16
  export {};
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ export const useTableSelect = (data, { key }) => {
3
+ const [selected, setSelected] = React.useState([]);
4
+ const allSelected = selected.length === data.length;
5
+ const isSelected = (dot) => selected.includes(dot[key]);
6
+ const selectAll = () => setSelected(data.map((dot) => dot[key]));
7
+ const selectOnlyOne = (dot) => setSelected([dot[key]]);
8
+ const unselectAll = () => setSelected([]);
9
+ const toggle = (dot) => {
10
+ if (isSelected(dot)) {
11
+ setSelected((current) => current.filter((selectedDot) => selectedDot !== dot[key]));
12
+ }
13
+ else {
14
+ setSelected((current) => [...current, dot[key]]);
15
+ }
16
+ };
17
+ const toggleAll = () => (allSelected ? unselectAll() : selectAll());
18
+ return {
19
+ selected,
20
+ allSelected,
21
+ toggle,
22
+ toggleAll,
23
+ isSelected,
24
+ selectOnlyOne,
25
+ };
26
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0lBQzFDLE1BQU0sTUFBTSxHQUFHLENBQUMsR0FBYyxFQUFFLEVBQUU7UUFDaEMsSUFBSSxVQUFVLENBQUMsR0FBRyxDQUFDLEVBQUU7WUFDbkIsV0FBVyxDQUFDLENBQUMsT0FBTyxFQUFFLEVBQUUsQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLENBQUMsV0FBVyxFQUFFLEVBQUUsQ0FBQyxXQUFXLEtBQUssR0FBRyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQztTQUNyRjthQUFNO1lBQ0wsV0FBVyxDQUFDLENBQUMsT0FBTyxFQUFFLEVBQUUsQ0FBQyxDQUFDLEdBQUcsT0FBTyxFQUFFLEdBQUcsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUM7U0FDbEQ7SUFDSCxDQUFDLENBQUM7SUFDRixNQUFNLFNBQVMsR0FBRyxHQUFHLEVBQUUsQ0FBQyxDQUFDLFdBQVcsQ0FBQyxDQUFDLENBQUMsV0FBVyxFQUFFLENBQUMsQ0FBQyxDQUFDLFNBQVMsRUFBRSxDQUFDLENBQUM7SUFFcEUsT0FBTztRQUNMLFFBQVE7UUFDUixXQUFXO1FBQ1gsTUFBTTtRQUNOLFNBQVM7UUFDVCxVQUFVO1FBQ1YsYUFBYTtLQUNkLENBQUM7QUFDSixDQUFDLENBQUMifQ==
@@ -0,0 +1,2 @@
1
+ import { DataTableRow, Sort } from '../../../src/utils/table/types';
2
+ export declare const useTableSort: <T extends DataTableRow>() => [Sort<T> | undefined, (field: keyof T) => void];
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ export const useTableSort = () => {
3
+ const [sort, setSort] = React.useState();
4
+ const handleSortClick = (field) => {
5
+ if ((sort === null || sort === void 0 ? void 0 : sort.key) === field) {
6
+ if (sort.direction === 'ascending') {
7
+ setSort({ key: field, direction: 'descending' });
8
+ }
9
+ else {
10
+ setSort(undefined);
11
+ }
12
+ }
13
+ else {
14
+ setSort({ key: field, direction: 'ascending' });
15
+ }
16
+ };
17
+ return [sort, handleSortClick];
18
+ };
19
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlVGFibGVTb3J0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3V0aWxzL3RhYmxlL3VzZVRhYmxlU29ydC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE1BQU0sT0FBTyxDQUFDO0FBRzFCLE1BQU0sQ0FBQyxNQUFNLFlBQVksR0FBRyxHQUE0RSxFQUFFO0lBQ3hHLE1BQU0sQ0FBQyxJQUFJLEVBQUUsT0FBTyxDQUFDLEdBQUcsS0FBSyxDQUFDLFFBQVEsRUFBVyxDQUFDO0lBQ2xELE1BQU0sZUFBZSxHQUFHLENBQUMsS0FBYyxFQUFFLEVBQUU7UUFDekMsSUFBSSxDQUFBLElBQUksYUFBSixJQUFJLHVCQUFKLElBQUksQ0FBRSxHQUFHLE1BQUssS0FBSyxFQUFFO1lBQ3ZCLElBQUksSUFBSSxDQUFDLFNBQVMsS0FBSyxXQUFXLEVBQUU7Z0JBQ2xDLE9BQU8sQ0FBQyxFQUFFLEdBQUcsRUFBRSxLQUFLLEVBQUUsU0FBUyxFQUFFLFlBQVksRUFBRSxDQUFDLENBQUM7YUFDbEQ7aUJBQU07Z0JBQ0wsT0FBTyxDQUFDLFNBQVMsQ0FBQyxDQUFDO2FBQ3BCO1NBQ0Y7YUFBTTtZQUNMLE9BQU8sQ0FBQyxFQUFFLEdBQUcsRUFBRSxLQUFLLEVBQUUsU0FBUyxFQUFFLFdBQVcsRUFBRSxDQUFDLENBQUM7U0FDakQ7SUFDSCxDQUFDLENBQUM7SUFFRixPQUFPLENBQUMsSUFBSSxFQUFFLGVBQWUsQ0FBQyxDQUFDO0FBQ2pDLENBQUMsQ0FBQyJ9
package/dist/styles.css CHANGED
@@ -715,8 +715,8 @@ input[type='number'].no-arrows {
715
715
  .mt-4 {
716
716
  margin-top: 12px !important;
717
717
  }
718
- .ml-4 {
719
- margin-left: 12px !important;
718
+ .mb-5 {
719
+ margin-bottom: 16px !important;
720
720
  }
721
721
  .mr-4 {
722
722
  margin-right: 12px !important;
@@ -763,6 +763,9 @@ input[type='number'].no-arrows {
763
763
  .table {
764
764
  display: table !important;
765
765
  }
766
+ .\!table {
767
+ display: table !important;
768
+ }
766
769
  .grid {
767
770
  display: grid !important;
768
771
  }
@@ -796,12 +799,18 @@ input[type='number'].no-arrows {
796
799
  .h-\[50px\] {
797
800
  height: 50px !important;
798
801
  }
799
- .h-\[32px\] {
800
- height: 32px !important;
802
+ .h-5 {
803
+ height: 16px !important;
801
804
  }
802
805
  .h-full {
803
806
  height: 100% !important;
804
807
  }
808
+ .h-\[6px\] {
809
+ height: 6px !important;
810
+ }
811
+ .h-\[32px\] {
812
+ height: 32px !important;
813
+ }
805
814
  .h-\[174px\] {
806
815
  height: 174px !important;
807
816
  }
@@ -811,9 +820,6 @@ input[type='number'].no-arrows {
811
820
  .h-1px {
812
821
  height: 1px !important;
813
822
  }
814
- .h-5 {
815
- height: 16px !important;
816
- }
817
823
  .h-6 {
818
824
  height: 24px !important;
819
825
  }
@@ -832,12 +838,24 @@ input[type='number'].no-arrows {
832
838
  .min-h-full {
833
839
  min-height: 100% !important;
834
840
  }
841
+ .min-h-\[50px\] {
842
+ min-height: 50px !important;
843
+ }
835
844
  .w-full {
836
845
  width: 100% !important;
837
846
  }
838
847
  .w-3 {
839
848
  width: 8px !important;
840
849
  }
850
+ .w-5 {
851
+ width: 16px !important;
852
+ }
853
+ .w-1 {
854
+ width: 2px !important;
855
+ }
856
+ .w-\[6px\] {
857
+ width: 6px !important;
858
+ }
841
859
  .w-\[32px\] {
842
860
  width: 32px !important;
843
861
  }
@@ -847,15 +865,9 @@ input[type='number'].no-arrows {
847
865
  .w-1px {
848
866
  width: 1px !important;
849
867
  }
850
- .w-1 {
851
- width: 2px !important;
852
- }
853
868
  .w-2 {
854
869
  width: 4px !important;
855
870
  }
856
- .w-5 {
857
- width: 16px !important;
858
- }
859
871
  .w-6 {
860
872
  width: 24px !important;
861
873
  }
@@ -949,6 +961,15 @@ input[type='number'].no-arrows {
949
961
  .resize {
950
962
  resize: both !important;
951
963
  }
964
+ .snap-x {
965
+ scroll-snap-type: x var(--tw-scroll-snap-strictness) !important;
966
+ }
967
+ .snap-mandatory {
968
+ --tw-scroll-snap-strictness: mandatory !important;
969
+ }
970
+ .snap-start {
971
+ scroll-snap-align: start !important;
972
+ }
952
973
  .appearance-none {
953
974
  -webkit-appearance: none !important;
954
975
  -moz-appearance: none !important;
@@ -957,6 +978,9 @@ input[type='number'].no-arrows {
957
978
  .auto-cols-fr {
958
979
  grid-auto-columns: minmax(0, 1fr) !important;
959
980
  }
981
+ .grid-flow-col {
982
+ grid-auto-flow: column !important;
983
+ }
960
984
  .grid-cols-\[auto_1fr_auto\] {
961
985
  grid-template-columns: auto 1fr auto !important;
962
986
  }
@@ -969,6 +993,9 @@ input[type='number'].no-arrows {
969
993
  .grid-cols-3 {
970
994
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
971
995
  }
996
+ .grid-cols-\[16px_1fr\] {
997
+ grid-template-columns: 16px 1fr !important;
998
+ }
972
999
  .grid-cols-\[auto_1fr\] {
973
1000
  grid-template-columns: auto 1fr !important;
974
1001
  }
@@ -978,6 +1005,9 @@ input[type='number'].no-arrows {
978
1005
  .flex-row {
979
1006
  flex-direction: row !important;
980
1007
  }
1008
+ .flex-row-reverse {
1009
+ flex-direction: row-reverse !important;
1010
+ }
981
1011
  .flex-col {
982
1012
  flex-direction: column !important;
983
1013
  }
@@ -990,6 +1020,12 @@ input[type='number'].no-arrows {
990
1020
  .items-center {
991
1021
  align-items: center !important;
992
1022
  }
1023
+ .items-stretch {
1024
+ align-items: stretch !important;
1025
+ }
1026
+ .justify-start {
1027
+ justify-content: flex-start !important;
1028
+ }
993
1029
  .justify-end {
994
1030
  justify-content: flex-end !important;
995
1031
  }
@@ -1048,6 +1084,9 @@ input[type='number'].no-arrows {
1048
1084
  .self-center {
1049
1085
  align-self: center !important;
1050
1086
  }
1087
+ .justify-self-center {
1088
+ justify-self: center !important;
1089
+ }
1051
1090
  .overflow-hidden {
1052
1091
  overflow: hidden !important;
1053
1092
  }
@@ -1057,6 +1096,12 @@ input[type='number'].no-arrows {
1057
1096
  .overflow-x-hidden {
1058
1097
  overflow-x: hidden !important;
1059
1098
  }
1099
+ .overflow-x-scroll {
1100
+ overflow-x: scroll !important;
1101
+ }
1102
+ .scroll-smooth {
1103
+ scroll-behavior: smooth !important;
1104
+ }
1060
1105
  .whitespace-nowrap {
1061
1106
  white-space: nowrap !important;
1062
1107
  }
@@ -1108,22 +1153,22 @@ input[type='number'].no-arrows {
1108
1153
  --tw-border-opacity: 1 !important;
1109
1154
  border-color: rgb(3 153 227 / var(--tw-border-opacity)) !important;
1110
1155
  }
1111
- .border-navyBlue-100 {
1112
- --tw-border-opacity: 1 !important;
1113
- border-color: rgb(48 55 94 / var(--tw-border-opacity)) !important;
1114
- }
1115
1156
  .border-grey-5 {
1116
1157
  --tw-border-opacity: 1 !important;
1117
1158
  border-color: rgb(237 237 240 / var(--tw-border-opacity)) !important;
1118
1159
  }
1119
- .border-grey-50 {
1160
+ .border-navyBlue-100 {
1120
1161
  --tw-border-opacity: 1 !important;
1121
- border-color: rgb(120 120 133 / var(--tw-border-opacity)) !important;
1162
+ border-color: rgb(48 55 94 / var(--tw-border-opacity)) !important;
1122
1163
  }
1123
1164
  .border-grey-10 {
1124
1165
  --tw-border-opacity: 1 !important;
1125
1166
  border-color: rgb(225 225 227 / var(--tw-border-opacity)) !important;
1126
1167
  }
1168
+ .border-grey-50 {
1169
+ --tw-border-opacity: 1 !important;
1170
+ border-color: rgb(120 120 133 / var(--tw-border-opacity)) !important;
1171
+ }
1127
1172
  .border-grey-40 {
1128
1173
  --tw-border-opacity: 1 !important;
1129
1174
  border-color: rgb(150 150 160 / var(--tw-border-opacity)) !important;
@@ -1166,14 +1211,14 @@ input[type='number'].no-arrows {
1166
1211
  --tw-bg-opacity: 1 !important;
1167
1212
  background-color: rgb(247 247 250 / var(--tw-bg-opacity)) !important;
1168
1213
  }
1169
- .bg-navyBlue-100 {
1170
- --tw-bg-opacity: 1 !important;
1171
- background-color: rgb(48 55 94 / var(--tw-bg-opacity)) !important;
1172
- }
1173
1214
  .bg-white {
1174
1215
  --tw-bg-opacity: 1 !important;
1175
1216
  background-color: rgb(255 255 255 / var(--tw-bg-opacity)) !important;
1176
1217
  }
1218
+ .bg-navyBlue-100 {
1219
+ --tw-bg-opacity: 1 !important;
1220
+ background-color: rgb(48 55 94 / var(--tw-bg-opacity)) !important;
1221
+ }
1177
1222
  .bg-grey-5 {
1178
1223
  --tw-bg-opacity: 1 !important;
1179
1224
  background-color: rgb(237 237 240 / var(--tw-bg-opacity)) !important;
@@ -1194,6 +1239,10 @@ input[type='number'].no-arrows {
1194
1239
  --tw-bg-opacity: 1 !important;
1195
1240
  background-color: rgb(216 0 5 / var(--tw-bg-opacity)) !important;
1196
1241
  }
1242
+ .bg-grey-30 {
1243
+ --tw-bg-opacity: 1 !important;
1244
+ background-color: rgb(180 180 187 / var(--tw-bg-opacity)) !important;
1245
+ }
1197
1246
  .bg-current {
1198
1247
  background-color: currentColor !important;
1199
1248
  }
@@ -1258,12 +1307,12 @@ input[type='number'].no-arrows {
1258
1307
  .p-5 {
1259
1308
  padding: 16px !important;
1260
1309
  }
1261
- .p-3 {
1262
- padding: 8px !important;
1263
- }
1264
1310
  .p-6 {
1265
1311
  padding: 24px !important;
1266
1312
  }
1313
+ .p-3 {
1314
+ padding: 8px !important;
1315
+ }
1267
1316
  .p-2 {
1268
1317
  padding: 4px !important;
1269
1318
  }
@@ -1994,6 +2043,18 @@ input[type='number'].no-arrows {
1994
2043
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), 0 0 rgba(0,0,0,0) !important;
1995
2044
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 rgba(0,0,0,0)) !important;
1996
2045
  }
2046
+ .focus-visible\:ring-1.focus-visible {
2047
+ --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;
2048
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;
2049
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), 0 0 rgba(0,0,0,0) !important;
2050
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 rgba(0,0,0,0)) !important;
2051
+ }
2052
+ .focus-visible\:ring-1:focus-visible {
2053
+ --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;
2054
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;
2055
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), 0 0 rgba(0,0,0,0) !important;
2056
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 rgba(0,0,0,0)) !important;
2057
+ }
1997
2058
  .focus-visible\:ring-inset.focus-visible {
1998
2059
  --tw-ring-inset: inset !important;
1999
2060
  }
@@ -2016,6 +2077,14 @@ input[type='number'].no-arrows {
2016
2077
  --tw-ring-opacity: 1 !important;
2017
2078
  --tw-ring-color: rgb(120 120 133 / var(--tw-ring-opacity)) !important;
2018
2079
  }
2080
+ .focus-visible\:ring-info-70.focus-visible {
2081
+ --tw-ring-opacity: 1 !important;
2082
+ --tw-ring-color: rgb(3 153 227 / var(--tw-ring-opacity)) !important;
2083
+ }
2084
+ .focus-visible\:ring-info-70:focus-visible {
2085
+ --tw-ring-opacity: 1 !important;
2086
+ --tw-ring-color: rgb(3 153 227 / var(--tw-ring-opacity)) !important;
2087
+ }
2019
2088
  .active\:bg-primary-90:active {
2020
2089
  --tw-bg-opacity: 1 !important;
2021
2090
  background-color: rgb(198 4 67 / var(--tw-bg-opacity)) !important;
@@ -2099,9 +2168,16 @@ input[type='number'].no-arrows {
2099
2168
  --tw-ring-opacity: 1 !important;
2100
2169
  --tw-ring-color: rgb(210 210 214 / var(--tw-ring-opacity)) !important;
2101
2170
  }
2171
+ .group:last-child .group-last\:border-b-0 {
2172
+ border-bottom-width: 0px !important;
2173
+ }
2102
2174
  .group:hover .group-hover\:visible {
2103
2175
  visibility: visible !important;
2104
2176
  }
2177
+ .group:hover .group-hover\:bg-grey-0 {
2178
+ --tw-bg-opacity: 1 !important;
2179
+ background-color: rgb(247 247 250 / var(--tw-bg-opacity)) !important;
2180
+ }
2105
2181
  .group:hover .group-hover\:bg-grey-30 {
2106
2182
  --tw-bg-opacity: 1 !important;
2107
2183
  background-color: rgb(180 180 187 / var(--tw-bg-opacity)) !important;