@commercelayer/app-elements 0.0.79 → 0.1.0

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 (131) hide show
  1. package/dist/{Async-2e9c3da2.js → Async-566ec3f7.js} +3 -3
  2. package/dist/{InputDateComponent-fe3ffd00.js → InputDateComponent-4461b3e6.js} +3 -3
  3. package/dist/{Select-be90391b.js → Select-89937223.js} +3 -3
  4. package/dist/helpers/appsNavigation.d.ts +1 -1
  5. package/dist/hooks/useOverlay.d.ts +36 -0
  6. package/dist/{main-bd408fbe.js → main-795be39b.js} +7405 -7297
  7. package/dist/main.d.ts +23 -40
  8. package/dist/main.js +99 -100
  9. package/dist/mocks/setup.d.ts +3 -0
  10. package/dist/{overrides-684ed062.js → overrides-346bb0f6.js} +2 -2
  11. package/dist/providers/TokenProvider/TokenProvider.d.ts +15 -11
  12. package/dist/providers/TokenProvider/getInfoFromJwt.d.ts +3 -2
  13. package/dist/providers/TokenProvider/url.d.ts +3 -2
  14. package/dist/providers/TokenProvider/validateToken.d.ts +6 -1
  15. package/dist/style.css +1 -1
  16. package/dist/ui/atoms/Section.d.ts +31 -0
  17. package/dist/ui/atoms/Table/Table.d.ts +21 -0
  18. package/dist/ui/atoms/Table/Td.d.ts +8 -0
  19. package/dist/ui/atoms/{tables → Table}/index.d.ts +3 -2
  20. package/dist/ui/{lists → composite}/ListDetails.d.ts +1 -1
  21. package/dist/ui/composite/TableData.d.ts +23 -0
  22. package/dist/ui/{hook-form → forms/Form}/HookedForm.d.ts +1 -1
  23. package/dist/ui/forms/Form/index.d.ts +1 -0
  24. package/dist/ui/{hook-form → forms/Input}/HookedInput.d.ts +4 -4
  25. package/dist/ui/forms/{Input.d.ts → Input/Input.d.ts} +2 -3
  26. package/dist/ui/forms/Input/index.d.ts +2 -0
  27. package/dist/ui/{hook-form → forms/InputCheckbox}/HookedInputCheckbox.d.ts +4 -4
  28. package/dist/ui/forms/{InputCheckbox.d.ts → InputCheckbox/InputCheckbox.d.ts} +2 -2
  29. package/dist/ui/forms/InputCheckbox/index.d.ts +2 -0
  30. package/dist/ui/forms/InputCheckboxGroup.d.ts +2 -3
  31. package/dist/ui/{hook-form → forms/InputCurrency}/HookedInputCurrency.d.ts +4 -4
  32. package/dist/ui/forms/InputCurrency/InputCurrency.d.ts +48 -0
  33. package/dist/ui/forms/InputCurrency/index.d.ts +3 -58
  34. package/dist/ui/forms/InputCurrency/utils.d.ts +10 -0
  35. package/dist/ui/forms/InputCurrencyRange.d.ts +8 -5
  36. package/dist/ui/{hook-form → forms/InputDate}/HookedInputDate.d.ts +4 -4
  37. package/dist/ui/forms/InputDate/InputDate.d.ts +4 -0
  38. package/dist/ui/forms/InputDate/InputDateComponent.d.ts +1 -2
  39. package/dist/ui/forms/InputDate/index.d.ts +2 -5
  40. package/dist/ui/{hook-form → forms/InputDateRange}/HookedInputDateRange.d.ts +4 -4
  41. package/dist/ui/forms/{InputDateRange.d.ts → InputDateRange/InputDateRange.d.ts} +3 -4
  42. package/dist/ui/forms/InputDateRange/index.d.ts +2 -0
  43. package/dist/ui/forms/InputFeedback.d.ts +2 -3
  44. package/dist/ui/forms/InputFile.d.ts +6 -2
  45. package/dist/ui/forms/InputJson.d.ts +2 -3
  46. package/dist/ui/{hook-form → forms/InputMetadata}/HookedInputMetadata.d.ts +3 -3
  47. package/dist/ui/forms/InputMetadata/index.d.ts +1 -0
  48. package/dist/ui/forms/InputRadioGroup.d.ts +9 -4
  49. package/dist/ui/forms/InputReadonly.d.ts +3 -3
  50. package/dist/ui/{resources/RelationshipSelector → forms/InputResourceGroup}/Checkbox.d.ts +1 -1
  51. package/dist/ui/forms/InputResourceGroup/HookedInputResourceGroup.d.ts +15 -0
  52. package/dist/ui/forms/InputResourceGroup/InputResourceGroup.d.ts +28 -0
  53. package/dist/ui/forms/InputResourceGroup/index.d.ts +2 -0
  54. package/dist/ui/forms/InputSelect/Async.d.ts +1 -1
  55. package/dist/ui/{hook-form → forms/InputSelect}/HookedInputSelect.d.ts +4 -4
  56. package/dist/ui/forms/InputSelect/InputSelect.d.ts +91 -0
  57. package/dist/ui/forms/InputSelect/Select.d.ts +1 -1
  58. package/dist/ui/forms/InputSelect/index.d.ts +2 -91
  59. package/dist/ui/forms/InputSimpleSelect/HookedInputSimpleSelect.d.ts +21 -0
  60. package/dist/ui/forms/InputSimpleSelect/InputSimpleSelect.d.ts +12 -0
  61. package/dist/ui/forms/InputSimpleSelect/index.d.ts +2 -0
  62. package/dist/ui/{hook-form → forms/InputSpinner}/HookedInputSpinner.d.ts +4 -4
  63. package/dist/ui/forms/{InputSpinner.d.ts → InputSpinner/InputSpinner.d.ts} +2 -3
  64. package/dist/ui/forms/InputSpinner/index.d.ts +2 -0
  65. package/dist/ui/{hook-form/HookedInputToggleBox.d.ts → forms/InputSwitch/HookedInputSwitch.d.ts} +6 -6
  66. package/dist/ui/forms/InputSwitch/InputSwitch.d.ts +5 -0
  67. package/dist/ui/forms/InputSwitch/index.d.ts +2 -0
  68. package/dist/ui/forms/InputTextArea.d.ts +2 -2
  69. package/dist/ui/forms/InputToggleButton/HookedInputToggleButton.d.ts +18 -0
  70. package/dist/ui/forms/{ToggleButtons.d.ts → InputToggleButton/InputToggleButton.d.ts} +7 -6
  71. package/dist/ui/forms/InputToggleButton/index.d.ts +2 -0
  72. package/dist/ui/forms/Label.d.ts +6 -3
  73. package/dist/ui/forms/Legend.d.ts +14 -0
  74. package/dist/ui/{hook-form → forms/ReactHookForm}/HookedValidationApiError.d.ts +3 -3
  75. package/dist/ui/{hook-form → forms/ReactHookForm}/HookedValidationError.d.ts +3 -3
  76. package/dist/ui/forms/ReactHookForm/index.d.ts +4 -0
  77. package/dist/ui/{hook-form → forms/ReactHookForm}/useValidationFeedback.d.ts +1 -1
  78. package/dist/ui/internals/InputWrapper.d.ts +6 -1
  79. package/dist/ui/resources/Filters/types.d.ts +4 -4
  80. package/dist/ui/resources/Filters/useFilters.d.ts +2 -1
  81. package/dist/ui/resources/ResourceList/ResourceList.d.ts +64 -0
  82. package/dist/ui/resources/ResourceList/index.d.ts +1 -45
  83. package/dist/{unsupportedIterableToArray-a4407b22.js → unsupportedIterableToArray-a3020d44.js} +1 -1
  84. package/dist/utils/children.d.ts +4 -3
  85. package/dist/utils/extractHeaders.d.ts +2 -1
  86. package/dist/utils/text.d.ts +8 -1
  87. package/package.json +26 -26
  88. package/dist/hooks/useOverlayNavigation.d.ts +0 -27
  89. package/dist/ui/atoms/Legend.d.ts +0 -32
  90. package/dist/ui/atoms/Overlay.d.ts +0 -20
  91. package/dist/ui/atoms/tables/Td.d.ts +0 -9
  92. package/dist/ui/forms/InputToggleBox.d.ts +0 -9
  93. package/dist/ui/forms/InputToggleListBox.d.ts +0 -15
  94. package/dist/ui/forms/RadioButtons.d.ts +0 -19
  95. package/dist/ui/hook-form/HookedInputToggleListBox.d.ts +0 -21
  96. package/dist/ui/hook-form/HookedRelationshipSelector.d.ts +0 -18
  97. package/dist/ui/hook-form/HookedToggleButtons.d.ts +0 -18
  98. package/dist/ui/resources/RelationshipSelector/index.d.ts +0 -26
  99. package/dist/ui/resources/ResourceList/index.test.d.ts +0 -1
  100. package/dist/ui/tables/Table.d.ts +0 -10
  101. package/dist/ui/tables/TableData.d.ts +0 -14
  102. package/dist/utils/tests.d.ts +0 -1
  103. /package/dist/{ui/atoms/Legend.test.d.ts → hooks/useOverlay.test.d.ts} +0 -0
  104. /package/dist/ui/atoms/{Overlay.test.d.ts → Section.test.d.ts} +0 -0
  105. /package/dist/ui/{tables → atoms/Table}/Table.test.d.ts +0 -0
  106. /package/dist/ui/atoms/{tables → Table}/Th.d.ts +0 -0
  107. /package/dist/ui/atoms/{tables → Table}/Tr.d.ts +0 -0
  108. /package/dist/ui/{lists → composite}/List.d.ts +0 -0
  109. /package/dist/ui/{lists → composite}/List.test.d.ts +0 -0
  110. /package/dist/ui/{lists → composite}/ListDetails.test.d.ts +0 -0
  111. /package/dist/ui/{lists → composite}/ListDetailsItem.d.ts +0 -0
  112. /package/dist/ui/{lists → composite}/ListDetailsItem.test.d.ts +0 -0
  113. /package/dist/ui/{lists → composite}/ListItem.d.ts +0 -0
  114. /package/dist/ui/{lists → composite}/ListItem.test.d.ts +0 -0
  115. /package/dist/ui/{tables → composite}/TableData.test.d.ts +0 -0
  116. /package/dist/ui/forms/{Input.test.d.ts → Input/Input.test.d.ts} +0 -0
  117. /package/dist/ui/forms/{InputCheckbox.test.d.ts → InputCheckbox/InputCheckbox.test.d.ts} +0 -0
  118. /package/dist/ui/forms/InputCurrency/{index.test.d.ts → InputCurrency.test.d.ts} +0 -0
  119. /package/dist/ui/forms/InputDate/{InputDate.test.d.ts → InputDateComponent.test.d.ts} +0 -0
  120. /package/dist/ui/forms/{InputDateRange.test.d.ts → InputDateRange/InputDateRange.test.d.ts} +0 -0
  121. /package/dist/ui/{resources/RelationshipSelector → forms/InputResourceGroup}/FullList.d.ts +0 -0
  122. /package/dist/ui/{resources/RelationshipSelector → forms/InputResourceGroup}/utils.d.ts +0 -0
  123. /package/dist/ui/{resources/RelationshipSelector → forms/InputResourceGroup}/utils.test.d.ts +0 -0
  124. /package/dist/ui/forms/InputSelect/{index.test.d.ts → InputSelect.test.d.ts} +0 -0
  125. /package/dist/ui/forms/{InputSpinner.test.d.ts → InputSimpleSelect/InputSimpleSelect.test.d.ts} +0 -0
  126. /package/dist/ui/forms/{InputToggleBox.test.d.ts → InputSpinner/InputSpinner.test.d.ts} +0 -0
  127. /package/dist/ui/forms/{InputToggleListBox.test.d.ts → InputSwitch/InputSwitch.test.d.ts} +0 -0
  128. /package/dist/ui/forms/{RadioButtons.test.d.ts → InputToggleButton/InputToggleButton.test.d.ts} +0 -0
  129. /package/dist/ui/{hook-form → forms/ReactHookForm}/setApiFormErrors.d.ts +0 -0
  130. /package/dist/ui/{hook-form → forms/ReactHookForm}/setApiFormErrors.test.d.ts +0 -0
  131. /package/dist/ui/{forms/ToggleButtons.test.d.ts → resources/ResourceList/ResourceList.test.d.ts} +0 -0
