@commercelayer/app-elements 0.2.0 → 0.3.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 (75) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +15 -14
  3. package/dist/{InputDateComponent-926e5e6d.js → InputDateComponent-dee358c1.js} +1 -1
  4. package/dist/hooks/useOnBlurFromContainer.d.ts +9 -0
  5. package/dist/main-49356a73.js +41117 -0
  6. package/dist/main.d.ts +5 -6
  7. package/dist/main.js +140 -142
  8. package/dist/mocks/data/customers.d.ts +2 -0
  9. package/dist/providers/CoreSdkProvider/useCoreApi.d.ts +23 -0
  10. package/dist/providers/TokenProvider/TokenProvider.d.ts +12 -13
  11. package/dist/style.css +1 -1
  12. package/dist/ui/atoms/A.d.ts +1 -1
  13. package/dist/ui/atoms/Avatar.d.ts +3 -0
  14. package/dist/ui/atoms/AvatarLetter/AvatarLetter.d.ts +23 -0
  15. package/dist/ui/atoms/AvatarLetter/colors.d.ts +2 -0
  16. package/dist/ui/atoms/AvatarLetter/index.d.ts +1 -0
  17. package/dist/ui/atoms/Badge.d.ts +5 -6
  18. package/dist/ui/atoms/Button.d.ts +4 -3
  19. package/dist/ui/atoms/Card.d.ts +1 -0
  20. package/dist/ui/atoms/Container.d.ts +6 -8
  21. package/dist/ui/atoms/CopyToClipboard.d.ts +2 -4
  22. package/dist/ui/atoms/Hr.d.ts +5 -4
  23. package/dist/ui/atoms/Icon/Icon.d.ts +18 -0
  24. package/dist/ui/atoms/{Icon.d.ts → Icon/icons.d.ts} +1 -26
  25. package/dist/ui/atoms/Icon/index.d.ts +1 -0
  26. package/dist/ui/atoms/Progress.d.ts +9 -6
  27. package/dist/ui/atoms/RadialProgress.d.ts +7 -0
  28. package/dist/ui/atoms/Tag.d.ts +2 -2
  29. package/dist/ui/composite/{ActionButtons.d.ts → ActionButtons/ActionButtons.d.ts} +2 -2
  30. package/dist/ui/composite/ActionButtons/index.d.ts +1 -0
  31. package/dist/ui/composite/Dropdown/Dropdown.d.ts +16 -0
  32. package/dist/ui/{atoms/dropdown/DropdownMenuDivider.d.ts → composite/Dropdown/DropdownDivider.d.ts} +3 -3
  33. package/dist/ui/{atoms/dropdown/DropdownMenuItem.d.ts → composite/Dropdown/DropdownItem.d.ts} +3 -3
  34. package/dist/ui/{atoms/dropdown → composite/Dropdown}/DropdownMenu.d.ts +3 -3
  35. package/dist/ui/composite/Dropdown/index.d.ts +3 -0
  36. package/dist/ui/composite/ListDetails.d.ts +2 -2
  37. package/dist/ui/composite/SearchBar.d.ts +2 -2
  38. package/dist/ui/forms/Input/Input.d.ts +2 -2
  39. package/dist/ui/forms/InputCurrency/InputCurrency.d.ts +3 -3
  40. package/dist/ui/forms/InputDate/InputDateComponent.d.ts +10 -10
  41. package/dist/ui/forms/InputReadonly.d.ts +4 -4
  42. package/dist/ui/forms/InputResourceGroup/InputResourceGroup.d.ts +1 -1
  43. package/dist/ui/forms/InputSelect/InputSelect.d.ts +1 -1
  44. package/dist/ui/internals/InputWrapper.d.ts +5 -5
  45. package/dist/ui/resources/ResourceAddress/ResourceAddress.d.ts +15 -0
  46. package/dist/ui/resources/ResourceAddress/ResourceAddress.mocks.d.ts +38 -0
  47. package/dist/ui/resources/ResourceAddress/ResourceAddressForm.d.ts +48 -0
  48. package/dist/ui/resources/ResourceAddress/index.d.ts +1 -0
  49. package/dist/ui/resources/ResourceLineItems/ResourceLineItems.d.ts +15 -0
  50. package/dist/ui/resources/{ResourceLineItems.mocks.d.ts → ResourceLineItems/ResourceLineItems.mocks.d.ts} +18 -0
  51. package/dist/ui/resources/ResourceLineItems/index.d.ts +1 -0
  52. package/dist/ui/resources/ResourceMetadata/ResourceMetadata.d.ts +22 -0
  53. package/dist/ui/resources/ResourceMetadata/ResourceMetadata.test.d.ts +1 -0
  54. package/dist/ui/resources/ResourceMetadata/ResourceMetadataForm.d.ts +14 -0
  55. package/dist/ui/resources/ResourceMetadata/index.d.ts +1 -0
  56. package/dist/ui/resources/ResourceTags.d.ts +12 -0
  57. package/dist/ui/resources/useResourceFilters/types.d.ts +2 -2
  58. package/dist/utils/array.d.ts +10 -0
  59. package/dist/utils/text.d.ts +5 -2
  60. package/package.json +2 -1
  61. package/dist/main-d208b3aa.js +0 -29029
  62. package/dist/ui/atoms/AvatarLetter.d.ts +0 -16
  63. package/dist/ui/atoms/BlockCode.d.ts +0 -12
  64. package/dist/ui/atoms/dropdown/index.d.ts +0 -3
  65. package/dist/ui/composite/ContextMenu.d.ts +0 -10
  66. package/dist/ui/forms/InputMetadata/HookedInputMetadata.d.ts +0 -19
  67. package/dist/ui/forms/InputMetadata/index.d.ts +0 -1
  68. package/dist/ui/resources/ResourceLineItems.d.ts +0 -12
  69. package/dist/ui/resources/ResourceListItemsMetadata.d.ts +0 -6
  70. /package/dist/ui/atoms/{AvatarLetter.test.d.ts → AvatarLetter/AvatarLetter.test.d.ts} +0 -0
  71. /package/dist/ui/atoms/{BlockCode.test.d.ts → AvatarLetter/colors.test.d.ts} +0 -0
  72. /package/dist/ui/atoms/{Icon.test.d.ts → Icon/Icon.test.d.ts} +0 -0
  73. /package/dist/ui/composite/{ActionButtons.test.d.ts → ActionButtons/ActionButtons.test.d.ts} +0 -0
  74. /package/dist/ui/resources/{ResourceLineItems.test.d.ts → ResourceAddress/ResourceAddress.test.d.ts} +0 -0
  75. /package/dist/ui/resources/{ResourceListItemsMetadata.test.d.ts → ResourceLineItems/ResourceLineItems.test.d.ts} +0 -0
