mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-11-13 01:54:16 +01:00
2cc179acc1
- Added searchParams based router for easier testing - Added more stories to the storybook
43 lines
902 B
JavaScript
43 lines
902 B
JavaScript
import React from 'react';
|
|
import FieldFunction from '../src/components/FieldFunction';
|
|
import {action} from '@storybook/addon-actions';
|
|
import {Wrapper} from './ui';
|
|
import {withA11y} from '@storybook/addon-a11y';
|
|
import {latest} from '@mapbox/mapbox-gl-style-spec'
|
|
|
|
|
|
export default {
|
|
title: 'FieldFunction',
|
|
component: FieldFunction,
|
|
decorators: [withA11y],
|
|
};
|
|
|
|
export const Basic = () => {
|
|
const value = {
|
|
"property": "rank",
|
|
"type": "categorical",
|
|
"default": "#222",
|
|
"stops": [
|
|
[
|
|
{"zoom": 6, "value": ""},
|
|
["#777"]
|
|
],
|
|
[
|
|
{"zoom": 10, "value": ""},
|
|
["#444"]
|
|
]
|
|
]
|
|
};
|
|
|
|
return <div style={{width: "360px"}}>
|
|
<FieldFunction
|
|
onChange={() => {}}
|
|
value={value}
|
|
errors={[]}
|
|
fieldName={"Color"}
|
|
fieldType={"color"}
|
|
fieldSpec={latest['paint_fill']['fill-color']}
|
|
/>
|
|
</div>
|
|
};
|
|
|