How to use the storybook/updateKnob function in storybook

To help you get started, we’ve selected a few storybook examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kupibilet-frontend / ui / src / components / Radio / stories.js View on Github external
const onChange = (value) => {
  updateKnob('selectedValue', 'text', value)
}
github kupibilet-frontend / ui / src / components / DateRange / stories.js View on Github external
const onDatesChange = ({ startDate, endDate }) => {
  updateKnob('startDate', 'date', startDate || null)
  updateKnob('endDate', 'date', endDate || null)
}
github kupibilet-frontend / ui / src / components / Toggler / stories.js View on Github external
const onChange = (value) => {
  updateKnob('currentValue', 'text', value)
}
github kupibilet-frontend / ui / src / components / Dropdown / stories.js View on Github external
const onToggle = (event, value) => {
      event.preventDefault()
      updateKnob('isOpen', 'boolean', value)
    }
github kupibilet-frontend / ui / src / blocks / Tabs / stories.js View on Github external
const onTabChange = (key) => {
  updateKnob('activeKey', 'text', key)
}
github kupibilet-frontend / ui / src / components / DateRange / stories.js View on Github external
const onDatesChange = ({ startDate, endDate }) => {
  updateKnob('startDate', 'date', startDate || null)
  updateKnob('endDate', 'date', endDate || null)
}
github kupibilet-frontend / ui / src / components / PriceVariantsButton / stories.js View on Github external
const onClick = (index) => updateKnob('active', 'number', index)
github kupibilet-frontend / ui / src / components / NavBar / stories.js View on Github external
const onClick = (i) => updateKnob('activeKey', 'number', i)
github kupibilet-frontend / ui / src / components / Select / stories.js View on Github external
const onSuggestionMultiSelected = (event, { suggestion: { value } }) => {
  const suggestionsFilter = array('suggestionsFilter', [])
  const nextSuggestionsFilter = suggestionsFilter.includes(value)
    ? suggestionsFilter.filter((item) => item !== value)
    : [...suggestionsFilter, value]

  updateKnob('suggestionsFilter', 'array', nextSuggestionsFilter)
  updateKnob('placeholder', 'text', `${nextSuggestionsFilter.length} suggestions selected`)
}
github kupibilet-frontend / ui / src / components / DateRange / stories.js View on Github external
const onFocusChange = (focusedInput) => {
  updateKnob('focusedInput', 'select', focusedInput || 'none')
}