@commercelayer/app-elements 0.0.80 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -48
- package/dist/{Async-a8cbdb5b.js → Async-566ec3f7.js} +3 -3
- package/dist/{InputDateComponent-a8c34dc1.js → InputDateComponent-4461b3e6.js} +3 -3
- package/dist/{Select-e581ae99.js → Select-89937223.js} +3 -3
- package/dist/helpers/appsNavigation.d.ts +1 -1
- package/dist/{main-dd440dc6.js → main-795be39b.js} +7119 -7022
- package/dist/main.d.ts +22 -38
- package/dist/main.js +97 -97
- package/dist/mocks/setup.d.ts +3 -0
- package/dist/{overrides-0673bab0.js → overrides-346bb0f6.js} +621 -618
- package/dist/providers/TokenProvider/TokenProvider.d.ts +15 -11
- package/dist/providers/TokenProvider/getInfoFromJwt.d.ts +3 -2
- package/dist/providers/TokenProvider/url.d.ts +3 -2
- package/dist/providers/TokenProvider/validateToken.d.ts +6 -1
- package/dist/style.css +1 -1
- package/dist/ui/atoms/Section.d.ts +31 -0
- package/dist/ui/atoms/Table/Table.d.ts +21 -0
- package/dist/ui/atoms/Table/Td.d.ts +8 -0
- package/dist/ui/atoms/{tables → Table}/index.d.ts +3 -2
- package/dist/ui/{lists → composite}/ListDetails.d.ts +1 -1
- package/dist/ui/composite/TableData.d.ts +23 -0
- package/dist/ui/forms/Form/index.d.ts +1 -0
- package/dist/ui/{hook-form → forms/Input}/HookedInput.d.ts +4 -4
- package/dist/ui/forms/{Input.d.ts → Input/Input.d.ts} +2 -3
- package/dist/ui/forms/Input/index.d.ts +2 -0
- package/dist/ui/{hook-form → forms/InputCheckbox}/HookedInputCheckbox.d.ts +4 -4
- package/dist/ui/forms/{InputCheckbox.d.ts → InputCheckbox/InputCheckbox.d.ts} +2 -2
- package/dist/ui/forms/InputCheckbox/index.d.ts +2 -0
- package/dist/ui/forms/InputCheckboxGroup.d.ts +2 -3
- package/dist/ui/{hook-form → forms/InputCurrency}/HookedInputCurrency.d.ts +4 -4
- package/dist/ui/forms/InputCurrency/InputCurrency.d.ts +48 -0
- package/dist/ui/forms/InputCurrency/index.d.ts +3 -58
- package/dist/ui/forms/InputCurrency/utils.d.ts +10 -0
- package/dist/ui/forms/InputCurrencyRange.d.ts +8 -5
- package/dist/ui/{hook-form → forms/InputDate}/HookedInputDate.d.ts +4 -4
- package/dist/ui/forms/InputDate/InputDate.d.ts +4 -0
- package/dist/ui/forms/InputDate/InputDateComponent.d.ts +1 -2
- package/dist/ui/forms/InputDate/index.d.ts +2 -5
- package/dist/ui/{hook-form → forms/InputDateRange}/HookedInputDateRange.d.ts +4 -4
- package/dist/ui/forms/{InputDateRange.d.ts → InputDateRange/InputDateRange.d.ts} +3 -4
- package/dist/ui/forms/InputDateRange/index.d.ts +2 -0
- package/dist/ui/forms/InputFeedback.d.ts +2 -3
- package/dist/ui/forms/InputFile.d.ts +6 -2
- package/dist/ui/forms/InputJson.d.ts +2 -3
- package/dist/ui/{hook-form → forms/InputMetadata}/HookedInputMetadata.d.ts +3 -3
- package/dist/ui/forms/InputMetadata/index.d.ts +1 -0
- package/dist/ui/forms/InputRadioGroup.d.ts +9 -4
- package/dist/ui/forms/InputReadonly.d.ts +3 -3
- package/dist/ui/{resources/RelationshipSelector → forms/InputResourceGroup}/Checkbox.d.ts +1 -1
- package/dist/ui/forms/InputResourceGroup/HookedInputResourceGroup.d.ts +15 -0
- package/dist/ui/forms/InputResourceGroup/InputResourceGroup.d.ts +28 -0
- package/dist/ui/forms/InputResourceGroup/index.d.ts +2 -0
- package/dist/ui/forms/InputSelect/Async.d.ts +1 -1
- package/dist/ui/{hook-form → forms/InputSelect}/HookedInputSelect.d.ts +4 -4
- package/dist/ui/forms/InputSelect/InputSelect.d.ts +91 -0
- package/dist/ui/forms/InputSelect/Select.d.ts +1 -1
- package/dist/ui/forms/InputSelect/index.d.ts +2 -91
- package/dist/ui/forms/InputSimpleSelect/HookedInputSimpleSelect.d.ts +21 -0
- package/dist/ui/forms/InputSimpleSelect/InputSimpleSelect.d.ts +12 -0
- package/dist/ui/forms/InputSimpleSelect/index.d.ts +2 -0
- package/dist/ui/{hook-form → forms/InputSpinner}/HookedInputSpinner.d.ts +4 -4
- package/dist/ui/forms/{InputSpinner.d.ts → InputSpinner/InputSpinner.d.ts} +2 -3
- package/dist/ui/forms/InputSpinner/index.d.ts +2 -0
- package/dist/ui/{hook-form/HookedInputToggleBox.d.ts → forms/InputSwitch/HookedInputSwitch.d.ts} +6 -6
- package/dist/ui/forms/InputSwitch/InputSwitch.d.ts +5 -0
- package/dist/ui/forms/InputSwitch/index.d.ts +2 -0
- package/dist/ui/forms/InputTextArea.d.ts +2 -2
- package/dist/ui/forms/InputToggleButton/HookedInputToggleButton.d.ts +18 -0
- package/dist/ui/forms/{ToggleButtons.d.ts → InputToggleButton/InputToggleButton.d.ts} +7 -6
- package/dist/ui/forms/InputToggleButton/index.d.ts +2 -0
- package/dist/ui/forms/Label.d.ts +6 -3
- package/dist/ui/forms/Legend.d.ts +14 -0
- package/dist/ui/{hook-form → forms/ReactHookForm}/HookedValidationApiError.d.ts +3 -3
- package/dist/ui/{hook-form → forms/ReactHookForm}/HookedValidationError.d.ts +3 -3
- package/dist/ui/forms/ReactHookForm/index.d.ts +4 -0
- package/dist/ui/{hook-form → forms/ReactHookForm}/useValidationFeedback.d.ts +1 -1
- package/dist/ui/internals/InputWrapper.d.ts +6 -1
- package/dist/ui/resources/Filters/types.d.ts +4 -4
- package/dist/ui/resources/Filters/useFilters.d.ts +2 -1
- package/dist/ui/resources/ResourceList/ResourceList.d.ts +64 -0
- package/dist/ui/resources/ResourceList/index.d.ts +1 -45
- package/dist/{unsupportedIterableToArray-0f93b40f.js → unsupportedIterableToArray-a3020d44.js} +1 -1
- package/dist/utils/children.d.ts +4 -3
- package/dist/utils/extractHeaders.d.ts +2 -1
- package/dist/utils/text.d.ts +8 -1
- package/package.json +26 -26
- package/dist/ui/atoms/Legend.d.ts +0 -32
- package/dist/ui/atoms/tables/Td.d.ts +0 -9
- package/dist/ui/forms/InputToggleBox.d.ts +0 -9
- package/dist/ui/forms/InputToggleListBox.d.ts +0 -15
- package/dist/ui/forms/RadioButtons.d.ts +0 -19
- package/dist/ui/hook-form/HookedInputToggleListBox.d.ts +0 -21
- package/dist/ui/hook-form/HookedRelationshipSelector.d.ts +0 -18
- package/dist/ui/hook-form/HookedToggleButtons.d.ts +0 -18
- package/dist/ui/resources/RelationshipSelector/index.d.ts +0 -26
- package/dist/ui/resources/ResourceList/index.test.d.ts +0 -1
- package/dist/ui/tables/Table.d.ts +0 -10
- package/dist/ui/tables/TableData.d.ts +0 -14
- package/dist/utils/tests.d.ts +0 -1
- /package/dist/ui/atoms/{Legend.test.d.ts → Section.test.d.ts} +0 -0
- /package/dist/ui/{tables → atoms/Table}/Table.test.d.ts +0 -0
- /package/dist/ui/atoms/{tables → Table}/Th.d.ts +0 -0
- /package/dist/ui/atoms/{tables → Table}/Tr.d.ts +0 -0
- /package/dist/ui/{lists → composite}/List.d.ts +0 -0
- /package/dist/ui/{lists → composite}/List.test.d.ts +0 -0
- /package/dist/ui/{lists → composite}/ListDetails.test.d.ts +0 -0
- /package/dist/ui/{lists → composite}/ListDetailsItem.d.ts +0 -0
- /package/dist/ui/{lists → composite}/ListDetailsItem.test.d.ts +0 -0
- /package/dist/ui/{lists → composite}/ListItem.d.ts +0 -0
- /package/dist/ui/{lists → composite}/ListItem.test.d.ts +0 -0
- /package/dist/ui/{tables → composite}/TableData.test.d.ts +0 -0
- /package/dist/ui/{hook-form → forms/Form}/HookedForm.d.ts +0 -0
- /package/dist/ui/forms/{Input.test.d.ts → Input/Input.test.d.ts} +0 -0
- /package/dist/ui/forms/{InputCheckbox.test.d.ts → InputCheckbox/InputCheckbox.test.d.ts} +0 -0
- /package/dist/ui/forms/InputCurrency/{index.test.d.ts → InputCurrency.test.d.ts} +0 -0
- /package/dist/ui/forms/InputDate/{InputDate.test.d.ts → InputDateComponent.test.d.ts} +0 -0
- /package/dist/ui/forms/{InputDateRange.test.d.ts → InputDateRange/InputDateRange.test.d.ts} +0 -0
- /package/dist/ui/{resources/RelationshipSelector → forms/InputResourceGroup}/FullList.d.ts +0 -0
- /package/dist/ui/{resources/RelationshipSelector → forms/InputResourceGroup}/utils.d.ts +0 -0
- /package/dist/ui/{resources/RelationshipSelector → forms/InputResourceGroup}/utils.test.d.ts +0 -0
- /package/dist/ui/forms/InputSelect/{index.test.d.ts → InputSelect.test.d.ts} +0 -0
- /package/dist/ui/forms/{InputSpinner.test.d.ts → InputSimpleSelect/InputSimpleSelect.test.d.ts} +0 -0
- /package/dist/ui/forms/{InputToggleBox.test.d.ts → InputSpinner/InputSpinner.test.d.ts} +0 -0
- /package/dist/ui/forms/{InputToggleListBox.test.d.ts → InputSwitch/InputSwitch.test.d.ts} +0 -0
- /package/dist/ui/forms/{RadioButtons.test.d.ts → InputToggleButton/InputToggleButton.test.d.ts} +0 -0
- /package/dist/ui/{hook-form → forms/ReactHookForm}/setApiFormErrors.d.ts +0 -0
- /package/dist/ui/{hook-form → forms/ReactHookForm}/setApiFormErrors.test.d.ts +0 -0
- /package/dist/ui/{forms/ToggleButtons.test.d.ts → resources/ResourceList/ResourceList.test.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,59 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
React UI Elements for Commerce Layer applications.
|
|
4
|
-
|
|
5
|
-
## What is Commerce Layer?
|
|
6
|
-
|
|
7
|
-
[Commerce Layer](https://commercelayer.io) is a multi-market commerce API and order management system that lets you add global shopping capabilities to any website, mobile app, chatbot, wearable, voice, or IoT device, with ease. Compose your stack with the best-of-breed tools you already mastered and love. Make any experience shoppable, anywhere, through a blazing-fast, enterprise-grade, and secure API.
|
|
1
|
+
> [!WARNING]
|
|
2
|
+
> This library is still in active development.
|
|
8
3
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- [Getting started](#getting-started)
|
|
12
|
-
- [Preact](#preact)
|
|
4
|
+
# App Elements
|
|
13
5
|
|
|
14
|
-
|
|
6
|
+
`App Elements` is a React components library used to build Commerce Layer dashboard HUB apps. This library contains different types of components, helpers and hooks, from simple and small bits like `Button` o `Card` to complex components like `OrderSummary`.
|
|
15
7
|
|
|
16
|
-
|
|
8
|
+
## Local development
|
|
17
9
|
|
|
18
10
|
```sh
|
|
19
|
-
pnpm install
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
2. Add global css in your app index.tsx
|
|
23
|
-
|
|
24
|
-
```jsx
|
|
25
|
-
import "@commercelayer/app-elements/style.css";
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
React.createRoot(document.getElementById("root") as HTMLElement).render(
|
|
29
|
-
<React.StrictMode>
|
|
30
|
-
<App />
|
|
31
|
-
</React.StrictMode>
|
|
32
|
-
)
|
|
11
|
+
pnpm install
|
|
12
|
+
pnpm dev
|
|
33
13
|
```
|
|
34
14
|
|
|
35
|
-
|
|
15
|
+
### Link to other application
|
|
36
16
|
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
|
40
|
-
<link
|
|
41
|
-
href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap"
|
|
42
|
-
rel="stylesheet"
|
|
43
|
-
/>
|
|
44
|
-
</head>
|
|
45
|
-
```
|
|
17
|
+
```sh
|
|
18
|
+
pnpm build:elements --watch
|
|
46
19
|
|
|
47
|
-
|
|
20
|
+
cd ~/projects/app-elements/packages/app-elements
|
|
21
|
+
pnpm link --global
|
|
48
22
|
|
|
49
|
-
|
|
50
|
-
|
|
23
|
+
cd ~/projects/my-app/packages/app
|
|
24
|
+
pnpm link --global @commercelayer/app-elements
|
|
51
25
|
```
|
|
52
|
-
|
|
53
|
-
5. (optional) install `@commercelayer/sdk` to use `<TokenProvider>` component
|
|
54
|
-
|
|
55
|
-
## Preact
|
|
56
|
-
|
|
57
|
-
Support for `preact` is provided out of the box, thanks to the fact we are not including React jsx-runtime modules in bundled files.
|
|
58
|
-
The application where this package is installed to is responsible of this.
|
|
59
|
-
But no extra configuration should be required in your project, in fact all latest versions of vite, react and preact will handle this automatically.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { L as de, H as le } from "./main-
|
|
1
|
+
import { L as de, H as le } from "./main-795be39b.js";
|
|
2
2
|
import * as ce from "react";
|
|
3
3
|
import { useRef as F, useState as a, useEffect as x, useCallback as D, forwardRef as ve } from "react";
|
|
4
|
-
import { _ as Oe, a as s, h as Se, b as g, u as me, S as _e, c as he, s as ge } from "./overrides-
|
|
5
|
-
import { d as ye } from "./unsupportedIterableToArray-
|
|
4
|
+
import { _ as Oe, a as s, h as Se, b as g, u as me, S as _e, c as he, s as ge } from "./overrides-346bb0f6.js";
|
|
5
|
+
import { d as ye } from "./unsupportedIterableToArray-a3020d44.js";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
import "@commercelayer/sdk";
|
|
8
8
|
import "react-hook-form";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as Ma, r as E, a as Rn, t as H, b as Mt, c as Ee, d as _, g as Cr, _ as Qt, s as je, e as cr, f as xa, h as ur, i as Ln, j as Sa, k as Oa, l as Ea, m as qr, n as _a, o as Kr, p as Pa, q as Ta, u as Na, v as An, w as ae, x as nt, y as pr, z as Hn, A as Ya, B as lr, C as Zr, D as Ia, E as Ra, F as La, G as At, H as Ke, I as Aa, J as Ha, K as Fa } from "./main-
|
|
1
|
+
import { P as Ma, r as E, a as Rn, t as H, b as Mt, c as Ee, d as _, g as Cr, _ as Qt, s as je, e as cr, f as xa, h as ur, i as Ln, j as Sa, k as Oa, l as Ea, m as qr, n as _a, o as Kr, p as Pa, q as Ta, u as Na, v as An, w as ae, x as nt, y as pr, z as Hn, A as Ya, B as lr, C as Zr, D as Ia, E as Ra, F as La, G as At, H as Ke, I as Aa, J as Ha, K as Fa } from "./main-795be39b.js";
|
|
2
2
|
import * as B from "react";
|
|
3
3
|
import h, { forwardRef as Fn, createElement as ja, Component as Ua, createRef as Ba } from "react";
|
|
4
|
-
import { _ as Wa, a as I, b as R, c as N, d as D, e as b, f as Y } from "./unsupportedIterableToArray-
|
|
4
|
+
import { _ as Wa, a as I, b as R, c as N, d as D, e as b, f as Y } from "./unsupportedIterableToArray-a3020d44.js";
|
|
5
5
|
import * as Va from "react-dom";
|
|
6
6
|
import Qa, { findDOMNode as $a } from "react-dom";
|
|
7
7
|
import "@commercelayer/sdk";
|
|
@@ -5227,7 +5227,7 @@ const Lc = Fn(
|
|
|
5227
5227
|
hint: p,
|
|
5228
5228
|
feedback: f,
|
|
5229
5229
|
label: s,
|
|
5230
|
-
children: /* @__PURE__ */ Ke.jsxs("div", { className: "relative", children: [
|
|
5230
|
+
children: /* @__PURE__ */ Ke.jsxs("div", { className: "relative w-full", children: [
|
|
5231
5231
|
/* @__PURE__ */ Ke.jsx(
|
|
5232
5232
|
Ic,
|
|
5233
5233
|
{
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { H as n } from "./main-
|
|
2
|
-
import { u as s, S as m, c as p, s as i } from "./overrides-
|
|
1
|
+
import { H as n } from "./main-795be39b.js";
|
|
2
|
+
import { u as s, S as m, c as p, s as i } from "./overrides-346bb0f6.js";
|
|
3
3
|
import * as c from "react";
|
|
4
4
|
import { forwardRef as S } from "react";
|
|
5
5
|
import "react-dom";
|
|
6
6
|
import "@commercelayer/sdk";
|
|
7
7
|
import "react-hook-form";
|
|
8
8
|
import "query-string";
|
|
9
|
-
import "./unsupportedIterableToArray-
|
|
9
|
+
import "./unsupportedIterableToArray-a3020d44.js";
|
|
10
10
|
var f = /* @__PURE__ */ S(function(e, t) {
|
|
11
11
|
var o = s(e);
|
|
12
12
|
return /* @__PURE__ */ c.createElement(m, p({
|
|
@@ -68,5 +68,5 @@ interface NavigateToExternalDetailsParams {
|
|
|
68
68
|
export declare function navigateToDetail(params: NavigateToInternalDetailsParams | NavigateToExternalDetailsParams): {
|
|
69
69
|
href: string;
|
|
70
70
|
onClick: (e: React.MouseEvent<HTMLAnchorElement | HTMLDivElement, MouseEvent>) => void;
|
|
71
|
-
};
|
|
71
|
+
} | null;
|
|
72
72
|
export {};
|