@stack-spot/portal-layout 0.0.47 → 0.0.49

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 (94) hide show
  1. package/dist/Layout.d.ts +2 -2
  2. package/dist/Layout.js +1 -1
  3. package/dist/LayoutOverlayManager.js +6 -6
  4. package/dist/LayoutOverlayManager.js.map +1 -1
  5. package/dist/components/Dialog.d.ts +2 -2
  6. package/dist/components/Dialog.d.ts.map +1 -1
  7. package/dist/components/Dialog.js +1 -1
  8. package/dist/components/Header.d.ts +1 -1
  9. package/dist/components/Header.js +1 -1
  10. package/dist/components/OverlayContent.d.ts +1 -1
  11. package/dist/components/OverlayContent.js +20 -20
  12. package/dist/components/PortalSwitcher.d.ts +1 -1
  13. package/dist/components/PortalSwitcher.js +54 -54
  14. package/dist/components/SelectionList.d.ts +1 -1
  15. package/dist/components/SelectionList.js +54 -54
  16. package/dist/components/SelectionList.js.map +1 -1
  17. package/dist/components/Toaster.d.ts +1 -1
  18. package/dist/components/Toaster.js +1 -1
  19. package/dist/components/UserMenu.d.ts +1 -1
  20. package/dist/components/UserMenu.js +41 -41
  21. package/dist/components/error/ErrorBoundary.d.ts +1 -1
  22. package/dist/components/error/ErrorBoundary.js +1 -1
  23. package/dist/components/error/ErrorFeedback.d.ts +1 -1
  24. package/dist/components/error/ErrorFeedback.js +1 -1
  25. package/dist/components/error/SilentErrorBoundary.d.ts +1 -1
  26. package/dist/components/error/SilentErrorBoundary.js +1 -1
  27. package/dist/components/menu/MenuContent.d.ts +10 -12
  28. package/dist/components/menu/MenuContent.d.ts.map +1 -1
  29. package/dist/components/menu/MenuContent.js +146 -146
  30. package/dist/components/menu/MenuContent.js.map +1 -1
  31. package/dist/components/menu/MenuSections.d.ts +1 -1
  32. package/dist/components/menu/MenuSections.js +1 -1
  33. package/dist/components/menu/MenuSections.js.map +1 -1
  34. package/dist/components/menu/PageSelector.d.ts +1 -1
  35. package/dist/components/menu/PageSelector.js +65 -65
  36. package/dist/components/menu/PageSelector.js.map +1 -1
  37. package/dist/components/menu/use-check-text-overflow.js.map +1 -1
  38. package/dist/layout.css +465 -465
  39. package/dist/svg/AI.d.ts +1 -1
  40. package/dist/svg/AI.js +1 -1
  41. package/dist/svg/EDP.d.ts +1 -1
  42. package/dist/svg/EDP.js +1 -1
  43. package/dist/svg/Forbidden.d.ts +1 -1
  44. package/dist/svg/Forbidden.js +1 -1
  45. package/dist/svg/HUB.d.ts +1 -1
  46. package/dist/svg/HUB.js +1 -1
  47. package/dist/svg/Logo.d.ts +1 -1
  48. package/dist/svg/Logo.js +1 -1
  49. package/dist/svg/NotFound.d.ts +1 -1
  50. package/dist/svg/NotFound.js +1 -1
  51. package/dist/svg/ServerError.d.ts +1 -1
  52. package/dist/svg/ServerError.js +1 -1
  53. package/dist/svg/Unauthenticated.d.ts +1 -1
  54. package/dist/svg/Unauthenticated.js +1 -1
  55. package/dist/toaster.js +1 -1
  56. package/dist/utils.js.map +1 -1
  57. package/package.json +1 -1
  58. package/src/Layout.tsx +103 -103
  59. package/src/LayoutOverlayManager.tsx +273 -273
  60. package/src/components/Dialog.tsx +93 -93
  61. package/src/components/Header.tsx +29 -29
  62. package/src/components/OverlayContent.tsx +58 -58
  63. package/src/components/PortalSwitcher.tsx +147 -147
  64. package/src/components/SelectionList.tsx +268 -268
  65. package/src/components/Toaster.tsx +16 -16
  66. package/src/components/UserMenu.tsx +111 -111
  67. package/src/components/error/ErrorBoundary.tsx +38 -38
  68. package/src/components/error/ErrorFeedback.tsx +114 -114
  69. package/src/components/error/ErrorManager.ts +31 -31
  70. package/src/components/error/SilentErrorBoundary.tsx +54 -54
  71. package/src/components/menu/MenuContent.tsx +293 -293
  72. package/src/components/menu/MenuSections.tsx +268 -268
  73. package/src/components/menu/PageSelector.tsx +152 -152
  74. package/src/components/menu/constants.ts +2 -2
  75. package/src/components/menu/types.ts +112 -112
  76. package/src/components/menu/use-check-text-overflow.tsx +26 -26
  77. package/src/components/menu/use-keyboard-controls.tsx +70 -70
  78. package/src/components/types.ts +15 -15
  79. package/src/dictionary.ts +25 -25
  80. package/src/elements.ts +24 -24
  81. package/src/errors.ts +11 -11
  82. package/src/index.ts +17 -17
  83. package/src/layout.css +465 -465
  84. package/src/svg/AI.tsx +37 -37
  85. package/src/svg/EDP.tsx +35 -35
  86. package/src/svg/Forbidden.tsx +22 -22
  87. package/src/svg/HUB.tsx +35 -35
  88. package/src/svg/Logo.tsx +35 -35
  89. package/src/svg/NotFound.tsx +16 -16
  90. package/src/svg/ServerError.tsx +33 -33
  91. package/src/svg/Unauthenticated.tsx +16 -16
  92. package/src/toaster.tsx +76 -76
  93. package/src/utils.ts +114 -114
  94. package/tsconfig.json +8 -8
