@stack-spot/portal-components 2.3.1 → 2.3.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.3.2](https://github.com/stack-spot/portal-commons/compare/portal-components@v2.3.1...portal-components@v2.3.2) (2024-08-16)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * accessibility 409 Notifications date ([8c87685](https://github.com/stack-spot/portal-commons/commit/8c876856d9eef750a4e5d5ece475e3500ed04f2d))
9
+
3
10
  ## [2.3.1](https://github.com/stack-spot/portal-commons/compare/portal-components@v2.3.0...portal-components@v2.3.1) (2024-08-02)
4
11
 
5
12
 
@@ -1 +1 @@
1
- {"version":3,"file":"TimelineSection.d.ts","sourceRoot":"","sources":["../../src/components/TimelineSection.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAsB,MAAM,8BAA8B,CAAA;AAGxE,UAAU,KAAK;IACb;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;IACb;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAiBD;;;GAGG;AACH,eAAO,MAAM,eAAe,+CAAgD,KAAK,4CAahF,CAAA"}
1
+ {"version":3,"file":"TimelineSection.d.ts","sourceRoot":"","sources":["../../src/components/TimelineSection.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAoC,MAAM,8BAA8B,CAAA;AAGtF,UAAU,KAAK;IACb;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;IACb;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAiBD;;;GAGG;AACH,eAAO,MAAM,eAAe,+CAAgD,KAAK,4CAgBhF,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Text } from '@citric/core';
3
- import { useMonthDictionary } from '@stack-spot/portal-translate';
3
+ import { useMonthDictionary, useTranslate } from '@stack-spot/portal-translate';
4
4
  import { styled } from 'styled-components';
5
5
  const Styled = styled.div `
6
6
  display: flex;
@@ -22,6 +22,16 @@ const Styled = styled.div `
22
22
  */
23
23
  export const TimelineSection = ({ children, day, month, className, style }) => {
24
24
  const months = useMonthDictionary();
25
- return (_jsxs(Styled, { style: style, className: className, children: [_jsxs("div", { className: "timeline-section-header", children: [_jsx(Text, { appearance: "h2", children: day >= 10 ? day : `0${day}` }), _jsx(Text, { appearance: "subtitle4", children: months[month].toUpperCase().substring(0, 3) })] }), _jsx("div", { className: "timeline-section-content", children: children })] }));
25
+ const t = useTranslate(locale);
26
+ const ariaLabel = t.dayMonth.replace('%d', `${day}`).replace('%m', months[month]);
27
+ return (_jsxs(Styled, { style: style, className: className, children: [_jsxs("div", { className: "timeline-section-header", children: [_jsx(Text, { appearance: "h2", "aria-label": ariaLabel, children: day >= 10 ? day : `0${day}` }), _jsx(Text, { appearance: "subtitle4", "aria-hidden": "true", children: months[month].toUpperCase().substring(0, 3) })] }), _jsx("div", { className: "timeline-section-content", children: children })] }));
28
+ };
29
+ const locale = {
30
+ pt: {
31
+ dayMonth: '%d de %m',
32
+ },
33
+ en: {
34
+ dayMonth: '%m %d',
35
+ },
26
36
  };
27
37
  //# sourceMappingURL=TimelineSection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TimelineSection.js","sourceRoot":"","sources":["../../src/components/TimelineSection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,M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QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAS,EAAE,EAAE;IACnF,MAAM,MAAM,GAAG,kBAAkB,EAAE,CAAA;IACnC,MAAM,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,CAAA;IAE9B,MAAM,SAAS,GAAG,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;IACjF,OAAO,CACL,MAAC,MAAM,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,aACxC,eAAK,SAAS,EAAC,yBAAyB,aACtC,KAAC,IAAI,IAAC,UAAU,EAAC,IAAI,gBAAa,SAAS,YAAG,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,GAAQ,EACjF,KAAC,IAAI,IAAC,UAAU,EAAC,WAAW,iBAAa,MAAM,YAAE,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAQ,IAChG,EACN,cAAK,SAAS,EAAC,0BAA0B,YACtC,QAAQ,GACL,IACC,CACV,CAAA;AACH,CAAC,CAAA;AAED,MAAM,MAAM,GAAG;IACb,EAAE,EAAE;QACF,QAAQ,EAAE,UAAU;KACrB;IACD,EAAE,EAAE;QACF,QAAQ,EAAE,OAAO;KAClB;CACF,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stack-spot/portal-components",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,5 +1,5 @@
1
1
  import { Text } from '@citric/core'
2
- import { Month, useMonthDictionary } from '@stack-spot/portal-translate'
2
+ import { Month, useMonthDictionary, useTranslate } from '@stack-spot/portal-translate'
3
3
  import { styled } from 'styled-components'
4
4
 
5
5
  interface Props {
@@ -40,11 +40,14 @@ const Styled = styled.div`
40
40
  */
41
41
  export const TimelineSection = ({ children, day, month, className, style }: Props) => {
42
42
  const months = useMonthDictionary()
43
+ const t = useTranslate(locale)
44
+
45
+ const ariaLabel = t.dayMonth.replace('%d', `${day}`).replace('%m', months[month])
43
46
  return (
44
47
  <Styled style={style} className={className}>
45
48
  <div className="timeline-section-header">
46
- <Text appearance="h2">{day >= 10 ? day : `0${day}`}</Text>
47
- <Text appearance="subtitle4">{months[month].toUpperCase().substring(0, 3)}</Text>
49
+ <Text appearance="h2" aria-label={ariaLabel}>{day >= 10 ? day : `0${day}`}</Text>
50
+ <Text appearance="subtitle4" aria-hidden="true">{months[month].toUpperCase().substring(0, 3)}</Text>
48
51
  </div>
49
52
  <div className="timeline-section-content">
50
53
  {children}
@@ -52,3 +55,12 @@ export const TimelineSection = ({ children, day, month, className, style }: Prop
52
55
  </Styled>
53
56
  )
54
57
  }
58
+
59
+ const locale = {
60
+ pt: {
61
+ dayMonth: '%d de %m',
62
+ },
63
+ en: {
64
+ dayMonth: '%m %d',
65
+ },
66
+ }