package/dist/main.d.ts CHANGED
@@ -8,7 +8,7 @@ export { getAvatarSrcFromRate, getParcelTrackingDetail, getParcelTrackingDetails
8
8
  export { useClickAway } from './hooks/useClickAway';
9
9
  export { useDelayShow } from './hooks/useDelayShow';
10
10
  export { useIsChanged } from './hooks/useIsChanged';
11
- export { useOverlayNavigation } from './hooks/useOverlayNavigation';
11
+ export { useOverlay } from './hooks/useOverlay';
12
12
  export { CoreSdkProvider, useCoreApi, useCoreSdkProvider } from './providers/CoreSdkProvider';
13
13
  export { ErrorBoundary } from './providers/ErrorBoundary';
14
14
  export { MetaTags, TokenProvider, useTokenProvider, type TokenProviderAllowedApp, type TokenProviderPermissionItem, type TokenProviderRoleActions, type TokenProviderRolePermissions, type TokenProviderTokenApplicationKind } from './providers/TokenProvider';
@@ -27,84 +27,67 @@ export { Grid } from './ui/atoms/Grid';
27
27
  export { Hint } from './ui/atoms/Hint';
28
28
  export { Hr } from './ui/atoms/Hr';
29
29
  export { Icon, iconNames } from './ui/atoms/Icon';
30
- export { Legend } from './ui/atoms/Legend';
31
- export { Overlay } from './ui/atoms/Overlay';
32
30
  export { PageHeading } from './ui/atoms/PageHeading';
33
31
  export { Pagination } from './ui/atoms/Pagination';
34
32
  export { Progress } from './ui/atoms/Progress';
35
33
  export { RadialProgress } from './ui/atoms/RadialProgress';
34
+ export { Section } from './ui/atoms/Section';
36
35
  export { Skeleton, SkeletonItem } from './ui/atoms/Skeleton';
37
36
  export { SkeletonTemplate, withSkeletonTemplate } from './ui/atoms/SkeletonTemplate';
38
37
  export { Spacer } from './ui/atoms/Spacer';
39
38
  export { Stack } from './ui/atoms/Stack';
40
39
  export { StatusDot } from './ui/atoms/StatusDot';
41
40
  export { Steps } from './ui/atoms/Steps';
41
+ export { Table, Td, Th, Tr } from './ui/atoms/Table';
42
42
  export { Tab, Tabs } from './ui/atoms/Tabs';
43
43
  export { Tag } from './ui/atoms/Tag';
44
44
  export { Text } from './ui/atoms/Text';
45
45
  export { DropdownMenu, DropdownMenuDivider, DropdownMenuItem } from './ui/atoms/dropdown';
46
- export { Td, Th, Tr } from './ui/atoms/tables';
47
46
  export { ActionButtons } from './ui/composite/ActionButtons';
48
47
  export { CardDialog } from './ui/composite/CardDialog';
49
48
  export { ContextMenu } from './ui/composite/ContextMenu';
49
+ export { List } from './ui/composite/List';
50
+ export { ListDetails } from './ui/composite/ListDetails';
51
+ export { ListDetailsItem } from './ui/composite/ListDetailsItem';
52
+ export { ListItem } from './ui/composite/ListItem';
50
53
  export { PageError } from './ui/composite/PageError';
51
54
  export { PageLayout } from './ui/composite/PageLayout';
52
55
  export { PageSkeleton } from './ui/composite/PageSkeleton';
53
56
  export { Report } from './ui/composite/Report';
54
57
  export { SearchBar } from './ui/composite/SearchBar';
58
+ export { TableData } from './ui/composite/TableData';
55
59
  export { Timeline, type TimelineEvent } from './ui/composite/Timeline';
56
- export { Input } from './ui/forms/Input';
57
- export { InputCheckbox } from './ui/forms/InputCheckbox';
60
+ export { HookedForm } from './ui/forms/Form';
61
+ export { HookedInput, Input } from './ui/forms/Input';
62
+ export { HookedInputCheckbox, InputCheckbox } from './ui/forms/InputCheckbox';
58
63
  export { InputCheckboxGroup } from './ui/forms/InputCheckboxGroup';
59
- export { InputCurrency, formatCentsToCurrency } from './ui/forms/InputCurrency';
64
+ export { HookedInputCurrency, InputCurrency, formatCentsToCurrency, type InputCurrencyProps } from './ui/forms/InputCurrency';
60
65
  export { InputCurrencyRange } from './ui/forms/InputCurrencyRange';
61
- export { InputDate } from './ui/forms/InputDate';
62
- export { InputDateRange } from './ui/forms/InputDateRange';
66
+ export { HookedInputDate, InputDate } from './ui/forms/InputDate';
67
+ export { HookedInputDateRange, InputDateRange } from './ui/forms/InputDateRange';
63
68
  export { InputFeedback } from './ui/forms/InputFeedback';
64
69
  export { InputFile } from './ui/forms/InputFile';
65
70
  export { InputJson } from './ui/forms/InputJson';
71
+ export { HookedInputMetadata } from './ui/forms/InputMetadata';
66
72
  export { InputRadioGroup } from './ui/forms/InputRadioGroup';
67
73
  export { InputReadonly } from './ui/forms/InputReadonly';
68
- export { InputSelect, flatSelectValues, getDefaultValueFromFlatten, isGroupedSelectValues, isMultiValueSelected, isSingleValueSelected } from './ui/forms/InputSelect';
69
- export type { SelectValue } from './ui/forms/InputSelect';
70
- export { InputSpinner } from './ui/forms/InputSpinner';
74
+ export { HookedInputResourceGroup, InputResourceGroup } from './ui/forms/InputResourceGroup';
75
+ export { HookedInputSelect, InputSelect, flatSelectValues, getDefaultValueFromFlatten, isGroupedSelectValues, isMultiValueSelected, isSingleValueSelected, type InputSelectProps, type SelectValue } from './ui/forms/InputSelect';
76
+ export { HookedInputSimpleSelect, InputSimpleSelect } from './ui/forms/InputSimpleSelect';
77
+ export { HookedInputSpinner, InputSpinner } from './ui/forms/InputSpinner';
78
+ export { HookedInputSwitch, InputSwitch } from './ui/forms/InputSwitch';
71
79
  export { InputTextArea } from './ui/forms/InputTextArea';
72
- export { InputToggleBox } from './ui/forms/InputToggleBox';
73
- export { InputToggleListBox } from './ui/forms/InputToggleListBox';
80
+ export { HookedInputToggleButton, InputToggleButton, type InputToggleButtonProps, type ToggleButtonOption } from './ui/forms/InputToggleButton';
74
81
  export { Label } from './ui/forms/Label';
75
- export { RadioButtons } from './ui/forms/RadioButtons';
76
- export { ToggleButtons } from './ui/forms/ToggleButtons';
77
- export { HookedForm } from './ui/hook-form/HookedForm';
78
- export { HookedInput } from './ui/hook-form/HookedInput';
79
- export { HookedInputCheckbox } from './ui/hook-form/HookedInputCheckbox';
80
- export { HookedInputCurrency } from './ui/hook-form/HookedInputCurrency';
81
- export { HookedInputDate } from './ui/hook-form/HookedInputDate';
82
- export { HookedInputDateRange } from './ui/hook-form/HookedInputDateRange';
83
- export { HookedInputMetadata } from './ui/hook-form/HookedInputMetadata';
84
- export { HookedInputSelect } from './ui/hook-form/HookedInputSelect';
85
- export { HookedInputSpinner } from './ui/hook-form/HookedInputSpinner';
86
- export { HookedInputToggleBox } from './ui/hook-form/HookedInputToggleBox';
87
- export { HookedInputToggleListBox } from './ui/hook-form/HookedInputToggleListBox';
88
- export { HookedRelationshipSelector } from './ui/hook-form/HookedRelationshipSelector';
89
- export { HookedToggleButtons } from './ui/hook-form/HookedToggleButtons';
90
- export { HookedValidationApiError } from './ui/hook-form/HookedValidationApiError';
91
- export { HookedValidationError } from './ui/hook-form/HookedValidationError';
92
- export { setApiFormErrors } from './ui/hook-form/setApiFormErrors';
93
- export { useValidationFeedback } from './ui/hook-form/useValidationFeedback';
94
- export { List } from './ui/lists/List';
95
- export { ListDetails } from './ui/lists/ListDetails';
96
- export { ListDetailsItem } from './ui/lists/ListDetailsItem';
97
- export { ListItem } from './ui/lists/ListItem';
82
+ export { Legend } from './ui/forms/Legend';
83
+ export { HookedValidationApiError, HookedValidationError, setApiFormErrors, useValidationFeedback } from './ui/forms/ReactHookForm';
98
84
  export { FiltersForm, FiltersNav, FiltersSearchBar, makeFilterAdapters, useFilters } from './ui/resources/Filters';
99
85
  export { LineItems } from './ui/resources/LineItems';
100
86
  export { ListItemOrder } from './ui/resources/ListItemOrder';
101
87
  export { ListItemsMetadata } from './ui/resources/ListItemsMetadata';
102
88
  export { OrderSummary } from './ui/resources/OrderSummary';
103
89
  export { OrderTimeline } from './ui/resources/OrderTimeline';
104
- export { RelationshipSelector } from './ui/resources/RelationshipSelector';
105
90
  export { ResourceList } from './ui/resources/ResourceList';
106
91
  export { ResourceTags } from './ui/resources/ResourceTags';
107
92
  export { ShipmentParcels } from './ui/resources/ShipmentParcels';
108
- export { Table } from './ui/tables/Table';
109
- export { TableData } from './ui/tables/TableData';
110
93
  export { getOrderDisplayStatus, getOrderFulfillmentStatusName, getOrderPaymentStatusName, getOrderStatusName, getOrderTransactionPastTense, getOrderTriggerAttributeName } from './dictionaries/orders';
package/dist/main.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ah as i, aW as b, ai as u, aj as l, ak as d, am as p, an as g, ao as c, ap as m, aX as I, aq as S, aY as k, ar as T, aa as D, aQ as y, aR as C, aS as B, as as h, ad as F, bO as H, bP as A, bQ as P, at as R, au as L, bt as v, bu as O, bv as x, bw as N, bx as V, by as f, bz as M, bA as w, bB as E, bC as G, bD as J, bE as Q, bF as U, bG as W, bH as X, av as Y, aw as Z, b3 as $, b4 as j, b5 as q, b6 as z, b8 as K, b9 as _, ba as aa, bb as ea, bc as sa, bd as ta, be as oa, bf as ra, bg as na, bm as ia, bn as ba, bo as ua, bp as la, bq as da, ay as pa, bT as ga, bK as ca, bL as ma, bM as Ia, bN as Sa, bU as ka, bV as Ta, ae as Da, bW as ya, bX as Ca, az as Ba, aZ as ha, aA as Fa, a_ as Ha, a$ as Aa, aB as Pa, aC as Ra, aD as La, br as va, bY as Oa, b0 as xa, bZ as Na, b_ as Va, b1 as fa, b$ as Ma, aE as wa, aF as Ea, aG as Ga, aI as Ja, aJ as Qa, aK as Ua, aL as Wa, aM as Xa, c0 as Ya, c1 as Za, aN as $a, aO as ja, aT as qa, aP as za, aU as Ka, b2 as _a, bs as ae, af as ee, aV as se, al as te, X as oe, W as re, bh as ne, b7 as ie, R as be, Y as ue, Z as le, $ as de, bi as pe, S as ge, T as ce, c2 as me, c3 as Ie, c4 as Se, c5 as ke, c6 as Te, c7 as De, a0 as ye, a1 as Ce, a2 as Be, a3 as he, M as Fe, a4 as He, a5 as Ae, ax as Pe, O as Re, bj as Le, bk as ve, bl as Oe, bR as xe, N as Ne, Q as Ve, bI as fe, U as Me, V as we, a6 as Ee, ab as Ge, ac as Je, a7 as Qe, bS as Ue, a8 as We, a9 as Xe, ag as Ye, bJ as Ze, aH as $e } from "./main-bd408fbe.js";
1
+ import { ah as i, aW as u, ai as b, aj as l, ak as p, am as d, an as c, ao as g, ap as m, aX as S, aq as I, aY as k, ar as T, aa as D, aT as C, aU as y, aV as h, as as F, ad as H, bQ as A, bR as P, bS as R, at as B, au as L, b8 as O, b9 as v, bb as V, be as f, bi as N, bk as w, bp as M, bs as x, bu as E, bB as G, bD as J, bF as Q, bI as U, bM as W, bN as X, av as Y, aw as Z, ba as $, bc as j, bd as q, bf as z, bh as K, bj as _, bl as aa, bm as ea, bn as sa, bo as ta, bq as ra, br as oa, bt as na, bv as ia, bC as ua, bE as ba, bG as la, bH as pa, bJ as da, bK as ca, bL as ga, bV as ma, aZ as Sa, a_ as Ia, a$ as ka, b0 as Ta, bW as Da, bX as Ca, ae as ya, bY as ha, bZ as Fa, b1 as Ha, ay as Aa, b2 as Pa, b3 as Ra, az as Ba, aA as La, aB as Oa, b4 as va, b_ as Va, b$ as fa, b5 as Na, aC as wa, c0 as Ma, aD as xa, aE as Ea, aF as Ga, aH as Ja, aI as Qa, aJ as Ua, aK as Wa, aP as Xa, aL as Ya, b6 as Za, aQ as $a, aR as ja, aM as qa, aS as za, aN as Ka, b7 as _a, af as ae, aO as ee, al as se, X as te, W as re, bw as oe, bg as ne, R as ie, Y as ue, Z as be, $ as le, bx as pe, S as de, T as ce, c1 as ge, c2 as me, c3 as Se, c4 as Ie, c5 as ke, c6 as Te, a0 as De, a1 as Ce, a2 as ye, a3 as he, M as Fe, a4 as He, a5 as Ae, ax as Pe, O as Re, by as Be, bz as Le, bA as Oe, bT as ve, N as Ve, Q as fe, bO as Ne, U as we, V as Me, a6 as xe, ab as Ee, ac as Ge, a7 as Je, bU as Qe, a8 as Ue, a9 as We, ag as Xe, bP as Ye, aG as Ze } from "./main-795be39b.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  import "@commercelayer/sdk";
@@ -6,42 +6,42 @@ import "react-hook-form";
6
6
  import "query-string";
