@magiclabs/ui-components 1.17.0 → 1.17.1
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/cjs/components/list-items/navigation-button.js +1 -1
- package/dist/cjs/components/list-items/navigation-button.js.map +1 -1
- package/dist/es/components/list-items/navigation-button.js +1 -1
- package/dist/es/components/list-items/navigation-button.js.map +1 -1
- package/dist/types/components/list-items/navigation-button.d.ts +1 -0
- package/dist/types/components/list-items/navigation-button.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),h=require("@styled/tokens"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),h=require("@styled/tokens"),C=require("../icons/ico-external-link.js");require("../primitives/button.js"),require("../primitives/checkbox.js"),require("../primitives/popover.js"),require("../primitives/radio.js"),require("../primitives/segmented-control.js"),require("../primitives/switch.js");var b=require("../primitives/text.js"),g=require("@styled/css"),a=require("@styled/jsx"),N=require("@styled/patterns"),l=require("create-slots"),t=require("react"),c=require("react-aria");const q=l.createSlot(({children:r,...s})=>e.jsx(a.Center,{children:t.Children.map(r,i=>t.cloneElement(i,s))})),v=l.createSlot(({children:r,...s})=>e.jsx(a.Center,{children:t.Children.map(r,i=>t.cloneElement(i,s))})),f=t.forwardRef((r,s)=>{const{primaryLabel:i,secondaryLabel:u,isExternalLink:x,disabled:m}=r,j=t.useRef(null),d=s||j,{buttonProps:y}=c.useButton({...r,isDisabled:m??!1},d),{isFocusVisible:k,focusProps:w}=c.useFocusRing();return l.createHost(r.children,p=>{const n=p.get(q),o=p.get(v);return e.jsxs("button",{...c.mergeProps(y,w),ref:d,className:N.flex({justifyContent:"space-between",alignItems:"center",w:"full",p:4,bg:"neutral.quaternary",transition:"background-color 0.2s",_hover:{bg:"neutral.secondary"},rounded:"lg",cursor:"pointer",outlineColor:"brand.base",outlineStyle:k?"solid":"none",outlineWidth:"thick",outlineOffset:.5,_disabled:{opacity:"0.3",pointerEvents:"none"}}),children:[e.jsxs(a.HStack,{children:[n&&{...n,props:{...n.props,className:n.props.color?void 0:g.css({color:"brand.base"}),height:24}},e.jsx(b.default,{styles:{fontWeight:500},children:i}),x&&e.jsx(C.default,{width:14,height:14,color:h.token("colors.neutral.primary")})]}),e.jsxs(a.HStack,{children:[u&&e.jsx(b.default,{size:"sm",styles:{color:h.token("colors.text.tertiary")},children:u}),o&&{...o,props:{...o.props,className:o.props.color?void 0:g.css({color:"neutral.primary"}),width:16,height:16}}]})]})})});f.displayName="NavigationButton";const S=Object.assign(f,{LeadingIcon:q,TrailingIcon:v});exports.default=S;
|
|
2
2
|
//# sourceMappingURL=navigation-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-button.js","sources":["../../../../src/components/list-items/navigation-button.tsx"],"sourcesContent":["import { IcoExternalLink } from '@components/icons';\nimport { Text } from '@components/primitives';\nimport { css } from '@styled/css';\nimport { Center, HStack } from '@styled/jsx';\nimport { flex } from '@styled/patterns';\nimport { token } from '@styled/tokens';\nimport { createHost, createSlot } from 'create-slots';\nimport { Children, RefObject, cloneElement, forwardRef, useRef } from 'react';\nimport { AriaButtonProps, mergeProps, useButton, useFocusRing } from 'react-aria';\n\nexport interface NavigationButtonProps extends AriaButtonProps {\n primaryLabel: string;\n secondaryLabel?: string;\n isExternalLink?: boolean;\n}\n\nconst LeadingIcon = createSlot(({ children, ...props }) => {\n return (\n <Center>\n {Children.map(children, child => {\n return cloneElement(child, props);\n })}\n </Center>\n );\n});\n\nconst TrailingIcon = createSlot(({ children, ...props }) => {\n return (\n <Center>\n {Children.map(children, child => {\n return cloneElement(child, props);\n })}\n </Center>\n );\n});\n\nconst NavigationButtonBase = forwardRef<HTMLButtonElement, NavigationButtonProps>((props, forwardedRef) => {\n const { primaryLabel, secondaryLabel, isExternalLink } = props;\n\n const internalRef = useRef(null);\n const ref = forwardedRef || internalRef;\n\n const { buttonProps } = useButton(props, ref as RefObject<HTMLButtonElement>);\n const { isFocusVisible, focusProps } = useFocusRing();\n\n return createHost(props.children, slots => {\n const leadingIcon = slots.get(LeadingIcon);\n const trailingIcon = slots.get(TrailingIcon);\n\n return (\n <button\n {...mergeProps(buttonProps, focusProps)}\n ref={ref}\n className={flex({\n justifyContent: 'space-between',\n alignItems: 'center',\n w: 'full',\n p: 4,\n bg: 'neutral.quaternary',\n transition: 'background-color 0.2s',\n _hover: { bg: 'neutral.secondary' },\n rounded: 'lg',\n cursor: 'pointer',\n outlineColor: 'brand.base',\n outlineStyle: isFocusVisible ? 'solid' : 'none',\n outlineWidth: 'thick',\n outlineOffset: 0.5,\n })}\n >\n <HStack>\n {leadingIcon && {\n ...leadingIcon,\n props: {\n ...leadingIcon.props,\n className: !leadingIcon.props.color ? css({ color: 'brand.base' }) : undefined,\n height: 24,\n },\n }}\n <Text styles={{ fontWeight: 500 }}>{primaryLabel}</Text>\n {isExternalLink && <IcoExternalLink width={14} height={14} color={token('colors.neutral.primary')} />}\n </HStack>\n <HStack>\n {secondaryLabel && (\n <Text size=\"sm\" styles={{ color: token('colors.text.tertiary') }}>\n {secondaryLabel}\n </Text>\n )}\n {trailingIcon && {\n ...trailingIcon,\n props: {\n ...trailingIcon.props,\n className: !trailingIcon.props.color ? css({ color: 'neutral.primary' }) : undefined,\n width: 16,\n height: 16,\n },\n }}\n </HStack>\n </button>\n );\n });\n});\n\nNavigationButtonBase.displayName = 'NavigationButton';\n\nconst NavigationButton = Object.assign(NavigationButtonBase, { LeadingIcon, TrailingIcon });\n\nexport default NavigationButton;\n"],"names":["LeadingIcon","createSlot","children","props","_jsx","Center","Children","child","cloneElement","TrailingIcon","NavigationButtonBase","forwardRef","forwardedRef","primaryLabel","secondaryLabel","isExternalLink","internalRef","useRef","ref","buttonProps","useButton","isFocusVisible","focusProps","useFocusRing","createHost","slots","leadingIcon","trailingIcon","_jsxs","mergeProps","flex","HStack","css","Text","IcoExternalLink","token","NavigationButton"],"mappings":"
|
|
1
|
+
{"version":3,"file":"navigation-button.js","sources":["../../../../src/components/list-items/navigation-button.tsx"],"sourcesContent":["import { IcoExternalLink } from '@components/icons';\nimport { Text } from '@components/primitives';\nimport { css } from '@styled/css';\nimport { Center, HStack } from '@styled/jsx';\nimport { flex } from '@styled/patterns';\nimport { token } from '@styled/tokens';\nimport { createHost, createSlot } from 'create-slots';\nimport { Children, RefObject, cloneElement, forwardRef, useRef } from 'react';\nimport { AriaButtonProps, mergeProps, useButton, useFocusRing } from 'react-aria';\n\nexport interface NavigationButtonProps extends AriaButtonProps {\n primaryLabel: string;\n secondaryLabel?: string;\n isExternalLink?: boolean;\n disabled?: boolean;\n}\n\nconst LeadingIcon = createSlot(({ children, ...props }) => {\n return (\n <Center>\n {Children.map(children, child => {\n return cloneElement(child, props);\n })}\n </Center>\n );\n});\n\nconst TrailingIcon = createSlot(({ children, ...props }) => {\n return (\n <Center>\n {Children.map(children, child => {\n return cloneElement(child, props);\n })}\n </Center>\n );\n});\n\nconst NavigationButtonBase = forwardRef<HTMLButtonElement, NavigationButtonProps>((props, forwardedRef) => {\n const { primaryLabel, secondaryLabel, isExternalLink, disabled } = props;\n\n const internalRef = useRef(null);\n const ref = forwardedRef || internalRef;\n\n const { buttonProps } = useButton({ ...props, isDisabled: disabled ?? false }, ref as RefObject<HTMLButtonElement>);\n const { isFocusVisible, focusProps } = useFocusRing();\n\n return createHost(props.children, slots => {\n const leadingIcon = slots.get(LeadingIcon);\n const trailingIcon = slots.get(TrailingIcon);\n\n return (\n <button\n {...mergeProps(buttonProps, focusProps)}\n ref={ref}\n className={flex({\n justifyContent: 'space-between',\n alignItems: 'center',\n w: 'full',\n p: 4,\n bg: 'neutral.quaternary',\n transition: 'background-color 0.2s',\n _hover: { bg: 'neutral.secondary' },\n rounded: 'lg',\n cursor: 'pointer',\n outlineColor: 'brand.base',\n outlineStyle: isFocusVisible ? 'solid' : 'none',\n outlineWidth: 'thick',\n outlineOffset: 0.5,\n _disabled: { opacity: '0.3', pointerEvents: 'none' },\n })}\n >\n <HStack>\n {leadingIcon && {\n ...leadingIcon,\n props: {\n ...leadingIcon.props,\n className: !leadingIcon.props.color ? css({ color: 'brand.base' }) : undefined,\n height: 24,\n },\n }}\n <Text styles={{ fontWeight: 500 }}>{primaryLabel}</Text>\n {isExternalLink && <IcoExternalLink width={14} height={14} color={token('colors.neutral.primary')} />}\n </HStack>\n <HStack>\n {secondaryLabel && (\n <Text size=\"sm\" styles={{ color: token('colors.text.tertiary') }}>\n {secondaryLabel}\n </Text>\n )}\n {trailingIcon && {\n ...trailingIcon,\n props: {\n ...trailingIcon.props,\n className: !trailingIcon.props.color ? css({ color: 'neutral.primary' }) : undefined,\n width: 16,\n height: 16,\n },\n }}\n </HStack>\n </button>\n );\n });\n});\n\nNavigationButtonBase.displayName = 'NavigationButton';\n\nconst NavigationButton = Object.assign(NavigationButtonBase, { LeadingIcon, TrailingIcon });\n\nexport default NavigationButton;\n"],"names":["LeadingIcon","createSlot","children","props","_jsx","Center","Children","child","cloneElement","TrailingIcon","NavigationButtonBase","forwardRef","forwardedRef","primaryLabel","secondaryLabel","isExternalLink","disabled","internalRef","useRef","ref","buttonProps","useButton","isFocusVisible","focusProps","useFocusRing","createHost","slots","leadingIcon","trailingIcon","_jsxs","mergeProps","flex","HStack","css","Text","IcoExternalLink","token","NavigationButton"],"mappings":"ykBAiBA,MAAMA,EAAcC,EAAAA,WAAW,CAAC,CAAE,SAAAC,EAAU,GAAGC,CAAO,IAElDC,EAAAA,IAACC,EAAAA,OAAM,CAAA,SACJC,EAAAA,SAAS,IAAIJ,EAAUK,GACfC,eAAaD,EAAOJ,CAAK,CACjC,CACM,CAAA,CAEZ,EAEKM,EAAeR,aAAW,CAAC,CAAE,SAAAC,EAAU,GAAGC,CAAO,IAEnDC,MAACC,EAAM,OAAA,CAAA,SACJC,EAAS,SAAA,IAAIJ,EAAUK,GACfC,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QAAM,wBAAwB,CAAC,CAAA,CAAI,CAC9F,CAAA,EACTP,EAAAA,KAACG,EAAAA,OACE,CAAA,SAAA,CAAAlB,GACCV,EAAAA,IAAC8B,EAAAA,QAAK,CAAA,KAAK,KAAK,OAAQ,CAAE,MAAOE,QAAM,sBAAsB,CAAG,EAAA,SAC7DtB,CAAc,CAAA,EAGlBc,GAAgB,CACf,GAAGA,EACH,MAAO,CACL,GAAGA,EAAa,MAChB,UAAYA,EAAa,MAAM,MAA4C,OAApCK,EAAAA,IAAI,CAAE,MAAO,kBAAmB,EACvE,MAAO,GACP,OAAQ,EACT,EACF,CACM,CAAA,CAAA,CAAA,CAAA,CAGf,CAAC,CACH,CAAC,EAEDvB,EAAqB,YAAc,mBAE7B2B,MAAAA,EAAmB,OAAO,OAAO3B,EAAsB,CAAE,YAAAV,EAAa,aAAAS,CAAY,CAAE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t,jsxs as s}from"react/jsx-runtime";import{token as p}from"@styled/tokens";import
|
|
1
|
+
import{jsx as t,jsxs as s}from"react/jsx-runtime";import{token as p}from"@styled/tokens";import L from"../icons/ico-external-link.js";import"../primitives/button.js";import"../primitives/checkbox.js";import"../primitives/popover.js";import"../primitives/radio.js";import"../primitives/segmented-control.js";import"../primitives/switch.js";import m from"../primitives/text.js";import{css as d}from"@styled/css";import{Center as u,HStack as h}from"@styled/jsx";import{flex as B}from"@styled/patterns";import{createSlot as f,createHost as E}from"create-slots";import{Children as b,cloneElement as g,forwardRef as H,useRef as P}from"react";import{useButton as R,useFocusRing as S,mergeProps as F}from"react-aria";const y=f(({children:r,...o})=>t(u,{children:b.map(r,e=>g(e,o))})),x=f(({children:r,...o})=>t(u,{children:b.map(r,e=>g(e,o))})),j=H((r,o)=>{const{primaryLabel:e,secondaryLabel:l,isExternalLink:k,disabled:v}=r,w=P(null),a=o||w,{buttonProps:N}=R({...r,isDisabled:v??!1},a),{isFocusVisible:C,focusProps:I}=S();return E(r.children,c=>{const i=c.get(y),n=c.get(x);return s("button",{...F(N,I),ref:a,className:B({justifyContent:"space-between",alignItems:"center",w:"full",p:4,bg:"neutral.quaternary",transition:"background-color 0.2s",_hover:{bg:"neutral.secondary"},rounded:"lg",cursor:"pointer",outlineColor:"brand.base",outlineStyle:C?"solid":"none",outlineWidth:"thick",outlineOffset:.5,_disabled:{opacity:"0.3",pointerEvents:"none"}}),children:[s(h,{children:[i&&{...i,props:{...i.props,className:i.props.color?void 0:d({color:"brand.base"}),height:24}},t(m,{styles:{fontWeight:500},children:e}),k&&t(L,{width:14,height:14,color:p("colors.neutral.primary")})]}),s(h,{children:[l&&t(m,{size:"sm",styles:{color:p("colors.text.tertiary")},children:l}),n&&{...n,props:{...n.props,className:n.props.color?void 0:d({color:"neutral.primary"}),width:16,height:16}}]})]})})});j.displayName="NavigationButton";const O=Object.assign(j,{LeadingIcon:y,TrailingIcon:x});export{O as default};
|
|
2
2
|
//# sourceMappingURL=navigation-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-button.js","sources":["../../../../src/components/list-items/navigation-button.tsx"],"sourcesContent":["import { IcoExternalLink } from '@components/icons';\nimport { Text } from '@components/primitives';\nimport { css } from '@styled/css';\nimport { Center, HStack } from '@styled/jsx';\nimport { flex } from '@styled/patterns';\nimport { token } from '@styled/tokens';\nimport { createHost, createSlot } from 'create-slots';\nimport { Children, RefObject, cloneElement, forwardRef, useRef } from 'react';\nimport { AriaButtonProps, mergeProps, useButton, useFocusRing } from 'react-aria';\n\nexport interface NavigationButtonProps extends AriaButtonProps {\n primaryLabel: string;\n secondaryLabel?: string;\n isExternalLink?: boolean;\n}\n\nconst LeadingIcon = createSlot(({ children, ...props }) => {\n return (\n <Center>\n {Children.map(children, child => {\n return cloneElement(child, props);\n })}\n </Center>\n );\n});\n\nconst TrailingIcon = createSlot(({ children, ...props }) => {\n return (\n <Center>\n {Children.map(children, child => {\n return cloneElement(child, props);\n })}\n </Center>\n );\n});\n\nconst NavigationButtonBase = forwardRef<HTMLButtonElement, NavigationButtonProps>((props, forwardedRef) => {\n const { primaryLabel, secondaryLabel, isExternalLink } = props;\n\n const internalRef = useRef(null);\n const ref = forwardedRef || internalRef;\n\n const { buttonProps } = useButton(props, ref as RefObject<HTMLButtonElement>);\n const { isFocusVisible, focusProps } = useFocusRing();\n\n return createHost(props.children, slots => {\n const leadingIcon = slots.get(LeadingIcon);\n const trailingIcon = slots.get(TrailingIcon);\n\n return (\n <button\n {...mergeProps(buttonProps, focusProps)}\n ref={ref}\n className={flex({\n justifyContent: 'space-between',\n alignItems: 'center',\n w: 'full',\n p: 4,\n bg: 'neutral.quaternary',\n transition: 'background-color 0.2s',\n _hover: { bg: 'neutral.secondary' },\n rounded: 'lg',\n cursor: 'pointer',\n outlineColor: 'brand.base',\n outlineStyle: isFocusVisible ? 'solid' : 'none',\n outlineWidth: 'thick',\n outlineOffset: 0.5,\n })}\n >\n <HStack>\n {leadingIcon && {\n ...leadingIcon,\n props: {\n ...leadingIcon.props,\n className: !leadingIcon.props.color ? css({ color: 'brand.base' }) : undefined,\n height: 24,\n },\n }}\n <Text styles={{ fontWeight: 500 }}>{primaryLabel}</Text>\n {isExternalLink && <IcoExternalLink width={14} height={14} color={token('colors.neutral.primary')} />}\n </HStack>\n <HStack>\n {secondaryLabel && (\n <Text size=\"sm\" styles={{ color: token('colors.text.tertiary') }}>\n {secondaryLabel}\n </Text>\n )}\n {trailingIcon && {\n ...trailingIcon,\n props: {\n ...trailingIcon.props,\n className: !trailingIcon.props.color ? css({ color: 'neutral.primary' }) : undefined,\n width: 16,\n height: 16,\n },\n }}\n </HStack>\n </button>\n );\n });\n});\n\nNavigationButtonBase.displayName = 'NavigationButton';\n\nconst NavigationButton = Object.assign(NavigationButtonBase, { LeadingIcon, TrailingIcon });\n\nexport default NavigationButton;\n"],"names":["LeadingIcon","createSlot","children","props","_jsx","Center","Children","child","cloneElement","TrailingIcon","NavigationButtonBase","forwardRef","forwardedRef","primaryLabel","secondaryLabel","isExternalLink","internalRef","useRef","ref","buttonProps","useButton","isFocusVisible","focusProps","useFocusRing","createHost","slots","leadingIcon","trailingIcon","_jsxs","mergeProps","flex","HStack","css","Text","IcoExternalLink","token","NavigationButton"],"mappings":"
|
|
1
|
+
{"version":3,"file":"navigation-button.js","sources":["../../../../src/components/list-items/navigation-button.tsx"],"sourcesContent":["import { IcoExternalLink } from '@components/icons';\nimport { Text } from '@components/primitives';\nimport { css } from '@styled/css';\nimport { Center, HStack } from '@styled/jsx';\nimport { flex } from '@styled/patterns';\nimport { token } from '@styled/tokens';\nimport { createHost, createSlot } from 'create-slots';\nimport { Children, RefObject, cloneElement, forwardRef, useRef } from 'react';\nimport { AriaButtonProps, mergeProps, useButton, useFocusRing } from 'react-aria';\n\nexport interface NavigationButtonProps extends AriaButtonProps {\n primaryLabel: string;\n secondaryLabel?: string;\n isExternalLink?: boolean;\n disabled?: boolean;\n}\n\nconst LeadingIcon = createSlot(({ children, ...props }) => {\n return (\n <Center>\n {Children.map(children, child => {\n return cloneElement(child, props);\n })}\n </Center>\n );\n});\n\nconst TrailingIcon = createSlot(({ children, ...props }) => {\n return (\n <Center>\n {Children.map(children, child => {\n return cloneElement(child, props);\n })}\n </Center>\n );\n});\n\nconst NavigationButtonBase = forwardRef<HTMLButtonElement, NavigationButtonProps>((props, forwardedRef) => {\n const { primaryLabel, secondaryLabel, isExternalLink, disabled } = props;\n\n const internalRef = useRef(null);\n const ref = forwardedRef || internalRef;\n\n const { buttonProps } = useButton({ ...props, isDisabled: disabled ?? false }, ref as RefObject<HTMLButtonElement>);\n const { isFocusVisible, focusProps } = useFocusRing();\n\n return createHost(props.children, slots => {\n const leadingIcon = slots.get(LeadingIcon);\n const trailingIcon = slots.get(TrailingIcon);\n\n return (\n <button\n {...mergeProps(buttonProps, focusProps)}\n ref={ref}\n className={flex({\n justifyContent: 'space-between',\n alignItems: 'center',\n w: 'full',\n p: 4,\n bg: 'neutral.quaternary',\n transition: 'background-color 0.2s',\n _hover: { bg: 'neutral.secondary' },\n rounded: 'lg',\n cursor: 'pointer',\n outlineColor: 'brand.base',\n outlineStyle: isFocusVisible ? 'solid' : 'none',\n outlineWidth: 'thick',\n outlineOffset: 0.5,\n _disabled: { opacity: '0.3', pointerEvents: 'none' },\n })}\n >\n <HStack>\n {leadingIcon && {\n ...leadingIcon,\n props: {\n ...leadingIcon.props,\n className: !leadingIcon.props.color ? css({ color: 'brand.base' }) : undefined,\n height: 24,\n },\n }}\n <Text styles={{ fontWeight: 500 }}>{primaryLabel}</Text>\n {isExternalLink && <IcoExternalLink width={14} height={14} color={token('colors.neutral.primary')} />}\n </HStack>\n <HStack>\n {secondaryLabel && (\n <Text size=\"sm\" styles={{ color: token('colors.text.tertiary') }}>\n {secondaryLabel}\n </Text>\n )}\n {trailingIcon && {\n ...trailingIcon,\n props: {\n ...trailingIcon.props,\n className: !trailingIcon.props.color ? css({ color: 'neutral.primary' }) : undefined,\n width: 16,\n height: 16,\n },\n }}\n </HStack>\n </button>\n );\n });\n});\n\nNavigationButtonBase.displayName = 'NavigationButton';\n\nconst NavigationButton = Object.assign(NavigationButtonBase, { LeadingIcon, TrailingIcon });\n\nexport default NavigationButton;\n"],"names":["LeadingIcon","createSlot","children","props","_jsx","Center","Children","child","cloneElement","TrailingIcon","NavigationButtonBase","forwardRef","forwardedRef","primaryLabel","secondaryLabel","isExternalLink","disabled","internalRef","useRef","ref","buttonProps","useButton","isFocusVisible","focusProps","useFocusRing","createHost","slots","leadingIcon","trailingIcon","_jsxs","mergeProps","flex","HStack","css","Text","IcoExternalLink","token","NavigationButton"],"mappings":"qsBAiBA,MAAMA,EAAcC,EAAW,CAAC,CAAE,SAAAC,EAAU,GAAGC,CAAO,IAElDC,EAACC,EAAM,CAAA,SACJC,EAAS,IAAIJ,EAAUK,GACfC,EAAaD,EAAOJ,CAAK,CACjC,CACM,CAAA,CAEZ,EAEKM,EAAeR,EAAW,CAAC,CAAE,SAAAC,EAAU,GAAGC,CAAO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,CAC9F,CAAA,EACTP,EAACG,EACE,CAAA,SAAA,CAAAlB,GACCV,EAAC8B,EAAK,CAAA,KAAK,KAAK,OAAQ,CAAE,MAAOE,EAAM,sBAAsB,CAAG,EAAA,SAC7DtB,CAAc,CAAA,EAGlBc,GAAgB,CACf,GAAGA,EACH,MAAO,CACL,GAAGA,EAAa,MAChB,UAAYA,EAAa,MAAM,MAA4C,OAApCK,EAAI,CAAE,MAAO,kBAAmB,EACvE,MAAO,GACP,OAAQ,EACT,EACF,CACM,CAAA,CAAA,CAAA,CAAA,CAGf,CAAC,CACH,CAAC,EAEDvB,EAAqB,YAAc,mBAE7B2B,MAAAA,EAAmB,OAAO,OAAO3B,EAAsB,CAAE,YAAAV,EAAa,aAAAS,CAAY,CAAE"}
|
|
@@ -4,6 +4,7 @@ export interface NavigationButtonProps extends AriaButtonProps {
|
|
|
4
4
|
primaryLabel: string;
|
|
5
5
|
secondaryLabel?: string;
|
|
6
6
|
isExternalLink?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
7
8
|
}
|
|
8
9
|
declare const NavigationButton: import("react").ForwardRefExoticComponent<NavigationButtonProps & import("react").RefAttributes<HTMLButtonElement>> & {
|
|
9
10
|
LeadingIcon: ({ children, ...props }: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-button.d.ts","sourceRoot":"","sources":["../../../../src/components/list-items/navigation-button.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,eAAe,EAAuC,MAAM,YAAY,CAAC;AAElF,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC5D,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"navigation-button.d.ts","sourceRoot":"","sources":["../../../../src/components/list-items/navigation-button.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,eAAe,EAAuC,MAAM,YAAY,CAAC;AAElF,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC5D,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA2FD,QAAA,MAAM,gBAAgB;;;CAAqE,CAAC;AAE5F,eAAe,gBAAgB,CAAC"}
|