paris 0.17.3 → 0.17.5
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 +14 -0
- package/package.json +1 -1
- package/src/stories/combobox/Combobox.tsx +4 -2
- package/src/stories/field/Field.tsx +1 -1
- package/src/stories/input/Input.module.scss +6 -7
- package/src/stories/input/Input.tsx +17 -17
- package/src/stories/select/Select.module.scss +3 -1
- package/src/stories/textarea/TextArea.tsx +17 -15
- package/src/stories/theme/themes.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# paris
|
|
2
2
|
|
|
3
|
+
## 0.17.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 67ea6ea: Fix input field width calculation broken by iOS Safari scale trick. Wraps input/textarea in a container div so the scale trick's `width: calc(100% / 0.875)` resolves correctly, fixing width issues with enhancers and textarea not filling containers.
|
|
8
|
+
|
|
9
|
+
## 0.17.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 693a687: fix(combobox): revert close icon to FontAwesomeIcon
|
|
14
|
+
- 12331bd: Theme: fix dark theme color value for `overlayWhiteUltrastrong`
|
|
15
|
+
- 9774b0e: Field's container `onClick` called `input.click()` even when the click originated from the button itself, causing a double toggle on touch devices. This broke Headless UI Select/Menu/Combobox on iOS Safari since HUI 2.2+ toggles on `onClick` for touch (unlike mouse, which toggles on `pointerDown`).
|
|
16
|
+
|
|
3
17
|
## 0.17.3
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "paris",
|
|
3
3
|
"author": "Sanil Chawla <sanil@slingshot.fm> (https://sanil.co)",
|
|
4
4
|
"description": "Paris is Slingshot's React design system. It's a collection of reusable components, design tokens, and guidelines that help us build consistent, accessible, and performant user interfaces.",
|
|
5
|
-
"version": "0.17.
|
|
5
|
+
"version": "0.17.5",
|
|
6
6
|
"homepage": "https://paris.slingshot.fm",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
@@ -8,6 +8,8 @@ import {
|
|
|
8
8
|
Combobox as HCombobox, ComboboxInput, ComboboxOptions, ComboboxOption, Transition,
|
|
9
9
|
} from '@headlessui/react';
|
|
10
10
|
import { clsx } from 'clsx';
|
|
11
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
12
|
+
import { faClose } from '@fortawesome/free-solid-svg-icons';
|
|
11
13
|
import inputStyles from '../input/Input.module.scss';
|
|
12
14
|
import dropdownStyles from '../utility/Dropdown.module.scss';
|
|
13
15
|
import styles from '../select/Select.module.scss';
|
|
@@ -21,7 +23,7 @@ import { Field } from '../field';
|
|
|
21
23
|
import type { ButtonProps } from '../button';
|
|
22
24
|
import { Button } from '../button';
|
|
23
25
|
import { TextWhenString } from '../utility';
|
|
24
|
-
import { Check,
|
|
26
|
+
import { Check, Icon } from '../icon';
|
|
25
27
|
|
|
26
28
|
export type Option<T extends Record<string, any> = Record<string, any>> = {
|
|
27
29
|
id: string,
|
|
@@ -262,7 +264,7 @@ export function Combobox<T extends Record<string, any> = Record<string, any>>({
|
|
|
262
264
|
<Button
|
|
263
265
|
size="xs"
|
|
264
266
|
shape="circle"
|
|
265
|
-
startEnhancer={<
|
|
267
|
+
startEnhancer={<FontAwesomeIcon icon={faClose} fontSize="10px" />}
|
|
266
268
|
onClick={() => {
|
|
267
269
|
if (onChange) {
|
|
268
270
|
onChange(null);
|
|
@@ -124,7 +124,7 @@ export const Field: FC<PropsWithChildren<FieldProps>> = ({
|
|
|
124
124
|
onClick={(e) => {
|
|
125
125
|
if (typeof window !== 'undefined' && htmlFor) {
|
|
126
126
|
const input = document.getElementById(htmlFor);
|
|
127
|
-
if (input && !disabled) {
|
|
127
|
+
if (input && !disabled && !input.contains(e.target as Node)) {
|
|
128
128
|
if (input.tagName === 'BUTTON') input.click();
|
|
129
129
|
else input.focus();
|
|
130
130
|
}
|
|
@@ -84,18 +84,11 @@
|
|
|
84
84
|
transform: scale(0.875);
|
|
85
85
|
transform-origin: left center;
|
|
86
86
|
width: calc(100% / 0.875);
|
|
87
|
-
flex-shrink: 0;
|
|
88
|
-
|
|
89
|
-
&[data-has-end-enhancer="true"] {
|
|
90
|
-
width: calc((100% / 0.875) - 14px - 13px);
|
|
91
|
-
margin-right: calc((-100% * (1 - 0.875) / 0.875));
|
|
92
|
-
}
|
|
93
87
|
}
|
|
94
88
|
|
|
95
89
|
|
|
96
90
|
& input,
|
|
97
91
|
& textarea {
|
|
98
|
-
width: 100%;
|
|
99
92
|
background-color: transparent;
|
|
100
93
|
padding: 0;
|
|
101
94
|
margin: 0;
|
|
@@ -155,6 +148,12 @@
|
|
|
155
148
|
}
|
|
156
149
|
}
|
|
157
150
|
|
|
151
|
+
.inputScaleWrapper {
|
|
152
|
+
flex: 1;
|
|
153
|
+
min-width: 0;
|
|
154
|
+
overflow: hidden;
|
|
155
|
+
}
|
|
156
|
+
|
|
158
157
|
.enhancer {
|
|
159
158
|
display: flex;
|
|
160
159
|
color: var(--pte-new-colors-contentSecondary);
|
|
@@ -120,23 +120,23 @@ export const Input: FC<InputProps & ComponentPropsWithoutRef<'input'>> = forward
|
|
|
120
120
|
)}
|
|
121
121
|
</div>
|
|
122
122
|
)}
|
|
123
|
-
<
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
123
|
+
<div className={styles.inputScaleWrapper}>
|
|
124
|
+
<input
|
|
125
|
+
{...props}
|
|
126
|
+
id={inputID}
|
|
127
|
+
ref={ref}
|
|
128
|
+
type={type || 'text'}
|
|
129
|
+
aria-label={typeof label === 'string' ? label : props['aria-label']}
|
|
130
|
+
aria-describedby={`${inputID}-description`}
|
|
131
|
+
aria-disabled={disabled}
|
|
132
|
+
data-status={disabled ? 'disabled' : (status || 'default')}
|
|
133
|
+
readOnly={disabled}
|
|
134
|
+
className={clsx(
|
|
135
|
+
props.className,
|
|
136
|
+
styles.input,
|
|
137
|
+
)}
|
|
138
|
+
/>
|
|
139
|
+
</div>
|
|
140
140
|
{!!endEnhancer && (
|
|
141
141
|
<div
|
|
142
142
|
{...overrides?.endEnhancerContainer}
|
|
@@ -68,21 +68,23 @@ export const TextArea = forwardRef<HTMLTextAreaElement, InputProps & ComponentPr
|
|
|
68
68
|
)}
|
|
69
69
|
</div>
|
|
70
70
|
)}
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
71
|
+
<div className={styles.inputScaleWrapper}>
|
|
72
|
+
<textarea
|
|
73
|
+
{...props}
|
|
74
|
+
id={textareaID}
|
|
75
|
+
ref={ref}
|
|
76
|
+
aria-label={typeof label === 'string' ? label : props['aria-label']}
|
|
77
|
+
aria-describedby={`${textareaID}-description`}
|
|
78
|
+
aria-disabled={disabled}
|
|
79
|
+
readOnly={disabled}
|
|
80
|
+
rows={rows}
|
|
81
|
+
data-status={disabled ? 'disabled' : (status || 'default')}
|
|
82
|
+
className={clsx(
|
|
83
|
+
props.className,
|
|
84
|
+
styles.input,
|
|
85
|
+
)}
|
|
86
|
+
/>
|
|
87
|
+
</div>
|
|
86
88
|
{!!endEnhancer && (
|
|
87
89
|
<div
|
|
88
90
|
{...overrides?.endEnhancerContainer}
|
|
@@ -1380,7 +1380,7 @@ export const DarkTheme: Theme = merge(LightTheme, {
|
|
|
1380
1380
|
overlayStrong: 'rgba(255, 255, 255, 0.09)',
|
|
1381
1381
|
overlayInverseSubtle: 'rgba(0, 0, 0, 0.02)',
|
|
1382
1382
|
overlayInverseMedium: 'rgba(0, 0, 0, 0.05)',
|
|
1383
|
-
overlayWhiteUltrastrong: 'rgba(
|
|
1383
|
+
overlayWhiteUltrastrong: 'rgba(255, 255, 255, 0.18)',
|
|
1384
1384
|
overlayBlackSubtle: 'rgba(0, 0, 0, 0.2)',
|
|
1385
1385
|
overlayBlackMedium: 'rgba(0, 0, 0, 0.3)',
|
|
1386
1386
|
overlayBlackStrong: 'rgba(0, 0, 0, 0.4)',
|