@@ -1,268 +1,268 @@
1
- import { Flex, IconBox, Text } from '@citric/core'
2
- import { ArrowLeft, Check, ChevronRight } from '@citric/icons'
3
- import { IconButton } from '@citric/ui'
4
- import { WithStyle, listToClass, theme } from '@stack-spot/portal-theme'
5
- import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
6
- import { ReactElement, useCallback, useEffect, useMemo, useState } from 'react'
7
- import { styled } from 'styled-components'
8
- import { useKeyboardControls } from './menu/use-keyboard-controls'
9
- import { Action } from './types'
10
-
11
- interface ItemWithIcon {
12
- icon?: React.ReactElement,
13
- iconRight?: React.ReactElement,
14
- }
15
-
16
- export interface ListAction extends ItemWithIcon, Action {
17
- active?: boolean,
18
- }
19
-
20
- interface ListGroup {
21
- type?: 'section' | 'collapsible',
22
- children: ListItem[],
23
- }
24
-
25
- interface ListSection extends ListGroup {
26
- type: 'section',
27
- label?: string,
28
- }
29
-
30
- interface ListCollapsible extends ListGroup, ItemWithIcon {
31
- type?: 'collapsible',
32
- label: string,
33
- }
34
-
35
- type ListItem = ListSection | ListCollapsible | ListAction
36
-
37
- interface CurrentItemList {
38
- items: ListItem[],
39
- label?: string,
40
- parent?: CurrentItemList,
41
- }
42
-
43
- const ANIMATION_DURATION_MS = 300
44
- const MAX_HEIGHT_TRANSITION = `max-height ease-in ${ANIMATION_DURATION_MS / 1000}s`
45
-
46
- export interface SelectionListProps extends WithStyle {
47
- id: string,
48
- visible?: boolean,
49
- items: ListItem[],
50
- onHide?: () => void,
51
- maxHeight?: string,
52
- before?: ReactElement,
53
- after?: ReactElement,
54
- scroll?: boolean,
55
- }
56
-
57
- interface RenderOptions {
58
- setCurrent: (current: CurrentItemList) => void,
59
- controllerId?: string,
60
- onClose?: () => void,
61
- }
62
-
63
- const SelectionBox = styled.div<{ $maxHeight: string, $scroll?: boolean }>`
64
- max-height: 0;
65
- overflow-y: ${({ $scroll }) => $scroll ? 'auto' : 'hidden'};
66
- overflow-x: hidden;
67
- transition: ${MAX_HEIGHT_TRANSITION}, visibility 0s ${ANIMATION_DURATION_MS / 1000}s;
68
- z-index: 1;
69
- box-shadow: 4px 4px 48px #000;
70
- border-radius: 0.5rem;
71
- visibility: hidden;
72
-
73
- .selection-list-content {
74
- display: flex;
75
- flex-direction: column;
76
- background: ${theme.color.light['500']};
77
- border-radius: 0.5rem;
78
- border: 1px solid ${theme.color.light['600']};
79
- background-color: ${theme.color.light['300']};
80
- }
81
-
82
- .section-title, li > a {
83
- height: 40px;
84
- padding: 0 8px;
85
- display: flex;
86
- flex-direction: row;
87
- align-items: center;
88
- }
89
-
90
- li > a {
91
- gap: 4px;
92
- transition: background-color 0.2s;
93
- &:hover, &:focus {
94
- background: ${theme.color.light['400']};
95
- }
96
- .label {
97
- flex: 1;
98
- white-space: nowrap;
99
- overflow: hidden;
100
- text-overflow: ellipsis;
101
- }
102
- }
103
-
104
- li.section {
105
- border-bottom: 2px solid ${theme.color.light['600']};
106
- &:last-child {
107
- border-bottom: none;
108
- }
109
- }
110
-
111
- &.visible {
112
- max-height: ${({ $maxHeight }) => $maxHeight};
113
- visibility: visible;
114
- transition: ${MAX_HEIGHT_TRANSITION};
115
- }
116
- `
117
-
118
- function renderAction({
119
- label, href, onClick, icon, iconRight, active, target, iconActive = <Check />,
120
- }: ListAction, { onClose }: RenderOptions) {
121
- function handleClick() {
122
- onClick?.()
123
- onClose?.()
124
- }
125
-
126
- const isTextLabel = typeof label === 'string'
127
-
128
- return (
129
- <li key={isTextLabel ? label : label.id} className="action">
130
- <a href={href} onClick={handleClick} target={target} tabIndex={0} aria-selected={active}>
131
- {icon && <IconBox>{icon}</IconBox>}
132
- {isTextLabel ? <Text appearance="body2" className="label">{label}</Text> : label.element}
133
- {iconRight && <IconBox>{iconRight}</IconBox>}
134
- {active && <IconBox>{iconActive}</IconBox>}
135
- </a>
136
- </li>
137
- )
138
- }
139
-
140
- function renderCollapsible({ label, icon, iconRight, children }: ListCollapsible, { setCurrent, controllerId }: RenderOptions) {
141
- function handleClick(ev: React.MouseEvent) {
142
- // accessibility: this will tell the screen reader the section was expanded before this link is removed from the DOM.
143
- (ev.target as HTMLElement)?.setAttribute?.('aria-expanded', 'true')
144
- setCurrent({ items: children, label })
145
- }
146
- return (
147
- <li key={label} className="collapsible">
148
- <a onClick={handleClick} tabIndex={0} aria-expanded={false} aria-controls={controllerId}>
149
- {icon && <IconBox>{icon}</IconBox>}
150
- <Text appearance="body2" className="label">{label}</Text>
151
- {iconRight && <IconBox>{iconRight}</IconBox>}
152
- <IconBox><ChevronRight /></IconBox>
153
- </a>
154
- </li>
155
- )
156
- }
157
-
158
- function renderSection({ label, children }: ListSection, options: RenderOptions) {
159
- return (
160
- <li key={label ?? children.map(c => c.label).join('-')} className="section">
161
- {label && <Text appearance="overheader2" colorScheme="primary" className="section-title">{label}</Text>}
162
- <ul>{children.map(i => renderItem(i, options))}</ul>
163
- </li>
164
- )
165
- }
166
-
167
- function renderItem(item: ListItem, options: RenderOptions) {
168
- if ('children' in item) {
169
- return item.type === 'section' ? renderSection(item, options) : renderCollapsible(item, options)
170
- }
171
- return renderAction(item, options)
172
- }
173
-
174
- export const SelectionList = ({
175
- id, items, className, style, visible = true, maxHeight = '300px', onHide, before, after, scroll,
176
- }: SelectionListProps) => {
177
- const t = useTranslate(dictionary)
178
- const [current, setCurrent] = useState<CurrentItemList>({ items })
179
- const { keyboardControlledElement: wrapper, attachKeyboardListeners, detachKeyboardListeners } = useKeyboardControls(
180
- { onPressEscape: onHide, querySelectors: 'li.action a, li.collapsible a, button' },
181
- )
182
-
183
- const listItems = useMemo(
184
- () => current.items.map(i => renderItem(
185
- i,
186
- {
187
- setCurrent: (next: CurrentItemList) => setCurrent({ ...next, parent: current }),
188
- onClose: onHide,
189
- controllerId: id,
190
- },
191
- )),
192
- [current],
193
- )
194
-
195
- const hide = useCallback((event: Event) => {
196
- const target = (event.target as HTMLElement | null)
197
- // if the element is not in the DOM anymore, we'll consider the click was inside the selection list
198
- const isClickInsideSelectionList = !target?.isConnected || wrapper.current?.contains(target)
199
- const isAction = target?.classList?.contains('action') || !!target?.closest('.action')
200
- if (!isClickInsideSelectionList || isAction) onHide?.()
201
- }, [])
202
-
203
- useEffect(() => {
204
- if (visible) {
205
- setCurrent({ items })
206
- attachKeyboardListeners()
207
- if (onHide) setTimeout(() => document.addEventListener('click', hide), 50)
208
- }
209
- else {
210
- detachKeyboardListeners()
211
- document.removeEventListener('click', hide)
212
- }
213
- }, [visible])
214
-
215
- return (
216
- <SelectionBox
217
- id={id}
218
- ref={wrapper}
219
- $maxHeight={maxHeight}
220
- style={style}
221
- className={listToClass(['selection-list', visible ? 'visible' : undefined, className])}
222
- $scroll={scroll}
223
- aria-hidden={!visible}
224
- >
225
- <div className="selection-list-content">
226
- {before}
227
- {current.parent
228
- ? (
229
- <Flex mt={5} mb={1} alignItems="center">
230
- <IconButton
231
- onClick={(ev) => {
232
- // accessibility: this will tell the screen reader the section was collapsed before this button is removed from the DOM.
233
- (ev.target as HTMLElement)?.setAttribute?.('aria-expanded', 'false')
234
- setCurrent(current.parent ?? { items })
235
- }}
236
- sx={{ mr: 3 }}
237
- title={t.back}
238
- aria-controls={id}
239
- aria-expanded={true}
240
- >
241
- <ArrowLeft />
242
- </IconButton>
243
- <Text appearance="microtext1">{current.label}</Text>
244
- </Flex>
245
- )
246
- : undefined
247
- }
248
- <ul>
249
- {listItems}
250
- {after &&
251
- <li className="action">
252
- {after}
253
- </li>
254
- }
255
- </ul>
256
- </div>
257
- </SelectionBox>
258
- )
259
- }
260
-
261
- const dictionary = {
262
- en: {
263
- back: 'Go back',
264
- },
265
- pt: {
266
- back: 'Voltar',
267
- },
268
- } satisfies Dictionary
1
+ import { Flex, IconBox, Text } from '@citric/core'
2
+ import { ArrowLeft, Check, ChevronRight } from '@citric/icons'
3
+ import { IconButton } from '@citric/ui'
4
+ import { WithStyle, listToClass, theme } from '@stack-spot/portal-theme'
5
+ import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
6
+ import { ReactElement, useCallback, useEffect, useMemo, useState } from 'react'
7
+ import { styled } from 'styled-components'
8
+ import { useKeyboardControls } from './menu/use-keyboard-controls'
9
+ import { Action } from './types'
10
+
11
+ interface ItemWithIcon {
12
+ icon?: React.ReactElement,
13
+ iconRight?: React.ReactElement,
14
+ }
15
+
16
+ export interface ListAction extends ItemWithIcon, Action {
17
+ active?: boolean,
18
+ }
19
+
20
+ interface ListGroup {
21
+ type?: 'section' | 'collapsible',
22
+ children: ListItem[],
23
+ }
24
+
25
+ interface ListSection extends ListGroup {
26
+ type: 'section',
27
+ label?: string,
28
+ }
29
+
30
+ interface ListCollapsible extends ListGroup, ItemWithIcon {
31
+ type?: 'collapsible',
32
+ label: string,
33
+ }
34
+
35
+ type ListItem = ListSection | ListCollapsible | ListAction
36
+
37
+ interface CurrentItemList {
38
+ items: ListItem[],
39
+ label?: string,
40
+ parent?: CurrentItemList,
41
+ }
42
+
43
+ const ANIMATION_DURATION_MS = 300
44
+ const MAX_HEIGHT_TRANSITION = `max-height ease-in ${ANIMATION_DURATION_MS / 1000}s`
45
+
46
+ export interface SelectionListProps extends WithStyle {
47
+ id: string,
48
+ visible?: boolean,
49
+ items: ListItem[],
50
+ onHide?: () => void,
51
+ maxHeight?: string,
52
+ before?: ReactElement,
53
+ after?: ReactElement,
54
+ scroll?: boolean,
55
+ }
56
+
57
+ interface RenderOptions {
58
+ setCurrent: (current: CurrentItemList) => void,
59
+ controllerId?: string,
60
+ onClose?: () => void,
61
+ }
62
+
63
+ const SelectionBox = styled.div<{ $maxHeight: string, $scroll?: boolean }>`
64
+ max-height: 0;
65
+ overflow-y: ${({ $scroll }) => $scroll ? 'auto' : 'hidden'};
66
+ overflow-x: hidden;
67
+ transition: ${MAX_HEIGHT_TRANSITION}, visibility 0s ${ANIMATION_DURATION_MS / 1000}s;
68
+ z-index: 1;
69
+ box-shadow: 4px 4px 48px #000;
70
+ border-radius: 0.5rem;
71
+ visibility: hidden;
72
+
73
+ .selection-list-content {
74
+ display: flex;
75
+ flex-direction: column;
76
+ background: ${theme.color.light['500']};
77
+ border-radius: 0.5rem;
78
+ border: 1px solid ${theme.color.light['600']};
79
+ background-color: ${theme.color.light['300']};
80
+ }
81
+
82
+ .section-title, li > a {
83
+ height: 40px;
84
+ padding: 0 8px;
85
+ display: flex;
86
+ flex-direction: row;
87
+ align-items: center;
88
+ }
89
+
90
+ li > a {
91
+ gap: 4px;
92
+ transition: background-color 0.2s;
93
+ &:hover, &:focus {
94
+ background: ${theme.color.light['400']};
95
+ }
96
+ .label {
97
+ flex: 1;
98
+ white-space: nowrap;
99
+ overflow: hidden;
100
+ text-overflow: ellipsis;
101
+ }
102
+ }
103
+
104
+ li.section {
105
+ border-bottom: 2px solid ${theme.color.light['600']};
106
+ &:last-child {
107
+ border-bottom: none;
108
+ }
109
+ }
110
+
111
+ &.visible {
112
+ max-height: ${({ $maxHeight }) => $maxHeight};
113
+ visibility: visible;
114
+ transition: ${MAX_HEIGHT_TRANSITION};
115
+ }
116
+ `
117
+
118
+ function renderAction({
119
+ label, href, onClick, icon, iconRight, active, target, iconActive = <Check />,
120
+ }: ListAction, { onClose }: RenderOptions) {
121
+ function handleClick() {
122
+ onClick?.()
123
+ onClose?.()
124
+ }
125
+
126
+ const isTextLabel = typeof label === 'string'
127
+
128
+ return (
129
+ <li key={isTextLabel ? label : label.id} className="action">
130
+ <a href={href} onClick={handleClick} target={target} tabIndex={0} aria-selected={active}>
131
+ {icon && <IconBox>{icon}</IconBox>}
132
+ {isTextLabel ? <Text appearance="body2" className="label">{label}</Text> : label.element}
133
+ {iconRight && <IconBox>{iconRight}</IconBox>}
134
+ {active && <IconBox>{iconActive}</IconBox>}
135
+ </a>
136
+ </li>
137
+ )
138
+ }
139
+
140
+ function renderCollapsible({ label, icon, iconRight, children }: ListCollapsible, { setCurrent, controllerId }: RenderOptions) {
141
+ function handleClick(ev: React.MouseEvent) {
142
+ // accessibility: this will tell the screen reader the section was expanded before this link is removed from the DOM.
143
+ (ev.target as HTMLElement)?.setAttribute?.('aria-expanded', 'true')
144
+ setCurrent({ items: children, label })
145
+ }
146
+ return (
147
+ <li key={label} className="collapsible">
148
+ <a onClick={handleClick} tabIndex={0} aria-expanded={false} aria-controls={controllerId}>
149
+ {icon && <IconBox>{icon}</IconBox>}
150
+ <Text appearance="body2" className="label">{label}</Text>
151
+ {iconRight && <IconBox>{iconRight}</IconBox>}
152
+ <IconBox><ChevronRight /></IconBox>
153
+ </a>
154
+ </li>
155
+ )
156
+ }
157
+
158
+ function renderSection({ label, children }: ListSection, options: RenderOptions) {
159
+ return (
160
+ <li key={label ?? children.map(c => c.label).join('-')} className="section">
161
+ {label && <Text appearance="overheader2" colorScheme="primary" className="section-title">{label}</Text>}
162
+ <ul>{children.map(i => renderItem(i, options))}</ul>
163
+ </li>
164
+ )
165
+ }
166
+
167
+ function renderItem(item: ListItem, options: RenderOptions) {
168
+ if ('children' in item) {
169
+ return item.type === 'section' ? renderSection(item, options) : renderCollapsible(item, options)
170
+ }
171
+ return renderAction(item, options)
172
+ }
173
+
174
+ export const SelectionList = ({
175
+ id, items, className, style, visible = true, maxHeight = '300px', onHide, before, after, scroll,
176
+ }: SelectionListProps) => {
177
+ const t = useTranslate(dictionary)
178
+ const [current, setCurrent] = useState<CurrentItemList>({ items })
179
+ const { keyboardControlledElement: wrapper, attachKeyboardListeners, detachKeyboardListeners } = useKeyboardControls(
180
+ { onPressEscape: onHide, querySelectors: 'li.action a, li.collapsible a, button' },
181
+ )
182
+
183
+ const listItems = useMemo(
184
+ () => current.items.map(i => renderItem(
185
+ i,
186
+ {
187
+ setCurrent: (next: CurrentItemList) => setCurrent({ ...next, parent: current }),
188
+ onClose: onHide,
189
+ controllerId: id,
190
+ },
191
+ )),
192
+ [current],
193
+ )
194
+
195
+ const hide = useCallback((event: Event) => {
196
+ const target = (event.target as HTMLElement | null)
197
+ // if the element is not in the DOM anymore, we'll consider the click was inside the selection list
198
+ const isClickInsideSelectionList = !target?.isConnected || wrapper.current?.contains(target)
199
+ const isAction = target?.classList?.contains('action') || !!target?.closest('.action')
200
+ if (!isClickInsideSelectionList || isAction) onHide?.()
201
+ }, [])
202
+
203
+ useEffect(() => {
204
+ if (visible) {
205
+ setCurrent({ items })
206
+ attachKeyboardListeners()
207
+ if (onHide) setTimeout(() => document.addEventListener('click', hide), 50)
208
+ }
209
+ else {
210
+ detachKeyboardListeners()
211
+ document.removeEventListener('click', hide)
212
+ }
213
+ }, [visible])
214
+
215
+ return (
216
+ <SelectionBox
217
+ id={id}
218
+ ref={wrapper}
219
+ $maxHeight={maxHeight}
220
+ style={style}
221
+ className={listToClass(['selection-list', visible ? 'visible' : undefined, className])}
222
+ $scroll={scroll}
223
+ aria-hidden={!visible}
224
+ >
225
+ <div className="selection-list-content">
226
+ {before}
227
+ {current.parent
228
+ ? (
229
+ <Flex mt={5} mb={1} alignItems="center">
230
+ <IconButton
231
+ onClick={(ev) => {
232
+ // accessibility: this will tell the screen reader the section was collapsed before this button is removed from the DOM.
233
+ (ev.target as HTMLElement)?.setAttribute?.('aria-expanded', 'false')
234
+ setCurrent(current.parent ?? { items })
235
+ }}
236
+ sx={{ mr: 3 }}
237
+ title={t.back}
238
+ aria-controls={id}
239
+ aria-expanded={true}
240
+ >
241
+ <ArrowLeft />
242
+ </IconButton>
243
+ <Text appearance="microtext1">{current.label}</Text>
244
+ </Flex>
245
+ )
246
+ : undefined
247
+ }
248
+ <ul>
249
+ {listItems}
250
+ {after &&
251
+ <li className="action">
252
+ {after}
253
+ </li>
254
+ }
255
+ </ul>
256
+ </div>
257
+ </SelectionBox>
258
+ )
259
+ }
260
+
261
+ const dictionary = {
262
+ en: {
263
+ back: 'Go back',
264
+ },
265
+ pt: {
266
+ back: 'Voltar',
267
+ },
268
+ } satisfies Dictionary
@@ -1,16 +1,16 @@
1
- import { TimesMini } from '@citric/icons'
2
- import { IconButton } from '@citric/ui'
3
- import { CloseButtonProps, ToastContainer } from 'react-toastify'
4
- import 'react-toastify/dist/ReactToastify.css'
5
- import { useDictionary } from '../dictionary'
6
-
7
- const CloseButton = ({ closeToast }: CloseButtonProps) => {
8
- const t = useDictionary()
9
- return (
10
- <IconButton onClick={() => closeToast(null as any)} title={t.dismiss}>
11
- <TimesMini />
12
- </IconButton>
13
- )
14
- }
15
-
16
- export const Toaster = () => <ToastContainer closeButton={CloseButton} />
1
+ import { TimesMini } from '@citric/icons'
2
+ import { IconButton } from '@citric/ui'
3
+ import { CloseButtonProps, ToastContainer } from 'react-toastify'
4
+ import 'react-toastify/dist/ReactToastify.css'
5
+ import { useDictionary } from '../dictionary'
6
+
7
+ const CloseButton = ({ closeToast }: CloseButtonProps) => {
8
+ const t = useDictionary()
9
+ return (
10
+ <IconButton onClick={() => closeToast(null as any)} title={t.dismiss}>
11
+ <TimesMini />
12
+ </IconButton>
13
+ )
14
+ }
15
+
16
+ export const Toaster = () => <ToastContainer closeButton={CloseButton} />