@stokr/components-library 5.0.1 → 5.0.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/README.md +8 -8
- package/dist/components/AddressItem/AddressItem.styles.js +9 -9
- package/dist/components/AdminDashboard/Table/Table.styles.js +18 -25
- package/dist/components/AgreementItem/AgreementItem.styles.js +1 -1
- package/dist/components/BackButton/BackButton.styles.js +15 -15
- package/dist/components/BasicTable/BasicTable.styles.js +6 -8
- package/dist/components/BlogPost/BlogPost.styles.js +9 -13
- package/dist/components/Button/Button.styles.d.ts +1 -1
- package/dist/components/Button/Button.styles.js +122 -11
- package/dist/components/Button/GlareButton.js +1 -1
- package/dist/components/Card/Card.styles.js +3 -4
- package/dist/components/CardTabs/CardTabs.styles.js +17 -17
- package/dist/components/ChartLegend/ChartLegend.styles.js +6 -7
- package/dist/components/Checkbox/Checkbox.styles.js +10 -11
- package/dist/components/Checklist/ChecklistCard.js +3 -3
- package/dist/components/Checklist/ChecklistCard.styles.js +7 -20
- package/dist/components/Chips/Chip.js +2 -2
- package/dist/components/Chips/Chip.styles.js +6 -10
- package/dist/components/Collapsible/Collapsible.styles.js +14 -14
- package/dist/components/ComponentScroll/ComponentScroll.styles.js +5 -5
- package/dist/components/ComponentWrapper/ComponentWrapper.styles.js +5 -5
- package/dist/components/ConfirmModal/ConfirmModal.styles.js +2 -2
- package/dist/components/Country/CountrySelect.js +6 -6
- package/dist/components/CryptoAddress/CryptoAddress.d.ts +6 -2
- package/dist/components/CryptoAddress/CryptoAddress.js +2 -2
- package/dist/components/CryptoAddress/CryptoAddress.styles.d.ts +2 -1
- package/dist/components/CryptoAddress/CryptoAddress.styles.js +20 -27
- package/dist/components/CryptoAddressWrapper/CryptoAddressWrapper.styles.js +2 -2
- package/dist/components/FAQ/FAQ.styles.js +15 -20
- package/dist/components/Form/Form.styles.js +5 -5
- package/dist/components/Grid/Grid.styles.js +7 -7
- package/dist/components/IdentityInfo/IdentityInfo.styles.js +10 -22
- package/dist/components/InfoBox/InfoBox.d.ts +2 -2
- package/dist/components/InfoBox/InfoBox.js +5 -3
- package/dist/components/InfoIcon/InfoIcon.styles.js +2 -2
- package/dist/components/Input/DatePickerInput.styles.js +23 -24
- package/dist/components/Input/Input.styles.js +24 -30
- package/dist/components/Input/InputPassword.styles.js +11 -11
- package/dist/components/Input/InputWithButton.styles.js +5 -5
- package/dist/components/Input/MultiSelect.js +17 -17
- package/dist/components/Input/OtpInput.js +1 -1
- package/dist/components/Input/RangeInput.js +2 -2
- package/dist/components/Input/SearchInput.styles.js +10 -10
- package/dist/components/Input/Select.js +21 -16
- package/dist/components/Input/Select.styles.js +24 -28
- package/dist/components/Input/TableFilterDropdown.js +5 -5
- package/dist/components/Input/Textarea.styles.js +11 -13
- package/dist/components/MenuNav/MenuNav.styles.js +2 -5
- package/dist/components/Modal/Modal.styles.js +25 -31
- package/dist/components/Modal/PaymentModal.js +7 -7
- package/dist/components/Modal/SideModal.styles.js +8 -8
- package/dist/components/Modal/SideModalParts.js +15 -16
- package/dist/components/Modal/SuccessModal/SuccessModal.styles.js +5 -8
- package/dist/components/NotificationCounter/NotificationCounter.styles.js +2 -2
- package/dist/components/Number/Number.js +1 -1
- package/dist/components/Number/Number.styles.js +2 -2
- package/dist/components/Pagination/Pagination.styles.js +7 -7
- package/dist/components/PanelCard/PanelCard.styles.js +17 -17
- package/dist/components/Payment/DetailRows.js +1 -1
- package/dist/components/Payment/DetailsToggle.js +4 -6
- package/dist/components/Payment/PaymentDetailsCard.js +29 -53
- package/dist/components/Payment/PaymentDisplay.js +12 -20
- package/dist/components/Payment/PaymentPendingCard.d.ts +1 -1
- package/dist/components/Payment/PaymentPendingCard.js +10 -13
- package/dist/components/Payment/PaymentSuccessCard.js +6 -9
- package/dist/components/Payment/TimerComponent.js +5 -4
- package/dist/components/Process/Process.styles.js +7 -13
- package/dist/components/ProfileBadge/ProfileBadge.styles.js +8 -10
- package/dist/components/ProfileBox/ProfileBox.styles.js +5 -7
- package/dist/components/Radio/Radio.styles.js +8 -9
- package/dist/components/RefreshButton/RefreshButton.styles.js +5 -5
- package/dist/components/RequestDataBox/RequestDataBox.styles.js +3 -5
- package/dist/components/Section/Section.styles.js +16 -18
- package/dist/components/SectionTitle/SectionTitle.styles.d.ts +4 -0
- package/dist/components/SectionTitle/SectionTitle.styles.js +4 -7
- package/dist/components/Skeleton/Skeleton.d.ts +1 -1
- package/dist/components/Skeleton/Skeleton.js +3 -3
- package/dist/components/Snackbar/Snackbar.styles.js +8 -10
- package/dist/components/SpanButton/SpanButton.styles.js +2 -2
- package/dist/components/StatusDot/StatusDot.d.ts +1 -1
- package/dist/components/StatusDot/StatusDot.js +5 -5
- package/dist/components/StatusDot/StatusDot.styles.js +2 -5
- package/dist/components/StatusTag/StatusTag.js +1 -1
- package/dist/components/StatusTag/StatusTag.styles.js +4 -4
- package/dist/components/StepController/StepController.styles.js +7 -7
- package/dist/components/StepSidebar/MobileStepProgress.styles.js +6 -8
- package/dist/components/StepSidebar/StepProgress.styles.js +18 -27
- package/dist/components/StepSidebar/StepSidebar.styles.js +14 -20
- package/dist/components/StokrLoader/StokrLoader.js +41 -13
- package/dist/components/StokrLoader/loaderSession.d.ts +14 -0
- package/dist/components/StokrLoader/loaderSession.js +30 -0
- package/dist/components/Switch/Switch.styles.js +12 -14
- package/dist/components/TabsNav/TabsNav.styles.js +7 -9
- package/dist/components/TaxResidenceCard/TaxResidenceCard.js +1 -1
- package/dist/components/TaxResidenceCard/TaxResidenceCard.styles.js +30 -35
- package/dist/components/Text/Text.styles.d.ts +2 -1
- package/dist/components/Text/Text.styles.js +36 -70
- package/dist/components/TextLink/TextLink.styles.js +5 -7
- package/dist/components/Timeline/Timeline.styles.js +17 -23
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -2
- package/dist/components/Tooltip/Tooltip.styles.js +4 -5
- package/dist/components/breakdown/Breakdown.js +3 -5
- package/dist/components/logo/Logo.js +1 -1
- package/dist/design-system/css/base.css +14 -14
- package/dist/design-system/css-builders.d.ts +25 -0
- package/dist/design-system/css-builders.js +81 -0
- package/dist/design-system/generated/fonts.css +0 -49
- package/dist/design-system/generated/text-classes.css +123 -123
- package/dist/design-system/generated/text-styles.d.ts +24 -24
- package/dist/design-system/generated/text-styles.js +123 -123
- package/dist/design-system/generated/tokens.css +417 -412
- package/dist/design-system/index.d.ts +2 -1
- package/dist/design-system/styled/build-theme.js +1 -1
- package/dist/design-system/tokens/colors.d.ts +1 -1
- package/dist/design-system/tokens/colors.js +1 -1
- package/dist/design-system/tokens/fonts.d.ts +6 -2
- package/dist/design-system/tokens/fonts.js +1 -1
- package/dist/design-system/tokens/semantic.d.ts +15 -3
- package/dist/design-system/tokens/semantic.js +5 -1
- package/dist/design-system/tokens/typography.d.ts +1 -1
- package/dist/design-system/tokens/typography.js +64 -41
- package/dist/index.d.ts +11 -1
- package/dist/index.js +3 -0
- package/dist/styles/borderedField.d.ts +1 -1
- package/dist/styles/borderedField.js +13 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ npm install react react-dom styled-components react-router-dom
|
|
|
35
35
|
|
|
36
36
|
Peers: React 18 or 19, styled-components 6, react-router-dom 6 or 7.
|
|
37
37
|
|
|
38
|
-
**2. Import the design-system stylesheet once**, at the entry point of the app. It brings the fonts, the CSS variables (`--
|
|
38
|
+
**2. Import the design-system stylesheet once**, at the entry point of the app. It brings the fonts, the CSS variables (`--text-primary`, `--status-info-bg`, `--space-4`…), the text classes and the baseline. Without it components render unstyled.
|
|
39
39
|
|
|
40
40
|
```tsx
|
|
41
41
|
import '@stokr/components-library/design-system.css'
|
|
@@ -103,7 +103,7 @@ Components that open (modals, drawers) are controlled by an `isOpen` prop; field
|
|
|
103
103
|
|
|
104
104
|
## 🎨 Design system
|
|
105
105
|
|
|
106
|
-
**One source for the look.** The colours, type, spacing, radius, shadows and breakpoints of the STOKR UI kit are written once, in this library, and reach every app as CSS variables (
|
|
106
|
+
**One source for the look.** The colours, type, spacing, radius, shadows and breakpoints of the STOKR UI kit are written once, in this library, and reach every app as CSS variables (`--*`). Components and apps use the **names**, never the values, and dark mode comes for free.
|
|
107
107
|
|
|
108
108
|
```tsx
|
|
109
109
|
import '@stokr/components-library/design-system.css' // once, at the app entry
|
|
@@ -111,8 +111,8 @@ import { text, breakpoint } from '@stokr/components-library'
|
|
|
111
111
|
|
|
112
112
|
const Title = styled.h1`
|
|
113
113
|
${text('titleXl')}
|
|
114
|
-
color: var(--
|
|
115
|
-
${breakpoint.Medium` padding: var(--
|
|
114
|
+
color: var(--text-primary);
|
|
115
|
+
${breakpoint.Medium` padding: var(--space-8); `}
|
|
116
116
|
`
|
|
117
117
|
```
|
|
118
118
|
|
|
@@ -151,14 +151,14 @@ Pure functions and hooks, also exported from the package root.
|
|
|
151
151
|
| `npm run lint` | 🔎 ESLint on `src`, then `check:css-vars` |
|
|
152
152
|
| `npm run gen:tokens` | ⚙️ Regenerate `src/design-system/generated` from `tokens/` |
|
|
153
153
|
| `npm run check:tokens` | 🔒 Fails if `generated/` is out of date |
|
|
154
|
-
| `npm run check:css-vars` | 🔎 Fails on an undefined
|
|
154
|
+
| `npm run check:css-vars` | 🔎 Fails on an undefined CSS variable |
|
|
155
155
|
| `npm run check:media` | 📱 Fails if a raw width `@media` is added (use `breakpoint`) |
|
|
156
156
|
| `npm run build:dist` | 📦 Library build + static files + design-system stylesheet |
|
|
157
157
|
| `npm run build-storybook` | 🏗️ Static Storybook in `storybook-static` |
|
|
158
158
|
|
|
159
159
|
**The rules in one list** (details in [AGENTS.md](AGENTS.md) and the [design-system guide](src/design-system/README.md)):
|
|
160
160
|
|
|
161
|
-
- 🎨 Colours by role from the semantic tokens (`--
|
|
161
|
+
- 🎨 Colours by role from the semantic tokens (`--text-*`, `--background-*`, `--border-*`, `--action-*`, `--status-*`, `--tag-*`); never a hex, `font-family` or raw `@media` in a component.
|
|
162
162
|
- 📖 One story file per component, with a `Default` story that sets only the required props.
|
|
163
163
|
- 🧩 New and touched components are TypeScript, without `prop-types`.
|
|
164
164
|
- 🔁 Changing a token: edit `tokens/`, run `npm run gen:tokens`, commit `generated/`.
|
|
@@ -173,7 +173,7 @@ Pure functions and hooks, also exported from the package root.
|
|
|
173
173
|
|
|
174
174
|
1. 🧵 **Import `@stokr/components-library/design-system.css` once.** Components now read CSS variables, so without it they are unstyled.
|
|
175
175
|
2. 📱 **`rwd` is now `breakpoint`**, and `Large` moved from 1024px to 1200px (992 < 1200 < 1440).
|
|
176
|
-
3. 🎨 **`colors`** is now the UI kit's colour ramp (`colors['blue-500']`, hex values). The old flat object (`colors.blue`, `colors.grey2`…), the old `theme` keys (`theme.cPrimary`…), `GlobalStyle`, `spacing`, `typography`, `media` and `getMedia` are gone: use `var(--
|
|
176
|
+
3. 🎨 **`colors`** is now the UI kit's colour ramp (`colors['blue-500']`, hex values). The old flat object (`colors.blue`, `colors.grey2`…), the old `theme` keys (`theme.cPrimary`…), `GlobalStyle`, `spacing`, `typography`, `media` and `getMedia` are gone: use `var(--name)`, `text()` and `breakpoint`.
|
|
177
177
|
4. 🔣 **Register `requiredMaterialIcons`**: components draw Material icons, not the old icon fonts.
|
|
178
178
|
5. 🌗 **Dark mode** is `data-theme="dark"` on `<html>`; nothing to change in components that use the semantic tokens.
|
|
179
179
|
6. 📏 **`rem` became `px`**: the library no longer depends on a 10px root font size.
|
|
@@ -187,7 +187,7 @@ Pure functions and hooks, also exported from the package root.
|
|
|
187
187
|
| Symptom | Cause and fix |
|
|
188
188
|
| ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
189
189
|
| 😶 Components look unstyled, wrong font | The stylesheet is not imported: `import '@stokr/components-library/design-system.css'` once at the entry. |
|
|
190
|
-
| 🌗 Something stays light (or unreadable) in dark mode | A hard-coded colour in the app. Use a semantic token (`var(--
|
|
190
|
+
| 🌗 Something stays light (or unreadable) in dark mode | A hard-coded colour in the app. Use a semantic token (`var(--text-primary)`…). |
|
|
191
191
|
| 🔣 An icon renders empty | The icon is not registered: `registerMaterialIcons(...)`, including every key of `requiredMaterialIcons`. |
|
|
192
192
|
| 🧭 `useNavigate()` may be used only in the context of a `<Router>` | Wrap the app in a router. `SmartLink`, `TextLink`, `BackButton` and `MenuNav` need one. |
|
|
193
193
|
| ⚛️ Invalid hook call / duplicated React or styled-components | Dedupe the peers in Vite: `resolve: { dedupe: ['react', 'react-dom', 'styled-components'] }`. |
|
|
@@ -4,7 +4,7 @@ const Root = styled.div`
|
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-wrap: wrap;
|
|
6
6
|
align-items: center;
|
|
7
|
-
gap: var(--address-item-gap, var(--
|
|
7
|
+
gap: var(--address-item-gap, var(--space-3));
|
|
8
8
|
min-width: 0;
|
|
9
9
|
`;
|
|
10
10
|
const Leading = styled.span`
|
|
@@ -15,16 +15,16 @@ const Leading = styled.span`
|
|
|
15
15
|
box-sizing: content-box;
|
|
16
16
|
width: var(--address-item-leading-size, 24px);
|
|
17
17
|
height: var(--address-item-leading-size, 24px);
|
|
18
|
-
padding: var(--address-item-leading-padding, var(--
|
|
19
|
-
border-radius: var(--
|
|
20
|
-
background: var(--address-item-leading-background, var(--
|
|
18
|
+
padding: var(--address-item-leading-padding, var(--space-1));
|
|
19
|
+
border-radius: var(--radius-full);
|
|
20
|
+
background: var(--address-item-leading-background, var(--background-surface-raised));
|
|
21
21
|
overflow: hidden;
|
|
22
22
|
`;
|
|
23
23
|
const Main = styled.div`
|
|
24
24
|
display: flex;
|
|
25
25
|
flex: 1 1 auto;
|
|
26
26
|
align-items: center;
|
|
27
|
-
gap: var(--address-item-gap, var(--
|
|
27
|
+
gap: var(--address-item-gap, var(--space-3));
|
|
28
28
|
`;
|
|
29
29
|
const Body = styled.div`
|
|
30
30
|
display: flex;
|
|
@@ -32,24 +32,24 @@ const Body = styled.div`
|
|
|
32
32
|
`;
|
|
33
33
|
const Label = styled.span`
|
|
34
34
|
${text("caption")};
|
|
35
|
-
color: var(--
|
|
35
|
+
color: var(--text-primary);
|
|
36
36
|
`;
|
|
37
37
|
const AddressRow = styled.span`
|
|
38
38
|
display: flex;
|
|
39
39
|
flex-wrap: wrap;
|
|
40
40
|
align-items: center;
|
|
41
|
-
gap: var(--
|
|
41
|
+
gap: var(--space-1) var(--address-item-address-gap, var(--space-2));
|
|
42
42
|
min-width: 0;
|
|
43
43
|
`;
|
|
44
44
|
const AddressGroup = styled.span`
|
|
45
45
|
display: inline-flex;
|
|
46
46
|
align-items: center;
|
|
47
|
-
gap: var(--address-item-address-gap, var(--
|
|
47
|
+
gap: var(--address-item-address-gap, var(--space-2));
|
|
48
48
|
min-width: 0;
|
|
49
49
|
`;
|
|
50
50
|
const Address = styled.span`
|
|
51
51
|
${text("subtitleM")};
|
|
52
|
-
color: var(--
|
|
52
|
+
color: var(--text-primary);
|
|
53
53
|
${({ $full }) => $full ? "min-width: 0; overflow-wrap: anywhere;" : "flex-shrink: 0; white-space: nowrap;"}
|
|
54
54
|
`;
|
|
55
55
|
const Trailing = styled.div`
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
2
|
import { glyph } from "../../MaterialIcon/glyph.js";
|
|
3
|
+
import { text } from "../../../design-system/styled/text.js";
|
|
3
4
|
styled.div`
|
|
4
5
|
position: relative;
|
|
5
6
|
`;
|
|
@@ -10,7 +11,7 @@ styled.div`
|
|
|
10
11
|
left: 0;
|
|
11
12
|
width: 100%;
|
|
12
13
|
overflow: hidden;
|
|
13
|
-
background-color: var(--
|
|
14
|
+
background-color: var(--background-default);
|
|
14
15
|
`;
|
|
15
16
|
styled.div`
|
|
16
17
|
z-index: 0;
|
|
@@ -29,7 +30,7 @@ const Column = styled.div.withConfig({
|
|
|
29
30
|
})`
|
|
30
31
|
display: table-cell;
|
|
31
32
|
text-align: ${(props) => props.align};
|
|
32
|
-
font-family: var(--
|
|
33
|
+
font-family: var(--font-family-base);
|
|
33
34
|
|
|
34
35
|
${(props) => props.colWidth && `
|
|
35
36
|
width: ${props.colWidth}
|
|
@@ -56,16 +57,12 @@ styled.div.withConfig({
|
|
|
56
57
|
|
|
57
58
|
${Row} {
|
|
58
59
|
${Column} {
|
|
59
|
-
border-bottom: 1px solid var(--
|
|
60
|
+
border-bottom: 1px solid var(--border-subtle);
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
${Column} {
|
|
64
|
-
|
|
65
|
-
font-size: 11px;
|
|
66
|
-
line-height: 20px;
|
|
67
|
-
letter-spacing: 1.98px;
|
|
68
|
-
text-transform: uppercase;
|
|
65
|
+
${text("overline")}
|
|
69
66
|
vertical-align: middle;
|
|
70
67
|
white-space: nowrap;
|
|
71
68
|
padding: 10px 10px;
|
|
@@ -81,19 +78,19 @@ styled.div`
|
|
|
81
78
|
|
|
82
79
|
& + ${Row} {
|
|
83
80
|
${Column} {
|
|
84
|
-
border-top: 1px solid var(--
|
|
81
|
+
border-top: 1px solid var(--border-subtle);
|
|
85
82
|
}
|
|
86
83
|
}
|
|
87
84
|
|
|
88
85
|
/* &:hover {
|
|
89
86
|
${Column} {
|
|
90
|
-
background-color: var(--
|
|
87
|
+
background-color: var(--color-neutral-100);
|
|
91
88
|
}
|
|
92
89
|
} */
|
|
93
90
|
}
|
|
94
91
|
|
|
95
92
|
${Column} {
|
|
96
|
-
color: var(--
|
|
93
|
+
color: var(--text-primary);
|
|
97
94
|
font-weight: 400;
|
|
98
95
|
font-size: 14px;
|
|
99
96
|
line-height: 20px;
|
|
@@ -104,7 +101,7 @@ styled.div`
|
|
|
104
101
|
styled.div`
|
|
105
102
|
display: inline-block;
|
|
106
103
|
background-color: ${(props) => props.color};
|
|
107
|
-
color: var(--
|
|
104
|
+
color: var(--text-on-brand);
|
|
108
105
|
font-weight: 600;
|
|
109
106
|
min-width: 40px;
|
|
110
107
|
line-height: 24px;
|
|
@@ -157,19 +154,15 @@ const TableWrap = styled.div`
|
|
|
157
154
|
const StyledTh = styled.th.withConfig({
|
|
158
155
|
shouldForwardProp: (props) => !["blue", "width", "minWidth", "maxWidth"].includes(props)
|
|
159
156
|
})`
|
|
160
|
-
text
|
|
157
|
+
${text("overline")}
|
|
161
158
|
padding: 10px;
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
background-color: var(--stokr-background-default);
|
|
166
|
-
color: var(--stokr-text-primary);
|
|
167
|
-
border-bottom: 1px solid var(--stokr-border-subtle);
|
|
168
|
-
line-height: 20px;
|
|
159
|
+
background-color: var(--background-default);
|
|
160
|
+
color: var(--text-primary);
|
|
161
|
+
border-bottom: 1px solid var(--border-subtle);
|
|
169
162
|
|
|
170
163
|
${(props) => props.blue && `
|
|
171
|
-
background-color: var(--
|
|
172
|
-
color: var(--
|
|
164
|
+
background-color: var(--action-accent-bg);
|
|
165
|
+
color: var(--action-accent-text);
|
|
173
166
|
border:none;
|
|
174
167
|
`}
|
|
175
168
|
|
|
@@ -191,11 +184,11 @@ const StyledTd = styled.td.withConfig({
|
|
|
191
184
|
shouldForwardProp: (props) => !["blue", "subTable", "width", "minWidth", "maxWidth"].includes(props)
|
|
192
185
|
})`
|
|
193
186
|
padding: 26px 15px;
|
|
194
|
-
border-bottom: 1px solid var(--
|
|
187
|
+
border-bottom: 1px solid var(--border-subtle);
|
|
195
188
|
font-size: 14px;
|
|
196
189
|
${(props) => props.blue && `
|
|
197
|
-
background-color: var(--
|
|
198
|
-
color: var(--
|
|
190
|
+
background-color: var(--action-accent-bg-hover);
|
|
191
|
+
color: var(--action-accent-text);
|
|
199
192
|
`}
|
|
200
193
|
|
|
201
194
|
${(props) => props.subTable && `
|
|
@@ -8,7 +8,7 @@ const BackButtonIcon = styled.span.attrs({
|
|
|
8
8
|
font-size: 16px;
|
|
9
9
|
position: absolute;
|
|
10
10
|
left: 0;
|
|
11
|
-
color: var(--
|
|
11
|
+
color: var(--text-primary);
|
|
12
12
|
transform: translateX(0);
|
|
13
13
|
transition:
|
|
14
14
|
0.3s color,
|
|
@@ -21,7 +21,7 @@ const ForwardButtonIcon = styled.span.attrs({
|
|
|
21
21
|
font-size: 16px;
|
|
22
22
|
position: absolute;
|
|
23
23
|
right: 0;
|
|
24
|
-
color: var(--
|
|
24
|
+
color: var(--text-primary);
|
|
25
25
|
transform: translateX(0);
|
|
26
26
|
transition:
|
|
27
27
|
0.3s color,
|
|
@@ -32,17 +32,17 @@ const StyledBackButton = styled(Link)`
|
|
|
32
32
|
font-size: 11px;
|
|
33
33
|
line-height: 16px;
|
|
34
34
|
letter-spacing: 2px;
|
|
35
|
-
color: var(--
|
|
35
|
+
color: var(--text-primary);
|
|
36
36
|
position: relative;
|
|
37
37
|
padding-left: 16px;
|
|
38
38
|
transition: 0.3s color;
|
|
39
39
|
|
|
40
40
|
&:hover {
|
|
41
|
-
color: var(--
|
|
41
|
+
color: var(--action-accent-bg-hover);
|
|
42
42
|
|
|
43
43
|
${BackButtonIcon} {
|
|
44
44
|
transform: translateX(-4px);
|
|
45
|
-
color: var(--
|
|
45
|
+
color: var(--action-accent-bg-hover);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
`;
|
|
@@ -51,17 +51,17 @@ const StyledBackButtonExternal = styled.a`
|
|
|
51
51
|
font-size: 11px;
|
|
52
52
|
line-height: 16px;
|
|
53
53
|
letter-spacing: 2px;
|
|
54
|
-
color: var(--
|
|
54
|
+
color: var(--text-primary);
|
|
55
55
|
position: relative;
|
|
56
56
|
padding-left: 16px;
|
|
57
57
|
transition: 0.3s color;
|
|
58
58
|
|
|
59
59
|
&:hover {
|
|
60
|
-
color: var(--
|
|
60
|
+
color: var(--action-accent-bg-hover);
|
|
61
61
|
|
|
62
62
|
${BackButtonIcon} {
|
|
63
63
|
transform: translateX(-4px);
|
|
64
|
-
color: var(--
|
|
64
|
+
color: var(--action-accent-bg-hover);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
`;
|
|
@@ -71,17 +71,17 @@ const StyledWindowBackButton = styled.span`
|
|
|
71
71
|
line-height: 16px;
|
|
72
72
|
cursor: pointer;
|
|
73
73
|
letter-spacing: 2px;
|
|
74
|
-
color: var(--
|
|
74
|
+
color: var(--text-primary);
|
|
75
75
|
position: relative;
|
|
76
76
|
padding-left: 16px;
|
|
77
77
|
transition: 0.3s color;
|
|
78
78
|
|
|
79
79
|
&:hover {
|
|
80
|
-
color: var(--
|
|
80
|
+
color: var(--action-accent-bg-hover);
|
|
81
81
|
|
|
82
82
|
${BackButtonIcon} {
|
|
83
83
|
transform: translateX(-4px);
|
|
84
|
-
color: var(--
|
|
84
|
+
color: var(--action-accent-bg-hover);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
`;
|
|
@@ -92,7 +92,7 @@ styled.div.withConfig({
|
|
|
92
92
|
font-size: 11px;
|
|
93
93
|
line-height: 16px;
|
|
94
94
|
letter-spacing: 2px;
|
|
95
|
-
color: var(--
|
|
95
|
+
color: var(--text-primary);
|
|
96
96
|
position: relative;
|
|
97
97
|
padding-left: 16px;
|
|
98
98
|
transition: 0.3s color;
|
|
@@ -103,16 +103,16 @@ styled.div.withConfig({
|
|
|
103
103
|
`}
|
|
104
104
|
|
|
105
105
|
&:hover {
|
|
106
|
-
color: var(--
|
|
106
|
+
color: var(--action-accent-bg-hover);
|
|
107
107
|
|
|
108
108
|
${BackButtonIcon} {
|
|
109
109
|
transform: translateX(-4px);
|
|
110
|
-
color: var(--
|
|
110
|
+
color: var(--action-accent-bg-hover);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
${ForwardButtonIcon} {
|
|
114
114
|
transform: translateX(4px);
|
|
115
|
-
color: var(--
|
|
115
|
+
color: var(--action-accent-bg-hover);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
`;
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
|
+
import { text } from "../../design-system/styled/text.js";
|
|
2
3
|
import { breakpoint } from "../../design-system/styled/breakpoint.js";
|
|
3
4
|
const Table = styled.div.withConfig({
|
|
4
5
|
shouldForwardProp: (props) => !["filled"].includes(props)
|
|
5
6
|
})`
|
|
6
7
|
display: block;
|
|
7
|
-
border: 1px solid var(--
|
|
8
|
+
border: 1px solid var(--border-subtle);
|
|
8
9
|
${(props) => props.filled && `
|
|
9
|
-
background: var(--
|
|
10
|
+
background: var(--background-surface);
|
|
10
11
|
`}
|
|
11
12
|
`;
|
|
12
13
|
const Row = styled.div.withConfig({
|
|
13
14
|
shouldForwardProp: (props) => !["smallPadding"].includes(props)
|
|
14
15
|
})`
|
|
15
|
-
|
|
16
|
-
line-height: 24px;
|
|
17
|
-
letter-spacing: 2.1px;
|
|
18
|
-
text-transform: uppercase;
|
|
16
|
+
${text("labelRegular")}
|
|
19
17
|
padding: 16px 24px;
|
|
20
18
|
display: block;
|
|
21
19
|
|
|
@@ -24,7 +22,7 @@ const Row = styled.div.withConfig({
|
|
|
24
22
|
`}
|
|
25
23
|
|
|
26
24
|
& + & {
|
|
27
|
-
border-top: 1px solid var(--
|
|
25
|
+
border-top: 1px solid var(--border-subtle);
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
&:after {
|
|
@@ -52,7 +50,7 @@ const LabelWarning = styled.div`
|
|
|
52
50
|
float: left;
|
|
53
51
|
text-align: left;
|
|
54
52
|
width: 100%;
|
|
55
|
-
color: var(--
|
|
53
|
+
color: var(--status-error-text);
|
|
56
54
|
line-height: 16px;
|
|
57
55
|
`;
|
|
58
56
|
const Caption = styled.div`
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Button } from "../Button/Button.styles.js";
|
|
2
2
|
import styled, { css } from "styled-components";
|
|
3
3
|
import { breakpoint } from "../../design-system/styled/breakpoint.js";
|
|
4
|
+
import { text } from "../../design-system/styled/text.js";
|
|
4
5
|
import { Breakdown } from "../breakdown/Breakdown.js";
|
|
5
6
|
const Content = styled.div.withConfig({
|
|
6
7
|
shouldForwardProp: (props) => props !== "layout"
|
|
@@ -17,7 +18,7 @@ const Content = styled.div.withConfig({
|
|
|
17
18
|
bottom: 0;
|
|
18
19
|
left: 0;
|
|
19
20
|
right: 0;
|
|
20
|
-
color: var(--
|
|
21
|
+
color: var(--brand-pure-white);
|
|
21
22
|
`}
|
|
22
23
|
|
|
23
24
|
${breakpoint.Medium`
|
|
@@ -40,7 +41,7 @@ const Container = styled.div.withConfig({
|
|
|
40
41
|
position: relative;
|
|
41
42
|
display: flex;
|
|
42
43
|
flex-direction: column;
|
|
43
|
-
background: var(--
|
|
44
|
+
background: var(--background-default);
|
|
44
45
|
height: 100%;
|
|
45
46
|
min-height: 400px;
|
|
46
47
|
max-height: 540px;
|
|
@@ -64,11 +65,11 @@ const Container = styled.div.withConfig({
|
|
|
64
65
|
@media (hover: hover) and (pointer: fine) {
|
|
65
66
|
cursor:pointer;
|
|
66
67
|
&:hover {
|
|
67
|
-
box-shadow: 0 0 0 10px
|
|
68
|
+
box-shadow: 0 0 0 10px var(--background-surface);
|
|
68
69
|
|
|
69
70
|
${(props.layout === "image-right" || props.layout === "image-left") && `
|
|
70
71
|
${Content} {
|
|
71
|
-
background-color: var(--
|
|
72
|
+
background-color: var(--background-surface);
|
|
72
73
|
}
|
|
73
74
|
`}
|
|
74
75
|
}
|
|
@@ -109,11 +110,7 @@ const TextWrapper = styled.div`
|
|
|
109
110
|
// max-height: 70%;
|
|
110
111
|
|
|
111
112
|
h3 {
|
|
112
|
-
|
|
113
|
-
font-size: 20px;
|
|
114
|
-
line-height: 30px;
|
|
115
|
-
letter-spacing: 1.41px;
|
|
116
|
-
text-transform: uppercase;
|
|
113
|
+
${text("titleL")}
|
|
117
114
|
margin: 0;
|
|
118
115
|
display: -webkit-box;
|
|
119
116
|
-webkit-box-orient: vertical;
|
|
@@ -128,7 +125,6 @@ const TextWrapper = styled.div`
|
|
|
128
125
|
`}
|
|
129
126
|
|
|
130
127
|
${breakpoint.Medium`
|
|
131
|
-
font-size: 22px;
|
|
132
128
|
-webkit-line-clamp: 6;
|
|
133
129
|
`}
|
|
134
130
|
|
|
@@ -172,7 +168,7 @@ const BottomRow = styled.div`
|
|
|
172
168
|
const Category = styled(Breakdown).withConfig({
|
|
173
169
|
shouldForwardProp: (props) => props !== "category"
|
|
174
170
|
})`
|
|
175
|
-
|
|
171
|
+
${text("labelRegular")}
|
|
176
172
|
display: flex;
|
|
177
173
|
align-items: center;
|
|
178
174
|
gap: 8px;
|
|
@@ -185,7 +181,7 @@ const Category = styled(Breakdown).withConfig({
|
|
|
185
181
|
height: 0;
|
|
186
182
|
border-style: solid;
|
|
187
183
|
border-width: 6px 0 6px 8px;
|
|
188
|
-
border-color: transparent transparent transparent var(--
|
|
184
|
+
border-color: transparent transparent transparent var(--border-subtle);
|
|
189
185
|
}
|
|
190
186
|
`}
|
|
191
187
|
`;
|
|
@@ -209,7 +205,7 @@ const LoaderWrapper = styled.div`
|
|
|
209
205
|
display: flex;
|
|
210
206
|
align-items: center;
|
|
211
207
|
justify-content: center;
|
|
212
|
-
background: var(--
|
|
208
|
+
background: var(--background-default);
|
|
213
209
|
`;
|
|
214
210
|
export {
|
|
215
211
|
BottomRow,
|
|
@@ -2,7 +2,7 @@ export type ButtonSize = 'sm' | 'md' | 'lg';
|
|
|
2
2
|
/** The UI kit's button variants; colours come from the `action-*` tokens, so they follow the theme. */
|
|
3
3
|
export type ButtonVariant = 'accent' | 'primary' | 'secondary' | 'outline' | 'ghost' | 'link' | 'negative';
|
|
4
4
|
export interface ButtonProps {
|
|
5
|
-
/** Kit variant.
|
|
5
|
+
/** Kit variant. Without it the button keeps its original look (and the deprecated boolean props still work). */
|
|
6
6
|
variant?: ButtonVariant;
|
|
7
7
|
/** Figma size (32 / 40 / 48px tall, label/cta text, room for icons). Without it the button keeps its original look. */
|
|
8
8
|
size?: ButtonSize;
|
|
@@ -78,7 +78,7 @@ const VARIANTS = {
|
|
|
78
78
|
disabledText: "action-disabled-negative-text"
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
const paint = (p) => p === "transparent" ? "transparent" : `var(
|
|
81
|
+
const paint = (p) => p === "transparent" ? "transparent" : `var(--${p})`;
|
|
82
82
|
const resolveButtonVariant = (props) => {
|
|
83
83
|
if (props.variant) return props.variant;
|
|
84
84
|
if (props.outline || props.outlineBlack || props.black) return "outline";
|
|
@@ -87,7 +87,121 @@ const resolveButtonVariant = (props) => {
|
|
|
87
87
|
if (props.secondary) return "secondary";
|
|
88
88
|
return "accent";
|
|
89
89
|
};
|
|
90
|
-
const
|
|
90
|
+
const legacyVariantStyles = (props) => css`
|
|
91
|
+
background-color: var(--action-accent-bg);
|
|
92
|
+
border-color: var(--action-accent-bg);
|
|
93
|
+
color: var(--action-accent-text);
|
|
94
|
+
|
|
95
|
+
&:hover,
|
|
96
|
+
&:focus,
|
|
97
|
+
&:active {
|
|
98
|
+
background-color: var(--action-accent-bg-hover);
|
|
99
|
+
border-color: var(--action-accent-bg-hover);
|
|
100
|
+
color: var(--action-accent-text);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
${props.secondary && css`
|
|
104
|
+
background-color: var(--background-default);
|
|
105
|
+
color: var(--action-accent-bg);
|
|
106
|
+
|
|
107
|
+
&:hover,
|
|
108
|
+
&:focus,
|
|
109
|
+
&:active {
|
|
110
|
+
background-color: var(--action-accent-bg);
|
|
111
|
+
border-color: var(--action-accent-bg);
|
|
112
|
+
color: var(--action-accent-text);
|
|
113
|
+
}
|
|
114
|
+
`}
|
|
115
|
+
|
|
116
|
+
${props.onlyText && css`
|
|
117
|
+
border-color: transparent;
|
|
118
|
+
background-color: transparent;
|
|
119
|
+
color: var(--text-primary);
|
|
120
|
+
|
|
121
|
+
&:hover,
|
|
122
|
+
&:focus,
|
|
123
|
+
&:active {
|
|
124
|
+
background-color: transparent;
|
|
125
|
+
border-color: transparent;
|
|
126
|
+
color: var(--action-accent-bg);
|
|
127
|
+
}
|
|
128
|
+
`}
|
|
129
|
+
|
|
130
|
+
${props.disabled && css`
|
|
131
|
+
border-color: var(--text-primary);
|
|
132
|
+
background-color: var(--background-default);
|
|
133
|
+
color: var(--text-primary);
|
|
134
|
+
opacity: 0.2;
|
|
135
|
+
cursor: default;
|
|
136
|
+
box-shadow: none !important;
|
|
137
|
+
pointer-events: none !important;
|
|
138
|
+
|
|
139
|
+
&:hover,
|
|
140
|
+
&:focus,
|
|
141
|
+
&:active {
|
|
142
|
+
background-color: var(--action-accent-bg);
|
|
143
|
+
border-color: var(--action-accent-bg);
|
|
144
|
+
color: var(--action-accent-text);
|
|
145
|
+
}
|
|
146
|
+
`}
|
|
147
|
+
|
|
148
|
+
${props.negative && css`
|
|
149
|
+
border-color: var(--status-error-border);
|
|
150
|
+
background-color: var(--background-default);
|
|
151
|
+
color: var(--status-error-border);
|
|
152
|
+
|
|
153
|
+
&:hover,
|
|
154
|
+
&:focus,
|
|
155
|
+
&:active {
|
|
156
|
+
background-color: var(--background-default);
|
|
157
|
+
border-color: var(--status-error-text);
|
|
158
|
+
color: var(--status-error-text);
|
|
159
|
+
}
|
|
160
|
+
`}
|
|
161
|
+
|
|
162
|
+
${props.outline && css`
|
|
163
|
+
border-color: var(--text-on-brand);
|
|
164
|
+
background-color: transparent;
|
|
165
|
+
color: var(--text-on-brand);
|
|
166
|
+
|
|
167
|
+
&:hover,
|
|
168
|
+
&:focus,
|
|
169
|
+
&:active {
|
|
170
|
+
background-color: var(--text-on-brand);
|
|
171
|
+
border-color: var(--text-on-brand);
|
|
172
|
+
color: var(--status-error-border);
|
|
173
|
+
}
|
|
174
|
+
`}
|
|
175
|
+
|
|
176
|
+
${props.outlineBlack && css`
|
|
177
|
+
border-color: var(--border-default);
|
|
178
|
+
background-color: var(--background-default);
|
|
179
|
+
color: var(--text-primary);
|
|
180
|
+
|
|
181
|
+
&:hover,
|
|
182
|
+
&:focus,
|
|
183
|
+
&:active {
|
|
184
|
+
background-color: var(--action-accent-bg);
|
|
185
|
+
border-color: var(--action-accent-bg);
|
|
186
|
+
color: var(--action-accent-text);
|
|
187
|
+
}
|
|
188
|
+
`}
|
|
189
|
+
|
|
190
|
+
${props.black && css`
|
|
191
|
+
border-color: var(--border-default);
|
|
192
|
+
background-color: transparent;
|
|
193
|
+
color: var(--text-primary);
|
|
194
|
+
|
|
195
|
+
&:hover,
|
|
196
|
+
&:focus,
|
|
197
|
+
&:active {
|
|
198
|
+
background-color: var(--text-primary);
|
|
199
|
+
border-color: var(--text-primary);
|
|
200
|
+
color: var(--background-default);
|
|
201
|
+
}
|
|
202
|
+
`}
|
|
203
|
+
`;
|
|
204
|
+
const kitVariantStyles = (props) => {
|
|
91
205
|
const variant = resolveButtonVariant(props);
|
|
92
206
|
const v = VARIANTS[variant];
|
|
93
207
|
return css`
|
|
@@ -130,6 +244,7 @@ const variantStyles = (props) => {
|
|
|
130
244
|
`}
|
|
131
245
|
`;
|
|
132
246
|
};
|
|
247
|
+
const variantStyles = (props) => props.variant ? kitVariantStyles(props) : legacyVariantStyles(props);
|
|
133
248
|
const Button = styled.button.withConfig({
|
|
134
249
|
shouldForwardProp: (props) => ![
|
|
135
250
|
"variant",
|
|
@@ -155,14 +270,10 @@ const Button = styled.button.withConfig({
|
|
|
155
270
|
min-height: 40px;
|
|
156
271
|
max-width: 100%;
|
|
157
272
|
border: 1px solid transparent;
|
|
158
|
-
|
|
159
|
-
font-size: 12px;
|
|
160
|
-
line-height: 16px;
|
|
161
|
-
text-transform: uppercase;
|
|
273
|
+
${text("buttonLabel")}
|
|
162
274
|
text-align: center;
|
|
163
|
-
letter-spacing: 2px;
|
|
164
275
|
border-radius: 28px;
|
|
165
|
-
padding:
|
|
276
|
+
padding: 7px 32px;
|
|
166
277
|
margin: 0;
|
|
167
278
|
outline: 0;
|
|
168
279
|
vertical-align: baseline;
|
|
@@ -177,8 +288,8 @@ const Button = styled.button.withConfig({
|
|
|
177
288
|
background-color 0.2s,
|
|
178
289
|
border-color 0.2s;
|
|
179
290
|
|
|
180
|
-
${({ size
|
|
181
|
-
${text("
|
|
291
|
+
${({ size }) => size && SIZES[size] && css`
|
|
292
|
+
${text("label")};
|
|
182
293
|
display: inline-flex;
|
|
183
294
|
align-items: center;
|
|
184
295
|
justify-content: center;
|
|
@@ -208,7 +319,7 @@ const Button = styled.button.withConfig({
|
|
|
208
319
|
${(props) => props.fluid && css`
|
|
209
320
|
display: ${props.size ? "flex" : "block"};
|
|
210
321
|
width: 100%;
|
|
211
|
-
${!props.size && "padding:
|
|
322
|
+
${!props.size && "padding: 7px 12px;"}
|
|
212
323
|
`}
|
|
213
324
|
|
|
214
325
|
${(props) => props.center && css`
|
|
@@ -5,7 +5,7 @@ import { useState, useRef, useId, useEffect } from "react";
|
|
|
5
5
|
import styled, { css, keyframes } from "styled-components";
|
|
6
6
|
import { breakpoint } from "../../design-system/styled/breakpoint.js";
|
|
7
7
|
const config = {
|
|
8
|
-
colorDark: "var(--
|
|
8
|
+
colorDark: "var(--color-blue-600)",
|
|
9
9
|
colorLight: "#9bfcfd",
|
|
10
10
|
strokeWidth: 2,
|
|
11
11
|
padding: 5,
|