File tree Expand file tree Collapse file tree 1 file changed +93
-0
lines changed
shared/aries-core/src/stories/components Expand file tree Collapse file tree 1 file changed +93
-0
lines changed Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import type { Meta , StoryObj } from '@storybook/react' ;
3+ import { Data , DataFilter , DataFilters , DataTable } from 'grommet' ;
4+
5+ const meta = {
6+ title : 'Components/DataFilters' ,
7+ component : DataFilters ,
8+ argTypes : {
9+ clearFilters : {
10+ control : { type : 'boolean' } ,
11+ } ,
12+ drop : {
13+ control : { type : 'boolean' } ,
14+ } ,
15+ heading : {
16+ control : { type : 'text' } ,
17+ } ,
18+ layer : {
19+ control : { type : 'boolean' } ,
20+ } ,
21+ } ,
22+ } satisfies Meta < typeof DataFilters > ;
23+
24+ export default meta ;
25+ type Story = StoryObj < typeof meta > ;
26+
27+ export const Default = {
28+ name : 'DataFilters' ,
29+ render : args => (
30+ < Data
31+ data = { [
32+ {
33+ name : 'Bryan' ,
34+ location : 'Fort Collins' ,
35+ date : '2018-06-10' ,
36+ percent : 30 ,
37+ paid : 1234 ,
38+ } ,
39+ {
40+ name : 'Chris' ,
41+ location : 'Palo Alto' ,
42+ date : '2018-06-09' ,
43+ percent : 40 ,
44+ paid : 2345 ,
45+ } ,
46+ {
47+ name : 'Eric' ,
48+ location : 'Palo Alto' ,
49+ date : '2018-06-11' ,
50+ percent : 80 ,
51+ paid : 3456 ,
52+ } ,
53+ ] }
54+ >
55+ < DataFilters { ...args } >
56+ < DataFilter property = "name" />
57+ < DataFilter property = "location" />
58+ < DataFilter property = "percent" />
59+ < DataFilter property = "paid" />
60+ </ DataFilters >
61+ < DataTable
62+ columns = { [
63+ {
64+ property : 'name' ,
65+ header : 'Name' ,
66+ } ,
67+ {
68+ property : 'location' ,
69+ header : 'Location' ,
70+ } ,
71+ {
72+ property : 'date' ,
73+ header : 'Date' ,
74+ } ,
75+ {
76+ property : 'percent' ,
77+ header : 'Percent' ,
78+ } ,
79+ {
80+ property : 'paid' ,
81+ header : 'Paid' ,
82+ } ,
83+ ] }
84+ />
85+ </ Data >
86+ ) ,
87+ args : {
88+ clearFilters : false ,
89+ drop : false ,
90+ heading : 'Filters' ,
91+ layer : true ,
92+ } ,
93+ } satisfies Story ;
You can’t perform that action at this time.
0 commit comments