@simplybusiness/mobius 9.3.4 → 10.0.0
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 +24 -0
- package/package.json +2 -2
- package/src/components/Accordion/Accordion.css +79 -71
- package/src/components/Accordion/AccordionList.css +25 -23
- package/src/components/Alert/Alert.css +46 -44
- package/src/components/Box/Box.css +4 -2
- package/src/components/Breadcrumbs/Breadcrumbs.css +25 -23
- package/src/components/Button/Button.css +227 -219
- package/src/components/Button/Button.story.styles.css +9 -7
- package/src/components/Checkbox/Checkbox.css +106 -104
- package/src/components/Checkbox/CheckboxGroup.css +22 -20
- package/src/components/Combobox/Combobox.css +96 -94
- package/src/components/Container/Container.css +11 -9
- package/src/components/Divider/Divider.css +14 -12
- package/src/components/Drawer/Drawer.css +157 -155
- package/src/components/DropdownMenu/DropdownMenu.css +54 -52
- package/src/components/DropdownMenu/DropdownMenu.story.styles.css +11 -9
- package/src/components/ErrorMessage/ErrorMessage.css +30 -28
- package/src/components/ExpandableText/ExpandableText.css +11 -9
- package/src/components/Fieldset/Fieldset.css +13 -11
- package/src/components/Flex/Flex.css +5 -3
- package/src/components/Grid/Grid.story.styles.css +18 -16
- package/src/components/Icon/Icon.css +37 -35
- package/src/components/Label/Label.css +13 -11
- package/src/components/Link/Link.css +29 -27
- package/src/components/List/List.css +47 -45
- package/src/components/LoadingIndicator/LoadingIndicator.css +4 -2
- package/src/components/Modal/Modal.css +122 -120
- package/src/components/NumberField/NumberField.css +58 -56
- package/src/components/PasswordField/PasswordField.css +27 -25
- package/src/components/Popover/Popover.css +32 -30
- package/src/components/Popover/Popover.story.styles.css +24 -22
- package/src/components/Progress/Progress.css +25 -23
- package/src/components/Radio/Radio.css +167 -163
- package/src/components/Segment/Segment.css +163 -161
- package/src/components/Select/Select.css +82 -80
- package/src/components/Slider/Slider.css +113 -111
- package/src/components/Stack/Stack.css +24 -22
- package/src/components/Switch/Switch.css +58 -56
- package/src/components/Table/Table.css +52 -50
- package/src/components/Text/Text.css +92 -90
- package/src/components/TextArea/TextArea.css +41 -39
- package/src/components/TextField/TextField.css +132 -130
- package/src/components/Title/Title.css +32 -30
- package/src/components/Toast/Toast.css +234 -232
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 10.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- fc4ed44: ### BREAKING CHANGE: All component CSS is now wrapped in `@layer` declarations
|
|
8
|
+
|
|
9
|
+
All CSS across mobius, mobius-datepicker, mobius-journey, mobius-interventions, mobius-chat-ui, and mobius-chatbot is now wrapped in `@layer atoms` or `@layer organisms`. The layer order preamble is declared in theme-core.
|
|
10
|
+
|
|
11
|
+
**What this means for consumers:**
|
|
12
|
+
- **Good news:** You no longer need specificity hacks (e.g. `.Foo.Foo`) to override Mobius styles. Your unlayered CSS automatically wins the cascade, regardless of import order.
|
|
13
|
+
- **Action required if you support older browsers:** `@layer` is supported in Chrome 99+, Firefox 97+, and Safari 15.4+ (all shipped early 2022). If you need to support browsers older than this, you must add your own `@layer` polyfill at the build level. Mobius intentionally does not ship a polyfill — doing so would cause polyfilled styles to become unlayered and override your app styles, defeating the purpose.
|
|
14
|
+
- **Custom layer ordering:** If you need to insert your own layers between Mobius layers, declare your own `@layer` order before importing theme-core. Your declaration must include all Mobius layers: `@layer reset, base, atoms, your-layer, organisms, theme;`
|
|
15
|
+
|
|
16
|
+
**What changed:**
|
|
17
|
+
- 204 CSS files wrapped in `@layer` blocks
|
|
18
|
+
- `@layer reset, base, atoms, organisms, theme;` preamble added to theme-core
|
|
19
|
+
- New `@simplybusiness/stylelint-plugin` enforces layer wrapping in CI
|
|
20
|
+
- `lint-css.js` now resolves stylelint config per-package instead of using a hardcoded central config
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- @simplybusiness/icons@5.0.3
|
|
25
|
+
- @simplybusiness/mobius-hooks@0.1.1
|
|
26
|
+
|
|
3
27
|
## 9.3.4
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplybusiness/mobius",
|
|
3
3
|
"license": "UNLICENSED",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "10.0.0",
|
|
5
5
|
"description": "Core library of Mobius react components",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@eslint/eslintrc": "^3.3.4",
|
|
68
68
|
"@eslint/js": "^9.39.3",
|
|
69
69
|
"@react-types/progress": "^3.5.18",
|
|
70
|
-
"@simplybusiness/build-scripts": "^
|
|
70
|
+
"@simplybusiness/build-scripts": "^3.0.0",
|
|
71
71
|
"@simplybusiness/eslint-config": "^2.0.4",
|
|
72
72
|
"@simplybusiness/eslint-plugin": "^1.3.0",
|
|
73
73
|
"@testing-library/dom": "^10.4.1",
|
|
@@ -1,89 +1,97 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
@layer atoms {
|
|
2
|
+
.mobius-accordion {
|
|
3
|
+
--transition-duration: 0ms;
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
width: 100%;
|
|
9
|
+
outline: none;
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
&.--should-animate {
|
|
12
|
+
--transition-duration: 500ms;
|
|
13
|
+
}
|
|
12
14
|
}
|
|
13
|
-
}
|
|
14
15
|
|
|
15
|
-
.mobius-accordion__content-container {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
.mobius-accordion__content-container {
|
|
17
|
+
display: grid;
|
|
18
|
+
grid-template-rows: 0fr;
|
|
19
|
+
transition: grid-template-rows var(--transition-duration);
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
&.--is-open {
|
|
22
|
+
grid-template-rows: 1fr;
|
|
23
|
+
}
|
|
22
24
|
}
|
|
23
|
-
}
|
|
24
25
|
|
|
25
|
-
.mobius-accordion__content {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
.mobius-accordion__content {
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
opacity: 0;
|
|
29
|
+
transition:
|
|
30
|
+
opacity var(--transition-duration),
|
|
31
|
+
margin var(--transition-duration);
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
&.--is-open {
|
|
34
|
+
overflow: visible;
|
|
35
|
+
opacity: 1;
|
|
36
|
+
margin-top: var(--size-xs);
|
|
37
|
+
}
|
|
36
38
|
}
|
|
37
|
-
}
|
|
38
39
|
|
|
39
|
-
/* Links */
|
|
40
|
-
.mobius-accordion__link {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
/* Links */
|
|
41
|
+
.mobius-accordion__link {
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
border-radius: var(--radius-1);
|
|
45
|
+
color: var(--color-accordion-link, var(--color-secondary));
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
outline: none;
|
|
48
|
+
text-decoration: underline;
|
|
49
|
+
text-underline-offset: var(--accordion-link-underline-offset, 6px);
|
|
50
|
+
|
|
51
|
+
&:hover,
|
|
52
|
+
&:active {
|
|
53
|
+
color: var(--color-accordion-link-hover, var(--color-secondary-hover));
|
|
54
|
+
text-decoration: var(--accordion-link-hover-text-decoration, underline);
|
|
55
|
+
}
|
|
49
56
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
&:focus-visible {
|
|
58
|
+
outline: none;
|
|
59
|
+
box-shadow: var(--accordion-box-shadow, var(--box-shadow-default));
|
|
60
|
+
}
|
|
54
61
|
}
|
|
55
62
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
63
|
+
h1.mobius-accordion__link-text,
|
|
64
|
+
h2.mobius-accordion__link-text,
|
|
65
|
+
h3.mobius-accordion__link-text,
|
|
66
|
+
h4.mobius-accordion__link-text,
|
|
67
|
+
h5.mobius-accordion__link-text,
|
|
68
|
+
h6.mobius-accordion__link-text,
|
|
69
|
+
.mobius-accordion__link-text {
|
|
70
|
+
margin: 0;
|
|
71
|
+
/* Text order: when icon-position is 1 (left), text is 2; when icon-position is 2 (right), text is 1 */
|
|
72
|
+
order: calc(3 - var(--mobius-accordion-icon-position, 2));
|
|
73
|
+
line-height: var(--line-height-normal);
|
|
74
|
+
font-size: var(--accordion-font-size, var(--font-size-small-paragraph));
|
|
75
|
+
font-weight: var(--accordion-font-weight, var(--font-weight-normal));
|
|
59
76
|
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
h1.mobius-accordion__link-text,
|
|
63
|
-
h2.mobius-accordion__link-text,
|
|
64
|
-
h3.mobius-accordion__link-text,
|
|
65
|
-
h4.mobius-accordion__link-text,
|
|
66
|
-
h5.mobius-accordion__link-text,
|
|
67
|
-
h6.mobius-accordion__link-text,
|
|
68
|
-
.mobius-accordion__link-text {
|
|
69
|
-
margin: 0;
|
|
70
|
-
/* Text order: when icon-position is 1 (left), text is 2; when icon-position is 2 (right), text is 1 */
|
|
71
|
-
order: calc(3 - var(--mobius-accordion-icon-position, 2));
|
|
72
|
-
line-height: var(--line-height-normal);
|
|
73
|
-
font-size: var(--accordion-font-size, var(--font-size-small-paragraph));
|
|
74
|
-
font-weight: var(--accordion-font-weight, var(--font-weight-normal));
|
|
75
|
-
}
|
|
76
77
|
|
|
77
|
-
.mobius-accordion__link-icon {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
.mobius-accordion__link-icon {
|
|
79
|
+
/* Icon order: directly uses the position value */
|
|
80
|
+
order: var(--mobius-accordion-icon-position, 2);
|
|
81
|
+
/* Dynamic margin: when icon position is 1 (left), margin-left = 0 and margin-right = margin;
|
|
82
|
+
when icon position is 2 (right), margin-left = margin and margin-right = 0 */
|
|
83
|
+
margin-left: calc(
|
|
84
|
+
(var(--mobius-accordion-icon-position, 2) - 1) *
|
|
85
|
+
var(--accordion-icon-margin, var(--size-xs))
|
|
86
|
+
);
|
|
87
|
+
margin-right: calc(
|
|
88
|
+
(2 - var(--mobius-accordion-icon-position, 2)) *
|
|
89
|
+
var(--accordion-icon-margin, var(--size-xs))
|
|
90
|
+
);
|
|
91
|
+
transition: transform var(--transition-duration);
|
|
85
92
|
|
|
86
|
-
|
|
87
|
-
|
|
93
|
+
&.--is-open {
|
|
94
|
+
transform: rotateZ(-180deg);
|
|
95
|
+
}
|
|
88
96
|
}
|
|
89
97
|
}
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
@layer atoms {
|
|
2
|
+
.mobius-accordion-list {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
width: 100%;
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
text-decoration: none;
|
|
10
|
-
--accordion-icon-margin: 0;
|
|
11
|
-
|
|
12
|
-
&:hover,
|
|
13
|
-
&:active {
|
|
7
|
+
/* Layout overrides for Accordions within the list */
|
|
8
|
+
& .mobius-accordion__link {
|
|
9
|
+
justify-content: space-between;
|
|
14
10
|
text-decoration: none;
|
|
11
|
+
--accordion-icon-margin: 0;
|
|
12
|
+
|
|
13
|
+
&:hover,
|
|
14
|
+
&:active {
|
|
15
|
+
text-decoration: none;
|
|
16
|
+
}
|
|
15
17
|
}
|
|
16
|
-
}
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
& .mobius-accordion__link-text {
|
|
20
|
+
color: var(--color-text-medium);
|
|
21
|
+
font-size: var(--font-size-regular);
|
|
22
|
+
font-weight: var(--font-weight-semibold);
|
|
23
|
+
}
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
& .mobius-accordion__content {
|
|
26
|
+
color: var(--color-text-medium);
|
|
27
|
+
font-size: var(--font-size-regular);
|
|
28
|
+
font-weight: var(--font-weight-light);
|
|
29
|
+
line-height: var(--line-height-normal);
|
|
30
|
+
}
|
|
29
31
|
}
|
|
30
32
|
}
|
|
@@ -1,54 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
@layer atoms {
|
|
2
|
+
.mobius-alert__icon {
|
|
3
|
+
margin-right: var(--size-sm);
|
|
4
|
+
}
|
|
4
5
|
|
|
5
|
-
.mobius-alert {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
.mobius-alert {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-grow: 1;
|
|
9
|
+
align-items: center;
|
|
10
|
+
font-size: var(--font-size-regular);
|
|
11
|
+
line-height: var(--line-height-normal);
|
|
12
|
+
color: var(--color-text);
|
|
13
|
+
border: 2px solid;
|
|
14
|
+
border-color: inherit;
|
|
15
|
+
border-radius: var(--radius-1);
|
|
16
|
+
padding: var(--size-sm);
|
|
17
|
+
|
|
18
|
+
&.--has-header {
|
|
19
|
+
align-items: start;
|
|
20
|
+
|
|
21
|
+
& .mobius-alert__icon {
|
|
22
|
+
margin-top: 2px;
|
|
23
|
+
}
|
|
22
24
|
}
|
|
23
|
-
}
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
&.--info {
|
|
27
|
+
border-color: var(--color-info);
|
|
28
|
+
background-color: var(--color-info-background);
|
|
29
|
+
}
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
&.--success {
|
|
32
|
+
border-color: var(--color-valid);
|
|
33
|
+
background-color: var(--color-valid-background);
|
|
34
|
+
}
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
&.--warning {
|
|
37
|
+
border-color: var(--color-warning);
|
|
38
|
+
background-color: var(--color-warning-background);
|
|
39
|
+
}
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
&.--error {
|
|
42
|
+
border-color: var(--color-error);
|
|
43
|
+
background-color: var(--color-error-background);
|
|
44
|
+
}
|
|
43
45
|
}
|
|
44
|
-
}
|
|
45
46
|
|
|
46
|
-
.mobius-alert__icon .mobius-icon {
|
|
47
|
-
|
|
48
|
-
}
|
|
47
|
+
.mobius-alert__icon .mobius-icon {
|
|
48
|
+
height: 1.32em;
|
|
49
|
+
}
|
|
49
50
|
|
|
50
|
-
.mobius-alert__header {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
.mobius-alert__header {
|
|
52
|
+
margin: 0 0 var(--size-xxs);
|
|
53
|
+
font-size: var(--font-size-regular);
|
|
54
|
+
font-weight: 600;
|
|
55
|
+
}
|
|
54
56
|
}
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
@layer atoms {
|
|
2
|
+
.mobius-breadcrumb {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
background-color: var(--color-background-light);
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
list-style: none;
|
|
8
|
+
margin: 0;
|
|
9
|
+
padding: 0;
|
|
10
|
+
flex-wrap: wrap;
|
|
11
|
+
|
|
12
|
+
& ul,
|
|
13
|
+
& ol {
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
10
19
|
|
|
11
|
-
|
|
12
|
-
& ol {
|
|
20
|
+
.mobius-breadcrumb__item {
|
|
13
21
|
box-sizing: border-box;
|
|
22
|
+
color: var(--color-text);
|
|
14
23
|
display: flex;
|
|
24
|
+
flex-direction: row;
|
|
15
25
|
align-items: center;
|
|
16
26
|
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.mobius-breadcrumb__item {
|
|
20
|
-
box-sizing: border-box;
|
|
21
|
-
color: var(--color-text);
|
|
22
|
-
display: flex;
|
|
23
|
-
flex-direction: row;
|
|
24
|
-
align-items: center;
|
|
25
|
-
}
|
|
26
27
|
|
|
27
|
-
.mobius-breadcrumb__separator {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
.mobius-breadcrumb__separator {
|
|
29
|
+
margin-left: var(--size-xs);
|
|
30
|
+
margin-right: var(--size-xs);
|
|
31
|
+
}
|
|
30
32
|
}
|