@economic/taco 1.26.0 → 1.26.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.
- package/dist/components/Header/Header.d.ts +1 -1
- package/dist/components/Header/components/Agreement/Avatar.d.ts +7 -0
- package/dist/components/Header/components/Agreement/Badge.d.ts +6 -0
- package/dist/components/Header/components/Agreement/Display.d.ts +9 -0
- package/dist/components/Header/components/Agreement/Item.d.ts +8 -0
- package/dist/components/Header/components/{Agreements/AgreementDetails.d.ts → Agreement/types.d.ts} +0 -7
- package/dist/components/Header/components/AgreementSelector.d.ts +8 -6
- package/dist/esm/packages/taco/src/components/Header/Header.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Avatar.js +28 -0
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Avatar.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Badge.js +23 -0
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Badge.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Display.js +36 -0
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Display.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Item.js +39 -0
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Item.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js +17 -16
- package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js +3 -2
- package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js.map +1 -1
- package/dist/esm/packages/taco/src/index.js +1 -1
- package/dist/taco.cjs.development.js +103 -69
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/package.json +2 -2
- package/types.json +177 -115
- package/dist/esm/packages/taco/src/components/Header/components/Agreements/AgreementDetails.js +0 -73
- package/dist/esm/packages/taco/src/components/Header/components/Agreements/AgreementDetails.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@economic/taco",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.1",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "Matt Daly <matthew.daly@visma.com>",
|
|
6
6
|
"homepage": "https://github.com/e-conomic/taco#readme",
|
|
@@ -132,5 +132,5 @@
|
|
|
132
132
|
"not ie < 11"
|
|
133
133
|
]
|
|
134
134
|
},
|
|
135
|
-
"gitHead": "
|
|
135
|
+
"gitHead": "7b9e77f3328350340161ccf12ce8b012e99aeb78"
|
|
136
136
|
}
|
package/types.json
CHANGED
|
@@ -700,7 +700,19 @@
|
|
|
700
700
|
"OutlineBadgeProps",
|
|
701
701
|
"SubtleBadgeProps",
|
|
702
702
|
"StatusBadgeProps"
|
|
703
|
-
]
|
|
703
|
+
],
|
|
704
|
+
"AgreementBadgeProps": {
|
|
705
|
+
"intersections": [
|
|
706
|
+
"HTMLAttributes<HTMLSpanElement>"
|
|
707
|
+
],
|
|
708
|
+
"props": [
|
|
709
|
+
{
|
|
710
|
+
"name": "agreement",
|
|
711
|
+
"optional": false,
|
|
712
|
+
"type": "Agreement"
|
|
713
|
+
}
|
|
714
|
+
]
|
|
715
|
+
}
|
|
704
716
|
},
|
|
705
717
|
"BadgeIcon": {
|
|
706
718
|
"BadgeIconProps": {
|
|
@@ -1797,12 +1809,36 @@
|
|
|
1797
1809
|
},
|
|
1798
1810
|
"MenuHeaderProps": "HTMLAttributes<HTMLDivElement>"
|
|
1799
1811
|
},
|
|
1800
|
-
"
|
|
1801
|
-
"
|
|
1812
|
+
"Avatar": {
|
|
1813
|
+
"AgreementAvatarProps": {
|
|
1802
1814
|
"intersections": [
|
|
1803
|
-
"
|
|
1815
|
+
"ImgHTMLAttributes<HTMLImageElement>"
|
|
1804
1816
|
],
|
|
1805
1817
|
"props": [
|
|
1818
|
+
{
|
|
1819
|
+
"name": "fallbackSrc",
|
|
1820
|
+
"optional": false,
|
|
1821
|
+
"type": "string"
|
|
1822
|
+
}
|
|
1823
|
+
]
|
|
1824
|
+
}
|
|
1825
|
+
},
|
|
1826
|
+
"Display": {
|
|
1827
|
+
"AgreementDisplayProps": {
|
|
1828
|
+
"props": [
|
|
1829
|
+
{
|
|
1830
|
+
"name": "children",
|
|
1831
|
+
"optional": true,
|
|
1832
|
+
"type": [
|
|
1833
|
+
"Element",
|
|
1834
|
+
"null"
|
|
1835
|
+
]
|
|
1836
|
+
},
|
|
1837
|
+
{
|
|
1838
|
+
"name": "className",
|
|
1839
|
+
"optional": true,
|
|
1840
|
+
"type": "string"
|
|
1841
|
+
},
|
|
1806
1842
|
{
|
|
1807
1843
|
"name": "currentAgreement",
|
|
1808
1844
|
"optional": false,
|
|
@@ -1814,92 +1850,78 @@
|
|
|
1814
1850
|
"type": "string"
|
|
1815
1851
|
}
|
|
1816
1852
|
]
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1853
|
+
}
|
|
1854
|
+
},
|
|
1855
|
+
"Item": {
|
|
1856
|
+
"AgreementItemProps": {
|
|
1819
1857
|
"intersections": [
|
|
1820
|
-
"
|
|
1858
|
+
"Agreement"
|
|
1821
1859
|
],
|
|
1822
1860
|
"props": [
|
|
1823
1861
|
{
|
|
1824
|
-
"name": "
|
|
1825
|
-
"optional":
|
|
1826
|
-
"type":
|
|
1862
|
+
"name": "children",
|
|
1863
|
+
"optional": true,
|
|
1864
|
+
"type": [
|
|
1865
|
+
"Element",
|
|
1866
|
+
"null"
|
|
1867
|
+
]
|
|
1827
1868
|
},
|
|
1828
1869
|
{
|
|
1829
|
-
"name": "
|
|
1830
|
-
"optional":
|
|
1831
|
-
"type":
|
|
1832
|
-
"arguments": {
|
|
1833
|
-
"agreement": "Agreement",
|
|
1834
|
-
"filter": {
|
|
1835
|
-
"arguments": {
|
|
1836
|
-
"agreement": "Agreement"
|
|
1837
|
-
},
|
|
1838
|
-
"returnValue": "boolean"
|
|
1839
|
-
}
|
|
1840
|
-
},
|
|
1841
|
-
"returnValue": "void"
|
|
1842
|
-
}
|
|
1870
|
+
"name": "className",
|
|
1871
|
+
"optional": true,
|
|
1872
|
+
"type": "string"
|
|
1843
1873
|
},
|
|
1844
1874
|
{
|
|
1845
|
-
"name": "
|
|
1875
|
+
"name": "fallbackImageSrc",
|
|
1846
1876
|
"optional": false,
|
|
1847
|
-
"type":
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
},
|
|
1857
|
-
"returnValue": "void"
|
|
1858
|
-
}
|
|
1859
|
-
},
|
|
1877
|
+
"type": "string"
|
|
1878
|
+
}
|
|
1879
|
+
]
|
|
1880
|
+
},
|
|
1881
|
+
"MenuItemProps": {
|
|
1882
|
+
"intersections": [
|
|
1883
|
+
"Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'>"
|
|
1884
|
+
],
|
|
1885
|
+
"props": [
|
|
1860
1886
|
{
|
|
1861
|
-
"name": "
|
|
1887
|
+
"name": "dialog",
|
|
1862
1888
|
"optional": true,
|
|
1863
|
-
"type": {
|
|
1864
|
-
"returnValue": "void"
|
|
1865
|
-
}
|
|
1866
|
-
},
|
|
1867
|
-
{
|
|
1868
|
-
"name": "onChangeAgreement",
|
|
1869
|
-
"optional": false,
|
|
1870
1889
|
"type": {
|
|
1871
1890
|
"arguments": {
|
|
1872
|
-
"
|
|
1891
|
+
"props": "Partial<DialogProps>"
|
|
1873
1892
|
},
|
|
1874
|
-
"returnValue": "
|
|
1893
|
+
"returnValue": "Element"
|
|
1875
1894
|
}
|
|
1876
1895
|
},
|
|
1877
1896
|
{
|
|
1878
|
-
"name": "
|
|
1879
|
-
"optional":
|
|
1880
|
-
"type":
|
|
1881
|
-
"returnValue": "void"
|
|
1882
|
-
}
|
|
1897
|
+
"name": "disabled",
|
|
1898
|
+
"optional": true,
|
|
1899
|
+
"type": "boolean"
|
|
1883
1900
|
},
|
|
1884
1901
|
{
|
|
1885
|
-
"name": "
|
|
1902
|
+
"name": "icon",
|
|
1886
1903
|
"optional": true,
|
|
1887
|
-
"type": "
|
|
1904
|
+
"type": "IconName"
|
|
1888
1905
|
},
|
|
1889
1906
|
{
|
|
1890
|
-
"name": "
|
|
1907
|
+
"name": "onClick",
|
|
1891
1908
|
"optional": true,
|
|
1892
1909
|
"type": {
|
|
1893
1910
|
"arguments": {
|
|
1894
|
-
"
|
|
1911
|
+
"event": "MouseEvent<HTMLDivElement, MouseEvent>"
|
|
1895
1912
|
},
|
|
1896
1913
|
"returnValue": "void"
|
|
1897
1914
|
}
|
|
1915
|
+
},
|
|
1916
|
+
{
|
|
1917
|
+
"name": "shortcut",
|
|
1918
|
+
"optional": true,
|
|
1919
|
+
"type": "string"
|
|
1898
1920
|
}
|
|
1899
1921
|
]
|
|
1900
1922
|
}
|
|
1901
1923
|
},
|
|
1902
|
-
"
|
|
1924
|
+
"Agreement": {
|
|
1903
1925
|
"Agreement": {
|
|
1904
1926
|
"props": [
|
|
1905
1927
|
{
|
|
@@ -1958,29 +1980,113 @@
|
|
|
1958
1980
|
"type": "string"
|
|
1959
1981
|
}
|
|
1960
1982
|
]
|
|
1961
|
-
}
|
|
1962
|
-
|
|
1983
|
+
}
|
|
1984
|
+
},
|
|
1985
|
+
"AgreementSelector": {
|
|
1986
|
+
"AgreementDisplayProps": {
|
|
1963
1987
|
"intersections": [
|
|
1964
|
-
"
|
|
1988
|
+
"HTMLAttributes<HTMLDivElement>"
|
|
1965
1989
|
],
|
|
1966
1990
|
"props": [
|
|
1967
1991
|
{
|
|
1968
|
-
"name": "
|
|
1969
|
-
"optional":
|
|
1970
|
-
"type":
|
|
1971
|
-
"Element",
|
|
1972
|
-
"null"
|
|
1973
|
-
]
|
|
1992
|
+
"name": "currentAgreement",
|
|
1993
|
+
"optional": false,
|
|
1994
|
+
"type": "Agreement"
|
|
1974
1995
|
},
|
|
1975
1996
|
{
|
|
1976
|
-
"name": "
|
|
1977
|
-
"optional":
|
|
1997
|
+
"name": "fallbackImageSrc",
|
|
1998
|
+
"optional": false,
|
|
1978
1999
|
"type": "string"
|
|
2000
|
+
}
|
|
2001
|
+
]
|
|
2002
|
+
},
|
|
2003
|
+
"AgreementSelectorProps": {
|
|
2004
|
+
"props": [
|
|
2005
|
+
{
|
|
2006
|
+
"name": "agreements",
|
|
2007
|
+
"optional": false,
|
|
2008
|
+
"type": "Agreement[]"
|
|
2009
|
+
},
|
|
2010
|
+
{
|
|
2011
|
+
"name": "currentAgreement",
|
|
2012
|
+
"optional": false,
|
|
2013
|
+
"type": "Agreement"
|
|
1979
2014
|
},
|
|
1980
2015
|
{
|
|
1981
2016
|
"name": "fallbackImageSrc",
|
|
1982
2017
|
"optional": false,
|
|
1983
2018
|
"type": "string"
|
|
2019
|
+
},
|
|
2020
|
+
{
|
|
2021
|
+
"name": "filterAgreement",
|
|
2022
|
+
"optional": false,
|
|
2023
|
+
"type": {
|
|
2024
|
+
"arguments": {
|
|
2025
|
+
"agreement": "Agreement",
|
|
2026
|
+
"filter": {
|
|
2027
|
+
"arguments": {
|
|
2028
|
+
"agreement": "Agreement"
|
|
2029
|
+
},
|
|
2030
|
+
"returnValue": "boolean"
|
|
2031
|
+
}
|
|
2032
|
+
},
|
|
2033
|
+
"returnValue": "void"
|
|
2034
|
+
}
|
|
2035
|
+
},
|
|
2036
|
+
{
|
|
2037
|
+
"name": "filterClientAgreement",
|
|
2038
|
+
"optional": false,
|
|
2039
|
+
"type": {
|
|
2040
|
+
"arguments": {
|
|
2041
|
+
"agreement": "Agreement",
|
|
2042
|
+
"filter": {
|
|
2043
|
+
"arguments": {
|
|
2044
|
+
"agreement": "Agreement"
|
|
2045
|
+
},
|
|
2046
|
+
"returnValue": "boolean"
|
|
2047
|
+
}
|
|
2048
|
+
},
|
|
2049
|
+
"returnValue": "void"
|
|
2050
|
+
}
|
|
2051
|
+
},
|
|
2052
|
+
{
|
|
2053
|
+
"name": "onAddAgreement",
|
|
2054
|
+
"optional": true,
|
|
2055
|
+
"type": {
|
|
2056
|
+
"returnValue": "void"
|
|
2057
|
+
}
|
|
2058
|
+
},
|
|
2059
|
+
{
|
|
2060
|
+
"name": "onChangeAgreement",
|
|
2061
|
+
"optional": false,
|
|
2062
|
+
"type": {
|
|
2063
|
+
"arguments": {
|
|
2064
|
+
"agreement": "Agreement"
|
|
2065
|
+
},
|
|
2066
|
+
"returnValue": "void"
|
|
2067
|
+
}
|
|
2068
|
+
},
|
|
2069
|
+
{
|
|
2070
|
+
"name": "onLogout",
|
|
2071
|
+
"optional": false,
|
|
2072
|
+
"type": {
|
|
2073
|
+
"returnValue": "void"
|
|
2074
|
+
}
|
|
2075
|
+
},
|
|
2076
|
+
{
|
|
2077
|
+
"name": "open",
|
|
2078
|
+
"optional": true,
|
|
2079
|
+
"type": "boolean"
|
|
2080
|
+
},
|
|
2081
|
+
{
|
|
2082
|
+
"name": "setOpen",
|
|
2083
|
+
"optional": true,
|
|
2084
|
+
"type": {
|
|
2085
|
+
"arguments": {
|
|
2086
|
+
"open": "boolean"
|
|
2087
|
+
},
|
|
2088
|
+
"returnValue": "void"
|
|
2089
|
+
}
|
|
1984
2090
|
}
|
|
1985
2091
|
]
|
|
1986
2092
|
}
|
|
@@ -2776,50 +2882,6 @@
|
|
|
2776
2882
|
]
|
|
2777
2883
|
}
|
|
2778
2884
|
},
|
|
2779
|
-
"Item": {
|
|
2780
|
-
"MenuItemProps": {
|
|
2781
|
-
"intersections": [
|
|
2782
|
-
"Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'>"
|
|
2783
|
-
],
|
|
2784
|
-
"props": [
|
|
2785
|
-
{
|
|
2786
|
-
"name": "dialog",
|
|
2787
|
-
"optional": true,
|
|
2788
|
-
"type": {
|
|
2789
|
-
"arguments": {
|
|
2790
|
-
"props": "Partial<DialogProps>"
|
|
2791
|
-
},
|
|
2792
|
-
"returnValue": "Element"
|
|
2793
|
-
}
|
|
2794
|
-
},
|
|
2795
|
-
{
|
|
2796
|
-
"name": "disabled",
|
|
2797
|
-
"optional": true,
|
|
2798
|
-
"type": "boolean"
|
|
2799
|
-
},
|
|
2800
|
-
{
|
|
2801
|
-
"name": "icon",
|
|
2802
|
-
"optional": true,
|
|
2803
|
-
"type": "IconName"
|
|
2804
|
-
},
|
|
2805
|
-
{
|
|
2806
|
-
"name": "onClick",
|
|
2807
|
-
"optional": true,
|
|
2808
|
-
"type": {
|
|
2809
|
-
"arguments": {
|
|
2810
|
-
"event": "MouseEvent<HTMLDivElement, MouseEvent>"
|
|
2811
|
-
},
|
|
2812
|
-
"returnValue": "void"
|
|
2813
|
-
}
|
|
2814
|
-
},
|
|
2815
|
-
{
|
|
2816
|
-
"name": "shortcut",
|
|
2817
|
-
"optional": true,
|
|
2818
|
-
"type": "string"
|
|
2819
|
-
}
|
|
2820
|
-
]
|
|
2821
|
-
}
|
|
2822
|
-
},
|
|
2823
2885
|
"RadioGroup": {
|
|
2824
2886
|
"ForwardedMenuRadioGroupWithStatics": {
|
|
2825
2887
|
"intersections": [
|
|
@@ -3813,7 +3875,7 @@
|
|
|
3813
3875
|
{
|
|
3814
3876
|
"type": "reflection",
|
|
3815
3877
|
"declaration": {
|
|
3816
|
-
"id":
|
|
3878
|
+
"id": 3278,
|
|
3817
3879
|
"name": "__type",
|
|
3818
3880
|
"kind": 65536,
|
|
3819
3881
|
"kindString": "Type literal",
|
|
@@ -4013,7 +4075,7 @@
|
|
|
4013
4075
|
"constraint": {
|
|
4014
4076
|
"type": "reflection",
|
|
4015
4077
|
"declaration": {
|
|
4016
|
-
"id":
|
|
4078
|
+
"id": 2018,
|
|
4017
4079
|
"name": "__type",
|
|
4018
4080
|
"kind": 65536,
|
|
4019
4081
|
"kindString": "Type literal",
|
package/dist/esm/packages/taco/src/components/Header/components/Agreements/AgreementDetails.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import cn from 'classnames';
|
|
3
|
-
import { Icon } from '../../../Icon/Icon.js';
|
|
4
|
-
import { Badge } from '../../../Badge/Badge.js';
|
|
5
|
-
|
|
6
|
-
const AgreementDetails = props => {
|
|
7
|
-
const {
|
|
8
|
-
children,
|
|
9
|
-
className: customClassName,
|
|
10
|
-
fallbackImageSrc,
|
|
11
|
-
...agreement
|
|
12
|
-
} = props;
|
|
13
|
-
const className = cn('w-full rounded flex w-full px-1.5 xl:px-2 gap-2 overflow-hidden text-left items-center', customClassName);
|
|
14
|
-
let badge;
|
|
15
|
-
if (agreement.isAdministrator) {
|
|
16
|
-
badge = /*#__PURE__*/React__default.createElement(Badge, {
|
|
17
|
-
color: "blue",
|
|
18
|
-
small: true,
|
|
19
|
-
className: "ml-2"
|
|
20
|
-
}, "Admin");
|
|
21
|
-
} else if (agreement.isDeveloper) {
|
|
22
|
-
badge = /*#__PURE__*/React__default.createElement(Badge, {
|
|
23
|
-
color: "blue",
|
|
24
|
-
small: true,
|
|
25
|
-
className: "ml-2"
|
|
26
|
-
}, "Developer");
|
|
27
|
-
}
|
|
28
|
-
return /*#__PURE__*/React__default.createElement("span", {
|
|
29
|
-
className: className
|
|
30
|
-
}, /*#__PURE__*/React__default.createElement(Image, {
|
|
31
|
-
fallbackSrc: fallbackImageSrc,
|
|
32
|
-
src: agreement.imageSrc,
|
|
33
|
-
title: `${agreement.name} - ${agreement.number} ${agreement.userId}`
|
|
34
|
-
}), /*#__PURE__*/React__default.createElement("span", {
|
|
35
|
-
className: "flex flex-col overflow-hidden"
|
|
36
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
37
|
-
className: "flex truncate text-white",
|
|
38
|
-
title: agreement.name
|
|
39
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
40
|
-
className: "truncate"
|
|
41
|
-
}, agreement.name), ' ', agreement.secure ? /*#__PURE__*/React__default.createElement(Icon, {
|
|
42
|
-
name: "secure-tick",
|
|
43
|
-
className: "ml-1 mt-0.5 mb-0.5 !h-4 !w-4 flex-shrink-0 flex-grow-0"
|
|
44
|
-
}) : null), /*#__PURE__*/React__default.createElement("span", {
|
|
45
|
-
className: "text-grey-100 whitespace-nowrap text-xs"
|
|
46
|
-
}, agreement.number, " ", agreement.userId, " ", badge)), children);
|
|
47
|
-
};
|
|
48
|
-
const Image = /*#__PURE__*/React__default.forwardRef(function AccountImage(props, ref) {
|
|
49
|
-
const {
|
|
50
|
-
src,
|
|
51
|
-
fallbackSrc,
|
|
52
|
-
...otherProps
|
|
53
|
-
} = props;
|
|
54
|
-
const [loaded, setLoaded] = React__default.useState(false);
|
|
55
|
-
const handleLoad = () => setLoaded(true);
|
|
56
|
-
const handleError = event => {
|
|
57
|
-
event.target.src = fallbackSrc;
|
|
58
|
-
};
|
|
59
|
-
const className = cn('h-9 w-9 rounded-full shrink-0 group-focus:yt-focus-dark xl:group-focus:shadow-none', {
|
|
60
|
-
visible: loaded
|
|
61
|
-
}, props.className);
|
|
62
|
-
return /*#__PURE__*/React__default.createElement("img", Object.assign({}, otherProps, {
|
|
63
|
-
className: className,
|
|
64
|
-
src: src,
|
|
65
|
-
onLoad: handleLoad,
|
|
66
|
-
onError: handleError,
|
|
67
|
-
alt: "Company logo",
|
|
68
|
-
ref: ref
|
|
69
|
-
}));
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
export { AgreementDetails };
|
|
73
|
-
//# sourceMappingURL=AgreementDetails.js.map
|
package/dist/esm/packages/taco/src/components/Header/components/Agreements/AgreementDetails.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AgreementDetails.js","sources":["../../../../../../../../../src/components/Header/components/Agreements/AgreementDetails.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { Badge } from '../../../Badge/Badge';\nimport { Icon } from '../../../Icon/Icon';\n\nexport type Agreement = {\n adminAgreementNumber?: number;\n number: number;\n name: string;\n userId: string;\n clients?: Agreement[];\n favorite?: boolean;\n imageSrc?: string;\n isAdministrator?: boolean;\n isDeveloper?: boolean;\n statuses?: any[];\n secure: boolean;\n};\n\nexport type AgreementDetailsProps = Agreement & {\n children?: JSX.Element | null;\n className?: string;\n fallbackImageSrc: string;\n};\n\nexport const AgreementDetails = (props: AgreementDetailsProps) => {\n const { children, className: customClassName, fallbackImageSrc, ...agreement } = props;\n const className = cn(\n 'w-full rounded flex w-full px-1.5 xl:px-2 gap-2 overflow-hidden text-left items-center',\n customClassName\n );\n\n let badge;\n\n if (agreement.isAdministrator) {\n badge = (\n <Badge color=\"blue\" small className=\"ml-2\">\n Admin\n </Badge>\n );\n } else if (agreement.isDeveloper) {\n badge = (\n <Badge color=\"blue\" small className=\"ml-2\">\n Developer\n </Badge>\n );\n }\n\n return (\n <span className={className}>\n <Image\n fallbackSrc={fallbackImageSrc}\n src={agreement.imageSrc}\n title={`${agreement.name} - ${agreement.number} ${agreement.userId}`}\n />\n <span className=\"flex flex-col overflow-hidden\">\n <span className=\"flex truncate text-white\" title={agreement.name}>\n <span className=\"truncate\">{agreement.name}</span>{' '}\n {agreement.secure ? (\n <Icon name=\"secure-tick\" className=\"ml-1 mt-0.5 mb-0.5 !h-4 !w-4 flex-shrink-0 flex-grow-0\" />\n ) : null}\n </span>\n <span className=\"text-grey-100 whitespace-nowrap text-xs\">\n {agreement.number} {agreement.userId} {badge}\n </span>\n </span>\n {children}\n </span>\n );\n};\n\ntype ImageProps = React.ImgHTMLAttributes<HTMLImageElement> & { fallbackSrc: string };\n\nconst Image = React.forwardRef<HTMLImageElement, ImageProps>(function AccountImage(props, ref) {\n const { src, fallbackSrc, ...otherProps } = props;\n const [loaded, setLoaded] = React.useState(false);\n const handleLoad = () => setLoaded(true);\n const handleError = event => {\n event.target.src = fallbackSrc;\n };\n\n const className = cn(\n 'h-9 w-9 rounded-full shrink-0 group-focus:yt-focus-dark xl:group-focus:shadow-none',\n {\n visible: loaded,\n },\n props.className\n );\n\n return (\n <img\n {...otherProps}\n className={className}\n src={src}\n onLoad={handleLoad}\n onError={handleError}\n alt=\"Company logo\"\n ref={ref}\n />\n );\n});\n"],"names":["AgreementDetails","props","children","className","customClassName","fallbackImageSrc","agreement","cn","badge","isAdministrator","React","Badge","color","small","isDeveloper","Image","fallbackSrc","src","imageSrc","title","name","number","userId","secure","Icon","forwardRef","AccountImage","ref","otherProps","loaded","setLoaded","useState","handleLoad","handleError","event","target","visible","onLoad","onError","alt"],"mappings":";;;;;MAyBaA,gBAAgB,GAAIC,KAA4B;EACzD,MAAM;IAAEC,QAAQ;IAAEC,SAAS,EAAEC,eAAe;IAAEC,gBAAgB;IAAE,GAAGC;GAAW,GAAGL,KAAK;EACtF,MAAME,SAAS,GAAGI,EAAE,CAChB,wFAAwF,EACxFH,eAAe,CAClB;EAED,IAAII,KAAK;EAET,IAAIF,SAAS,CAACG,eAAe,EAAE;IAC3BD,KAAK,gBACDE,6BAACC,KAAK;MAACC,KAAK,EAAC,MAAM;MAACC,KAAK;MAACV,SAAS,EAAC;eAGvC;GACJ,MAAM,IAAIG,SAAS,CAACQ,WAAW,EAAE;IAC9BN,KAAK,gBACDE,6BAACC,KAAK;MAACC,KAAK,EAAC,MAAM;MAACC,KAAK;MAACV,SAAS,EAAC;mBAGvC;;EAGL,oBACIO;IAAMP,SAAS,EAAEA;kBACbO,6BAACK,KAAK;IACFC,WAAW,EAAEX,gBAAgB;IAC7BY,GAAG,EAAEX,SAAS,CAACY,QAAQ;IACvBC,KAAK,KAAKb,SAAS,CAACc,UAAUd,SAAS,CAACe,UAAUf,SAAS,CAACgB;IAC9D,eACFZ;IAAMP,SAAS,EAAC;kBACZO;IAAMP,SAAS,EAAC,0BAA0B;IAACgB,KAAK,EAAEb,SAAS,CAACc;kBACxDV;IAAMP,SAAS,EAAC;KAAYG,SAAS,CAACc,IAAI,CAAQ,EAAC,GAAG,EACrDd,SAAS,CAACiB,MAAM,gBACbb,6BAACc,IAAI;IAACJ,IAAI,EAAC,aAAa;IAACjB,SAAS,EAAC;IAA2D,GAC9F,IAAI,CACL,eACPO;IAAMP,SAAS,EAAC;KACXG,SAAS,CAACe,MAAM,OAAGf,SAAS,CAACgB,MAAM,OAAGd,KAAK,CACzC,CACJ,EACNN,QAAQ,CACN;AAEf;AAIA,MAAMa,KAAK,gBAAGL,cAAK,CAACe,UAAU,CAA+B,SAASC,YAAY,CAACzB,KAAK,EAAE0B,GAAG;EACzF,MAAM;IAAEV,GAAG;IAAED,WAAW;IAAE,GAAGY;GAAY,GAAG3B,KAAK;EACjD,MAAM,CAAC4B,MAAM,EAAEC,SAAS,CAAC,GAAGpB,cAAK,CAACqB,QAAQ,CAAC,KAAK,CAAC;EACjD,MAAMC,UAAU,GAAG,MAAMF,SAAS,CAAC,IAAI,CAAC;EACxC,MAAMG,WAAW,GAAGC,KAAK;IACrBA,KAAK,CAACC,MAAM,CAAClB,GAAG,GAAGD,WAAW;GACjC;EAED,MAAMb,SAAS,GAAGI,EAAE,CAChB,oFAAoF,EACpF;IACI6B,OAAO,EAAEP;GACZ,EACD5B,KAAK,CAACE,SAAS,CAClB;EAED,oBACIO,sDACQkB,UAAU;IACdzB,SAAS,EAAEA,SAAS;IACpBc,GAAG,EAAEA,GAAG;IACRoB,MAAM,EAAEL,UAAU;IAClBM,OAAO,EAAEL,WAAW;IACpBM,GAAG,EAAC,cAAc;IAClBZ,GAAG,EAAEA;KACP;AAEV,CAAC,CAAC;;;;"}
|