package/dist/main.d.ts CHANGED
@@ -8,6 +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 { useOnBlurFromContainer } from './hooks/useOnBlurFromContainer';
11
12
  export { useOverlay } from './hooks/useOverlay';
12
13
  export { CoreSdkProvider, useCoreApi, useCoreSdkProvider } from './providers/CoreSdkProvider';
13
14
  export { ErrorBoundary } from './providers/ErrorBoundary';
@@ -16,7 +17,6 @@ export { A } from './ui/atoms/A';
16
17
  export { Avatar } from './ui/atoms/Avatar';
17
18
  export { AvatarLetter } from './ui/atoms/AvatarLetter';
18
19
  export { Badge, badgeVariants } from './ui/atoms/Badge';
19
- export { BlockCode } from './ui/atoms/BlockCode';
20
20
  export { Button } from './ui/atoms/Button';
21
21
  export { ButtonFilter } from './ui/atoms/ButtonFilter';
22
22
  export { Card } from './ui/atoms/Card';
@@ -26,7 +26,7 @@ export { EmptyState } from './ui/atoms/EmptyState';
26
26
  export { Grid } from './ui/atoms/Grid';
27
27
  export { Hint } from './ui/atoms/Hint';
28
28
  export { Hr } from './ui/atoms/Hr';
