@asgardeo/browser 0.1.0 → 0.1.2

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,40 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import { ThemeDetection, ThemeMode } from '@asgardeo/javascript';
19
+ /**
20
+ * Extended theme detection config that includes DOM-specific options
21
+ */
22
+ export interface BrowserThemeDetection extends ThemeDetection {
23
+ /**
24
+ * The element to observe for class changes
25
+ * @default document.documentElement (html element)
26
+ */
27
+ targetElement?: HTMLElement;
28
+ }
29
+ /**
30
+ * Detects the current theme mode based on the specified method
31
+ */
32
+ export declare const detectThemeMode: (mode: ThemeMode, config?: BrowserThemeDetection) => "light" | "dark";
33
+ /**
34
+ * Creates a MutationObserver to watch for class changes on the target element
35
+ */
36
+ export declare const createClassObserver: (targetElement: HTMLElement, callback: (isDark: boolean) => void, config?: BrowserThemeDetection) => MutationObserver;
37
+ /**
38
+ * Creates a media query listener for system theme changes
39
+ */
40
+ export declare const createMediaQueryListener: (callback: (isDark: boolean) => void) => MediaQueryList | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asgardeo/browser",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Browser-specific implementation of Asgardeo JavaScript SDK.",
5
5
  "keywords": [
6
6
  "asgardeo",
@@ -59,7 +59,7 @@
59
59
  "randombytes": "^2.1.0",
60
60
  "stream-browserify": "^3.0.0",
61
61
  "tslib": "^2.8.1",
62
- "@asgardeo/javascript": "^0.1.0"
62
+ "@asgardeo/javascript": "^0.1.2"
63
63
  },
64
64
  "publishConfig": {
65
65
  "access": "public"
@@ -1,28 +0,0 @@
1
- /**
2
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
- *
4
- * WSO2 LLC. licenses this file to you under the Apache License,
5
- * Version 2.0 (the "License"); you may not use this file except
6
- * in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing,
12
- * software distributed under the License is distributed on an
13
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- * KIND, either express or implied. See the License for the
15
- * specific language governing permissions and limitations
16
- * under the License.
17
- */
18
- /**
19
- * Class defining style constants for the downstream libraries.
20
- */
21
- declare class StyleConstants {
22
- /**
23
- * CSS class prefix for out of the box components.
24
- */
25
- static readonly VENDOR_CSS_CLASS_PREFIX: string;
26
- protected constructor();
27
- }
28
- export default StyleConstants;
@@ -1,32 +0,0 @@
1
- /**
2
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
- *
4
- * WSO2 LLC. licenses this file to you under the Apache License,
5
- * Version 2.0 (the "License"); you may not use this file except
6
- * in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing,
12
- * software distributed under the License is distributed on an
13
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- * KIND, either express or implied. See the License for the
15
- * specific language governing permissions and limitations
16
- * under the License.
17
- */
18
- /**
19
- * Adds a vendor-specific prefix to a CSS class name.
20
- *
21
- * @param className - The original CSS class name to be prefixed
22
- * @returns A new string with the vendor prefix added to the class name
23
- *
24
- * @example
25
- * ```typescript
26
- * // Usage with clsx
27
- * clsx(withVendorCSSClassPrefix('sign-in-button'), className)
28
- * // Result: "wso2-sign-in-button"
29
- * ```
30
- */
31
- declare const withVendorCSSClassPrefix: (className: string) => string;
32
- export default withVendorCSSClassPrefix;