diff --git a/superset-frontend/src/components/Select/AntdSelect.stories.tsx b/superset-frontend/src/components/Select/AntdSelect.stories.tsx new file mode 100644 index 0000000000..e26588ad99 --- /dev/null +++ b/superset-frontend/src/components/Select/AntdSelect.stories.tsx @@ -0,0 +1,244 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import React from 'react'; +import Select, { OptionsType, SelectProps } from './AntdSelect'; + +export default { + title: 'Select', + component: Select, +}; + +const options = [ + { + label: 'Such an incredibly awesome long long label', + value: 'Such an incredibly awesome long long label', + }, + { + label: 'Another incredibly awesome long long label', + value: 'Another incredibly awesome long long label', + }, + { label: 'Just a label', value: 'Just a label' }, + { label: 'A', value: 'A' }, + { label: 'B', value: 'B' }, + { label: 'C', value: 'C' }, + { label: 'D', value: 'D' }, + { label: 'E', value: 'E' }, + { label: 'F', value: 'F' }, + { label: 'G', value: 'G' }, + { label: 'H', value: 'H' }, + { label: 'I', value: 'I' }, +]; + +const selectPositions = [ + { + id: 'topLeft', + style: { top: '0', left: '0' }, + }, + { + id: 'topRight', + style: { top: '0', right: '0' }, + }, + { + id: 'bottomLeft', + style: { bottom: '0', left: '0' }, + }, + { + id: 'bottomRight', + style: { bottom: '0', right: '0' }, + }, +]; + +export const AtEveryCorner = () => ( + <> + {selectPositions.map(position => ( +
+ +); + +AsyncSelect.args = { + withError: false, + allowNewOptions: false, + paginatedFetch: false, +}; + +AsyncSelect.argTypes = { + mode: { + control: { type: 'select', options: ['single', 'multiple', 'tags'] }, + }, +}; + +AsyncSelect.story = { + parameters: { + knobs: { + disable: true, + }, + }, +}; + +export const InteractiveSelect = (args: SelectProps) =>