@povio/ui 0.0.7 → 0.0.9

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 (104) hide show
  1. package/dist/assets/icons/Calendar.js +1 -1
  2. package/dist/assets/icons/CheckCircle.js +3 -3
  3. package/dist/assets/icons/ChevronsLeft.js +11 -22
  4. package/dist/assets/icons/ChevronsRight.js +11 -22
  5. package/dist/assets/icons/DateTime.js +13 -6
  6. package/dist/assets/icons/Drag.js +1 -1
  7. package/dist/assets/icons/File.js +1 -1
  8. package/dist/assets/icons/Info.js +2 -4
  9. package/dist/assets/icons/Menu.js +1 -3
  10. package/dist/assets/icons/Send.js +1 -1
  11. package/dist/assets/icons/Upload.js +2 -2
  12. package/dist/assets/icons/{Warningfilled.js → WarningFilled.js} +1 -1
  13. package/dist/components/Menu/MenuPopover.js +1 -1
  14. package/dist/components/buttons/PillButton/pillButton.cva.js +1 -1
  15. package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -1
  16. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +7 -4
  17. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +10 -4
  18. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +7 -4
  19. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +16 -5
  20. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +3 -2
  21. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +30 -23
  22. package/dist/components/inputs/File/FileUpload.js +1 -1
  23. package/dist/components/inputs/File/InputUpload.js +1 -1
  24. package/dist/components/inputs/File/shared/FileUploadContentError.js +1 -1
  25. package/dist/components/inputs/File/shared/InputUploadContent.js +10 -4
  26. package/dist/components/inputs/File/shared/InputUploadFilled.js +36 -22
  27. package/dist/components/inputs/File/shared/fileUpload.cva.js +3 -2
  28. package/dist/components/inputs/File/shared/inputUploadButton.cva.js +6 -5
  29. package/dist/components/inputs/FormField/FormFieldLabel.d.ts +3 -2
  30. package/dist/components/inputs/FormField/FormFieldLabel.js +8 -2
  31. package/dist/components/inputs/Input/TextArea/TextArea.js +6 -9
  32. package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -0
  33. package/dist/components/inputs/Input/TextInput/TextInput.js +26 -3
  34. package/dist/components/inputs/Input/shared/InputContent.js +67 -59
  35. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +3 -2
  36. package/dist/components/inputs/Selection/shared/SelectBase.js +2 -1
  37. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  38. package/dist/components/inputs/Selection/shared/SelectInput.js +84 -90
  39. package/dist/components/inputs/Selection/shared/SelectInputTags.d.ts +11 -0
  40. package/dist/components/inputs/Selection/shared/SelectInputTags.js +22 -0
  41. package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
  42. package/dist/components/inputs/Selection/shared/SelectListBox.js +56 -45
  43. package/dist/components/inputs/Selection/shared/select.context.js +1 -0
  44. package/dist/components/inputs/Selection/shared/select.types.d.ts +8 -0
  45. package/dist/components/inputs/shared/InputClear.d.ts +3 -1
  46. package/dist/components/inputs/shared/InputClear.js +4 -3
  47. package/dist/components/inputs/shared/input.cva.js +18 -17
  48. package/dist/components/inputs/shared/label.cva.js +2 -2
  49. package/dist/components/overlays/BottomSheet/BottomSheet.js +17 -12
  50. package/dist/components/overlays/Tooltip/Tooltip.d.ts +4 -2
  51. package/dist/components/overlays/Tooltip/Tooltip.js +32 -6
  52. package/dist/components/overlays/Tooltip/tooltip.cva.d.ts +21 -0
  53. package/dist/components/overlays/Tooltip/tooltip.cva.js +60 -0
  54. package/dist/components/segment/Segment.js +8 -2
  55. package/dist/components/segment/SegmentItem.js +4 -2
  56. package/dist/components/table/CellText.js +2 -2
  57. package/dist/components/table/HeaderText.js +1 -1
  58. package/dist/components/table/Table.js +34 -16
  59. package/dist/components/table/table.cva.d.ts +7 -3
  60. package/dist/components/table/table.cva.js +37 -11
  61. package/dist/config/uiConfig.context.d.ts +3 -1
  62. package/dist/config/uiConfig.context.js +6 -1
  63. package/dist/config/uiStyle.context.d.ts +2 -1
  64. package/dist/helpers/dynamicColumns.js +2 -2
  65. package/dist/helpers/dynamicInputs.d.ts +2 -0
  66. package/dist/helpers/dynamicInputs.js +5 -3
  67. package/dist/hooks/useAutosave.js +4 -1
  68. package/dist/hooks/useTableColumnConfig.js +5 -1
  69. package/dist/index.d.ts +12 -6
  70. package/dist/index.js +15 -11
  71. package/dist/utils/date-time.utils.js +12 -12
  72. package/dist/utils/dom.utils.js +2 -2
  73. package/dist/utils/file.utils.js +1 -1
  74. package/dist/utils/isEqual.js +2 -1
  75. package/dist/utils/object.utils.js +2 -2
  76. package/dist/utils/{rest/rest.utils.js → rest.utils.js} +1 -1
  77. package/dist/utils/vendor/acl/AclGuard.d.ts +8 -0
  78. package/dist/utils/vendor/acl/AclGuard.js +15 -0
  79. package/dist/utils/vendor/acl/Can.d.ts +9 -0
  80. package/dist/utils/vendor/acl/Can.js +18 -0
  81. package/dist/utils/vendor/acl/ability.context.d.ts +15 -0
  82. package/dist/utils/vendor/acl/ability.context.js +37 -0
  83. package/dist/utils/vendor/acl/appAbility.types.d.ts +3 -0
  84. package/dist/utils/vendor/auth/AuthGuard.d.ts +6 -0
  85. package/dist/utils/vendor/auth/AuthGuard.js +26 -0
  86. package/dist/utils/vendor/auth/auth.context.d.ts +21 -0
  87. package/dist/utils/vendor/auth/auth.context.js +36 -0
  88. package/dist/utils/vendor/auth/withPrivateAuthGuard.d.ts +6 -0
  89. package/dist/utils/vendor/auth/withPrivateAuthGuard.js +17 -0
  90. package/dist/utils/vendor/error-handling.js +1 -1
  91. package/dist/utils/{rest/rest-client.d.ts → vendor/rest-client.types.d.ts} +8 -14
  92. package/dist/utils/zod.utils.d.ts +2 -1
  93. package/package.json +2 -2
  94. package/dist/hooks/useSingletonMutation.d.ts +0 -4
  95. package/dist/hooks/useSingletonMutation.js +0 -27
  96. package/dist/utils/rest/interceptors/logging.interceptor.d.ts +0 -2
  97. package/dist/utils/rest/interceptors/logging.interceptor.js +0 -17
  98. package/dist/utils/rest/interceptors/response.interceptor.d.ts +0 -2
  99. package/dist/utils/rest/interceptors/response.interceptor.js +0 -25
  100. package/dist/utils/rest/rest-client.js +0 -62
  101. /package/dist/assets/icons/{Warningfilled.d.ts → WarningFilled.d.ts} +0 -0
  102. /package/dist/utils/{rest/rest.utils.d.ts → rest.utils.d.ts} +0 -0
  103. /package/dist/utils/{rest/interceptors → vendor}/rest-interceptor.d.ts +0 -0
  104. /package/dist/utils/{rest/interceptors → vendor}/rest-interceptor.js +0 -0
