@stack-spot/portal-layout 0.0.58 → 0.0.60
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/menu/PageSelector.d.ts.map +1 -1
- package/dist/components/menu/PageSelector.js +9 -5
- package/dist/components/menu/PageSelector.js.map +1 -1
- package/dist/components/tour/steps/PortalSwitcherStep.d.ts.map +1 -1
- package/dist/components/tour/steps/PortalSwitcherStep.js +5 -2
- package/dist/components/tour/steps/PortalSwitcherStep.js.map +1 -1
- package/package.json +1 -1
- package/src/components/menu/PageSelector.tsx +15 -10
- package/src/components/tour/steps/PortalSwitcherStep.tsx +5 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageSelector.d.ts","sourceRoot":"","sources":["../../../src/components/menu/PageSelector.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"PageSelector.d.ts","sourceRoot":"","sources":["../../../src/components/menu/PageSelector.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAyElC,eAAO,MAAM,YAAY,+CAAgD,QAAQ,4CAiEhF,CAAA"}
|
|
@@ -15,17 +15,22 @@ const SelectorBox = styled.div `
|
|
|
15
15
|
margin: ${PADDING}px;
|
|
16
16
|
margin-bottom: 28px;
|
|
17
17
|
|
|
18
|
-
>
|
|
18
|
+
> button {
|
|
19
19
|
display: flex;
|
|
20
20
|
gap: 8px;
|
|
21
21
|
align-items: center;
|
|
22
22
|
border-radius: 0.25rem;
|
|
23
|
+
background-color: transparent;
|
|
23
24
|
border: 1px solid ${theme.color.light['500']};
|
|
24
25
|
padding: 8px;
|
|
25
26
|
transition: background-color 0.2s;
|
|
27
|
+
color: ${theme.color.light['contrastText']};
|
|
28
|
+
width: 100%;
|
|
29
|
+
text-align: left;
|
|
26
30
|
|
|
27
31
|
&:hover {
|
|
28
32
|
background-color: ${theme.color.light['500']};
|
|
33
|
+
cursor: pointer;
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
.label {
|
|
@@ -38,7 +43,6 @@ const SelectorBox = styled.div `
|
|
|
38
43
|
|
|
39
44
|
.selection-list {
|
|
40
45
|
position: absolute;
|
|
41
|
-
top: 0;
|
|
42
46
|
left: 0;
|
|
43
47
|
right: 0;
|
|
44
48
|
box-shadow: none;
|
|
@@ -98,7 +102,7 @@ export const PageSelector = ({ options, value, button, loading, title }) => {
|
|
|
98
102
|
const buttonLabelText = typeof button?.label == 'string' ? button?.label : button?.label.id;
|
|
99
103
|
return (_jsx(SelectorBox, { children: loading
|
|
100
104
|
? _jsx(LoadingCircular, {})
|
|
101
|
-
: (_jsxs(_Fragment, { children: [title && _jsx(Text, { colorScheme: "light.700", sx: { mb: 3 }, children: title }), _jsxs("
|
|
105
|
+
: (_jsxs(_Fragment, { children: [title && _jsx(Text, { colorScheme: "light.700", sx: { mb: 3 }, children: title }), _jsxs("button", { onClick: () => setVisible(true), onKeyDown: (e) => e.key === 'Enter' && setVisible(true), title: label, tabIndex: 0, "aria-label": interpolate(t.accessibility, [label]), "aria-expanded": visible, "aria-controls": id.current, "aria-haspopup": "listbox", children: [selected?.icon && _jsx(IconBox, { children: selected?.icon }), isTextLabel ?
|
|
102
106
|
_jsx(Text, { ref: ref, appearance: "body2", className: "label", title: overflow ? labelText : '', children: labelText }) :
|
|
103
107
|
label.element, _jsx(IconBox, { size: "xs", children: _jsx(Select, {}) })] }), _jsx(SelectionList, { id: id.current, visible: visible, items: optionsWithIcon, onHide: () => setVisible(false), after: button ?
|
|
104
108
|
_jsx(Link, { className: "view-all", tabIndex: 0, href: button.href, onClick: button.onClick, children: buttonLabelText })
|
|
@@ -106,10 +110,10 @@ export const PageSelector = ({ options, value, button, loading, title }) => {
|
|
|
106
110
|
};
|
|
107
111
|
const dictionary = {
|
|
108
112
|
en: {
|
|
109
|
-
accessibility: 'Current value: $0.
|
|
113
|
+
accessibility: 'Current value: $0.',
|
|
110
114
|
},
|
|
111
115
|
pt: {
|
|
112
|
-
accessibility: 'Valor atual: $0.
|
|
116
|
+
accessibility: 'Valor atual: $0.',
|
|
113
117
|
},
|
|
114
118
|
};
|
|
115
119
|
//# sourceMappingURL=PageSelector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageSelector.js","sourceRoot":"","sources":["../../../src/components/menu/PageSelector.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAc,WAAW,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AACpF,OAAO,
|
|
1
|
+
{"version":3,"file":"PageSelector.js","sourceRoot":"","sources":["../../../src/components/menu/PageSelector.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAc,WAAW,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AACpF,OAAO,EAAiB,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAc,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,oBAAoB,IAAI,OAAO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/steps/PortalSwitcherStep.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAW,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"PortalSwitcherStep.d.ts","sourceRoot":"","sources":["../../../../src/components/tour/steps/PortalSwitcherStep.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAW,MAAM,gBAAgB,CAAA;AA6BlD,eAAO,MAAM,kBAAkB,EAAE,QAIhC,CAAA"}
|
|
@@ -3,11 +3,14 @@ import { Box, Button, Flex, IconBox, Image, Text } from '@citric/core';
|
|
|
3
3
|
import { TimesMini } from '@citric/icons';
|
|
4
4
|
import { useTour } from '@reactour/tour';
|
|
5
5
|
import { useTranslate } from '@stack-spot/portal-translate';
|
|
6
|
-
import { TextWithPointingArrow } from '../utils.js';
|
|
6
|
+
import { TextWithPointingArrow, finishTour } from '../utils.js';
|
|
7
7
|
const PortalSwitcherStep = () => {
|
|
8
8
|
const t = useTranslate(translations);
|
|
9
9
|
const { setIsOpen } = useTour();
|
|
10
|
-
return _jsxs(Box, { bg: "inverse.500", children: [_jsx(TextWithPointingArrow, { "$position": "right", children: _jsxs(Flex, { w: 12, pl: 5, py: 3, flexWrap: "nowrap", justifyContent: "space-between", alignItems: "center", children: [_jsxs(Text, { appearance: "body2", colorScheme: "inverse.contrastText", weight: "medium", children: [" ", t.title, " "] }), _jsx(Button, { appearance: "text", size: "sm", onClick: () =>
|
|
10
|
+
return _jsxs(Box, { bg: "inverse.500", children: [_jsx(TextWithPointingArrow, { "$position": "right", children: _jsxs(Flex, { w: 12, pl: 5, py: 3, flexWrap: "nowrap", justifyContent: "space-between", alignItems: "center", children: [_jsxs(Text, { appearance: "body2", colorScheme: "inverse.contrastText", weight: "medium", children: [" ", t.title, " "] }), _jsx(Button, { appearance: "text", size: "sm", onClick: () => {
|
|
11
|
+
finishTour();
|
|
12
|
+
setIsOpen(false);
|
|
13
|
+
}, children: _jsx(IconBox, { size: "xs", colorIcon: "inverse.contrastText", children: _jsx(TimesMini, {}) }) })] }) }), _jsx(Image, { src: "https://marketing.stackspot.com/switch-v2.gif", alt: "GIF showing how to move from one portal to another" }), _jsx(Box, { px: 5, py: 3, children: _jsx(Text, { appearance: "microtext1", colorScheme: "inverse.contrastText", children: t.description }) })] });
|
|
11
14
|
};
|
|
12
15
|
export const portalSwitcherStep = {
|
|
13
16
|
selector: '.portal-switcher',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PortalSwitcherStep.js","sourceRoot":"","sources":["../../../../src/components/tour/steps/PortalSwitcherStep.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAY,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"PortalSwitcherStep.js","sourceRoot":"","sources":["../../../../src/components/tour/steps/PortalSwitcherStep.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAY,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE5D,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC9B,MAAM,CAAC,GAAG,YAAY,CAAC,YAAY,CAAC,CAAA;IACpC,MAAM,EAAE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AAK,EAAE,uCAAuC;QAC9C,WAAW,EAAE,yMAAyM;KACvN;CACF,CAAA"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import { ArrowRight, Select } from '@citric/icons'
|
|
|
3
3
|
import { LoadingCircular } from '@citric/ui'
|
|
4
4
|
import { theme } from '@stack-spot/portal-theme'
|
|
5
5
|
import { Dictionary, interpolate, useTranslate } from '@stack-spot/portal-translate'
|
|
6
|
-
import { useMemo, useRef, useState } from 'react'
|
|
6
|
+
import { KeyboardEvent, useMemo, useRef, useState } from 'react'
|
|
7
7
|
import { styled } from 'styled-components'
|
|
8
8
|
import { useAnchorTag } from '../../layout-context'
|
|
9
9
|
import { ListAction, SelectionList } from '../SelectionList'
|
|
@@ -16,17 +16,22 @@ const SelectorBox = styled.div`
|
|
|
16
16
|
margin: ${PADDING}px;
|
|
17
17
|
margin-bottom: 28px;
|
|
18
18
|
|
|
19
|
-
>
|
|
19
|
+
> button {
|
|
20
20
|
display: flex;
|
|
21
21
|
gap: 8px;
|
|
22
22
|
align-items: center;
|
|
23
23
|
border-radius: 0.25rem;
|
|
24
|
+
background-color: transparent;
|
|
24
25
|
border: 1px solid ${theme.color.light['500']};
|
|
25
26
|
padding: 8px;
|
|
26
27
|
transition: background-color 0.2s;
|
|
28
|
+
color: ${theme.color.light['contrastText']};
|
|
29
|
+
width: 100%;
|
|
30
|
+
text-align: left;
|
|
27
31
|
|
|
28
32
|
&:hover {
|
|
29
33
|
background-color: ${theme.color.light['500']};
|
|
34
|
+
cursor: pointer;
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
.label {
|
|
@@ -39,7 +44,6 @@ const SelectorBox = styled.div`
|
|
|
39
44
|
|
|
40
45
|
.selection-list {
|
|
41
46
|
position: absolute;
|
|
42
|
-
top: 0;
|
|
43
47
|
left: 0;
|
|
44
48
|
right: 0;
|
|
45
49
|
box-shadow: none;
|
|
@@ -110,21 +114,22 @@ export const PageSelector = ({ options, value, button, loading, title }: Selecto
|
|
|
110
114
|
: (
|
|
111
115
|
<>
|
|
112
116
|
{title && <Text colorScheme="light.700" sx={{ mb: 3 }}>{title}</Text>}
|
|
113
|
-
<
|
|
117
|
+
<button
|
|
114
118
|
onClick={() => setVisible(true)}
|
|
115
|
-
onKeyDown={e => e.key === 'Enter' && setVisible(true)}
|
|
116
|
-
title={
|
|
119
|
+
onKeyDown={(e: KeyboardEvent<HTMLButtonElement>) => e.key === 'Enter' && setVisible(true)}
|
|
120
|
+
title={label as string}
|
|
117
121
|
tabIndex={0}
|
|
118
|
-
aria-label={interpolate(t.accessibility, [
|
|
122
|
+
aria-label={interpolate(t.accessibility, [label])}
|
|
119
123
|
aria-expanded={visible}
|
|
120
124
|
aria-controls={id.current}
|
|
125
|
+
aria-haspopup="listbox"
|
|
121
126
|
>
|
|
122
127
|
{selected?.icon && <IconBox>{selected?.icon}</IconBox>}
|
|
123
128
|
{isTextLabel ?
|
|
124
129
|
<Text ref={ref} appearance="body2" className="label" title={overflow ? labelText : ''}>{labelText}</Text> :
|
|
125
130
|
label.element}
|
|
126
131
|
<IconBox size="xs"><Select /></IconBox>
|
|
127
|
-
</
|
|
132
|
+
</button>
|
|
128
133
|
|
|
129
134
|
<SelectionList
|
|
130
135
|
id={id.current}
|
|
@@ -145,10 +150,10 @@ export const PageSelector = ({ options, value, button, loading, title }: Selecto
|
|
|
145
150
|
|
|
146
151
|
const dictionary = {
|
|
147
152
|
en: {
|
|
148
|
-
accessibility: 'Current value: $0.
|
|
153
|
+
accessibility: 'Current value: $0.',
|
|
149
154
|
},
|
|
150
155
|
pt: {
|
|
151
|
-
accessibility: 'Valor atual: $0.
|
|
156
|
+
accessibility: 'Valor atual: $0.',
|
|
152
157
|
},
|
|
153
158
|
} satisfies Dictionary
|
|
154
159
|
|
|
@@ -2,7 +2,7 @@ import { Box, Button, Flex, IconBox, Image, Text } from '@citric/core'
|
|
|
2
2
|
import { TimesMini } from '@citric/icons'
|
|
3
3
|
import { StepType, useTour } from '@reactour/tour'
|
|
4
4
|
import { useTranslate } from '@stack-spot/portal-translate'
|
|
5
|
-
import { TextWithPointingArrow } from '../utils'
|
|
5
|
+
import { TextWithPointingArrow, finishTour } from '../utils'
|
|
6
6
|
|
|
7
7
|
const PortalSwitcherStep = () => {
|
|
8
8
|
const t = useTranslate(translations)
|
|
@@ -11,7 +11,10 @@ const PortalSwitcherStep = () => {
|
|
|
11
11
|
<TextWithPointingArrow $position="right">
|
|
12
12
|
<Flex w={12} pl={5} py={3} flexWrap="nowrap" justifyContent="space-between" alignItems="center">
|
|
13
13
|
<Text appearance="body2" colorScheme="inverse.contrastText" weight="medium"> {t.title} </Text>
|
|
14
|
-
<Button appearance="text" size="sm" onClick={() =>
|
|
14
|
+
<Button appearance="text" size="sm" onClick={() => {
|
|
15
|
+
finishTour()
|
|
16
|
+
setIsOpen(false)
|
|
17
|
+
}}>
|
|
15
18
|
<IconBox size="xs" colorIcon="inverse.contrastText">
|
|
16
19
|
<TimesMini />
|
|
17
20
|
</IconBox>
|