7
7
  export {
8
8
  i as A,
9
- b as ActionButtons,
10
- u as Avatar,
9
+ u as ActionButtons,
10
+ b as Avatar,
11
11
  l as AvatarLetter,
12
- d as Badge,
13
- p as BlockCode,
14
- g as Button,
15
- c as ButtonFilter,
12
+ p as Badge,
13
+ d as BlockCode,
14
+ c as Button,
15
+ g as ButtonFilter,
16
16
  m as Card,
17
- I as CardDialog,
18
- S as Container,
17
+ S as CardDialog,
18
+ I as Container,
19
19
  k as ContextMenu,
20
20
  T as CopyToClipboard,
21
21
  D as CoreSdkProvider,
22
- y as DropdownMenu,
23
- C as DropdownMenuDivider,
24
- B as DropdownMenuItem,
25
- h as EmptyState,
26
- F as ErrorBoundary,
27
- H as FiltersForm,
28
- A as FiltersNav,
29
- P as FiltersSearchBar,
30
- R as Grid,
22
+ C as DropdownMenu,
23
+ y as DropdownMenuDivider,
24
+ h as DropdownMenuItem,
25
+ F as EmptyState,
26
+ H as ErrorBoundary,
27
+ A as FiltersForm,
28
+ P as FiltersNav,
29
+ R as FiltersSearchBar,
30
+ B as Grid,
31
31
  L as Hint,
32
- v as HookedForm,
33
- O as HookedInput,
34
- x as HookedInputCheckbox,
35
- N as HookedInputCurrency,
36
- V as HookedInputDate,
37
- f as HookedInputDateRange,
32
+ O as HookedForm,
33
+ v as HookedInput,
34
+ V as HookedInputCheckbox,
35
+ f as HookedInputCurrency,
36
+ N as HookedInputDate,
37
+ w as HookedInputDateRange,
38
38
  M as HookedInputMetadata,
39
- w as HookedInputSelect,
40
- E as HookedInputSpinner,
41
- G as HookedInputToggleBox,
42
- J as HookedInputToggleListBox,
43
- Q as HookedRelationshipSelector,
44
- U as HookedToggleButtons,
39
+ x as HookedInputResourceGroup,
40
+ E as HookedInputSelect,
41
+ G as HookedInputSimpleSelect,
42
+ J as HookedInputSpinner,
43
+ Q as HookedInputSwitch,
44
+ U as HookedInputToggleButton,
45
45
  W as HookedValidationApiError,
46
46
  X as HookedValidationError,
47
47
  Y as Hr,
@@ -56,41 +56,41 @@ export {
56
56
  ea as InputFeedback,
57
57
  sa as InputFile,
58
58
  ta as InputJson,
59
- oa as InputRadioGroup,
60
- ra as InputReadonly,
61
- na as InputSelect,
62
- ia as InputSpinner,
63
- ba as InputTextArea,
64
- ua as InputToggleBox,
65
- la as InputToggleListBox,
66
- da as Label,
67
- pa as Legend,
68
- ga as LineItems,
69
- ca as List,
70
- ma as ListDetails,
71
- Ia as ListDetailsItem,
72
- Sa as ListItem,
73
- ka as ListItemOrder,
74
- Ta as ListItemsMetadata,
75
- Da as MetaTags,
76
- ya as OrderSummary,
77
- Ca as OrderTimeline,
78
- Ba as Overlay,
79
- ha as PageError,
80
- Fa as PageHeading,
81
- Ha as PageLayout,
82
- Aa as PageSkeleton,
83
- Pa as Pagination,
84
- Ra as Progress,
85
- La as RadialProgress,
86
- va as RadioButtons,
87
- Oa as RelationshipSelector,
88
- xa as Report,
89
- Na as ResourceList,
90
- Va as ResourceTags,
91
- fa as SearchBar,
59
+ ra as InputRadioGroup,
60
+ oa as InputReadonly,
61
+ na as InputResourceGroup,
62
+ ia as InputSelect,
63
+ ua as InputSimpleSelect,
64
+ ba as InputSpinner,
65
+ la as InputSwitch,
66
+ pa as InputTextArea,
67
+ da as InputToggleButton,
68
+ ca as Label,
69
+ ga as Legend,
70
+ ma as LineItems,
71
+ Sa as List,
72
+ Ia as ListDetails,
73
+ ka as ListDetailsItem,
74
+ Ta as ListItem,
75
+ Da as ListItemOrder,
76
+ Ca as ListItemsMetadata,
77
+ ya as MetaTags,
78
+ ha as OrderSummary,
79
+ Fa as OrderTimeline,
80
+ Ha as PageError,
81
+ Aa as PageHeading,
82
+ Pa as PageLayout,
83
+ Ra as PageSkeleton,
84
+ Ba as Pagination,
85
+ La as Progress,
86
+ Oa as RadialProgress,
87
+ va as Report,
88
+ Va as ResourceList,
89
+ fa as ResourceTags,
90
+ Na as SearchBar,
91
+ wa as Section,
92
92
  Ma as ShipmentParcels,
93
- wa as Skeleton,
93
+ xa as Skeleton,
94
94
  Ea as SkeletonItem,
95
95
  Ga as SkeletonTemplate,
96
96
  Ja as Spacer,
@@ -106,53 +106,52 @@ export {
106
106
  za as Text,
107
107
  Ka as Th,
108
108
  _a as Timeline,
109
- ae as ToggleButtons,
110
- ee as TokenProvider,
111
- se as Tr,
112
- te as badgeVariants,
113
- oe as computeFullname,
109
+ ae as TokenProvider,
110
+ ee as Tr,
111
+ se as badgeVariants,
112
+ te as computeFullname,
114
113
  re as downloadJsonAsFile,
115
- ne as flatSelectValues,
116
- ie as formatCentsToCurrency,
117
- be as formatDate,
114
+ oe as flatSelectValues,
115
+ ne as formatCentsToCurrency,
116
+ ie as formatDate,
118
117
  ue as formatDisplayName,
119
- le as formatResourceName,
120
- de as getAvatarSrcFromRate,
118
+ be as formatResourceName,
119
+ le as getAvatarSrcFromRate,
121
120
  pe as getDefaultValueFromFlatten,
122
- ge as getIsoDateAtDayEdge,
121
+ de as getIsoDateAtDayEdge,
123
122
  ce as getIsoDateAtDaysBefore,
124
- me as getOrderDisplayStatus,
125
- Ie as getOrderFulfillmentStatusName,
123
+ ge as getOrderDisplayStatus,
124
+ me as getOrderFulfillmentStatusName,
126
125
  Se as getOrderPaymentStatusName,
127
- ke as getOrderStatusName,
128
- Te as getOrderTransactionPastTense,
129
- De as getOrderTriggerAttributeName,
130
- ye as getParcelTrackingDetail,
126
+ Ie as getOrderStatusName,
127
+ ke as getOrderTransactionPastTense,
128
+ Te as getOrderTriggerAttributeName,
129
+ De as getParcelTrackingDetail,
131
130
  Ce as getParcelTrackingDetails,
132
- Be as getShipmentRate,
131
+ ye as getShipmentRate,
133
132
  he as getShipmentRates,
134
133
  Fe as goBack,
135
134
  He as hasBeenPurchased,
136
135
  Ae as hasSingleTracking,
137
136
  Pe as iconNames,
138
137
  Re as isAttachmentValidNote,
139
- Le as isGroupedSelectValues,
140
- ve as isMultiValueSelected,
138
+ Be as isGroupedSelectValues,
139
+ Le as isMultiValueSelected,
141
140
  Oe as isSingleValueSelected,
142
- xe as makeFilterAdapters,
143
- Ne as navigateToDetail,
144
- Ve as referenceOrigins,
145
- fe as setApiFormErrors,
146
- Me as sortAndGroupByDate,
147
- we as timeSeparator,
148
- Ee as useClickAway,
149
- Ge as useCoreApi,
150
- Je as useCoreSdkProvider,
151
- Qe as useDelayShow,
152
- Ue as useFilters,
153
- We as useIsChanged,
154
- Xe as useOverlayNavigation,
155
- Ye as useTokenProvider,
156
- Ze as useValidationFeedback,
157
- $e as withSkeletonTemplate
141
+ ve as makeFilterAdapters,
142
+ Ve as navigateToDetail,
143
+ fe as referenceOrigins,
144
+ Ne as setApiFormErrors,
145
+ we as sortAndGroupByDate,
146
+ Me as timeSeparator,
147
+ xe as useClickAway,
148
+ Ee as useCoreApi,
149
+ Ge as useCoreSdkProvider,
150
+ Je as useDelayShow,
151
+ Qe as useFilters,
152
+ Ue as useIsChanged,
153
+ We as useOverlay,
154
+ Xe as useTokenProvider,
155
+ Ye as useValidationFeedback,
156
+ Ze as withSkeletonTemplate
158
157
  };
@@ -1 +1,4 @@
1
+ declare global {
2
+ export function assertToBeDefined<T>(val: T): asserts val is NonNullable<T>;
3
+ }
1
4
  export {};
@@ -1,7 +1,7 @@
1
- import { d as Se, g as gr, _ as In, a as br, b as pr, c as fr, f as mr } from "./unsupportedIterableToArray-a4407b22.js";
1
+ import { d as Se, g as gr, _ as In, a as br, b as pr, c as fr, f as mr } from "./unsupportedIterableToArray-a3020d44.js";
2
2
  import * as B from "react";
3
3
  import { useLayoutEffect as vn, forwardRef as Ir, useContext as Te, createElement as me, Fragment as Be, createContext as Ct, useRef as oe, useState as Ie, useMemo as Ce, useCallback as Y, Component as vr, useEffect as hn } from "react";
4
- import { _ as hr, H as se, K as Cn } from "./main-bd408fbe.js";
4
+ import { _ as hr, H as se, K as Cn } from "./main-795be39b.js";
5
5
  import { createPortal as Cr } from "react-dom";
6
6
  function V() {
7
7
  return V = Object.assign ? Object.assign.bind() : function(t) {
@@ -19,27 +19,34 @@ export interface TokenProviderProps {
19
19
  */
20
20
  kind: TokenProviderTokenApplicationKind;
21
21
  /**
22
- * Slug of the current app. Can be one of imports, exports, webhooks, resources, orders or custom.
22
+ * Slug of the current app. It needs to match one of the allowed app slugs enabled in the dashboard.
23
+ * Example: `orders`, `imports`, `exports`, `shipments`, `webhooks`, `returns`
23
24
  * Will be used to persist token for current app only.
24
25
  */
25
26
  appSlug: TokenProviderAllowedApp;
27
+ /**
28
+ * Required when application is forked or running as self-hosted.
29
+ * It's used to perform a security check to test the validity of token against current organization.
30
+ */
31
+ organizationSlug?: string;
26
32
  /**
27
33
  * Base domain to be used for Commerce Layer API requests (eg. `commercelayer.io`)
28
34
  */
29
35
  domain?: string;
30
36
  /**
31
- * Callback invoked when token is not valid
37
+ * Automatically redirect to dashboard to start re-authentication flow and return to app with fresh token
38
+ */
39
+ reauthenticateOnInvalidAuth?: boolean;
40
+ /**
41
+ * Callback invoked when token is not valid.
42
+ * Can be used to manually handle re-authentication flow when `reauthenticateOnInvalidAuth` is false.
32
43
  */
33
44
  onInvalidAuth?: (info: {
34
45
  dashboardUrl: string;
35
46
  reason: string;
36
47
  }) => void;
37
48
  /**
38
- * Automatically redirect to dashboard to start re-authentication flow and return to app with fresh token
39
- */
40
- reauthenticateOnInvalidAuth?: boolean;
41
- /**
42
- * Element to be used as loader (eg: skeleton or spinner icon)
49
+ * UI element to be used as loader (eg: skeleton or spinner icon)
43
50
  */
44
51
  loadingElement?: ReactNode;
45
52
  /**
@@ -62,7 +69,4 @@ export interface TokenProviderProps {
62
69
  }
63
70
  export declare const AuthContext: import("react").Context<TokenProviderValue>;
64
71
  export declare const useTokenProvider: () => TokenProviderValue;
65
- export declare function TokenProvider({ appSlug, kind, domain, onInvalidAuth, reauthenticateOnInvalidAuth, loadingElement, errorElement, devMode, children, accessToken: accessTokenFromProp }: TokenProviderProps): JSX.Element;
66
- export declare namespace TokenProvider {
67
- var displayName: string;
68
- }
72
+ export declare const TokenProvider: React.FC<TokenProviderProps>;
@@ -1,7 +1,8 @@
1
1
  import { type Mode } from './types';
2
2
  export declare const getInfoFromJwt: (accessToken: string) => {
3
- slug?: string;
4
- kind?: string;
3
+ orgSlug?: string;
4
+ appKind?: string;
5
+ appId?: string;
5
6
  exp?: number;
6
7
  mode?: Mode;
7
8
  };
@@ -1,7 +1,8 @@
1
1
  import { type Mode } from './types';
2
2
  export declare function getOrgSlugFromCurrentUrl(): string;
3
- export declare function makeDashboardUrl({ domain, mode }: {
3
+ export declare function makeDashboardUrl({ domain, mode, organizationSlug }: {
4
4
  domain?: string;
5
5
  mode?: Mode;
6
+ organizationSlug?: string;
6
7
  }): string;
7
- export declare function makeReAuthenticationUrl(dashboardUrl: string, appName: string): string | undefined;
8
+ export declare function makeReAuthenticationUrl(dashboardUrl: string, appIdOrSlug?: string): string;
@@ -16,11 +16,16 @@ interface ValidToken {
16
16
  interface InvalidToken {
17
17
  isValidToken: false;
18
18
  }
19
- export declare function isValidTokenForCurrentApp({ accessToken, kind, domain, isProduction, currentMode }: {
19
+ export declare function isValidTokenForCurrentApp({ accessToken, kind, domain, isProduction, currentMode, organizationSlug }: {
20
20
  accessToken: string;
21
21
  kind: TokenProviderTokenApplicationKind;
22
22
  domain: string;
23
23
  isProduction: boolean;
24
24
  currentMode: Mode;
25
+ /**
26
+ * only required when app is self-hosted, to check if the token is valid for the current organization.
27
+ * When app is hosted by Commerce Layer, the organization slug is retrieved from the url subdomain.
28
+ */
29
+ organizationSlug?: string;
25
30
  }): Promise<ValidToken | InvalidToken>;
26
31
  export {};