@asgardeo/react 0.15.4 → 0.16.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.
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) 2026, 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 { Theme } from '@asgardeo/browser';
19
+ declare const useStyles: (theme: Theme, colorScheme: string) => Record<string, string>;
20
+ export default useStyles;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Copyright (c) 2026, 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 { FC, InputHTMLAttributes } from 'react';
19
+ /**
20
+ * Props for the Toggle component.
21
+ */
22
+ export interface ToggleProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'type'> {
23
+ className?: string;
24
+ error?: string;
25
+ helperText?: string;
26
+ label?: string;
27
+ required?: boolean;
28
+ }
29
+ /**
30
+ * A Toggle component that represents a boolean input. It is built on top of a hidden checkbox input
31
+ * and styled to look like a switch.
32
+ *
33
+ * The component is wrapped in a FormControl to display error messages and helper text.
34
+ * The label is associated with the input for accessibility.
35
+ *
36
+ * @param props - Props for the Toggle component
37
+ * @returns A JSX element representing the Toggle
38
+ */
39
+ declare const Toggle: FC<ToggleProps>;
40
+ export default Toggle;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) 2026, 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 { Theme } from '@asgardeo/browser';
19
+ declare const useStyles: (theme: Theme, colorScheme: string, hasError: boolean, required: boolean) => Record<string, string>;
20
+ export default useStyles;
package/dist/index.d.ts CHANGED
@@ -155,6 +155,8 @@ export { default as DatePicker } from './components/primitives/DatePicker/DatePi
155
155
  export * from './components/primitives/DatePicker/DatePicker';
156
156
  export { default as Checkbox } from './components/primitives/Checkbox/Checkbox';
157
157
  export * from './components/primitives/Checkbox/Checkbox';
158
+ export { default as Toggle } from './components/primitives/Toggle/Toggle';
159
+ export * from './components/primitives/Toggle/Toggle';
158
160
  export { default as FormControl } from './components/primitives/FormControl/FormControl';
159
161
  export * from './components/primitives/FormControl/FormControl';
160
162
  export { default as InputLabel } from './components/primitives/InputLabel/InputLabel';