@onereach/ui-components 4.4.3 → 4.4.4-beta.2718.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.
- package/dist/bundled/v2/components/index.d.ts +2 -0
- package/dist/bundled/v2/components/index.js +6 -4
- package/dist/bundled/v2/index.js +7 -5
- package/dist/bundled/v3/OrCombinedInput.vue_vue_type_script_lang-cb7a88f3.js +66 -0
- package/dist/bundled/v3/components/OrCombinedInputV3/OrCombinedInput.js +11 -66
- package/dist/bundled/v3/components/OrCombinedInputV3/index.js +1 -1
- package/dist/bundled/v3/components/index.d.ts +2 -0
- package/dist/bundled/v3/components/index.js +5 -3
- package/dist/bundled/v3/index.js +11 -8
- package/dist/esm/v2/OrCombinedInput-5994d9fc.js +158 -0
- package/dist/esm/v2/components/index.d.ts +2 -0
- package/dist/esm/v2/components/index.js +4 -3
- package/dist/esm/v2/components/or-combined-input-v3/index.js +6 -158
- package/dist/esm/v2/index.js +4 -3
- package/dist/esm/v3/OrCombinedInput-14c23a04.js +129 -0
- package/dist/esm/v3/components/index.d.ts +2 -0
- package/dist/esm/v3/components/index.js +3 -2
- package/dist/esm/v3/components/or-combined-input-v3/index.js +6 -129
- package/dist/esm/v3/index.js +3 -2
- package/package.json +2 -3
- package/src/components/index.ts +2 -0
- package/src/components/or-bottom-sheet-v3/OrBottomSheet.docs.mdx +0 -7
- package/src/components/or-bottom-sheet-v3/OrBottomSheet.stories3.ts +0 -110
- package/src/components/or-button-v3/OrButton.docs.mdx +0 -14
- package/src/components/or-button-v3/OrButton.stories3.ts +0 -130
- package/src/components/or-card-collection-v3/OrCardCollection.docs.mdx +0 -7
- package/src/components/or-card-collection-v3/OrCardCollection.stories3.ts +0 -378
- package/src/components/or-card-v3/OrCard.docs.mdx +0 -10
- package/src/components/or-card-v3/OrCard.stories3.ts +0 -74
- package/src/components/or-checkbox-group-v3/OrCheckboxGroup.docs.mdx +0 -7
- package/src/components/or-checkbox-group-v3/OrCheckboxGroup.stories3.ts +0 -399
- package/src/components/or-checkbox-tree-v3/OrCheckboxTree.docs.mdx +0 -7
- package/src/components/or-checkbox-tree-v3/OrCheckboxTree.stories3.ts +0 -112
- package/src/components/or-checkbox-v3/OrCheckbox.docs.mdx +0 -12
- package/src/components/or-checkbox-v3/OrCheckbox.stories3.ts +0 -155
- package/src/components/or-combined-input-v3/OrCombinedInput.docs.mdx +0 -7
- package/src/components/or-combined-input-v3/OrCombinedInput.stories3.ts +0 -201
- package/src/components/or-confirm-v3/OrConfirm.docs.mdx +0 -16
- package/src/components/or-confirm-v3/OrConfirm.stories3.ts +0 -252
- package/src/components/or-date-picker-v3/OrDatePicker.docs.mdx +0 -7
- package/src/components/or-date-picker-v3/OrDatePicker.stories3.ts +0 -174
- package/src/components/or-date-time-picker-v3/OrDateTimePicker.docs.mdx +0 -7
- package/src/components/or-date-time-picker-v3/OrDateTimePicker.stories3.ts +0 -183
- package/src/components/or-empty-state-v3/OrEmptyState.stories3.ts +0 -87
- package/src/components/or-error-tag-v3/OrErrorTag.docs.mdx +0 -8
- package/src/components/or-error-tag-v3/OrErrorTag.stories3.ts +0 -56
- package/src/components/or-expansion-panel-v3/OrExpansionPanel.docs.mdx +0 -7
- package/src/components/or-expansion-panel-v3/OrExpansionPanel.stories3.ts +0 -137
- package/src/components/or-fab-v3/OrFab.docs.mdx +0 -7
- package/src/components/or-fab-v3/OrFab.stories3.ts +0 -81
- package/src/components/or-form-group-v3/OrFormGroup.stories3.ts +0 -114
- package/src/components/or-icon-button-v3/OrIconButton.docs.mdx +0 -14
- package/src/components/or-icon-button-v3/OrIconButton.stories3.ts +0 -105
- package/src/components/or-icon-v3/OrIcon.docs.mdx +0 -12
- package/src/components/or-icon-v3/OrIcon.stories3.ts +0 -53
- package/src/components/or-inline-input-v3/OrInlineInput.docs.mdx +0 -7
- package/src/components/or-inline-input-v3/OrInlineInput.stories3.ts +0 -137
- package/src/components/or-inline-textarea-v3/OrInlineTextarea.docs.mdx +0 -7
- package/src/components/or-inline-textarea-v3/OrInlineTextarea.stories3.ts +0 -126
- package/src/components/or-input-v3/OrInput.docs.mdx +0 -16
- package/src/components/or-input-v3/OrInput.stories3.ts +0 -222
- package/src/components/or-link-v3/OrLink.docs.mdx +0 -7
- package/src/components/or-link-v3/OrLink.stories3.ts +0 -163
- package/src/components/or-loader-v3/OrLoader.docs.mdx +0 -14
- package/src/components/or-loader-v3/OrLoader.stories3.ts +0 -86
- package/src/components/or-menu-item-v3/OrMenuItem.docs.mdx +0 -7
- package/src/components/or-menu-item-v3/OrMenuItem.stories3.ts +0 -90
- package/src/components/or-menu-v3/OrMenu.docs.mdx +0 -7
- package/src/components/or-menu-v3/OrMenu.stories3.ts +0 -167
- package/src/components/or-modal-v3/OrModal.docs.mdx +0 -10
- package/src/components/or-modal-v3/OrModal.stories3.ts +0 -278
- package/src/components/or-notification-v3/OrNotification.docs.mdx +0 -7
- package/src/components/or-notification-v3/OrNotification.stories3.ts +0 -122
- package/src/components/or-overlay-v3/OrOverlay.docs.mdx +0 -11
- package/src/components/or-overlay-v3/OrOverlay.stories3.ts +0 -61
- package/src/components/or-pagination-v3/OrPagination.docs.mdx +0 -7
- package/src/components/or-pagination-v3/OrPagination.stories3.ts +0 -81
- package/src/components/or-popover-v3/OrPopover.docs.mdx +0 -11
- package/src/components/or-popover-v3/OrPopover.stories3.ts +0 -115
- package/src/components/or-progress-v3/OrProgress.docs.mdx +0 -12
- package/src/components/or-progress-v3/OrProgress.stories3.ts +0 -220
- package/src/components/or-radio-group-v3/OrRadioGroup.stories3.ts +0 -81
- package/src/components/or-radio-v3/OrRadio.docs.mdx +0 -11
- package/src/components/or-radio-v3/OrRadio.stories3.ts +0 -151
- package/src/components/or-search-v3/OrSearch.docs.mdx +0 -16
- package/src/components/or-search-v3/OrSearch.stories3.ts +0 -126
- package/src/components/or-segmented-control-v3/OrSegmentedControl.docs.mdx +0 -7
- package/src/components/or-segmented-control-v3/OrSegmentedControl.stories3.ts +0 -100
- package/src/components/or-select-v3/OrSelect.docs.mdx +0 -17
- package/src/components/or-select-v3/OrSelect.stories3.ts +0 -508
- package/src/components/or-sidebar-v3/OrSidebar.docs.mdx +0 -13
- package/src/components/or-sidebar-v3/OrSidebar.stories3.ts +0 -415
- package/src/components/or-skeleton-v3/OrSkeleton.docs.mdx +0 -14
- package/src/components/or-skeleton-v3/OrSkeleton.stories3.ts +0 -144
- package/src/components/or-skeleton-v3/or-skeleton-circle-v3/OrSkeletonCircle.docs.mdx +0 -7
- package/src/components/or-skeleton-v3/or-skeleton-circle-v3/OrSkeletonCircle.stories3.ts +0 -59
- package/src/components/or-skeleton-v3/or-skeleton-rect-v3/OrSkeletonRect.docs.mdx +0 -6
- package/src/components/or-skeleton-v3/or-skeleton-rect-v3/OrSkeletonRect.stories3.ts +0 -80
- package/src/components/or-skeleton-v3/or-skeleton-text-v3/OrSkeletonText.docs.mdx +0 -7
- package/src/components/or-skeleton-v3/or-skeleton-text-v3/OrSkeletonText.stories3.ts +0 -88
- package/src/components/or-switch-v3/OrSwitch.docs.mdx +0 -7
- package/src/components/or-switch-v3/OrSwitch.stories3.ts +0 -155
- package/src/components/or-tab-v3/OrTab.docs.mdx +0 -7
- package/src/components/or-tab-v3/OrTab.stories3.ts +0 -74
- package/src/components/or-tabs-v3/OrTabs.docs.mdx +0 -7
- package/src/components/or-tabs-v3/OrTabs.stories3.ts +0 -140
- package/src/components/or-tag-v3/OrTag.docs.mdx +0 -13
- package/src/components/or-tag-v3/OrTag.stories3.ts +0 -213
- package/src/components/or-tags-v3/OrTags.docs.mdx +0 -7
- package/src/components/or-tags-v3/OrTags.stories3.ts +0 -101
- package/src/components/or-teleport-v3/OrTeleport.docs.mdx +0 -7
- package/src/components/or-teleport-v3/OrTeleport.stories3.ts +0 -60
- package/src/components/or-text-v3/OrText.docs.mdx +0 -7
- package/src/components/or-text-v3/OrText.stories3.ts +0 -124
- package/src/components/or-textarea-v3/OrTextarea.docs.mdx +0 -14
- package/src/components/or-textarea-v3/OrTextarea.stories3.ts +0 -164
- package/src/components/or-time-picker-v3/OrTimePicker.docs.mdx +0 -7
- package/src/components/or-time-picker-v3/OrTimePicker.stories3.ts +0 -170
- package/src/components/or-toast-v3/OrToast.stories3.ts +0 -67
- package/src/components/or-toast-v3/or-toast-container-v3/OrToastContainer.docs.mdx +0 -123
- package/src/components/or-toast-v3/or-toast-container-v3/OrToastContainer.stories3.ts +0 -119
- package/src/components/or-tooltip-v3/OrTooltip.docs.mdx +0 -10
- package/src/components/or-tooltip-v3/OrTooltip.stories3.ts +0 -84
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryFn } from '@storybook/vue3';
|
|
2
|
-
import { OrIconV3 as OrIcon } from '../or-icon-v3';
|
|
3
|
-
import OrLinkDocs from './OrLink.docs.mdx';
|
|
4
|
-
import OrLink from './OrLink.vue';
|
|
5
|
-
import { LinkColor } from './props';
|
|
6
|
-
import Faker from 'faker';
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
title: 'Components/Link',
|
|
10
|
-
component: OrLink,
|
|
11
|
-
|
|
12
|
-
argTypes: {
|
|
13
|
-
// Slots
|
|
14
|
-
default: {
|
|
15
|
-
type: {
|
|
16
|
-
name: 'string',
|
|
17
|
-
required: true,
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
control: { type: 'text' },
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
// Props
|
|
24
|
-
href: {
|
|
25
|
-
control: { type: 'text' },
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
color: {
|
|
29
|
-
control: { type: 'select' },
|
|
30
|
-
options: Object.values(LinkColor),
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
underlined: {
|
|
34
|
-
control: { type: 'boolean' },
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
disabled: {
|
|
38
|
-
control: { type: 'boolean' },
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
loading: {
|
|
42
|
-
control: { type: 'boolean' },
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
loadingText: {
|
|
46
|
-
control: { type: 'text' },
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
parameters: {
|
|
51
|
-
layout: 'centered',
|
|
52
|
-
|
|
53
|
-
docs: {
|
|
54
|
-
page: OrLinkDocs,
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
design: {
|
|
58
|
-
type: 'figma',
|
|
59
|
-
url: 'https://www.figma.com/file/o7DdkaznUW2PtX4wiSuhhQ/Core?node-id=6085%3A71005',
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
} as Meta<typeof OrLink>;
|
|
63
|
-
|
|
64
|
-
const Template: StoryFn<typeof OrLink> = (args) => ({
|
|
65
|
-
components: {
|
|
66
|
-
OrLink,
|
|
67
|
-
OrIcon,
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
setup() {
|
|
71
|
-
return { args };
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
template: `
|
|
75
|
-
<OrLink v-bind="args" class="!typography-body-2-regular">
|
|
76
|
-
${args.default}
|
|
77
|
-
</OrLink>
|
|
78
|
-
`,
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
const TemplateWithTextAndBoldLink: StoryFn<typeof OrLink> = (args) => ({
|
|
82
|
-
components: {
|
|
83
|
-
OrLink,
|
|
84
|
-
OrIcon,
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
setup() {
|
|
88
|
-
return { args };
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
template: `
|
|
92
|
-
<p class="typography-body-2-regular text-on-primary-container dark:text-on-primary-container-dark">
|
|
93
|
-
You can
|
|
94
|
-
<OrLink v-bind="args" class="!typography-body-2-bold">
|
|
95
|
-
${args.default}
|
|
96
|
-
</OrLink>
|
|
97
|
-
to see more
|
|
98
|
-
</p>
|
|
99
|
-
`,
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
const TemplateWithRandomText: StoryFn<typeof OrLink> = (args) => ({
|
|
103
|
-
components: {
|
|
104
|
-
OrLink,
|
|
105
|
-
OrIcon,
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
setup() {
|
|
109
|
-
return { args };
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
template: `
|
|
113
|
-
<p class="typography-body-2-regular text-secondary dark:text-secondary-dark">
|
|
114
|
-
${Faker.lorem.words(5)}
|
|
115
|
-
<OrLink v-bind="args">
|
|
116
|
-
${args.default}
|
|
117
|
-
</OrLink>
|
|
118
|
-
${Faker.lorem.words(5)}
|
|
119
|
-
</p>
|
|
120
|
-
`,
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
export const Default = Template.bind({});
|
|
124
|
-
|
|
125
|
-
Default.args = {
|
|
126
|
-
// Slots
|
|
127
|
-
default: 'Link',
|
|
128
|
-
|
|
129
|
-
// Props
|
|
130
|
-
href: 'https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a',
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
export const WithColor = Template.bind({});
|
|
134
|
-
|
|
135
|
-
WithColor.args = {
|
|
136
|
-
...Default.args,
|
|
137
|
-
|
|
138
|
-
// Slots
|
|
139
|
-
default: Faker.commerce.productName(),
|
|
140
|
-
|
|
141
|
-
// Props
|
|
142
|
-
color: LinkColor.Danger,
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
export const BoldWithColorNotUnderlinedInsideText = TemplateWithTextAndBoldLink.bind({});
|
|
146
|
-
|
|
147
|
-
BoldWithColorNotUnderlinedInsideText.args = {
|
|
148
|
-
...Default.args,
|
|
149
|
-
|
|
150
|
-
// Slots
|
|
151
|
-
default: 'click here',
|
|
152
|
-
underlined: false,
|
|
153
|
-
color: LinkColor.Primary,
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
export const InsideRandomText = TemplateWithRandomText.bind({});
|
|
157
|
-
|
|
158
|
-
InsideRandomText.args = {
|
|
159
|
-
...Default.args,
|
|
160
|
-
|
|
161
|
-
// Slots
|
|
162
|
-
default: Faker.lorem.words(2),
|
|
163
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { DocsPage } from '@storybook/addon-docs';
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { OrLoaderV3 as OrLoader } from '@onereach/ui-components';
|
|
5
|
-
```
|
|
6
|
-
|
|
7
|
-
<DocsPage />
|
|
8
|
-
|
|
9
|
-
## Migration Guide from V1
|
|
10
|
-
- added properties `color` and `size`
|
|
11
|
-
- property `type` renamed to `variant`
|
|
12
|
-
- property `linearTitle` renamed to `title`
|
|
13
|
-
- property `linearDescription` renamed to `description`
|
|
14
|
-
- removed properties: `textTypeLabel`
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryFn } from '@storybook/vue3';
|
|
2
|
-
import OrLoaderDocs from './OrLoader.docs.mdx';
|
|
3
|
-
import OrLoader from './OrLoader.vue';
|
|
4
|
-
import { LoaderColor, LoaderSize, LoaderVariant } from './props';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Components/Loader',
|
|
8
|
-
component: OrLoader,
|
|
9
|
-
|
|
10
|
-
argTypes: {
|
|
11
|
-
// Props
|
|
12
|
-
variant: {
|
|
13
|
-
control: { type: 'select' },
|
|
14
|
-
options: Object.values(LoaderVariant),
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
color: {
|
|
18
|
-
control: { type: 'select' },
|
|
19
|
-
options: Object.values(LoaderColor),
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
size: {
|
|
23
|
-
control: { type: 'select' },
|
|
24
|
-
options: Object.values(LoaderSize),
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
title: {
|
|
28
|
-
control: { type: 'text' },
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
description: {
|
|
32
|
-
control: { type: 'text' },
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
parameters: {
|
|
37
|
-
layout: 'fullscreen',
|
|
38
|
-
|
|
39
|
-
docs: {
|
|
40
|
-
page: OrLoaderDocs,
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
design: {
|
|
44
|
-
type: 'figma',
|
|
45
|
-
url: 'https://www.figma.com/file/o7DdkaznUW2PtX4wiSuhhQ/Core?node-id=1649%3A9615',
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
} as Meta<typeof OrLoader>;
|
|
49
|
-
|
|
50
|
-
const Template: StoryFn<typeof OrLoader> = (args) => ({
|
|
51
|
-
components: {
|
|
52
|
-
OrLoader,
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
setup() {
|
|
56
|
-
return { args };
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
template: `
|
|
60
|
-
<div class="w-full min-h-[100px] p-md flex justify-center items-center">
|
|
61
|
-
<OrLoader class="w-2/5 max-w-[400px]" v-bind="args" />
|
|
62
|
-
</div>
|
|
63
|
-
`,
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
export const Default = Template.bind({});
|
|
67
|
-
|
|
68
|
-
export const Linear = Template.bind({});
|
|
69
|
-
Linear.args = {
|
|
70
|
-
variant: 'linear',
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const LinearWithText = Template.bind({});
|
|
74
|
-
LinearWithText.args = {
|
|
75
|
-
title: 'Loading',
|
|
76
|
-
variant: 'linear',
|
|
77
|
-
description: 'Promptly retrieving your data from the cloud',
|
|
78
|
-
};
|
|
79
|
-
LinearWithText.parameters = {
|
|
80
|
-
docs: {
|
|
81
|
-
description: {
|
|
82
|
-
story: 'By setting width on the component you may control the width of the linear loading indicator. \
|
|
83
|
-
Circular indicator size is controlled by the `size` prop.',
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
};
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { action } from '@storybook/addon-actions';
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/vue3';
|
|
3
|
-
import OrMenuItemDocs from './OrMenuItem.docs.mdx';
|
|
4
|
-
import OrMenuItem from './OrMenuItem.vue';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Components/Menu/Parts/Menu Item',
|
|
8
|
-
component: OrMenuItem,
|
|
9
|
-
|
|
10
|
-
argTypes: {
|
|
11
|
-
// Slots
|
|
12
|
-
default: {
|
|
13
|
-
type: {
|
|
14
|
-
name: 'string',
|
|
15
|
-
required: true,
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
control: { type: 'text' },
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
// Props
|
|
22
|
-
icon: {
|
|
23
|
-
control: { type: 'object' },
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
selected: {
|
|
27
|
-
control: { type: 'boolean' },
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
disabled: {
|
|
31
|
-
control: { type: 'boolean' },
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
parameters: {
|
|
36
|
-
layout: 'centered',
|
|
37
|
-
|
|
38
|
-
docs: {
|
|
39
|
-
page: OrMenuItemDocs,
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
design: {
|
|
43
|
-
type: 'figma',
|
|
44
|
-
url: 'https://www.figma.com/file/o7DdkaznUW2PtX4wiSuhhQ/Core?node-id=608%3A2926',
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
} as Meta<typeof OrMenuItem>;
|
|
48
|
-
|
|
49
|
-
const Template: StoryFn<typeof OrMenuItem> = (args) => ({
|
|
50
|
-
components: {
|
|
51
|
-
OrMenuItem,
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
setup() {
|
|
55
|
-
return {
|
|
56
|
-
args,
|
|
57
|
-
handleClick: action('click'),
|
|
58
|
-
handleFocus: action('focus'),
|
|
59
|
-
handleBlur: action('blur'),
|
|
60
|
-
};
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
template: `
|
|
64
|
-
<OrMenuItem
|
|
65
|
-
v-bind="args"
|
|
66
|
-
@click="handleClick"
|
|
67
|
-
@focus="handleFocus"
|
|
68
|
-
@blur="handleBlur"
|
|
69
|
-
>
|
|
70
|
-
${args.default}
|
|
71
|
-
</OrMenuItem>
|
|
72
|
-
`,
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
export const Default = Template.bind({});
|
|
76
|
-
|
|
77
|
-
Default.args = {
|
|
78
|
-
// Slots
|
|
79
|
-
default: 'Menu',
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export const WithIcon = Template.bind({});
|
|
83
|
-
|
|
84
|
-
WithIcon.args = {
|
|
85
|
-
// Slots
|
|
86
|
-
default: 'Menu',
|
|
87
|
-
|
|
88
|
-
// Props
|
|
89
|
-
icon: 'bug_report',
|
|
90
|
-
};
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { action } from '@storybook/addon-actions';
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/vue3';
|
|
3
|
-
import { ref } from 'vue-demi';
|
|
4
|
-
import { OrButtonV3 as OrButton } from '../or-button-v3';
|
|
5
|
-
import { OrMenuItemV3 as OrMenuItem } from '../or-menu-item-v3';
|
|
6
|
-
import { OrIconV3 as OrIcon } from '../or-icon-v3';
|
|
7
|
-
import OrMenuDocs from './OrMenu.docs.mdx';
|
|
8
|
-
import OrMenu from './OrMenu.vue';
|
|
9
|
-
import { MenuPlacement } from './props';
|
|
10
|
-
|
|
11
|
-
export default {
|
|
12
|
-
title: 'Components/Menu',
|
|
13
|
-
component: OrMenu,
|
|
14
|
-
|
|
15
|
-
argTypes: {
|
|
16
|
-
// Slots
|
|
17
|
-
default: {
|
|
18
|
-
type: {
|
|
19
|
-
name: 'string',
|
|
20
|
-
required: true,
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
control: { type: 'text' },
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
// Props
|
|
27
|
-
trigger: {
|
|
28
|
-
table: { disable: true },
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
placement: {
|
|
32
|
-
control: { type: 'select' },
|
|
33
|
-
options: Object.values(MenuPlacement),
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
// Events
|
|
37
|
-
'update:state': {
|
|
38
|
-
table: { disable: true },
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
parameters: {
|
|
43
|
-
layout: 'centered',
|
|
44
|
-
|
|
45
|
-
docs: {
|
|
46
|
-
page: OrMenuDocs,
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
design: {
|
|
50
|
-
type: 'figma',
|
|
51
|
-
url: 'https://www.figma.com/file/o7DdkaznUW2PtX4wiSuhhQ/Core?node-id=608%3A2926',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
} as Meta<typeof OrMenu>;
|
|
55
|
-
|
|
56
|
-
const Template: StoryFn<typeof OrMenu> = (args) => ({
|
|
57
|
-
components: {
|
|
58
|
-
OrButton,
|
|
59
|
-
OrMenu,
|
|
60
|
-
OrMenuItem,
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
setup() {
|
|
64
|
-
// Refs
|
|
65
|
-
const button = ref<InstanceType<typeof OrButton>>();
|
|
66
|
-
const menu = ref<InstanceType<typeof OrMenu>>();
|
|
67
|
-
|
|
68
|
-
return {
|
|
69
|
-
args,
|
|
70
|
-
button,
|
|
71
|
-
menu,
|
|
72
|
-
onUpdateState: action('update:state'),
|
|
73
|
-
};
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
template: `
|
|
77
|
-
<div class="contents">
|
|
78
|
-
<OrButton
|
|
79
|
-
ref="button"
|
|
80
|
-
@click="menu.open()"
|
|
81
|
-
>
|
|
82
|
-
Open
|
|
83
|
-
</OrButton>
|
|
84
|
-
|
|
85
|
-
<OrMenu
|
|
86
|
-
ref="menu"
|
|
87
|
-
v-bind="args"
|
|
88
|
-
:trigger="button?.root"
|
|
89
|
-
@update:state="onUpdateState"
|
|
90
|
-
>
|
|
91
|
-
${args.default}
|
|
92
|
-
</OrMenu>
|
|
93
|
-
</div>
|
|
94
|
-
`,
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
export const Menu = Template.bind({});
|
|
98
|
-
|
|
99
|
-
Menu.args = {
|
|
100
|
-
// Slots
|
|
101
|
-
default: `
|
|
102
|
-
<OrMenuItem>Item</OrMenuItem>
|
|
103
|
-
<OrMenuItem icon="bug_report">Item + Icon</OrMenuItem>
|
|
104
|
-
<OrMenuItem selected>Selected Item</OrMenuItem>
|
|
105
|
-
<OrMenuItem disabled>Disabled Item</OrMenuItem>
|
|
106
|
-
<OrMenuItem>Very Looooooooooooooooooooooooooooooooooooooooooooooooooooooooong Item</OrMenuItem>
|
|
107
|
-
`,
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
const OrderDropdownTemplate: StoryFn<typeof OrMenu> = (args) => ({
|
|
111
|
-
components: {
|
|
112
|
-
OrButton,
|
|
113
|
-
OrMenu,
|
|
114
|
-
OrMenuItem,
|
|
115
|
-
OrIcon,
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
setup() {
|
|
119
|
-
// Refs
|
|
120
|
-
const button = ref<InstanceType<typeof OrButton>>();
|
|
121
|
-
const menu = ref<InstanceType<typeof OrMenu>>();
|
|
122
|
-
|
|
123
|
-
return {
|
|
124
|
-
args,
|
|
125
|
-
button,
|
|
126
|
-
menu,
|
|
127
|
-
onUpdateState: action('update:state'),
|
|
128
|
-
};
|
|
129
|
-
},
|
|
130
|
-
|
|
131
|
-
template: `
|
|
132
|
-
<div class="contents">
|
|
133
|
-
<OrButton
|
|
134
|
-
ref="button"
|
|
135
|
-
variant="link"
|
|
136
|
-
color="inherit"
|
|
137
|
-
@click="menu.toggle()"
|
|
138
|
-
>
|
|
139
|
-
A-Z
|
|
140
|
-
<OrIcon
|
|
141
|
-
v-if="menu"
|
|
142
|
-
:icon="menu.isOpen ? 'arrow_drop_up' : 'arrow_drop_down'"
|
|
143
|
-
/>
|
|
144
|
-
</OrButton>
|
|
145
|
-
<OrMenu
|
|
146
|
-
ref="menu"
|
|
147
|
-
v-bind="args"
|
|
148
|
-
:trigger="button?.root"
|
|
149
|
-
@update:state="onUpdateState"
|
|
150
|
-
>
|
|
151
|
-
${args.default}
|
|
152
|
-
</OrMenu>
|
|
153
|
-
</div>
|
|
154
|
-
`,
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
export const OrderDropdown = OrderDropdownTemplate.bind({});
|
|
158
|
-
|
|
159
|
-
OrderDropdown.args = {
|
|
160
|
-
// Slots
|
|
161
|
-
default: `
|
|
162
|
-
<OrMenuItem selected>Last Updated</OrMenuItem>
|
|
163
|
-
<OrMenuItem>Firs Updated</OrMenuItem>
|
|
164
|
-
<OrMenuItem>A - Z</OrMenuItem>
|
|
165
|
-
<OrMenuItem>Z - A</OrMenuItem>
|
|
166
|
-
`,
|
|
167
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { DocsPage } from '@storybook/addon-docs';
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { OrModalV3 as OrModal } from '@onereach/ui-components';
|
|
5
|
-
```
|
|
6
|
-
|
|
7
|
-
<DocsPage />
|
|
8
|
-
|
|
9
|
-
## Migration Guide from V1
|
|
10
|
-
- removed properties `titleText`, `showClose`, `closeOnClickOutside`, `size`, and `isWithoutOverlay`
|