29
- export { Icon, iconNames } from './ui/atoms/Icon';
29
+ export { Icon, type IconProps } from './ui/atoms/Icon';
30
30
  export { PageHeading } from './ui/atoms/PageHeading';
31
31
  export { Pagination } from './ui/atoms/Pagination';
32
32
  export { Progress } from './ui/atoms/Progress';
@@ -42,10 +42,9 @@ 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
- export { DropdownMenu, DropdownMenuDivider, DropdownMenuItem } from './ui/atoms/dropdown';
46
45
  export { ActionButtons } from './ui/composite/ActionButtons';
47
46
  export { CardDialog } from './ui/composite/CardDialog';
48
- export { ContextMenu } from './ui/composite/ContextMenu';
47
+ export { Dropdown, DropdownDivider, DropdownItem } from './ui/composite/Dropdown';
49
48
  export { List } from './ui/composite/List';
50
49
  export { ListDetails } from './ui/composite/ListDetails';
51
50
  export { ListDetailsItem } from './ui/composite/ListDetailsItem';
@@ -68,7 +67,6 @@ export { HookedInputDateRange, InputDateRange } from './ui/forms/InputDateRange'
68
67
  export { InputFeedback } from './ui/forms/InputFeedback';
69
68
  export { InputFile } from './ui/forms/InputFile';
70
69
  export { InputJson } from './ui/forms/InputJson';
71
- export { HookedInputMetadata } from './ui/forms/InputMetadata';
72
70
  export { InputRadioGroup } from './ui/forms/InputRadioGroup';
73
71
  export { InputReadonly } from './ui/forms/InputReadonly';
74
72
  export { HookedInputResourceGroup, InputResourceGroup } from './ui/forms/InputResourceGroup';
