Skip to content

Commit

Permalink
Merge pull request #15788 from storybookjs/remove_array_control
Browse files Browse the repository at this point in the history
Controls: Remove ArrayControl
  • Loading branch information
shilman committed Aug 8, 2021
2 parents 806547a + f011a67 commit f9f3256
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 103 deletions.
6 changes: 0 additions & 6 deletions app/server/src/client/preview/render.ts
Expand Up @@ -28,12 +28,6 @@ const buildStoryArgs = (args: Args, argTypes: ArgTypes) => {
// For cross framework & language support we pick a consistent representation of Dates as strings
storyArgs[key] = new Date(argValue).toISOString();
break;
case 'array': {
// use the supplied separator when serializing an array as a string
const separator = control.separator || ',';
storyArgs[key] = argValue.join(separator);
break;
}
case 'object':
// send objects as JSON strings
storyArgs[key] = JSON.stringify(argValue);
Expand Down
4 changes: 2 additions & 2 deletions examples/server-kitchen-sink/views/addons/controls/all.pug
Expand Up @@ -5,8 +5,8 @@
- dateOptions = { year: 'numeric', month: 'long', day: 'numeric', timeZone: 'UTC' };
- style = `border: 2px dotted ${colour}; padding: 8px 22px; border-radius: 8px`;
- today = new Date(today);
- items = items.split(',');
- other = JSON.parse(other)
- items = JSON.parse(tems);
- other = JSON.parse(other);

div(style=`${style}`)
h1 My name is #{name},
Expand Down
28 changes: 0 additions & 28 deletions lib/components/src/controls/Array.stories.tsx

This file was deleted.

60 changes: 0 additions & 60 deletions lib/components/src/controls/Array.tsx

This file was deleted.

1 change: 0 additions & 1 deletion lib/components/src/controls/index.tsx
Expand Up @@ -2,7 +2,6 @@ import React, { Suspense } from 'react';

export * from './types';

export * from './Array';
export * from './Boolean';
export type { ColorProps } from './Color';

Expand Down
6 changes: 0 additions & 6 deletions lib/components/src/controls/types.ts
Expand Up @@ -11,11 +11,6 @@ export interface ControlProps<T> {
onBlur?: (evt: any) => void;
}

export type ArrayValue = string[] | readonly string[];
export interface ArrayConfig {
separator?: string;
}

export type BooleanValue = boolean;
export interface BooleanConfig {}

Expand Down Expand Up @@ -80,7 +75,6 @@ export type ControlType =
| 'text';

export type Control =
| ArrayConfig
| BooleanConfig
| ColorConfig
| DateConfig
Expand Down

0 comments on commit f9f3256

Please sign in to comment.