@qualcomm-ui/react 1.23.0 → 1.24.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/accordion/index.js +2 -3
- package/dist/accordion/index.js.map +1 -7
- package/dist/action-group/index.js +2 -3
- package/dist/action-group/index.js.map +1 -7
- package/dist/alert-banner/index.js +2 -3
- package/dist/alert-banner/index.js.map +1 -7
- package/dist/avatar/index.js +2 -3
- package/dist/avatar/index.js.map +1 -7
- package/dist/badge/index.js +2 -3
- package/dist/badge/index.js.map +1 -7
- package/dist/breadcrumbs/index.js +2 -3
- package/dist/breadcrumbs/index.js.map +1 -7
- package/dist/button/button-group-context.d.ts +2 -5
- package/dist/button/button-group-context.d.ts.map +1 -1
- package/dist/button/button.d.ts +2 -1
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/icon-button.d.ts +2 -1
- package/dist/button/icon-button.d.ts.map +1 -1
- package/dist/button/index.js +2 -3
- package/dist/button/index.js.map +1 -7
- package/dist/card/index.js +2 -3
- package/dist/card/index.js.map +1 -7
- package/dist/checkbox/index.js +2 -3
- package/dist/checkbox/index.js.map +1 -7
- package/dist/checkbox-group/index.js +2 -3
- package/dist/checkbox-group/index.js.map +1 -7
- package/dist/checkmark/index.js +2 -3
- package/dist/checkmark/index.js.map +1 -7
- package/dist/collapsible/index.js +2 -3
- package/dist/collapsible/index.js.map +1 -7
- package/dist/combobox/index.js +2 -3
- package/dist/combobox/index.js.map +1 -7
- package/dist/dialog/index.js +2 -3
- package/dist/dialog/index.js.map +1 -7
- package/dist/divider/index.js +2 -3
- package/dist/divider/index.js.map +1 -7
- package/dist/drawer/index.js +2 -3
- package/dist/drawer/index.js.map +1 -7
- package/dist/field-group/index.js +2 -3
- package/dist/field-group/index.js.map +1 -7
- package/dist/file-input/index.js +2 -3
- package/dist/file-input/index.js.map +1 -7
- package/dist/file-upload/index.js +2 -3
- package/dist/file-upload/index.js.map +1 -7
- package/dist/footer/index.js +1 -2
- package/dist/header-bar/index.js +2 -3
- package/dist/header-bar/index.js.map +1 -7
- package/dist/icon/index.js +2 -3
- package/dist/icon/index.js.map +1 -7
- package/dist/inline-icon-button/index.js +2 -3
- package/dist/inline-icon-button/index.js.map +1 -7
- package/dist/inline-notification/index.js +2 -3
- package/dist/inline-notification/index.js.map +1 -7
- package/dist/input/index.js +2 -3
- package/dist/input/index.js.map +1 -7
- package/dist/kbd/index.js +2 -3
- package/dist/kbd/index.js.map +1 -7
- package/dist/link/index.js +2 -3
- package/dist/link/index.js.map +1 -7
- package/dist/menu/index.d.ts +76 -51
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +2 -3
- package/dist/menu/index.js.map +1 -7
- package/dist/menu/menu-icon-button.d.ts +1 -1
- package/dist/menu/menu-icon-button.d.ts.map +1 -1
- package/dist/menu/menu-split-button.d.ts +40 -0
- package/dist/menu/menu-split-button.d.ts.map +1 -0
- package/dist/number-input/index.js +2 -3
- package/dist/number-input/index.js.map +1 -7
- package/dist/pagination/index.js +2 -3
- package/dist/pagination/index.js.map +1 -7
- package/dist/password-input/index.js +2 -3
- package/dist/password-input/index.js.map +1 -7
- package/dist/popover/index.js +2 -3
- package/dist/popover/index.js.map +1 -7
- package/dist/progress/index.js +2 -3
- package/dist/progress/index.js.map +1 -7
- package/dist/progress-ring/index.js +2 -3
- package/dist/progress-ring/index.js.map +1 -7
- package/dist/qds-theme/index.js +2 -3
- package/dist/qds-theme/index.js.map +1 -7
- package/dist/qui-root/index.js +2 -3
- package/dist/qui-root/index.js.map +1 -7
- package/dist/radio/index.js +2 -3
- package/dist/radio/index.js.map +1 -7
- package/dist/segmented-control/index.js +2 -3
- package/dist/segmented-control/index.js.map +1 -7
- package/dist/select/index.js +2 -3
- package/dist/select/index.js.map +1 -7
- package/dist/side-nav/index.js +2 -3
- package/dist/side-nav/index.js.map +1 -7
- package/dist/slider/index.js +2 -3
- package/dist/slider/index.js.map +1 -7
- package/dist/stepper/index.js +2 -3
- package/dist/stepper/index.js.map +1 -7
- package/dist/stepper/stepper-completed-content.d.ts +2 -1
- package/dist/stepper/stepper-completed-content.d.ts.map +1 -1
- package/dist/switch/index.js +2 -3
- package/dist/switch/index.js.map +1 -7
- package/dist/switch-group/index.js +2 -3
- package/dist/switch-group/index.js.map +1 -7
- package/dist/table/index.js +2 -3
- package/dist/table/index.js.map +1 -7
- package/dist/tabs/index.js +2 -3
- package/dist/tabs/index.js.map +1 -7
- package/dist/tag/index.js +2 -3
- package/dist/tag/index.js.map +1 -7
- package/dist/tag/tag.d.ts +33 -6
- package/dist/tag/tag.d.ts.map +1 -1
- package/dist/text-area/index.js +2 -3
- package/dist/text-area/index.js.map +1 -7
- package/dist/text-input/index.js +2 -3
- package/dist/text-input/index.js.map +1 -7
- package/dist/toast/index.js +2 -3
- package/dist/toast/index.js.map +1 -7
- package/dist/tooltip/index.js +2 -3
- package/dist/tooltip/index.js.map +1 -7
- package/dist/tree/index.js +2 -3
- package/dist/tree/index.js.map +1 -7
- package/dist/tsbuildinfo +1 -1
- package/package.json +9 -6
- package/dist/button/internal/context-button.d.ts +0 -4
- package/dist/button/internal/context-button.d.ts.map +0 -1
- package/dist/button/internal/context-icon-button.d.ts +0 -4
- package/dist/button/internal/context-icon-button.d.ts.map +0 -1
- package/dist/button/internal/index.d.ts +0 -5
- package/dist/button/internal/index.d.ts.map +0 -1
- package/dist/button/internal/internal-button.d.ts +0 -4
- package/dist/button/internal/internal-button.d.ts.map +0 -1
- package/dist/button/internal/internal-icon-button.d.ts +0 -4
- package/dist/button/internal/internal-icon-button.d.ts.map +0 -1
- package/dist/footer/index.js.map +0 -7
package/dist/tabs/index.js.map
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/tabs/qds-tabs-context.ts", "../../src/tabs/tab/tab-button.tsx", "../../src/tabs/tab/tab-dismiss-button.tsx", "../../src/tabs/tab/tab-root.tsx", "../../src/tabs/tab/index.ts", "../../src/tabs/tabs/tabs-context.tsx", "../../src/tabs/tabs/tabs-indicator.tsx", "../../src/tabs/tabs/tabs-list.tsx", "../../src/tabs/tabs/tabs-panel.tsx", "../../src/tabs/tabs/tabs-root.tsx", "../../src/tabs/tabs/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { createGuardedContext } from \"@qualcomm-ui/react-core/context\";\nexport const [QdsTabsContextProvider, useQdsTabsContext] = createGuardedContext({\n hookName: \"useQdsTabsContext\",\n providerName: \"<QdsTabsContextProvider>\",\n strict: true\n});", "import { jsx, jsxs } from \"react/jsx-runtime\";\nimport { isValidElement } from \"react\";\nimport { Icon, IconOrNode } from \"@qualcomm-ui/react/icon\";\nimport { CoreTabs } from \"@qualcomm-ui/react-core/tabs\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsTabsContext } from \"../qds-tabs-context\";\nexport function TabButton(t0) {\n const {\n children,\n endIcon,\n startIcon,\n ...props\n } = t0;\n const qdsContext = useQdsTabsContext();\n const mergedProps = mergeProps(qdsContext.getTabButtonBindings(), props);\n return jsxs(CoreTabs.TabButton, {\n ...mergedProps,\n children: [startIcon ? isValidElement(startIcon) ? jsx(IconOrNode, {\n icon: startIcon,\n ...qdsContext.getTabStartIconBindings()\n }) : jsx(\"span\", {\n ...qdsContext.getTabStartIconBindings(),\n children: jsx(Icon, {\n icon: startIcon\n })\n }) : null, children, endIcon ? isValidElement(endIcon) ? jsx(IconOrNode, {\n icon: endIcon,\n ...qdsContext.getTabEndIconBindings()\n }) : jsx(\"span\", {\n ...qdsContext.getTabEndIconBindings(),\n children: jsx(Icon, {\n icon: endIcon\n })\n }) : null]\n });\n}", "import { jsx } from \"react/jsx-runtime\";\nimport { X } from \"lucide-react\";\nimport { InlineIconButton } from \"@qualcomm-ui/react/inline-icon-button\";\nimport { CoreTabs } from \"@qualcomm-ui/react-core/tabs\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsTabsContext } from \"../qds-tabs-context\";\nexport function TabDismissButton(t0) {\n const {\n render,\n ...props\n } = t0;\n const qdsContext = useQdsTabsContext();\n const mergedProps = mergeProps(qdsContext.getTabDismissButtonBindings(), props);\n return jsx(CoreTabs.TabDismissButton, {\n render: jsx(InlineIconButton, {\n icon: X,\n render\n }),\n ...mergedProps\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { CoreTabs } from \"@qualcomm-ui/react-core/tabs\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsTabsContext } from \"../qds-tabs-context\";\nexport function TabRoot(props) {\n const $ = _c(3);\n const qdsContext = useQdsTabsContext();\n let t0;\n if ($[0] !== props || $[1] !== qdsContext) {\n const mergedProps = mergeProps(qdsContext.getTabBindings(), props);\n t0 = jsx(CoreTabs.Tab, {\n ...mergedProps\n });\n $[0] = props;\n $[1] = qdsContext;\n $[2] = t0;\n } else {\n t0 = $[2];\n }\n return t0;\n}", "import { TabButton } from \"./tab-button\";\nimport { TabDismissButton } from \"./tab-dismiss-button\";\nimport { TabRoot } from \"./tab-root\";\nexport const Tab = {\n Button: TabButton,\n DismissButton: TabDismissButton,\n Root: TabRoot\n};", "import { jsx } from \"react/jsx-runtime\";\nimport { CoreTabs } from \"@qualcomm-ui/react-core/tabs\";\nexport function TabsContext(props) {\n return /* @__PURE__ */jsx(CoreTabs.Context, {\n ...props\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { CoreTabs } from \"@qualcomm-ui/react-core/tabs\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsTabsContext } from \"../qds-tabs-context\";\nexport function TabsIndicator(props) {\n const $ = _c(3);\n const qdsContext = useQdsTabsContext();\n let t0;\n if ($[0] !== props || $[1] !== qdsContext) {\n const mergedProps = mergeProps(qdsContext.getIndicatorBindings(), props);\n t0 = jsx(CoreTabs.Indicator, {\n ...mergedProps\n });\n $[0] = props;\n $[1] = qdsContext;\n $[2] = t0;\n } else {\n t0 = $[2];\n }\n return t0;\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { CoreTabs } from \"@qualcomm-ui/react-core/tabs\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsTabsContext } from \"../qds-tabs-context\";\nexport function TabsList(props) {\n const $ = _c(3);\n const qdsContext = useQdsTabsContext();\n let t0;\n if ($[0] !== props || $[1] !== qdsContext) {\n const mergedProps = mergeProps(qdsContext.getListBindings(), props);\n t0 = jsx(CoreTabs.List, {\n ...mergedProps\n });\n $[0] = props;\n $[1] = qdsContext;\n $[2] = t0;\n } else {\n t0 = $[2];\n }\n return t0;\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { CoreTabs } from \"@qualcomm-ui/react-core/tabs\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsTabsContext } from \"../qds-tabs-context\";\nexport function TabsPanel(props) {\n const $ = _c(3);\n const qdsContext = useQdsTabsContext();\n let t0;\n if ($[0] !== props || $[1] !== qdsContext) {\n const mergedProps = mergeProps(qdsContext.getPanelBindings(), props);\n t0 = jsx(CoreTabs.Panel, {\n ...mergedProps\n });\n $[0] = props;\n $[1] = qdsContext;\n $[2] = t0;\n } else {\n t0 = $[2];\n }\n return t0;\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { useMemo } from \"react\";\nimport { createQdsTabsApi } from \"@qualcomm-ui/qds-core/tabs\";\nimport { normalizeProps } from \"@qualcomm-ui/react-core/machine\";\nimport { CoreTabs } from \"@qualcomm-ui/react-core/tabs\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { QdsTabsContextProvider } from \"../qds-tabs-context\";\nexport function TabsRoot(t0) {\n const $ = _c(7);\n let t1;\n if ($[0] !== t0) {\n const {\n animateIndicator,\n iconVariant,\n size,\n variant,\n ...props\n } = t0;\n let t2;\n if ($[2] !== animateIndicator || $[3] !== iconVariant || $[4] !== size || $[5] !== variant) {\n t2 = createQdsTabsApi({\n animateIndicator,\n iconVariant,\n size,\n variant\n }, normalizeProps);\n $[2] = animateIndicator;\n $[3] = iconVariant;\n $[4] = size;\n $[5] = variant;\n $[6] = t2;\n } else {\n t2 = $[6];\n }\n const qdsContext = t2;\n const mergedProps = mergeProps(qdsContext.getRootBindings(), props);\n t1 = jsx(QdsTabsContextProvider, {\n value: qdsContext,\n children: jsx(CoreTabs.Root, {\n ...mergedProps\n })\n });\n $[0] = t0;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n return t1;\n}", "import { TabsContext } from \"./tabs-context\";\nimport { TabsIndicator } from \"./tabs-indicator\";\nimport { TabsList } from \"./tabs-list\";\nimport { TabsPanel } from \"./tabs-panel\";\nimport { TabsRoot } from \"./tabs-root\";\nexport const Tabs = {\n Context: TabsContext,\n Indicator: TabsIndicator,\n List: TabsList,\n Panel: TabsPanel,\n Root: TabsRoot\n};"],
|
|
5
|
-
"mappings": ";AAAA,OAAS,yBAA4B,kCAC9B,GAAM,CAAC,uBAAwB,iBAAiB,EAAI,qBAAqB,CAC9E,SAAU,oBACV,aAAc,2BACd,OAAQ,EACV,CAAC,ECLD,OAAS,IAAK,SAAY,oBAC1B,OAAS,mBAAsB,QAC/B,OAAS,KAAM,eAAkB,0BACjC,OAAS,aAAgB,+BACzB,OAAS,eAAkB,iCAEpB,SAAS,UAAU,GAAI,CAC5B,GAAM,CACJ,SACA,QACA,UACA,GAAG,KACL,EAAI,GACE,WAAa,kBAAkB,EAC/B,YAAc,WAAW,WAAW,qBAAqB,EAAG,KAAK,EACvE,OAAO,KAAK,SAAS,UAAW,CAC9B,GAAG,YACH,SAAU,CAAC,UAAY,eAAe,SAAS,EAAI,IAAI,WAAY,CACjE,KAAM,UACN,GAAG,WAAW,wBAAwB,CACxC,CAAC,EAAI,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AAO,CAClB,QAAS,YACT,UAAW,cACX,KAAM,SACN,MAAO,UACP,KAAM,QACR",
|
|
6
|
-
"names": ["jsx", "CoreTabs", "mergeProps", "mergeProps", "jsx", "CoreTabs", "jsx", "CoreTabs", "mergeProps", "mergeProps", "jsx", "CoreTabs", "jsx", "CoreTabs", "_c", "jsx", "CoreTabs", "mergeProps", "_c", "mergeProps", "jsx", "CoreTabs", "_c", "jsx", "CoreTabs", "mergeProps", "_c", "mergeProps", "jsx", "CoreTabs", "_c", "jsx", "CoreTabs", "mergeProps", "_c", "mergeProps", "jsx", "CoreTabs", "_c", "jsx", "CoreTabs", "mergeProps", "_c", "mergeProps", "jsx", "CoreTabs"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"index.js","names":["QdsTabsApi","createGuardedContext","QdsTabsContextProvider","useQdsTabsContext","hookName","providerName","strict","isValidElement","ReactElement","Icon","IconOrNode","LucideIconOrElement","CoreTabs","CoreTabsTabButtonProps","mergeProps","useQdsTabsContext","TabButtonProps","disabled","endIcon","startIcon","TabButton","t0","$","_c","children","props","qdsContext","mergedProps","getTabButtonBindings","t1","getTabStartIconBindings","t2","getTabEndIconBindings","t3","ReactElement","X","InlineIconButton","CoreTabs","CoreTabsTabDismissButtonProps","mergeProps","useQdsTabsContext","TabDismissButtonProps","TabDismissButton","t0","$","_c","render","props","qdsContext","mergedProps","getTabDismissButtonBindings","t1","t2","ReactElement","CoreTabs","CoreTabsTabProps","mergeProps","useQdsTabsContext","TabRootProps","TabRoot","props","$","_c","qdsContext","t0","getTabBindings","mergedProps","t1","TabButton","TabButtonProps","TabDismissButton","TabDismissButtonProps","TabRoot","TabRootProps","TabComponent","Button","DismissButton","Root","Tab","ReactElement","CoreTabs","CoreTabsContextProps","TabsContextProps","TabsContext","props","$","_c","t0","ReactElement","CoreTabs","CoreTabsIndicatorProps","mergeProps","useQdsTabsContext","TabsIndicatorProps","TabsIndicator","props","$","_c","qdsContext","t0","getIndicatorBindings","mergedProps","t1","ReactElement","CoreTabs","CoreTabsListProps","mergeProps","useQdsTabsContext","TabsListProps","TabsList","props","$","_c","qdsContext","t0","getListBindings","mergedProps","t1","ReactElement","CoreTabs","CoreTabsPanelProps","mergeProps","useQdsTabsContext","TabsPanelProps","TabsPanel","props","$","_c","qdsContext","t0","getPanelBindings","mergedProps","t1","ReactElement","useMemo","createQdsTabsApi","QdsTabsApiProps","normalizeProps","CoreTabs","CoreTabsRootProps","mergeProps","QdsTabsContextProvider","TabsRootProps","TabsRoot","t0","$","_c","qdsContext","t1","animateIndicator","iconVariant","size","variant","props","t2","getRootBindings","mergedProps","t3","TabsContext","TabsContextProps","TabsIndicator","TabsIndicatorProps","TabsList","TabsListProps","TabsPanel","TabsPanelProps","TabsRoot","TabsRootProps","TabsComponent","Context","Indicator","List","Panel","Root","Tabs"],"sources":["../../src/tabs/qds-tabs-context.ts","../../src/tabs/tab/tab-button.tsx","../../src/tabs/tab/tab-dismiss-button.tsx","../../src/tabs/tab/tab-root.tsx","../../src/tabs/tab/index.ts","../../src/tabs/tabs/tabs-context.tsx","../../src/tabs/tabs/tabs-indicator.tsx","../../src/tabs/tabs/tabs-list.tsx","../../src/tabs/tabs/tabs-panel.tsx","../../src/tabs/tabs/tabs-root.tsx","../../src/tabs/tabs/index.ts"],"sourcesContent":["// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {QdsTabsApi} from \"@qualcomm-ui/qds-core/tabs\"\nimport {createGuardedContext} from \"@qualcomm-ui/react-core/context\"\n\nexport const [QdsTabsContextProvider, useQdsTabsContext] =\n createGuardedContext<QdsTabsApi>({\n hookName: \"useQdsTabsContext\",\n providerName: \"<QdsTabsContextProvider>\",\n strict: true,\n })\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {isValidElement, type ReactElement} from \"react\"\n\nimport {Icon, IconOrNode} from \"@qualcomm-ui/react/icon\"\nimport type {LucideIconOrElement} from \"@qualcomm-ui/react-core/lucide\"\nimport {\n CoreTabs,\n type CoreTabsTabButtonProps,\n} from \"@qualcomm-ui/react-core/tabs\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nimport {useQdsTabsContext} from \"../qds-tabs-context\"\n\nexport interface TabButtonProps extends CoreTabsTabButtonProps {\n /**\n * Use the `disabled` prop on the parent `<Tab.Root>` component instead.\n */\n disabled?: never\n\n /**\n * Icon positioned after the text content. If supplied as a\n * `LucideIcon`, the size will automatically match the {@link size} prop.\n * Supply as a `ReactElement` for additional customization.\n */\n endIcon?: LucideIconOrElement\n\n /**\n * Icon positioned before the text content. If supplied as a `LucideIcon`,\n * the size will automatically match the {@link size}. Supply as a\n * `ReactElement` for additional customization.\n */\n startIcon?: LucideIconOrElement\n}\n\n/**\n * Button that activates its associated tab panel. Renders a `<button>` element by\n * default.\n */\nexport function TabButton({\n children,\n endIcon,\n startIcon,\n ...props\n}: TabButtonProps): ReactElement {\n const qdsContext = useQdsTabsContext()\n const mergedProps = mergeProps(qdsContext.getTabButtonBindings(), props)\n\n return (\n <CoreTabs.TabButton {...mergedProps}>\n {startIcon ? (\n isValidElement(startIcon) ? (\n <IconOrNode\n icon={startIcon}\n {...qdsContext.getTabStartIconBindings()}\n />\n ) : (\n <span {...qdsContext.getTabStartIconBindings()}>\n <Icon icon={startIcon} />\n </span>\n )\n ) : null}\n {children}\n {endIcon ? (\n isValidElement(endIcon) ? (\n <IconOrNode icon={endIcon} {...qdsContext.getTabEndIconBindings()} />\n ) : (\n <span {...qdsContext.getTabEndIconBindings()}>\n <Icon icon={endIcon} />\n </span>\n )\n ) : null}\n </CoreTabs.TabButton>\n )\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ReactElement} from \"react\"\n\nimport {X} from \"lucide-react\"\n\nimport {InlineIconButton} from \"@qualcomm-ui/react/inline-icon-button\"\nimport {\n CoreTabs,\n type CoreTabsTabDismissButtonProps,\n} from \"@qualcomm-ui/react-core/tabs\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nimport {useQdsTabsContext} from \"../qds-tabs-context\"\n\nexport interface TabDismissButtonProps extends CoreTabsTabDismissButtonProps {}\n\n/**\n * Button that dismisses a tab. Renders a `<button>` element by default.\n */\nexport function TabDismissButton({\n render,\n ...props\n}: TabDismissButtonProps): ReactElement {\n const qdsContext = useQdsTabsContext()\n const mergedProps = mergeProps(\n qdsContext.getTabDismissButtonBindings(),\n props,\n )\n\n return (\n <CoreTabs.TabDismissButton\n render={<InlineIconButton icon={X} render={render} />}\n {...mergedProps}\n />\n )\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ReactElement} from \"react\"\n\nimport {CoreTabs, type CoreTabsTabProps} from \"@qualcomm-ui/react-core/tabs\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nimport {useQdsTabsContext} from \"../qds-tabs-context\"\n\nexport interface TabRootProps extends CoreTabsTabProps {}\n\n/**\n * Groups all parts of a single tab. Renders a `<div>` element by default.\n */\nexport function TabRoot(props: TabRootProps): ReactElement {\n const qdsContext = useQdsTabsContext()\n const mergedProps = mergeProps(qdsContext.getTabBindings(), props)\n\n return <CoreTabs.Tab {...mergedProps} />\n}\n","import {TabButton, type TabButtonProps} from \"./tab-button\"\nimport {\n TabDismissButton,\n type TabDismissButtonProps,\n} from \"./tab-dismiss-button\"\nimport {TabRoot, type TabRootProps} from \"./tab-root\"\n\nexport type {TabButtonProps, TabDismissButtonProps, TabRootProps}\n\ntype TabComponent = {\n /**\n * Button that activates its associated tab panel. Renders a `<button>` element by\n * default.\n */\n Button: typeof TabButton\n /**\n * Button that dismisses a tab. Renders a `<button>` element by default.\n */\n DismissButton: typeof TabDismissButton\n /**\n * Groups all parts of a single tab. Renders a `<div>` element by default.\n */\n Root: typeof TabRoot\n}\n\nexport const Tab: TabComponent = {\n Button: TabButton,\n DismissButton: TabDismissButton,\n Root: TabRoot,\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ReactElement} from \"react\"\n\nimport {CoreTabs, type CoreTabsContextProps} from \"@qualcomm-ui/react-core/tabs\"\n\nexport interface TabsContextProps extends CoreTabsContextProps {}\n\nexport function TabsContext(props: TabsContextProps): ReactElement {\n return <CoreTabs.Context {...props} />\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ReactElement} from \"react\"\n\nimport {\n CoreTabs,\n type CoreTabsIndicatorProps,\n} from \"@qualcomm-ui/react-core/tabs\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nimport {useQdsTabsContext} from \"../qds-tabs-context\"\n\nexport interface TabsIndicatorProps extends CoreTabsIndicatorProps {}\n\n/**\n * Visual indicator that highlights the active tab. Renders a `<div>` element by\n * default. You only need to render a single `<Tabs.Indicator>` component per tab\n * list.\n *\n * @example\n * ```tsx\n * <Tabs.Root>\n * <Tabs.List>\n * <Tabs.Indicator />\n * <Tab.Root value=\"tab-1\">\n * <Tab.Button>Tab 1</Tab.Button>\n * </Tab.Root>\n * </Tabs.List>\n * </Tabs.Root>\n * ```\n */\nexport function TabsIndicator(props: TabsIndicatorProps): ReactElement {\n const qdsContext = useQdsTabsContext()\n const mergedProps = mergeProps(qdsContext.getIndicatorBindings(), props)\n\n return <CoreTabs.Indicator {...mergedProps} />\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ReactElement} from \"react\"\n\nimport {CoreTabs, type CoreTabsListProps} from \"@qualcomm-ui/react-core/tabs\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nimport {useQdsTabsContext} from \"../qds-tabs-context\"\n\nexport interface TabsListProps extends CoreTabsListProps {}\n\n/**\n * Container for the tab buttons. Renders a `<div>` element by default.\n */\nexport function TabsList(props: TabsListProps): ReactElement {\n const qdsContext = useQdsTabsContext()\n const mergedProps = mergeProps(qdsContext.getListBindings(), props)\n\n return <CoreTabs.List {...mergedProps} />\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ReactElement} from \"react\"\n\nimport {CoreTabs, type CoreTabsPanelProps} from \"@qualcomm-ui/react-core/tabs\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nimport {useQdsTabsContext} from \"../qds-tabs-context\"\n\nexport interface TabsPanelProps extends CoreTabsPanelProps {}\n\n/**\n * Content area associated with a tab. Renders a `<div>` element by default.\n */\nexport function TabsPanel(props: TabsPanelProps): ReactElement {\n const qdsContext = useQdsTabsContext()\n const mergedProps = mergeProps(qdsContext.getPanelBindings(), props)\n\n return <CoreTabs.Panel {...mergedProps} />\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {type ReactElement, useMemo} from \"react\"\n\nimport {\n createQdsTabsApi,\n type QdsTabsApiProps,\n} from \"@qualcomm-ui/qds-core/tabs\"\nimport {normalizeProps} from \"@qualcomm-ui/react-core/machine\"\nimport {CoreTabs, type CoreTabsRootProps} from \"@qualcomm-ui/react-core/tabs\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nimport {QdsTabsContextProvider} from \"../qds-tabs-context\"\n\nexport interface TabsRootProps extends CoreTabsRootProps, QdsTabsApiProps {}\n\n/**\n * Groups all parts of the tabs. Renders a `<div>` element by default.\n */\nexport function TabsRoot({\n animateIndicator,\n iconVariant,\n size,\n variant,\n ...props\n}: TabsRootProps): ReactElement {\n const qdsContext = useMemo(\n () =>\n createQdsTabsApi(\n {animateIndicator, iconVariant, size, variant},\n normalizeProps,\n ),\n [animateIndicator, iconVariant, size, variant],\n )\n\n const mergedProps = mergeProps(qdsContext.getRootBindings(), props)\n\n return (\n <QdsTabsContextProvider value={qdsContext}>\n <CoreTabs.Root {...mergedProps} />\n </QdsTabsContextProvider>\n )\n}\n","import {TabsContext, type TabsContextProps} from \"./tabs-context\"\nimport {TabsIndicator, type TabsIndicatorProps} from \"./tabs-indicator\"\nimport {TabsList, type TabsListProps} from \"./tabs-list\"\nimport {TabsPanel, type TabsPanelProps} from \"./tabs-panel\"\nimport {TabsRoot, type TabsRootProps} from \"./tabs-root\"\n\nexport type {\n TabsContextProps,\n TabsIndicatorProps,\n TabsListProps,\n TabsPanelProps,\n TabsRootProps,\n}\n\ntype TabsComponent = {\n Context: typeof TabsContext\n /**\n * Visual indicator that highlights the active tab. Renders a `<div>` element by\n * default. You only need to render a single `<Tabs.Indicator>` component per tab\n * list.\n *\n * @example\n * ```tsx\n * <Tabs.Root>\n * <Tabs.List>\n * <Tabs.Indicator />\n * <Tab.Root value=\"tab-1\">\n * <Tab.Button>Tab 1</Tab.Button>\n * </Tab.Root>\n * </Tabs.List>\n * </Tabs.Root>\n * ```\n */\n Indicator: typeof TabsIndicator\n /**\n * Container for the tab buttons. Renders a `<div>` element by default.\n */\n List: typeof TabsList\n /**\n * Content area associated with a tab. Renders a `<div>` element by default.\n */\n Panel: typeof TabsPanel\n /**\n * Groups all parts of the tabs. Renders a `<div>` element by default.\n */\n Root: typeof TabsRoot\n}\n\nexport const Tabs: TabsComponent = {\n Context: TabsContext,\n Indicator: TabsIndicator,\n List: TabsList,\n Panel: TabsPanel,\n Root: TabsRoot,\n}\n"],"mappings":"qnBAMA,GAAa,CAACE,EAAwBC,GACpCF,EAAiC,CAC/BG,SAAU,oBACVC,aAAc,2BACdC,OAAQ,GACT,CAAC,CC6BJ,SAAOc,UAAAC,EAAA,CAAA,IAAAC,EAAAC,EAAA,GAAA,CAAmB,CAAA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-
"use client";
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use client;";import{c as e}from"react/compiler-runtime";import{mergeProps as t}from"@qualcomm-ui/utils/merge-props";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{PolymorphicElement as i}from"@qualcomm-ui/react-core/system";import{X as a}from"lucide-react";import{IconOrNode as o}from"@qualcomm-ui/react/icon";import{normalizeProps as s}from"@qualcomm-ui/react-core/machine";import{useControlledState as c}from"@qualcomm-ui/react-core/state";import{createQdsTagApi as l}from"@qualcomm-ui/qds-core/tag";function Tag(u){let d=e(17),{children:f,defaultSelected:p,disabled:m,emphasis:h,endIcon:g,onDismiss:_,onSelectedChange:v,radius:y,selected:b,shape:x,size:S,startIcon:C,variant:w,...T}=u,E=p??!1,D;d[0]!==v||d[1]!==b||d[2]!==E?(D={controlled:b,defaultValue:E,name:`Tag`,onChangeProp:v,state:`selected`},d[0]=v,d[1]=b,d[2]=E,d[3]=D):D=d[3];let[O,k]=c(D),A=l({disabled:m,emphasis:h,radius:y,selected:O,shape:x,size:S,variant:w},s),j=A.isInteractiveVariant()?`button`:`span`,t3;d[4]!==O||d[5]!==k||d[6]!==w?(t3=()=>{w===`selectable`&&k(!O)},d[4]=O,d[5]=k,d[6]=w,d[7]=t3):t3=d[7];let M=t(A.getRootBindings(),{onClick:t3},T),N=i,P=C?n(o,{icon:C,...A.getStartIconBindings()}):null,F;d[8]===f?F=d[9]:(F=n(`span`,{children:f}),d[8]=f,d[9]=F);let I=w===`dismissable`?n(`button`,{...A.getDismissButtonBindings(),onClick:_,children:n(o,{icon:a,...A.getEndIconBindings()})}):g?n(o,{icon:g,...A.getEndIconBindings()}):null,L;return d[10]!==N||d[11]!==j||d[12]!==M||d[13]!==P||d[14]!==F||d[15]!==I?(L=r(N,{as:j,...M,children:[P,F,I]}),d[10]=N,d[11]=j,d[12]=M,d[13]=P,d[14]=F,d[15]=I,d[16]=L):L=d[16],L}export{Tag};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
package/dist/tag/index.js.map
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/tag/tag.tsx"],
|
|
4
|
-
"sourcesContent": ["import { c as _c } from \"react/compiler-runtime\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nimport { useState } from \"react\";\nimport { X } from \"lucide-react\";\nimport { createQdsTagApi } from \"@qualcomm-ui/qds-core/tag\";\nimport { IconOrNode } from \"@qualcomm-ui/react/icon\";\nimport { normalizeProps } from \"@qualcomm-ui/react-core/machine\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nexport function Tag(t0) {\n const $ = _c(2);\n const {\n children,\n disabled,\n emphasis,\n endIcon,\n onDismiss,\n radius,\n shape,\n size,\n startIcon,\n variant,\n ...props\n } = t0;\n const [selected, setSelected] = useState(false);\n const qdsApi = createQdsTagApi({\n disabled,\n emphasis,\n radius,\n selected,\n shape,\n size,\n variant\n }, normalizeProps);\n const rootElement = qdsApi.isInteractiveVariant() ? \"button\" : \"span\";\n let t1;\n if ($[0] !== variant) {\n t1 = () => {\n if (variant === \"selectable\") {\n setSelected(_temp);\n }\n };\n $[0] = variant;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n const rootProps = mergeProps(qdsApi.getRootBindings(), {\n onClick: t1\n }, props);\n return jsxs(PolymorphicElement, {\n as: rootElement,\n ...rootProps,\n children: [startIcon ? jsx(IconOrNode, {\n icon: startIcon,\n ...qdsApi.getStartIconBindings()\n }) : null, jsx(\"span\", {\n children\n }), variant === \"dismissable\" ? jsx(\"button\", {\n ...qdsApi.getDismissButtonBindings(),\n onClick: onDismiss,\n children: jsx(IconOrNode, {\n icon: X,\n ...qdsApi.getEndIconBindings()\n })\n }) : endIcon ? jsx(IconOrNode, {\n icon: endIcon,\n ...qdsApi.getEndIconBindings()\n }) : null]\n });\n}\n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ACV",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ReactElement","ReactNode","X","createQdsTagApi","QdsTagApiProps","IconOrNode","LucideIconOrElement","normalizeProps","useControlledState","ElementRenderProp","PolymorphicElement","mergeProps","TagProps","children","defaultSelected","endIcon","onDismiss","onSelectedChange","selected","startIcon","Tag","t0","$","_c","disabled","emphasis","radius","selectedProp","shape","size","variant","props","t1","t2","controlled","defaultValue","name","onChangeProp","state","setSelected","qdsApi","rootElement","isInteractiveVariant","t3","rootProps","getRootBindings","onClick","T0","t4","getStartIconBindings","t5","t6","getDismissButtonBindings","getEndIconBindings","t7"],"sources":["../../src/tag/tag.tsx"],"sourcesContent":["// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ReactElement, ReactNode} from \"react\"\n\nimport {X} from \"lucide-react\"\n\nimport {createQdsTagApi, type QdsTagApiProps} from \"@qualcomm-ui/qds-core/tag\"\nimport {IconOrNode} from \"@qualcomm-ui/react/icon\"\nimport type {LucideIconOrElement} from \"@qualcomm-ui/react-core/lucide\"\nimport {normalizeProps} from \"@qualcomm-ui/react-core/machine\"\nimport {useControlledState} from \"@qualcomm-ui/react-core/state\"\nimport {\n type ElementRenderProp,\n PolymorphicElement,\n} from \"@qualcomm-ui/react-core/system\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nexport interface TagProps extends QdsTagApiProps, ElementRenderProp<\"button\"> {\n /**\n * React {@link https://react.dev/learn/passing-props-to-a-component#passing-jsx-as-children children} prop.\n */\n children?: ReactNode\n\n /**\n * Initial selected state when the component is uncontrolled.\n * Only applicable when {@link variant} is `selectable`.\n * Ignored when {@link selected} is provided.\n *\n * @since 1.24.0\n *\n * @default false\n */\n defaultSelected?: boolean\n\n /**\n * {@link https://lucide.dev lucide-react} icon, positioned after\n * the button text. Can be supplied as a `ReactElement` for additional\n * customization.\n * Ignored when {@link variant} is `dismissable`, as it is reserved for the\n * dismiss icon.\n */\n endIcon?: LucideIconOrElement\n\n /**\n * Callback fired when the dismiss button is clicked.\n * Only applicable when {@link variant} is `dismissable`.\n */\n onDismiss?: () => void\n\n /**\n * Callback fired when the selected state changes. Fires in both controlled\n * and uncontrolled modes.\n * Only applicable when {@link variant} is `selectable`.\n *\n * @since 1.24.0\n */\n onSelectedChange?: (selected: boolean) => void\n\n /**\n * Controls the selected state. When omitted, the tag manages its own selected\n * state internally.\n * Only applicable when {@link variant} is `selectable`.\n *\n * @since 1.24.0\n */\n selected?: boolean\n\n /**\n * {@link https://lucide.dev lucide-react} icon, positioned before\n * the button text. Can be supplied as a `ReactElement` for additional\n * customization.\n */\n startIcon?: LucideIconOrElement\n}\n\nexport function Tag({\n children,\n defaultSelected,\n disabled,\n emphasis,\n endIcon,\n onDismiss,\n onSelectedChange,\n radius,\n selected: selectedProp,\n shape,\n size,\n startIcon,\n variant,\n ...props\n}: TagProps): ReactElement {\n const [selected, setSelected] = useControlledState<boolean>({\n controlled: selectedProp,\n defaultValue: defaultSelected ?? false,\n name: \"Tag\",\n onChangeProp: onSelectedChange,\n state: \"selected\",\n })\n\n const qdsApi = createQdsTagApi(\n {disabled, emphasis, radius, selected, shape, size, variant},\n normalizeProps,\n )\n\n const rootElement = qdsApi.isInteractiveVariant() ? \"button\" : \"span\"\n const rootProps = mergeProps(\n qdsApi.getRootBindings(),\n {\n onClick: () => {\n if (variant === \"selectable\") {\n setSelected(!selected)\n }\n },\n },\n props,\n )\n\n return (\n <PolymorphicElement as={rootElement} {...rootProps}>\n {startIcon ? (\n <IconOrNode icon={startIcon} {...qdsApi.getStartIconBindings()} />\n ) : null}\n <span>{children}</span>\n {variant === \"dismissable\" ? (\n <button {...qdsApi.getDismissButtonBindings()} onClick={onDismiss}>\n <IconOrNode icon={X} {...qdsApi.getEndIconBindings()} />\n </button>\n ) : endIcon ? (\n <IconOrNode icon={endIcon} {...qdsApi.getEndIconBindings()} />\n )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WAAgB,CAAA,CAAAS,EAAA,GAAAT,EAAAS,EAAA,GAAA4B,GACtB,IAAAC,EAAArB,IAAY,cACX,EAAA,SAAA,CAES,GAFGU,EAAMY,0BAA2B,CAAWpC,QAAAA,WACtD,EAAC,EAAD,CAAkBd,KAAAA,EAAC,GAAMsC,EAAMa,oBAAqB,CACtD,CAAA,CAGM,CAAA,CAFJtC,EACF,EAAC,EAAD,CAAkBA,KAAAA,EAAO,GAAMyB,EAAMa,oBAAqB,CACpD,CAAA,CAFJ,KAEIC,EACW,OADXhC,EAAA,MAAAyB,GAAAzB,EAAA,MAAAmB,GAAAnB,EAAA,MAAAsB,GAAAtB,EAAA,MAAA0B,GAAA1B,EAAA,MAAA4B,GAAA5B,EAAA,MAAA6B,GAXVG,EAAA,EAAC,EAAD,CAAwBb,GAAAA,EAAW,GAAMG,WAAzC,CACGI,EAGDE,EACCC,EAOkB,GAAA7B,EAAA,IAAAyB,EAAAzB,EAAA,IAAAmB,EAAAnB,EAAA,IAAAsB,EAAAtB,EAAA,IAAA0B,EAAA1B,EAAA,IAAA4B,EAAA5B,EAAA,IAAA6B,EAAA7B,EAAA,IAAAgC,GAAAA,EAAAhC,EAAA,IAZrBgC"}
|
package/dist/tag/tag.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
2
|
import { type QdsTagApiProps } from "@qualcomm-ui/qds-core/tag";
|
|
3
3
|
import type { LucideIconOrElement } from "@qualcomm-ui/react-core/lucide";
|
|
4
4
|
import { type ElementRenderProp } from "@qualcomm-ui/react-core/system";
|
|
@@ -7,18 +7,45 @@ export interface TagProps extends QdsTagApiProps, ElementRenderProp<"button"> {
|
|
|
7
7
|
* React {@link https://react.dev/learn/passing-props-to-a-component#passing-jsx-as-children children} prop.
|
|
8
8
|
*/
|
|
9
9
|
children?: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Initial selected state when the component is uncontrolled.
|
|
12
|
+
* Only applicable when {@link variant} is `selectable`.
|
|
13
|
+
* Ignored when {@link selected} is provided.
|
|
14
|
+
*
|
|
15
|
+
* @since 1.24.0
|
|
16
|
+
*
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
defaultSelected?: boolean;
|
|
10
20
|
/**
|
|
11
21
|
* {@link https://lucide.dev lucide-react} icon, positioned after
|
|
12
22
|
* the button text. Can be supplied as a `ReactElement` for additional
|
|
13
|
-
* customization.
|
|
14
|
-
* `dismissable`, as it is reserved for the
|
|
23
|
+
* customization.
|
|
24
|
+
* Ignored when {@link variant} is `dismissable`, as it is reserved for the
|
|
25
|
+
* dismiss icon.
|
|
15
26
|
*/
|
|
16
27
|
endIcon?: LucideIconOrElement;
|
|
17
28
|
/**
|
|
18
|
-
* Callback fired when the dismiss button is clicked.
|
|
19
|
-
* {@link variant} is `dismissable`.
|
|
29
|
+
* Callback fired when the dismiss button is clicked.
|
|
30
|
+
* Only applicable when {@link variant} is `dismissable`.
|
|
20
31
|
*/
|
|
21
32
|
onDismiss?: () => void;
|
|
33
|
+
/**
|
|
34
|
+
* Callback fired when the selected state changes. Fires in both controlled
|
|
35
|
+
* and uncontrolled modes.
|
|
36
|
+
* Only applicable when {@link variant} is `selectable`.
|
|
37
|
+
*
|
|
38
|
+
* @since 1.24.0
|
|
39
|
+
*/
|
|
40
|
+
onSelectedChange?: (selected: boolean) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Controls the selected state. When omitted, the tag manages its own selected
|
|
43
|
+
* state internally.
|
|
44
|
+
* Only applicable when {@link variant} is `selectable`.
|
|
45
|
+
*
|
|
46
|
+
* @since 1.24.0
|
|
47
|
+
*/
|
|
48
|
+
selected?: boolean;
|
|
22
49
|
/**
|
|
23
50
|
* {@link https://lucide.dev lucide-react} icon, positioned before
|
|
24
51
|
* the button text. Can be supplied as a `ReactElement` for additional
|
|
@@ -26,5 +53,5 @@ export interface TagProps extends QdsTagApiProps, ElementRenderProp<"button"> {
|
|
|
26
53
|
*/
|
|
27
54
|
startIcon?: LucideIconOrElement;
|
|
28
55
|
}
|
|
29
|
-
export declare function Tag({ children, disabled, emphasis, endIcon, onDismiss, radius, shape, size, startIcon, variant, ...props }: TagProps): ReactElement;
|
|
56
|
+
export declare function Tag({ children, defaultSelected, disabled, emphasis, endIcon, onDismiss, onSelectedChange, radius, selected: selectedProp, shape, size, startIcon, variant, ...props }: TagProps): ReactElement;
|
|
30
57
|
//# sourceMappingURL=tag.d.ts.map
|
package/dist/tag/tag.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../src/tag/tag.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../src/tag/tag.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,OAAO,CAAA;AAIlD,OAAO,EAAkB,KAAK,cAAc,EAAC,MAAM,2BAA2B,CAAA;AAE9E,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAA;AAGvE,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,gCAAgC,CAAA;AAGvC,MAAM,WAAW,QAAS,SAAQ,cAAc,EAAE,iBAAiB,CAAC,QAAQ,CAAC;IAC3E;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IAEpB;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IAEzB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,mBAAmB,CAAA;IAE7B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IAEtB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAA;IAE9C;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;OAIG;IACH,SAAS,CAAC,EAAE,mBAAmB,CAAA;CAChC;AAED,wBAAgB,GAAG,CAAC,EAClB,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,QAAQ,EAAE,YAAY,EACtB,KAAK,EACL,IAAI,EACJ,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACT,EAAE,QAAQ,GAAG,YAAY,CA0CzB"}
|
package/dist/text-area/index.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use client;";import{c as e}from"react/compiler-runtime";import{mergeProps as t}from"@qualcomm-ui/utils/merge-props";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{PolymorphicElement as i}from"@qualcomm-ui/react-core/system";import{AlertCircle as a,Asterisk as o}from"lucide-react";import{Icon as s,IconOrNode as c}from"@qualcomm-ui/react/icon";import"react";import{normalizeProps as l,useOptionalContentId as u}from"@qualcomm-ui/react-core/machine";import{useControlledId as d}from"@qualcomm-ui/react-core/state";import{createGuardedContext as f}from"@qualcomm-ui/react-core/context";import{TextAreaContextProvider as p,useTextArea as m,useTextAreaContext as h,useTextAreaCounter as g,useTextAreaErrorText as _,useTextAreaHint as v,useTextAreaInput as y,useTextAreaLabel as b}from"@qualcomm-ui/react-core/text-area";import{splitTextAreaProps as x}from"@qualcomm-ui/core/text-area";import{createQdsTextAreaApi as S}from"@qualcomm-ui/qds-core/text-area";var[C,w]=f({hookName:`useQdsTextAreaContext`,providerName:`<QdsTextAreaContextProvider>`,strict:!0});function defaultDisplay(e,t){return t==null?e:`${e}/${t}`}function TextAreaCounter(r){let a=e(9),{display:o,id:s,...c}=r,l=o===void 0?defaultDisplay:o,u;a[0]===s?u=a[1]:(u={id:s},a[0]=s,a[1]=u);let d=t(g(u),w().getCounterBindings(),c),{maxLength:f,value:p}=h(),m;a[2]!==l||a[3]!==f||a[4]!==p.length?(m=l(p.length,f),a[2]=l,a[3]=f,a[4]=p.length,a[5]=m):m=a[5];let _;return a[6]!==d||a[7]!==m?(_=n(i,{as:`div`,...d,children:m}),a[6]=d,a[7]=m,a[8]=_):_=a[8],_}function TextAreaErrorText(o){let s=e(6),{children:l,id:u,...d}=o,f;s[0]===u?f=s[1]:(f={id:u},s[0]=u,s[1]=f);let p=t(_(f),w().getErrorTextBindings(),d),m;s[2]===Symbol.for(`react.memo_cache_sentinel`)?(m=n(c,{icon:a}),s[2]=m):m=s[2];let h;return s[3]!==l||s[4]!==p?(h=r(i,{as:`div`,...p,children:[m,l]}),s[3]=l,s[4]=p,s[5]=h):h=s[5],h}function TextAreaHint(r){let a=e(5),{children:o,id:s,...c}=r,l;a[0]===s?l=a[1]:(l={id:s},a[0]=s,a[1]=l);let u=t(v(l),w().getHintBindings(),c),d;return a[2]!==o||a[3]!==u?(d=n(i,{as:`div`,...u,children:o}),a[2]=o,a[3]=u,a[4]=d):d=a[4],d}function TextAreaInput(r){let i=e(4),{id:a,...o}=r,s;i[0]===a?s=i[1]:(s={id:a},i[0]=a,i[1]=s);let c=t(y(s),w().getInputBindings(),o),l;return i[2]===c?l=i[3]:(l=n(`textarea`,{...c}),i[2]=c,i[3]=l),l}function TextAreaLabel(a){let c=e(9),{children:l,id:u,...d}=a,f;c[0]===u?f=c[1]:(f={id:u},c[0]=u,c[1]=f);let p=b(f),m=w(),g=t(p,m.getLabelBindings(),d),{required:_}=h(),v;c[2]!==m||c[3]!==_?(v=_?n(s,{...m.getRequiredIndicatorBindings(),icon:o,size:`xs`}):null,c[2]=m,c[3]=_,c[4]=v):v=c[4];let y;return c[5]!==l||c[6]!==g||c[7]!==v?(y=r(i,{as:`label`,...g,children:[l,v]}),c[5]=l,c[6]=g,c[7]=v,c[8]=y):y=c[8],y}function TextAreaRoot(r){let a=e(11),{children:o,size:s,...c}=r,[u,d]=x(c),f=m(u),h;a[0]===s?h=a[1]:(h=S({size:s},l),a[0]=s,a[1]=h);let g=h,_=t(f.getRootBindings(),g.getRootBindings(),d),v;a[2]!==o||a[3]!==_?(v=n(i,{as:`div`,..._,children:o}),a[2]=o,a[3]=_,a[4]=v):v=a[4];let y;a[5]!==g||a[6]!==v?(y=n(C,{value:g,children:v}),a[5]=g,a[6]=v,a[7]=y):y=a[7];let b;return a[8]!==f||a[9]!==y?(b=n(p,{value:f,children:y}),a[8]=f,a[9]=y,a[10]=b):b=a[10],b}function TextArea$1(t){let i=e(50),a,o,s,c,l,f,p,m,h,g,_,v;i[0]===t?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],f=i[6],p=i[7],m=i[8],h=i[9],g=i[10],_=i[11],v=i[12]):({counter:a,counterProps:o,errorText:s,errorTextProps:c,hint:l,hintProps:f,inputProps:p,label:m,labelProps:h,maxLength:g,placeholder:_,...v}=t,i[0]=t,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=f,i[7]=p,i[8]=m,i[9]=h,i[10]=g,i[11]=_,i[12]=v);let y=m||h?.children,b=s||c?.children,x=l||f?.children,S=d(o?.id),C=u(b,c),w=u(x,f),T=d(p?.id),E=u(y,h),D;i[13]!==v.ids||i[14]!==S||i[15]!==C||i[16]!==w||i[17]!==T||i[18]!==E?(D={counter:S,errorText:C,hint:w,input:T,label:E,...v.ids},i[13]=v.ids,i[14]=S,i[15]=C,i[16]=w,i[17]=T,i[18]=E,i[19]=D):D=i[19];let O=D,k;i[20]!==O.label||i[21]!==y||i[22]!==h?(k=y?n(TextAreaLabel,{...h,id:O.label,children:y}):null,i[20]=O.label,i[21]=y,i[22]=h,i[23]=k):k=i[23];let A;i[24]!==a||i[25]!==o||i[26]!==g?(A=a??g!==void 0?n(TextAreaCounter,{...o}):null,i[24]=a,i[25]=o,i[26]=g,i[27]=A):A=i[27];let j;i[28]!==O.input||i[29]!==p||i[30]!==g||i[31]!==_?(j=n(TextAreaInput,{maxLength:g,placeholder:_,...p,id:O.input}),i[28]=O.input,i[29]=p,i[30]=g,i[31]=_,i[32]=j):j=i[32];let M;i[33]!==x||i[34]!==f||i[35]!==O.hint?(M=x?n(TextAreaHint,{...f,id:O.hint,children:x}):null,i[33]=x,i[34]=f,i[35]=O.hint,i[36]=M):M=i[36];let N;i[37]!==b||i[38]!==c||i[39]!==O.errorText?(N=b?n(TextAreaErrorText,{...c,id:O.errorText,children:b}):null,i[37]=b,i[38]=c,i[39]=O.errorText,i[40]=N):N=i[40];let P;return i[41]!==O||i[42]!==g||i[43]!==v||i[44]!==M||i[45]!==N||i[46]!==k||i[47]!==A||i[48]!==j?(P=r(TextAreaRoot,{...v,ids:O,maxLength:g,children:[k,A,j,M,N]}),i[41]=O,i[42]=g,i[43]=v,i[44]=M,i[45]=N,i[46]=k,i[47]=A,i[48]=j,i[49]=P):P=i[49],P}var T=TextArea$1;T.Counter=TextAreaCounter,T.ErrorText=TextAreaErrorText,T.Hint=TextAreaHint,T.Input=TextAreaInput,T.Label=TextAreaLabel,T.Root=TextAreaRoot;export{T as TextArea};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/text-area/text-area.tsx", "../../src/text-area/text-area-counter.tsx", "../../src/text-area/qds-text-area-context.ts", "../../src/text-area/text-area-error-text.tsx", "../../src/text-area/text-area-hint.tsx", "../../src/text-area/text-area-input.tsx", "../../src/text-area/text-area-label.tsx", "../../src/text-area/text-area-root.tsx", "../../src/text-area/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 { TextAreaCounter } from \"./text-area-counter\";\nimport { TextAreaErrorText } from \"./text-area-error-text\";\nimport { TextAreaHint } from \"./text-area-hint\";\nimport { TextAreaInput } from \"./text-area-input\";\nimport { TextAreaLabel } from \"./text-area-label\";\nimport { TextAreaRoot } from \"./text-area-root\";\nexport function TextArea(t0) {\n const {\n counter,\n counterProps,\n errorText,\n errorTextProps,\n hint,\n hintProps,\n inputProps,\n label,\n labelProps,\n maxLength,\n placeholder,\n ...props\n } = t0;\n const labelContent = label || labelProps?.children;\n const errorTextContent = errorText || errorTextProps?.children;\n const hintContent = hint || hintProps?.children;\n const ids = {\n counter: useControlledId(counterProps?.id),\n errorText: useOptionalContentId(errorTextContent, errorTextProps),\n hint: useOptionalContentId(hintContent, hintProps),\n input: useControlledId(inputProps?.id),\n label: useOptionalContentId(labelContent, labelProps),\n ...props.ids\n };\n return jsxs(TextAreaRoot, {\n ...props,\n ids,\n maxLength,\n children: [labelContent ? jsx(TextAreaLabel, {\n ...labelProps,\n id: ids.label,\n children: labelContent\n }) : null, counter ?? maxLength !== void 0 ? jsx(TextAreaCounter, {\n ...counterProps\n }) : null, jsx(TextAreaInput, {\n maxLength,\n placeholder,\n ...inputProps,\n id: ids.input\n }), hintContent ? jsx(TextAreaHint, {\n ...hintProps,\n id: ids.hint,\n children: hintContent\n }) : null, errorTextContent ? jsx(TextAreaErrorText, {\n ...errorTextProps,\n id: ids.errorText,\n children: errorTextContent\n }) : null]\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { useTextAreaContext, useTextAreaCounter } from \"@qualcomm-ui/react-core/text-area\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsTextAreaContext } from \"./qds-text-area-context\";\nfunction defaultDisplay(count, maxLength) {\n return maxLength != null ? `${count}/${maxLength}` : count;\n}\nexport function TextAreaCounter(t0) {\n const $ = _c(2);\n const {\n display: t1,\n id,\n ...props\n } = t0;\n const display = t1 === undefined ? defaultDisplay : t1;\n let t2;\n if ($[0] !== id) {\n t2 = {\n id\n };\n $[0] = id;\n $[1] = t2;\n } else {\n t2 = $[1];\n }\n const contextProps = useTextAreaCounter(t2);\n const qdsContext = useQdsTextAreaContext();\n const mergedProps = mergeProps(contextProps, qdsContext.getCounterBindings(), props);\n const {\n maxLength,\n value\n } = useTextAreaContext();\n return jsx(PolymorphicElement, {\n as: \"div\",\n ...mergedProps,\n children: display(value.length, maxLength)\n });\n}", "import { createGuardedContext } from \"@qualcomm-ui/react-core/context\";\nexport const [QdsTextAreaContextProvider, useQdsTextAreaContext] = createGuardedContext({\n hookName: \"useQdsTextAreaContext\",\n providerName: \"<QdsTextAreaContextProvider>\",\n strict: true\n});", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nimport { AlertCircle } from \"lucide-react\";\nimport { IconOrNode } from \"@qualcomm-ui/react/icon\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { useTextAreaErrorText } from \"@qualcomm-ui/react-core/text-area\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsTextAreaContext } from \"./qds-text-area-context\";\nexport function TextAreaErrorText(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 = useTextAreaErrorText(t1);\n const qdsContext = useQdsTextAreaContext();\n const mergedProps = mergeProps(contextProps, qdsContext.getErrorTextBindings(), props);\n return jsxs(PolymorphicElement, {\n as: \"div\",\n ...mergedProps,\n children: [jsx(IconOrNode, {\n icon: AlertCircle\n }), children]\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { useTextAreaHint } from \"@qualcomm-ui/react-core/text-area\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsTextAreaContext } from \"./qds-text-area-context\";\nexport function TextAreaHint(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 = useTextAreaHint(t1);\n const qdsContext = useQdsTextAreaContext();\n const mergedProps = mergeProps(contextProps, qdsContext.getHintBindings(), props);\n return jsx(PolymorphicElement, {\n as: \"div\",\n ...mergedProps,\n children\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { useTextAreaInput } from \"@qualcomm-ui/react-core/text-area\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsTextAreaContext } from \"./qds-text-area-context\";\nexport function TextAreaInput(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 = useTextAreaInput(t1);\n const qdsContext = useQdsTextAreaContext();\n const mergedProps = mergeProps(contextProps, qdsContext.getInputBindings(), props);\n return jsx(\"textarea\", {\n ...mergedProps\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nimport { Asterisk } from \"lucide-react\";\nimport { Icon } from \"@qualcomm-ui/react/icon\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { useTextAreaContext, useTextAreaLabel } from \"@qualcomm-ui/react-core/text-area\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { useQdsTextAreaContext } from \"./qds-text-area-context\";\nexport function TextAreaLabel(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 = useTextAreaLabel(t1);\n const qdsContext = useQdsTextAreaContext();\n const mergedProps = mergeProps(contextProps, qdsContext.getLabelBindings(), props);\n const {\n required\n } = useTextAreaContext();\n return jsxs(PolymorphicElement, {\n as: \"label\",\n ...mergedProps,\n children: [children, required ? jsx(Icon, {\n ...qdsContext.getRequiredIndicatorBindings(),\n icon: Asterisk,\n size: \"xs\"\n }) : null]\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { useMemo } from \"react\";\nimport { splitTextAreaProps } from \"@qualcomm-ui/core/text-area\";\nimport { createQdsTextAreaApi } from \"@qualcomm-ui/qds-core/text-area\";\nimport { normalizeProps } from \"@qualcomm-ui/react-core/machine\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { TextAreaContextProvider, useTextArea } from \"@qualcomm-ui/react-core/text-area\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { QdsTextAreaContextProvider } from \"./qds-text-area-context\";\nexport function TextAreaRoot(t0) {\n const $ = _c(2);\n const {\n children,\n size,\n ...props\n } = t0;\n const [textAreaProps, localProps] = splitTextAreaProps(props);\n const context = useTextArea(textAreaProps);\n let t1;\n if ($[0] !== size) {\n t1 = createQdsTextAreaApi({\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(), qdsContext.getRootBindings(), localProps);\n return jsx(TextAreaContextProvider, {\n value: context,\n children: jsx(QdsTextAreaContextProvider, {\n value: qdsContext,\n children: jsx(PolymorphicElement, {\n as: \"div\",\n ...mergedProps,\n children\n })\n })\n });\n}", "import { TextArea as SimpleTextArea } from \"./text-area\";\nimport { TextAreaCounter } from \"./text-area-counter\";\nimport { TextAreaErrorText } from \"./text-area-error-text\";\nimport { TextAreaHint } from \"./text-area-hint\";\nimport { TextAreaInput } from \"./text-area-input\";\nimport { TextAreaLabel } from \"./text-area-label\";\nimport { TextAreaRoot } from \"./text-area-root\";\nexport const TextArea = SimpleTextArea;\nTextArea.Counter = TextAreaCounter;\nTextArea.ErrorText = TextAreaErrorText;\nTextArea.Hint = TextAreaHint;\nTextArea.Input = TextAreaInput;\nTextArea.Label = TextAreaLabel;\nTextArea.Root = TextAreaRoot;"],
|
|
5
|
-
"mappings": ";AAAA,OAAS,OAAAA,KAAK,QAAAC,UAAY,oBAC1B,OAAS,yBAA4B,kCACrC,OAAS,oBAAuB,gCCFhC,OAAS,KAAK,OAAU,yBACxB,OAAS,QAAW,oBACpB,OAAS,uBAA0B,iCACnC,OAAS,mBAAoB,uBAA0B,oCACvD,OAAS,eAAkB,iCCJ3B,OAAS,yBAA4B,kCAC9B,GAAM,CAAC,2BAA4B,qBAAqB,EAAI,qBAAqB,CACtF,SAAU,wBACV,aAAc,+BACd,OAAQ,EACV,CAAC,EDCD,SAAS,eAAe,MAAO,UAAW,CACxC,OAAO,WAAa,KAAO,GAAG,KAAK,IAAI,SAAS,GAAK,KACvD,CACO,SAAS,gBAAgB,GAAI,CAClC,IAAM,EAAI,GAAG,CAAC,EACR,CACJ,QAAS,GACT,GACA,GAAG,KACL,EAAI,GACE,QAAU,KAAO,OAAY,eAAiB,GAChD,GACA,EAAE,CAAC,IAAM,IACX,GAAK,CACH,EACF,EACA,EAAE,CAAC,EAAI,GACP,EAAE,CAAC,EAAI,IAEP,GAAK,EAAE,CAAC,EAEV,IAAM,aAAe,mBAAmB,EAAE,EACpC,WAAa,sBAAsB,EACnC,YAAc,WAAW,aAAc,WAAW,mBAAmB,EAAG,KAAK,EAC7E,CACJ,UACA,KACF,EAAI,mBAAmB,EACvB,OAAO,IAAI,mBAAoB,CAC7B,GAAI,MACJ,GAAG,YACH,SAAU,QAAQ,MAAM,OAAQ,SAAS,CAC3C,CAAC,CACH,CEvCA,OAAS,KAAKC,QAAU,yBACxB,OAAS,OAAAC,KAAK,SAAY,oBAC1B,OAAS,gBAAmB,eAC5B,OAAS,eAAkB,0BAC3B,OAAS,sBAAAC,wBAA0B,iCACnC,OAAS,yBAA4B,oCACrC,OAAS,cAA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AAI,IAAI,KACR,SAAU,WACZ,CAAC,EAAI,KAAM,iBAAmBA,KAAI,kBAAmB,CACnD,GAAG,eACH,GAAI,IAAI,UACR,SAAU,gBACZ,CAAC,EAAI,IAAI,CACX,CAAC,CACH,CQrDO,IAAMC,UAAW,SACxBA,UAAS,QAAU,gBACnBA,UAAS,UAAY,kBACrBA,UAAS,KAAO,aAChBA,UAAS,MAAQ,cACjBA,UAAS,MAAQ,cACjBA,UAAS,KAAO",
|
|
6
|
-
"names": ["jsx", "jsxs", "_c", "jsx", "PolymorphicElement", "mergeProps", "_c", "mergeProps", "PolymorphicElement", "jsx", "_c", "jsx", "PolymorphicElement", "mergeProps", "_c", "mergeProps", "jsx", "PolymorphicElement", "_c", "jsx", "mergeProps", "_c", "mergeProps", "jsx", "_c", "jsx", "jsxs", "PolymorphicElement", "useTextAreaContext", "mergeProps", "_c", "mergeProps", "useTextAreaContext", "jsxs", "PolymorphicElement", "jsx", "_c", "jsx", "PolymorphicElement", "mergeProps", "_c", "mergeProps", "jsx", "PolymorphicElement", "jsxs", "jsx", "TextArea"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"index.js","names":["QdsTextAreaApi","createGuardedContext","QdsTextAreaContextProvider","useQdsTextAreaContext","hookName","providerName","strict","ReactElement","ReactNode","ElementRenderProp","PolymorphicElement","useTextAreaContext","useTextAreaCounter","mergeProps","useQdsTextAreaContext","TextAreaCounterProps","display","count","maxLength","defaultDisplay","TextAreaCounter","t0","$","_c","t1","id","props","undefined","t2","contextProps","qdsContext","mergedProps","getCounterBindings","value","t3","length","t4","ReactElement","ReactNode","AlertCircle","IconOrNode","ElementRenderProp","PolymorphicElement","useTextAreaErrorText","mergeProps","useQdsTextAreaContext","TextAreaErrorTextProps","children","TextAreaErrorText","t0","$","_c","id","props","t1","contextProps","qdsContext","mergedProps","getErrorTextBindings","t2","Symbol","for","t3","ReactElement","ReactNode","ElementRenderProp","PolymorphicElement","useTextAreaHint","mergeProps","useQdsTextAreaContext","TextAreaHintProps","children","TextAreaHint","t0","$","_c","id","props","t1","contextProps","qdsContext","mergedProps","getHintBindings","t2","ComponentPropsWithRef","ReactElement","IdProp","useTextAreaInput","mergeProps","useQdsTextAreaContext","TextAreaInputProps","TextAreaInput","t0","$","_c","id","props","t1","contextProps","qdsContext","mergedProps","getInputBindings","t2","ReactElement","ReactNode","Asterisk","Icon","ElementRenderProp","PolymorphicElement","useTextAreaContext","useTextAreaLabel","mergeProps","useQdsTextAreaContext","TextAreaLabelProps","children","TextAreaLabel","t0","$","_c","id","props","t1","contextProps","qdsContext","mergedProps","getLabelBindings","required","t2","getRequiredIndicatorBindings","t3","ReactElement","ReactNode","useMemo","splitTextAreaProps","TextAreaApiProps","createQdsTextAreaApi","QdsTextAreaApiProps","normalizeProps","ElementRenderProp","PolymorphicElement","TextAreaContextProvider","useTextArea","mergeProps","QdsTextAreaContextProvider","TextAreaRootProps","Omit","children","TextAreaRoot","t0","$","_c","size","props","textAreaProps","localProps","context","t1","qdsContext","mergedProps","getRootBindings","t2","t3","t4","ReactElement","ReactNode","useOptionalContentId","useControlledId","TextAreaCounter","TextAreaCounterProps","TextAreaErrorText","TextAreaErrorTextProps","TextAreaHint","TextAreaHintProps","TextAreaInput","TextAreaInputProps","TextAreaLabel","TextAreaLabelProps","TextAreaRoot","TextAreaRootProps","TextAreaProps","children","counter","counterProps","errorText","errorTextProps","hint","hintProps","inputProps","label","labelProps","maxLength","placeholder","TextArea","t0","$","_c","props","labelContent","errorTextContent","hintContent","t1","id","t2","t3","t4","t5","t6","ids","input","t7","t8","undefined","t9","t10","t11","t12","TextArea","SimpleTextArea","TextAreaCounter","TextAreaCounterProps","TextAreaErrorText","TextAreaErrorTextProps","TextAreaHint","TextAreaHintProps","TextAreaInput","TextAreaInputProps","TextAreaLabel","TextAreaLabelProps","TextAreaRoot","TextAreaRootProps","TextAreaComponent","Counter","ErrorText","Hint","Input","Label","Root"],"sources":["../../src/text-area/qds-text-area-context.ts","../../src/text-area/text-area-counter.tsx","../../src/text-area/text-area-error-text.tsx","../../src/text-area/text-area-hint.tsx","../../src/text-area/text-area-input.tsx","../../src/text-area/text-area-label.tsx","../../src/text-area/text-area-root.tsx","../../src/text-area/text-area.tsx","../../src/text-area/index.ts"],"sourcesContent":["// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {QdsTextAreaApi} from \"@qualcomm-ui/qds-core/text-area\"\nimport {createGuardedContext} from \"@qualcomm-ui/react-core/context\"\n\nexport const [QdsTextAreaContextProvider, useQdsTextAreaContext] =\n createGuardedContext<QdsTextAreaApi>({\n hookName: \"useQdsTextAreaContext\",\n providerName: \"<QdsTextAreaContextProvider>\",\n strict: true,\n })\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ReactElement, ReactNode} from \"react\"\n\nimport {\n type ElementRenderProp,\n PolymorphicElement,\n} from \"@qualcomm-ui/react-core/system\"\nimport {\n useTextAreaContext,\n useTextAreaCounter,\n} from \"@qualcomm-ui/react-core/text-area\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nimport {useQdsTextAreaContext} from \"./qds-text-area-context\"\n\nexport interface TextAreaCounterProps extends ElementRenderProp<\"div\"> {\n /**\n * Customize how the counter is displayed. Receives the current character\n * count and optional max length, and returns a React node.\n *\n * @example\n * // Display as \"42 of 100\"\n * display={(count, max) => max ? `${count} of ${max}` : count}\n */\n display?: (count: number, maxLength?: number) => ReactNode\n}\n\nfunction defaultDisplay(count: number, maxLength?: number): ReactNode {\n return maxLength != null ? `${count}/${maxLength}` : count\n}\n\n/**\n * Character counter displayed opposite the textarea label. Renders a `<div>`\n * element by default.\n */\nexport function TextAreaCounter({\n display = defaultDisplay,\n id,\n ...props\n}: TextAreaCounterProps): ReactElement {\n const contextProps = useTextAreaCounter({id})\n const qdsContext = useQdsTextAreaContext()\n\n const mergedProps = mergeProps(\n contextProps,\n qdsContext.getCounterBindings(),\n props,\n )\n\n const {maxLength, value} = useTextAreaContext()\n\n return (\n <PolymorphicElement as=\"div\" {...mergedProps}>\n {display(value.length, maxLength)}\n </PolymorphicElement>\n )\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ReactElement, ReactNode} from \"react\"\n\nimport {AlertCircle} from \"lucide-react\"\n\nimport {IconOrNode} from \"@qualcomm-ui/react/icon\"\nimport {\n type ElementRenderProp,\n PolymorphicElement,\n} from \"@qualcomm-ui/react-core/system\"\nimport {useTextAreaErrorText} from \"@qualcomm-ui/react-core/text-area\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nimport {useQdsTextAreaContext} from \"./qds-text-area-context\"\n\nexport interface TextAreaErrorTextProps extends ElementRenderProp<\"div\"> {\n /**\n * React {@link https://react.dev/learn/passing-props-to-a-component#passing-jsx-as-children children} prop.\n */\n children?: ReactNode\n}\n\n/**\n * Error message displayed when the textarea is invalid. Renders a `<div>` element by\n * default.\n */\nexport function TextAreaErrorText({\n children,\n id,\n ...props\n}: TextAreaErrorTextProps): ReactElement {\n const contextProps = useTextAreaErrorText({id})\n const qdsContext = useQdsTextAreaContext()\n\n const mergedProps = mergeProps(\n contextProps,\n qdsContext.getErrorTextBindings(),\n props,\n )\n\n return (\n <PolymorphicElement as=\"div\" {...mergedProps}>\n <IconOrNode icon={AlertCircle} />\n {children}\n </PolymorphicElement>\n )\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ReactElement, ReactNode} from \"react\"\n\nimport {\n type ElementRenderProp,\n PolymorphicElement,\n} from \"@qualcomm-ui/react-core/system\"\nimport {useTextAreaHint} from \"@qualcomm-ui/react-core/text-area\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nimport {useQdsTextAreaContext} from \"./qds-text-area-context\"\n\nexport interface TextAreaHintProps extends ElementRenderProp<\"div\"> {\n /**\n * React {@link https://react.dev/learn/passing-props-to-a-component#passing-jsx-as-children children} prop.\n */\n children?: ReactNode\n}\n\n/**\n * Helper text displayed below the textarea. Renders a `<div>` element by default.\n */\nexport function TextAreaHint({\n children,\n id,\n ...props\n}: TextAreaHintProps): ReactElement {\n const contextProps = useTextAreaHint({id})\n const qdsContext = useQdsTextAreaContext()\n\n const mergedProps = mergeProps(\n contextProps,\n qdsContext.getHintBindings(),\n props,\n )\n\n return (\n <PolymorphicElement as=\"div\" {...mergedProps}>\n {children}\n </PolymorphicElement>\n )\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ComponentPropsWithRef, ReactElement} from \"react\"\n\nimport type {IdProp} from \"@qualcomm-ui/react-core/system\"\nimport {useTextAreaInput} from \"@qualcomm-ui/react-core/text-area\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nimport {useQdsTextAreaContext} from \"./qds-text-area-context\"\n\nexport interface TextAreaInputProps\n extends ComponentPropsWithRef<\"textarea\">, IdProp {}\n\n/**\n * The text area element. Renders a `<textarea>` element.\n */\nexport function TextAreaInput({\n id,\n ...props\n}: TextAreaInputProps): ReactElement {\n const contextProps = useTextAreaInput({id})\n const qdsContext = useQdsTextAreaContext()\n\n const mergedProps = mergeProps(\n contextProps,\n qdsContext.getInputBindings(),\n props,\n )\n\n return <textarea {...mergedProps} />\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ReactElement, ReactNode} from \"react\"\n\nimport {Asterisk} from \"lucide-react\"\n\nimport {Icon} from \"@qualcomm-ui/react/icon\"\nimport {\n type ElementRenderProp,\n PolymorphicElement,\n} from \"@qualcomm-ui/react-core/system\"\nimport {\n useTextAreaContext,\n useTextAreaLabel,\n} from \"@qualcomm-ui/react-core/text-area\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nimport {useQdsTextAreaContext} from \"./qds-text-area-context\"\n\nexport interface TextAreaLabelProps extends ElementRenderProp<\"label\"> {\n /**\n * React {@link https://react.dev/learn/passing-props-to-a-component#passing-jsx-as-children children} prop.\n */\n children?: ReactNode\n}\n\n/**\n * An accessible label that is automatically associated with the input. Renders a\n * `<label>` element by default.\n */\nexport function TextAreaLabel({\n children,\n id,\n ...props\n}: TextAreaLabelProps): ReactElement {\n const contextProps = useTextAreaLabel({id})\n const qdsContext = useQdsTextAreaContext()\n\n const mergedProps = mergeProps(\n contextProps,\n qdsContext.getLabelBindings(),\n props,\n )\n\n const {required} = useTextAreaContext()\n\n return (\n <PolymorphicElement as=\"label\" {...mergedProps}>\n {children}\n {required ? (\n <Icon\n {...qdsContext.getRequiredIndicatorBindings()}\n icon={Asterisk}\n size=\"xs\"\n />\n ) : null}\n </PolymorphicElement>\n )\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {type ReactElement, type ReactNode, useMemo} from \"react\"\n\nimport {\n splitTextAreaProps,\n type TextAreaApiProps,\n} from \"@qualcomm-ui/core/text-area\"\nimport {\n createQdsTextAreaApi,\n type QdsTextAreaApiProps,\n} from \"@qualcomm-ui/qds-core/text-area\"\nimport {normalizeProps} from \"@qualcomm-ui/react-core/machine\"\nimport {\n type ElementRenderProp,\n PolymorphicElement,\n} from \"@qualcomm-ui/react-core/system\"\nimport {\n TextAreaContextProvider,\n useTextArea,\n} from \"@qualcomm-ui/react-core/text-area\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nimport {QdsTextAreaContextProvider} from \"./qds-text-area-context\"\n\nexport interface TextAreaRootProps\n extends\n TextAreaApiProps,\n QdsTextAreaApiProps,\n Omit<ElementRenderProp<\"div\">, \"dir\" | \"defaultValue\"> {\n /**\n * React {@link https://react.dev/learn/passing-props-to-a-component#passing-jsx-as-children children} prop.\n */\n children?: ReactNode\n}\n\n/**\n * Groups all parts of the text-area. Renders a `<div>` element by default.\n */\nexport function TextAreaRoot({\n children,\n size,\n ...props\n}: TextAreaRootProps): ReactElement {\n const [textAreaProps, localProps] = splitTextAreaProps(props)\n const context = useTextArea(textAreaProps)\n\n const qdsContext = useMemo(\n () => createQdsTextAreaApi({size}, normalizeProps),\n [size],\n )\n\n const mergedProps = mergeProps(\n context.getRootBindings(),\n qdsContext.getRootBindings(),\n localProps,\n )\n\n return (\n <TextAreaContextProvider value={context}>\n <QdsTextAreaContextProvider value={qdsContext}>\n <PolymorphicElement as=\"div\" {...mergedProps}>\n {children}\n </PolymorphicElement>\n </QdsTextAreaContextProvider>\n </TextAreaContextProvider>\n )\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ReactElement, ReactNode} from \"react\"\n\nimport {useOptionalContentId} from \"@qualcomm-ui/react-core/machine\"\nimport {useControlledId} from \"@qualcomm-ui/react-core/state\"\n\nimport {TextAreaCounter, type TextAreaCounterProps} from \"./text-area-counter\"\nimport {\n TextAreaErrorText,\n type TextAreaErrorTextProps,\n} from \"./text-area-error-text\"\nimport {TextAreaHint, type TextAreaHintProps} from \"./text-area-hint\"\nimport {TextAreaInput, type TextAreaInputProps} from \"./text-area-input\"\nimport {TextAreaLabel, type TextAreaLabelProps} from \"./text-area-label\"\nimport {TextAreaRoot, type TextAreaRootProps} from \"./text-area-root\"\n\nexport interface TextAreaProps extends TextAreaRootProps {\n /**\n * The simple TextArea doesn't support children.\n */\n children?: never\n\n /**\n * Controls whether to display the counter element.\n *\n * - `true`: always show the counter\n * - `false`: never show the counter\n * - `undefined` (default): only show the counter if `maxLength` is set\n */\n counter?: boolean\n\n /**\n * Props applied to the counter element.\n */\n counterProps?: TextAreaCounterProps\n\n /**\n * Optional error that describes the element when {@link invalid} is true.\n */\n errorText?: string\n\n /**\n * Props applied to the error text element.\n */\n errorTextProps?: TextAreaErrorTextProps\n\n /**\n * Optional hint describing the element. This element is automatically\n * associated with the component's textarea element for accessibility.\n */\n hint?: ReactNode\n\n /**\n * Props applied to the hint element.\n */\n hintProps?: TextAreaHintProps\n\n /**\n * Props applied to the textarea element.\n */\n inputProps?: TextAreaInputProps\n\n /**\n * Optional label describing the element. Recommended. This element is\n * automatically associated with the component's input element for\n * accessibility.\n */\n label?: ReactNode\n\n /**\n * Props applied to the label element.\n */\n labelProps?: TextAreaLabelProps\n\n /**\n * HTML {@link https://www.w3schools.com/tags/att_input_maxlength.asp maxlength} attribute,\n * passed to the underlying textarea element.\n */\n maxLength?: number\n\n /**\n * HTML {@link https://www.w3schools.com/tags/att_input_placeholder.asp placeholder} attribute,\n * passed to the underlying textarea element.\n */\n placeholder?: string\n}\n\nexport function TextArea({\n counter,\n counterProps,\n errorText,\n errorTextProps,\n hint,\n hintProps,\n inputProps,\n label,\n labelProps,\n maxLength,\n placeholder,\n ...props\n}: TextAreaProps): ReactElement {\n const labelContent = label || labelProps?.children\n const errorTextContent = errorText || errorTextProps?.children\n const hintContent = hint || hintProps?.children\n\n const ids = {\n counter: useControlledId(counterProps?.id),\n errorText: useOptionalContentId(errorTextContent, errorTextProps),\n hint: useOptionalContentId(hintContent, hintProps),\n input: useControlledId(inputProps?.id),\n label: useOptionalContentId(labelContent, labelProps),\n ...props.ids,\n }\n\n return (\n <TextAreaRoot {...props} ids={ids} maxLength={maxLength}>\n {labelContent ? (\n <TextAreaLabel {...labelProps} id={ids.label}>\n {labelContent}\n </TextAreaLabel>\n ) : null}\n\n {(counter ?? maxLength !== undefined) ? (\n <TextAreaCounter {...counterProps} />\n ) : null}\n\n <TextAreaInput\n maxLength={maxLength}\n placeholder={placeholder}\n {...inputProps}\n id={ids.input}\n />\n\n {hintContent ? (\n <TextAreaHint {...hintProps} id={ids.hint}>\n {hintContent}\n </TextAreaHint>\n ) : null}\n\n {errorTextContent ? (\n <TextAreaErrorText {...errorTextProps} id={ids.errorText}>\n {errorTextContent}\n </TextAreaErrorText>\n ) : null}\n </TextAreaRoot>\n )\n}\n","import {TextArea as SimpleTextArea} from \"./text-area\"\nimport {TextAreaCounter, type TextAreaCounterProps} from \"./text-area-counter\"\nimport {\n TextAreaErrorText,\n type TextAreaErrorTextProps,\n} from \"./text-area-error-text\"\nimport {TextAreaHint, type TextAreaHintProps} from \"./text-area-hint\"\nimport {TextAreaInput, type TextAreaInputProps} from \"./text-area-input\"\nimport {TextAreaLabel, type TextAreaLabelProps} from \"./text-area-label\"\nimport {TextAreaRoot, type TextAreaRootProps} from \"./text-area-root\"\n\nexport type {\n TextAreaRootProps,\n TextAreaLabelProps,\n TextAreaInputProps,\n TextAreaHintProps,\n TextAreaErrorTextProps,\n TextAreaCounterProps,\n}\n\ntype TextAreaComponent = typeof SimpleTextArea & {\n /**\n * Character counter displayed opposite the textarea label. Renders a `<div>`\n * element by default.\n */\n Counter: typeof TextAreaCounter\n /**\n * Error message displayed when the textarea is invalid. Renders a `<div>` element\n * by default.\n */\n ErrorText: typeof TextAreaErrorText\n /**\n * Helper text displayed below the textarea. Renders a `<div>` element by default.\n */\n Hint: typeof TextAreaHint\n /**\n * The text area element. Renders a `<textarea>` element.\n */\n Input: typeof TextAreaInput\n /**\n * An accessible label that is automatically associated with the input. Renders a\n * `<label>` element by default.\n */\n Label: typeof TextAreaLabel\n /**\n * Groups all parts of the text-area. Renders a `<div>` element by default.\n */\n Root: typeof TextAreaRoot\n}\n\nexport const TextArea: TextAreaComponent = SimpleTextArea as TextAreaComponent\n\nTextArea.Counter = TextAreaCounter\nTextArea.ErrorText = TextAreaErrorText\nTextArea.Hint = TextAreaHint\nTextArea.Input = TextAreaInput\nTextArea.Label = TextAreaLabel\nTextArea.Root = TextAreaRoot\n"],"mappings":"m8BAMA,GAAa,CAACE,EAA4BC,GACxCF,EAAqC,CACnCG,SAAU,wBACVC,aAAc,+BACdC,OAAQ,GAC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,CAAA,CAJP,KAIOJ,EAAA,IAAAI,EAAAJ,EAAA,IAAAV,EAAAU,EAAA,IAAAa,EAAAxB,UAAAW,EAAA,IAAAoB,GAAAA,EAAApB,EAAA,IAAA,IAAAqB,EACK,OADLrB,EAAA,MAAAa,GAAAb,EAAA,MAAAJ,GAAAI,EAAA,MAAAE,GAAAF,EAAA,MAAAmB,GAAAnB,EAAA,MAAAoB,GAAApB,EAAA,MAAAe,GAAAf,EAAA,MAAAgB,GAAAhB,EAAA,MAAAkB,GA5BVG,EAAA,EAAC,aAAD,CAAa,GAAKnB,EAAYW,MAAgBjB,qBAA9C,CACGmB,EAMAC,EAIDE,EAOCC,EAMAC,EAKY,GAAApB,EAAA,IAAAa,EAAAb,EAAA,IAAAJ,EAAAI,EAAA,IAAAE,EAAAF,EAAA,IAAAmB,EAAAnB,EAAA,IAAAoB,EAAApB,EAAA,IAAAe,EAAAf,EAAA,IAAAgB,EAAAhB,EAAA,IAAAkB,EAAAlB,EAAA,IAAAqB,GAAAA,EAAArB,EAAA,IA7BfqB,ECnEJ,IAAaC,EAA8BC,WAE3CD,EAASe,QAAUb,gBACnBF,EAASgB,UAAYZ,kBACrBJ,EAASiB,KAAOX,aAChBN,EAASkB,MAAQV,cACjBR,EAASmB,MAAQT,cACjBV,EAASoB,KAAOR"}
|
package/dist/text-input/index.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use client;";import{c as e}from"react/compiler-runtime";import{mergeProps as t}from"@qualcomm-ui/utils/merge-props";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{PolymorphicElement as i}from"@qualcomm-ui/react-core/system";import{X as a}from"lucide-react";import"react";import{normalizeProps as o,useOptionalContentId as s}from"@qualcomm-ui/react-core/machine";import{useControlledId as c}from"@qualcomm-ui/react-core/state";import{InputEndIcon as l,InputErrorIndicator as u,InputErrorText as d,InputHint as f,InputLabel as p,InputStartIcon as m,QdsInputContextProvider as h,useQdsInputContext as g}from"@qualcomm-ui/react/input";import{InlineIconButton as _}from"@qualcomm-ui/react/inline-icon-button";import{createQdsInputApi as v}from"@qualcomm-ui/qds-core/input";import{TextInputContextProvider as y,useTextInput as b,useTextInputClearTrigger as x,useTextInputContext as S,useTextInputErrorText as C,useTextInputHint as w,useTextInputInput as T,useTextInputInputGroup as E,useTextInputLabel as D}from"@qualcomm-ui/react-core/text-input";import{splitTextInputProps as O}from"@qualcomm-ui/core/text-input";function TextInputClearTrigger(r){let i=e(7),o=x(),s=g(),c;i[0]!==o||i[1]!==r||i[2]!==s?(c=t(o,s.getClearTriggerBindings(),r),i[0]=o,i[1]=r,i[2]=s,i[3]=c):c=i[3];let l=c,u;return i[4]!==l||i[5]!==s.size?(u=n(_,{icon:a,size:s.size,variant:`scale`,...l}),i[4]=l,i[5]=s.size,i[6]=u):u=i[6],u}function TextInputErrorIndicator(r){let i=e(5),a=S(),o;i[0]!==a||i[1]!==r?(o=t(a.getErrorIndicatorBindings(),r),i[0]=a,i[1]=r,i[2]=o):o=i[2];let s=o,c;return i[3]===s?c=i[4]:(c=n(u,{...s}),i[3]=s,i[4]=c),c}function TextInputErrorText(r){let i=e(5),{children:a,id:o,...s}=r,c;i[0]===o?c=i[1]:(c={id:o},i[0]=o,i[1]=c);let l=t(C(c),s),u;return i[2]!==a||i[3]!==l?(u=n(d,{...l,children:a}),i[2]=a,i[3]=l,i[4]=u):u=i[4],u}function TextInputHint(r){let i=e(5),{children:a,id:o,...s}=r,c;i[0]===o?c=i[1]:(c={id:o},i[0]=o,i[1]=c);let l=t(w(c),s),u;return i[2]!==a||i[3]!==l?(u=n(f,{...l,children:a}),i[2]=a,i[3]=l,i[4]=u):u=i[4],u}function TextInputInput(r){let i=e(4),{id:a,...o}=r,s;i[0]===a?s=i[1]:(s={id:a},i[0]=a,i[1]=s);let c=t(T(s),g().getInputBindings(),o),l;return i[2]===c?l=i[3]:(l=n(`input`,{...c}),i[2]=c,i[3]=l),l}function TextInputInputGroup(a){let o=e(9),{children:s,...c}=a,u=g(),d=t(E(),u.getGroupBindings(),c),f;o[0]===u.startIcon?f=o[1]:(f=u.startIcon?n(m,{icon:u.startIcon}):null,o[0]=u.startIcon,o[1]=f);let p;o[2]===u.endIcon?p=o[3]:(p=u.endIcon?n(l,{icon:u.endIcon}):null,o[2]=u.endIcon,o[3]=p);let h;return o[4]!==s||o[5]!==d||o[6]!==f||o[7]!==p?(h=r(i,{as:`div`,...d,children:[f,s,p]}),o[4]=s,o[5]=d,o[6]=f,o[7]=p,o[8]=h):h=o[8],h}function TextInputLabel(r){let i=e(5),{id:a,...o}=r,s;i[0]===a?s=i[1]:(s={id:a},i[0]=a,i[1]=s);let c=D(s),l=S(),u=t(c,o),d;return i[2]!==u||i[3]!==l.required?(d=n(p,{required:l.required,...u}),i[2]=u,i[3]=l.required,i[4]=d):d=i[4],d}function TextInputRoot(r){let a=e(13),{children:s,endIcon:c,size:l,startIcon:u,...d}=r,[f,p]=O(d),m=b(f),g;a[0]!==c||a[1]!==l||a[2]!==u?(g=v({endIcon:c,size:l,startIcon:u},o),a[0]=c,a[1]=l,a[2]=u,a[3]=g):g=a[3];let _=g,x=t(m.getRootBindings(),_.getRootBindings(),p),S;a[4]!==s||a[5]!==x?(S=n(i,{as:`div`,...x,children:s}),a[4]=s,a[5]=x,a[6]=S):S=a[6];let C;a[7]!==_||a[8]!==S?(C=n(h,{value:_,children:S}),a[7]=_,a[8]=S,a[9]=C):C=a[9];let w;return a[10]!==m||a[11]!==C?(w=n(y,{value:m,children:C}),a[10]=m,a[11]=C,a[12]=w):w=a[12],w}function TextInput$1(t){let i=e(59),a,o,l,u,d,f,p,m,h,g,_,v,y,b,x;i[0]===t?(a=i[1],o=i[2],l=i[3],u=i[4],d=i[5],f=i[6],p=i[7],m=i[8],h=i[9],g=i[10],_=i[11],v=i[12],y=i[13],b=i[14],x=i[15]):({"aria-label":a,"aria-labelledby":o,clearable:x,clearTriggerProps:l,errorIndicatorProps:u,errorText:d,errorTextProps:f,hint:p,hintProps:m,inputGroupProps:h,inputProps:g,label:_,labelProps:v,placeholder:y,...b}=t,i[0]=t,i[1]=a,i[2]=o,i[3]=l,i[4]=u,i[5]=d,i[6]=f,i[7]=p,i[8]=m,i[9]=h,i[10]=g,i[11]=_,i[12]=v,i[13]=y,i[14]=b,i[15]=x);let S=x===void 0?!0:x,C=_||v?.children,w=d||f?.children,T=p||m?.children,E;i[16]!==a||i[17]!==o||i[18]!==g?(E={...g},a!==void 0&&(E[`aria-label`]=a),o!==void 0&&(E[`aria-labelledby`]=o),i[16]=a,i[17]=o,i[18]=g,i[19]=E):E=i[19];let D=s(w,f),O=s(T,m),k=c(E?.id),A=s(C,v),j;i[20]!==b.ids||i[21]!==D||i[22]!==O||i[23]!==k||i[24]!==A?(j={errorText:D,hint:O,input:k,label:A,...b.ids},i[20]=b.ids,i[21]=D,i[22]=O,i[23]=k,i[24]=A,i[25]=j):j=i[25];let M=j,N;i[26]!==M.label||i[27]!==C||i[28]!==v?(N=C?n(TextInputLabel,{...v,id:M.label,children:C}):null,i[26]=M.label,i[27]=C,i[28]=v,i[29]=N):N=i[29];let P;i[30]!==M.input||i[31]!==E||i[32]!==y?(P=n(TextInputInput,{placeholder:y,...E,id:M.input}),i[30]=M.input,i[31]=E,i[32]=y,i[33]=P):P=i[33];let F;i[34]!==l||i[35]!==S?(F=S?n(TextInputClearTrigger,{...l}):null,i[34]=l,i[35]=S,i[36]=F):F=i[36];let I;i[37]===u?I=i[38]:(I=n(TextInputErrorIndicator,{...u}),i[37]=u,i[38]=I);let L;i[39]!==h||i[40]!==I||i[41]!==P||i[42]!==F?(L=r(TextInputInputGroup,{...h,children:[P,F,I]}),i[39]=h,i[40]=I,i[41]=P,i[42]=F,i[43]=L):L=i[43];let R;i[44]!==T||i[45]!==m||i[46]!==M.hint?(R=T?n(TextInputHint,{...m,id:M.hint,children:T}):null,i[44]=T,i[45]=m,i[46]=M.hint,i[47]=R):R=i[47];let z;i[48]!==w||i[49]!==f||i[50]!==M.errorText?(z=w?n(TextInputErrorText,{...f,id:M.errorText,children:w}):null,i[48]=w,i[49]=f,i[50]=M.errorText,i[51]=z):z=i[51];let B;return i[52]!==M||i[53]!==b||i[54]!==L||i[55]!==R||i[56]!==z||i[57]!==N?(B=r(TextInputRoot,{...b,ids:M,children:[N,L,R,z]}),i[52]=M,i[53]=b,i[54]=L,i[55]=R,i[56]=z,i[57]=N,i[58]=B):B=i[58],B}var k=TextInput$1;k.ClearTrigger=TextInputClearTrigger,k.ErrorIndicator=TextInputErrorIndicator,k.ErrorText=TextInputErrorText,k.Hint=TextInputHint,k.InputGroup=TextInputInputGroup,k.Input=TextInputInput,k.Label=TextInputLabel,k.Root=TextInputRoot;export{k as TextInput};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/text-input/text-input.tsx", "../../src/text-input/text-input-clear-trigger.tsx", "../../src/text-input/text-input-error-indicator.tsx", "../../src/text-input/text-input-error-text.tsx", "../../src/text-input/text-input-hint.tsx", "../../src/text-input/text-input-input.tsx", "../../src/text-input/text-input-input-group.tsx", "../../src/text-input/text-input-label.tsx", "../../src/text-input/text-input-root.tsx", "../../src/text-input/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 { TextInputClearTrigger } from \"./text-input-clear-trigger\";\nimport { TextInputErrorIndicator } from \"./text-input-error-indicator\";\nimport { TextInputErrorText } from \"./text-input-error-text\";\nimport { TextInputHint } from \"./text-input-hint\";\nimport { TextInputInput } from \"./text-input-input\";\nimport { TextInputInputGroup } from \"./text-input-input-group\";\nimport { TextInputLabel } from \"./text-input-label\";\nimport { TextInputRoot } from \"./text-input-root\";\nexport function TextInput(t0) {\n const {\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n clearable: t1,\n clearTriggerProps,\n errorIndicatorProps,\n errorText,\n errorTextProps,\n hint,\n hintProps,\n inputGroupProps,\n inputProps: inputPropsProp,\n label,\n labelProps,\n placeholder,\n ...props\n } = t0;\n const clearable = t1 === undefined ? true : t1;\n const labelContent = label || labelProps?.children;\n const errorTextContent = errorText || errorTextProps?.children;\n const hintContent = hint || hintProps?.children;\n const inputProps = {\n ...inputPropsProp\n };\n if (ariaLabel !== void 0) {\n inputProps[\"aria-label\"] = ariaLabel;\n }\n if (ariaLabelledBy !== void 0) {\n inputProps[\"aria-labelledby\"] = ariaLabelledBy;\n }\n const ids = {\n errorText: useOptionalContentId(errorTextContent, errorTextProps),\n hint: useOptionalContentId(hintContent, hintProps),\n input: useControlledId(inputProps?.id),\n label: useOptionalContentId(labelContent, labelProps),\n ...props.ids\n };\n return jsxs(TextInputRoot, {\n ...props,\n ids,\n children: [labelContent ? jsx(TextInputLabel, {\n ...labelProps,\n id: ids.label,\n children: labelContent\n }) : null, jsxs(TextInputInputGroup, {\n ...inputGroupProps,\n children: [jsx(TextInputInput, {\n placeholder,\n ...inputProps,\n id: ids.input\n }), clearable ? jsx(TextInputClearTrigger, {\n ...clearTriggerProps\n }) : null, jsx(TextInputErrorIndicator, {\n ...errorIndicatorProps\n })]\n }), hintContent ? jsx(TextInputHint, {\n ...hintProps,\n id: ids.hint,\n children: hintContent\n }) : null, errorTextContent ? jsx(TextInputErrorText, {\n ...errorTextProps,\n id: ids.errorText,\n children: errorTextContent\n }) : null]\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { X } from \"lucide-react\";\nimport { InlineIconButton } from \"@qualcomm-ui/react/inline-icon-button\";\nimport { useQdsInputContext } from \"@qualcomm-ui/react/input\";\nimport { useTextInputClearTrigger } from \"@qualcomm-ui/react-core/text-input\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nexport function TextInputClearTrigger(props) {\n const $ = _c(4);\n const contextProps = useTextInputClearTrigger();\n const qdsContext = useQdsInputContext();\n let t0;\n if ($[0] !== contextProps || $[1] !== props || $[2] !== qdsContext) {\n const mergedProps = mergeProps(contextProps, qdsContext.getClearTriggerBindings(), props);\n t0 = jsx(InlineIconButton, {\n icon: X,\n size: qdsContext.size,\n variant: \"scale\",\n ...mergedProps\n });\n $[0] = contextProps;\n $[1] = props;\n $[2] = qdsContext;\n $[3] = t0;\n } else {\n t0 = $[3];\n }\n return t0;\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { InputErrorIndicator } from \"@qualcomm-ui/react/input\";\nimport { useTextInputContext } from \"@qualcomm-ui/react-core/text-input\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nexport function TextInputErrorIndicator(props) {\n const $ = _c(3);\n const context = useTextInputContext();\n let t0;\n if ($[0] !== context || $[1] !== props) {\n const mergedProps = mergeProps(context.getErrorIndicatorBindings(), props);\n t0 = jsx(InputErrorIndicator, {\n ...mergedProps\n });\n $[0] = context;\n $[1] = props;\n $[2] = t0;\n } else {\n t0 = $[2];\n }\n return t0;\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { InputErrorText } from \"@qualcomm-ui/react/input\";\nimport { useTextInputErrorText } from \"@qualcomm-ui/react-core/text-input\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nexport function TextInputErrorText(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 = useTextInputErrorText(t1);\n const mergedProps = mergeProps(contextProps, props);\n return jsx(InputErrorText, {\n ...mergedProps,\n children\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { InputHint } from \"@qualcomm-ui/react/input\";\nimport { useTextInputHint } from \"@qualcomm-ui/react-core/text-input\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nexport function TextInputHint(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 = useTextInputHint(t1);\n const mergedProps = mergeProps(contextProps, 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 { useQdsInputContext } from \"@qualcomm-ui/react/input\";\nimport { useTextInputInput } from \"@qualcomm-ui/react-core/text-input\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nexport function TextInputInput(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 = useTextInputInput(t1);\n const qdsContext = useQdsInputContext();\n const mergedProps = mergeProps(contextProps, qdsContext.getInputBindings(), props);\n return jsx(\"input\", {\n ...mergedProps\n });\n}", "import { jsx, jsxs } from \"react/jsx-runtime\";\nimport { InputEndIcon, InputStartIcon, useQdsInputContext } from \"@qualcomm-ui/react/input\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { useTextInputInputGroup } from \"@qualcomm-ui/react-core/text-input\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nexport function TextInputInputGroup(t0) {\n const {\n children,\n ...props\n } = t0;\n const qdsContext = useQdsInputContext();\n const contextProps = useTextInputInputGroup();\n const mergedProps = mergeProps(contextProps, qdsContext.getGroupBindings(), props);\n return jsxs(PolymorphicElement, {\n as: \"div\",\n ...mergedProps,\n children: [qdsContext.startIcon ? jsx(InputStartIcon, {\n icon: qdsContext.startIcon\n }) : null, children, qdsContext.endIcon ? jsx(InputEndIcon, {\n icon: qdsContext.endIcon\n }) : null]\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { InputLabel } from \"@qualcomm-ui/react/input\";\nimport { useTextInputContext, useTextInputLabel } from \"@qualcomm-ui/react-core/text-input\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nexport function TextInputLabel(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 = useTextInputLabel(t1);\n const textInputContext = useTextInputContext();\n const mergedProps = mergeProps(contextProps, props);\n return jsx(InputLabel, {\n required: textInputContext.required,\n ...mergedProps\n });\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { useMemo } from \"react\";\nimport { splitTextInputProps } from \"@qualcomm-ui/core/text-input\";\nimport { createQdsInputApi } from \"@qualcomm-ui/qds-core/input\";\nimport { QdsInputContextProvider } from \"@qualcomm-ui/react/input\";\nimport { normalizeProps } from \"@qualcomm-ui/react-core/machine\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { TextInputContextProvider, useTextInput } from \"@qualcomm-ui/react-core/text-input\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nexport function TextInputRoot(t0) {\n const $ = _c(4);\n const {\n children,\n endIcon,\n size,\n startIcon,\n ...props\n } = t0;\n const [textInputProps, localProps] = splitTextInputProps(props);\n const context = useTextInput(textInputProps);\n let t1;\n if ($[0] !== endIcon || $[1] !== size || $[2] !== startIcon) {\n t1 = createQdsInputApi({\n endIcon,\n size,\n startIcon\n }, normalizeProps);\n $[0] = endIcon;\n $[1] = size;\n $[2] = startIcon;\n $[3] = t1;\n } else {\n t1 = $[3];\n }\n const qdsContext = t1;\n const mergedProps = mergeProps(context.getRootBindings(), qdsContext.getRootBindings(), localProps);\n return jsx(TextInputContextProvider, {\n value: context,\n children: jsx(QdsInputContextProvider, {\n value: qdsContext,\n children: jsx(PolymorphicElement, {\n as: \"div\",\n ...mergedProps,\n children\n })\n })\n });\n}", "import { TextInput as SimpleTextInput } from \"./text-input\";\nimport { TextInputClearTrigger } from \"./text-input-clear-trigger\";\nimport { TextInputErrorIndicator } from \"./text-input-error-indicator\";\nimport { TextInputErrorText } from \"./text-input-error-text\";\nimport { TextInputHint } from \"./text-input-hint\";\nimport { TextInputInput } from \"./text-input-input\";\nimport { TextInputInputGroup } from \"./text-input-input-group\";\nimport { TextInputLabel } from \"./text-input-label\";\nimport { TextInputRoot } from \"./text-input-root\";\nexport const TextInput = SimpleTextInput;\nTextInput.ClearTrigger = TextInputClearTrigger;\nTextInput.ErrorIndicator = TextInputErrorIndicator;\nTextInput.ErrorText = TextInputErrorText;\nTextInput.Hint = TextInputHint;\nTextInput.InputGroup = TextInputInputGroup;\nTextInput.Input = TextInputInput;\nTextInput.Label = TextInputLabel;\nTextInput.Root = TextInputRoot;"],
|
|
5
|
-
"mappings": ";AAAA,OAAS,OAAAA,KAAK,QAAAC,UAAY,oBAC1B,OAAS,yBAA4B,kCACrC,OAAS,oBAAuB,gCCFhC,OAAS,KAAK,OAAU,yBACxB,OAAS,QAAW,oBACpB,OAAS,MAAS,eAClB,OAAS,qBAAwB,wCACjC,OAAS,uBAA0B,2BACnC,OAAS,6BAAgC,qCACzC,OAAS,eAAkB,iCACpB,SAAS,sBAAsB,MAAO,CAC3C,IAAM,EAAI,GAAG,CAAC,EACR,aAAe,yBAAyB,EACxC,WAAa,mBAAmB,EAClC,GACJ,GAAI,EAAE,CAAC,IAAM,cAAgB,EAAE,CAAC,IAAM,OAAS,EAAE,CAAC,IAAM,WAAY,CAClE,IAAM,YAAc,WAAW,aAAc,WAAW,wBAAwB,EAAG,KAAK,EACxF,GAAK,IAAI,iBAAkB,CACzB,KAAM,EACN,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AyB,CACtC,GAAG,mBACL,CAAC,CAAC,CACJ,CAAC,EAAG,YAAcA,KAAI,cAAe,CACnC,GAAG,UACH,GAAI,IAAI,KACR,SAAU,WACZ,CAAC,EAAI,KAAM,iBAAmBA,KAAI,mBAAoB,CACpD,GAAG,eACH,GAAI,IAAI,UACR,SAAU,gBACZ,CAAC,EAAI,IAAI,CACX,CAAC,CACH,CSpEO,IAAMC,WAAY,UACzBA,WAAU,aAAe,sBACzBA,WAAU,eAAiB,wBAC3BA,WAAU,UAAY,mBACtBA,WAAU,KAAO,cACjBA,WAAU,WAAa,oBACvBA,WAAU,MAAQ,eAClBA,WAAU,MAAQ,eAClBA,WAAU,KAAO",
|
|
6
|
-
"names": ["jsx", "jsxs", "_c", "jsx", "mergeProps", "_c", "jsx", "mergeProps", "_c", "jsx", "mergeProps", "_c", "jsx", "useQdsInputContext", "mergeProps", "jsx", "useQdsInputContext", "mergeProps", "_c", "jsx", "useTextInputContext", "mergeProps", "_c", "jsx", "PolymorphicElement", "mergeProps", "jsxs", "jsx", "TextInput"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ReactElement","X","InlineIconButton","useQdsInputContext","ElementRenderProp","useTextInputClearTrigger","mergeProps","TextInputClearTriggerProps","TextInputClearTrigger","props","$","_c","contextProps","qdsContext","t0","getClearTriggerBindings","mergedProps","t1","size","ReactElement","InputErrorIndicator","InputErrorIndicatorProps","useTextInputContext","mergeProps","TextInputErrorIndicatorProps","TextInputErrorIndicator","props","$","_c","context","t0","getErrorIndicatorBindings","mergedProps","t1","ReactElement","InputErrorText","InputErrorTextProps","useTextInputErrorText","mergeProps","TextInputErrorTextProps","TextInputErrorText","t0","$","_c","children","id","props","t1","contextProps","mergedProps","t2","ReactElement","InputHint","InputHintProps","useTextInputHint","mergeProps","TextInputHintProps","TextInputHint","t0","$","_c","children","id","props","t1","contextProps","mergedProps","t2","ComponentPropsWithRef","ReactElement","useQdsInputContext","IdProp","useTextInputInput","ComponentDataAttributes","mergeProps","TextInputInputProps","TextInputInput","t0","$","_c","id","props","t1","contextProps","qdsContext","mergedProps","getInputBindings","t2","ReactElement","ReactNode","InputEndIcon","InputStartIcon","useQdsInputContext","ElementRenderProp","PolymorphicElement","useTextInputInputGroup","mergeProps","TextInputInputGroupProps","children","TextInputInputGroup","t0","$","_c","props","qdsContext","contextProps","mergedProps","getGroupBindings","t1","startIcon","t2","endIcon","t3","ReactElement","ReactNode","InputLabel","ElementRenderProp","useTextInputContext","useTextInputLabel","mergeProps","TextInputLabelProps","children","TextInputLabel","t0","$","_c","id","props","t1","contextProps","textInputContext","mergedProps","t2","required","ReactElement","ReactNode","useMemo","splitTextInputProps","TextInputApiProps","createQdsInputApi","QdsInputContextProvider","QdsReactInputApiProps","normalizeProps","ElementRenderProp","PolymorphicElement","TextInputContextProvider","useTextInput","mergeProps","TextInputRootProps","Omit","children","TextInputRoot","t0","$","_c","endIcon","size","startIcon","props","textInputProps","localProps","context","t1","qdsContext","mergedProps","getRootBindings","t2","t3","t4","ReactElement","ReactNode","LucideIconOrElement","useOptionalContentId","useControlledId","TextInputClearTrigger","TextInputClearTriggerProps","TextInputErrorIndicator","TextInputErrorIndicatorProps","TextInputErrorText","TextInputErrorTextProps","TextInputHint","TextInputHintProps","TextInputInput","TextInputInputProps","TextInputInputGroup","TextInputInputGroupProps","TextInputLabel","TextInputLabelProps","TextInputRoot","TextInputRootProps","TextInputProps","children","clearable","clearTriggerProps","endIcon","errorIndicatorProps","errorText","errorTextProps","hint","hintProps","inputGroupProps","inputProps","label","labelProps","placeholder","startIcon","TextInput","t0","$","_c","ariaLabel","ariaLabelledBy","inputPropsProp","props","t1","undefined","labelContent","errorTextContent","hintContent","t2","t3","t4","id","t5","t6","ids","input","t7","t8","t9","t10","t11","t12","t13","t14","TextInput","SimpleTextInput","TextInputProps","TextInputClearTrigger","TextInputClearTriggerProps","TextInputErrorIndicator","TextInputErrorIndicatorProps","TextInputErrorText","TextInputErrorTextProps","TextInputHint","TextInputHintProps","TextInputInput","TextInputInputProps","TextInputInputGroup","TextInputInputGroupProps","TextInputLabel","TextInputLabelProps","TextInputRoot","TextInputRootProps","TextInputComponent","ClearTrigger","ErrorIndicator","ErrorText","Hint","Input","InputGroup","Label","Root"],"sources":["../../src/text-input/text-input-clear-trigger.tsx","../../src/text-input/text-input-error-indicator.tsx","../../src/text-input/text-input-error-text.tsx","../../src/text-input/text-input-hint.tsx","../../src/text-input/text-input-input.tsx","../../src/text-input/text-input-input-group.tsx","../../src/text-input/text-input-label.tsx","../../src/text-input/text-input-root.tsx","../../src/text-input/text-input.tsx","../../src/text-input/index.ts"],"sourcesContent":["// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ReactElement} from \"react\"\n\nimport {X} from \"lucide-react\"\n\nimport {InlineIconButton} from \"@qualcomm-ui/react/inline-icon-button\"\nimport {useQdsInputContext} from \"@qualcomm-ui/react/input\"\nimport type {ElementRenderProp} from \"@qualcomm-ui/react-core/system\"\nimport {useTextInputClearTrigger} from \"@qualcomm-ui/react-core/text-input\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nexport interface TextInputClearTriggerProps extends ElementRenderProp<\"button\"> {}\n\n/**\n * Button that clears the input value. Renders a `<button>` element by default.\n */\nexport function TextInputClearTrigger(\n props: TextInputClearTriggerProps,\n): ReactElement {\n const contextProps = useTextInputClearTrigger()\n const qdsContext = useQdsInputContext()\n const mergedProps = mergeProps(\n contextProps,\n qdsContext.getClearTriggerBindings(),\n props,\n )\n\n return (\n <InlineIconButton\n icon={X}\n size={qdsContext.size}\n variant=\"scale\"\n {...mergedProps}\n />\n )\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ReactElement} from \"react\"\n\nimport {\n InputErrorIndicator,\n type InputErrorIndicatorProps,\n} from \"@qualcomm-ui/react/input\"\nimport {useTextInputContext} from \"@qualcomm-ui/react-core/text-input\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nexport interface TextInputErrorIndicatorProps extends InputErrorIndicatorProps {}\n\n/**\n * Visual indicator displayed when the input is invalid. Renders a `<div>` element\n * by default.\n */\nexport function TextInputErrorIndicator(\n props: TextInputErrorIndicatorProps,\n): ReactElement {\n const context = useTextInputContext()\n const mergedProps = mergeProps(context.getErrorIndicatorBindings(), props)\n return <InputErrorIndicator {...mergedProps} />\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ReactElement} from \"react\"\n\nimport {\n InputErrorText,\n type InputErrorTextProps,\n} from \"@qualcomm-ui/react/input\"\nimport {useTextInputErrorText} from \"@qualcomm-ui/react-core/text-input\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nexport interface TextInputErrorTextProps extends InputErrorTextProps {}\n\n/**\n * Error message displayed when the input is invalid. Renders a `<div>` element by\n * default.\n */\nexport function TextInputErrorText({\n children,\n id,\n ...props\n}: TextInputErrorTextProps): ReactElement {\n const contextProps = useTextInputErrorText({id})\n\n const mergedProps = mergeProps(contextProps, props)\n\n return <InputErrorText {...mergedProps}>{children}</InputErrorText>\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ReactElement} from \"react\"\n\nimport {InputHint, type InputHintProps} from \"@qualcomm-ui/react/input\"\nimport {useTextInputHint} from \"@qualcomm-ui/react-core/text-input\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nexport interface TextInputHintProps extends InputHintProps {}\n\n/**\n * Helper text displayed below the input. Renders a `<div>` element by default.\n */\nexport function TextInputHint({\n children,\n id,\n ...props\n}: TextInputHintProps): ReactElement {\n const contextProps = useTextInputHint({id})\n const mergedProps = mergeProps(contextProps, props)\n\n return <InputHint {...mergedProps}>{children}</InputHint>\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ComponentPropsWithRef, ReactElement} from \"react\"\n\nimport {useQdsInputContext} from \"@qualcomm-ui/react/input\"\nimport type {IdProp} from \"@qualcomm-ui/react-core/system\"\nimport {useTextInputInput} from \"@qualcomm-ui/react-core/text-input\"\nimport type {ComponentDataAttributes} from \"@qualcomm-ui/utils/attributes\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nexport interface TextInputInputProps\n extends ComponentPropsWithRef<\"input\">, ComponentDataAttributes, IdProp {}\n\n/**\n * The text input element. Renders an `<input>` element.\n */\nexport function TextInputInput({\n id,\n ...props\n}: TextInputInputProps): ReactElement {\n const contextProps = useTextInputInput({id})\n\n const qdsContext = useQdsInputContext()\n\n const mergedProps = mergeProps(\n contextProps,\n qdsContext.getInputBindings(),\n props,\n )\n\n return <input {...mergedProps} />\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ReactElement, ReactNode} from \"react\"\n\nimport {\n InputEndIcon,\n InputStartIcon,\n useQdsInputContext,\n} from \"@qualcomm-ui/react/input\"\nimport {\n type ElementRenderProp,\n PolymorphicElement,\n} from \"@qualcomm-ui/react-core/system\"\nimport {useTextInputInputGroup} from \"@qualcomm-ui/react-core/text-input\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nexport interface TextInputInputGroupProps extends ElementRenderProp<\"div\"> {\n /**\n * React {@link https://react.dev/learn/passing-props-to-a-component#passing-jsx-as-children children} prop.\n */\n children?: ReactNode\n}\n\n/**\n * Container that wraps the input element and optional icons. Renders a `<div>`\n * element by default.\n */\nexport function TextInputInputGroup({\n children,\n ...props\n}: TextInputInputGroupProps): ReactElement {\n const qdsContext = useQdsInputContext()\n const contextProps = useTextInputInputGroup()\n const mergedProps = mergeProps(\n contextProps,\n qdsContext.getGroupBindings(),\n props,\n )\n\n return (\n <PolymorphicElement as=\"div\" {...mergedProps}>\n {qdsContext.startIcon ? (\n <InputStartIcon icon={qdsContext.startIcon} />\n ) : null}\n {children}\n {qdsContext.endIcon ? <InputEndIcon icon={qdsContext.endIcon} /> : null}\n </PolymorphicElement>\n )\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ReactElement, ReactNode} from \"react\"\n\nimport {InputLabel} from \"@qualcomm-ui/react/input\"\nimport type {ElementRenderProp} from \"@qualcomm-ui/react-core/system\"\nimport {\n useTextInputContext,\n useTextInputLabel,\n} from \"@qualcomm-ui/react-core/text-input\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nexport interface TextInputLabelProps extends ElementRenderProp<\"label\"> {\n /**\n * React {@link https://react.dev/learn/passing-props-to-a-component#passing-jsx-as-children children} prop.\n */\n children?: ReactNode\n}\n\n/**\n * An accessible label that is automatically associated with the input. Renders a\n * `<label>` element by default.\n */\nexport function TextInputLabel({\n id,\n ...props\n}: TextInputLabelProps): ReactElement {\n const contextProps = useTextInputLabel({id})\n const textInputContext = useTextInputContext()\n\n const mergedProps = mergeProps(contextProps, props)\n\n return <InputLabel required={textInputContext.required} {...mergedProps} />\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {type ReactElement, type ReactNode, useMemo} from \"react\"\n\nimport {\n splitTextInputProps,\n type TextInputApiProps,\n} from \"@qualcomm-ui/core/text-input\"\nimport {createQdsInputApi} from \"@qualcomm-ui/qds-core/input\"\nimport {\n QdsInputContextProvider,\n type QdsReactInputApiProps,\n} from \"@qualcomm-ui/react/input\"\nimport {normalizeProps} from \"@qualcomm-ui/react-core/machine\"\nimport {\n type ElementRenderProp,\n PolymorphicElement,\n} from \"@qualcomm-ui/react-core/system\"\nimport {\n TextInputContextProvider,\n useTextInput,\n} from \"@qualcomm-ui/react-core/text-input\"\nimport {mergeProps} from \"@qualcomm-ui/utils/merge-props\"\n\nexport interface TextInputRootProps\n extends\n TextInputApiProps,\n QdsReactInputApiProps,\n Omit<ElementRenderProp<\"div\">, \"dir\" | \"defaultValue\"> {\n /**\n * React {@link https://react.dev/learn/passing-props-to-a-component#passing-jsx-as-children children} prop.\n */\n children?: ReactNode\n}\n\n/**\n * Groups all parts of the text input. Renders a `<div>` element by default.\n */\nexport function TextInputRoot({\n children,\n endIcon,\n size,\n startIcon,\n ...props\n}: TextInputRootProps): ReactElement {\n const [textInputProps, localProps] = splitTextInputProps(props)\n const context = useTextInput(textInputProps)\n\n const qdsContext = useMemo(\n () => createQdsInputApi({endIcon, size, startIcon}, normalizeProps),\n [endIcon, size, startIcon],\n )\n\n const mergedProps = mergeProps(\n context.getRootBindings(),\n qdsContext.getRootBindings(),\n localProps,\n )\n\n return (\n <TextInputContextProvider value={context}>\n <QdsInputContextProvider value={qdsContext}>\n <PolymorphicElement as=\"div\" {...mergedProps}>\n {children}\n </PolymorphicElement>\n </QdsInputContextProvider>\n </TextInputContextProvider>\n )\n}\n","// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ReactElement, ReactNode} from \"react\"\n\nimport type {LucideIconOrElement} from \"@qualcomm-ui/react-core/lucide\"\nimport {useOptionalContentId} from \"@qualcomm-ui/react-core/machine\"\nimport {useControlledId} from \"@qualcomm-ui/react-core/state\"\n\nimport {\n TextInputClearTrigger,\n type TextInputClearTriggerProps,\n} from \"./text-input-clear-trigger\"\nimport {\n TextInputErrorIndicator,\n type TextInputErrorIndicatorProps,\n} from \"./text-input-error-indicator\"\nimport {\n TextInputErrorText,\n type TextInputErrorTextProps,\n} from \"./text-input-error-text\"\nimport {TextInputHint, type TextInputHintProps} from \"./text-input-hint\"\nimport {TextInputInput, type TextInputInputProps} from \"./text-input-input\"\nimport {\n TextInputInputGroup,\n type TextInputInputGroupProps,\n} from \"./text-input-input-group\"\nimport {TextInputLabel, type TextInputLabelProps} from \"./text-input-label\"\nimport {TextInputRoot, type TextInputRootProps} from \"./text-input-root\"\n\nexport interface TextInputProps extends TextInputRootProps {\n /**\n * {@link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-label aria-label}\n * attribute, forwarded to the input element.\n */\n \"aria-label\"?: string | undefined\n\n /**\n * {@link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-labelledby aria-labelledby}\n * attribute, forwarded to the input element. If you provide a {@link label},\n * omit this prop.\n */\n \"aria-labelledby\"?: string | undefined\n\n /**\n * The simple TextInput doesn't support children.\n */\n children?: never\n\n /**\n * When `true`, renders a clear button that resets the input value on click.\n * The button only appears when the input has a value.\n *\n * @default true\n */\n clearable?: boolean\n\n clearTriggerProps?: TextInputClearTriggerProps\n\n /**\n * {@link https://lucide.dev lucide-react} icon, positioned after\n * the input. Can be supplied as a `ReactElement` for additional customization.\n */\n endIcon?: LucideIconOrElement\n\n /**\n * Props applied to the error indicator element.\n */\n errorIndicatorProps?: TextInputErrorIndicatorProps\n\n /**\n * Optional error that describes the element when {@link invalid} is true.\n */\n errorText?: string\n\n /**\n * Props applied to the error text element.\n */\n errorTextProps?: TextInputErrorTextProps\n\n /**\n * Optional hint describing the element. This element is automatically\n * associated with the component's input element for accessibility.\n */\n hint?: ReactNode\n\n /**\n * Props applied to the label element.\n */\n hintProps?: TextInputHintProps\n\n /**\n * Props applied to the input group element.\n *\n * @inheritDoc\n */\n inputGroupProps?: TextInputInputGroupProps\n\n /**\n * Props applied to the input element.\n */\n inputProps?: TextInputInputProps\n\n /**\n * Optional label describing the element. Recommended. This element is\n * automatically associated with the component's input element for\n * accessibility.\n */\n label?: ReactNode\n\n /**\n * Props applied to the label element.\n */\n labelProps?: TextInputLabelProps\n\n /**\n * HTML {@link https://www.w3schools.com/tags/att_input_placeholder.asp placeholder} attribute,\n * passed to the underlying input element.\n */\n placeholder?: string\n\n /**\n * {@link https://lucide.dev lucide-react} icon, positioned before\n * the input. Can be supplied as a `ReactElement` for additional customization.\n */\n startIcon?: LucideIconOrElement\n}\n\nexport function TextInput({\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n clearable = true,\n clearTriggerProps,\n errorIndicatorProps,\n errorText,\n errorTextProps,\n hint,\n hintProps,\n inputGroupProps,\n inputProps: inputPropsProp,\n label,\n labelProps,\n placeholder,\n ...props\n}: TextInputProps): ReactElement {\n const labelContent = label || labelProps?.children\n const errorTextContent = errorText || errorTextProps?.children\n const hintContent = hint || hintProps?.children\n\n const inputProps = {\n ...inputPropsProp,\n }\n\n // prevent undefined labels from overwriting defaults\n if (ariaLabel !== undefined) {\n inputProps[\"aria-label\"] = ariaLabel\n }\n if (ariaLabelledBy !== undefined) {\n inputProps[\"aria-labelledby\"] = ariaLabelledBy\n }\n\n const ids = {\n errorText: useOptionalContentId(errorTextContent, errorTextProps),\n hint: useOptionalContentId(hintContent, hintProps),\n input: useControlledId(inputProps?.id),\n label: useOptionalContentId(labelContent, labelProps),\n ...props.ids,\n }\n\n return (\n <TextInputRoot {...props} ids={ids}>\n {labelContent ? (\n <TextInputLabel {...labelProps} id={ids.label}>\n {labelContent}\n </TextInputLabel>\n ) : null}\n\n <TextInputInputGroup {...inputGroupProps}>\n <TextInputInput\n placeholder={placeholder}\n {...inputProps}\n id={ids.input}\n />\n {clearable ? <TextInputClearTrigger {...clearTriggerProps} /> : null}\n <TextInputErrorIndicator {...errorIndicatorProps} />\n </TextInputInputGroup>\n\n {hintContent ? (\n <TextInputHint {...hintProps} id={ids.hint}>\n {hintContent}\n </TextInputHint>\n ) : null}\n\n {errorTextContent ? (\n <TextInputErrorText {...errorTextProps} id={ids.errorText}>\n {errorTextContent}\n </TextInputErrorText>\n ) : null}\n </TextInputRoot>\n )\n}\n","import {TextInput as SimpleTextInput, type TextInputProps} from \"./text-input\"\nimport {\n TextInputClearTrigger,\n type TextInputClearTriggerProps,\n} from \"./text-input-clear-trigger\"\nimport {\n TextInputErrorIndicator,\n type TextInputErrorIndicatorProps,\n} from \"./text-input-error-indicator\"\nimport {\n TextInputErrorText,\n type TextInputErrorTextProps,\n} from \"./text-input-error-text\"\nimport {TextInputHint, type TextInputHintProps} from \"./text-input-hint\"\nimport {TextInputInput, type TextInputInputProps} from \"./text-input-input\"\nimport {\n TextInputInputGroup,\n type TextInputInputGroupProps,\n} from \"./text-input-input-group\"\nimport {TextInputLabel, type TextInputLabelProps} from \"./text-input-label\"\nimport {TextInputRoot, type TextInputRootProps} from \"./text-input-root\"\n\nexport type {\n TextInputClearTriggerProps,\n TextInputErrorIndicatorProps,\n TextInputErrorTextProps,\n TextInputHintProps,\n TextInputInputGroupProps,\n TextInputInputProps,\n TextInputLabelProps,\n TextInputRootProps,\n TextInputProps,\n}\n\ntype TextInputComponent = typeof SimpleTextInput & {\n /**\n * Button that clears the input value. Renders a `<button>` element by default.\n */\n ClearTrigger: typeof TextInputClearTrigger\n /**\n * Visual indicator displayed when the input is invalid. Renders a `<div>` element\n * by default.\n */\n ErrorIndicator: typeof TextInputErrorIndicator\n /**\n * Error message displayed when the input is invalid. Renders a `<div>` element by\n * default.\n */\n ErrorText: typeof TextInputErrorText\n /**\n * Helper text displayed below the input. Renders a `<div>` element by default.\n */\n Hint: typeof TextInputHint\n /**\n * The text input element. Renders an `<input>` element.\n */\n Input: typeof TextInputInput\n /**\n * Container that wraps the input element and optional icons. Renders a `<div>`\n * element by default.\n */\n InputGroup: typeof TextInputInputGroup\n /**\n * An accessible label that is automatically associated with the input. Renders a\n * `<label>` element by default.\n */\n Label: typeof TextInputLabel\n /**\n * Groups all parts of the text input. Renders a `<div>` element by default.\n */\n Root: typeof TextInputRoot\n}\n\nexport const TextInput: TextInputComponent =\n SimpleTextInput as TextInputComponent\n\nTextInput.ClearTrigger = TextInputClearTrigger\nTextInput.ErrorIndicator = TextInputErrorIndicator\nTextInput.ErrorText = TextInputErrorText\nTextInput.Hint = TextInputHint\nTextInput.InputGroup = TextInputInputGroup\nTextInput.Input = TextInputInput\nTextInput.Label = TextInputLabel\nTextInput.Root = TextInputRoot\n"],"mappings":"gmCAkBA,SAAOQ,sBAAAC,EAAA,CAAA,IAAAC,EAAAC,EAAA,EAAA,CAGLC,EAAqBP,GAA0B,CAC/CQ,EAAmBV,GAAoB,CAAAW,EAAAJ,EAAA,KAAAE,GAAAF,EAAA,KAAAD,GAAAC,EAAA,KAAAG,GACnBC,EAAAR,EAClBM,EACAC,EAAUE,yBAA0B,CACpCN,EACD,CAAAC,EAAA,GAAAE,EAAAF,EAAA,GAAAD,EAAAC,EAAA,GAAAG,EAAAH,EAAA,GAAAI,GAAAA,EAAAJ,EAAA,GAJD,IAAAM,EAAoBF,EAInBG,EAQG,OARHP,EAAA,KAAAM,GAAAN,EAAA,KAAAG,EAAAK,MAGCD,EAAA,EAAC,EAAD,CACQhB,KAAAA,EACA,KAAAY,EAAUK,KACR,QAAA,QAAO,GACXF,EACJ,CAAA,CAAAN,EAAA,GAAAM,EAAAN,EAAA,GAAAG,EAAAK,KAAAR,EAAA,GAAAO,GAAAA,EAAAP,EAAA,GALFO,ECZJ,SAAOQ,wBAAAC,EAAA,CAAA,IAAAC,EAAAC,EAAA,EAAA,CAGLC,EAAgBP,GAAqB,CAAAQ,EAAAH,EAAA,KAAAE,GAAAF,EAAA,KAAAD,GACjBI,EAAAP,EAAWM,EAAOE,2BAA4B,CAAEL,EAAM,CAAAC,EAAA,GAAAE,EAAAF,EAAA,GAAAD,EAAAC,EAAA,GAAAG,GAAAA,EAAAH,EAAA,GAA1E,IAAAK,EAAoBF,EAAsDG,EAC3B,OAD2BN,EAAA,KAAAK,EAC3BC,EAAAN,EAAA,IAAxCM,EAAA,EAAC,EAAD,CAAoB,GAAKD,EAAe,CAAA,CAAAL,EAAA,GAAAK,EAAAL,EAAA,GAAAM,GAAxCA,ECLT,SAAOO,mB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EAAAV,EAAA,IAAAT,EAAAS,EAAA,IAAAiB,EAAA3B,KAAAU,EAAA,IAAAwB,GAAAA,EAAAxB,EAAA,IAAA,IAAAyB,EAAAzB,EAAA,MAAAS,GAAAT,EAAA,MAAAX,GAAAW,EAAA,MAAAiB,EAAA7B,WAEPqC,EAAAhB,EACC,EAAC,mBAAD,CAAmB,GAAKpB,EAAoB,GAAA4B,EAAG7B,mBAC5CqB,EAEG,CAAA,CAJP,KAIOT,EAAA,IAAAS,EAAAT,EAAA,IAAAX,EAAAW,EAAA,IAAAiB,EAAA7B,UAAAY,EAAA,IAAAyB,GAAAA,EAAAzB,EAAA,IAAA,IAAA0B,EACM,OADN1B,EAAA,MAAAiB,GAAAjB,EAAA,MAAAK,GAAAL,EAAA,MAAAuB,GAAAvB,EAAA,MAAAwB,GAAAxB,EAAA,MAAAyB,GAAAzB,EAAA,MAAAmB,GA3BVO,EAAA,EAAC,cAAD,CAAc,GAAKrB,EAAYY,eAA/B,CACGE,EAMDI,EAUCC,EAMAC,EAKa,GAAAzB,EAAA,IAAAiB,EAAAjB,EAAA,IAAAK,EAAAL,EAAA,IAAAuB,EAAAvB,EAAA,IAAAwB,EAAAxB,EAAA,IAAAyB,EAAAzB,EAAA,IAAAmB,EAAAnB,EAAA,IAAA0B,GAAAA,EAAA1B,EAAA,IA5BhB0B,ECjGJ,IAAaC,EACXC,YAEFD,EAAUoB,aAAejB,sBACzBH,EAAUqB,eAAiBhB,wBAC3BL,EAAUsB,UAAYf,mBACtBP,EAAUuB,KAAOd,cACjBT,EAAUyB,WAAaZ,oBACvBb,EAAUwB,MAAQb,eAClBX,EAAU0B,MAAQX,eAClBf,EAAU2B,KAAOV"}
|
package/dist/toast/index.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use client;";import{c as e}from"react/compiler-runtime";import{mergeProps as t}from"@qualcomm-ui/utils/merge-props";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{PolymorphicElement as i}from"@qualcomm-ui/react-core/system";import{BellRing as a,CircleAlert as o,CircleCheck as s,TriangleAlert as c,X as l}from"lucide-react";import{IconOrNode as u}from"@qualcomm-ui/react/icon";import"react";import{normalizeProps as d}from"@qualcomm-ui/react-core/machine";import{createGuardedContext as f}from"@qualcomm-ui/react-core/context";import{Button as p}from"@qualcomm-ui/react/button";import{InlineIconButton as m}from"@qualcomm-ui/react/inline-icon-button";import{ProgressRing as h}from"@qualcomm-ui/react/progress-ring";import{CoreToast as g,CoreToaster as _,useToastContext as v}from"@qualcomm-ui/react-core/toast";import{createQdsToastApi as y}from"@qualcomm-ui/qds-core/toast";import{createToastStore as b}from"@qualcomm-ui/core/toast";var[x,S]=f({hookName:`useQdsToastContext`,providerName:`<QdsToastContextProvider>`,strict:!0});function ToastActionButton(r){let a=e(8),{action:o,render:s,...c}=r,l=t(S().getActionBindings(),c),u;a[0]===s?u=a[1]:(u=n(p,{emphasis:`neutral`,render:s,size:`sm`,variant:`outline`}),a[0]=s,a[1]=u);let d;a[2]!==o.label||a[3]!==u?(d=n(i,{as:`button`,render:u,children:o.label}),a[2]=o.label,a[3]=u,a[4]=d):d=a[4];let f;return a[5]!==l||a[6]!==d?(f=n(g.ActionTrigger,{...l,children:d}),a[5]=l,a[6]=d,a[7]=f):f=a[7],f}function ToastCloseButton(r){let i=e(5),{icon:a,...o}=r,s=t(S().getCloseButtonBindings(),o),c=a||l,u;i[0]===c?u=i[1]:(u=n(m,{icon:c,variant:`fixed`}),i[0]=c,i[1]=u);let d;return i[2]!==s||i[3]!==u?(d=n(g.CloseTrigger,{...s,children:u}),i[2]=s,i[3]=u,i[4]=d):d=i[4],d}function ToastDescription(r){let i=e(5),a=S(),o;i[0]!==r||i[1]!==a?(o=t(a.getDescriptionBindings(),r),i[0]=r,i[1]=a,i[2]=o):o=i[2];let s=o,c;return i[3]===s?c=i[4]:(c=n(g.Description,{...s}),i[3]=s,i[4]=c),c}function ToastIcon(r){let i=e(3),{icon:a,...s}=r,c=S(),l=t(c.getIconBindings(),s),d=a||C[c.emphasis]||o,f;return i[0]!==l||i[1]!==d?(f=n(u,{icon:d,size:`lg`,...l}),i[0]=l,i[1]=d,i[2]=f):f=i[2],f}var C={danger:o,info:o,loading:n(h,{size:`xs`}),neutral:a,success:s,warning:c};function ToastLabel(r){let i=e(5),a=S(),o;i[0]!==r||i[1]!==a?(o=t(a.getLabelBindings(),r),i[0]=r,i[1]=a,i[2]=o):o=i[2];let s=o,c;return i[3]===s?c=i[4]:(c=n(g.Label,{...s}),i[3]=s,i[4]=c),c}function ToastRoot(r){let i=e(10),a=v(),o;i[0]===a.type?o=i[1]:(o=y({emphasis:a.type},d),i[0]=a.type,i[1]=o);let s=o,c;i[2]!==r||i[3]!==s?(c=t(s.getRootBindings(),r),i[2]=r,i[3]=s,i[4]=c):c=i[4];let l=c,u;i[5]===l?u=i[6]:(u=n(g.Root,{...l}),i[5]=l,i[6]=u);let f;return i[7]!==s||i[8]!==u?(f=n(x,{value:s,children:u}),i[7]=s,i[8]=u,i[9]=f):f=i[9],f}function createToaster(e){return b(e)}function Toaster(t){let r=e(8),i,a,o;r[0]===t?(i=r[1],a=r[2],o=r[3]):({children:i,toaster:o,...a}=t,r[0]=t,r[1]=i,r[2]=a,r[3]=o);let s=i||DefaultToast,c;return r[4]!==a||r[5]!==s||r[6]!==o?(c=n(_,{toaster:o,...a,children:s}),r[4]=a,r[5]=s,r[6]=o,r[7]=c):c=r[7],c}function DefaultToast(t){let i=e(15),a;i[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=n(ToastIcon,{}),i[0]=a):a=i[0];let o;i[1]===t.label?o=i[2]:(o=n(ToastLabel,{children:t.label}),i[1]=t.label,i[2]=o);let s;i[3]===t.description?s=i[4]:(s=n(ToastDescription,{children:t.description}),i[3]=t.description,i[4]=s);let c;i[5]===t.action?c=i[6]:(c=t.action?n(ToastActionButton,{action:t.action}):null,i[5]=t.action,i[6]=c);let l;i[7]===t.closable?l=i[8]:(l=t.closable?n(ToastCloseButton,{}):null,i[7]=t.closable,i[8]=l);let u;return i[9]!==o||i[10]!==s||i[11]!==c||i[12]!==l||i[13]!==t.id?(u=r(ToastRoot,{children:[a,o,s,c,l]},t.id),i[9]=o,i[10]=s,i[11]=c,i[12]=l,i[13]=t.id,i[14]=u):u=i[14],u}var w={ActionButton:ToastActionButton,CloseButton:ToastCloseButton,Description:ToastDescription,Icon:ToastIcon,Label:ToastLabel,Root:ToastRoot};export{x as QdsToastContextProvider,w as Toast,Toaster,createToaster,S as useQdsToastContext};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|