@hotosm/ui 0.3.2-b5 → 0.3.2-b7

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.
@@ -0,0 +1,179 @@
1
+ import{b as p}from"./chunk.TNLBUOUK.js";import{a as h,c as g}from"./chunk.NI7UJOOZ.js";function b(r){var e,o,t="";if(typeof r=="string"||typeof r=="number")t+=r;else if(typeof r=="object")if(Array.isArray(r)){var i=r.length;for(e=0;e<i;e++)r[e]&&(o=b(r[e]))&&(t&&(t+=" "),t+=o)}else for(o in r)r[o]&&(t&&(t+=" "),t+=o);return t}function f(){for(var r,e,o=0,t="",i=arguments.length;o<i;o++)(r=arguments[o])&&(e=b(r))&&(t&&(t+=" "),t+=e);return t}var y=r=>typeof r=="boolean"?`${r}`:r===0?"0":r,x=f,w=(r,e)=>o=>{var t;if((e==null?void 0:e.variants)==null)return x(r,o==null?void 0:o.class,o==null?void 0:o.className);let{variants:i,defaultVariants:s}=e,z=Object.keys(i).map(a=>{let l=o==null?void 0:o[a],d=s==null?void 0:s[a];if(l===null)return null;let n=y(l)||y(d);return i[a][n]}),m=o&&Object.entries(o).reduce((a,l)=>{let[d,n]=l;return n===void 0||(a[d]=n),a},{}),A=e==null||(t=e.compoundVariants)===null||t===void 0?void 0:t.reduce((a,l)=>{let u=l,{class:d,className:n}=u,O=g(u,["class","className"]);return Object.entries(O).every(C=>{let[v,c]=C;return Array.isArray(c)?c.includes(h(h({},s),m)[v]):h(h({},s),m)[v]===c})?[...a,d,n]:a},[]);return x(r,z,A,o==null?void 0:o.class,o==null?void 0:o.className)};var V=w(`
2
+ header
3
+ `,{variants:{size:{small:"header--size-small",medium:"header--size-medium",large:"header--size-large"},borderBottom:{true:"border-bottom"}}}),F=p`
4
+ .header {
5
+ display: flex;
6
+ align-items: center;
7
+ justify-content: space-between;
8
+ padding: 0 var(--hot-spacing-small);
9
+ }
10
+
11
+ .header.border-bottom {
12
+ border-bottom: var(--hot-spacing-3x-small) solid var(--hot-color-neutral-50);
13
+ }
14
+
15
+ .header--size-small {
16
+ height: var(--hot-spacing-4x-large);
17
+ }
18
+
19
+ .header--size-medium {
20
+ height: calc(var(--hot-spacing-4x-large) * 2);
21
+ }
22
+
23
+ .header--size-large {
24
+ height: calc(var(--hot-spacing-4x-large) * 4);
25
+ }
26
+
27
+ .header--link {
28
+ text-decoration: none;
29
+ display: flex;
30
+ align-items: center;
31
+ justify-content: space-between;
32
+ gap: var(--hot-spacing-small);
33
+ }
34
+
35
+ .header--title {
36
+ color: var(--hot-color-neutral-950);
37
+ font-family: var(--hot-font-sans);
38
+ font-size: var(--hot-font-size-x-large);
39
+ }
40
+
41
+ .header--tab::part(base) {
42
+ font-size: var(--hot-font-size-medium);
43
+ font-weight: var(--hot-font-weight-normal);
44
+ color: var(--hot-color-neutral-950);
45
+ padding: var(--hot-spacing-small) var(--hot-spacing-small);
46
+ }
47
+
48
+ .header--tab-group::part(base) {
49
+ --track-color: transparent;
50
+ --indicator-color: none;
51
+ }
52
+
53
+ .header--nav {
54
+ justify-content: space-between;
55
+ justify-items: center;
56
+ gap: var(--hot-spacing-medium);
57
+ font-weight: var(--hot-font-weight-semibold);
58
+ }
59
+
60
+ .header--nav-mobile {
61
+ }
62
+
63
+ .header--person-circle {
64
+ font-size: var(--hot-font-size-x-large);
65
+ }
66
+
67
+ .header--drawer {
68
+ font-size: var(--hot-font-size-x-large)
69
+ }
70
+
71
+ .header--right-section {
72
+ display: flex;
73
+ align-items: center;
74
+ gap: var(--hot-spacing-small);
75
+ }
76
+
77
+ .header--logo-img {
78
+ }
79
+
80
+ .header--tab {
81
+ border-bottom: 2px solid;
82
+ border-color: transparent;
83
+ }
84
+ .header--tab-active {
85
+ border-color: var(--hot-color-neutral-1000);
86
+ }
87
+
88
+ /* Login Modal Styles */
89
+ .login-modal {
90
+ --width: 35rem;
91
+ --border-radius: 8px;
92
+ --background-color: white;
93
+ }
94
+
95
+ /* Global wa-button styling when shadow DOM is disabled */
96
+ wa-button {
97
+ /* HOT Color primitives */
98
+ --hot-color-red-950: #A52A28;
99
+ --hot-color-red-900: #B9302D;
100
+ --hot-color-red-800: #B83032;
101
+ --hot-color-red-700: #C53639;
102
+ --hot-color-red-600: #D73F3F;
103
+ --hot-color-red-500: #F34D47;
104
+ --hot-color-red-400: #ED5C5E;
105
+ --hot-color-red-300: #E27A7D;
106
+ --hot-color-red-200: #EC9EA1;
107
+ --hot-color-red-100: #FDD0D6;
108
+ --hot-color-red-50: #FEECEF;
109
+
110
+ /* HOT Semantic colors */
111
+ --hot-color-primary-950: var(--hot-color-red-950);
112
+ --hot-color-primary-900: var(--hot-color-red-900);
113
+ --hot-color-primary-800: var(--hot-color-red-800);
114
+ --hot-color-primary-700: var(--hot-color-red-700);
115
+ --hot-color-primary-600: var(--hot-color-red-600);
116
+ --hot-color-primary-500: var(--hot-color-red-500);
117
+ --hot-color-primary-400: var(--hot-color-red-400);
118
+ --hot-color-primary-300: var(--hot-color-red-300);
119
+ --hot-color-primary-200: var(--hot-color-red-200);
120
+ --hot-color-primary-100: var(--hot-color-red-100);
121
+ --hot-color-primary-50: var(--hot-color-red-50);
122
+
123
+ /* HOT Typography */
124
+ --hot-font-sans: Archivo, -apple-system, Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
125
+ --hot-font-weight-semibold: 500;
126
+ --hot-font-weight-bold: 700;
127
+
128
+ /* HOT Spacing */
129
+ --hot-spacing-x-small: 0.5rem;
130
+ --hot-spacing-small: 0.75rem;
131
+ --hot-spacing-medium: 1rem;
132
+ --hot-spacing-large: 1.25rem;
133
+
134
+ /* HOT Border radius */
135
+ --hot-border-radius-medium: 0.25rem;
136
+ --hot-border-radius-circle: 50%;
137
+
138
+ /* HOT Font sizes */
139
+ --hot-font-size-small: 0.875rem;
140
+ --hot-font-size-medium: 1rem;
141
+ --hot-font-size-large: 1.25rem;
142
+ }
143
+
144
+ /* Apply HOT styling to button parts */
145
+ wa-button::part(base) {
146
+ font-family: var(--hot-font-sans);
147
+ font-weight: var(--hot-font-weight-semibold);
148
+ border-radius: var(--hot-border-radius-medium);
149
+ transition: all 0.2s ease-in-out;
150
+ }
151
+
152
+ wa-button::part(base):hover {
153
+ transform: translateY(-1px);
154
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
155
+ }
156
+
157
+ wa-button::part(base):active {
158
+ transform: translateY(0);
159
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
160
+ }
161
+
162
+ wa-button::part(label) {
163
+ font-family: var(--hot-font-sans);
164
+ font-weight: var(--hot-font-weight-semibold);
165
+ }
166
+
167
+ /* Login button specific styling */
168
+ wa-button.login-button::part(base) {
169
+ background: linear-gradient(135deg, var(--hot-color-primary-500), var(--hot-color-primary-600));
170
+ border: none;
171
+ color: white;
172
+ padding: var(--hot-spacing-small) var(--hot-spacing-medium);
173
+ font-size: var(--hot-font-size-medium);
174
+ }
175
+
176
+ wa-button.login-button::part(base):hover {
177
+ background: linear-gradient(135deg, var(--hot-color-primary-600), var(--hot-color-primary-700));
178
+ }
179
+ `;export{V as a,F as b};
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk.6YNKD56X.js";var r=e;customElements.define("hot-header",e);export{r as a};
@@ -10,6 +10,8 @@ interface MenuItem {
10
10
  }
