@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,220 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryFn } from '@storybook/vue3';
|
|
2
|
-
import OrProgressDocs from './OrProgress.docs.mdx';
|
|
3
|
-
import OrProgress from './OrProgress.vue';
|
|
4
|
-
import { ProgressColor, ProgressType } from './props';
|
|
5
|
-
import { OrIconV3 as OrIcon } from '../or-icon-v3';
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: 'Components/Progress',
|
|
9
|
-
component: OrProgress,
|
|
10
|
-
|
|
11
|
-
argTypes: {
|
|
12
|
-
// Slots
|
|
13
|
-
header: {
|
|
14
|
-
type: {
|
|
15
|
-
name: 'string',
|
|
16
|
-
required: false,
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
control: { type: 'text' },
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
label: {
|
|
23
|
-
type: {
|
|
24
|
-
name: 'string',
|
|
25
|
-
required: false,
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
control: { type: 'text' },
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
percent: {
|
|
32
|
-
type: {
|
|
33
|
-
name: 'string',
|
|
34
|
-
required: false,
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
control: { type: 'text' },
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
footer: {
|
|
41
|
-
type: {
|
|
42
|
-
name: 'string',
|
|
43
|
-
required: false,
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
control: { type: 'text' },
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
// Props
|
|
50
|
-
maxValue: {
|
|
51
|
-
control: { type: 'number' },
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
value: {
|
|
55
|
-
control: { type: 'number' },
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
progress: {
|
|
59
|
-
control: {
|
|
60
|
-
type: 'range',
|
|
61
|
-
min: 0,
|
|
62
|
-
max: 1,
|
|
63
|
-
step: 0.0001,
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
precision: {
|
|
68
|
-
control: { type: 'number' },
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
type: {
|
|
72
|
-
control: { type: 'select' },
|
|
73
|
-
options: Object.values(ProgressType),
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
color: {
|
|
77
|
-
control: { type: 'select' },
|
|
78
|
-
options: Object.values(ProgressColor),
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
loading: {
|
|
82
|
-
control: { type: 'boolean' },
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
parameters: {
|
|
87
|
-
layout: 'centered',
|
|
88
|
-
|
|
89
|
-
docs: {
|
|
90
|
-
page: OrProgressDocs,
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
design: {
|
|
94
|
-
type: 'figma',
|
|
95
|
-
url: 'https://www.figma.com/file/o7DdkaznUW2PtX4wiSuhhQ/Core?node-id=387%3A1797',
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
} as Meta<typeof OrProgress>;
|
|
99
|
-
|
|
100
|
-
const Template: StoryFn<typeof OrProgress> = (args) => ({
|
|
101
|
-
components: {
|
|
102
|
-
OrProgress,
|
|
103
|
-
OrIcon,
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
setup() {
|
|
107
|
-
return { args };
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
template: `
|
|
111
|
-
<or-progress v-bind="args">
|
|
112
|
-
<template v-if="${!!args.header}" v-slot:header>
|
|
113
|
-
${args.header}
|
|
114
|
-
</template>
|
|
115
|
-
<template v-if="${!!args.label}" v-slot:label>
|
|
116
|
-
${args.label}
|
|
117
|
-
</template>
|
|
118
|
-
<template v-if="${!!args.percent}" v-slot:percent="{ value }">
|
|
119
|
-
${args.percent}
|
|
120
|
-
</template>
|
|
121
|
-
<template v-if="${!!args.footer}" v-slot:footer="{ value }">
|
|
122
|
-
${args.footer}
|
|
123
|
-
</template>
|
|
124
|
-
</or-progress>
|
|
125
|
-
`,
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
export const Default = Template.bind({});
|
|
129
|
-
Default.args = {
|
|
130
|
-
progress: 0.5,
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
export const Circle = Template.bind({});
|
|
134
|
-
Circle.args = {
|
|
135
|
-
progress: 0.5,
|
|
136
|
-
type: ProgressType.Circle,
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
export const WithValue = Template.bind({});
|
|
140
|
-
WithValue.args = {
|
|
141
|
-
maxValue: 200,
|
|
142
|
-
value: 100,
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
export const CircleWithValue = Template.bind({});
|
|
146
|
-
CircleWithValue.args = {
|
|
147
|
-
...Circle.args,
|
|
148
|
-
maxValue: 200,
|
|
149
|
-
value: 100,
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
export const Loading = Template.bind({});
|
|
153
|
-
Loading.args = {
|
|
154
|
-
...Default.args,
|
|
155
|
-
loading: true,
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
export const CircleLoading = Template.bind({});
|
|
159
|
-
CircleLoading.args = {
|
|
160
|
-
...Circle.args,
|
|
161
|
-
loading: true,
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
export const WithColor = Template.bind({});
|
|
165
|
-
WithColor.args = {
|
|
166
|
-
progress: 0.75,
|
|
167
|
-
color: ProgressColor.Warning,
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
export const CircleWithColor = Template.bind({});
|
|
171
|
-
CircleWithColor.args = {
|
|
172
|
-
type: ProgressType.Circle,
|
|
173
|
-
progress: 0.75,
|
|
174
|
-
color: ProgressColor.Primary,
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
export const WithHeaderText = Template.bind({});
|
|
178
|
-
WithHeaderText.args = {
|
|
179
|
-
...Default.args,
|
|
180
|
-
label: 'Progress',
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
export const WithFooterText = Template.bind({});
|
|
184
|
-
WithFooterText.args = {
|
|
185
|
-
...Default.args,
|
|
186
|
-
footer: 'Progress',
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
export const WithHeaderAndPrecision = Template.bind({});
|
|
190
|
-
WithHeaderAndPrecision.args = {
|
|
191
|
-
...WithHeaderText.args,
|
|
192
|
-
progress: 0.54321,
|
|
193
|
-
precision: 3,
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
export const WithHeaderSlot = Template.bind({});
|
|
197
|
-
WithHeaderSlot.args = {
|
|
198
|
-
...Default.args,
|
|
199
|
-
header: '<div>Custom <i>header</i></div>',
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
export const WithFooterSlot = Template.bind({});
|
|
203
|
-
WithFooterSlot.args = {
|
|
204
|
-
...Default.args,
|
|
205
|
-
footer: '<div>Custom <i>footer</i></div>',
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
export const WithLabelSlot = Template.bind({});
|
|
209
|
-
WithLabelSlot.args = {
|
|
210
|
-
...Default.args,
|
|
211
|
-
label: '<or-icon icon="storage" /> Storage',
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
export const ScopedSlots = Template.bind({});
|
|
215
|
-
ScopedSlots.args = {
|
|
216
|
-
...WithValue.args,
|
|
217
|
-
label: 'Service',
|
|
218
|
-
percent: '{{value}} used',
|
|
219
|
-
footer: '<b>{{value}}</b> of {{args.maxValue}} Mb',
|
|
220
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { action } from '@storybook/addon-actions';
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/vue3';
|
|
3
|
-
import { ref, watch } from 'vue-demi';
|
|
4
|
-
import OrRadioGroup from './OrRadioGroup.vue';
|
|
5
|
-
import { FormGroupDirection } from '../or-form-group-v3';
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: 'Components/Radio/Group',
|
|
9
|
-
component: OrRadioGroup,
|
|
10
|
-
|
|
11
|
-
argTypes: {
|
|
12
|
-
options: {
|
|
13
|
-
control: { type: 'object' },
|
|
14
|
-
},
|
|
15
|
-
direction: {
|
|
16
|
-
control: { type: 'select' },
|
|
17
|
-
options: Object.values(FormGroupDirection),
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
parameters: {
|
|
22
|
-
layout: 'centered',
|
|
23
|
-
},
|
|
24
|
-
} as Meta<typeof OrRadioGroup>;
|
|
25
|
-
|
|
26
|
-
const Template: StoryFn<typeof OrRadioGroup> = (args) => ({
|
|
27
|
-
components: {
|
|
28
|
-
OrRadioGroup,
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
setup() {
|
|
32
|
-
// State
|
|
33
|
-
const model = ref<string>();
|
|
34
|
-
|
|
35
|
-
// Effects
|
|
36
|
-
watch(model, (value) => {
|
|
37
|
-
console.debug(value);
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
return {
|
|
41
|
-
args,
|
|
42
|
-
model,
|
|
43
|
-
onUpdateModelValue: action('update:modelValue'),
|
|
44
|
-
};
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
template: `
|
|
48
|
-
<div class="contents">
|
|
49
|
-
<OrRadioGroup
|
|
50
|
-
v-model="model"
|
|
51
|
-
v-bind="args"
|
|
52
|
-
@update:modelValue="onUpdateModelValue"
|
|
53
|
-
/>
|
|
54
|
-
</div>
|
|
55
|
-
`,
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
export const Group = Template.bind({});
|
|
59
|
-
|
|
60
|
-
Group.args = {
|
|
61
|
-
label: 'Radio Group',
|
|
62
|
-
options: [
|
|
63
|
-
{
|
|
64
|
-
label: 'Radio 1',
|
|
65
|
-
value: 'radio-1',
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
label: 'Radio 2',
|
|
69
|
-
value: 'radio-2',
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
label: 'Radio 3',
|
|
73
|
-
value: 'radio-3',
|
|
74
|
-
disabled: true,
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
label: 'Radio 4',
|
|
78
|
-
value: 'radio-4',
|
|
79
|
-
},
|
|
80
|
-
],
|
|
81
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { DocsPage } from '@storybook/addon-docs';
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { OrRadioV3 as OrRadio } from '@onereach/ui-components';
|
|
5
|
-
```
|
|
6
|
-
|
|
7
|
-
<DocsPage />
|
|
8
|
-
|
|
9
|
-
## Migration Guide from V1
|
|
10
|
-
- property `isDisabled` renamed to `disabled`
|
|
11
|
-
- removed property `isUncheckable`
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { action } from '@storybook/addon-actions';
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/vue3';
|
|
3
|
-
import { ref, watch } from 'vue-demi';
|
|
4
|
-
import { OrIconV3 as OrIcon } from '../or-icon-v3';
|
|
5
|
-
import { LabelVariant } from '../or-label-v3';
|
|
6
|
-
import OrRadioDocs from './OrRadio.docs.mdx';
|
|
7
|
-
import OrRadio from './OrRadio.vue';
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
title: 'Components/Radio',
|
|
11
|
-
component: OrRadio,
|
|
12
|
-
|
|
13
|
-
argTypes: {
|
|
14
|
-
// Slots
|
|
15
|
-
addon: {
|
|
16
|
-
type: {
|
|
17
|
-
name: 'string',
|
|
18
|
-
required: false,
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
control: { type: 'text' },
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
// Props
|
|
25
|
-
modelValue: {
|
|
26
|
-
control: { type: 'text' },
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
value: {
|
|
30
|
-
control: { type: 'text' },
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
label: {
|
|
34
|
-
control: { type: 'text' },
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
labelVariant: {
|
|
38
|
-
control: { type: 'select' },
|
|
39
|
-
options: Object.values(LabelVariant),
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
required: {
|
|
43
|
-
control: { type: 'boolean' },
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
disabled: {
|
|
47
|
-
control: { type: 'boolean' },
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
// Events
|
|
51
|
-
'update:modelValue': {
|
|
52
|
-
table: { disable: true },
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
input: {
|
|
56
|
-
table: { disable: true },
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
focus: {
|
|
60
|
-
table: { disable: true },
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
blur: {
|
|
64
|
-
table: { disable: true },
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
parameters: {
|
|
69
|
-
layout: 'centered',
|
|
70
|
-
|
|
71
|
-
docs: {
|
|
72
|
-
page: OrRadioDocs,
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
design: {
|
|
76
|
-
type: 'figma',
|
|
77
|
-
url: 'https://www.figma.com/file/o7DdkaznUW2PtX4wiSuhhQ/Core?node-id=202%3A13',
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
decorators: [
|
|
82
|
-
() => ({
|
|
83
|
-
template: `
|
|
84
|
-
<div class="flex flex-col gap-sm">
|
|
85
|
-
<story />
|
|
86
|
-
</div>
|
|
87
|
-
`,
|
|
88
|
-
}),
|
|
89
|
-
],
|
|
90
|
-
} as Meta<typeof OrRadio>;
|
|
91
|
-
|
|
92
|
-
const Template: StoryFn<typeof OrRadio> = (args) => ({
|
|
93
|
-
components: {
|
|
94
|
-
OrIcon,
|
|
95
|
-
OrRadio,
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
setup() {
|
|
99
|
-
// State
|
|
100
|
-
const model = ref<string>();
|
|
101
|
-
|
|
102
|
-
// Effects
|
|
103
|
-
watch(model, (value) => {
|
|
104
|
-
console.debug(value);
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
return {
|
|
108
|
-
args,
|
|
109
|
-
model,
|
|
110
|
-
onUpdateModelValue: action('update:modelValue'),
|
|
111
|
-
onFocus: action('focus'),
|
|
112
|
-
onBlur: action('blur'),
|
|
113
|
-
};
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
template: `
|
|
117
|
-
<div class="contents">
|
|
118
|
-
<OrRadio
|
|
119
|
-
v-model="model"
|
|
120
|
-
v-bind="args"
|
|
121
|
-
@update:modelValue="onUpdateModelValue"
|
|
122
|
-
@focus="onFocus"
|
|
123
|
-
@blur="onBlur"
|
|
124
|
-
>
|
|
125
|
-
<template #addon>
|
|
126
|
-
${args.addon}
|
|
127
|
-
</template>
|
|
128
|
-
</OrRadio>
|
|
129
|
-
|
|
130
|
-
<OrRadio
|
|
131
|
-
v-model="model"
|
|
132
|
-
value="radio-2"
|
|
133
|
-
label="Radio 2"
|
|
134
|
-
@update:modelValue="onUpdateModelValue"
|
|
135
|
-
@focus="onFocus"
|
|
136
|
-
@blur="onBlur"
|
|
137
|
-
/>
|
|
138
|
-
</div>
|
|
139
|
-
`,
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
export const Radio = Template.bind({});
|
|
143
|
-
|
|
144
|
-
Radio.args = {
|
|
145
|
-
// Slots
|
|
146
|
-
addon: '<OrIcon icon="info" />',
|
|
147
|
-
|
|
148
|
-
// Props
|
|
149
|
-
value: 'radio-1',
|
|
150
|
-
label: 'Radio 1',
|
|
151
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { DocsPage } from '@storybook/addon-docs';
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { OrSearchV3 as OrSearch } from '@onereach/ui-components';
|
|
5
|
-
```
|
|
6
|
-
|
|
7
|
-
<DocsPage />
|
|
8
|
-
|
|
9
|
-
## Migration Guide from V1
|
|
10
|
-
- property `isDisabled` renamed to `disabled`
|
|
11
|
-
- property `isSmall` replaced with `size`
|
|
12
|
-
- removed properties `htmlId`, `htmlInputAttrs` and `maxLength` (now attributes are forwarded directly to the input)
|
|
13
|
-
- removed properties `isReadonly`, `isInvalid`, `htmlType`, `isRequired`, `label`, `modelValue`, `error` and `hint`
|
|
14
|
-
- removed `update:modelValue` event
|
|
15
|
-
- removed property `isUsingTrim` - trim is used by default
|
|
16
|
-
- added `focus` and `clear` methods
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { action } from '@storybook/addon-actions';
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/vue3';
|
|
3
|
-
import OrSearchDocs from './OrSearch.docs.mdx';
|
|
4
|
-
import OrSearch from './OrSearch.vue';
|
|
5
|
-
import { SearchSize } from './props';
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: 'Components/Search',
|
|
9
|
-
component: OrSearch,
|
|
10
|
-
|
|
11
|
-
argTypes: {
|
|
12
|
-
// Attrs
|
|
13
|
-
id: {
|
|
14
|
-
control: { type: 'text' },
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
readonly: {
|
|
18
|
-
control: { type: 'boolean' },
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
maxlength: {
|
|
22
|
-
control: { type: 'number' },
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
// Props
|
|
26
|
-
size: {
|
|
27
|
-
control: { type: 'select' },
|
|
28
|
-
options: Object.values(SearchSize),
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
placeholder: {
|
|
32
|
-
control: { type: 'text' },
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
debounce: {
|
|
36
|
-
control: { type: 'number' },
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
disabled: {
|
|
40
|
-
control: { type: 'boolean' },
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
autocomplete: {
|
|
44
|
-
control: { type: 'text' },
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
disableDefaultStyles: {
|
|
48
|
-
control: { type: 'boolean' },
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
// Events
|
|
52
|
-
search: {
|
|
53
|
-
table: { disable: true },
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
input: {
|
|
57
|
-
table: { disable: true },
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
keydown: {
|
|
61
|
-
table: { disable: true },
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
keyup: {
|
|
65
|
-
table: { disable: true },
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
focus: {
|
|
69
|
-
table: { disable: true },
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
blur: {
|
|
73
|
-
table: { disable: true },
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
clear: {
|
|
77
|
-
table: { disable: true },
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
parameters: {
|
|
82
|
-
layout: 'centered',
|
|
83
|
-
|
|
84
|
-
docs: {
|
|
85
|
-
page: OrSearchDocs,
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
} as Meta<typeof OrSearch>;
|
|
89
|
-
|
|
90
|
-
const Template: StoryFn<typeof OrSearch> = (args) => ({
|
|
91
|
-
components: {
|
|
92
|
-
OrSearch,
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
setup() {
|
|
96
|
-
return {
|
|
97
|
-
args,
|
|
98
|
-
onSearch: action('search'),
|
|
99
|
-
onKeydown: action('keydown'),
|
|
100
|
-
onKeyup: action('keyup'),
|
|
101
|
-
onFocus: action('focus'),
|
|
102
|
-
onBlur: action('blur'),
|
|
103
|
-
onClear: action('clear'),
|
|
104
|
-
};
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
template: `
|
|
108
|
-
<OrSearch
|
|
109
|
-
v-bind="args"
|
|
110
|
-
style="min-width: 150px"
|
|
111
|
-
@search="onSearch"
|
|
112
|
-
@keydown="onKeydown"
|
|
113
|
-
@keyup="onKeyup"
|
|
114
|
-
@focus="onFocus"
|
|
115
|
-
@blur="onBlur"
|
|
116
|
-
@clear="onClear"
|
|
117
|
-
/>
|
|
118
|
-
`,
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
export const Search = Template.bind({});
|
|
122
|
-
|
|
123
|
-
Search.args = {
|
|
124
|
-
// Props
|
|
125
|
-
placeholder: 'Search',
|
|
126
|
-
};
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { action } from '@storybook/addon-actions';
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/vue3';
|
|
3
|
-
import { ref, watch } from 'vue-demi';
|
|
4
|
-
import OrSegmentedControlDocs from './OrSegmentedControl.docs.mdx';
|
|
5
|
-
import OrSegmentedControl from './OrSegmentedControl.vue';
|
|
6
|
-
import { SegmentedControlSize } from './props';
|
|
7
|
-
import { SegmentedControlOption } from './types';
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
title: 'Components/Segmented Control',
|
|
11
|
-
component: OrSegmentedControl,
|
|
12
|
-
|
|
13
|
-
argTypes: {
|
|
14
|
-
// Props
|
|
15
|
-
options: {
|
|
16
|
-
control: { type: 'object' },
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
modelValue: {
|
|
20
|
-
control: { type: 'text' },
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
size: {
|
|
24
|
-
control: { type: 'select' },
|
|
25
|
-
options: Object.values(SegmentedControlSize),
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
disabled: {
|
|
29
|
-
control: { type: 'boolean' },
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
// Events
|
|
33
|
-
'update:modelValue': {
|
|
34
|
-
table: { disable: true },
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
input: {
|
|
38
|
-
table: { disable: true },
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
parameters: {
|
|
43
|
-
layout: 'centered',
|
|
44
|
-
|
|
45
|
-
docs: {
|
|
46
|
-
page: OrSegmentedControlDocs,
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
design: {
|
|
50
|
-
type: 'figma',
|
|
51
|
-
url: 'https://www.figma.com/file/o7DdkaznUW2PtX4wiSuhhQ/Core?node-id=410%3A2097&t=7N93DAotOYMOX2kx-1',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
} as Meta<typeof OrSegmentedControl>;
|
|
55
|
-
|
|
56
|
-
const Template: StoryFn<typeof OrSegmentedControl> = (args) => ({
|
|
57
|
-
components: {
|
|
58
|
-
OrSegmentedControl,
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
setup() {
|
|
62
|
-
// State
|
|
63
|
-
const model = ref<string>();
|
|
64
|
-
|
|
65
|
-
// Effects
|
|
66
|
-
watch(model, (value) => {
|
|
67
|
-
console.debug(value);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
return {
|
|
71
|
-
args,
|
|
72
|
-
model,
|
|
73
|
-
onUpdateModelValue: action('update:modelValue'),
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
template: `
|
|
78
|
-
<OrSegmentedControl
|
|
79
|
-
v-model="model"
|
|
80
|
-
v-bind="args"
|
|
81
|
-
@update:modelValue="onUpdateModelValue"
|
|
82
|
-
/>
|
|
83
|
-
`,
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
export const Default = Template.bind({});
|
|
87
|
-
|
|
88
|
-
Default.args = {
|
|
89
|
-
// Props
|
|
90
|
-
options: Array.from<string, SegmentedControlOption>([
|
|
91
|
-
'Alfa',
|
|
92
|
-
'Bravo',
|
|
93
|
-
'Charlie',
|
|
94
|
-
'Delta',
|
|
95
|
-
'Echo',
|
|
96
|
-
], (item) => ({
|
|
97
|
-
value: item.toLowerCase(),
|
|
98
|
-
label: item,
|
|
99
|
-
})),
|
|
100
|
-
};
|