@tmlmobilidade/ui 20250915.1518.13 → 20250915.1655.9

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/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { User, UnixTimestamp, UserPreferenceValue, Permission } from '@tmlmobilidade/types';
2
3
  import { ButtonProps as ButtonProps$2, BadgeProps as BadgeProps$1, ComboboxProps, MenuProps as MenuProps$1, MenuTargetProps as MenuTargetProps$1, MenuDropdownProps as MenuDropdownProps$1, MenuItemProps as MenuItemProps$1, MenuDividerProps as MenuDividerProps$1, MenuLabelProps as MenuLabelProps$1, TooltipProps as TooltipProps$1, CheckboxProps as CheckboxProps$1, CheckboxGroupProps as CheckboxGroupProps$1, PopoverProps as PopoverProps$1, PopoverTargetProps as PopoverTargetProps$1, PopoverDropdownProps as PopoverDropdownProps$1, SegmentedControlProps as SegmentedControlProps$1, SliderProps as SliderProps$1, SwitchProps as SwitchProps$1, TextProps as TextProps$1, NumberInputProps as NumberInputProps$1, PasswordInputProps, PillsInputProps as PillsInputProps$1, TextareaProps as TextareaProps$1, TextInputProps as TextInputProps$1 } from '@mantine/core';
3
4
  export { Modal, RenderTreeNodePayload, Tree, TreeNodeData, getTreeExpandedState, useTree } from '@mantine/core';
4
5
  import * as React$1 from 'react';