11
11
  export declare class Header extends LitElement {
12
12
  static styles: CSSResultGroup;
13
+ static shadowRootOptions: ShadowRootInit;
14
+ createRenderRoot(): DocumentFragment | HTMLElement;
13
15
  name: string;
14
16
  /** Use a text-based title in the header. */
15
17
  accessor title: string;
@@ -31,7 +33,21 @@ export declare class Header extends LitElement {
31
33
  accessor loginModalOpen: boolean;
32
34
  /** Default fallback icon for providers without custom icons. */
33
35
  accessor defaultLoginIcon: string;
36
+ private mutationObserver?;
34
37
  connectedCallback(): Promise<void>;
38
+ disconnectedCallback(): void;
39
+ /**
40
+ * Injects HOT theme CSS into the shadow DOM of wa-button components
41
+ */
42
+ private injectCSSIntoShadowDOM;
43
+ /**
44
+ * Sets up mutation observer to automatically inject CSS into new wa-button components
45
+ */
46
+ private setupMutationObserver;
47
+ /**
48
+ * Override updated() to inject CSS when new wa-button elements are added
49
+ */
50
+ updated(changedProperties: Map<string, unknown>): void;
35
51
  selectTab(index: number): void;
36
52
  protected render(): import("lit-html").TemplateResult<1>;
37
53
  private _tabClick;
@@ -1 +1 @@
1
- import{a,b}from"../../chunks/chunk.UMBUH2EC.js";import"../../chunks/chunk.WX25LIXR.js";import"../../chunks/chunk.2FEIL35F.js";import"../../chunks/chunk.6Y3X2E2V.js";import"../../chunks/chunk.KO4EOD3I.js";import"../../chunks/chunk.TNLBUOUK.js";import"../../chunks/chunk.NI7UJOOZ.js";export{a as Header,b as default};
1
+ import{a,b}from"../../chunks/chunk.6YNKD56X.js";import"../../chunks/chunk.GGX6E7QF.js";import"../../chunks/chunk.2FEIL35F.js";import"../../chunks/chunk.6Y3X2E2V.js";import"../../chunks/chunk.KO4EOD3I.js";import"../../chunks/chunk.TNLBUOUK.js";import"../../chunks/chunk.NI7UJOOZ.js";export{a as Header,b as default};
@@ -1 +1 @@
1
- import{a}from"../../chunks/chunk.RQCFXHIG.js";import"../../chunks/chunk.UMBUH2EC.js";import"../../chunks/chunk.WX25LIXR.js";import"../../chunks/chunk.2FEIL35F.js";import"../../chunks/chunk.6Y3X2E2V.js";import"../../chunks/chunk.KO4EOD3I.js";import"../../chunks/chunk.TNLBUOUK.js";import"../../chunks/chunk.NI7UJOOZ.js";export{a as default};
1
+ import{a}from"../../chunks/chunk.NTH75J37.js";import"../../chunks/chunk.6YNKD56X.js";import"../../chunks/chunk.GGX6E7QF.js";import"../../chunks/chunk.2FEIL35F.js";import"../../chunks/chunk.6Y3X2E2V.js";import"../../chunks/chunk.KO4EOD3I.js";import"../../chunks/chunk.TNLBUOUK.js";import"../../chunks/chunk.NI7UJOOZ.js";export{a as default};
@@ -1 +1 @@
1
- import{a,b}from"../../chunks/chunk.WX25LIXR.js";import"../../chunks/chunk.TNLBUOUK.js";import"../../chunks/chunk.NI7UJOOZ.js";export{a as headerVariants,b as styles};
1
+ import{a,b}from"../../chunks/chunk.GGX6E7QF.js";import"../../chunks/chunk.TNLBUOUK.js";import"../../chunks/chunk.NI7UJOOZ.js";export{a as headerVariants,b as styles};
package/dist/hotosm-ui.js CHANGED
@@ -1 +1 @@
1
- import{a as o}from"./chunks/chunk.RQCFXHIG.js";import"./chunks/chunk.UMBUH2EC.js";import"./chunks/chunk.WX25LIXR.js";import{a as t}from"./chunks/chunk.MCLA4YSC.js";import"./chunks/chunk.CFJBM2JT.js";import"./chunks/chunk.W65BP3JY.js";import{a as r}from"./chunks/chunk.3P72BRDN.js";import"./chunks/chunk.2E5B6OR3.js";import{a}from"./chunks/chunk.KWRSAL43.js";import"./chunks/chunk.NQSLFHXC.js";import"./chunks/chunk.O6I2TNK3.js";import{a as m}from"./chunks/chunk.SMFWK2VT.js";import"./chunks/chunk.OSUPNFJP.js";import"./chunks/chunk.34D2LPI2.js";import"./chunks/chunk.O2GMJYSL.js";import"./chunks/chunk.2FEIL35F.js";import"./chunks/chunk.6Y3X2E2V.js";import"./chunks/chunk.KO4EOD3I.js";import"./chunks/chunk.GTNRNZDH.js";import"./chunks/chunk.TNLBUOUK.js";import"./chunks/chunk.NI7UJOOZ.js";export{a as Button,m as Consent,o as Header,t as Logo,r as Tracking};
1
+ import{a as o}from"./chunks/chunk.NTH75J37.js";import"./chunks/chunk.6YNKD56X.js";import"./chunks/chunk.GGX6E7QF.js";import{a as t}from"./chunks/chunk.MCLA4YSC.js";import"./chunks/chunk.CFJBM2JT.js";import"./chunks/chunk.W65BP3JY.js";import{a as r}from"./chunks/chunk.3P72BRDN.js";import"./chunks/chunk.2E5B6OR3.js";import{a}from"./chunks/chunk.KWRSAL43.js";import"./chunks/chunk.NQSLFHXC.js";import"./chunks/chunk.O6I2TNK3.js";import{a as m}from"./chunks/chunk.SMFWK2VT.js";import"./chunks/chunk.OSUPNFJP.js";import"./chunks/chunk.34D2LPI2.js";import"./chunks/chunk.O2GMJYSL.js";import"./chunks/chunk.2FEIL35F.js";import"./chunks/chunk.6Y3X2E2V.js";import"./chunks/chunk.KO4EOD3I.js";import"./chunks/chunk.GTNRNZDH.js";import"./chunks/chunk.TNLBUOUK.js";import"./chunks/chunk.NI7UJOOZ.js";export{a as Button,m as Consent,o as Header,t as Logo,r as Tracking};
@@ -1,4 +1,5 @@
1
1
  /* HOT theme */
2
+
2
3
  /* :root makes them available globally */
3
4
  :root,
4
5
  /* :host is for Web Components and shadow DOM scopes */
@@ -16,7 +17,7 @@
16
17
  --hot-color-red-800: #B83032;
17
18
  --hot-color-red-700: #C53639;
18
19
  --hot-color-red-600: #D73F3F;
19
- --hot-color-red-500: green;
20
+ --hot-color-red-500: #F34D47;
20
21
  --hot-color-red-400: #ED5C5E;
21
22
  --hot-color-red-300: #E27A7D;
22
23
  --hot-color-red-200: #EC9EA1;
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Configuration for shadow DOM handling in HOT UI components
3
+ */
4
+ export interface ShadowDOMConfig {
5
+ /** Whether to disable shadow DOM for Lit components */
6
+ disableShadowDOM: boolean;
7
+ /** Whether to inject CSS into shadow DOM when not disabled */
8
+ injectCSS: boolean;
9
+ /** Whether to use mutation observers for dynamic content */
10
+ useMutationObserver: boolean;
11
+ }
12
+ /**
13
+ * Default configuration
14
+ * - disableShadowDOM: false (keep shadow DOM for encapsulation)
15
+ * - injectCSS: true (inject HOT theme CSS into shadow DOM)
16
+ * - useMutationObserver: true (automatically handle dynamic content)
17
+ */
18
+ export declare const defaultShadowDOMConfig: ShadowDOMConfig;
19
+ /**
20
+ * Configuration that disables shadow DOM entirely
21
+ * Use this when you want global CSS to penetrate all components
22
+ */
23
+ export declare const noShadowDOMConfig: ShadowDOMConfig;
24
+ /**
25
+ * Configuration that keeps shadow DOM but injects CSS
26
+ * Use this for maximum encapsulation with HOT theming
27
+ */
28
+ export declare const injectCSSConfig: ShadowDOMConfig;
29
+ /**
30
+ * Global configuration instance
31
+ * Can be modified at runtime to change behavior
32
+ */
33
+ export declare let globalShadowDOMConfig: ShadowDOMConfig;
34
+ /**
35
+ * Set the global shadow DOM configuration
36
+ * @param config The configuration to use
37
+ */
38
+ export declare function setShadowDOMConfig(config: ShadowDOMConfig): void;
39
+ /**
40
+ * Get the current global shadow DOM configuration
41
+ * @returns The current configuration
42
+ */
43
+ export declare function getShadowDOMConfig(): ShadowDOMConfig;
44
+ /**
45
+ * Helper function to determine if shadow DOM should be disabled for a component
46
+ * @returns True if shadow DOM should be disabled
47
+ */
48
+ export declare function shouldDisableShadowDOM(): boolean;
49
+ /**
50
+ * Helper function to determine if CSS should be injected into shadow DOM
51
+ * @returns True if CSS should be injected
52
+ */
53
+ export declare function shouldInjectCSS(): boolean;
54
+ /**
55
+ * Helper function to determine if mutation observers should be used
56
+ * @returns True if mutation observers should be used
57
+ */
58
+ export declare function shouldUseMutationObserver(): boolean;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Utility functions for injecting CSS into shadow DOM components
3
+ */
4
+ /**
5
+ * HOT theme CSS variables and styles for injection into shadow DOM
6
+ */
7
+ export declare const HOT_THEME_CSS = "\n :host {\n /* HOT Color primitives */\n --hot-color-red-950: #A52A28;\n --hot-color-red-900: #B9302D;\n --hot-color-red-800: #B83032;\n --hot-color-red-700: #C53639;\n --hot-color-red-600: #D73F3F;\n --hot-color-red-500: #F34D47;\n --hot-color-red-400: #ED5C5E;\n --hot-color-red-300: #E27A7D;\n --hot-color-red-200: #EC9EA1;\n --hot-color-red-100: #FDD0D6;\n --hot-color-red-50: #FEECEF;\n\n --hot-color-rose-950: #3E030B;\n --hot-color-rose-900: #4B040E;\n --hot-color-rose-800: #5C1517;\n --hot-color-rose-700: #6B231D;\n --hot-color-rose-600: #7C2E26;\n --hot-color-rose-500: #7D463F;\n --hot-color-rose-400: #9E6960;\n --hot-color-rose-300: #B3837B;\n --hot-color-rose-200: #CFA59E;\n --hot-color-rose-100: #EAC7C0;\n --hot-color-rose-50: #FFE6DE;\n\n --hot-color-yellow-950: #CC6508;\n --hot-color-yellow-900: #E8750C;\n --hot-color-yellow-800: #F77D0F;\n --hot-color-yellow-700: #FAA71E;\n --hot-color-yellow-600: #FCBF26;\n --hot-color-yellow-500: #FED82E;\n --hot-color-yellow-400: #FAE62E;\n --hot-color-yellow-300: #FDEB51;\n --hot-color-yellow-200: #FFF072;\n --hot-color-yellow-100: #FFF59B;\n --hot-color-yellow-50: #FFF9C3;\n\n --hot-color-blue-950: #111C31;\n --hot-color-blue-900: #182642;\n --hot-color-blue-800: #20365B;\n --hot-color-blue-700: #263F68;\n --hot-color-blue-600: #2E4873;\n --hot-color-blue-500: #344F7B;\n --hot-color-blue-400: #53688B;\n --hot-color-blue-300: #71829E;\n --hot-color-blue-200: #97A5BA;\n --hot-color-blue-100: #BFC8D6;\n --hot-color-blue-50: #E6E9EE;\n\n --hot-color-cyan-950: #2B514F;\n --hot-color-cyan-900: #366361;\n --hot-color-cyan-800: #408789;\n --hot-color-cyan-700: #459BA0;\n --hot-color-cyan-600: #4BB1B9;\n --hot-color-cyan-500: #50C1CB;\n --hot-color-cyan-400: #58CBD1;\n --hot-color-cyan-300: #6AD4D9;\n --hot-color-cyan-200: #8FE1E3;\n --hot-color-cyan-100: #B9EDED;\n --hot-color-cyan-50: #E3F8F8;\n\n --hot-color-gray-950: #2C3038;\n --hot-color-gray-900: #404248;\n --hot-color-gray-800: #515057;\n --hot-color-gray-700: #615F66;\n --hot-color-gray-600: #716F73;\n --hot-color-gray-500: #828085;\n --hot-color-gray-400: #9A969B;\n --hot-color-gray-300: #B3B0B3;\n --hot-color-gray-200: #C4C3C5;\n --hot-color-gray-100: #E1E0E1;\n --hot-color-gray-50: #F3F3F3;\n\n /* HOT Semantic colors */\n --hot-color-primary-950: var(--hot-color-red-950);\n --hot-color-primary-900: var(--hot-color-red-900);\n --hot-color-primary-800: var(--hot-color-red-800);\n --hot-color-primary-700: var(--hot-color-red-700);\n --hot-color-primary-600: var(--hot-color-red-600);\n --hot-color-primary-500: var(--hot-color-red-500);\n --hot-color-primary-400: var(--hot-color-red-400);\n --hot-color-primary-300: var(--hot-color-red-300);\n --hot-color-primary-200: var(--hot-color-red-200);\n --hot-color-primary-100: var(--hot-color-red-100);\n --hot-color-primary-50: var(--hot-color-red-50);\n\n --hot-color-danger-950: var(--hot-color-red-950);\n --hot-color-danger-900: var(--hot-color-red-900);\n --hot-color-danger-800: var(--hot-color-red-800);\n --hot-color-danger-700: var(--hot-color-red-700);\n --hot-color-danger-600: var(--hot-color-red-600);\n --hot-color-danger-500: var(--hot-color-red-500);\n --hot-color-danger-400: var(--hot-color-red-400);\n --hot-color-danger-300: var(--hot-color-red-300);\n --hot-color-danger-200: var(--hot-color-red-200);\n --hot-color-danger-100: var(--hot-color-red-100);\n --hot-color-danger-50: var(--hot-color-red-50);\n\n --hot-color-warning-950: var(--hot-color-yellow-950);\n --hot-color-warning-900: var(--hot-color-yellow-900);\n --hot-color-warning-800: var(--hot-color-yellow-800);\n --hot-color-warning-700: var(--hot-color-yellow-700);\n --hot-color-warning-600: var(--hot-color-yellow-600);\n --hot-color-warning-500: var(--hot-color-yellow-500);\n --hot-color-warning-400: var(--hot-color-yellow-400);\n --hot-color-warning-300: var(--hot-color-yellow-300);\n --hot-color-warning-200: var(--hot-color-yellow-200);\n --hot-color-warning-100: var(--hot-color-yellow-100);\n --hot-color-warning-50: var(--hot-color-yellow-50);\n\n --hot-color-success-950: #031608;\n --hot-color-success-900: #052310;\n --hot-color-success-800: #0a3a1d;\n --hot-color-success-700: #0a5027;\n --hot-color-success-600: #036730;\n --hot-color-success-500: #00883c;\n --hot-color-success-400: #00ac49;\n --hot-color-success-300: #5dc36f;\n --hot-color-success-200: #93da98;\n --hot-color-success-100: #c2f2c1;\n --hot-color-success-50: #e3f9e3;\n\n --hot-color-neutral-1000: #ffffff;\n --hot-color-neutral-950: var(--hot-color-gray-950);\n --hot-color-neutral-900: var(--hot-color-gray-900);\n --hot-color-neutral-800: var(--hot-color-gray-800);\n --hot-color-neutral-700: var(--hot-color-gray-700);\n --hot-color-neutral-600: var(--hot-color-gray-600);\n --hot-color-neutral-500: var(--hot-color-gray-500);\n --hot-color-neutral-400: var(--hot-color-gray-400);\n --hot-color-neutral-300: var(--hot-color-gray-300);\n --hot-color-neutral-200: var(--hot-color-gray-200);\n --hot-color-neutral-100: var(--hot-color-gray-100);\n --hot-color-neutral-50: var(--hot-color-gray-50);\n --hot-color-neutral-0: #000000;\n\n /* HOT Typography */\n --hot-font-sans: Archivo, -apple-system, Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';\n --hot-font-sans-variant: 'Barlow';\n --hot-font-sans-variant-condensed: 'Barlow Condensed';\n --hot-font-sefif: Georgia, 'Times New Roman', serif;\n --hot-font-mono: Menlo, Monaco, Consolas, 'Courier New', monospace, Consolas, 'Liberation Mono', Menlo, monospace;\n\n --hot-font-size-2x-small: 0.625rem;\n --hot-font-size-x-small: 0.75rem;\n --hot-font-size-small: 0.875rem;\n --hot-font-size-medium: 1rem;\n --hot-font-size-large: 1.25rem;\n --hot-font-size-x-large: 1.5rem;\n --hot-font-size-2x-large: 2.25rem;\n --hot-font-size-3x-large: 3rem;\n --hot-font-size-4x-large: 4.5rem;\n\n --hot-font-weight-light: 300;\n --hot-font-weight-normal: 400;\n --hot-font-weight-semibold: 500;\n --hot-font-weight-bold: 700;\n\n --hot-letter-spacing-denser: -0.03em;\n --hot-letter-spacing-dense: -0.015em;\n --hot-letter-spacing-normal: normal;\n --hot-letter-spacing-loose: 0.075em;\n --hot-letter-spacing-looser: 0.15em;\n\n --hot-line-height-denser: 1;\n --hot-line-height-dense: 1.4;\n --hot-line-height-normal: 1.8;\n --hot-line-height-loose: 2.2;\n --hot-line-height-looser: 2.6;\n\n --hot-spacing-3x-small: 0.125rem;\n --hot-spacing-2x-small: 0.25rem;\n --hot-spacing-x-small: 0.5rem;\n --hot-spacing-small: 0.75rem;\n --hot-spacing-medium: 1rem;\n --hot-spacing-large: 1.25rem;\n --hot-spacing-x-large: 1.75rem;\n --hot-spacing-2x-large: 2.25rem;\n --hot-spacing-3x-large: 3rem;\n --hot-spacing-4x-large: 4.5rem;\n\n --hot-border-radius-small: 0.1875rem;\n --hot-border-radius-medium: 0.25rem;\n --hot-border-radius-large: 0.5rem;\n --hot-border-radius-x-large: 1rem;\n --hot-border-radius-circle: 50%;\n --hot-border-radius-pill: 9999px;\n }\n\n /* Apply HOT styling to button parts */\n ::part(base) {\n font-family: var(--hot-font-sans);\n font-weight: var(--hot-font-weight-semibold);\n border-radius: var(--hot-border-radius-medium);\n transition: all 0.2s ease-in-out;\n }\n\n ::part(base):hover {\n transform: translateY(-1px);\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);\n }\n\n ::part(base):active {\n transform: translateY(0);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n }\n\n ::part(label) {\n font-family: var(--hot-font-sans);\n font-weight: var(--hot-font-weight-semibold);\n }\n\n /* Login button specific styling */\n :host(.login-button)::part(base) {\n background: linear-gradient(135deg, var(--hot-color-primary-500), var(--hot-color-primary-600));\n border: none;\n color: white;\n padding: var(--hot-spacing-small) var(--hot-spacing-medium);\n font-size: var(--hot-font-size-medium);\n }\n\n :host(.login-button)::part(base):hover {\n background: linear-gradient(135deg, var(--hot-color-primary-600), var(--hot-color-primary-700));\n }\n\n /* Gradient button styling */\n :host(.gradient-button)::part(base) {\n background: linear-gradient(217deg, var(--hot-color-red-50), var(--hot-color-rose-50), var(--hot-color-yellow-50));\n border: solid 1px var(--hot-color-rose-50);\n color: white;\n text-shadow: rgb(0 0 0 / 0.3) 0 -1px;\n }\n\n :host(.gradient-button)::part(base):hover {\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);\n transform: translateY(-3px);\n }\n\n :host(.gradient-button)::part(base):active {\n box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);\n transform: translateY(0);\n }\n";
8
+ /**
9
+ * Injects HOT theme CSS into the shadow DOM of a component
10
+ * @param element The element to inject CSS into
11
+ * @param styleId Optional ID for the style element (defaults to 'hot-theme-injection')
12
+ */
13
+ export declare function injectHOTThemeCSS(element: Element, styleId?: string): void;
14
+ /**
15
+ * Injects HOT theme CSS into all wa-button components within a container
16
+ * @param container The container element or shadow root to search for wa-button components
17
+ */
18
+ export declare function injectHOTThemeCSSIntoButtons(container: Element | ShadowRoot): void;
19
+ /**
20
+ * Creates a MutationObserver to automatically inject CSS into new wa-button components
21
+ * @param container The container element or shadow root to observe
22
+ * @param callback Optional callback to run after injection
23
+ */
24
+ export declare function observeAndInjectCSS(container: Element | ShadowRoot, callback?: () => void): MutationObserver;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotosm/ui",
3
- "version": "0.3.2-b5",
3
+ "version": "0.3.2-b7",
4
4
  "description": "Shared UI components with HOT theming.",
5
5
  "homepage": "https://github.com/hotosm/ui#readme",
6
6
  "author": {
@@ -1 +0,0 @@
1
- import{b as e}from"./chunk.UMBUH2EC.js";var r=e;customElements.define("hot-header",e);export{r as a};
@@ -1,96 +0,0 @@
1
- import{b as f}from"./chunk.TNLBUOUK.js";import{a as c,c as g}from"./chunk.NI7UJOOZ.js";function b(t){var r,e,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var n=t.length;for(r=0;r<n;r++)t[r]&&(e=b(t[r]))&&(a&&(a+=" "),a+=e)}else for(e in t)t[e]&&(a&&(a+=" "),a+=e);return a}function y(){for(var t,r,e=0,a="",n=arguments.length;e<n;e++)(t=arguments[e])&&(r=b(t))&&(a&&(a+=" "),a+=r);return a}var x=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,p=y,z=(t,r)=>e=>{var a;if((r==null?void 0:r.variants)==null)return p(t,e==null?void 0:e.class,e==null?void 0:e.className);let{variants:n,defaultVariants:s}=r,w=Object.keys(n).map(o=>{let i=e==null?void 0:e[o],d=s==null?void 0:s[o];if(i===null)return null;let l=x(i)||x(d);return n[o][l]}),m=e&&Object.entries(e).reduce((o,i)=>{let[d,l]=i;return l===void 0||(o[d]=l),o},{}),j=r==null||(a=r.compoundVariants)===null||a===void 0?void 0:a.reduce((o,i)=>{let u=i,{class:d,className:l}=u,V=g(u,["class","className"]);return Object.entries(V).every(k=>{let[v,h]=k;return Array.isArray(h)?h.includes(c(c({},s),m)[v]):c(c({},s),m)[v]===h})?[...o,d,l]:o},[]);return p(t,w,j,e==null?void 0:e.class,e==null?void 0:e.className)};var _=z(`
2
- header
3
- `,{variants:{size:{small:"header--size-small",medium:"header--size-medium",large:"header--size-large"},borderBottom:{true:"border-bottom"}}}),B=f`
4
- .header {
5
- display: flex;
6
- align-items: center;
7
- justify-content: space-between;
8
- padding: 0 var(--hot-spacing-small);
9
- }
10
-
11
- .header.border-bottom {
12
- border-bottom: var(--hot-spacing-3x-small) solid var(--hot-color-neutral-50);
13
- }
14
-
15
- .header--size-small {
16
- height: var(--hot-spacing-4x-large);
17
- }
18
-
19
- .header--size-medium {
20
- height: calc(var(--hot-spacing-4x-large) * 2);
21
- }
22
-
23
- .header--size-large {
24
- height: calc(var(--hot-spacing-4x-large) * 4);
25
- }
26
-
27
- .header--link {
28
- text-decoration: none;
29
- display: flex;
30
- align-items: center;
31
- justify-content: space-between;
32
- gap: var(--hot-spacing-small);
33
- }
34
-
35
- .header--title {
36
- color: var(--hot-color-neutral-950);
37
- font-family: var(--hot-font-sans);
38
- font-size: var(--hot-font-size-x-large);
39
- }
40
-
41
- .header--tab::part(base) {
42
- font-size: var(--hot-font-size-medium);
43
- font-weight: var(--hot-font-weight-normal);
44
- color: var(--hot-color-neutral-950);
45
- padding: var(--hot-spacing-small) var(--hot-spacing-small);
46
- }
47
-
48
- .header--tab-group::part(base) {
49
- --track-color: transparent;
50
- --indicator-color: none;
51
- }
52
-
53
- .header--nav {
54
- justify-content: space-between;
55
- justify-items: center;
56
- gap: var(--hot-spacing-medium);
57
- font-weight: var(--hot-font-weight-semibold);
58
- }
59
-
60
- .header--nav-mobile {
61
- }
62
-
63
- .header--person-circle {
64
- font-size: var(--hot-font-size-x-large);
65
- }
66
-
67
- .header--drawer {
68
- font-size: var(--hot-font-size-x-large)
69
- }
70
-
71
- .header--right-section {
72
- display: flex;
73
- align-items: center;
74
- gap: var(--hot-spacing-small);
75
- }
76
-
77
-
78
-
79
- .header--logo-img {
80
- }
81
-
82
- .header--tab {
83
- border-bottom: 2px solid;
84
- border-color: transparent;
85
- }
86
- .header--tab-active {
87
- border-color: var(--hot-color-neutral-1000);
88
- }
89
-
90
- /* Login Modal Styles */
91
- .login-modal {
92
- --width: 35rem;
93
- --border-radius: 8px;
94
- --background-color: white;
95
- }
96
- `;export{_ as a,B as b};