@@ -1,62 +0,0 @@
1
- import axios from "axios";
2
- import { z } from "zod";
3
- import { LoggingInterceptor } from "./interceptors/logging.interceptor.js";
4
- import { ResponseInterceptor } from "./interceptors/response.interceptor.js";
5
- import { SharedErrorHandler } from "../vendor/error-handling.js";
6
- class RestClient {
7
- constructor({
8
- config,
9
- interceptors
10
- } = {}) {
11
- this.client = axios.create(config);
12
- const defaultInterceptors = [LoggingInterceptor, ResponseInterceptor];
13
- this.attachInterceptors(defaultInterceptors);
14
- this.attachInterceptors(interceptors);
15
- }
16
- attachInterceptors(interceptors, ...args) {
17
- if (interceptors != null) {
18
- interceptors.forEach((interceptor) => this.attachInterceptor(interceptor, ...args));
19
- }
20
- }
21
- attachInterceptor(interceptor, ...args) {
22
- interceptor.addInterceptor(this.client, ...args);
23
- }
24
- ejectInterceptor(interceptor) {
25
- interceptor.removeInterceptor(this.client);
26
- }
27
- async get(requestInfo, url, requestConfig) {
28
- return this.makeRequest(requestInfo, { ...requestConfig, method: "get", url });
29
- }
30
- async post(requestInfo, url, data, requestConfig) {
31
- return this.makeRequest(requestInfo, { ...requestConfig, method: "post", url, data });
32
- }
33
- async patch(requestInfo, url, data, requestConfig) {
34
- return this.makeRequest(requestInfo, { ...requestConfig, method: "patch", url, data });
35
- }
36
- async put(requestInfo, url, data, requestConfig) {
37
- return this.makeRequest(requestInfo, { ...requestConfig, method: "put", url, data });
38
- }
39
- async delete(requestInfo, url, data, requestConfig) {
40
- return this.makeRequest(requestInfo, { ...requestConfig, method: "delete", url, data });
41
- }
42
- async makeRequest(requestInfo, requestConfig) {
43
- const errorStack = new Error().stack;
44
- try {
45
- const { rawResponse, ...config } = requestConfig;
46
- const res = await this.client(config);
47
- const resData = requestInfo.resSchema.parse(res.data);
48
- return rawResponse ? { ...res, data: resData } : resData;
49
- } catch (e) {
50
- if (e instanceof z.ZodError) {
51
- e.name = "BE Response schema mismatch - ZodError";
52
- e.stack = [e.stack, ...errorStack?.split("\n").slice(2) ?? []].join("\n");
53
- }
54
- const errorHandler = requestInfo.errorHandler ?? SharedErrorHandler;
55
- errorHandler.rethrowError(e);
56
- throw e;
57
- }
58
- }
59
- }
60
- export {
61
- RestClient
62
- };