@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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022 Commerce Layer
3
+ Copyright (c) 2023 Commerce Layer
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -3,23 +3,24 @@
3
3
 
4
4
  # App Elements
5
5
 
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`.
6
+ [![NPM](https://img.shields.io/npm/v/%40commercelayer%2Fapp-elements)](https://www.npmjs.com/package/@commercelayer/app-elements)
7
7
 
8
- ## Local development
8
+ The Commerce Layer admin Dashboard has a hub section for back-office applications built on top of our APIs that facilitates the use of some of the platform's main features.
9
9
 
10
- ```sh
11
- pnpm install
12
- pnpm dev
13
- ```
10
+ <img width="700" alt="You can access the Hub section from the dashboard sidebar menu" src="https://user-images.githubusercontent.com/1681269/268583888-265c7b96-d6d1-451c-9353-a59a4de6edb6.png">
14
11
 
15
- ### Link to other application
12
+ `App Elements` is the React component library for building these Hub applications. This library contains different components, helpers, and hooks, from simple and small bits like `Button` or `Card` to complex components like `OrderSummary`.
16
13
 
17
- ```sh
18
- pnpm build:elements --watch
14
+ ## Getting started
19
15
 
20
- cd ~/projects/app-elements/packages/app-elements
21
- pnpm link --global
16
+ For a constantly updated list of the available and soon-to-come components provided by Commerce Layer's `app-elements` library, please refer to [the official documentation](https://commercelayer.github.io/app-elements) that will help you get started in a snap.
22
17
 
23
- cd ~/projects/my-app/packages/app
24
- pnpm link --global @commercelayer/app-elements
25
- ```
18
+ ## Need help?
19
+
20
+ - Join [Commerce Layer's Slack community](https://slack.commercelayer.app).
21
+ - Ping us [on X (formerly Twitter)](https://x.com/commercelayer).
22
+ - Is there a bug? Create an [issue](https://github.com/commercelayer/app-elements/issues) on this repository.
23
+
24
+ ## License
25
+
26
+ This project is published under the [MIT](https://github.com/commercelayer/app-elements/blob/main/LICENSE) license.
@@ -1,4 +1,4 @@
1
- import { P as Ma, r as E, a as Rn, t as H, b as Mt, c as Ee, d as P, g as Cr, _ as Qt, s as je, e as cr, f as xa, h as I, i as R, j as N, k as D, l as b, m as Y, n as Sa, o as ur, p as Ln, q as Oa, u as Ea, v as Pa, w as qr, x as _a, y as Kr, z as Ta, A as Na, B as Ya, C as An, D as ae, E as nt, F as pr, G as Hn, H as Ia, I as lr, J as Zr, K as Ra, L as La, M as Aa, N as At, O as Ke, Q as Ha, R as Fa, S as ja } from "./main-d208b3aa.js";
1
+ import { P as Ma, r as E, a as Rn, t as H, b as Mt, c as Ee, d as P, g as Cr, _ as Qt, s as je, e as cr, f as xa, h as I, i as R, j as N, k as D, l as b, m as Y, n as Sa, o as ur, p as Ln, q as Oa, u as Ea, v as Pa, w as qr, x as _a, y as Kr, z as Ta, A as Na, B as Ya, C as An, D as ae, E as nt, F as pr, G as Hn, H as Ia, I as lr, J as Zr, K as Ra, L as La, M as Aa, N as At, O as Ke, Q as Ha, R as Fa, S as ja } from "./main-49356a73.js";
2
2
  import * as B from "react";
3
3
  import h, { forwardRef as Fn, createElement as Ua, Component as Ba, createRef as Wa } from "react";
4
4
  import * as Va from "react-dom";
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ type OnBlur = (event: React.FocusEvent<HTMLElement, Element>) => void;
3
+ /**
4
+ * Check if the new focused element is a child of the element and trigger the `onBlur` callback.
5
+ * @param onBlur Function that will be triggered when the new focused element is a child of the element.
6
+ * @returns
7
+ */
8
+ export declare const useOnBlurFromContainer: (onBlur: () => void) => OnBlur;
9
+ export {};