@greenharness/greenrack-ui 7.2.0 → 7.2.1
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/Checkbox/Checkbox.stories.d.ts.map +1 -1
- package/dist/components/Checkbox/styles.css.d.ts +1 -0
- package/dist/components/Checkbox/styles.css.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.stories.d.ts.map +1 -1
- package/dist/components/RadioGroup/styles.css.d.ts +1 -0
- package/dist/components/RadioGroup/styles.css.d.ts.map +1 -1
- package/dist/components/Switch/Switch.stories.d.ts.map +1 -1
- package/dist/components/Switch/styles.css.d.ts +1 -0
- package/dist/components/Switch/styles.css.d.ts.map +1 -1
- package/dist/index.js +21 -18
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Checkbox/Checkbox.stories.tsx +2 -0
- package/src/components/Checkbox/styles.css.ts +4 -0
- package/src/components/RadioGroup/RadioGroup.stories.tsx +4 -0
- package/src/components/RadioGroup/styles.css.ts +4 -0
- package/src/components/Switch/Switch.stories.tsx +2 -0
- package/src/components/Switch/styles.css.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@greenharness/greenrack-ui",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -91,14 +91,14 @@
|
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@tanstack/react-virtual": "^3.14.13",
|
|
94
|
+
"@types/qrcode": "^1.5.6",
|
|
94
95
|
"qrcode": "^1.5.4",
|
|
95
|
-
"@greenharness/greenrack-tokens": "^7.2.
|
|
96
|
+
"@greenharness/greenrack-tokens": "^7.2.1"
|
|
96
97
|
},
|
|
97
98
|
"devDependencies": {
|
|
98
99
|
"@babel/preset-typescript": "^7.28.0",
|
|
99
100
|
"@hookform/resolvers": "^5.0.0",
|
|
100
101
|
"@phosphor-icons/core": "2.1.1",
|
|
101
|
-
"@types/qrcode": "^1.5.6",
|
|
102
102
|
"@types/react": "^19.0.0",
|
|
103
103
|
"@types/react-dom": "^19.0.0",
|
|
104
104
|
"@vitejs/plugin-react": "^4.0.0",
|
|
@@ -26,6 +26,8 @@ export const Default: Story = {
|
|
|
26
26
|
const checkbox = canvas.getByRole('checkbox')
|
|
27
27
|
await expect(checkbox).toBeInTheDocument()
|
|
28
28
|
await expect(checkbox).toBeEnabled()
|
|
29
|
+
// The hidden input is placed against its own label, never a page ancestor.
|
|
30
|
+
await expect(checkbox.offsetParent).toBe(checkbox.closest('label'))
|
|
29
31
|
|
|
30
32
|
await userEvent.click(checkbox)
|
|
31
33
|
await expect(args.onChange).toHaveBeenCalledTimes(1)
|
|
@@ -8,6 +8,10 @@ import {borders} from '@greenharness/greenrack-tokens/tokens/borders.css'
|
|
|
8
8
|
|
|
9
9
|
export const styles = css.create({
|
|
10
10
|
root: {
|
|
11
|
+
// The containing block of the visually hidden input (position: absolute):
|
|
12
|
+
// without it the input escapes to the nearest positioned ancestor, outside
|
|
13
|
+
// any scroller between, and lengthens the page.
|
|
14
|
+
position: 'relative',
|
|
11
15
|
display: 'inline-flex',
|
|
12
16
|
alignItems: 'center',
|
|
13
17
|
gap: spacing.sm,
|
|
@@ -28,6 +28,10 @@ export const Default: Story = {
|
|
|
28
28
|
await expect(radios.length).toBe(3)
|
|
29
29
|
await expect(radios[0]).toBeChecked()
|
|
30
30
|
await expect(radios[1]).not.toBeChecked()
|
|
31
|
+
// Each hidden input is placed against its own label, never a page ancestor.
|
|
32
|
+
for (const radio of radios) {
|
|
33
|
+
await expect(radio.offsetParent).toBe(radio.closest('label'))
|
|
34
|
+
}
|
|
31
35
|
},
|
|
32
36
|
}
|
|
33
37
|
|
|
@@ -16,6 +16,10 @@ export const styles = css.create({
|
|
|
16
16
|
flexDirection: 'row',
|
|
17
17
|
},
|
|
18
18
|
item: {
|
|
19
|
+
// The containing block of the visually hidden input (position: absolute):
|
|
20
|
+
// without it the input escapes to the nearest positioned ancestor, outside
|
|
21
|
+
// any scroller between, and lengthens the page.
|
|
22
|
+
position: 'relative',
|
|
19
23
|
display: 'inline-flex',
|
|
20
24
|
alignItems: 'center',
|
|
21
25
|
gap: spacing.sm,
|
|
@@ -26,6 +26,8 @@ export const Default: Story = {
|
|
|
26
26
|
const switchEl = canvas.getByRole('switch')
|
|
27
27
|
await expect(switchEl).toBeInTheDocument()
|
|
28
28
|
await expect(switchEl).not.toBeChecked()
|
|
29
|
+
// The hidden input is placed against its own label, never a page ancestor.
|
|
30
|
+
await expect(switchEl.offsetParent).toBe(switchEl.closest('label'))
|
|
29
31
|
|
|
30
32
|
await userEvent.click(switchEl)
|
|
31
33
|
await expect(args.onCheckedChange).toHaveBeenCalledWith(true)
|
|
@@ -8,6 +8,10 @@ import {borders} from '@greenharness/greenrack-tokens/tokens/borders.css'
|
|
|
8
8
|
|
|
9
9
|
export const styles = css.create({
|
|
10
10
|
root: {
|
|
11
|
+
// The containing block of the visually hidden input (position: absolute):
|
|
12
|
+
// without it the input escapes to the nearest positioned ancestor, outside
|
|
13
|
+
// any scroller between, and lengthens the page.
|
|
14
|
+
position: 'relative',
|
|
11
15
|
display: 'inline-flex',
|
|
12
16
|
alignItems: 'center',
|
|
13
17
|
gap: spacing.sm,
|