@justeattakeaway/pie-css 0.32.0 → 1.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/dist/components/button.css +3 -3
- package/dist/components/radio.css +9 -9
- package/docs/components/BUTTON.md +4 -4
- package/docs/components/RADIO.md +3 -3
- package/package.json +8 -2
- package/scss/_internal/components/button.scss +1 -1
- package/scss/_internal/components/radio.scss +1 -1
- package/scss/mixins/components/_button.scss +2 -0
- package/scss/mixins/components/_radio.scss +2 -2
|
@@ -528,12 +528,12 @@
|
|
|
528
528
|
--btn-inline-size: 100%;
|
|
529
529
|
}
|
|
530
530
|
|
|
531
|
-
.
|
|
531
|
+
.is-disabled {
|
|
532
532
|
--btn-text-color: var(--dt-color-content-disabled-solid);
|
|
533
533
|
cursor: not-allowed;
|
|
534
534
|
pointer-events: none;
|
|
535
535
|
}
|
|
536
|
-
.
|
|
536
|
+
.is-disabled:not(.c-button--ghost,
|
|
537
537
|
.c-button--ghost-dark,
|
|
538
538
|
.c-button--ghost-inverse,
|
|
539
539
|
.c-button--ghost-inverse-light,
|
|
@@ -541,7 +541,7 @@
|
|
|
541
541
|
--int-states-mixin-bg-color: var(--dt-color-disabled-01);
|
|
542
542
|
--btn-text-color: var(--dt-color-content-disabled);
|
|
543
543
|
}
|
|
544
|
-
.
|
|
544
|
+
.is-disabled.c-button--outline, .is-disabled.c-button--outline-inverse {
|
|
545
545
|
border-color: var(--dt-color-disabled-01);
|
|
546
546
|
}
|
|
547
547
|
|
|
@@ -111,41 +111,41 @@
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
.
|
|
114
|
+
.has-error {
|
|
115
115
|
--radio-bg-color--checked: var(--dt-color-support-error);
|
|
116
116
|
--radio-border-color: var(--dt-color-support-error);
|
|
117
117
|
}
|
|
118
|
-
.
|
|
118
|
+
.has-error:hover:not(:checked, :disabled) {
|
|
119
119
|
--radio-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--dt-color-hover-01));
|
|
120
120
|
}
|
|
121
121
|
@supports (background-color: color-mix(in srgb, black, white)) {
|
|
122
|
-
.
|
|
122
|
+
.has-error:hover:not(:checked, :disabled) {
|
|
123
123
|
--radio-bg-color: color-mix(in srgb, var(--dt-color-hover-01-bg) var(--dt-color-hover-01), transparent);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
.
|
|
126
|
+
.has-error:active:not(:checked, :disabled) {
|
|
127
127
|
--radio-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--dt-color-active-01));
|
|
128
128
|
}
|
|
129
129
|
@supports (background-color: color-mix(in srgb, black, white)) {
|
|
130
|
-
.
|
|
130
|
+
.has-error:active:not(:checked, :disabled) {
|
|
131
131
|
--radio-bg-color: color-mix(in srgb, var(--dt-color-active-01-bg) var(--dt-color-active-01), transparent);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
.
|
|
134
|
+
.has-error:hover:checked:not(:disabled):before {
|
|
135
135
|
--radio-bg-color--checked: hsl(var(--dt-color-support-error-h), var(--dt-color-support-error-s), calc(var(--dt-color-support-error-l) - var(--dt-color-hover-01)));
|
|
136
136
|
--radio-border-color: hsl(var(--dt-color-support-error-h), var(--dt-color-support-error-s), calc(var(--dt-color-support-error-l) - var(--dt-color-hover-01)));
|
|
137
137
|
}
|
|
138
138
|
@supports (background-color: color-mix(in srgb, black, white)) {
|
|
139
|
-
.
|
|
139
|
+
.has-error:hover:checked:not(:disabled):before {
|
|
140
140
|
--radio-bg-color--checked: color-mix(in srgb, var(--dt-color-hover-01-bg) var(--dt-color-hover-01), var(--dt-color-support-error));
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
.
|
|
143
|
+
.has-error:active:checked:not(:disabled):before {
|
|
144
144
|
--radio-bg-color--checked: hsl(var(--dt-color-support-error-h), var(--dt-color-support-error-s), calc(var(--dt-color-support-error-l) - var(--dt-color-active-01)));
|
|
145
145
|
--radio-border-color: hsl(var(--dt-color-support-error-h), var(--dt-color-support-error-s), calc(var(--dt-color-support-error-l) - var(--dt-color-active-01)));
|
|
146
146
|
}
|
|
147
147
|
@supports (background-color: color-mix(in srgb, black, white)) {
|
|
148
|
-
.
|
|
148
|
+
.has-error:active:checked:not(:disabled):before {
|
|
149
149
|
--radio-bg-color--checked: color-mix(in srgb, var(--dt-color-active-01-bg) var(--dt-color-active-01), var(--dt-color-support-error));
|
|
150
150
|
}
|
|
151
151
|
}
|
|
@@ -98,7 +98,7 @@ Apply the `c-button` class along with variant and size modifiers to a static ele
|
|
|
98
98
|
</div>
|
|
99
99
|
|
|
100
100
|
<!-- Disabled state -->
|
|
101
|
-
<div class="c-button c-button--primary c-button--medium
|
|
101
|
+
<div class="c-button c-button--primary c-button--medium is-disabled">
|
|
102
102
|
Disabled
|
|
103
103
|
</div>
|
|
104
104
|
|
|
@@ -148,7 +148,7 @@ Apply the `c-button` class along with variant and size modifiers to a static ele
|
|
|
148
148
|
|
|
149
149
|
| Class | Description |
|
|
150
150
|
|-------|-------------|
|
|
151
|
-
| `.
|
|
151
|
+
| `.is-disabled` | Disabled appearance (cursor: not-allowed, pointer-events: none) |
|
|
152
152
|
| `.c-button--fullWidth` | Makes the button span 100% of its container |
|
|
153
153
|
| `.c-button--truncate` | Truncates the label with an ellipsis when text overflows the button's width |
|
|
154
154
|
| `.c-button--responsive` | Enables responsive size bumping at wider viewports |
|
|
@@ -194,10 +194,10 @@ Outline variants (`outline`, `outline-inverse`) include a 1px border and automat
|
|
|
194
194
|
|
|
195
195
|
### Disabled
|
|
196
196
|
|
|
197
|
-
The disabled modifier uses class-based selectors (`.
|
|
197
|
+
The disabled modifier uses class-based selectors (`.is-disabled`) rather than the `:disabled` pseudo-class, because these CSS classes target non-interactive elements where `:disabled` is not applicable.
|
|
198
198
|
|
|
199
199
|
```html
|
|
200
|
-
<div class="c-button c-button--primary c-button--medium
|
|
200
|
+
<div class="c-button c-button--primary c-button--medium is-disabled">
|
|
201
201
|
Disabled
|
|
202
202
|
</div>
|
|
203
203
|
```
|
package/docs/components/RADIO.md
CHANGED
|
@@ -86,7 +86,7 @@ Apply the `c-radio` class to a native radio input:
|
|
|
86
86
|
</label>
|
|
87
87
|
|
|
88
88
|
<!-- Error state -->
|
|
89
|
-
<input type="radio" class="c-radio
|
|
89
|
+
<input type="radio" class="c-radio has-error" name="option" value="3">
|
|
90
90
|
```
|
|
91
91
|
|
|
92
92
|
## Available Classes
|
|
@@ -94,7 +94,7 @@ Apply the `c-radio` class to a native radio input:
|
|
|
94
94
|
| Class | Description |
|
|
95
95
|
|-------|-------------|
|
|
96
96
|
| `.c-radio` | Base radio input styling with all default states |
|
|
97
|
-
| `.
|
|
97
|
+
| `.has-error` | Error state styling |
|
|
98
98
|
|
|
99
99
|
**Note:** All other visual states (`:checked`, `:disabled`, `:hover`, `:active`, `:focus-visible`) are handled automatically by CSS pseudo-classes.
|
|
100
100
|
|
|
@@ -104,7 +104,7 @@ All states are applied automatically via CSS pseudo-classes, except for error wh
|
|
|
104
104
|
|
|
105
105
|
| State | CSS Selector | Appearance | When Applied |
|
|
106
106
|
|-------|--------------|------------|--------------|
|
|
107
|
-
| **Error** | `.
|
|
107
|
+
| **Error** | `.has-error` | Error border color | Add `has-error` class |
|
|
108
108
|
| **Unchecked** | `.c-radio` | Empty circle with border | Default state |
|
|
109
109
|
| **Checked** | `.c-radio:checked` | Filled circle with center dot | When selected |
|
|
110
110
|
| **Disabled** | `.c-radio:disabled` | Faded, not-allowed cursor | When `disabled` attribute is present |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-css",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "A styling library that provides both a shared collection of ready to use CSS styles to be used across JET web front-ends, and SCSS-based style helpers for our PIE Web Component library.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,13 +25,19 @@
|
|
|
25
25
|
"generate:typography-docs": "node scripts/generate-typography-docs.js",
|
|
26
26
|
"lint:scripts": "run -T eslint .",
|
|
27
27
|
"lint:scripts:fix": "yarn lint:scripts --fix",
|
|
28
|
-
"lint:style": "run -T stylelint ./**/*.{css,scss}",
|
|
28
|
+
"lint:style": "run -T stylelint './**/*.{css,scss}'",
|
|
29
29
|
"lint:style:fix": "yarn lint:style --fix",
|
|
30
30
|
"prepublishOnly": "yarn lint:style && yarn lint:scripts && yarn build && yarn test",
|
|
31
31
|
"test": "run -T vitest run --config ../../../vite.config.js",
|
|
32
32
|
"test:ci": "yarn test",
|
|
33
33
|
"test:watch": "run -T vitest"
|
|
34
34
|
},
|
|
35
|
+
"stylelint": {
|
|
36
|
+
"extends": [
|
|
37
|
+
"@justeattakeaway/stylelint-config-pie/base",
|
|
38
|
+
"@justeattakeaway/stylelint-config-pie/style"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
35
41
|
"keywords": [
|
|
36
42
|
"PIE",
|
|
37
43
|
"CSS",
|
|
@@ -374,6 +374,7 @@
|
|
|
374
374
|
pointer-events: none;
|
|
375
375
|
}
|
|
376
376
|
|
|
377
|
+
// stylelint-disable @stylistic/indentation
|
|
377
378
|
// For every variant except ghost variants, set the disabled background colour
|
|
378
379
|
&:not(
|
|
379
380
|
.#{$prefix}--ghost,
|
|
@@ -385,6 +386,7 @@
|
|
|
385
386
|
--int-states-mixin-bg-color: var(--dt-color-disabled-01);
|
|
386
387
|
--btn-text-color: var(--dt-color-content-disabled);
|
|
387
388
|
}
|
|
389
|
+
// stylelint-enable @stylistic/indentation
|
|
388
390
|
|
|
389
391
|
// For outline variants, set the border to the disabled colour
|
|
390
392
|
&.#{$prefix}--outline,
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
/// @include radio-interactive-state('dt-color-interactive-brand');
|
|
104
104
|
/// }
|
|
105
105
|
/// @example scss - Using with error color
|
|
106
|
-
/// .
|
|
106
|
+
/// .has-error {
|
|
107
107
|
/// @include radio-interactive-state('dt-color-support-error');
|
|
108
108
|
/// }
|
|
109
109
|
@mixin radio-interactive-state($bg-color) {
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
|
|
157
157
|
/// Error state modifier that overrides color custom properties
|
|
158
158
|
/// @example scss - Applying error state
|
|
159
|
-
/// .
|
|
159
|
+
/// .has-error {
|
|
160
160
|
/// @include radio-error();
|
|
161
161
|
/// }
|
|
162
162
|
@mixin radio-error() {
|