@thinkpixellab-public/px-vue 5.0.3 → 5.2.0

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.
Files changed (124) hide show
  1. package/README.md +10 -15
  2. package/bases/PxBaseScroll.vue +0 -1
  3. package/components/PxColorPanel.vue +2 -1
  4. package/components/PxSelectionBar.vue +0 -1
  5. package/components/PxValidator.vue +0 -1
  6. package/composables/loadGsap.js +10 -10
  7. package/package.json +60 -42
  8. package/plugins/common-client.js +0 -3
  9. package/plugins/common.js +0 -3
  10. package/utils/SharedHeightManager.js +2 -2
  11. package/utils/cardGridLayoutHelper.js +1 -1
  12. package/utils/scrollWatcher.js +6 -6
  13. package/utils/smootherCorners.js +33 -38
  14. package/.eslintrc.js +0 -14
  15. package/.prettierrc.json +0 -10
  16. package/.storybook/main.js +0 -26
  17. package/.storybook/manager-head.html +0 -0
  18. package/.storybook/manager.js +0 -6
  19. package/.storybook/preview-head.html +0 -3
  20. package/.storybook/preview.js +0 -26
  21. package/.storybook/preview.scss +0 -3
  22. package/.storybook/px-styles.config.scss +0 -26
  23. package/babel.config.js +0 -16
  24. package/chromatic.config.json +0 -5
  25. package/dev/data/fruits.js +0 -59
  26. package/dev/data/random.js +0 -13
  27. package/dev/demos/Demo-PxBaseDrag.vue +0 -94
  28. package/dev/demos/Demo-PxCardGrid.vue +0 -50
  29. package/dev/demos/Demo-PxContain.vue +0 -106
  30. package/dev/demos/Demo-PxFlip.vue +0 -104
  31. package/dev/demos/Demo-PxFloat.vue +0 -105
  32. package/dev/demos/Demo-PxMenu.vue +0 -94
  33. package/dev/demos/Demo-PxPivot.vue +0 -55
  34. package/dev/demos/Demo-PxSideDrawer.vue +0 -62
  35. package/dev/demos/Demo-PxSlideTransition.vue +0 -84
  36. package/dev/demos/Demo-PxSlides.vue +0 -142
  37. package/dev/demos/Demo-PxStylesPreview.vue +0 -41
  38. package/dev/demos/Demo-PxSwiper.vue +0 -36
  39. package/dev/demos/DemoPicker.vue +0 -77
  40. package/dev/dev.vue +0 -64
  41. package/dev/serve.js +0 -17
  42. package/stories/Intro.mdx +0 -1
  43. package/stories/PxAnimate.stories.js +0 -184
  44. package/stories/PxArrow.stories.js +0 -74
  45. package/stories/PxArrowScroller.stories.js +0 -38
  46. package/stories/PxAspect.stories.js +0 -66
  47. package/stories/PxAutoClamp.stories.js +0 -47
  48. package/stories/PxBackgroundFader.stories.js +0 -42
  49. package/stories/PxBalancedText.stories.js +0 -66
  50. package/stories/PxButton.stories.js +0 -83
  51. package/stories/PxCalendar.stories.js +0 -36
  52. package/stories/PxCard.stories.js +0 -31
  53. package/stories/PxCardGrid.stories.js +0 -60
  54. package/stories/PxClock.stories.js +0 -36
  55. package/stories/PxCodeSample.stories.js +0 -53
  56. package/stories/PxColorPalette.stories.js +0 -59
  57. package/stories/PxColorPanel.stories.js +0 -31
  58. package/stories/PxColorPicker.stories.js +0 -41
  59. package/stories/PxContain.stories.js +0 -80
  60. package/stories/PxCopyText.stories.js +0 -35
  61. package/stories/PxCorners.stories.js +0 -187
  62. package/stories/PxDatePicker.stories.js +0 -36
  63. package/stories/PxDropdown.stories.js +0 -56
  64. package/stories/PxExpander.stories.js +0 -33
  65. package/stories/PxFit.stories.js +0 -40
  66. package/stories/PxFlex.stories.js +0 -41
  67. package/stories/PxFlip.stories.js +0 -51
  68. package/stories/PxFloat.stories.js +0 -147
  69. package/stories/PxGsapScrubber.stories.js +0 -36
  70. package/stories/PxIcon.stories.js +0 -189
  71. package/stories/PxIconButton.stories.js +0 -87
  72. package/stories/PxImage.stories.js +0 -113
  73. package/stories/PxLabeledInput.stories.js +0 -44
  74. package/stories/PxMeasureContainer.stories.js +0 -50
  75. package/stories/PxMenu.stories.js +0 -99
  76. package/stories/PxPivot.stories.js +0 -42
  77. package/stories/PxPopupButton.stories.js +0 -69
  78. package/stories/PxProgressCircle.stories.js +0 -39
  79. package/stories/PxQrCode.stories.js +0 -36
  80. package/stories/PxRadioButton.stories.js +0 -35
  81. package/stories/PxResizer.stories.js +0 -40
  82. package/stories/PxScrubber.stories.js +0 -58
  83. package/stories/PxSideDrawer.stories.js +0 -36
  84. package/stories/PxSlides.stories.js +0 -65
  85. package/stories/PxSpinner.stories.js +0 -37
  86. package/stories/PxSticky.stories.js +0 -36
  87. package/stories/PxSvg.stories.js +0 -46
  88. package/stories/PxSvgRender.stories.js +0 -40
  89. package/stories/PxSyncHeight.stories.js +0 -48
  90. package/stories/PxTable.stories.js +0 -145
  91. package/stories/PxTextbox.stories.js +0 -59
  92. package/stories/PxToggle.stories.js +0 -77
  93. package/stories/PxToggleButton.stories.js +0 -109
  94. package/stories/PxToggleButtonList.stories.js +0 -102
  95. package/stories/PxToolPanel.stories.js +0 -351
  96. package/stories/PxTransition.stories.js +0 -74
  97. package/stories/PxTransitionExpand.stories.js +0 -36
  98. package/stories/PxTransitionItem.stories.js +0 -36
  99. package/stories/PxValidator.stories.js +0 -100
  100. package/stories/assets/alpha.svg +0 -6
  101. package/stories/assets/alphaNoSizing.svg +0 -6
  102. package/stories/assets/alphaSizeWidth.svg +0 -6
  103. package/stories/assets/px-01.jpg +0 -0
  104. package/stories/assets/px-02.jpg +0 -0
  105. package/stories/assets/px-03.jpg +0 -0
  106. package/stories/assets/px-04.jpg +0 -0
  107. package/stories/makestories.js +0 -65
  108. package/stories/svgIcon.stories.js +0 -67
  109. package/storybook/sb-sampledata.js +0 -664
  110. package/storybook/sb-styles.scss +0 -200
  111. package/storybook/sb-utils.js +0 -30
  112. package/test/MockComponent.vue +0 -12
  113. package/test/PxBaseColor.test.js +0 -54
  114. package/test/PxBaseItems.test.js +0 -95
  115. package/test/PxBaseItemsSelect.test.js +0 -470
  116. package/test/PxBaseUniqueId.test.js +0 -29
  117. package/test/PxBaseVariants.test.js +0 -166
  118. package/test/PxBaseVariantsOverride.test.js +0 -87
  119. package/test/animation.test.js +0 -120
  120. package/test/cssStr.test.js +0 -287
  121. package/test/utils.test.js +0 -60
  122. package/test/variants.test.js +0 -92
  123. package/vite.config.js +0 -37
  124. package/vue.config.js +0 -12
