@qite/tide-booking-component 1.0.17 → 1.0.19

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.
Files changed (166) hide show
  1. package/README.md +8 -8
  2. package/package.json +71 -71
  3. package/rollup.config.js +23 -23
  4. package/src/booking-wizard/components/icon.tsx +29 -29
  5. package/src/booking-wizard/components/labeled-input.tsx +64 -64
  6. package/src/booking-wizard/components/labeled-select.tsx +69 -69
  7. package/src/booking-wizard/components/message.tsx +34 -34
  8. package/src/booking-wizard/components/product-card.tsx +37 -37
  9. package/src/booking-wizard/components/rating.tsx +21 -21
  10. package/src/booking-wizard/components/step-indicator.tsx +37 -37
  11. package/src/booking-wizard/components/step-route.tsx +27 -27
  12. package/src/booking-wizard/features/booking/api.ts +44 -44
  13. package/src/booking-wizard/features/booking/booking-slice.ts +373 -373
  14. package/src/booking-wizard/features/booking/booking.tsx +297 -297
  15. package/src/booking-wizard/features/booking/selectors.ts +340 -340
  16. package/src/booking-wizard/features/confirmation/confirmation.tsx +81 -81
  17. package/src/booking-wizard/features/error/error.tsx +71 -71
  18. package/src/booking-wizard/features/price-details/price-details-api.ts +22 -22
  19. package/src/booking-wizard/features/price-details/price-details-slice.ts +149 -149
  20. package/src/booking-wizard/features/price-details/util.ts +135 -135
  21. package/src/booking-wizard/features/product-options/no-options.tsx +18 -18
  22. package/src/booking-wizard/features/product-options/none-option.tsx +118 -118
  23. package/src/booking-wizard/features/product-options/option-booking-group.tsx +210 -210
  24. package/src/booking-wizard/features/product-options/option-item.tsx +321 -321
  25. package/src/booking-wizard/features/product-options/option-pax-card.tsx +117 -117
  26. package/src/booking-wizard/features/product-options/option-pax-group.tsx +169 -169
  27. package/src/booking-wizard/features/product-options/option-room.tsx +314 -314
  28. package/src/booking-wizard/features/product-options/option-unit-group.tsx +192 -192
  29. package/src/booking-wizard/features/product-options/option-units-card.tsx +100 -100
  30. package/src/booking-wizard/features/product-options/options-form.tsx +347 -347
  31. package/src/booking-wizard/features/product-options/validate-form.ts +9 -9
  32. package/src/booking-wizard/features/sidebar/index.tsx +80 -80
  33. package/src/booking-wizard/features/sidebar/sidebar-flight.tsx +66 -66
  34. package/src/booking-wizard/features/sidebar/sidebar-util.ts +168 -167
  35. package/src/booking-wizard/features/sidebar/sidebar.tsx +343 -343
  36. package/src/booking-wizard/features/summary/summary-booking-option-pax.tsx +25 -25
  37. package/src/booking-wizard/features/summary/summary-booking-option-unit.tsx +25 -25
  38. package/src/booking-wizard/features/summary/summary-flight.tsx +36 -35
  39. package/src/booking-wizard/features/summary/summary-per-booking-option-group.tsx +57 -57
  40. package/src/booking-wizard/features/summary/summary-per-pax-option-group.tsx +51 -51
  41. package/src/booking-wizard/features/summary/summary-per-unit-option-group.tsx +54 -54
  42. package/src/booking-wizard/features/summary/summary-slice.ts +28 -28
  43. package/src/booking-wizard/features/summary/summary.tsx +601 -601
  44. package/src/booking-wizard/features/travelers-form/travelers-form-slice.ts +139 -139
  45. package/src/booking-wizard/features/travelers-form/travelers-form.tsx +729 -729
  46. package/src/booking-wizard/features/travelers-form/type-ahead-input.tsx +101 -101
  47. package/src/booking-wizard/features/travelers-form/validate-form.ts +166 -166
  48. package/src/booking-wizard/index.tsx +36 -36
  49. package/src/booking-wizard/settings-context.ts +54 -54
  50. package/src/booking-wizard/store.ts +29 -29
  51. package/src/booking-wizard/translations/translations.json +135 -135
  52. package/src/booking-wizard/types.ts +134 -133
  53. package/src/booking-wizard/utils/class-util.ts +9 -9
  54. package/src/booking-wizard/utils/localization-util.ts +7 -7
  55. package/src/booking-wizard/utils/query-string-util.ts +94 -94
  56. package/src/booking-wizard/utils/tide-api-utils.ts +20 -20
  57. package/src/index.ts +3 -3
  58. package/tsconfig.json +24 -24
  59. package/build/build-cjs/booking-wizard/components/icon.d.ts +0 -7
  60. package/build/build-cjs/booking-wizard/components/labeled-input.d.ts +0 -18
  61. package/build/build-cjs/booking-wizard/components/labeled-select.d.ts +0 -21
  62. package/build/build-cjs/booking-wizard/components/message.d.ts +0 -9
  63. package/build/build-cjs/booking-wizard/components/product-card.d.ts +0 -8
  64. package/build/build-cjs/booking-wizard/components/rating.d.ts +0 -6
  65. package/build/build-cjs/booking-wizard/components/step-indicator.d.ts +0 -6
  66. package/build/build-cjs/booking-wizard/components/step-route.d.ts +0 -9
  67. package/build/build-cjs/booking-wizard/features/booking/api.d.ts +0 -7
  68. package/build/build-cjs/booking-wizard/features/booking/booking-slice.d.ts +0 -26
  69. package/build/build-cjs/booking-wizard/features/booking/booking.d.ts +0 -8
  70. package/build/build-cjs/booking-wizard/features/booking/selectors.d.ts +0 -94
  71. package/build/build-cjs/booking-wizard/features/confirmation/confirmation.d.ts +0 -5
  72. package/build/build-cjs/booking-wizard/features/error/error.d.ts +0 -5
  73. package/build/build-cjs/booking-wizard/features/price-details/price-details-api.d.ts +0 -5
  74. package/build/build-cjs/booking-wizard/features/price-details/price-details-slice.d.ts +0 -66
  75. package/build/build-cjs/booking-wizard/features/price-details/util.d.ts +0 -2
  76. package/build/build-cjs/booking-wizard/features/product-options/no-options.d.ts +0 -2
  77. package/build/build-cjs/booking-wizard/features/product-options/none-option.d.ts +0 -9
  78. package/build/build-cjs/booking-wizard/features/product-options/option-booking-group.d.ts +0 -12
  79. package/build/build-cjs/booking-wizard/features/product-options/option-item.d.ts +0 -11
  80. package/build/build-cjs/booking-wizard/features/product-options/option-pax-card.d.ts +0 -10
  81. package/build/build-cjs/booking-wizard/features/product-options/option-pax-group.d.ts +0 -13
  82. package/build/build-cjs/booking-wizard/features/product-options/option-room.d.ts +0 -10
  83. package/build/build-cjs/booking-wizard/features/product-options/option-unit-group.d.ts +0 -13
  84. package/build/build-cjs/booking-wizard/features/product-options/option-units-card.d.ts +0 -9
  85. package/build/build-cjs/booking-wizard/features/product-options/options-form.d.ts +0 -5
  86. package/build/build-cjs/booking-wizard/features/product-options/validate-form.d.ts +0 -2
  87. package/build/build-cjs/booking-wizard/features/sidebar/index.d.ts +0 -7
  88. package/build/build-cjs/booking-wizard/features/sidebar/sidebar-flight.d.ts +0 -8
  89. package/build/build-cjs/booking-wizard/features/sidebar/sidebar-util.d.ts +0 -9
  90. package/build/build-cjs/booking-wizard/features/sidebar/sidebar.d.ts +0 -25
  91. package/build/build-cjs/booking-wizard/features/summary/summary-booking-option-pax.d.ts +0 -7
  92. package/build/build-cjs/booking-wizard/features/summary/summary-booking-option-unit.d.ts +0 -7
  93. package/build/build-cjs/booking-wizard/features/summary/summary-flight.d.ts +0 -8
  94. package/build/build-cjs/booking-wizard/features/summary/summary-per-booking-option-group.d.ts +0 -7
  95. package/build/build-cjs/booking-wizard/features/summary/summary-per-pax-option-group.d.ts +0 -7
  96. package/build/build-cjs/booking-wizard/features/summary/summary-per-unit-option-group.d.ts +0 -7
  97. package/build/build-cjs/booking-wizard/features/summary/summary-slice.d.ts +0 -8
  98. package/build/build-cjs/booking-wizard/features/summary/summary.d.ts +0 -5
  99. package/build/build-cjs/booking-wizard/features/travelers-form/travelers-form-slice.d.ts +0 -60
  100. package/build/build-cjs/booking-wizard/features/travelers-form/travelers-form.d.ts +0 -5
  101. package/build/build-cjs/booking-wizard/features/travelers-form/type-ahead-input.d.ts +0 -16
  102. package/build/build-cjs/booking-wizard/features/travelers-form/validate-form.d.ts +0 -4
  103. package/build/build-cjs/booking-wizard/index.d.ts +0 -12
  104. package/build/build-cjs/booking-wizard/settings-context.d.ts +0 -6
  105. package/build/build-cjs/booking-wizard/store.d.ts +0 -21
  106. package/build/build-cjs/booking-wizard/types.d.ts +0 -123
  107. package/build/build-cjs/booking-wizard/utils/class-util.d.ts +0 -1
  108. package/build/build-cjs/booking-wizard/utils/localization-util.d.ts +0 -1
  109. package/build/build-cjs/booking-wizard/utils/query-string-util.d.ts +0 -7
  110. package/build/build-cjs/booking-wizard/utils/tide-api-utils.d.ts +0 -2
  111. package/build/build-cjs/index.d.ts +0 -2
  112. package/build/build-cjs/index.js +0 -9961
  113. package/build/build-esm/booking-wizard/components/icon.d.ts +0 -7
  114. package/build/build-esm/booking-wizard/components/labeled-input.d.ts +0 -18
  115. package/build/build-esm/booking-wizard/components/labeled-select.d.ts +0 -21
  116. package/build/build-esm/booking-wizard/components/message.d.ts +0 -9
  117. package/build/build-esm/booking-wizard/components/product-card.d.ts +0 -8
  118. package/build/build-esm/booking-wizard/components/rating.d.ts +0 -6
  119. package/build/build-esm/booking-wizard/components/step-indicator.d.ts +0 -6
  120. package/build/build-esm/booking-wizard/components/step-route.d.ts +0 -9
  121. package/build/build-esm/booking-wizard/features/booking/api.d.ts +0 -7
  122. package/build/build-esm/booking-wizard/features/booking/booking-slice.d.ts +0 -26
  123. package/build/build-esm/booking-wizard/features/booking/booking.d.ts +0 -8
  124. package/build/build-esm/booking-wizard/features/booking/selectors.d.ts +0 -94
  125. package/build/build-esm/booking-wizard/features/confirmation/confirmation.d.ts +0 -5
  126. package/build/build-esm/booking-wizard/features/error/error.d.ts +0 -5
  127. package/build/build-esm/booking-wizard/features/price-details/price-details-api.d.ts +0 -5
  128. package/build/build-esm/booking-wizard/features/price-details/price-details-slice.d.ts +0 -66
  129. package/build/build-esm/booking-wizard/features/price-details/util.d.ts +0 -2
  130. package/build/build-esm/booking-wizard/features/product-options/no-options.d.ts +0 -2
  131. package/build/build-esm/booking-wizard/features/product-options/none-option.d.ts +0 -9
  132. package/build/build-esm/booking-wizard/features/product-options/option-booking-group.d.ts +0 -12
  133. package/build/build-esm/booking-wizard/features/product-options/option-item.d.ts +0 -11
  134. package/build/build-esm/booking-wizard/features/product-options/option-pax-card.d.ts +0 -10
  135. package/build/build-esm/booking-wizard/features/product-options/option-pax-group.d.ts +0 -13
  136. package/build/build-esm/booking-wizard/features/product-options/option-room.d.ts +0 -10
  137. package/build/build-esm/booking-wizard/features/product-options/option-unit-group.d.ts +0 -13
  138. package/build/build-esm/booking-wizard/features/product-options/option-units-card.d.ts +0 -9
  139. package/build/build-esm/booking-wizard/features/product-options/options-form.d.ts +0 -5
  140. package/build/build-esm/booking-wizard/features/product-options/validate-form.d.ts +0 -2
  141. package/build/build-esm/booking-wizard/features/sidebar/index.d.ts +0 -7
  142. package/build/build-esm/booking-wizard/features/sidebar/sidebar-flight.d.ts +0 -8
  143. package/build/build-esm/booking-wizard/features/sidebar/sidebar-util.d.ts +0 -9
  144. package/build/build-esm/booking-wizard/features/sidebar/sidebar.d.ts +0 -25
  145. package/build/build-esm/booking-wizard/features/summary/summary-booking-option-pax.d.ts +0 -7
  146. package/build/build-esm/booking-wizard/features/summary/summary-booking-option-unit.d.ts +0 -7
  147. package/build/build-esm/booking-wizard/features/summary/summary-flight.d.ts +0 -8
  148. package/build/build-esm/booking-wizard/features/summary/summary-per-booking-option-group.d.ts +0 -7
  149. package/build/build-esm/booking-wizard/features/summary/summary-per-pax-option-group.d.ts +0 -7
  150. package/build/build-esm/booking-wizard/features/summary/summary-per-unit-option-group.d.ts +0 -7
  151. package/build/build-esm/booking-wizard/features/summary/summary-slice.d.ts +0 -8
  152. package/build/build-esm/booking-wizard/features/summary/summary.d.ts +0 -5
  153. package/build/build-esm/booking-wizard/features/travelers-form/travelers-form-slice.d.ts +0 -60
  154. package/build/build-esm/booking-wizard/features/travelers-form/travelers-form.d.ts +0 -5
  155. package/build/build-esm/booking-wizard/features/travelers-form/type-ahead-input.d.ts +0 -16
  156. package/build/build-esm/booking-wizard/features/travelers-form/validate-form.d.ts +0 -4
  157. package/build/build-esm/booking-wizard/index.d.ts +0 -12
  158. package/build/build-esm/booking-wizard/settings-context.d.ts +0 -6
  159. package/build/build-esm/booking-wizard/store.d.ts +0 -21
  160. package/build/build-esm/booking-wizard/types.d.ts +0 -123
  161. package/build/build-esm/booking-wizard/utils/class-util.d.ts +0 -1
  162. package/build/build-esm/booking-wizard/utils/localization-util.d.ts +0 -1
  163. package/build/build-esm/booking-wizard/utils/query-string-util.d.ts +0 -7
  164. package/build/build-esm/booking-wizard/utils/tide-api-utils.d.ts +0 -2
  165. package/build/build-esm/index.d.ts +0 -2
  166. package/build/build-esm/index.js +0 -9950
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # README
2
-
3
- This is the unified Tide Booking Component.
4
-
5
- ## Remarks
6
-
7
- Do not forget to sync React versions when you're doing local changes and when you try to test them in a local React project (check https://reactjs.org/warnings/invalid-hook-call-warning.html#duplicate-react).
8
- If using the playground, after installing it's node modules execute the following command in the root folder `npm link ./playground/node_modules/react`
1
+ # README
2
+
3
+ This is the unified Tide Booking Component.
4
+
5
+ ## Remarks
6
+
7
+ Do not forget to sync React versions when you're doing local changes and when you try to test them in a local React project (check https://reactjs.org/warnings/invalid-hook-call-warning.html#duplicate-react).
8
+ If using the playground, after installing it's node modules execute the following command in the root folder `npm link ./playground/node_modules/react`
package/package.json CHANGED
@@ -1,71 +1,71 @@
1
- {
2
- "name": "@qite/tide-booking-component",
3
- "version": "1.0.17",
4
- "description": "React BookingWizard component for Tide",
5
- "main": "build/build-cjs/index.js",
6
- "module": "build/build-esm/index.js",
7
- "scripts": {
8
- "start": "rollup -c -w",
9
- "build": "rollup -c",
10
- "tsc": "tsc --noEmit",
11
- "format": "prettier --write ."
12
- },
13
- "repository": {
14
- "type": "git",
15
- "url": "git+ssh://git@bitbucket.org/qitegeneral/tide-booking-component.git"
16
- },
17
- "keywords": [
18
- "tide",
19
- "booking",
20
- "react",
21
- "component"
22
- ],
23
- "author": "Kristof Colpaert <kristof.colpaert@qite.be>",
24
- "license": "OBSD",
25
- "homepage": "https://bitbucket.org/qitegeneral/tide-booking-component#readme",
26
- "devDependencies": {
27
- "@jsonurl/jsonurl": "^1.1.4",
28
- "@reach/router": "^1.3.4",
29
- "@reduxjs/toolkit": "^1.6.0",
30
- "@rollup/plugin-commonjs": "^19.0.1",
31
- "@rollup/plugin-json": "^4.1.0",
32
- "@rollup/plugin-node-resolve": "^13.0.2",
33
- "@types/flat": "^5.0.2",
34
- "@types/lodash": "^4.14.171",
35
- "@types/reach__router": "^1.3.9",
36
- "@types/react-dom": "^17.0.11",
37
- "@types/uuid": "^8.3.1",
38
- "date-fns": "^2.22.1",
39
- "flat": "^5.0.2",
40
- "formik": "^2.2.9",
41
- "lodash": "^4.17.21",
42
- "prettier": "^2.3.2",
43
- "react": "^17.0.2",
44
- "react-dom": "^17.0.2",
45
- "react-redux": "^7.2.4",
46
- "rollup": "^2.53.2",
47
- "rollup-plugin-delete": "^2.0.0",
48
- "rollup-plugin-peer-deps-external": "^2.2.4",
49
- "rollup-plugin-typescript2": "^0.30.0",
50
- "tslib": "^2.3.1",
51
- "typescript": "^4.3.5",
52
- "uuid": "^8.3.2"
53
- },
54
- "peerDependencies": {
55
- "@jsonurl/jsonurl": "^1.1.4",
56
- "@reach/router": "^1.3.4",
57
- "@reduxjs/toolkit": "^1.6.0",
58
- "date-fns": "^2.22.1",
59
- "flat": "^5.0.2",
60
- "formik": "^2.2.9",
61
- "immer": "^9.0.5",
62
- "lodash": "^4.17.21",
63
- "react": "^16.12.0",
64
- "react-dom": "^16.12.0",
65
- "react-redux": "^7.2.4",
66
- "uuid": "^8.3.2"
67
- },
68
- "dependencies": {
69
- "@qite/tide-client": "1.1.21"
70
- }
71
- }
1
+ {
2
+ "name": "@qite/tide-booking-component",
3
+ "version": "1.0.19",
4
+ "description": "React BookingWizard component for Tide",
5
+ "main": "build/build-cjs/index.js",
6
+ "module": "build/build-esm/index.js",
7
+ "scripts": {
8
+ "start": "rollup -c -w",
9
+ "build": "rollup -c",
10
+ "tsc": "tsc --noEmit",
11
+ "format": "prettier --write ."
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+ssh://git@bitbucket.org/qitegeneral/tide-booking-component.git"
16
+ },
17
+ "keywords": [
18
+ "tide",
19
+ "booking",
20
+ "react",
21
+ "component"
22
+ ],
23
+ "author": "Kristof Colpaert <kristof.colpaert@qite.be>",
24
+ "license": "OBSD",
25
+ "homepage": "https://bitbucket.org/qitegeneral/tide-booking-component#readme",
26
+ "devDependencies": {
27
+ "@jsonurl/jsonurl": "^1.1.4",
28
+ "@reach/router": "^1.3.4",
29
+ "@reduxjs/toolkit": "^1.6.0",
30
+ "@rollup/plugin-commonjs": "^19.0.1",
31
+ "@rollup/plugin-json": "^4.1.0",
32
+ "@rollup/plugin-node-resolve": "^13.0.2",
33
+ "@types/flat": "^5.0.2",
34
+ "@types/lodash": "^4.14.171",
35
+ "@types/reach__router": "^1.3.9",
36
+ "@types/react-dom": "^17.0.11",
37
+ "@types/uuid": "^8.3.1",
38
+ "date-fns": "^2.22.1",
39
+ "flat": "^5.0.2",
40
+ "formik": "^2.2.9",
41
+ "lodash": "^4.17.21",
42
+ "prettier": "^2.3.2",
43
+ "react": "^17.0.2",
44
+ "react-dom": "^17.0.2",
45
+ "react-redux": "^7.2.4",
46
+ "rollup": "^2.53.2",
47
+ "rollup-plugin-delete": "^2.0.0",
48
+ "rollup-plugin-peer-deps-external": "^2.2.4",
49
+ "rollup-plugin-typescript2": "^0.30.0",
50
+ "tslib": "^2.3.1",
51
+ "typescript": "^4.3.5",
52
+ "uuid": "^8.3.2"
53
+ },
54
+ "peerDependencies": {
55
+ "@jsonurl/jsonurl": "^1.1.4",
56
+ "@reach/router": "^1.3.4",
57
+ "@reduxjs/toolkit": "^1.6.0",
58
+ "date-fns": "^2.22.1",
59
+ "flat": "^5.0.2",
60
+ "formik": "^2.2.9",
61
+ "immer": "^9.0.5",
62
+ "lodash": "^4.17.21",
63
+ "react": "^16.12.0",
64
+ "react-dom": "^16.12.0",
65
+ "react-redux": "^7.2.4",
66
+ "uuid": "^8.3.2"
67
+ },
68
+ "dependencies": {
69
+ "@qite/tide-client": "1.1.21"
70
+ }
71
+ }
package/rollup.config.js CHANGED
@@ -1,23 +1,23 @@
1
- import commonjs from "@rollup/plugin-commonjs";
2
- import del from "rollup-plugin-delete";
3
- import json from "@rollup/plugin-json";
4
- import nodeResolve from "@rollup/plugin-node-resolve";
5
- import packageJson from "./package.json";
6
- import peerDepsExternal from "rollup-plugin-peer-deps-external";
7
- import typescript from "rollup-plugin-typescript2";
8
-
9
- export default {
10
- input: "src/index.ts",
11
- output: [
12
- { file: packageJson.main, format: "cjs", banner: "/* eslint-disable */" },
13
- { file: packageJson.module, format: "esm", banner: "/* eslint-disable */" },
14
- ],
15
- plugins: [
16
- peerDepsExternal(),
17
- json(),
18
- nodeResolve(),
19
- commonjs(),
20
- typescript(),
21
- del({ targets: ["build/*"] }),
22
- ],
23
- };
1
+ import commonjs from "@rollup/plugin-commonjs";
2
+ import del from "rollup-plugin-delete";
3
+ import json from "@rollup/plugin-json";
4
+ import nodeResolve from "@rollup/plugin-node-resolve";
5
+ import packageJson from "./package.json";
6
+ import peerDepsExternal from "rollup-plugin-peer-deps-external";
7
+ import typescript from "rollup-plugin-typescript2";
8
+
9
+ export default {
10
+ input: "src/index.ts",
11
+ output: [
12
+ { file: packageJson.main, format: "cjs", banner: "/* eslint-disable */" },
13
+ { file: packageJson.module, format: "esm", banner: "/* eslint-disable */" },
14
+ ],
15
+ plugins: [
16
+ peerDepsExternal(),
17
+ json(),
18
+ nodeResolve(),
19
+ commonjs(),
20
+ typescript(),
21
+ del({ targets: ["build/*"] }),
22
+ ],
23
+ };
@@ -1,29 +1,29 @@
1
- import React from "react";
2
- import { isEmpty } from "lodash";
3
- import { useContext } from "react";
4
- import SettingsContext from "../settings-context";
5
-
6
- interface IconProps {
7
- name: string;
8
- className?: string;
9
- }
10
-
11
- const Icon: React.FC<IconProps> = ({ name, className }) => {
12
- const { icons } = useContext(SettingsContext);
13
-
14
- if (!icons) {
15
- return null;
16
- }
17
-
18
- return (
19
- <svg
20
- className={["icon", `icon--${name}`, className]
21
- .filter((className) => !isEmpty(className))
22
- .join(" ")}
23
- >
24
- <use href={`${icons}#${name}`}></use>
25
- </svg>
26
- );
27
- };
28
-
29
- export default Icon;
1
+ import React from "react";
2
+ import { isEmpty } from "lodash";
3
+ import { useContext } from "react";
4
+ import SettingsContext from "../settings-context";
5
+
6
+ interface IconProps {
7
+ name: string;
8
+ className?: string;
9
+ }
10
+
11
+ const Icon: React.FC<IconProps> = ({ name, className }) => {
12
+ const { icons } = useContext(SettingsContext);
13
+
14
+ if (!icons) {
15
+ return null;
16
+ }
17
+
18
+ return (
19
+ <svg
20
+ className={["icon", `icon--${name}`, className]
21
+ .filter((className) => !isEmpty(className))
22
+ .join(" ")}
23
+ >
24
+ <use href={`${icons}#${name}`}></use>
25
+ </svg>
26
+ );
27
+ };
28
+
29
+ export default Icon;
@@ -1,64 +1,64 @@
1
- import React from "react";
2
- import { buildClassName } from "../utils/class-util";
3
- import { compact } from "lodash";
4
-
5
- interface LabeledInputProps {
6
- name: string;
7
- type?: string;
8
- required?: boolean;
9
- value?: string | number;
10
- defaultValue?: string | number;
11
- min?: string | number;
12
- max?: string | number;
13
- label?: string;
14
- placeholder?: string;
15
- hasError?: boolean;
16
- extraClassName?: string;
17
- onChange?: React.ChangeEventHandler<HTMLInputElement>;
18
- onBlur?: React.FocusEventHandler<HTMLInputElement>;
19
- }
20
-
21
- const LabeledInput: React.FC<LabeledInputProps> = ({
22
- name,
23
- type,
24
- required,
25
- value,
26
- defaultValue,
27
- min,
28
- max,
29
- label,
30
- placeholder,
31
- extraClassName,
32
- hasError,
33
- onChange,
34
- onBlur,
35
- }) => {
36
- return (
37
- <label
38
- className={buildClassName([
39
- "form__group",
40
- extraClassName,
41
- hasError && "form__group--error",
42
- ])}
43
- >
44
- <span className="form__label">
45
- {compact([label, required && "*"]).join(" ")}
46
- </span>
47
- <input
48
- name={name}
49
- type={type ?? "text"}
50
- required={required}
51
- className="form__input"
52
- min={min}
53
- max={max}
54
- placeholder={placeholder}
55
- onChange={onChange}
56
- onBlur={onBlur}
57
- value={value}
58
- defaultValue={defaultValue}
59
- />
60
- </label>
61
- );
62
- };
63
-
64
- export default LabeledInput;
1
+ import React from "react";
2
+ import { buildClassName } from "../utils/class-util";
3
+ import { compact } from "lodash";
4
+
5
+ interface LabeledInputProps {
6
+ name: string;
7
+ type?: string;
8
+ required?: boolean;
9
+ value?: string | number;
10
+ defaultValue?: string | number;
11
+ min?: string | number;
12
+ max?: string | number;
13
+ label?: string;
14
+ placeholder?: string;
15
+ hasError?: boolean;
16
+ extraClassName?: string;
17
+ onChange?: React.ChangeEventHandler<HTMLInputElement>;
18
+ onBlur?: React.FocusEventHandler<HTMLInputElement>;
19
+ }
20
+
21
+ const LabeledInput: React.FC<LabeledInputProps> = ({
22
+ name,
23
+ type,
24
+ required,
25
+ value,
26
+ defaultValue,
27
+ min,
28
+ max,
29
+ label,
30
+ placeholder,
31
+ extraClassName,
32
+ hasError,
33
+ onChange,
34
+ onBlur,
35
+ }) => {
36
+ return (
37
+ <label
38
+ className={buildClassName([
39
+ "form__group",
40
+ extraClassName,
41
+ hasError && "form__group--error",
42
+ ])}
43
+ >
44
+ <span className="form__label">
45
+ {compact([label, required && "*"]).join(" ")}
46
+ </span>
47
+ <input
48
+ name={name}
49
+ type={type ?? "text"}
50
+ required={required}
51
+ className="form__input"
52
+ min={min}
53
+ max={max}
54
+ placeholder={placeholder}
55
+ onChange={onChange}
56
+ onBlur={onBlur}
57
+ value={value}
58
+ defaultValue={defaultValue}
59
+ />
60
+ </label>
61
+ );
62
+ };
63
+
64
+ export default LabeledInput;
@@ -1,69 +1,69 @@
1
- import React from "react";
2
- import { buildClassName } from "../utils/class-util";
3
- import { compact } from "lodash";
4
-
5
- interface LabeledSelectProps {
6
- name: string;
7
- id?: string;
8
- required?: boolean;
9
- value?: string | number;
10
- defaultValue?: string | number;
11
- label?: string;
12
- hasError?: boolean;
13
- extraClassName?: string;
14
- extraDropdownClassName?: string;
15
- options?: {
16
- key: string;
17
- value: string | number | undefined;
18
- label: string;
19
- }[];
20
- onChange?: React.ChangeEventHandler<HTMLSelectElement>;
21
- onBlur?: React.FocusEventHandler<HTMLSelectElement>;
22
- }
23
-
24
- const LabeledSelect: React.FC<LabeledSelectProps> = ({
25
- name,
26
- id,
27
- required,
28
- value,
29
- defaultValue,
30
- label,
31
- extraClassName,
32
- extraDropdownClassName,
33
- hasError,
34
- options,
35
- onChange,
36
- onBlur,
37
- }) => {
38
- return (
39
- <label
40
- className={buildClassName([
41
- "form__group",
42
- extraClassName,
43
- hasError && "form__group--error",
44
- ])}
45
- >
46
- <span className="form__label">
47
- {compact([label, required && "*"]).join(" ")}
48
- </span>
49
- <div className={buildClassName(["dropdown", extraDropdownClassName])}>
50
- <select
51
- name={name}
52
- id={id}
53
- defaultValue={defaultValue}
54
- value={value}
55
- onBlur={onBlur}
56
- onChange={onChange}
57
- >
58
- {options?.map((option) => (
59
- <option key={option.key} value={option.value}>
60
- {option.label}
61
- </option>
62
- ))}
63
- </select>
64
- </div>
65
- </label>
66
- );
67
- };
68
-
69
- export default LabeledSelect;
1
+ import React from "react";
2
+ import { buildClassName } from "../utils/class-util";
3
+ import { compact } from "lodash";
4
+
5
+ interface LabeledSelectProps {
6
+ name: string;
7
+ id?: string;
8
+ required?: boolean;
9
+ value?: string | number;
10
+ defaultValue?: string | number;
11
+ label?: string;
12
+ hasError?: boolean;
13
+ extraClassName?: string;
14
+ extraDropdownClassName?: string;
15
+ options?: {
16
+ key: string;
17
+ value: string | number | undefined;
18
+ label: string;
19
+ }[];
20
+ onChange?: React.ChangeEventHandler<HTMLSelectElement>;
21
+ onBlur?: React.FocusEventHandler<HTMLSelectElement>;
22
+ }
23
+
24
+ const LabeledSelect: React.FC<LabeledSelectProps> = ({
25
+ name,
26
+ id,
27
+ required,
28
+ value,
29
+ defaultValue,
30
+ label,
31
+ extraClassName,
32
+ extraDropdownClassName,
33
+ hasError,
34
+ options,
35
+ onChange,
36
+ onBlur,
37
+ }) => {
38
+ return (
39
+ <label
40
+ className={buildClassName([
41
+ "form__group",
42
+ extraClassName,
43
+ hasError && "form__group--error",
44
+ ])}
45
+ >
46
+ <span className="form__label">
47
+ {compact([label, required && "*"]).join(" ")}
48
+ </span>
49
+ <div className={buildClassName(["dropdown", extraDropdownClassName])}>
50
+ <select
51
+ name={name}
52
+ id={id}
53
+ defaultValue={defaultValue}
54
+ value={value}
55
+ onBlur={onBlur}
56
+ onChange={onChange}
57
+ >
58
+ {options?.map((option) => (
59
+ <option key={option.key} value={option.value}>
60
+ {option.label}
61
+ </option>
62
+ ))}
63
+ </select>
64
+ </div>
65
+ </label>
66
+ );
67
+ };
68
+
69
+ export default LabeledSelect;
@@ -1,34 +1,34 @@
1
- import Icon from "./icon";
2
- import React from "react";
3
- import { buildClassName } from "../utils/class-util";
4
-
5
- interface MessageProps {
6
- type: "error" | "success";
7
- title: string;
8
- actionComponent?: JSX.Element;
9
- children?: JSX.Element | JSX.Element[];
10
- }
11
-
12
- const Message: React.FC<MessageProps> = ({
13
- type,
14
- title,
15
- actionComponent,
16
- children,
17
- }) => (
18
- <div
19
- className={buildClassName([
20
- "booking-message",
21
- type === "error" && "booking-message--error",
22
- type === "success" && "booking-message--success",
23
- ])}
24
- >
25
- {type === "error" && <Icon name="ui-error" />}
26
- <h4 className="booking-message__heading">{title}</h4>
27
- <div className="booking-message__text">{children}</div>
28
- {actionComponent && (
29
- <div className="booking-message__actions">{actionComponent}</div>
30
- )}
31
- </div>
32
- );
33
-
34
- export default Message;
1
+ import Icon from "./icon";
2
+ import React from "react";
3
+ import { buildClassName } from "../utils/class-util";
4
+
5
+ interface MessageProps {
6
+ type: "error" | "success";
7
+ title: string;
8
+ actionComponent?: JSX.Element;
9
+ children?: JSX.Element | JSX.Element[];
10
+ }
11
+
12
+ const Message: React.FC<MessageProps> = ({
13
+ type,
14
+ title,
15
+ actionComponent,
16
+ children,
17
+ }) => (
18
+ <div
19
+ className={buildClassName([
20
+ "booking-message",
21
+ type === "error" && "booking-message--error",
22
+ type === "success" && "booking-message--success",
23
+ ])}
24
+ >
25
+ {type === "error" && <Icon name="ui-error" />}
26
+ <h4 className="booking-message__heading">{title}</h4>
27
+ <div className="booking-message__text">{children}</div>
28
+ {actionComponent && (
29
+ <div className="booking-message__actions">{actionComponent}</div>
30
+ )}
31
+ </div>
32
+ );
33
+
34
+ export default Message;