@tmlmobilidade/ui 20250920.1941.29 → 20250922.953.29
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.css +14 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/src/components/comments/CommentItem/index.js +2 -2
- package/dist/src/components/comments/CommentItem/index.js.map +1 -1
- package/dist/src/components/comments/CommentList/index.js +2 -3
- package/dist/src/components/comments/CommentList/index.js.map +1 -1
- package/dist/styles-no-reset.css +14 -1
- package/dist/styles.css +15 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -38,7 +38,7 @@ interface NoResourceKeyOrValue {
|
|
38
38
|
value?: never;
|
39
39
|
}
|
40
40
|
type HasPermissionFinalProps<T> = HasPermissionProps & (NoResourceKeyOrValue | ResourceKeyAndValue<T>);
|
41
|
-
declare function HasPermission<T extends Record<string, unknown>>({ action, children, fallback, resource_key, scope, value }: HasPermissionFinalProps<T>): string | number | bigint | boolean | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> |
|
41
|
+
declare function HasPermission<T extends Record<string, unknown>>({ action, children, fallback, resource_key, scope, value }: HasPermissionFinalProps<T>): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> | null;
|
42
42
|
|
43
43
|
interface BackButtonProps {
|
44
44
|
onClick?: () => void;
|
@@ -168,12 +168,16 @@ interface CommentItemProps {
|
|
168
168
|
created_by: string;
|
169
169
|
icon: React.ReactNode;
|
170
170
|
iconTopMargin?: number;
|
171
|
+
reverse?: boolean;
|
171
172
|
}
|
172
|
-
declare function CommentItem({ content, created_at, created_by, icon, iconTopMargin }: CommentItemProps): react_jsx_runtime.JSX.Element;
|
173
|
+
declare function CommentItem({ content, created_at, created_by, icon, iconTopMargin, reverse }: CommentItemProps): react_jsx_runtime.JSX.Element;
|
173
174
|
|
174
|
-
|
175
|
+
interface CommentListProps {
|
175
176
|
data: CommentItemProps[];
|
176
|
-
|
177
|
+
maxHeight?: number;
|
178
|
+
reverse?: boolean;
|
179
|
+
}
|
180
|
+
declare function CommentList({ data, maxHeight, reverse }: CommentListProps): react_jsx_runtime.JSX.Element | null;
|
177
181
|
|
178
182
|
interface BadgeProps extends BadgeProps$1 {
|
179
183
|
children?: react__default.ReactNode;
|
@@ -7,8 +7,8 @@ import { Section } from '../../layout/Section/index.js';
|
|
7
7
|
import { Dates } from '@tmlmobilidade/utils';
|
8
8
|
import styles from './styles.module.css.js';
|
9
9
|
|
10
|
-
function CommentItem({ content, created_at, created_by, icon, iconTopMargin }) {
|
11
|
-
return (jsxRuntimeExports.jsxs("div", { className: styles.item, children: [jsxRuntimeExports.jsxs("div", { className: styles.itemWrapper, children: [jsxRuntimeExports.jsx("div", { className: styles.icon, style: { marginTop: iconTopMargin
|
10
|
+
function CommentItem({ content, created_at, created_by, icon, iconTopMargin, reverse }) {
|
11
|
+
return (jsxRuntimeExports.jsxs("div", { className: styles.item, "data-reverse": reverse, children: [jsxRuntimeExports.jsxs("div", { className: styles.itemWrapper, children: [jsxRuntimeExports.jsx("div", { className: styles.icon, style: { marginTop: iconTopMargin && `${iconTopMargin}px` }, children: icon }), jsxRuntimeExports.jsx("div", { className: styles.path })] }), jsxRuntimeExports.jsx("div", { className: styles.content, children: typeof content === 'string' ? (jsxRuntimeExports.jsxs(Section, { flexDirection: "column", padding: "none", children: [jsxRuntimeExports.jsx("div", { className: styles.label, children: content }), jsxRuntimeExports.jsxs(Label, { size: "sm", children: [created_by, " a ", Dates.fromUnixTimestamp(created_at).toLocaleString(Dates.FORMATS.DATETIME_SHORT, 'pt-PT')] })] })) : (content) })] }));
|
12
12
|
}
|
13
13
|
|
14
14
|
export { CommentItem };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/comments/CommentItem/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/comments/CommentItem/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;AAmBM,SAAU,WAAW,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAoB,EAAA;IAC9G,QACCA,sBAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,IAAI,EAAA,cAAA,EAAgB,OAAO,EAAA,QAAA,EAAA,CACjDA,sBAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,WAAW,EAAA,QAAA,EAAA,CACjCC,qBAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,aAAa,IAAI,CAAA,EAAG,aAAa,CAAA,EAAA,CAAI,EAAE,EAAA,QAAA,EACtF,IAAI,EAAA,CACA,EACNA,qBAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,IAAI,EAAA,CAAI,CAAA,EAAA,CAC1B,EACNA,qBAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,OAAO,EAAA,QAAA,EAC5B,OAAO,OAAO,KAAK,QAAQ,IAC3BD,sBAAA,CAAC,OAAO,EAAA,EAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAC,MAAM,EAAA,QAAA,EAAA,CAC7CC,qBAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,KAAK,EAAA,QAAA,EAAG,OAAO,EAAA,CAAO,EAC7CD,sBAAA,CAAC,KAAK,EAAA,EAAC,IAAI,EAAC,IAAI,EAAA,QAAA,EAAA,CAAE,UAAU,EAAA,KAAA,EAAK,KAAK,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,CAAA,EAAA,CAAS,CAAA,EAAA,CAC1H,KAEV,OAAO,CACP,EAAA,CACI,CAAA,EAAA,CACD;AAER;;;;"}
|
@@ -3,13 +3,12 @@ import { j as jsxRuntimeExports } from '../../../../_virtual/jsx-runtime.js';
|
|
3
3
|
import styles from './styles.module.css.js';
|
4
4
|
import { CommentItem } from '../CommentItem/index.js';
|
5
5
|
|
6
|
-
|
7
|
-
function CommentList({ data }) {
|
6
|
+
function CommentList({ data, maxHeight, reverse }) {
|
8
7
|
//
|
9
8
|
// B. Render components
|
10
9
|
if (!data)
|
11
10
|
return null;
|
12
|
-
return (jsxRuntimeExports.jsx("div", { className: styles.container, children: data.map((comment, index) => jsxRuntimeExports.jsx(CommentItem, { ...comment }, index)) }));
|
11
|
+
return (jsxRuntimeExports.jsx("div", { className: styles.container, "data-reverse": reverse, style: { maxHeight: maxHeight && `${maxHeight}px` }, children: (reverse ? data.toReversed() : data).map((comment, index) => jsxRuntimeExports.jsx(CommentItem, { ...comment, reverse: reverse }, index)) }));
|
13
12
|
}
|
14
13
|
|
15
14
|
export { CommentList };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/comments/CommentList/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/comments/CommentList/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;AAeM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,CAAC,CAAA,CAAE,CAAA,CAAA,CAAA,CAAI,EAAE,CAAA,CAAA,CAAA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AAA,CAAI,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,EAAE,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAI,CAAA,CAAE,CAAA,CAAA,CAAG,CAAC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAE,KAAK,CAAA,CAAA,CAAA,CAAA,CACxDA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,EAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAApC,CAAA,CAAA,CAAA,CAAA,CAAK,CAAmC,CAC1D,EAAA,CACI,CAAA;AAER;;"}
|
package/dist/styles-no-reset.css
CHANGED
@@ -1518,6 +1518,7 @@
|
|
1518
1518
|
|
1519
1519
|
.styles-module_icon__wl1ta {
|
1520
1520
|
z-index: 2;
|
1521
|
+
margin-top: 10px;
|
1521
1522
|
background-color: var(--color-system-background-100);
|
1522
1523
|
}
|
1523
1524
|
|
@@ -1528,7 +1529,11 @@
|
|
1528
1529
|
background-color: var(--color-system-border-100);
|
1529
1530
|
}
|
1530
1531
|
|
1531
|
-
.styles-module_item__S7RQD:last-child .styles-module_path__JfW5D {
|
1532
|
+
.styles-module_item__S7RQD[data-reverse="false"]:last-child .styles-module_path__JfW5D {
|
1533
|
+
display: none;
|
1534
|
+
}
|
1535
|
+
|
1536
|
+
.styles-module_item__S7RQD[data-reverse="true"]:first-child .styles-module_path__JfW5D {
|
1532
1537
|
display: none;
|
1533
1538
|
}
|
1534
1539
|
|
@@ -1562,6 +1567,13 @@
|
|
1562
1567
|
position: relative;
|
1563
1568
|
display: flex;
|
1564
1569
|
flex-direction: column;
|
1570
|
+
width: 100%;
|
1571
|
+
padding: var(--size-spacing-xs) 0;
|
1572
|
+
overflow-y: scroll;
|
1573
|
+
|
1574
|
+
&[data-reverse="true"] {
|
1575
|
+
flex-direction: column-reverse;
|
1576
|
+
}
|
1565
1577
|
}
|
1566
1578
|
|
1567
1579
|
.styles-module_label__SjHA2 {
|
@@ -11155,6 +11167,7 @@ body {
|
|
11155
11167
|
margin: 0;
|
11156
11168
|
color: var(--color-system-text-100);
|
11157
11169
|
scroll-padding-top: 80px;
|
11170
|
+
scrollbar-color: var(--color-primary) var(--color-system-background-200);
|
11158
11171
|
background-color: var(--color-system-background-200);
|
11159
11172
|
scroll-behavior: smooth;
|
11160
11173
|
}
|
package/dist/styles.css
CHANGED
@@ -14,6 +14,7 @@ body {
|
|
14
14
|
margin: 0;
|
15
15
|
color: var(--color-system-text-100);
|
16
16
|
scroll-padding-top: 80px;
|
17
|
+
scrollbar-color: var(--color-primary) var(--color-system-background-200);
|
17
18
|
background-color: var(--color-system-background-200);
|
18
19
|
scroll-behavior: smooth;
|
19
20
|
}
|
@@ -1577,6 +1578,7 @@ figure {
|
|
1577
1578
|
|
1578
1579
|
.styles-module_icon__wl1ta {
|
1579
1580
|
z-index: 2;
|
1581
|
+
margin-top: 10px;
|
1580
1582
|
background-color: var(--color-system-background-100);
|
1581
1583
|
}
|
1582
1584
|
|
@@ -1587,7 +1589,11 @@ figure {
|
|
1587
1589
|
background-color: var(--color-system-border-100);
|
1588
1590
|
}
|
1589
1591
|
|
1590
|
-
.styles-module_item__S7RQD:last-child .styles-module_path__JfW5D {
|
1592
|
+
.styles-module_item__S7RQD[data-reverse="false"]:last-child .styles-module_path__JfW5D {
|
1593
|
+
display: none;
|
1594
|
+
}
|
1595
|
+
|
1596
|
+
.styles-module_item__S7RQD[data-reverse="true"]:first-child .styles-module_path__JfW5D {
|
1591
1597
|
display: none;
|
1592
1598
|
}
|
1593
1599
|
|
@@ -1621,6 +1627,13 @@ figure {
|
|
1621
1627
|
position: relative;
|
1622
1628
|
display: flex;
|
1623
1629
|
flex-direction: column;
|
1630
|
+
width: 100%;
|
1631
|
+
padding: var(--size-spacing-xs) 0;
|
1632
|
+
overflow-y: scroll;
|
1633
|
+
|
1634
|
+
&[data-reverse="true"] {
|
1635
|
+
flex-direction: column-reverse;
|
1636
|
+
}
|
1624
1637
|
}
|
1625
1638
|
|
1626
1639
|
.styles-module_label__SjHA2 {
|
@@ -11214,6 +11227,7 @@ body {
|
|
11214
11227
|
margin: 0;
|
11215
11228
|
color: var(--color-system-text-100);
|
11216
11229
|
scroll-padding-top: 80px;
|
11230
|
+
scrollbar-color: var(--color-primary) var(--color-system-background-200);
|
11217
11231
|
background-color: var(--color-system-background-200);
|
11218
11232
|
scroll-behavior: smooth;
|
11219
11233
|
}
|
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": "
|
4
|
+
"version": "20250922.953.29",
|
5
5
|
"author": "João de Vasconcelos & Jusi Monteiro",
|
6
6
|
"license": "AGPL-3.0-or-later",
|
7
7
|
"publishConfig": {
|