@@ -1,33 +0,0 @@
1
- import PxExpander from '@/components/PxExpander.vue';
2
- // import { within } from '@storybook/testing-library';
3
-
4
- export default {
5
- component: PxExpander,
6
- args: {
7
- expanded: true,
8
- },
9
- };
10
-
11
- const Template = args => ({
12
- components: { PxExpander },
13
- template: '<PxExpander v-bind="args" v-on="$props">This is content1.</PxExpander>',
14
- });
15
-
16
- export const Default = {
17
- render: (args, { argTypes }) => ({
18
- components: { PxExpander },
19
- setup() {
20
- return { args };
21
- },
22
- template: `
23
- <div class="story-bounds">
24
- <PxExpander v-bind="args" v-on="$props">
25
- <div class="story-circle"></div>
26
- </PxExpander>
27
- </div>
28
- `,
29
- args: {
30
- expanded: true,
31
- },
32
- }),
33
- };
@@ -1,40 +0,0 @@
1
- import PxFit from '@/components/PxFit.vue';
2
- import PxResizer from '@/components/PxResizer.vue';
3
- import { extractArgTypes } from '@/storybook/sb-utils.js';
4
-
5
- export default {
6
- title: 'PxFit',
7
- component: PxFit,
8
- // decorators: [ ... ],
9
- // parameters: { ... },
10
-
11
- // https://storybook.js.org/docs/vue/essentials/controls#annotation
12
- // https://storybook.js.org/docs/vue/api/argtypes#available-properties
13
- argTypes: {
14
- ...extractArgTypes(PxFit),
15
- },
16
- args: {
17
- debug: false,
18
- },
19
- };
20
-
21
- export const Basic = {
22
- render: (args, { argTypes }) => ({
23
- components: { PxFit, PxResizer },
24
- setup() {
25
- return { args };
26
- },
27
- template: `
28
- <PxResizer :initialWidth="600" :initialHeight="200" allowResize="x" overlayVisible="always">
29
- <PxFit v-bind="args">
30
- <template #default="{ fit }">
31
- <div>
32
- <div v-if="fit == 'lg'" class="story-fill story-center" style="width: 600px">lg (600px)</div>
33
- <div v-if="fit == 'md'" class="story-fill story-center" style="width: 400px">md (400px)</div>
34
- <div v-if="fit == 'sm'" class="story-fill story-center" style="width: 200px">sm (200px)</div>
35
- </div>
36
- </template>
37
- </PxFit>
38
- </PxResizer>`,
39
- }),
40
- };
@@ -1,41 +0,0 @@
1
- import PxFlex from '@/components/PxFlex.vue';
2
- import { extractArgTypes } from '@/storybook/sb-utils.js';
3
-
4
- export default {
5
- title: 'PxFlex',
6
- component: PxFlex,
7
- // decorators: [ ... ],
8
- // parameters: { ... },
9
-
10
- // https://storybook.js.org/docs/vue/essentials/controls#annotation
11
- // https://storybook.js.org/docs/vue/api/argtypes#available-properties
12
- argTypes: {
13
- ...extractArgTypes(PxFlex),
14
- // someProp: { type: 'select', options: ['one', 'two', 'three'] }
15
- },
16
- args: {
17
- // label: 'Hello',
18
- // onClick: () => {}),
19
- },
20
- };
21
-
22
- export const Basic = {
23
- render: (args, { argTypes }) => ({
24
- components: { PxFlex },
25
- setup() {
26
- return { args };
27
- },
28
- template: `
29
- <PxFlex v-bind="args">
30
- <div class="story-circle story-size-xs"></div>
31
- <div class="story-circle story-size-sm"></div>
32
- <div class="story-circle story-size-base"></div>
33
- <div class="story-circle story-size-md"></div>
34
- </PxFlex>`,
35
- }),
36
- };
37
-
38
- // export const Advanced = {
39
- // ...Basic,
40
- // // args: { ... },
41
- // };
@@ -1,51 +0,0 @@
1
- import PxFlip from '@/components/PxFlip.vue';
2
- import { extractArgTypes } from '@/storybook/sb-utils.js';
3
-
4
- export default {
5
- title: 'PxFlip',
6
- component: PxFlip,
7
- // decorators: [ ... ],
8
- // parameters: { ... },
9
-
10
- // https://storybook.js.org/docs/vue/essentials/controls#annotation
11
- // https://storybook.js.org/docs/vue/api/argtypes#available-properties
12
- argTypes: {
13
- ...extractArgTypes(PxFlip),
14
- // someProp: { type: 'select', options: ['one', 'two', 'three'] }
15
- },
16
- args: {
17
- // label: 'Hello',
18
- // onClick: () => {}),
19
- },
20
- };
21
-
22
- export const Basic = {
23
- render: (args, { argTypes }) => ({
24
- components: { PxFlip },
25
- setup() {
26
- return { args };
27
- },
28
- data() {
29
- return {
30
- state: 'blue',
31
- };
32
- },
33
- template: `
34
-
35
- <PxFlip :states="['blue', 'orange']" :current="state">
36
- <template #default="{state}">
37
- <div data-flip :class="'story-state-' + state">
38
- {{state}}
39
- </div>
40
- </template>
41
- </PxFlip>
42
- <br>
43
- <button @click="state = state == 'blue' ? 'orange' : 'blue'">Toggle State</button>
44
- `,
45
- }),
46
- };
47
-
48
- // export const Advanced = {
49
- // ...Basic,
50
- // // args: { ... },
51
- // };
@@ -1,147 +0,0 @@
1
- import PxFloat from '@/components/PxFloat.vue';
2
- import PxToggleButton from '@/components/PxToggleButton.vue';
3
- import { extractArgTypes } from '@/storybook/sb-utils.js';
4
-
5
- export default {
6
- component: PxFloat,
7
- // decorators: [ ... ],
8
- // parameters: { ... },
9
-
10
- // decorators: [
11
- // (story, context) => {
12
- // const [args, updateArgs, resetArgs] = useArgs();
13
-
14
- // return {
15
- // components: { PxToggleButton },
16
- // data() {
17
- // return {
18
- // isVisible: args.visible,
19
- // };
20
- // },
21
- // watch: {
22
- // isVisible(nv) {
23
- // updateArgs({ ...args, visible: nv });
24
- // },
25
- // },
26
-
27
- // template:
28
- // '<div><PxToggleButton label="Visible" labelUnchecked="Hidden" v-model:checked="isVisible" /><story /></div>',
29
- // };
30
- // },
31
- // ],
32
-
33
- // https://storybook.js.org/docs/vue/essentials/controls#annotation
34
- // https://storybook.js.org/docs/vue/api/argtypes#available-properties
35
- argTypes: {
36
- ...extractArgTypes(PxFloat),
37
- // someProp: { type: 'select', options: ['one', 'two', 'three'] }
38
- },
39
- args: {
40
- portalEnabled: true,
41
- variant: 'default',
42
- keepInDom: true,
43
- },
44
- };
45
-
46
- export const Basic = {
47
- // name: 'Story Name',
48
- render: (args, { argTypes }) => {
49
- return {
50
- components: { PxFloat, PxToggleButton },
51
- setup() {
52
- return { args };
53
- },
54
- data() {
55
- return {
56
- popupVisible: args.visible,
57
- };
58
- },
59
- template: `
60
- <PxToggleButton label="Toggle Visible" v-model:checked="popupVisible" />
61
- <PxFloat v-bind="args" v-model:visible="popupVisible"><div style="max-width:50em;">Laudantium totam dicta reiciendis quod iste sunt rerum repellendus eum adipisci et consequatur quae dolorem eos. Culpa sint sequi autem optio atque. Sit eum eum veniam aut. Illo eum eum dicta dicta ut nobis natus. Similique ea sit quo dolorum ullam qui iste. Consequatur doloribus esse et qui voluptas magnam qui est eos et similique vel libero in fugit.</div></PxFloat>
62
- `,
63
- };
64
- },
65
- };
66
-
67
- export const DialogVariant = {
68
- ...Basic,
69
- args: { variant: 'dialog' },
70
- };
71
-
72
- export const MessageVariant = {
73
- ...Basic,
74
- args: { variant: 'message' },
75
- };
76
-
77
- export const MenuVariant = {
78
- ...Basic,
79
- args: { variant: 'menu' },
80
- };
81
-
82
- export const BlurVariant = {
83
- ...Basic,
84
- args: { variant: 'centered dialog blur' },
85
- };
86
-
87
- export const GrayVariant = {
88
- ...Basic,
89
- args: { variant: 'centered dialog gray' },
90
- };
91
-
92
- export const CenteredVariant = {
93
- ...Basic,
94
- args: { variant: 'centered' },
95
- };
96
-
97
- export const SmVariant = {
98
- ...Basic,
99
- args: { variant: 'dialog sm' },
100
- };
101
-
102
- export const MdVariant = {
103
- ...Basic,
104
- args: { variant: 'dialog md' },
105
- };
106
-
107
- export const LgVariant = {
108
- ...Basic,
109
- args: { variant: 'dialog lg' },
110
- };
111
-
112
- export const NoTransition = {
113
- ...Basic,
114
- args: { variant: 'dialog', transitionName: '' },
115
- };
116
-
117
- export const FloatInFloat = {
118
- // name: 'Story Name',
119
- render: (args, { argTypes }) => {
120
- return {
121
- components: { PxFloat, PxToggleButton },
122
- setup() {
123
- return { args };
124
- },
125
- data() {
126
- return {
127
- popupVisible: args.visible,
128
- innerPopupVisible: false,
129
- };
130
- },
131
- template: `
132
- <PxToggleButton label="Toggle Visible" v-model:checked="popupVisible" />
133
- <PxFloat v-bind="args" v-model:visible="popupVisible">
134
- <div style="max-width:50em;">
135
- <PxToggleButton label="Toggle Inner Visible" v-model:checked="innerPopupVisible" />
136
- <PxFloat v-bind="args" v-model:visible="innerPopupVisible">
137
- <div style="max-width:50em;">
138
- This is the inner popup
139
- </div>
140
- </PxFloat>
141
- </div>
142
- </PxFloat>
143
- <div class="story-gradient" :style="{width: '20vw', height: '300vh', textAlign: 'center', padding: '1em', margin: '1em auto'}">SCROLL<br>CHECK</div>
144
- `,
145
- };
146
- },
147
- };
@@ -1,36 +0,0 @@
1
- import PxGsapScrubber from '@/components/PxGsapScrubber.vue';
2
- import { extractArgTypes } from '@/storybook/sb-utils.js';
3
-
4
- export default {
5
- title: '[TODO] PxGsapScrubber',
6
- component: PxGsapScrubber,
7
- // decorators: [ ... ],
8
- // parameters: { ... },
9
-
10
- // https://storybook.js.org/docs/vue/essentials/controls#annotation
11
- // https://storybook.js.org/docs/vue/api/argtypes#available-properties
12
- argTypes: {
13
- ...extractArgTypes(PxGsapScrubber),
14
- // someProp: { type: 'select', options: ['one', 'two', 'three'] }
15
- },
16
- args: {
17
- // label: 'Hello',
18
- // onClick: () => {}),
19
- },
20
- };
21
-
22
- export const Basic = {
23
- render: (args, { argTypes }) => ({
24
- components: { PxGsapScrubber },
25
- setup() {
26
- return { args };
27
- },
28
- template: `
29
- <PxGsapScrubber v-bind="args"></PxGsapScrubber>`,
30
- }),
31
- };
32
-
33
- // export const Advanced = {
34
- // ...Basic,
35
- // // args: { ... },
36
- // };
@@ -1,189 +0,0 @@
1
- import PxIcon from '@/components/PxIcon.vue';
2
- import { extractArgTypes } from '@/storybook/sb-utils.js';
3
- import { svgArrow, svgCheck, svgX } from '../utils/svgIcons';
4
-
5
- import smileSvg from '@/assets/feather/smile.svg';
6
- import arrowRightSvg from '@/assets/feather/arrow-right.svg';
7
- import databaseSvg from '@/assets/feather/database.svg';
8
- import boxSvg from '@/assets/feather/box.svg';
9
-
10
- export default {
11
- component: PxIcon,
12
- argTypes: {
13
- ...extractArgTypes(PxIcon),
14
- src: { control: 'select', options: [smileSvg, boxSvg, databaseSvg] },
15
- },
16
- args: {
17
- src: smileSvg,
18
- },
19
- };
20
-
21
- export const Basic = {
22
- render: (args, { argTypes }) => ({
23
- components: { PxIcon },
24
- setup() {
25
- return { args };
26
- },
27
- template: `<PxIcon v-bind="args" />`,
28
- }),
29
- };
30
-
31
- export const NoSrc = {
32
- ...Basic,
33
- args: { src: null },
34
- };
35
-
36
- export const Events = {
37
- render: (args, { argTypes }) => ({
38
- components: { PxIcon },
39
- data() {
40
- return { opacity: 0.25 };
41
- },
42
- setup() {
43
- return { args };
44
- },
45
- template: `<PxIcon v-bind="args" :style="{opacity}" @mouseenter="opacity = 1" @mouseleave="opacity = 0.25" />`,
46
- }),
47
- };
48
- export const StrokeWidth = {
49
- ...Basic,
50
- args: { strokeWidth: 4 },
51
- };
52
-
53
- export const SizeAndStrokeWidth = {
54
- ...Basic,
55
- args: { size: '8em', strokeWidth: 1 },
56
- };
57
-
58
- export const Spacing = {
59
- ...Basic,
60
- render: (args, { argTypes }) => ({
61
- components: { PxIcon },
62
- setup() {
63
- return { args };
64
- },
65
- template: `
66
- <div>
67
- <span>This icon (<PxIcon v-bind="args" />) is normal spacing</span> and
68
- <span>this icon (<PxIcon v-bind="args" spacing="0.5" />) has extra.</span>
69
- </div>
70
- `,
71
- }),
72
- };
73
-
74
- export const Offset = {
75
- ...Basic,
76
- render: (args, { argTypes }) => ({
77
- components: { PxIcon },
78
- setup() {
79
- return { args };
80
- },
81
- template: `
82
- <div>
83
- <span>This icon (<PxIcon v-bind="args" />) is normal offset</span> and
84
- <span>this icon (<PxIcon v-bind="args" offset="0.2" />) is shifted down.</span>
85
- </div>
86
- `,
87
- }),
88
- };
89
-
90
- export const StrokeWidthScales = {
91
- ...Basic,
92
- render: (args, { argTypes }) => ({
93
- components: { PxIcon },
94
- setup() {
95
- return { args };
96
- },
97
- data() {
98
- return {
99
- arrowRightSvg,
100
-
101
- arrowUp: svgArrow({ angle: 'up' }),
102
- };
103
- },
104
- template: `
105
- <div>
106
- <PxIcon :src="arrowRightSvg" :strokeWidthScales="false" strokeWidth="2" size="5" />
107
- <PxIcon :src="arrowRightSvg" :strokeWidthScales="true" strokeWidth="2" size="5" />
108
- <PxIcon :src="arrowUp" :strokeWidthScales="false" strokeWidth="2" size="5" />
109
- <PxIcon :src="arrowUp" :strokeWidthScales="true" strokeWidth="2" size="5" />
110
- </div>
111
- `,
112
- }),
113
- };
114
-
115
- export const SvgSource = {
116
- ...Basic,
117
- args: {
118
- strokeWidth: 2,
119
- size: '10em',
120
- },
121
- render: (args, { argTypes }) => ({
122
- components: { PxIcon },
123
- setup() {
124
- return { args };
125
- },
126
- data() {
127
- return {
128
- arrowRightSvg,
129
- //longArrowRight: svgArrow({ angle: 45, pointerSize: 0.2 }),
130
- //longArrow45: svgArrow({ angle: 10, pointerSize: 0.2 }),
131
- arrowAngle: svgArrow({ angle: 45 }),
132
- arrowUp: svgArrow({ angle: 'up' }),
133
- arrowRight: svgArrow({ angle: 'right' }),
134
- longArrowUp: svgArrow({ angle: 'up', pointerSize: 0.1 }),
135
- chevron: svgArrow({ angle: 'right', chevron: true }),
136
- check: svgCheck(),
137
- x: svgX(),
138
- };
139
- },
140
- methods: {
141
- svgArrow,
142
- },
143
- template: `
144
- <div>
145
-
146
- <span class="story-inline-border">
147
- <PxIcon v-bind="args" :src="svgArrow({angle: 45})" />
148
- </span>
149
-
150
- <span class="story-inline-border">
151
- <PxIcon v-bind="args" :src="svgArrow({angle: 'right', pointerSize: 0.2})" />
152
- </span>
153
-
154
- <span class="story-inline-border">
155
- <PxIcon v-bind="args" :src="svgArrow({angle: 'right', chevron: true, pointerSize: 0.2})" />
156
- </span>
157
-
158
- <span class="story-inline-border">
159
- <PxIcon v-bind="args" :src="svgArrow({angle: 'right', chevron: true, pointerSize: 0.5})" />
160
- </span>
161
-
162
- <span class="story-inline-border">
163
- <PxIcon v-bind="args" :src="arrowUp" sizeBias="height" />
164
- </span>
165
-
166
- <span class="story-inline-border">
167
- <PxIcon v-bind="args" :src="arrowRight" sizeBias="height" />
168
- </span>
169
-
170
- <span class="story-inline-border">
171
- <PxIcon v-bind="args" :src="chevron" />
172
- </span>
173
-
174
- <span class="story-inline-border">
175
- <PxIcon v-bind="args" :src="longArrowUp" />
176
- </span>
177
-
178
- <span class="story-inline-border">
179
- <PxIcon v-bind="args" :src="check" />
180
- </span>
181
-
182
- <span class="story-inline-border">
183
- <PxIcon v-bind="args" :src="x" />
184
- </span>
185
-
186
- </div>
187
- `,
188
- }),
189
- };
@@ -1,87 +0,0 @@
1
- import PxIconButton from '@/components/PxIconButton.vue';
2
- import { extractArgTypes } from '@/storybook/sb-utils.js';
3
- import { svgArrow } from '../utils/svgIcons';
4
- import smileSvg from '@/assets/feather/smile.svg';
5
- import playSvg from '@/assets/feather/play.svg';
6
- import pauseSvg from '@/assets/feather/pause.svg';
7
-
8
- export default {
9
- title: 'PxIconButton',
10
- component: PxIconButton,
11
- // decorators: [ ... ],
12
- // parameters: { ... },
13
-
14
- // https://storybook.js.org/docs/vue/essentials/controls#annotation
15
- // https://storybook.js.org/docs/vue/api/argtypes#available-properties
16
- argTypes: {
17
- ...extractArgTypes(PxIconButton),
18
- // someProp: { type: 'select', options: ['one', 'two', 'three'] }
19
- },
20
- args: {
21
- icon: smileSvg,
22
- // onClick: () => {}),
23
- },
24
- };
25
-
26
- export const Basic = {
27
- render: (args, { argTypes }) => ({
28
- components: { PxIconButton },
29
- setup() {
30
- return { args };
31
- },
32
- methods: {
33
- svgArrow,
34
- },
35
- template: `
36
- <PxIconButton v-bind="args"></PxIconButton>`,
37
- }),
38
- };
39
-
40
- export const SrcProp = {
41
- ...Basic,
42
- args: {
43
- icon: null,
44
- src: playSvg,
45
- },
46
- };
47
-
48
- export const Toggle = {
49
- ...Basic,
50
- args: {
51
- icon: playSvg,
52
- iconChecked: pauseSvg,
53
- toggles: true,
54
- },
55
- };
56
-
57
- export const SrcToggle = {
58
- ...Basic,
59
- args: {
60
- icon: null,
61
- iconChecked: null,
62
- src: playSvg,
63
- srcChecked: pauseSvg,
64
- toggles: true,
65
- },
66
- };
67
-
68
- export const CheckedInherits = {
69
- ...Basic,
70
- args: {
71
- icon: { size: 4, src: playSvg, strokeWidthScales: false, strokeWidth: 2 },
72
- iconChecked: pauseSvg,
73
- iconCheckedInherits: true,
74
- variant: 'basic accent-hover',
75
- },
76
- };
77
-
78
- export const SvgString = {
79
- ...Basic,
80
- args: {
81
- icon: {
82
- size: 4,
83
- src: svgArrow({ angle: 'right', chevron: true, naturalSizeFixed: 'both' }),
84
- },
85
- iconChecked: svgArrow({ angle: 'down', chevron: true, naturalSizeFixed: 'both' }),
86
- },
87
- };