@photonhealth/elements 0.10.1 → 0.10.3
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 +22 -41
- package/dist/index.js +267 -267
- package/dist/index.mjs +8208 -8102
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,44 +1,25 @@
|
|
|
1
|
-
# Photon
|
|
2
|
-
|
|
3
|
-
Photon's collection of customizable and reusable components to help clients integrate seamlessly with our system.
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
```tsx
|
|
12
|
-
//Shoelace
|
|
13
|
-
import { customElement } from 'solid-element';
|
|
14
|
-
|
|
15
|
-
//Styles
|
|
16
|
-
import tailwind from '../tailwind.css?inline';
|
|
17
|
-
import styles from './style.css?inline'; //Inline is required to encapsulate the styles below
|
|
18
|
-
|
|
19
|
-
customElement(
|
|
20
|
-
'photon-my-first-component', // WebComponent Tag Name
|
|
21
|
-
{
|
|
22
|
-
disabled: false,
|
|
23
|
-
loading: false,
|
|
24
|
-
full: false
|
|
25
|
-
}, // Default Props
|
|
26
|
-
(props: { disabled: boolean; loading: boolean; full: boolean }, options) => {
|
|
27
|
-
return (
|
|
28
|
-
<>
|
|
29
|
-
<style>{tailwind}</style>
|
|
30
|
-
<style>{styles}</style>
|
|
31
|
-
<div>
|
|
32
|
-
<p class="text-blue-500">My first component</p>
|
|
33
|
-
</div>
|
|
34
|
-
</>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
);
|
|
1
|
+
# Photon Elements
|
|
2
|
+
|
|
3
|
+
Photon's collection of customizable and reusable components to help clients integrate seamlessly with our system. Elements can be used to add prescribing functionality into any web-based clinical tool.
|
|
4
|
+
|
|
5
|
+
## Documentation
|
|
6
|
+
|
|
7
|
+
### Installation
|
|
8
|
+
|
|
9
|
+
```shell
|
|
10
|
+
npm i @photonhealth/elements
|
|
38
11
|
```
|
|
39
12
|
|
|
40
|
-
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
import('@photonhealth/webcomponents').catch((err) => {});
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
You can also import within the `head` tag in HTML:
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<script src="https://cdn.rx.dev/elements/@latest/dist/index.js" type="module"></script>
|
|
23
|
+
```
|
|
41
24
|
|
|
42
|
-
|
|
43
|
-
- Second Parameter is the default values of properties. If you have properties a user isn’t supposed to specify, you can declare the defaults here. Any properties that are not kebab case (e.g first-word) are transformed to kebab-case when passed from HTML/JSX (per WebComponent Spec Guidelines)
|
|
44
|
-
- Third Parameter is a function of (props, options) ⇒ JSX.Element. NOTE: Do not de-structure `props` as in SolidJS this will make your properties (which are a Proxy object) lose reactivity. The second parameter, `options` contains a singular property `element` which gives you raw access to your DOM element created by this web-component. This is considered advanced functionality and rarely used (though I use it in our codebase and have examples of when it’s appropriate).
|
|
25
|
+
Full documentation of available elements and example configurations can be found here: [Photon Elements Documentation](https://docs.photon.health/docs/elements)
|