@hotosm/ui 0.3.3-b1 → 0.3.3-b2

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 CHANGED
@@ -157,8 +157,7 @@ bundler, you can import all the components as a bundle, as use them like so:
157
157
  import '@hotosm/ui/dist/hotosm-ui';
158
158
  </script>
159
159
 
160
- <hot-logo><hot-logo>
161
- <hot-button variant="primary">Click me!</hot-button>
160
+ <hot-header title="Test App" size="small" showLogin="false"></hot-header>
162
161
  ```
163
162
 
164
163
  #### React
@@ -167,31 +166,16 @@ Import in the same way as the bundler example above, except events
167
166
  are bound to slightly differently:
168
167
 
169
168
  ```jsx
170
- <hot-button
171
- size='small'
172
- variant='text'
173
- disabled={currentIndex <= 0}
174
- onClick={() => {
175
- console.log('do stuff');
169
+ <hot-header
170
+ title="Test App"
171
+ size="small"
172
+ showLogin="false"
173
+ onLogin={() => {
174
+ console.log('handler');
176
175
  }}
177
- >
178
- </hot-button>
176
+ ></hot-header>
179
177
  ```
180
178
 
181
- ### Development
182
-
183
- HOT UI is developed in TypeScript, using Lit and @lit/react.
184
-
185
- Primarily we want to have:
186
-
187
- - Low level components exported from the Shoelace web component
188
- library, simply re-exported with our default styling / CSS overrides.
189
- - A few composite components (header, sidebar, etc):
190
- - Consistent styling across most of our tools where it counts.
191
- - Reduction in duplicated logic, such as user management, OAuth login, etc.
192
- - Improved developer experience, reduced development time for new tools, while
193
- maintaining consistency in look and feel of applications.
194
-
195
179
  ### How to contribute
196
180
 
197
181
  - Clone the project `git clone git@github.com:hotosm/ui.git`
@@ -201,8 +185,8 @@ Primarily we want to have:
201
185
 
202
186
  For **styling**, check `/theme`:
203
187
 
204
- - `hot.css` has a HOT theme, used across HOT components
205
- - `hot-sl.css` has a Shoelace theme, re-defining styles variables
188
+ - `hot.css` has a HOT theme, used across HOT components.
189
+ - `hot-wa-override.css` has a WebAwesome theme, re-defining style variables.
206
190
 
207
191
  ### License
208
192
 
@@ -0,0 +1 @@
1
+ import{f as e}from"./chunk.TPOAILO5.js";var r=e;customElements.define("hot-header",e);export{r as a};
@@ -1,4 +1,4 @@
1
- import{b as o}from"./chunk.6Y3X2E2V.js";import{a as l}from"./chunk.M3ZIZPKF.js";import{a as d}from"./chunk.GTNRNZDH.js";import{e as r,k as c}from"./chunk.TNLBUOUK.js";import{d as s,e as a,f as n,g as i}from"./chunk.NI7UJOOZ.js";l();var u,g,p,b,h,m,v,e=class extends c{constructor(){super(...arguments);this.name="hot-consent";n(this,u,"");n(this,g,!1);n(this,p,!0);n(this,b,"About the information we collect");n(this,h,"We use cookies and similar technologies to recognize and analyze your visits, and measure traffic usage and activity.");n(this,m,"I Agree");n(this,v,"I Do Not Agree")}get consentId(){return a(this,u)}set consentId(t){i(this,u,t)}get force(){return a(this,g)}set force(t){i(this,g,t)}get isOpen(){return a(this,p)}set isOpen(t){i(this,p,t)}get title(){return a(this,b)}set title(t){i(this,b,t)}get message(){return a(this,h)}set message(t){i(this,h,t)}get agreeLabel(){return a(this,m)}set agreeLabel(t){i(this,m,t)}get notAgreeLabel(){return a(this,v)}set notAgreeLabel(t){i(this,v,t)}render(){return this.isOpen?r`
1
+ import{a as d}from"./chunk.GTNRNZDH.js";import{b as r}from"./chunk.6Y3X2E2V.js";import{a as l}from"./chunk.M3ZIZPKF.js";import{e as o,k as c}from"./chunk.TNLBUOUK.js";import{d as s,e as n,f as a,g as i}from"./chunk.NI7UJOOZ.js";l();var u,g,p,b,h,m,e=class extends c{constructor(){super(...arguments);this.name="hot-consent";a(this,u,"");a(this,g,!0);a(this,p,"About the information we collect");a(this,b,"We use cookies and similar technologies to recognize and analyze your visits, and measure traffic usage and activity.");a(this,h,"I Agree");a(this,m,"I Do Not Agree")}get consentId(){return n(this,u)}set consentId(t){i(this,u,t)}get isOpen(){return n(this,g)}set isOpen(t){i(this,g,t)}get title(){return n(this,p)}set title(t){i(this,p,t)}get message(){return n(this,b)}set message(t){i(this,b,t)}get agreeLabel(){return n(this,h)}set agreeLabel(t){i(this,h,t)}get notAgreeLabel(){return n(this,m)}set notAgreeLabel(t){i(this,m,t)}render(){return this.isOpen?o`
2
2
  <div class="consent-overlay">
3
3
  <div class="consent-container">
4
4
  <wa-callout variant="brand" appearance="outlined filled" size="large" class="consent-callout">
@@ -33,4 +33,4 @@ import{b as o}from"./chunk.6Y3X2E2V.js";import{a as l}from"./chunk.M3ZIZPKF.js";
33
33
  </wa-callout>
34
34
  </div>
35
35
  </div>
36
- `:null}_setAgree(t){this.isOpen=!1,localStorage.setItem(`${this.consentId}-consent-agree`,"true"),this.dispatchEvent(new Event("agree",{bubbles:!0,composed:!0}))}_setDisagree(t){this.isOpen=!1,localStorage.setItem(`${this.consentId}-consent-agree`,"false"),this.dispatchEvent(new Event("disagree",{bubbles:!0,composed:!0}))}connectedCallback(){super.connectedCallback();let t=localStorage.getItem(`${this.consentId}-consent-agree`);if(t==="false"){this.isOpen=!1;return}t==="true"&&(this.isOpen=!1)}};u=new WeakMap,g=new WeakMap,p=new WeakMap,b=new WeakMap,h=new WeakMap,m=new WeakMap,v=new WeakMap,e.styles=[d],s([o({type:String,attribute:"consent-id"})],e.prototype,"consentId",1),s([o({type:Boolean})],e.prototype,"force",1),s([o({type:Boolean})],e.prototype,"isOpen",1),s([o({type:String})],e.prototype,"title",1),s([o({type:String})],e.prototype,"message",1),s([o({type:String,attribute:"agree-label"})],e.prototype,"agreeLabel",1),s([o({type:String,attribute:"not-agree-label"})],e.prototype,"notAgreeLabel",1);var O=e;export{e as a,O as b};
36
+ `:null}_setAgree(t){this.isOpen=!1,localStorage.setItem(`${this.consentId}-consent-agree`,"true"),this.dispatchEvent(new Event("agree",{bubbles:!0,composed:!0}))}_setDisagree(t){this.isOpen=!1,localStorage.setItem(`${this.consentId}-consent-agree`,"false"),this.dispatchEvent(new Event("disagree",{bubbles:!0,composed:!0}))}connectedCallback(){super.connectedCallback();let t=localStorage.getItem(`${this.consentId}-consent-agree`);if(t==="false"){this.isOpen=!1;return}t==="true"&&(this.isOpen=!1)}};u=new WeakMap,g=new WeakMap,p=new WeakMap,b=new WeakMap,h=new WeakMap,m=new WeakMap,e.styles=[d],s([r({type:String,attribute:"consent-id"})],e.prototype,"consentId",1),s([r({type:Boolean})],e.prototype,"isOpen",1),s([r({type:String})],e.prototype,"title",1),s([r({type:String})],e.prototype,"message",1),s([r({type:String,attribute:"agree-label"})],e.prototype,"agreeLabel",1),s([r({type:String,attribute:"not-agree-label"})],e.prototype,"notAgreeLabel",1);var k=e;export{e as a,k as b};
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk.EOKB5QI4.js";var n=e;customElements.define("hot-consent",e);export{n as a};
@@ -1,4 +1,4 @@
1
- import{c as o,d as t,g as l,h as i}from"./chunk.2FEIL35F.js";import{a as e,b as a}from"./chunk.6Y3X2E2V.js";import{e as n}from"./chunk.TNLBUOUK.js";var d=`:host {
1
+ import{c as o,d as e,g as l,h as i}from"./chunk.2FEIL35F.js";import{a as t,b as a}from"./chunk.6Y3X2E2V.js";import{e as n}from"./chunk.TNLBUOUK.js";var p=`:host {
2
2
  display: flex;
3
3
  position: relative;
4
4
  align-items: stretch;
@@ -58,7 +58,7 @@ import{c as o,d as t,g as l,h as i}from"./chunk.2FEIL35F.js";import{a as e,b as
58
58
  display: block;
59
59
  overflow: hidden;
60
60
  }
61
- `,r=class extends t{constructor(){super(...arguments),this.variant="brand",this.appearance="outlined filled",this.size="medium"}render(){return n`
61
+ `,r=class extends e{constructor(){super(...arguments),this.variant="brand",this.appearance="outlined filled",this.size="medium"}render(){return n`
62
62
  <div part="icon">
63
63
  <slot name="icon"></slot>
64
64
  </div>
@@ -66,4 +66,4 @@ import{c as o,d as t,g as l,h as i}from"./chunk.2FEIL35F.js";import{a as e,b as
66
66
  <div part="message">
67
67
  <slot></slot>
68
68
  </div>
69
- `}};r.css=[d,i,l];o([a({reflect:!0})],r.prototype,"variant",2);o([a({reflect:!0})],r.prototype,"appearance",2);o([a({reflect:!0})],r.prototype,"size",2);r=o([e("wa-callout")],r);
69
+ `}};r.css=[p,i,l];o([a({reflect:!0})],r.prototype,"variant",2);o([a({reflect:!0})],r.prototype,"appearance",2);o([a({reflect:!0})],r.prototype,"size",2);r=o([t("wa-callout")],r);