@qualcomm-ui/react 1.10.1 → 1.12.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.
- package/dist/alert-banner/alert-banner-action-container.d.ts +14 -0
- package/dist/alert-banner/alert-banner-action-container.d.ts.map +1 -0
- package/dist/alert-banner/alert-banner-close-button.d.ts +13 -0
- package/dist/alert-banner/alert-banner-close-button.d.ts.map +1 -0
- package/dist/alert-banner/alert-banner-description.d.ts +13 -0
- package/dist/alert-banner/alert-banner-description.d.ts.map +1 -0
- package/dist/alert-banner/alert-banner-heading.d.ts +13 -0
- package/dist/alert-banner/alert-banner-heading.d.ts.map +1 -0
- package/dist/alert-banner/alert-banner-icon.d.ts +16 -0
- package/dist/alert-banner/alert-banner-icon.d.ts.map +1 -0
- package/dist/alert-banner/alert-banner-root.d.ts +18 -0
- package/dist/alert-banner/alert-banner-root.d.ts.map +1 -0
- package/dist/alert-banner/alert-banner.d.ts +82 -0
- package/dist/alert-banner/alert-banner.d.ts.map +1 -0
- package/dist/alert-banner/index.d.ts +41 -0
- package/dist/alert-banner/index.d.ts.map +1 -0
- package/dist/alert-banner/index.js +3 -0
- package/dist/alert-banner/index.js.map +7 -0
- package/dist/alert-banner/qds-alert-banner-context.d.ts +6 -0
- package/dist/alert-banner/qds-alert-banner-context.d.ts.map +1 -0
- package/dist/avatar/avatar-root.d.ts +7 -3
- package/dist/avatar/avatar-root.d.ts.map +1 -1
- package/dist/avatar/index.js +1 -1
- package/dist/avatar/index.js.map +2 -2
- package/dist/checkbox/checkbox-hint.d.ts +15 -0
- package/dist/checkbox/checkbox-hint.d.ts.map +1 -0
- package/dist/checkbox/checkbox.d.ts +11 -1
- package/dist/checkbox/checkbox.d.ts.map +1 -1
- package/dist/checkbox/index.d.ts +3 -1
- package/dist/checkbox/index.d.ts.map +1 -1
- package/dist/checkbox/index.js +1 -1
- package/dist/checkbox/index.js.map +4 -4
- package/dist/inline-notification/index.js +1 -1
- package/dist/inline-notification/index.js.map +2 -2
- package/dist/inline-notification/inline-notification-icon.d.ts.map +1 -1
- package/dist/input/index.js +1 -1
- package/dist/input/index.js.map +2 -2
- package/dist/number-input/index.d.ts +4 -1
- package/dist/number-input/index.d.ts.map +1 -1
- package/dist/number-input/index.js +1 -1
- package/dist/number-input/index.js.map +4 -4
- package/dist/number-input/number-input-unit-select.d.ts +6 -0
- package/dist/number-input/number-input-unit-select.d.ts.map +1 -0
- package/dist/number-input/number-input.d.ts +6 -1
- package/dist/number-input/number-input.d.ts.map +1 -1
- package/dist/radio/index.d.ts +3 -1
- package/dist/radio/index.d.ts.map +1 -1
- package/dist/radio/index.js +1 -1
- package/dist/radio/index.js.map +4 -4
- package/dist/radio/radio-group/index.d.ts +3 -1
- package/dist/radio/radio-group/index.d.ts.map +1 -1
- package/dist/radio/radio-group/radio-group-hint.d.ts +10 -0
- package/dist/radio/radio-group/radio-group-hint.d.ts.map +1 -0
- package/dist/radio/radio-hint.d.ts +15 -0
- package/dist/radio/radio-hint.d.ts.map +1 -0
- package/dist/radio/radio.d.ts +11 -1
- package/dist/radio/radio.d.ts.map +1 -1
- package/dist/select/index.d.ts +8 -1
- package/dist/select/index.d.ts.map +1 -1
- package/dist/select/index.js +1 -1
- package/dist/select/index.js.map +4 -4
- package/dist/select/select-item-checkbox.d.ts +11 -0
- package/dist/select/select-item-checkbox.d.ts.map +1 -0
- package/dist/select/select-items.d.ts.map +1 -1
- package/dist/select/select-root.d.ts +1 -1
- package/dist/select/select-root.d.ts.map +1 -1
- package/dist/switch/index.d.ts +3 -1
- package/dist/switch/index.d.ts.map +1 -1
- package/dist/switch/index.js +1 -1
- package/dist/switch/index.js.map +4 -4
- package/dist/switch/switch-hint.d.ts +15 -0
- package/dist/switch/switch-hint.d.ts.map +1 -0
- package/dist/switch/switch.d.ts +10 -1
- package/dist/switch/switch.d.ts.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -12,5 +12,5 @@ export interface SelectRootProps extends CoreSelectRootProps, QdsSelectApiProps
|
|
|
12
12
|
/**
|
|
13
13
|
* Groups all parts of the select. Renders a `<div>` element by default.
|
|
14
14
|
*/
|
|
15
|
-
export declare function SelectRoot({ children, icon, size, ...props }: SelectRootProps): ReactElement;
|
|
15
|
+
export declare function SelectRoot({ children, icon, selectionIndicator, size, ...props }: SelectRootProps): ReactElement;
|
|
16
16
|
//# sourceMappingURL=select-root.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-root.d.ts","sourceRoot":"","sources":["../../src/select/select-root.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAC,KAAK,YAAY,EAAU,MAAM,OAAO,CAAA;AAGhD,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,8BAA8B,CAAA;AAKrC,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAA;AAEvE,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,gCAAgC,CAAA;AAMvC,MAAM,WAAW,eACf,SAAQ,mBAAmB,EACzB,iBAAiB;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,mBAAmB,CAAA;CAC3B;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,YAAY,CAsBhC"}
|
|
1
|
+
{"version":3,"file":"select-root.d.ts","sourceRoot":"","sources":["../../src/select/select-root.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAC,KAAK,YAAY,EAAU,MAAM,OAAO,CAAA;AAGhD,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,8BAA8B,CAAA;AAKrC,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAA;AAEvE,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,gCAAgC,CAAA;AAMvC,MAAM,WAAW,eACf,SAAQ,mBAAmB,EACzB,iBAAiB;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,mBAAmB,CAAA;CAC3B;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,IAAI,EACJ,kBAAkB,EAClB,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,YAAY,CAsBhC"}
|
package/dist/switch/index.d.ts
CHANGED
|
@@ -2,15 +2,17 @@ import { Switch as SimpleSwitch } from "./switch";
|
|
|
2
2
|
import { SwitchControl, type SwitchControlProps } from "./switch-control";
|
|
3
3
|
import { SwitchErrorText, type SwitchErrorTextProps } from "./switch-error-text";
|
|
4
4
|
import { SwitchHiddenInput, type SwitchHiddenInputProps } from "./switch-hidden-input";
|
|
5
|
+
import { SwitchHint, type SwitchHintProps } from "./switch-hint";
|
|
5
6
|
import { SwitchLabel, type SwitchLabelProps } from "./switch-label";
|
|
6
7
|
import { SwitchRoot, type SwitchRootProps } from "./switch-root";
|
|
7
8
|
import { SwitchThumb, type SwitchThumbProps } from "./switch-thumb";
|
|
8
9
|
export * from "./qds-switch-context";
|
|
9
|
-
export type { SwitchControlProps, SwitchErrorTextProps, SwitchHiddenInputProps, SwitchLabelProps, SwitchRootProps, SwitchThumbProps, };
|
|
10
|
+
export type { SwitchControlProps, SwitchErrorTextProps, SwitchHiddenInputProps, SwitchHintProps, SwitchLabelProps, SwitchRootProps, SwitchThumbProps, };
|
|
10
11
|
type SwitchComponent = typeof SimpleSwitch & {
|
|
11
12
|
Control: typeof SwitchControl;
|
|
12
13
|
ErrorText: typeof SwitchErrorText;
|
|
13
14
|
HiddenInput: typeof SwitchHiddenInput;
|
|
15
|
+
Hint: typeof SwitchHint;
|
|
14
16
|
Label: typeof SwitchLabel;
|
|
15
17
|
Root: typeof SwitchRoot;
|
|
16
18
|
Thumb: typeof SwitchThumb;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/switch/index.ts"],"names":[],"mappings":"AAAA,OAAO,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AAiB,EACjB,KAAK,sBAAsB,EAC5B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAC,UAAU,EAAE,KAAK,eAAe,EAAC,MAAM,eAAe,CAAA;AAC9D,OAAO,EAAC,WAAW,EAAE,KAAK,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;AACjE,OAAO,EAAC,UAAU,EAAE,KAAK,eAAe,EAAC,MAAM,eAAe,CAAA;AAC9D,OAAO,EAAC,WAAW,EAAE,KAAK,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;AAEjE,cAAc,sBAAsB,CAAA;AAEpC,YAAY,EACV,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,gBAAgB,GACjB,CAAA;AAED,KAAK,eAAe,GAAG,OAAO,YAAY,GAAG;IAC3C,OAAO,EAAE,OAAO,aAAa,CAAA;IAC7B,SAAS,EAAE,OAAO,eAAe,CAAA;IACjC,WAAW,EAAE,OAAO,iBAAiB,CAAA;IACrC,IAAI,EAAE,OAAO,UAAU,CAAA;IACvB,KAAK,EAAE,OAAO,WAAW,CAAA;IACzB,IAAI,EAAE,OAAO,UAAU,CAAA;IACvB,KAAK,EAAE,OAAO,WAAW,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,eAAiD,CAAA"}
|
package/dist/switch/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx as
|
|
2
|
+
import{jsx as jsx8,jsxs}from"react/jsx-runtime";import{useOptionalContentId}from"@qualcomm-ui/react-core/machine";import{useControlledId as useControlledId2}from"@qualcomm-ui/react-core/state";import{jsx as jsx2}from"react/jsx-runtime";import{useSwitchControl}from"@qualcomm-ui/react-core/switch";import{PolymorphicElement as PolymorphicElement2}from"@qualcomm-ui/react-core/system";import{mergeProps as mergeProps2}from"@qualcomm-ui/utils/merge-props";import{createGuardedContext}from"@qualcomm-ui/react-core/context";var[QdsSwitchContextProvider,useQdsSwitchContext]=createGuardedContext({hookName:"useQdsSwitchContext",providerName:"<QdsSwitchContextProvider>",strict:!0});import{jsx}from"react/jsx-runtime";import{useSwitchThumb}from"@qualcomm-ui/react-core/switch";import{PolymorphicElement}from"@qualcomm-ui/react-core/system";import{mergeProps}from"@qualcomm-ui/utils/merge-props";function SwitchThumb(t0){let{children,...props}=t0,contextProps=useSwitchThumb(),qdsContext=useQdsSwitchContext(),mergedProps=mergeProps(contextProps,qdsContext.getThumbBindings(),props);return jsx(PolymorphicElement,{as:"span",...mergedProps,children})}function SwitchControl(t0){let{children:t1,...props}=t0,children=t1===void 0?jsx2(SwitchThumb,{}):t1,contextProps=useSwitchControl(),qdsContext=useQdsSwitchContext(),mergedProps=mergeProps2(contextProps,qdsContext.getControlBindings(),props);return jsx2(PolymorphicElement2,{as:"span",...mergedProps,children})}import{c as _c}from"react/compiler-runtime";import{jsx as jsx3}from"react/jsx-runtime";import{AlertCircle}from"lucide-react";import{InputErrorText}from"@qualcomm-ui/react/input";import{useSwitchErrorText}from"@qualcomm-ui/react-core/switch";import{mergeProps as mergeProps3}from"@qualcomm-ui/utils/merge-props";function SwitchErrorText(t0){let $=_c(2),{children,id,...props}=t0,t1;$[0]!==id?(t1={id},$[0]=id,$[1]=t1):t1=$[1];let contextProps=useSwitchErrorText(t1),qdsContext=useQdsSwitchContext(),mergedProps=mergeProps3(contextProps,qdsContext.getErrorTextBindings(),props);return jsx3(InputErrorText,{icon:AlertCircle,...mergedProps,children})}import{c as _c2}from"react/compiler-runtime";import{jsx as jsx4}from"react/jsx-runtime";import{useSwitchHiddenInput}from"@qualcomm-ui/react-core/switch";import{mergeProps as mergeProps4}from"@qualcomm-ui/utils/merge-props";function SwitchHiddenInput(t0){let $=_c2(2),{id,...props}=t0,t1;$[0]!==id?(t1={id},$[0]=id,$[1]=t1):t1=$[1];let contextProps=useSwitchHiddenInput(t1),qdsContext=useQdsSwitchContext(),mergedProps=mergeProps4(contextProps,qdsContext.getHiddenInputBindings(),props);return jsx4("input",{...mergedProps})}import{c as _c3}from"react/compiler-runtime";import{jsx as jsx5}from"react/jsx-runtime";import{InputHint}from"@qualcomm-ui/react/input";import{useSwitchHint}from"@qualcomm-ui/react-core/switch";import{mergeProps as mergeProps5}from"@qualcomm-ui/utils/merge-props";function SwitchHint(t0){let $=_c3(2),{children,id,...props}=t0,t1;$[0]!==id?(t1={id},$[0]=id,$[1]=t1):t1=$[1];let contextProps=useSwitchHint(t1),qdsContext=useQdsSwitchContext(),mergedProps=mergeProps5(contextProps,qdsContext.getHintBindings(),props);return jsx5(InputHint,{...mergedProps,children})}import{c as _c4}from"react/compiler-runtime";import{jsx as jsx6}from"react/jsx-runtime";import{useSwitchLabel}from"@qualcomm-ui/react-core/switch";import{PolymorphicElement as PolymorphicElement3}from"@qualcomm-ui/react-core/system";import{mergeProps as mergeProps6}from"@qualcomm-ui/utils/merge-props";function SwitchLabel(t0){let $=_c4(2),{children,id,...props}=t0,t1;$[0]!==id?(t1={id},$[0]=id,$[1]=t1):t1=$[1];let contextProps=useSwitchLabel(t1),qdsContext=useQdsSwitchContext(),mergedProps=mergeProps6(contextProps,qdsContext.getLabelBindings(),props);return jsx6(PolymorphicElement3,{as:"span",...mergedProps,children})}import{c as _c5}from"react/compiler-runtime";import{jsx as jsx7}from"react/jsx-runtime";import"react";import{splitSwitchProps}from"@qualcomm-ui/core/switch";import{createQdsSwitchApi}from"@qualcomm-ui/qds-core/switch";import{normalizeProps}from"@qualcomm-ui/react-core/machine";import{useControlledId}from"@qualcomm-ui/react-core/state";import{SwitchContextProvider,useSwitch}from"@qualcomm-ui/react-core/switch";import{PolymorphicElement as PolymorphicElement4}from"@qualcomm-ui/react-core/system";import{mergeProps as mergeProps7}from"@qualcomm-ui/utils/merge-props";function SwitchRoot(t0){let $=_c5(2),{children,id,size,...props}=t0,[switchProps,localProps]=splitSwitchProps(props),context=useSwitch(switchProps),t1;$[0]!==size?(t1=createQdsSwitchApi({size},normalizeProps),$[0]=size,$[1]=t1):t1=$[1];let qdsContext=t1,mergedProps=mergeProps7(context.getRootBindings({id:useControlledId(id)}),qdsContext.getRootBindings(),localProps);return jsx7(SwitchContextProvider,{value:context,children:jsx7(QdsSwitchContextProvider,{value:qdsContext,children:jsx7(PolymorphicElement4,{as:"label",...mergedProps,children})})})}function Switch(t0){let{"aria-label":ariaLabel,"aria-labelledby":ariaLabelledBy,controlProps,errorText,errorTextProps,hiddenInputProps:hiddenInputPropsProp,hint,hintProps,label,labelProps,thumbProps,...props}=t0,labelContent=label||labelProps?.children,errorTextContent=errorText||errorTextProps?.children,hintContent=hint||hintProps?.children,hiddenInputProps={...hiddenInputPropsProp};ariaLabel!==void 0&&(hiddenInputProps["aria-label"]=ariaLabel),ariaLabelledBy!==void 0&&(hiddenInputProps["aria-labelledby"]=ariaLabelledBy);let ids={errorText:useOptionalContentId(errorTextContent,errorTextProps),hiddenInput:useControlledId2(hiddenInputProps?.id),hint:useOptionalContentId(hintContent,hintProps),label:useOptionalContentId(labelContent,labelProps),root:useControlledId2(props.id),...props.ids};return jsxs(SwitchRoot,{...props,ids,children:[jsx8(SwitchHiddenInput,{...hiddenInputProps,id:ids.hiddenInput}),jsx8(SwitchControl,{...controlProps,children:jsx8(SwitchThumb,{...thumbProps})}),labelContent?jsx8(SwitchLabel,{...labelProps,id:ids.label,children:labelContent}):null,hintContent?jsx8(SwitchHint,{...hintProps,id:ids.hint,children:hintContent}):null,errorTextContent?jsx8(SwitchErrorText,{...errorTextProps,id:ids.errorText,children:errorTextContent}):null]})}var Switch2=Switch;Switch2.Control=SwitchControl;Switch2.ErrorText=SwitchErrorText;Switch2.HiddenInput=SwitchHiddenInput;Switch2.Hint=SwitchHint;Switch2.Label=SwitchLabel;Switch2.Root=SwitchRoot;Switch2.Thumb=SwitchThumb;export{QdsSwitchContextProvider,Switch2 as Switch,useQdsSwitchContext};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/switch/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/switch/switch.tsx", "../../src/switch/switch-control.tsx", "../../src/switch/qds-switch-context.ts", "../../src/switch/switch-thumb.tsx", "../../src/switch/switch-error-text.tsx", "../../src/switch/switch-hidden-input.tsx", "../../src/switch/switch-label.tsx", "../../src/switch/switch-root.tsx", "../../src/switch/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { jsx, jsxs } from \"react/jsx-runtime\";\nimport { useOptionalContentId } from \"@qualcomm-ui/react-core/machine\";\nimport { useControlledId } from \"@qualcomm-ui/react-core/state\";\nimport { SwitchControl } from \"./switch-control\";\nimport { SwitchErrorText } from \"./switch-error-text\";\nimport { SwitchHiddenInput } from \"./switch-hidden-input\";\nimport { SwitchLabel } from \"./switch-label\";\nimport { SwitchRoot } from \"./switch-root\";\nimport { SwitchThumb } from \"./switch-thumb\";\nexport function Switch(t0) {\n const {\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n controlProps,\n errorText,\n errorTextProps,\n hiddenInputProps: hiddenInputPropsProp,\n label,\n labelProps,\n thumbProps,\n ...props\n } = t0;\n const labelContent = label || labelProps?.children;\n const errorTextContent = errorText || errorTextProps?.children;\n const hiddenInputProps = {\n ...hiddenInputPropsProp\n };\n if (ariaLabel !== void 0) {\n hiddenInputProps[\"aria-label\"] = ariaLabel;\n }\n if (ariaLabelledBy !== void 0) {\n hiddenInputProps[\"aria-labelledby\"] = ariaLabelledBy;\n }\n const ids = {\n errorText: useOptionalContentId(errorTextContent, errorTextProps),\n hiddenInput: useControlledId(hiddenInputProps?.id),\n label: useOptionalContentId(labelContent, labelProps),\n root: useControlledId(props.id),\n ...props.ids\n };\n return jsxs(SwitchRoot, {\n ...props,\n ids,\n children: [jsx(SwitchHiddenInput, {\n ...hiddenInputProps,\n id: ids.hiddenInput\n }), jsx(SwitchControl, {\n ...controlProps,\n children: jsx(SwitchThumb, {\n ...thumbProps\n })\n }), labelContent ? jsx(SwitchLabel, {\n ...labelProps,\n id: ids.label,\n children: labelContent\n }) : null, errorTextContent ? jsx(SwitchErrorText, {\n ...errorTextProps,\n id: ids.errorText,\n children: errorTextContent\n }) : null]\n });\n}", "import { jsx } from \"react/jsx-runtime\";\nimport { useSwitchControl } from \"@qualcomm-ui/react-core/switch\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsSwitchContext } from \"./qds-switch-context\";\nimport { SwitchThumb } from \"./switch-thumb\";\nexport function SwitchControl(t0) {\n const {\n children: t1,\n ...props\n } = t0;\n const children = t1 === undefined ? jsx(SwitchThumb, {}) : t1;\n const contextProps = useSwitchControl();\n const qdsContext = useQdsSwitchContext();\n const mergedProps = mergeProps(contextProps, qdsContext.getControlBindings(), props);\n return jsx(PolymorphicElement, {\n as: \"span\",\n ...mergedProps,\n children\n });\n}", "import { createGuardedContext } from \"@qualcomm-ui/react-core/context\";\nexport const [QdsSwitchContextProvider, useQdsSwitchContext] = createGuardedContext({\n hookName: \"useQdsSwitchContext\",\n providerName: \"<QdsSwitchContextProvider>\",\n strict: true\n});", "import { jsx } from \"react/jsx-runtime\";\nimport { useSwitchThumb } from \"@qualcomm-ui/react-core/switch\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsSwitchContext } from \"./qds-switch-context\";\nexport function SwitchThumb(t0) {\n const {\n children,\n ...props\n } = t0;\n const contextProps = useSwitchThumb();\n const qdsContext = useQdsSwitchContext();\n const mergedProps = mergeProps(contextProps, qdsContext.getThumbBindings(), props);\n return jsx(PolymorphicElement, {\n as: \"span\",\n ...mergedProps,\n children\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { AlertCircle } from \"lucide-react\";\nimport { InputErrorText } from \"@qualcomm-ui/react/input\";\nimport { useSwitchErrorText } from \"@qualcomm-ui/react-core/switch\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsSwitchContext } from \"./qds-switch-context\";\nexport function SwitchErrorText(t0) {\n const $ = _c(2);\n const {\n children,\n id,\n ...props\n } = t0;\n let t1;\n if ($[0] !== id) {\n t1 = {\n id\n };\n $[0] = id;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n const contextProps = useSwitchErrorText(t1);\n const qdsContext = useQdsSwitchContext();\n const mergedProps = mergeProps(contextProps, qdsContext.getErrorTextBindings(), props);\n return jsx(InputErrorText, {\n icon: AlertCircle,\n ...mergedProps,\n children\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { useSwitchHiddenInput } from \"@qualcomm-ui/react-core/switch\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsSwitchContext } from \"./qds-switch-context\";\nexport function SwitchHiddenInput(t0) {\n const $ = _c(2);\n const {\n id,\n ...props\n } = t0;\n let t1;\n if ($[0] !== id) {\n t1 = {\n id\n };\n $[0] = id;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n const contextProps = useSwitchHiddenInput(t1);\n const qdsContext = useQdsSwitchContext();\n const mergedProps = mergeProps(contextProps, qdsContext.getHiddenInputBindings(), props);\n return jsx(\"input\", {\n ...mergedProps\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { useSwitchLabel } from \"@qualcomm-ui/react-core/switch\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsSwitchContext } from \"./qds-switch-context\";\nexport function SwitchLabel(t0) {\n const $ = _c(2);\n const {\n children,\n id,\n ...props\n } = t0;\n let t1;\n if ($[0] !== id) {\n t1 = {\n id\n };\n $[0] = id;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n const contextProps = useSwitchLabel(t1);\n const qdsContext = useQdsSwitchContext();\n const mergedProps = mergeProps(contextProps, qdsContext.getLabelBindings(), props);\n return jsx(PolymorphicElement, {\n as: \"span\",\n ...mergedProps,\n children\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { useMemo } from \"react\";\nimport { splitSwitchProps } from \"@qualcomm-ui/core/switch\";\nimport { createQdsSwitchApi } from \"@qualcomm-ui/qds-core/switch\";\nimport { normalizeProps } from \"@qualcomm-ui/react-core/machine\";\nimport { useControlledId } from \"@qualcomm-ui/react-core/state\";\nimport { SwitchContextProvider, useSwitch } from \"@qualcomm-ui/react-core/switch\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { QdsSwitchContextProvider } from \"./qds-switch-context\";\nexport function SwitchRoot(t0) {\n const $ = _c(2);\n const {\n children,\n id,\n size,\n ...props\n } = t0;\n const [switchProps, localProps] = splitSwitchProps(props);\n const context = useSwitch(switchProps);\n let t1;\n if ($[0] !== size) {\n t1 = createQdsSwitchApi({\n size\n }, normalizeProps);\n $[0] = size;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n const qdsContext = t1;\n const mergedProps = mergeProps(context.getRootBindings({\n id: useControlledId(id)\n }), qdsContext.getRootBindings(), localProps);\n return jsx(SwitchContextProvider, {\n value: context,\n children: jsx(QdsSwitchContextProvider, {\n value: qdsContext,\n children: jsx(PolymorphicElement, {\n as: \"label\",\n ...mergedProps,\n children\n })\n })\n });\n}", "import { Switch as SimpleSwitch } from \"./switch\";\nimport { SwitchControl } from \"./switch-control\";\nimport { SwitchErrorText } from \"./switch-error-text\";\nimport { SwitchHiddenInput } from \"./switch-hidden-input\";\nimport { SwitchLabel } from \"./switch-label\";\nimport { SwitchRoot } from \"./switch-root\";\nimport { SwitchThumb } from \"./switch-thumb\";\nexport * from \"./qds-switch-context\";\nexport const Switch = SimpleSwitch;\nSwitch.Control = SwitchControl;\nSwitch.ErrorText = SwitchErrorText;\nSwitch.HiddenInput = SwitchHiddenInput;\nSwitch.Label = SwitchLabel;\nSwitch.Root = SwitchRoot;\nSwitch.Thumb = SwitchThumb;"],
|
|
5
|
-
"mappings": ";AAAA,OAAS,OAAAA,KAAK,SAAY,oBAC1B,OAAS,yBAA4B,kCACrC,OAAS,mBAAAC,qBAAuB,gCCFhC,OAAS,OAAAC,SAAW,oBACpB,OAAS,qBAAwB,iCACjC,OAAS,sBAAAC,wBAA0B,iCACnC,OAAS,cAAAC,gBAAkB,iCCH3B,OAAS,yBAA4B,kCAC9B,GAAM,CAAC,yBAA0B,mBAAmB,EAAI,qBAAqB,CAClF,SAAU,sBACV,aAAc,6BACd,OAAQ,EACV,CAAC,ECLD,OAAS,QAAW,oBACpB,OAAS,mBAAsB,iCAC/B,OAAS,uBAA0B,iCACnC,OAAS,eAAkB,iCAEpB,SAAS,YAAY,GAAI,CAC9B,GAAM,CACJ,SACA,GAAG,KACL,EAAI,GACE,aAAe,eAAe,EAC9B,WAAa,oBAAoB,EACjC,YAAc,WAAW,aAAc,WAAW,iBAAiB,EAAG,KAAK,EACjF,OAAO,IAAI,mBAAoB,CAC7B,GAAI,OACJ,GAAG,YACH,QACF,CAAC,CACH,CFZO,SAAS,cAAc,GAAI,CAChC,GAAM,CACJ,SAAU,GACV,GAAG,KACL,EAAI,GACE,SAAW,KAAO,OAAYC,KAAI,YAAa,CAAC,CAAC,EAAI,GACrD,aAAe,iBAAiB,EAChC,WAAa,oBAAoB,EACjC,YAAcC,YAAW,aAAc,WAAW,mBAAmB,EAAG,KAAK,EACnF,OAAOD,KAAIE,oBAAoB,CAC7B,GAAI,OACJ,GAAG,YACH,QACF,CAAC,CACH,CGpBA,OAAS,KAAK,OAAU,yBACxB,OAAS,OAAAC,SAAW,oBACpB,OAAS,gBAAmB,eAC5B,OAAS,mBAAsB,2BAC/B,OAAS,uBAA0B,iCACnC,OAAS,cAAAC,gB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eAAe,EAAE,EAChC,WAAa,oBAAoB,EACjC,YAAcC,YAAW,aAAc,WAAW,iBAAiB,EAAG,KAAK,EACjF,OAAOC,KAAIC,oBAAoB,CAC7B,GAAI,OACJ,GAAG,YACH,QACF,CAAC,CACH,CC/BA,OAAS,KAAKC,QAAU,yBACxB,OAAS,OAAAC,SAAW,oBACpB,MAAwB,QACxB,OAAS,qBAAwB,2BACjC,OAAS,uBAA0B,+BACnC,OAAS,mBAAsB,kCAC/B,OAAS,oBAAuB,gCAChC,OAAS,sBAAuB,cAAiB,iCACjD,OAAS,sBAAAC,wBAA0B,iCACnC,OAAS,cAAAC,gBAAkB,iCAEpB,SAAS,WAAW,GAAI,CAC7B,IAAM,EAAIC,IAAG,CAAC,EACR,CACJ,SACA,GACA,KACA,GAAG,KACL,EAAI,GACE,CAAC,YAAa,UAAU,EAAI,iBAAiB,KAAK,EAClD,QAAU,UAAU,WAAW,EACjC,GACA,EAAE,CAAC,IAAM,MACX,GAAK,mBAAmB,CACtB,IACF,EAAG,cAAc,EACjB,EAAE,CAAC,EAAI,KACP,EAAE,CAAC,EAAI,IAEP,GAAK,EAAE,CAAC,EAEV,IAAM,WAAa,GACb,YAAcC,YAAW,QAAQ,gBAAgB,CACrD,GAAI,gBAAgB,EAAE,CACxB,CAAC,EAAG,WAAW,gBAAgB,EAAG,UAAU,EAC5C,OAAOC,KAAI,sBAAuB,CAChC,MAAO,QACP,SAAUA,KAAI,yBAA0B,CACtC,MAAO,WACP,SAAUA,KAAIC,oBAAoB,CAChC,GAAI,QACJ,GAAG,YACH,QACF,CAAC,CACH,CAAC,CACH,CAAC,CACH,
|
|
6
|
-
"names": ["jsx", "useControlledId", "jsx", "PolymorphicElement", "mergeProps", "jsx", "mergeProps", "PolymorphicElement", "jsx", "mergeProps", "mergeProps", "jsx", "_c", "jsx", "mergeProps", "_c", "mergeProps", "jsx", "_c", "jsx", "PolymorphicElement", "mergeProps", "_c", "mergeProps", "jsx", "PolymorphicElement", "_c", "jsx", "PolymorphicElement", "mergeProps", "_c", "mergeProps", "jsx", "PolymorphicElement", "useControlledId", "jsx", "Switch"]
|
|
3
|
+
"sources": ["../../src/switch/switch.tsx", "../../src/switch/switch-control.tsx", "../../src/switch/qds-switch-context.ts", "../../src/switch/switch-thumb.tsx", "../../src/switch/switch-error-text.tsx", "../../src/switch/switch-hidden-input.tsx", "../../src/switch/switch-hint.tsx", "../../src/switch/switch-label.tsx", "../../src/switch/switch-root.tsx", "../../src/switch/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { jsx, jsxs } from \"react/jsx-runtime\";\nimport { useOptionalContentId } from \"@qualcomm-ui/react-core/machine\";\nimport { useControlledId } from \"@qualcomm-ui/react-core/state\";\nimport { SwitchControl } from \"./switch-control\";\nimport { SwitchErrorText } from \"./switch-error-text\";\nimport { SwitchHiddenInput } from \"./switch-hidden-input\";\nimport { SwitchHint } from \"./switch-hint\";\nimport { SwitchLabel } from \"./switch-label\";\nimport { SwitchRoot } from \"./switch-root\";\nimport { SwitchThumb } from \"./switch-thumb\";\nexport function Switch(t0) {\n const {\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n controlProps,\n errorText,\n errorTextProps,\n hiddenInputProps: hiddenInputPropsProp,\n hint,\n hintProps,\n label,\n labelProps,\n thumbProps,\n ...props\n } = t0;\n const labelContent = label || labelProps?.children;\n const errorTextContent = errorText || errorTextProps?.children;\n const hintContent = hint || hintProps?.children;\n const hiddenInputProps = {\n ...hiddenInputPropsProp\n };\n if (ariaLabel !== void 0) {\n hiddenInputProps[\"aria-label\"] = ariaLabel;\n }\n if (ariaLabelledBy !== void 0) {\n hiddenInputProps[\"aria-labelledby\"] = ariaLabelledBy;\n }\n const ids = {\n errorText: useOptionalContentId(errorTextContent, errorTextProps),\n hiddenInput: useControlledId(hiddenInputProps?.id),\n hint: useOptionalContentId(hintContent, hintProps),\n label: useOptionalContentId(labelContent, labelProps),\n root: useControlledId(props.id),\n ...props.ids\n };\n return jsxs(SwitchRoot, {\n ...props,\n ids,\n children: [jsx(SwitchHiddenInput, {\n ...hiddenInputProps,\n id: ids.hiddenInput\n }), jsx(SwitchControl, {\n ...controlProps,\n children: jsx(SwitchThumb, {\n ...thumbProps\n })\n }), labelContent ? jsx(SwitchLabel, {\n ...labelProps,\n id: ids.label,\n children: labelContent\n }) : null, hintContent ? jsx(SwitchHint, {\n ...hintProps,\n id: ids.hint,\n children: hintContent\n }) : null, errorTextContent ? jsx(SwitchErrorText, {\n ...errorTextProps,\n id: ids.errorText,\n children: errorTextContent\n }) : null]\n });\n}", "import { jsx } from \"react/jsx-runtime\";\nimport { useSwitchControl } from \"@qualcomm-ui/react-core/switch\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsSwitchContext } from \"./qds-switch-context\";\nimport { SwitchThumb } from \"./switch-thumb\";\nexport function SwitchControl(t0) {\n const {\n children: t1,\n ...props\n } = t0;\n const children = t1 === undefined ? jsx(SwitchThumb, {}) : t1;\n const contextProps = useSwitchControl();\n const qdsContext = useQdsSwitchContext();\n const mergedProps = mergeProps(contextProps, qdsContext.getControlBindings(), props);\n return jsx(PolymorphicElement, {\n as: \"span\",\n ...mergedProps,\n children\n });\n}", "import { createGuardedContext } from \"@qualcomm-ui/react-core/context\";\nexport const [QdsSwitchContextProvider, useQdsSwitchContext] = createGuardedContext({\n hookName: \"useQdsSwitchContext\",\n providerName: \"<QdsSwitchContextProvider>\",\n strict: true\n});", "import { jsx } from \"react/jsx-runtime\";\nimport { useSwitchThumb } from \"@qualcomm-ui/react-core/switch\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsSwitchContext } from \"./qds-switch-context\";\nexport function SwitchThumb(t0) {\n const {\n children,\n ...props\n } = t0;\n const contextProps = useSwitchThumb();\n const qdsContext = useQdsSwitchContext();\n const mergedProps = mergeProps(contextProps, qdsContext.getThumbBindings(), props);\n return jsx(PolymorphicElement, {\n as: \"span\",\n ...mergedProps,\n children\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { AlertCircle } from \"lucide-react\";\nimport { InputErrorText } from \"@qualcomm-ui/react/input\";\nimport { useSwitchErrorText } from \"@qualcomm-ui/react-core/switch\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsSwitchContext } from \"./qds-switch-context\";\nexport function SwitchErrorText(t0) {\n const $ = _c(2);\n const {\n children,\n id,\n ...props\n } = t0;\n let t1;\n if ($[0] !== id) {\n t1 = {\n id\n };\n $[0] = id;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n const contextProps = useSwitchErrorText(t1);\n const qdsContext = useQdsSwitchContext();\n const mergedProps = mergeProps(contextProps, qdsContext.getErrorTextBindings(), props);\n return jsx(InputErrorText, {\n icon: AlertCircle,\n ...mergedProps,\n children\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { useSwitchHiddenInput } from \"@qualcomm-ui/react-core/switch\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsSwitchContext } from \"./qds-switch-context\";\nexport function SwitchHiddenInput(t0) {\n const $ = _c(2);\n const {\n id,\n ...props\n } = t0;\n let t1;\n if ($[0] !== id) {\n t1 = {\n id\n };\n $[0] = id;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n const contextProps = useSwitchHiddenInput(t1);\n const qdsContext = useQdsSwitchContext();\n const mergedProps = mergeProps(contextProps, qdsContext.getHiddenInputBindings(), props);\n return jsx(\"input\", {\n ...mergedProps\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { InputHint } from \"@qualcomm-ui/react/input\";\nimport { useSwitchHint } from \"@qualcomm-ui/react-core/switch\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsSwitchContext } from \"./qds-switch-context\";\nexport function SwitchHint(t0) {\n const $ = _c(2);\n const {\n children,\n id,\n ...props\n } = t0;\n let t1;\n if ($[0] !== id) {\n t1 = {\n id\n };\n $[0] = id;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n const contextProps = useSwitchHint(t1);\n const qdsContext = useQdsSwitchContext();\n const mergedProps = mergeProps(contextProps, qdsContext.getHintBindings(), props);\n return jsx(InputHint, {\n ...mergedProps,\n children\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { useSwitchLabel } from \"@qualcomm-ui/react-core/switch\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsSwitchContext } from \"./qds-switch-context\";\nexport function SwitchLabel(t0) {\n const $ = _c(2);\n const {\n children,\n id,\n ...props\n } = t0;\n let t1;\n if ($[0] !== id) {\n t1 = {\n id\n };\n $[0] = id;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n const contextProps = useSwitchLabel(t1);\n const qdsContext = useQdsSwitchContext();\n const mergedProps = mergeProps(contextProps, qdsContext.getLabelBindings(), props);\n return jsx(PolymorphicElement, {\n as: \"span\",\n ...mergedProps,\n children\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { useMemo } from \"react\";\nimport { splitSwitchProps } from \"@qualcomm-ui/core/switch\";\nimport { createQdsSwitchApi } from \"@qualcomm-ui/qds-core/switch\";\nimport { normalizeProps } from \"@qualcomm-ui/react-core/machine\";\nimport { useControlledId } from \"@qualcomm-ui/react-core/state\";\nimport { SwitchContextProvider, useSwitch } from \"@qualcomm-ui/react-core/switch\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { QdsSwitchContextProvider } from \"./qds-switch-context\";\nexport function SwitchRoot(t0) {\n const $ = _c(2);\n const {\n children,\n id,\n size,\n ...props\n } = t0;\n const [switchProps, localProps] = splitSwitchProps(props);\n const context = useSwitch(switchProps);\n let t1;\n if ($[0] !== size) {\n t1 = createQdsSwitchApi({\n size\n }, normalizeProps);\n $[0] = size;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n const qdsContext = t1;\n const mergedProps = mergeProps(context.getRootBindings({\n id: useControlledId(id)\n }), qdsContext.getRootBindings(), localProps);\n return jsx(SwitchContextProvider, {\n value: context,\n children: jsx(QdsSwitchContextProvider, {\n value: qdsContext,\n children: jsx(PolymorphicElement, {\n as: \"label\",\n ...mergedProps,\n children\n })\n })\n });\n}", "import { Switch as SimpleSwitch } from \"./switch\";\nimport { SwitchControl } from \"./switch-control\";\nimport { SwitchErrorText } from \"./switch-error-text\";\nimport { SwitchHiddenInput } from \"./switch-hidden-input\";\nimport { SwitchHint } from \"./switch-hint\";\nimport { SwitchLabel } from \"./switch-label\";\nimport { SwitchRoot } from \"./switch-root\";\nimport { SwitchThumb } from \"./switch-thumb\";\nexport * from \"./qds-switch-context\";\nexport const Switch = SimpleSwitch;\nSwitch.Control = SwitchControl;\nSwitch.ErrorText = SwitchErrorText;\nSwitch.HiddenInput = SwitchHiddenInput;\nSwitch.Hint = SwitchHint;\nSwitch.Label = SwitchLabel;\nSwitch.Root = SwitchRoot;\nSwitch.Thumb = SwitchThumb;"],
|
|
5
|
+
"mappings": ";AAAA,OAAS,OAAAA,KAAK,SAAY,oBAC1B,OAAS,yBAA4B,kCACrC,OAAS,mBAAAC,qBAAuB,gCCFhC,OAAS,OAAAC,SAAW,oBACpB,OAAS,qBAAwB,iCACjC,OAAS,sBAAAC,wBAA0B,iCACnC,OAAS,cAAAC,gBAAkB,iCCH3B,OAAS,yBAA4B,kCAC9B,GAAM,CAAC,yBAA0B,mBAAmB,EAAI,qBAAqB,CAClF,SAAU,sBACV,aAAc,6BACd,OAAQ,EACV,CAAC,ECLD,OAAS,QA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AmB,CACvB,GAAG,oBACL,EACI,YAAc,SAChB,iBAAiB,YAAY,EAAI,WAE/B,iBAAmB,SACrB,iBAAiB,iBAAiB,EAAI,gBAExC,IAAM,IAAM,CACV,UAAW,qBAAqB,iBAAkB,cAAc,EAChE,YAAaC,iBAAgB,kBAAkB,EAAE,EACjD,KAAM,qBAAqB,YAAa,SAAS,EACjD,MAAO,qBAAqB,aAAc,UAAU,EACpD,KAAMA,iBAAgB,MAAM,EAAE,EAC9B,GAAG,MAAM,GACX,EACA,OAAO,KAAK,WAAY,CACtB,GAAG,MACH,IACA,SAAU,CAACC,KAAI,kBAAmB,CAChC,GAAG,iBACH,GAAI,IAAI,WACV,CAAC,EAAGA,KAAI,cAAe,CACrB,GAAG,aACH,SAAUA,KAAI,YAAa,CACzB,GAAG,UACL,CAAC,CACH,CAAC,EAAG,aAAeA,KAAI,YAAa,CAClC,GAAG,WACH,GAAI,IAAI,MACR,SAAU,YACZ,CAAC,EAAI,KAAM,YAAcA,KAAI,WAAY,CACvC,GAAG,UACH,GAAI,IAAI,KACR,SAAU,WACZ,CAAC,EAAI,KAAM,iBAAmBA,KAAI,gBAAiB,CACjD,GAAG,eACH,GAAI,IAAI,UACR,SAAU,gBACZ,CAAC,EAAI,IAAI,CACX,CAAC,CACH,CS7DO,IAAMC,QAAS,OACtBA,QAAO,QAAU,cACjBA,QAAO,UAAY,gBACnBA,QAAO,YAAc,kBACrBA,QAAO,KAAO,WACdA,QAAO,MAAQ,YACfA,QAAO,KAAO,WACdA,QAAO,MAAQ",
|
|
6
|
+
"names": ["jsx", "useControlledId", "jsx", "PolymorphicElement", "mergeProps", "jsx", "mergeProps", "PolymorphicElement", "jsx", "mergeProps", "mergeProps", "jsx", "_c", "jsx", "mergeProps", "_c", "mergeProps", "jsx", "_c", "jsx", "mergeProps", "_c", "mergeProps", "jsx", "_c", "jsx", "PolymorphicElement", "mergeProps", "_c", "mergeProps", "jsx", "PolymorphicElement", "_c", "jsx", "PolymorphicElement", "mergeProps", "_c", "mergeProps", "jsx", "PolymorphicElement", "useControlledId", "jsx", "Switch"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
|
+
import { type InputHintProps } from "@qualcomm-ui/react/input";
|
|
3
|
+
import type { IdProp } from "@qualcomm-ui/react-core/system";
|
|
4
|
+
export interface SwitchHintProps extends IdProp, InputHintProps {
|
|
5
|
+
/**
|
|
6
|
+
* React {@link https://react.dev/learn/passing-props-to-a-component#passing-jsx-as-children children} prop.
|
|
7
|
+
*/
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A help message displayed below the switch. Renders a `<div>` element by
|
|
12
|
+
* default.
|
|
13
|
+
*/
|
|
14
|
+
export declare function SwitchHint({ children, id, ...props }: SwitchHintProps): ReactElement;
|
|
15
|
+
//# sourceMappingURL=switch-hint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch-hint.d.ts","sourceRoot":"","sources":["../../src/switch/switch-hint.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,OAAO,CAAA;AAElD,OAAO,EAAY,KAAK,cAAc,EAAC,MAAM,0BAA0B,CAAA;AAEvE,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,gCAAgC,CAAA;AAK1D,MAAM,WAAW,eAAgB,SAAQ,MAAM,EAAE,cAAc;IAC7D;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,EAAE,EACF,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,YAAY,CAUhC"}
|
package/dist/switch/switch.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { ReactElement, ReactNode } from "react";
|
|
|
2
2
|
import { type SwitchControlProps } from "./switch-control";
|
|
3
3
|
import { type SwitchErrorTextProps } from "./switch-error-text";
|
|
4
4
|
import { type SwitchHiddenInputProps } from "./switch-hidden-input";
|
|
5
|
+
import { type SwitchHintProps } from "./switch-hint";
|
|
5
6
|
import { type SwitchLabelProps } from "./switch-label";
|
|
6
7
|
import { type SwitchRootProps } from "./switch-root";
|
|
7
8
|
import { type SwitchThumbProps } from "./switch-thumb";
|
|
@@ -37,6 +38,14 @@ export interface SwitchProps extends SwitchRootProps {
|
|
|
37
38
|
* Props applied to the hidden input element.
|
|
38
39
|
*/
|
|
39
40
|
hiddenInputProps?: SwitchHiddenInputProps;
|
|
41
|
+
/**
|
|
42
|
+
* Optional hint text that describes the element.
|
|
43
|
+
*/
|
|
44
|
+
hint?: ReactNode;
|
|
45
|
+
/**
|
|
46
|
+
* Props applied to the hint element.
|
|
47
|
+
*/
|
|
48
|
+
hintProps?: SwitchHintProps;
|
|
40
49
|
/**
|
|
41
50
|
* Optional label describing the element. Recommended. This element is
|
|
42
51
|
* automatically associated with the component's input element for
|
|
@@ -52,5 +61,5 @@ export interface SwitchProps extends SwitchRootProps {
|
|
|
52
61
|
*/
|
|
53
62
|
thumbProps?: SwitchThumbProps;
|
|
54
63
|
}
|
|
55
|
-
export declare function Switch({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, controlProps, errorText, errorTextProps, hiddenInputProps: hiddenInputPropsProp, label, labelProps, thumbProps, ...props }: SwitchProps): ReactElement;
|
|
64
|
+
export declare function Switch({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, controlProps, errorText, errorTextProps, hiddenInputProps: hiddenInputPropsProp, hint, hintProps, label, labelProps, thumbProps, ...props }: SwitchProps): ReactElement;
|
|
56
65
|
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/switch/switch.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,O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