@@ -81,10 +79,11 @@ export { HookedInputToggleButton, InputToggleButton, type InputToggleButtonProps
81
79
  export { Label } from './ui/forms/Label';
82
80
  export { Legend } from './ui/forms/Legend';
83
81
  export { HookedValidationApiError, HookedValidationError, setApiFormErrors, useValidationFeedback } from './ui/forms/ReactHookForm';
82
+ export { ResourceAddress } from './ui/resources/ResourceAddress';
84
83
  export { ResourceLineItems } from './ui/resources/ResourceLineItems';
85
84
  export { ResourceList } from './ui/resources/ResourceList';
86
85
  export { ResourceListItem } from './ui/resources/ResourceListItem';
87
- export { ResourceListItemsMetadata } from './ui/resources/ResourceListItemsMetadata';
86
+ export { ResourceMetadata } from './ui/resources/ResourceMetadata';
88
87
  export { ResourceOrderSummary } from './ui/resources/ResourceOrderSummary';
89
88
  export { ResourceOrderTimeline } from './ui/resources/ResourceOrderTimeline';
90
89
  export { ResourceShipmentParcels } from './ui/resources/ResourceShipmentParcels';
package/dist/main.js CHANGED
@@ -1,4 +1,4 @@
1
- import { an as u, b0 as i, ao as b, ap as p, aq as c, as as l, at as d, au as g, av as m, b1 as S, aw as I, b2 as k, ax as T, ag as D, aZ as R, a_ as C, a$ as y, ay as H, aj as h, az as A, aA as P, be as B, bf as F, bh as L, bk as N, bo as V, bq as f, bv as v, by as O, bA as w, bH as M, bJ as x, bL as E, bO as G, bS as J, bT as U, aB as W, aC as X, bg as Y, bi as Z, bj as $, bl as j, bn as q, bp as z, br as K, bs as Q, bt as _, bu as aa, bw as ea, bx as sa, bz as ta, bB as ra, bI as oa, bK as na, bM as ua, bN as ia, bP as ba, bQ as pa, bR as ca, b3 as la, b4 as da, b5 as ga, b6 as ma, ak as Sa, b7 as Ia, aE as ka, b8 as Ta, b9 as Da, aF as Ra, aG as Ca, aH as ya, ba as Ha, bW as ha, bX as Aa, bY as Pa, bZ as Ba, b_ as Fa, b$ as La, c0 as Na, c1 as Va, bb as fa, aI as va, aJ as Oa, aK as wa, aL as Ma, aN as xa, aO as Ea, aP as Ga, aQ as Ja, aV as Ua, aR as Wa, bc as Xa, aW as Ya, aX as Za, aS as $a, aY as ja, aT as qa, bd as za, al as Ka, aU as Qa, ar as _a, a2 as ae, a1 as ee, bC as se, bm as te, X as re, a3 as oe, a4 as ne, a5 as ue, c3 as ie, c4 as be, bD as pe, Y as ce, Z as le, c5 as de, c6 as ge, c7 as me, c8 as Se, c9 as Ie, ca as ke, a6 as Te, a7 as De, cb as Re, cc as Ce, cd as ye, a8 as He, a9 as he, T as Ae, aa as Pe, ab as Be, aD as Fe, V as Le, bE as Ne, bF as Ve, bG as fe, U as ve, W as Oe, bU as we, $ as Me, a0 as xe, ac as Ee, ah as Ge, ai as Je, ad as Ue, ae as We, af as Xe, c2 as Ye, am as Ze, bV as $e, aM as je } from "./main-d208b3aa.js";
1
+ import { ao as u, aY as i, ap as b, aq as p, ar as l, at as c, au as d, av as g, aZ as m, aw as S, ax as I, ah as k, a_ as T, a$ as D, b0 as R, ay as y, ak as C, az as A, aA as h, bc as H, bd as P, bf as F, bi as B, bm as L, bo as O, bv as V, bx as f, bE as v, bG as N, bI as w, bL as E, bP as G, bQ as x, aB as M, aC as J, be as U, bg as W, bh as X, bj as Y, bl as Z, bn as $, bp as j, bq as q, br as z, bs as K, bt as Q, bu as _, bw as aa, by as ea, bF as sa, bH as ta, bJ as ra, bK as oa, bM as na, bN as ua, bO as ia, b1 as ba, b2 as pa, b3 as la, b4 as ca, al as da, b5 as ga, aD as ma, b6 as Sa, b7 as Ia, aE as ka, aF as Ta, aG as Da, b8 as Ra, bT as ya, bU as Ca, bV as Aa, bW as ha, bX as Ha, bY as Pa, bZ as Fa, b_ as Ba, b$ as La, b9 as Oa, aH as Va, aI as fa, aJ as va, aK as Na, aM as wa, aN as Ea, aO as Ga, aP as xa, aU as Ma, aQ as Ja, ba as Ua, aV as Wa, aW as Xa, aR as Ya, aX as Za, aS as $a, bb as ja, am as qa, aT as za, as as Ka, a2 as Qa, a1 as _a, bz as ae, bk as ee, X as se, a3 as te, a4 as re, a5 as oe, c1 as ne, c2 as ue, bA as ie, Y as be, Z as pe, c3 as le, c4 as ce, c5 as de, c6 as ge, c7 as me, c8 as Se, a6 as Ie, a7 as ke, c9 as Te, ca as De, cb as Re, a8 as ye, a9 as Ce, T as Ae, aa as he, ab as He, V as Pe, bB as Fe, bC as Be, bD as Le, U as Oe, W as Ve, bR as fe, $ as ve, a0 as Ne, ac as we, ai as Ee, aj as Ge, ad as xe, ae as Me, af as Je, ag as Ue, c0 as We, an as Xe, bS as Ye, aL as Ze } from "./main-49356a73.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  import "@commercelayer/sdk";
@@ -9,150 +9,148 @@ export {
9
9
  i as ActionButtons,
10
10
  b as Avatar,
11
11
  p as AvatarLetter,
12
- c as Badge,
13
- l as BlockCode,
14
- d as Button,
15
- g as ButtonFilter,
16
- m as Card,
17
- S as CardDialog,
18
- I as Container,
19
- k as ContextMenu,
20
- T as CopyToClipboard,
21
- D as CoreSdkProvider,
22
- R as DropdownMenu,
23
- C as DropdownMenuDivider,
24
- y as DropdownMenuItem,
25
- H as EmptyState,
26
- h as ErrorBoundary,
12
+ l as Badge,
13
+ c as Button,
14
+ d as ButtonFilter,
15
+ g as Card,
16
+ m as CardDialog,
17
+ S as Container,
18
+ I as CopyToClipboard,
19
+ k as CoreSdkProvider,
20
+ T as Dropdown,
21
+ D as DropdownDivider,
22
+ R as DropdownItem,
23
+ y as EmptyState,
24
+ C as ErrorBoundary,
27
25
  A as Grid,
28
- P as Hint,
29
- B as HookedForm,
30
- F as HookedInput,
31
- L as HookedInputCheckbox,
32
- N as HookedInputCurrency,
33
- V as HookedInputDate,
34
- f as HookedInputDateRange,
35
- v as HookedInputMetadata,
36
- O as HookedInputResourceGroup,
37
- w as HookedInputSelect,
38
- M as HookedInputSimpleSelect,
39
- x as HookedInputSpinner,
40
- E as HookedInputSwitch,
41
- G as HookedInputToggleButton,
42
- J as HookedValidationApiError,
43
- U as HookedValidationError,
44
- W as Hr,
45
- X as Icon,
46
- Y as Input,
47
- Z as InputCheckbox,
48
- $ as InputCheckboxGroup,
49
- j as InputCurrency,
50
- q as InputCurrencyRange,
51
- z as InputDate,
52
- K as InputDateRange,
53
- Q as InputFeedback,
54
- _ as InputFile,
55
- aa as InputJson,
56
- ea as InputRadioGroup,
57
- sa as InputReadonly,
58
- ta as InputResourceGroup,
59
- ra as InputSelect,
60
- oa as InputSimpleSelect,
61
- na as InputSpinner,
62
- ua as InputSwitch,
63
- ia as InputTextArea,
64
- ba as InputToggleButton,
65
- pa as Label,
66
- ca as Legend,
67
- la as List,
68
- da as ListDetails,
69
- ga as ListDetailsItem,
70
- ma as ListItem,
71
- Sa as MetaTags,
72
- Ia as PageError,
73
- ka as PageHeading,
74
- Ta as PageLayout,
75
- Da as PageSkeleton,
76
- Ra as Pagination,
77
- Ca as Progress,
78
- ya as RadialProgress,
79
- Ha as Report,
80
- ha as ResourceLineItems,
26
+ h as Hint,
27
+ H as HookedForm,
28
+ P as HookedInput,
29
+ F as HookedInputCheckbox,
30
+ B as HookedInputCurrency,
31
+ L as HookedInputDate,
32
+ O as HookedInputDateRange,
33
+ V as HookedInputResourceGroup,
34
+ f as HookedInputSelect,
35
+ v as HookedInputSimpleSelect,
36
+ N as HookedInputSpinner,
37
+ w as HookedInputSwitch,
38
+ E as HookedInputToggleButton,
39
+ G as HookedValidationApiError,
40
+ x as HookedValidationError,
41
+ M as Hr,
42
+ J as Icon,
43
+ U as Input,
44
+ W as InputCheckbox,
45
+ X as InputCheckboxGroup,
46
+ Y as InputCurrency,
47
+ Z as InputCurrencyRange,
48
+ $ as InputDate,
49
+ j as InputDateRange,
50
+ q as InputFeedback,
51
+ z as InputFile,
52
+ K as InputJson,
53
+ Q as InputRadioGroup,
54
+ _ as InputReadonly,
55
+ aa as InputResourceGroup,
56
+ ea as InputSelect,
57
+ sa as InputSimpleSelect,
58
+ ta as InputSpinner,
59
+ ra as InputSwitch,
60
+ oa as InputTextArea,
61
+ na as InputToggleButton,
62
+ ua as Label,
63
+ ia as Legend,
64
+ ba as List,
65
+ pa as ListDetails,
66
+ la as ListDetailsItem,
67
+ ca as ListItem,
68
+ da as MetaTags,
69
+ ga as PageError,
70
+ ma as PageHeading,
71
+ Sa as PageLayout,
72
+ Ia as PageSkeleton,
73
+ ka as Pagination,
74
+ Ta as Progress,
75
+ Da as RadialProgress,
76
+ Ra as Report,
77
+ ya as ResourceAddress,
78
+ Ca as ResourceLineItems,
81
79
  Aa as ResourceList,
82
- Pa as ResourceListItem,
83
- Ba as ResourceListItemsMetadata,
84
- Fa as ResourceOrderSummary,
85
- La as ResourceOrderTimeline,
86
- Na as ResourceShipmentParcels,
87
- Va as ResourceTags,
88
- fa as SearchBar,
89
- va as Section,
90
- Oa as Skeleton,
91
- wa as SkeletonItem,
92
- Ma as SkeletonTemplate,
93
- xa as Spacer,
80
+ ha as ResourceListItem,
81
+ Ha as ResourceMetadata,
82
+ Pa as ResourceOrderSummary,
83
+ Fa as ResourceOrderTimeline,
84
+ Ba as ResourceShipmentParcels,
85
+ La as ResourceTags,
86
+ Oa as SearchBar,
87
+ Va as Section,
88
+ fa as Skeleton,
89
+ va as SkeletonItem,
90
+ Na as SkeletonTemplate,
91
+ wa as Spacer,
94
92
  Ea as Stack,
95
93
  Ga as StatusDot,
96
- Ja as Steps,
97
- Ua as Tab,
98
- Wa as Table,
99
- Xa as TableData,
100
- Ya as Tabs,
101
- Za as Tag,
102
- $a as Td,
103
- ja as Text,
104
- qa as Th,
105
- za as Timeline,
106
- Ka as TokenProvider,
107
- Qa as Tr,
108
- _a as badgeVariants,
109
- ae as computeFullname,
110
- ee as downloadJsonAsFile,
111
- se as flatSelectValues,
112
- te as formatCentsToCurrency,
113
- re as formatDate,
114
- oe as formatDisplayName,
115
- ne as formatResourceName,
116
- ue as getAvatarSrcFromRate,
117
- ie as getCustomerDisplayStatus,
118
- be as getCustomerStatusName,
119
- pe as getDefaultValueFromFlatten,
120
- ce as getIsoDateAtDayEdge,
121
- le as getIsoDateAtDaysBefore,
122
- de as getOrderDisplayStatus,
123
- ge as getOrderFulfillmentStatusName,
124
- me as getOrderPaymentStatusName,
125
- Se as getOrderStatusName,
126
- Ie as getOrderTransactionPastTense,
127
- ke as getOrderTriggerAttributeName,
128
- Te as getParcelTrackingDetail,
129
- De as getParcelTrackingDetails,
130
- Re as getReturnDisplayStatus,
131
- Ce as getReturnStatusName,
132
- ye as getReturnTriggerAttributeName,
133
- He as getShipmentRate,
134
- he as getShipmentRates,
94
+ xa as Steps,
95
+ Ma as Tab,
96
+ Ja as Table,
97
+ Ua as TableData,
98
+ Wa as Tabs,
99
+ Xa as Tag,
100
+ Ya as Td,
101
+ Za as Text,
102
+ $a as Th,
103
+ ja as Timeline,
104
+ qa as TokenProvider,
105
+ za as Tr,
106
+ Ka as badgeVariants,
107
+ Qa as computeFullname,
108
+ _a as downloadJsonAsFile,
109
+ ae as flatSelectValues,
110
+ ee as formatCentsToCurrency,
111
+ se as formatDate,
112
+ te as formatDisplayName,
113
+ re as formatResourceName,
114
+ oe as getAvatarSrcFromRate,
115
+ ne as getCustomerDisplayStatus,
116
+ ue as getCustomerStatusName,
117
+ ie as getDefaultValueFromFlatten,
118
+ be as getIsoDateAtDayEdge,
119
+ pe as getIsoDateAtDaysBefore,
120
+ le as getOrderDisplayStatus,
121
+ ce as getOrderFulfillmentStatusName,
122
+ de as getOrderPaymentStatusName,
123
+ ge as getOrderStatusName,
124
+ me as getOrderTransactionPastTense,
125
+ Se as getOrderTriggerAttributeName,
126
+ Ie as getParcelTrackingDetail,
127
+ ke as getParcelTrackingDetails,
128
+ Te as getReturnDisplayStatus,
129
+ De as getReturnStatusName,
130
+ Re as getReturnTriggerAttributeName,
131
+ ye as getShipmentRate,
132
+ Ce as getShipmentRates,
135
133
  Ae as goBack,
136
- Pe as hasBeenPurchased,
137
- Be as hasSingleTracking,
138
- Fe as iconNames,
139
- Le as isAttachmentValidNote,
140
- Ne as isGroupedSelectValues,
141
- Ve as isMultiValueSelected,
142
- fe as isSingleValueSelected,
143
- ve as navigateTo,
144
- Oe as referenceOrigins,
145
- we as setApiFormErrors,
146
- Me as sortAndGroupByDate,
147
- xe as timeSeparator,
148
- Ee as useClickAway,
149
- Ge as useCoreApi,
150
- Je as useCoreSdkProvider,
151
- Ue as useDelayShow,
152
- We as useIsChanged,
153
- Xe as useOverlay,
154
- Ye as useResourceFilters,
155
- Ze as useTokenProvider,
156
- $e as useValidationFeedback,
157
- je as withSkeletonTemplate
134
+ he as hasBeenPurchased,
135
+ He as hasSingleTracking,
136
+ Pe as isAttachmentValidNote,
137
+ Fe as isGroupedSelectValues,
138
+ Be as isMultiValueSelected,
139
+ Le as isSingleValueSelected,
140
+ Oe as navigateTo,
141
+ Ve as referenceOrigins,
142
+ fe as setApiFormErrors,
143
+ ve as sortAndGroupByDate,
144
+ Ne as timeSeparator,
145
+ we as useClickAway,
146
+ Ee as useCoreApi,
147
+ Ge as useCoreSdkProvider,
148
+ xe as useDelayShow,
149
+ Me as useIsChanged,
150
+ Je as useOnBlurFromContainer,
151
+ Ue as useOverlay,
152
+ We as useResourceFilters,
153
+ Xe as useTokenProvider,
154
+ Ye as useValidationFeedback,
155
+ Ze as withSkeletonTemplate
158
156
  };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("msw").RestHandler<import("msw/lib/glossary-de6278a9").M<import("msw/lib/glossary-de6278a9").h>>[];
2
+ export default _default;
@@ -4,5 +4,28 @@ import { type Fetcher, type SWRConfiguration, type SWRResponse } from 'swr';
4
4
  import { type ConditionalKeys } from 'type-fest';
5
5
  type GenericMethod = (...args: any) => Promise<any>;
6
6
  type ForceToBeMethod<Method> = Method extends GenericMethod ? Method : GenericMethod;
7
+ /**
8
+ * This hook performs api request base on [`@commercelayer/sdk`](https://github.com/commercelayer/commercelayer-sdk) and [`swr`](https://swr.vercel.app/).
9
+ *
10
+ * This is an example of getting the order with id `1234`.
11
+ *
12
+ * If you're used to use our sdk you can write:
13
+ * ```ts
14
+ * const order = await client.orders.retrieve('1234')
15
+ * ```
16
+ *
17
+ * With `useCoreApi` you'll write instead:
18
+ * ```ts
19
+ * const {
20
+ * data: order,
21
+ * isLoading
22
+ * } = useCoreApi('orders', 'retrieve', ['1234'])
23
+ * ```
24
+ * @param resource Resource type
25
+ * @param action Related resource action
26
+ * @param args Action arguments
27
+ * @param config SWR options
28
+ * @returns SWR response
29
+ */
7
30
  export declare function useCoreApi<Resource extends ResourceTypeLock, Action extends ConditionalKeys<CommerceLayerClient[Resource], GenericMethod>, Method extends ForceToBeMethod<CommerceLayerClient[Resource][Action]>, Args extends Parameters<Method>, Output extends Awaited<ReturnType<Method>>, SWROptions extends SWRConfiguration<Output, any, Fetcher<Output>>>(resource: Resource, action: Action, args: Args | null, config?: SWROptions): SWRResponse<Output, any, SWROptions>;
8
31
  export {};
@@ -14,23 +14,30 @@ export interface TokenProviderValue {
14
14
  }
15
15
  export interface TokenProviderProps {
16
16
  /**
17
- * Token kind (will be validated)
18
- * Eg. `integration` or `webapp` but also `imports` or `orders` in case of dashboard-generated token
17
+ * Token kind (will be validated).
18
+ * For example: `integration`, `sales_channel` or `webapp` but also `imports` or `orders` in case of dashboard-generated token.
19
19
  */
20
20
  kind: TokenProviderTokenApplicationKind;
21
21
  /**
22
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`
24
23
  * Will be used to persist token for current app only.
25
24
  */
26
25
  appSlug: TokenProviderAllowedApp;
27
26
  /**
28
- * Required when application is forked or running as self-hosted.
27
+ * Skip domain slug validation when is dev mode
28
+ */
29
+ devMode: boolean;
30
+ /**
31
+ * Entire app content
32
+ */
33
+ children: ((props: TokenProviderValue) => ReactNode) | ReactNode;
34
+ /**
35
+ * Required when application is running as self-hosted.
29
36
  * It's used to perform a security check to test the validity of token against current organization.
30
37
  */
31
38
  organizationSlug?: string;
32
39
  /**
33
- * Base domain to be used for Commerce Layer API requests (eg. `commercelayer.io`)
40
+ * Base domain to be used for Commerce Layer API requests (e.g. `commercelayer.io`)
34
41
  */
35
42
  domain?: string;
36
43
  /**
@@ -53,19 +60,11 @@ export interface TokenProviderProps {
53
60
  * Element to display in case of invalid token
54
61
  */
55
62
  errorElement?: ReactNode;
56
- /**
57
- * skip domain slug validation when is dev mode
58
- */
59
- devMode: boolean;
60
63
  /**
61
64
  * Optional. In case you already have an access token, this will skip the retrieval of token from URL or localStorage.
62
65
  * When undefined (default scenario), token is expected to be retrieved from `?accessToken=xxxx` query string or localStorage (in this order).
63
66
  */
64
67
  accessToken?: string;
65
- /**
66
- * Entire app content
67
- */
68
- children: ((props: TokenProviderValue) => ReactNode) | ReactNode;
69
68
  }
70
69
  export declare const AuthContext: import("react").Context<TokenProviderValue>;
71
70
  export declare const useTokenProvider: () => TokenProviderValue;