Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
docs(input): fix input type knob
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod committed Feb 4, 2022
1 parent 937478a commit d6ee05b
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/components/input/stories/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license
*
* Copyright IBM Corp. 2019, 2020
* Copyright IBM Corp. 2019, 2022
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand All @@ -10,21 +10,20 @@
import { action } from '@storybook/addon-actions';
import { INPUT_COLOR_SCHEME, INPUT_SIZE, INPUT_TYPE } from '../input';

const inputTypes = {};
const inputTypes = Object.entries(INPUT_TYPE).reduce(
(acc, [key, val]) => ({
...acc,
[`${key.toLowerCase()}`]: val,
}),
{}
);

const sizes = {
Regular: null,
[`Small size (${INPUT_SIZE.SMALL})`]: INPUT_SIZE.SMALL,
[`Extra large size (${INPUT_SIZE.EXTRA_LARGE})`]: INPUT_SIZE.EXTRA_LARGE,
};

const keys = Object.keys(INPUT_TYPE);
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
const value = keys[key];
inputTypes[key.toLowerCase()] = value;
}

const colorSchemes = {
[`Regular`]: null,
[`Light (${INPUT_COLOR_SCHEME.LIGHT})`]: INPUT_COLOR_SCHEME.LIGHT,
Expand Down

0 comments on commit d6ee05b

Please sign in to comment.