@@ -6,7 +7,6 @@ import React__default, { PropsWithChildren, ReactNode, CSSProperties, RefObject
6
7
  import { Line, Stop } from '@carrismetropolitana/api-types/network';
7
8
  export { ViewportList } from 'react-viewport-list';
8
9
  import { DatePickerInputProps } from '@mantine/dates';
9
- import { UnixTimestamp, UserPreferenceValue, User, Permission } from '@tmlmobilidade/types';
10
10
  import { StyleSpecification, MapLibreEvent } from 'maplibre-gl';
11
11
  import { FeatureCollection, Polygon, Point, LineString, Feature, Geometry, GeoJsonProperties } from 'geojson';
12
12
  import { MapLayerMouseEvent, ViewStateChangeEvent, MapRef } from '@vis.gl/react-maplibre';
@@ -18,6 +18,12 @@ export * from '@mantine/hooks';
18
18
  export * from '@mantine/form';
19
19
  export { zod4Resolver, zodResolver } from 'mantine-form-zod-resolver';
20
20
 
21
+ interface AvatarProps {
22
+ size?: 'lg' | 'md' | 'sm' | 'xl' | 'xs';
23
+ user: User;
24
+ }
25
+ declare function Avatar({ size, user }: AvatarProps): react_jsx_runtime.JSX.Element;
26
+
21
27
  interface HasPermissionProps {
22
28
  action: string;
23
29
  children: React.ReactNode;
@@ -1153,5 +1159,5 @@ declare function AppProvider({ children }: PropsWithChildren): react_jsx_runtime
1153
1159
  */
1154
1160
  declare function BaseProvider({ children }: PropsWithChildren): react_jsx_runtime.JSX.Element;
1155
1161
 
1156
- export { AVAILABLE_MODES, AVAILABLE_THEMES, AlertCard, AlertMessage, AppProvider, AppWrapper, BackButton, Badge, BaseProvider, Button, CMIcon, CMLogo, Checkbox, Collapsible, ComboboxComponent as Combobox, ComponentWrapper, CoordinatesInput, DataTable, DatePicker, DateTimePicker, DeleteButton, Description, Divider, ErrorDisplay, FileButton, FileUpload, FilterTarget, FilterTypeDateRange, FilterTypeList, FilterWrapper, FiltersBar, Grid, HasPermission, IconButton, Indicator, Label, LineBadge, LineDisplay, LineName, LineSelect, Loader, LoadingOverlay, LockButton, MAP_STYLES, MAP_VIEWPORT, MapContextProvider, MapOverlayGeofences, MapOverlayMultipleStops, MapOverlayObservedPath, MapOverlayPins, MapOverlayScheduledPath, MapView, MapViewContextProvider, MeContextProvider, Menu, MultiSelect, NoDataLabel, NumberInput, Pane, PanesManager, PasswordInput, PillGroup, PillsInput, Popover, SearchInput, Section, SegmentedControl, Separator, Sidebar, SidebarContextProvider, Slider, Spacer, StopDisplay, StopDisplayName, StopSelect, Surface, Switch, TMLogo, TMLogoDark, TMLogoLight, Tag, TagGroup, Text, TextInput, Textarea, ThemeContextProvider, Toolbar, Tooltip, ValueDisplay, WhenDarkMode, WhenLightMode, WhenMode, accessorSearch, plainSearch, sidebarApps, useCssVariable, useCurrentUrl, useMapContext, useMapViewContext, useMeContext, useSearch, useSidebarContext, useThemeContext, useToast, useUserPreference };
1157
- export type { ButtonProps$1 as ButtonProps, CheckboxGroupProps, CheckboxProps, DataItem$2 as DataItem, DataTableColumn, DataTableProps, DatePickerProps, DateTimePickerProps, FileButtonProps, LabelProps, LineBadgeProps, LineDisplayProps, LineNameProps, LineSelectProps, LoaderProps, MapOverlayGeofencesPolygonDataProps, MapOverlayMultipleStopsDataProps, MapOverlayObservedPathLineDataProps, MapOverlayObservedPathPointsDataProps, MapOverlayPinsPointDataProps, MapOverlayScheduledPathLineDataProps, MapOverlayScheduledPathPointsDataProps, MapStyle, ModeType, NoDataLabelProps, NumberInputProps, PillsInputProps, PopoverDropdownProps, PopoverProps, PopoverTargetProps, SearchInputProps, SegmentedControlProps, SurfaceProps, TagGroupProps, TagProps, TextInputProps, TextProps, TextareaProps, ThemeType, ToastPromiseParams, ToastProps };
1162
+ export { AVAILABLE_MODES, AVAILABLE_THEMES, AlertCard, AlertMessage, AppProvider, AppWrapper, Avatar, BackButton, Badge, BaseProvider, Button, CMIcon, CMLogo, Checkbox, Collapsible, ComboboxComponent as Combobox, ComponentWrapper, CoordinatesInput, DataTable, DatePicker, DateTimePicker, DeleteButton, Description, Divider, ErrorDisplay, FileButton, FileUpload, FilterTarget, FilterTypeDateRange, FilterTypeList, FilterWrapper, FiltersBar, Grid, HasPermission, IconButton, Indicator, Label, LineBadge, LineDisplay, LineName, LineSelect, Loader, LoadingOverlay, LockButton, MAP_STYLES, MAP_VIEWPORT, MapContextProvider, MapOverlayGeofences, MapOverlayMultipleStops, MapOverlayObservedPath, MapOverlayPins, MapOverlayScheduledPath, MapView, MapViewContextProvider, MeContextProvider, Menu, MultiSelect, NoDataLabel, NumberInput, Pane, PanesManager, PasswordInput, PillGroup, PillsInput, Popover, SearchInput, Section, SegmentedControl, Separator, Sidebar, SidebarContextProvider, Slider, Spacer, StopDisplay, StopDisplayName, StopSelect, Surface, Switch, TMLogo, TMLogoDark, TMLogoLight, Tag, TagGroup, Text, TextInput, Textarea, ThemeContextProvider, Toolbar, Tooltip, ValueDisplay, WhenDarkMode, WhenLightMode, WhenMode, accessorSearch, plainSearch, sidebarApps, useCssVariable, useCurrentUrl, useMapContext, useMapViewContext, useMeContext, useSearch, useSidebarContext, useThemeContext, useToast, useUserPreference };
1163
+ export type { AvatarProps, ButtonProps$1 as ButtonProps, CheckboxGroupProps, CheckboxProps, DataItem$2 as DataItem, DataTableColumn, DataTableProps, DatePickerProps, DateTimePickerProps, FileButtonProps, LabelProps, LineBadgeProps, LineDisplayProps, LineNameProps, LineSelectProps, LoaderProps, MapOverlayGeofencesPolygonDataProps, MapOverlayMultipleStopsDataProps, MapOverlayObservedPathLineDataProps, MapOverlayObservedPathPointsDataProps, MapOverlayPinsPointDataProps, MapOverlayScheduledPathLineDataProps, MapOverlayScheduledPathPointsDataProps, MapStyle, ModeType, NoDataLabelProps, NumberInputProps, PillsInputProps, PopoverDropdownProps, PopoverProps, PopoverTargetProps, SearchInputProps, SegmentedControlProps, SurfaceProps, TagGroupProps, TagProps, TextInputProps, TextProps, TextareaProps, ThemeType, ToastPromiseParams, ToastProps };
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export { Avatar } from './src/components/authentication/Avatar/index.js';
1
2
  export { HasPermission } from './src/components/authentication/HasPermission/index.js';
2
3
  export { BackButton } from './src/components/buttons/BackButton/index.js';
3
4
  export { Button } from './src/components/buttons/Button/index.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,18 @@
1
+ 'use client';
2
+ import { j as jsxRuntimeExports } from '../../../../_virtual/jsx-runtime.js';
3
+ import { Avatar as Avatar$1 } from '@mantine/core';
4
+ import { isUrl } from '@tmlmobilidade/utils';
5
+
6
+ function Avatar({ size = 'md', user }) {
7
+ //
8
+ //
9
+ // User has an avatar and it is a valid URL
10
+ if (user.avatar && isUrl(user.avatar)) {
11
+ return jsxRuntimeExports.jsx(Avatar$1, { size: size, src: user.avatar });
12
+ }
13
+ // User does not have an avatar or the avatar is not a valid URL
14
+ return jsxRuntimeExports.jsx(Avatar$1, { size: size, children: user.first_name.charAt(0) + user.last_name.charAt(0) });
15
+ }
16
+
17
+ export { Avatar };
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/authentication/Avatar/index.tsx"],"sourcesContent":[null],"names":["_jsx","MantineAvatar"],"mappings":";;;;;AAeM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAC,CAAA,CAAE,CAAA,CAAA,CAAA,CAAI,GAAG,CAAA,CAAA,CAAA,CAAI,CAAA,CAAE,CAAA,CAAA,CAAA,CAAI,CAAA,CAAe,CAAA,CAAA;;;;IAKxD,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAI,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAK,CAAC,CAAA,CAAA,CAAA,CAAI,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAC,CAAA,CAAE;AACtC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAOA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,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mobilidade/utils';
12
13
  import '@mantine/modals';
13
14
  import 'clsx';
14
15
  import 'luxon';
@@ -19,7 +20,6 @@ import 'ukkonen';
19
20
  import '@mantine/hooks';
20
21
  import '../../common/Popover/index.js';
21
22
  import '../../datatable/DataTableContext/index.js';
22
- import '@tmlmobilidade/utils';
23
23
  import '@mantine/dates';
24
24
  import '../FilterTarget/index.js';
25
25
  import '../../map/view/MapViewContext/index.js';
@@ -20,9 +20,9 @@ import '../../../contexts/Sidebar.context.js';
20
20
  import '../../../contexts/Theme.context.js';
21
21
  import '../../sidebar/Sidebar/index.js';
22
22
  import '@tmlmobilidade/lib';
23
+ import '@tmlmobilidade/utils';
23
24
  import '@mantine/modals';
24
25
  import '../../datatable/DataTableContext/index.js';
25
- import '@tmlmobilidade/utils';
26
26
  import '@mantine/dates';
27
27
  import '../../filters/FilterTarget/index.js';
28
28
  import { Section } from '../../layout/Section/index.js';
@@ -22,8 +22,8 @@ import '../../../../contexts/Theme.context.js';
22
22
  import { Spacer } from '../../../layout/Spacer/index.js';
23
23
  import '../../../sidebar/Sidebar/index.js';
24
24
  import '@tmlmobilidade/lib';
25
- import '../../../datatable/DataTableContext/index.js';
26
25
  import '@tmlmobilidade/utils';
26
+ import '../../../datatable/DataTableContext/index.js';
27
27
  import '@mantine/dates';
28
28
  import '../../../filters/FilterTarget/index.js';
29
29
  import { MAP_STYLES } from '../../configs/styles.js';
@@ -19,9 +19,9 @@ import '../../../contexts/Sidebar.context.js';
19
19
  import '../../../contexts/Theme.context.js';
20
20
  import '../../sidebar/Sidebar/index.js';
21
21
  import '@tmlmobilidade/lib';
22
+ import '@tmlmobilidade/utils';
22
23
  import '@mantine/modals';
23
24
  import '../../datatable/DataTableContext/index.js';
24
- import '@tmlmobilidade/utils';
25
25
  import '@mantine/dates';
26
26
  import '../../filters/FilterTarget/index.js';
27
27
  import { Section } from '../../layout/Section/index.js';
@@ -1,8 +1,9 @@
1
1
  'use client';
2
2
  import { getAppConfig } from '@tmlmobilidade/lib';
3
3
  import '../../_virtual/jsx-runtime.js';
4
- import { useMeContext } from '../contexts/Me.context.js';
5
4
  import '@mantine/core';
5
+ import '@tmlmobilidade/utils';
6
+ import { useMeContext } from '../contexts/Me.context.js';
6
7
  import '@tabler/icons-react';
7
8
  import '@mantine/modals';
8
9
  import 'clsx';
@@ -15,7 +16,6 @@ import 'ukkonen';
15
16
  import '@mantine/hooks';
16
17
  import '../components/common/Popover/index.js';
17
18
  import '../components/datatable/DataTableContext/index.js';
18
- import '@tmlmobilidade/utils';
19
19
  import '@mantine/dates';
20
20
  import '../contexts/Map.context.js';
21
21
  import '../contexts/Sidebar.context.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/ui",
3
3
  "description": "UI components for Transportes Metropolitanos de Lisboa (TML) web applications.",
4
- "version": "20250915.1518.13",
4
+ "version": "20250915.1655.9",
5
5
  "author": "João de Vasconcelos & Jusi Monteiro",
6
6
  "license": "AGPL-3.0-or-later",
7
7
  "publishConfig": {