-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
4,845 additions
and
347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@segment/analytics-signals': minor | ||
'@segment/analytics-signals-runtime': minor | ||
--- | ||
|
||
- Add support for interaction signals for custom components and elements with contenteditable property | ||
- Allow custom disallow list to override network signals, even if same domain. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env", | ||
"@babel/preset-react", | ||
"@babel/preset-typescript" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
playwright-report/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/signals/signals-integration-tests/src/tests/custom-elements/components/App.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react' | ||
import { TextField } from './TextField' | ||
import { Select, SelectItem } from './Select' | ||
|
||
export const App: React.FC = () => { | ||
return ( | ||
<main> | ||
<div id="textfield"> | ||
<h2>TextField</h2> | ||
<TextField label="some-text-field" /> | ||
</div> | ||
<div id="select"> | ||
<h2>Select</h2> | ||
<Select> | ||
<SelectItem>Chocolate</SelectItem> | ||
<SelectItem>Mint</SelectItem> | ||
<SelectItem>Strawberry</SelectItem> | ||
<SelectItem>Vanilla</SelectItem> | ||
</Select> | ||
</div> | ||
</main> | ||
) | ||
} |
42 changes: 42 additions & 0 deletions
42
packages/signals/signals-integration-tests/src/tests/custom-elements/components/Button.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
@import "./theme.css"; | ||
|
||
.react-aria-Button { | ||
color: var(--text-color); | ||
background: var(--button-background); | ||
border: 1px solid var(--border-color); | ||
border-radius: 4px; | ||
appearance: none; | ||
vertical-align: middle; | ||
font-size: 1rem; | ||
text-align: center; | ||
margin: 0; | ||
outline: none; | ||
padding: 6px 10px; | ||
text-decoration: none; | ||
|
||
&[data-pressed] { | ||
box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.1); | ||
background: var(--button-background-pressed); | ||
border-color: var(--border-color-pressed); | ||
} | ||
|
||
&[data-focus-visible] { | ||
outline: 2px solid var(--focus-ring-color); | ||
outline-offset: -1px; | ||
} | ||
|
||
&[data-disabled]{ | ||
border-color: var(--border-color-disabled); | ||
color: var(--text-color-disabled); | ||
} | ||
} | ||
|
||
@keyframes toggle { | ||
from { | ||
opacity: 0; | ||
} | ||
|
||
to { | ||
opacity: 1; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/signals/signals-integration-tests/src/tests/custom-elements/components/Button.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react' | ||
import { Button as RACButton, ButtonProps } from 'react-aria-components' | ||
import './Button.css' | ||
|
||
export function Button(props: ButtonProps) { | ||
return <RACButton {...props} /> | ||
} |
99 changes: 99 additions & 0 deletions
99
packages/signals/signals-integration-tests/src/tests/custom-elements/components/Checkbox.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
@import "./theme.css"; | ||
|
||
.react-aria-Checkbox { | ||
--selected-color: var(--highlight-background); | ||
--selected-color-pressed: var(--highlight-background-pressed); | ||
--checkmark-color: var(--highlight-foreground); | ||
|
||
display: flex; | ||
align-items: center; | ||
gap: 0.571rem; | ||
font-size: 1.143rem; | ||
color: var(--text-color); | ||
forced-color-adjust: none; | ||
|
||
.checkbox { | ||
width: 1.143rem; | ||
height: 1.143rem; | ||
border: 2px solid var(--border-color); | ||
border-radius: 4px; | ||
transition: all 200ms; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
svg { | ||
width: 1rem; | ||
height: 1rem; | ||
fill: none; | ||
stroke: var(--checkmark-color); | ||
stroke-width: 3px; | ||
stroke-dasharray: 22px; | ||
stroke-dashoffset: 66; | ||
transition: all 200ms; | ||
} | ||
|
||
&[data-pressed] .checkbox { | ||
border-color: var(--border-color-pressed); | ||
} | ||
|
||
&[data-focus-visible] .checkbox { | ||
outline: 2px solid var(--focus-ring-color); | ||
outline-offset: 2px; | ||
} | ||
|
||
&[data-selected], | ||
&[data-indeterminate] { | ||
.checkbox { | ||
border-color: var(--selected-color); | ||
background: var(--selected-color); | ||
} | ||
|
||
&[data-pressed] .checkbox { | ||
border-color: var(--selected-color-pressed); | ||
background: var(--selected-color-pressed); | ||
} | ||
|
||
svg { | ||
stroke-dashoffset: 44; | ||
} | ||
} | ||
|
||
&[data-indeterminate] { | ||
& svg { | ||
stroke: none; | ||
fill: var(--checkmark-color); | ||
} | ||
} | ||
|
||
&[data-invalid] { | ||
.checkbox { | ||
--checkmark-color: var(--gray-50); | ||
border-color: var(--invalid-color); | ||
} | ||
|
||
&[data-pressed] .checkbox { | ||
border-color: var(--invalid-color-pressed); | ||
} | ||
|
||
&[data-selected], | ||
&[data-indeterminate] { | ||
.checkbox { | ||
background: var(--invalid-color); | ||
} | ||
|
||
&[data-pressed] .checkbox { | ||
background: var(--invalid-color-pressed); | ||
} | ||
} | ||
} | ||
|
||
&[data-disabled] { | ||
color: var(--text-color-disabled); | ||
|
||
.checkbox { | ||
border-color: var(--border-color-disabled); | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
packages/signals/signals-integration-tests/src/tests/custom-elements/components/Checkbox.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Checkbox as AriaCheckbox, CheckboxProps } from 'react-aria-components' | ||
import React from 'react' | ||
import './Checkbox.css' | ||
|
||
export function Checkbox({ children, ...props }: CheckboxProps) { | ||
return ( | ||
<AriaCheckbox {...props}> | ||
{({ isIndeterminate }) => ( | ||
<> | ||
<div className="checkbox"> | ||
<svg viewBox="0 0 18 18" aria-hidden="true"> | ||
{isIndeterminate ? ( | ||
<rect x={1} y={7.5} width={15} height={3} /> | ||
) : ( | ||
<polyline points="1 9 7 14 15 4" /> | ||
)} | ||
</svg> | ||
</div> | ||
{children} | ||
</> | ||
)} | ||
</AriaCheckbox> | ||
) | ||
} | ||
|
||
export { Checkbox as MyCheckbox } |
Oops, something went wrong.