@xylabs/react-button 5.2.1 → 5.2.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/react-button",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.2",
|
|
4
4
|
"description": "Common React library for all XY Labs projects that use React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"utility",
|
|
@@ -37,15 +37,16 @@
|
|
|
37
37
|
"packages/*"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@xylabs/react-pixel": "^5.2.
|
|
41
|
-
"@xylabs/react-shared": "^5.2.
|
|
40
|
+
"@xylabs/react-pixel": "^5.2.2",
|
|
41
|
+
"@xylabs/react-shared": "^5.2.2",
|
|
42
42
|
"react-router-dom": "^6.27.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@mui/material": "^6.1.4",
|
|
46
46
|
"@storybook/react": "^8.3.5",
|
|
47
47
|
"@types/react": "^18.3.11",
|
|
48
|
-
"@xylabs/react-flexbox": "^5.2.
|
|
48
|
+
"@xylabs/react-flexbox": "^5.2.2",
|
|
49
|
+
"@xylabs/react-pixel": "^5.2.2",
|
|
49
50
|
"@xylabs/ts-scripts-yarn3": "^4.2.1",
|
|
50
51
|
"@xylabs/tsconfig-react": "^4.2.1",
|
|
51
52
|
"react": "^18.3.1",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryFn } from '@storybook/react'
|
|
2
2
|
import { FlexCol, FlexRow } from '@xylabs/react-flexbox'
|
|
3
|
+
import { UserEventsProvider, XyoUserEventHandler } from '@xylabs/react-pixel'
|
|
3
4
|
import React from 'react'
|
|
4
5
|
|
|
5
6
|
import { ButtonEx } from './ButtonEx.tsx'
|
|
@@ -29,6 +30,26 @@ const DefaultTemplate: StoryFn<typeof ButtonEx> = args => (
|
|
|
29
30
|
</FlexRow>
|
|
30
31
|
)
|
|
31
32
|
|
|
33
|
+
const UserEventTemplate: StoryFn<typeof ButtonEx> = args => (
|
|
34
|
+
<UserEventsProvider userEvents={XyoUserEventHandler.get()}>
|
|
35
|
+
<FlexRow justifyContent="flex-start">
|
|
36
|
+
<FlexCol marginX={1}>
|
|
37
|
+
<ButtonEx {...args}>Default</ButtonEx>
|
|
38
|
+
</FlexCol>
|
|
39
|
+
<FlexCol marginX={1}>
|
|
40
|
+
<ButtonEx variant="outlined" {...args}>
|
|
41
|
+
Outlined
|
|
42
|
+
</ButtonEx>
|
|
43
|
+
</FlexCol>
|
|
44
|
+
<FlexCol marginX={1}>
|
|
45
|
+
<ButtonEx variant="contained" {...args}>
|
|
46
|
+
Contained
|
|
47
|
+
</ButtonEx>
|
|
48
|
+
</FlexCol>
|
|
49
|
+
</FlexRow>
|
|
50
|
+
</UserEventsProvider>
|
|
51
|
+
)
|
|
52
|
+
|
|
32
53
|
const Default = DefaultTemplate.bind({})
|
|
33
54
|
Default.args = {}
|
|
34
55
|
|
|
@@ -49,8 +70,17 @@ HrefTargetOnClick.args = {
|
|
|
49
70
|
href: 'https://xylabs.com', target: '_blank', onClick: () => console.log('Clicked'),
|
|
50
71
|
}
|
|
51
72
|
|
|
73
|
+
const HrefTargetWithEvents = UserEventTemplate.bind({})
|
|
74
|
+
HrefTargetWithEvents.args = { href: 'https://xylabs.com', target: '_blank' }
|
|
75
|
+
|
|
76
|
+
const HrefTargetOnClickWithEvents = UserEventTemplate.bind({})
|
|
77
|
+
HrefTargetOnClickWithEvents.args = {
|
|
78
|
+
href: 'https://xylabs.com', target: '_blank', onClick: () => console.log('Clicked'),
|
|
79
|
+
}
|
|
80
|
+
|
|
52
81
|
export {
|
|
53
|
-
BusyCircular, BusyLinear, Default, Href, HrefTarget, HrefTargetOnClick,
|
|
82
|
+
BusyCircular, BusyLinear, Default, Href, HrefTarget, HrefTargetOnClick, HrefTargetOnClickWithEvents,
|
|
83
|
+
HrefTargetWithEvents,
|
|
54
84
|
}
|
|
55
85
|
|
|
56
86
|
export default StorybookEntry
|