@thecb/components 9.0.4-beta.5 → 9.0.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "9.0.4-beta.5",
3
+ "version": "9.0.4",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -251,7 +251,6 @@ const FormInput = ({
251
251
  />
252
252
  )}
253
253
  </Box>
254
-
255
254
  <Stack
256
255
  direction="row"
257
256
  justify="space-between"
@@ -264,10 +263,10 @@ const FormInput = ({
264
263
  variant="pXS"
265
264
  weight={themeValues.fontWeight}
266
265
  extraStyles={`word-break: break-word;
267
- font-family: Public Sans;
268
- &::first-letter {
269
- text-transform: uppercase;
270
- }`}
266
+ font-family: Public Sans;
267
+ &::first-letter {
268
+ text-transform: uppercase;
269
+ }`}
271
270
  id={createIdFromString(labelTextWhenNoError, "error message")}
272
271
  >
273
272
  {errorMessages[field.errors[0]]}
@@ -1,146 +0,0 @@
1
- import React from "react";
2
- import { connect } from "react-redux";
3
- import { boolean } from "@storybook/addon-knobs";
4
- import { createFormState, required } from "redux-freeform";
5
- import PartialAmountForm from "./PartialAmountForm";
6
- import page from "../../../../.storybook/page";
7
- import * as PartialAmountFormState from "./PartialAmountForm.state";
8
-
9
- const { mapStateToProps, mapDispatchToProps, reducer } = createFormState({
10
- thing: {
11
- validators: [required()]
12
- }
13
- });
14
- const errorMessages = {
15
- [required.error]: "thing is required"
16
- };
17
- const partialAmountFormFields = {
18
- "3cd98097-1c95-43c6-848a-d44f95d312ec": {
19
- dirty: false,
20
- rawValue: "5000",
21
- validators: [
22
- {
23
- type: "validator/REQUIRED",
24
- args: [],
25
- error: "error/REQUIRED"
26
- },
27
- {
28
- type: "validator/VALIDATE_SUM",
29
- args: [
30
- {
31
- type: "validator/NUMBER_GREATER_THAN_OR_EQUAL_TO",
32
- args: [1],
33
- error: "error/NUMBER_GREATER_THAN_OR_EQUAL_TO"
34
- },
35
- [
36
- "ff4b6d84-7f6a-4692-8d50-05eab56a6351",
37
- "4396e95d-e0eb-44e6-8691-f94d72c2f7e7"
38
- ]
39
- ],
40
- error: "error/NUMBER_GREATER_THAN_OR_EQUAL_TO"
41
- },
42
- {
43
- type: "validator/VALIDATE_SUM",
44
- args: [
45
- {
46
- type: "validator/NUMBER_LESS_THAN_OR_EQUAL_TO",
47
- args: [50000],
48
- error: "error/NUMBER_LESS_THAN_OR_EQUAL_TO"
49
- },
50
- [
51
- "ff4b6d84-7f6a-4692-8d50-05eab56a6351",
52
- "4396e95d-e0eb-44e6-8691-f94d72c2f7e7"
53
- ]
54
- ],
55
- error: "error/NUMBER_LESS_THAN_OR_EQUAL_TO"
56
- }
57
- ],
58
- constraints: [
59
- {
60
- type: "validator/ONLY_NATURALS",
61
- args: [],
62
- error: "error/ONLY_NATURALS"
63
- }
64
- ],
65
- errors: ["error/NUMBER_LESS_THAN_OR_EQUAL_TO"],
66
- hasErrors: true,
67
- id: "3cd98097-1c95-43c6-848a-d44f95d312ec"
68
- },
69
- "ff4b6d84-7f6a-4692-8d50-05eab56a6351": {
70
- dirty: false,
71
- rawValue: "25000",
72
- id: "ff4b6d84-7f6a-4692-8d50-05eab56a6351",
73
- validators: [
74
- {
75
- type: "validator/REQUIRED",
76
- args: [],
77
- error: "error/REQUIRED"
78
- },
79
- {
80
- type: "validator/VALIDATE_SUM",
81
- args: [
82
- {
83
- type: "validator/NUMBER_GREATER_THAN_OR_EQUAL_TO",
84
- args: [1],
85
- error: "error/NUMBER_GREATER_THAN_OR_EQUAL_TO"
86
- },
87
- [
88
- "3cd98097-1c95-43c6-848a-d44f95d312ec",
89
- "4396e95d-e0eb-44e6-8691-f94d72c2f7e7"
90
- ]
91
- ],
92
- error: "error/NUMBER_GREATER_THAN_OR_EQUAL_TO"
93
- },
94
- {
95
- type: "validator/VALIDATE_SUM",
96
- args: [
97
- {
98
- type: "validator/NUMBER_LESS_THAN_OR_EQUAL_TO",
99
- args: [50000],
100
- error: "error/NUMBER_LESS_THAN_OR_EQUAL_TO"
101
- },
102
- [
103
- "3cd98097-1c95-43c6-848a-d44f95d312ec",
104
- "4396e95d-e0eb-44e6-8691-f94d72c2f7e7"
105
- ]
106
- ],
107
- error: "error/NUMBER_LESS_THAN_OR_EQUAL_TO"
108
- }
109
- ],
110
- constraints: [
111
- {
112
- type: "validator/ONLY_NATURALS",
113
- args: [],
114
- error: "error/ONLY_NATURALS"
115
- }
116
- ],
117
- errors: ["error/NUMBER_LESS_THAN_OR_EQUAL_TO"],
118
- hasErrors: true
119
- }
120
- };
121
- const options = [
122
- { value: "", text: "choose name" },
123
- { value: "foo", text: "foo" },
124
- { value: "bar", text: "bar" },
125
- { value: "baz", text: "baz" },
126
- { value: "disabled", text: "disabled" }
127
- ];
128
- const story = page({
129
- title: "Components|Molecules/PartialAmountForm",
130
- Component: PartialAmountForm,
131
- reducer: PartialAmountFormState.reducer,
132
- mapStateToProps: PartialAmountFormState.mapStateToProps,
133
- mapDispatchToProps: PartialAmountFormState.mapDispatchToProps
134
- });
135
- export default story;
136
-
137
- const ConnectedPartialAmountForm = connect(
138
- PartialAmountFormState.mapStateToProps,
139
- PartialAmountFormState.mapDispatchToProps
140
- )(PartialAmountForm);
141
- export const partialAmountForm = () => (
142
- <ConnectedPartialAmountForm
143
- showErrors={boolean("showErrors", false, "props")}
144
- lineItems={options}
145
- />
146
- );