You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* replace innerRef with forwardRef (#61)
* enable safe hrefs by default (#63)
* use separate sourcemaps and fix yarn size-limit
* format file, remove comments from dist
* lint --fix a few things
* node 10.18+
* upgrade ts deps and use simpler polymorphic typing (#71)
* v4.0.0-1
* update types again
* export types
* v4.0.0-2
* revert propsOf back
* v4.0.0-3
Copy file name to clipboardExpand all lines: README.md
+5-10Lines changed: 5 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,12 +62,6 @@ E.g:
62
62
<Box is={Link} to="/login">Login</Box>
63
63
```
64
64
65
-
##### innerRef
66
-
67
-
Type: `function`
68
-
69
-
Callback that gets passed a ref to inner DOM node (or component if the `is` prop is set to a React component type).
70
-
71
65
##### clearfix
72
66
73
67
Type: `boolean`
@@ -310,14 +304,15 @@ setClassNamePrefix('📦')
310
304
311
305
### Safe `href`s
312
306
313
-
By default `ui-box`does not ensure that urls use safe protocols when passed to an element. But we built this functionality into `ui-box` to protect the end users of the products you are building. You can alter this by using `configureSafeHref({enabled?: boolean, origin?: string})`. This will ensure that only safe protocols are used (`http:`, `https:`, `mailto:`, `tel:`, and `data:`) and that the correct `rel` values are added (`noopener`, `noreferrer`(for external links)).
307
+
By default `ui-box`ensures that urls use safe protocols when passed to an element. We built this functionality into `ui-box` to protect the end users of the products you are building. You can opt-out of this by using `configureSafeHref({enabled?: boolean, origin?: string})`. This allows you to configure which protocols are acceptable (`http:`, `https:`, `mailto:`, `tel:`, and `data:`) and that the correct `rel` values are added (`noopener`, `noreferrer`(for external links)).
314
308
315
309
```js
316
310
import { configureSafeHref } from'ui-box'
317
311
configureSafeHref({
318
-
enabled:true,
312
+
enabled:true,// the default behavior
319
313
})
320
314
```
315
+
321
316
```js
322
317
import { configureSafeHref } from'ui-box'
323
318
configureSafeHref({
@@ -326,10 +321,10 @@ configureSafeHref({
326
321
})
327
322
```
328
323
329
-
Additionally you can overwrite the behavoir on an individual component basis using the prop `allowUnsafeHref`
324
+
Additionally you can override the behavior on an individual component basis using the prop `allowUnsafeHref`
330
325
331
326
```jsx
332
-
<Box is="a" href="javascript:alert('hi')" allowUnsafeHref={true}>This is unsafe</Box>
327
+
<Box is="a" href="javascript:alert('hi')" allowUnsafeHref>This is unsafe</Box>
0 commit comments