@takaro/lib-components 0.4.0 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/actions/Button/Button.stories.tsx +49 -33
- package/src/components/actions/Button/__snapshots__/Button.test.tsx.snap +1 -1
- package/src/components/actions/ContextMenu/ContextMenu.stories.tsx +1 -0
- package/src/components/actions/ContextMenu/index.tsx +3 -2
- package/src/components/actions/DropdownButton/DropdownButton.stories.tsx +7 -7
- package/src/components/actions/IconButton/__snapshots__/IconButton.test.tsx.snap +1 -1
- package/src/components/data/Chip/__snapshots__/Chip.test.tsx.snap +4 -4
- package/src/components/data/Drawer/Drawer.stories.tsx +7 -3
- package/src/components/data/Stats/Stat.tsx +104 -25
- package/src/components/data/Stats/Stats.stories.tsx +135 -11
- package/src/components/data/Stats/context.tsx +10 -3
- package/src/components/data/Stats/index.tsx +16 -9
- package/src/components/dialogs/Dialog/Dialog.stories.tsx +8 -4
- package/src/components/feedback/Alert/Alert.stories.tsx +7 -0
- package/src/components/feedback/Alert/__snapshots__/Alert.test.tsx.snap +6 -4
- package/src/components/feedback/Alert/index.tsx +24 -14
- package/src/components/feedback/Alert/style.ts +23 -15
- package/src/components/feedback/Tooltip/Tooltip.stories.tsx +1 -1
- package/src/components/feedback/snacks/Default/default.stories.tsx +6 -5
- package/src/components/feedback/snacks/Drawer/Drawer.stories.tsx +1 -1
- package/src/components/inputs/CheckBox/CheckBox.stories.tsx +1 -1
- package/src/components/inputs/CodeField/CodeField.stories.tsx +1 -1
- package/src/components/inputs/Date/DatePicker/DatePicker.stories.tsx +6 -6
- package/src/components/inputs/FileField/FileField.stories.tsx +3 -4
- package/src/components/inputs/RadioGroup/RadioGroup.stories.tsx +1 -1
- package/src/components/inputs/Switch/Switch.stories.tsx +1 -1
- package/src/components/inputs/TagField/TagField.stories.tsx +1 -1
- package/src/components/inputs/TextAreaField/TextAreaField.stories.tsx +3 -1
- package/src/components/inputs/TextField/TextField.stories.tsx +3 -1
- package/src/components/inputs/ValueConfirmationField/ValueConfirmationField.stories.tsx +1 -1
- package/src/components/inputs/selects/SelectField/SelectField.stories.tsx +2 -2
- package/src/components/inputs/selects/SelectQueryField/SelectQueryField.stories.tsx +3 -3
- package/src/components/navigation/Steppers/SlimStepper/Stepper.stories.tsx +14 -14
- package/src/components/navigation/Steppers/Stepper/Stepper.stories.tsx +8 -8
- package/src/components/other/ActionMenu/ActionMenu.stories.tsx +0 -4
- package/src/components/other/Empty/Empty.stories.tsx +5 -1
- package/src/components/other/PermissionsGuard/PermissionsGuard.stories.tsx +3 -2
|
@@ -56,10 +56,9 @@ export const OnSubmit: StoryFn<FileFieldProps> = (args) => {
|
|
|
56
56
|
|
|
57
57
|
return (
|
|
58
58
|
<>
|
|
59
|
-
<Alert
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
/>
|
|
59
|
+
<Alert variant="warning">
|
|
60
|
+
Although the upload could be limited to a single file, the returned type will always be a FileList.
|
|
61
|
+
</Alert>
|
|
63
62
|
<form onSubmit={handleSubmit(onSubmit)}>
|
|
64
63
|
<FileField
|
|
65
64
|
name="profileImage"
|
|
@@ -59,7 +59,7 @@ export const OnSubmit: StoryFn<SwitchProps> = (args) => {
|
|
|
59
59
|
required={args.required}
|
|
60
60
|
readOnly={args.readOnly}
|
|
61
61
|
/>
|
|
62
|
-
<Button type="submit"
|
|
62
|
+
<Button type="submit">submit</Button>
|
|
63
63
|
</form>
|
|
64
64
|
submitted value: {value ? 'true' : 'false'}
|
|
65
65
|
</>
|
|
@@ -48,7 +48,7 @@ export const OnSubmit: StoryFn<TagFieldProps> = (args) => {
|
|
|
48
48
|
<pre>paste tester: apple,banana,jeroen</pre>
|
|
49
49
|
<form onSubmit={handleSubmit(onSubmit)}>
|
|
50
50
|
<TagField {...args} tagValidationSchema={beforeAddValidationSchema} control={control} name="tags" />
|
|
51
|
-
<Button type="submit"
|
|
51
|
+
<Button type="submit">Submit</Button>
|
|
52
52
|
</form>
|
|
53
53
|
<pre>result: {result.join(', ')}</pre>
|
|
54
54
|
</div>
|
|
@@ -89,7 +89,9 @@ export const OnSubmit: StoryFn<TextAreaFieldProps> = (args) => {
|
|
|
89
89
|
required={args.required}
|
|
90
90
|
hint={args.hint}
|
|
91
91
|
/>
|
|
92
|
-
<Button type="submit"
|
|
92
|
+
<Button type="submit" size="large">
|
|
93
|
+
Submit form
|
|
94
|
+
</Button>
|
|
93
95
|
</form>
|
|
94
96
|
<pre>result: {result}</pre>
|
|
95
97
|
</Wrapper>
|
|
@@ -138,7 +138,9 @@ export const OnSubmit: StoryFn<TextFieldProps> = (args) => {
|
|
|
138
138
|
disabled={args.disabled}
|
|
139
139
|
description={args.description}
|
|
140
140
|
/>
|
|
141
|
-
<Button type="submit"
|
|
141
|
+
<Button type="submit" size="large">
|
|
142
|
+
Submit form
|
|
143
|
+
</Button>
|
|
142
144
|
</form>
|
|
143
145
|
<p>result: {result}</p>
|
|
144
146
|
</Wrapper>
|
|
@@ -25,7 +25,7 @@ export const OnChange: StoryFn<ValueConfirmationFieldProps> = (args) => {
|
|
|
25
25
|
<strong>{args.value}</strong> to confirm
|
|
26
26
|
</p>
|
|
27
27
|
<ValueConfirmationField id={args.id} onValidChange={(valid) => setValid(valid)} value={args.value} />
|
|
28
|
-
<Button disabled={valid}
|
|
28
|
+
<Button disabled={valid}>Confirm</Button>
|
|
29
29
|
</Dialog.Body>
|
|
30
30
|
</Dialog.Content>
|
|
31
31
|
</Dialog>
|
|
@@ -134,7 +134,7 @@ export const OnSubmit: StoryFn<SelectFieldProps> = (args) => {
|
|
|
134
134
|
))}
|
|
135
135
|
</SelectField.OptionGroup>
|
|
136
136
|
</SelectField>
|
|
137
|
-
<Button type="submit"
|
|
137
|
+
<Button type="submit">Submit</Button>
|
|
138
138
|
</form>
|
|
139
139
|
<pre>result: {result}</pre>
|
|
140
140
|
</>
|
|
@@ -200,7 +200,7 @@ export const MultiSelect: StoryFn<SelectFieldProps> = (args) => {
|
|
|
200
200
|
))}
|
|
201
201
|
</SelectField.OptionGroup>
|
|
202
202
|
</SelectField>
|
|
203
|
-
<Button type="submit"
|
|
203
|
+
<Button type="submit">Submit</Button>
|
|
204
204
|
</form>
|
|
205
205
|
<pre>result: {result}</pre>
|
|
206
206
|
</>
|
|
@@ -88,7 +88,7 @@ export const ServerSideSubmit: StoryFn<SelectQueryFieldProps> = (args) => {
|
|
|
88
88
|
))}
|
|
89
89
|
</SelectQueryField.OptionGroup>
|
|
90
90
|
</SelectQueryField>
|
|
91
|
-
<Button type="submit"
|
|
91
|
+
<Button type="submit">Submit form</Button>
|
|
92
92
|
</form>
|
|
93
93
|
This is the submitted value:
|
|
94
94
|
<div>{result}</div>
|
|
@@ -148,7 +148,7 @@ export const ClientSideSubmit: StoryFn<SelectQueryFieldProps> = (args) => {
|
|
|
148
148
|
))}
|
|
149
149
|
</SelectQueryField.OptionGroup>
|
|
150
150
|
</SelectQueryField>
|
|
151
|
-
<Button type="submit"
|
|
151
|
+
<Button type="submit">Submit form</Button>
|
|
152
152
|
</form>
|
|
153
153
|
The result returns the decade of the film:
|
|
154
154
|
<div>{result}</div>
|
|
@@ -216,7 +216,7 @@ export const ClientSideMultiSelectSubmit: StoryFn<SelectQueryFieldProps> = (args
|
|
|
216
216
|
))}
|
|
217
217
|
</SelectQueryField.OptionGroup>
|
|
218
218
|
</SelectQueryField>
|
|
219
|
-
<Button type="submit"
|
|
219
|
+
<Button type="submit">Submit form</Button>
|
|
220
220
|
</form>
|
|
221
221
|
Selected films:
|
|
222
222
|
<div>{result && result.join(',')}</div>
|
|
@@ -33,55 +33,55 @@ export const Numbers: StoryFn = () => {
|
|
|
33
33
|
<SlimStepper.Step id="first" name="step 1">
|
|
34
34
|
<StepBody>
|
|
35
35
|
<p>Step 1</p>
|
|
36
|
-
<Button onClick={incrementCurrentStep}
|
|
36
|
+
<Button onClick={incrementCurrentStep}>Next step</Button>
|
|
37
37
|
</StepBody>
|
|
38
38
|
</SlimStepper.Step>
|
|
39
39
|
<SlimStepper.Step id="second" name="step 2">
|
|
40
40
|
<StepBody>
|
|
41
41
|
<p>Step 2</p>
|
|
42
|
-
<Button onClick={decrementCurrentStep}
|
|
43
|
-
<Button onClick={incrementCurrentStep}
|
|
42
|
+
<Button onClick={decrementCurrentStep}>previous step</Button>
|
|
43
|
+
<Button onClick={incrementCurrentStep}>Next step</Button>
|
|
44
44
|
</StepBody>
|
|
45
45
|
</SlimStepper.Step>
|
|
46
46
|
<SlimStepper.Step id="third" name="step 3">
|
|
47
47
|
<StepBody>
|
|
48
48
|
<p>Step 3</p>
|
|
49
|
-
<Button onClick={decrementCurrentStep}
|
|
50
|
-
<Button onClick={incrementCurrentStep}
|
|
49
|
+
<Button onClick={decrementCurrentStep}>Previous step</Button>
|
|
50
|
+
<Button onClick={incrementCurrentStep}>Next step</Button>
|
|
51
51
|
</StepBody>
|
|
52
52
|
</SlimStepper.Step>
|
|
53
53
|
<SlimStepper.Step id="fourth" name="step 4">
|
|
54
54
|
<StepBody>
|
|
55
55
|
<p>Step 4</p>
|
|
56
|
-
<Button onClick={decrementCurrentStep}
|
|
57
|
-
<Button onClick={incrementCurrentStep}
|
|
56
|
+
<Button onClick={decrementCurrentStep}>Previous step</Button>
|
|
57
|
+
<Button onClick={incrementCurrentStep}>Next step</Button>
|
|
58
58
|
</StepBody>
|
|
59
59
|
</SlimStepper.Step>
|
|
60
60
|
<SlimStepper.Step id="fifth" name="step 5">
|
|
61
61
|
<StepBody>
|
|
62
62
|
<p>Step 5</p>
|
|
63
|
-
<Button onClick={decrementCurrentStep}
|
|
64
|
-
<Button onClick={incrementCurrentStep}
|
|
63
|
+
<Button onClick={decrementCurrentStep}>Previous step</Button>
|
|
64
|
+
<Button onClick={incrementCurrentStep}>Next step</Button>
|
|
65
65
|
</StepBody>
|
|
66
66
|
</SlimStepper.Step>
|
|
67
67
|
<SlimStepper.Step id="sixth" name="step 6">
|
|
68
68
|
<StepBody>
|
|
69
69
|
<p>Step 6</p>
|
|
70
|
-
<Button onClick={decrementCurrentStep}
|
|
71
|
-
<Button onClick={incrementCurrentStep}
|
|
70
|
+
<Button onClick={decrementCurrentStep}>Previous step</Button>
|
|
71
|
+
<Button onClick={incrementCurrentStep}>Next step</Button>
|
|
72
72
|
</StepBody>
|
|
73
73
|
</SlimStepper.Step>
|
|
74
74
|
<SlimStepper.Step id="seventh" name="step 7">
|
|
75
75
|
<StepBody>
|
|
76
76
|
<p>Step 7</p>
|
|
77
|
-
<Button onClick={decrementCurrentStep}
|
|
78
|
-
<Button onClick={incrementCurrentStep}
|
|
77
|
+
<Button onClick={decrementCurrentStep}>Previous step</Button>
|
|
78
|
+
<Button onClick={incrementCurrentStep}>Next step</Button>
|
|
79
79
|
</StepBody>
|
|
80
80
|
</SlimStepper.Step>
|
|
81
81
|
<SlimStepper.Step id="eight" name="step 8">
|
|
82
82
|
<StepBody>
|
|
83
83
|
<p>Step 8</p>
|
|
84
|
-
<Button onClick={decrementCurrentStep}
|
|
84
|
+
<Button onClick={decrementCurrentStep}>Previous step</Button>
|
|
85
85
|
</StepBody>
|
|
86
86
|
</SlimStepper.Step>
|
|
87
87
|
</SlimStepper.Steps>
|
|
@@ -36,20 +36,20 @@ export const Numbers: StoryFn = () => {
|
|
|
36
36
|
<Stepper.Step id="first" name="step 1">
|
|
37
37
|
<StepBody>
|
|
38
38
|
<p>Step 1</p>
|
|
39
|
-
<Button onClick={incrementCurrentStep}
|
|
39
|
+
<Button onClick={incrementCurrentStep}>Next step</Button>
|
|
40
40
|
</StepBody>
|
|
41
41
|
</Stepper.Step>
|
|
42
42
|
<Stepper.Step id="second" name="step 2">
|
|
43
43
|
<StepBody>
|
|
44
44
|
<p>Step 2</p>
|
|
45
|
-
<Button onClick={decrementCurrentStep}
|
|
46
|
-
<Button onClick={incrementCurrentStep}
|
|
45
|
+
<Button onClick={decrementCurrentStep}>previous step</Button>
|
|
46
|
+
<Button onClick={incrementCurrentStep}>Next step</Button>
|
|
47
47
|
</StepBody>
|
|
48
48
|
</Stepper.Step>
|
|
49
49
|
<Stepper.Step id="third" name="step 3">
|
|
50
50
|
<StepBody>
|
|
51
51
|
<p>Step 3</p>
|
|
52
|
-
<Button onClick={decrementCurrentStep}
|
|
52
|
+
<Button onClick={decrementCurrentStep}>Previous step</Button>
|
|
53
53
|
</StepBody>
|
|
54
54
|
</Stepper.Step>
|
|
55
55
|
</Stepper.Steps>
|
|
@@ -66,20 +66,20 @@ export const Icons: StoryFn = () => {
|
|
|
66
66
|
<Stepper.Step icon={<Bell size="24" />} id="first" name="Shopping">
|
|
67
67
|
<StepBody>
|
|
68
68
|
<p>Step 1</p>
|
|
69
|
-
<Button onClick={incrementCurrentStep}
|
|
69
|
+
<Button onClick={incrementCurrentStep}>Next step</Button>
|
|
70
70
|
</StepBody>
|
|
71
71
|
</Stepper.Step>
|
|
72
72
|
<Stepper.Step icon={<Shipping size="24" />} id="second" name="Shipping">
|
|
73
73
|
<StepBody>
|
|
74
74
|
<p>Step 2</p>
|
|
75
|
-
<Button onClick={decrementCurrentStep}
|
|
76
|
-
<Button onClick={incrementCurrentStep}
|
|
75
|
+
<Button onClick={decrementCurrentStep}>previous step</Button>
|
|
76
|
+
<Button onClick={incrementCurrentStep}>Next step</Button>
|
|
77
77
|
</StepBody>
|
|
78
78
|
</Stepper.Step>
|
|
79
79
|
<Stepper.Step icon={<Safety size="24" />} id="third" name="Payment">
|
|
80
80
|
<StepBody>
|
|
81
81
|
<p>Step 3</p>
|
|
82
|
-
<Button onClick={decrementCurrentStep}
|
|
82
|
+
<Button onClick={decrementCurrentStep}>Previous step</Button>
|
|
83
83
|
</StepBody>
|
|
84
84
|
</Stepper.Step>
|
|
85
85
|
</Stepper.Steps>
|
|
@@ -49,7 +49,6 @@ export const Default: StoryFn<ActionMenuProps> = () => {
|
|
|
49
49
|
onClick={() => {
|
|
50
50
|
console.log('action 1 fired');
|
|
51
51
|
}}
|
|
52
|
-
text="action 1"
|
|
53
52
|
>
|
|
54
53
|
action 1
|
|
55
54
|
</Action>
|
|
@@ -57,7 +56,6 @@ export const Default: StoryFn<ActionMenuProps> = () => {
|
|
|
57
56
|
onClick={() => {
|
|
58
57
|
console.log('action 2 fired');
|
|
59
58
|
}}
|
|
60
|
-
text="action 2"
|
|
61
59
|
>
|
|
62
60
|
action 2
|
|
63
61
|
</Action>
|
|
@@ -65,7 +63,6 @@ export const Default: StoryFn<ActionMenuProps> = () => {
|
|
|
65
63
|
onClick={() => {
|
|
66
64
|
console.log('action 3 fired');
|
|
67
65
|
}}
|
|
68
|
-
text="action 3"
|
|
69
66
|
>
|
|
70
67
|
action 3
|
|
71
68
|
</Action>
|
|
@@ -73,7 +70,6 @@ export const Default: StoryFn<ActionMenuProps> = () => {
|
|
|
73
70
|
onClick={() => {
|
|
74
71
|
console.log('action 4 fired');
|
|
75
72
|
}}
|
|
76
|
-
text="action 4"
|
|
77
73
|
>
|
|
78
74
|
action 4
|
|
79
75
|
</Action>
|
|
@@ -10,7 +10,11 @@ export default {
|
|
|
10
10
|
args: {
|
|
11
11
|
header: 'Earn recurring revenue',
|
|
12
12
|
description: 'Subscriptions allow you to grow recurring revenue by charging subscribers on a regular basis',
|
|
13
|
-
actions: [
|
|
13
|
+
actions: [
|
|
14
|
+
<Button key="new-project-button " size="medium" icon={<AddIcon />}>
|
|
15
|
+
New project
|
|
16
|
+
</Button>,
|
|
17
|
+
],
|
|
14
18
|
size: 'medium',
|
|
15
19
|
},
|
|
16
20
|
} as Meta<EmptyProps>;
|
|
@@ -12,8 +12,9 @@ export default {
|
|
|
12
12
|
<div>
|
|
13
13
|
<Alert
|
|
14
14
|
variant="warning"
|
|
15
|
-
text="It is unlikely you will use THIS permissionguard directly. There should be a specific permissionguard in web-*
|
|
16
|
-
|
|
15
|
+
text="It is unlikely you will use THIS permissionguard directly. There should be a specific permissionguard in web-*
|
|
16
|
+
application"
|
|
17
|
+
></Alert>
|
|
17
18
|
{story()}
|
|
18
19
|
</div>
|
|
19
20
|
),
|