@dinefy/react-button 1.6.0 → 1.6.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/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -1
package/dist/index.cjs
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
'use strict';var
|
1
|
+
'use strict';var createRuntimeFn=require('@vanilla-extract/recipes/createRuntimeFn'),lucideReact=require('lucide-react'),jsxRuntime=require('react/jsx-runtime');require('./index.css');
|
2
|
+
var n=createRuntimeFn.createRuntimeFn({defaultClassName:"_9xoy1a0",variantClassNames:{},defaultVariants:{},compoundVariants:[]}),p="_9xoy1a2";var t=({icon:w,icons:c,size:g,iconProps:x,...o})=>{let e=typeof w=="string"?c==null?void 0:c[w]:w;if(!e)return null;let r={...x!=null?x:{},...g!=null?{size:g}:{}};return jsxRuntime.jsx(e,{"data-slot":"icon","aria-hidden":true,...r,...o})};t.displayName="Button.Icon";var a=({value:w,children:c})=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:w!=null?w:c});a.displayName="Button.Value";var i=({className:w,type:c="button",children:g,isLoading:x=false,...o})=>{let e=[n(),w].filter(Boolean).join(" "),r=!!o.disabled||x,s=o["aria-label"];return jsxRuntime.jsxs("button",{...o,className:e,type:c,disabled:r,"aria-busy":x||void 0,"aria-label":s,children:[x&&jsxRuntime.jsx(lucideReact.LoaderCircle,{"data-slot":"spinner",className:p,"aria-hidden":true}),!x&&g]})};i.displayName="Button";var f=Object.assign(i,{Icon:t,Value:a});exports.Button=f;//# sourceMappingURL=index.cjs.map
|
2
3
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../button.css.ts","../components/ButtonIcon.tsx","../components/ButtonValue.tsx","../Button.tsx"],"names":["button","_7a468","spinner","ButtonIcon","icon","icons","size","iconProps","restProps","IconComp","mergedIconProps","jsx","ButtonValue","value","children","Fragment","ButtonBase","className","type","isLoading","props","mergedClassName","isDisabled","computedAriaLabel","jsxs","LoaderCircle","Button"],"mappings":"
|
1
|
+
{"version":3,"sources":["../button.css.ts","../components/ButtonIcon.tsx","../components/ButtonValue.tsx","../Button.tsx"],"names":["button","_7a468","spinner","ButtonIcon","icon","icons","size","iconProps","restProps","IconComp","mergedIconProps","jsx","ButtonValue","value","children","Fragment","ButtonBase","className","type","isLoading","props","mergedClassName","isDisabled","computedAriaLabel","jsxs","LoaderCircle","Button"],"mappings":";AAGO,IAAIA,EAASC,+BAAAA,CAAO,CAAC,gBAAA,CAAiB,UAAA,CAAW,iBAAA,CAAkB,GAAG,eAAA,CAAgB,EAAC,CAAE,gBAAA,CAAiB,EAAE,CAAC,CAAA,CACzGC,CAAAA,CAAU,UAAA,CCOd,IAAMC,CAAAA,CAAa,CAAC,CAAE,IAAA,CAAAC,CAAAA,CAAM,KAAA,CAAAC,CAAAA,CAAO,IAAA,CAAAC,EAAM,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAU,CAAA,GAAuB,CAC9F,IAAMC,CAAAA,CAAsC,OAAOL,CAAAA,EAAS,QAAA,CAAWC,CAAAA,EAAA,IAAA,CAAA,MAAA,CAAAA,EAAQD,CAAAA,CAAAA,CAAQA,CAAAA,CACvF,GAAI,CAACK,CAAAA,CAAU,OAAO,IAAA,CACtB,IAAMC,CAAAA,CAAkB,CAAE,GAAIH,CAAAA,EAAA,KAAAA,CAAAA,CAAa,EAAC,CAAI,GAAID,CAAAA,EAAQ,IAAA,CAAO,CAAE,IAAA,CAAAA,CAAK,CAAA,CAAI,EAAI,CAAA,CAClF,OAAOK,cAAAA,CAACF,CAAAA,CAAA,CAAS,WAAA,CAAU,MAAA,CAAO,aAAA,CAAW,KAAE,GAAGC,CAAAA,CAAkB,GAAGF,CAAAA,CAAW,CACnF,CAAA,CAEAL,EAAW,WAAA,CAAc,aA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Gaq0i7mNqrkYepfaqZ0JrEUyPSYRgJYvdfAxRmzViXyA2ddMzRE3WiH+9UOEasY8UO6e7xLoPu0CIBVp6LaF9QEgFKhGGaqSMWMHqirXAawQl0KPrcaTw2g1J1w3CkHUr9km0UZZKlvhosFsErQXb+Y2xpV7ICkY1SybrmRpowVrXyaovn/79Dk11e3yEDgAA';\nimport 'src/button/button.css.ts.vanilla.css?source=#H4sIAAAAAAAAE42UwW7bMAyG73kKHRtgKpIUaxv3sjcZaIuyucikIcmxvSHvPlhJY8fNsNws//xIgvylHwccrIcag/q572XYwlb9WSllvdTpQ6nogYMVX2fKS4SITxuD5fpjpdRppVSUf8a9vM4iT6vnS4VNAnIoDqWXlo0uxInP1BH8k9Zd178V5Vui7givScjFG/SZYmGcztqDoTbcAtt4IXod6DdxmX1G59KPSgPGpN9zatckygrHEcOFOiTVUGgcDJkidsSorcOUERyVrCliHTJVIEf04+9fbYhkB10IR+Q4l0poFhVkqt8hlVW81V/ySbdQkxsWfJv01FZ1j/9+HnDrwzjhRuizlbRGiiScfdnR7WD369uzWX87j7kCI93/Y6WNqb+HUn/MDZRVckT/gI32Cw6KSEd8AHxfgFaKNugjBcrdmb90n6ld06sgjsyXBNcgLdYGXKxgx4sahgLkDs0D7eU322OJGpyTDs084y4l6sjEalEZEn7PFxdp6ezcSXFI1maq4WyO63uxeX4PyWngFbElppguZUfO6aICLjGbXoerx8aDFk8l8XQVTn8BUFMLi5EEAAA=';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var button = _7a468({defaultClassName:'_9xoy1a0',variantClassNames:{},defaultVariants:{},compoundVariants:[]});\nexport var spinner = '_9xoy1a2';","import type { ComponentType } from \"react\";\n\nexport type IconComponent = ComponentType<{ size?: number }>;\n\nexport type ButtonIconProps = Record<string, unknown> & {\n\ticon: IconComponent | string;\n\ticons?: Record<string, IconComponent>;\n\tsize?: number;\n\ticonProps?: Record<string, unknown>;\n};\n\nexport const ButtonIcon = ({ icon, icons, size, iconProps, ...restProps }: ButtonIconProps) => {\n\tconst IconComp: IconComponent | undefined = typeof icon === \"string\" ? icons?.[icon] : icon;\n\tif (!IconComp) return null;\n\tconst mergedIconProps = { ...(iconProps ?? {}), ...(size != null ? { size } : {}) };\n\treturn <IconComp data-slot=\"icon\" aria-hidden {...mergedIconProps} {...restProps} />;\n};\n\nButtonIcon.displayName = \"Button.Icon\";\n","import type { ReactNode } from \"react\";\n\nexport type ButtonValueProps = { value?: ReactNode; children?: ReactNode };\n\nexport const ButtonValue = ({ value, children }: ButtonValueProps) => <>{value ?? children}</>;\n\nButtonValue.displayName = \"Button.Value\";\n","import { LoaderCircle } from \"lucide-react\";\nimport type { ButtonHTMLAttributes, ReactNode } from \"react\";\nimport { button, spinner } from \"./button.css\";\nimport { ButtonIcon } from \"./components/ButtonIcon\";\nimport { ButtonValue } from \"./components/ButtonValue\";\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n\tchildren?: ReactNode;\n\tisLoading?: boolean;\n}\n\nconst ButtonBase = ({\n\tclassName,\n\ttype = \"button\",\n\tchildren,\n\tisLoading = false,\n\t...props\n}: ButtonProps) => {\n\tconst mergedClassName = [button(), className].filter(Boolean).join(\" \");\n\tconst isDisabled = Boolean(props.disabled) || isLoading;\n\tconst computedAriaLabel = props[\"aria-label\"];\n\n\treturn (\n\t\t<button\n\t\t\t{...props}\n\t\t\tclassName={mergedClassName}\n\t\t\ttype={type}\n\t\t\tdisabled={isDisabled}\n\t\t\taria-busy={isLoading || undefined}\n\t\t\taria-label={computedAriaLabel}\n\t\t>\n\t\t\t{isLoading && <LoaderCircle data-slot=\"spinner\" className={spinner} aria-hidden />}\n\t\t\t{!isLoading && children}\n\t\t</button>\n\t);\n};\n\nButtonBase.displayName = \"Button\";\n\nexport const Button = Object.assign(ButtonBase, {\n\tIcon: ButtonIcon,\n\tValue: ButtonValue,\n});\n"]}
|
package/dist/index.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import
|
1
|
+
import'./index.css';import {createRuntimeFn}from'@vanilla-extract/recipes/createRuntimeFn';import {LoaderCircle}from'lucide-react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var n=createRuntimeFn({defaultClassName:"_9xoy1a0",variantClassNames:{},defaultVariants:{},compoundVariants:[]}),p="_9xoy1a2";var t=({icon:w,icons:c,size:g,iconProps:x,...o})=>{let e=typeof w=="string"?c==null?void 0:c[w]:w;if(!e)return null;let r={...x!=null?x:{},...g!=null?{size:g}:{}};return jsx(e,{"data-slot":"icon","aria-hidden":true,...r,...o})};t.displayName="Button.Icon";var a=({value:w,children:c})=>jsx(Fragment,{children:w!=null?w:c});a.displayName="Button.Value";var i=({className:w,type:c="button",children:g,isLoading:x=false,...o})=>{let e=[n(),w].filter(Boolean).join(" "),r=!!o.disabled||x,s=o["aria-label"];return jsxs("button",{...o,className:e,type:c,disabled:r,"aria-busy":x||void 0,"aria-label":s,children:[x&&jsx(LoaderCircle,{"data-slot":"spinner",className:p,"aria-hidden":true}),!x&&g]})};i.displayName="Button";var f=Object.assign(i,{Icon:t,Value:a});export{f as Button};//# sourceMappingURL=index.mjs.map
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../button.css.ts","../components/ButtonIcon.tsx","../components/ButtonValue.tsx","../Button.tsx"],"names":["button","_7a468","spinner","ButtonIcon","icon","icons","size","iconProps","restProps","IconComp","mergedIconProps","jsx","ButtonValue","value","children","Fragment","ButtonBase","className","type","isLoading","props","mergedClassName","isDisabled","computedAriaLabel","jsxs","LoaderCircle","Button"],"mappings":"
|
1
|
+
{"version":3,"sources":["../button.css.ts","../components/ButtonIcon.tsx","../components/ButtonValue.tsx","../Button.tsx"],"names":["button","_7a468","spinner","ButtonIcon","icon","icons","size","iconProps","restProps","IconComp","mergedIconProps","jsx","ButtonValue","value","children","Fragment","ButtonBase","className","type","isLoading","props","mergedClass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ws//xIgvylHwccrIcag/q572XYwlb9WSllvdTpQ6nogYMVX2fKS4SITxuD5fpjpdRppVSUf8a9vM4iT6vnS4VNAnIoDqWXlo0uxInP1BH8k9Zd178V5Vui7givScjFG/SZYmGcztqDoTbcAtt4IXod6DdxmX1G59KPSgPGpN9zatckygrHEcOFOiTVUGgcDJkidsSorcOUERyVrCliHTJVIEf04+9fbYhkB10IR+Q4l0poFhVkqt8hlVW81V/ySbdQkxsWfJv01FZ1j/9+HnDrwzjhRuizlbRGiiScfdnR7WD369uzWX87j7kCI93/Y6WNqb+HUn/MDZRVckT/gI32Cw6KSEd8AHxfgFaKNugjBcrdmb90n6ld06sgjsyXBNcgLdYGXKxgx4sahgLkDs0D7eU322OJGpyTDs084y4l6sjEalEZEn7PFxdp6ezcSXFI1maq4WyO63uxeX4PyWngFbElppguZUfO6aICLjGbXoerx8aDFk8l8XQVTn8BUFMLi5EEAAA=';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var button = _7a468({defaultClassName:'_9xoy1a0',variantClassNames:{},defaultVariants:{},compoundVariants:[]});\nexport var spinner = '_9xoy1a2';","import type { ComponentType } from \"react\";\n\nexport type IconComponent = ComponentType<{ size?: number }>;\n\nexport type ButtonIconProps = Record<string, unknown> & {\n\ticon: IconComponent | string;\n\ticons?: Record<string, IconComponent>;\n\tsize?: number;\n\ticonProps?: Record<string, unknown>;\n};\n\nexport const ButtonIcon = ({ icon, icons, size, iconProps, ...restProps }: ButtonIconProps) => {\n\tconst IconComp: IconComponent | undefined = typeof icon === \"string\" ? icons?.[icon] : icon;\n\tif (!IconComp) return null;\n\tconst mergedIconProps = { ...(iconProps ?? {}), ...(size != null ? { size } : {}) };\n\treturn <IconComp data-slot=\"icon\" aria-hidden {...mergedIconProps} {...restProps} />;\n};\n\nButtonIcon.displayName = \"Button.Icon\";\n","import type { ReactNode } from \"react\";\n\nexport type ButtonValueProps = { value?: ReactNode; children?: ReactNode };\n\nexport const ButtonValue = ({ value, children }: ButtonValueProps) => <>{value ?? children}</>;\n\nButtonValue.displayName = \"Button.Value\";\n","import { LoaderCircle } from \"lucide-react\";\nimport type { ButtonHTMLAttributes, ReactNode } from \"react\";\nimport { button, spinner } from \"./button.css\";\nimport { ButtonIcon } from \"./components/ButtonIcon\";\nimport { ButtonValue } from \"./components/ButtonValue\";\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n\tchildren?: ReactNode;\n\tisLoading?: boolean;\n}\n\nconst ButtonBase = ({\n\tclassName,\n\ttype = \"button\",\n\tchildren,\n\tisLoading = false,\n\t...props\n}: ButtonProps) => {\n\tconst mergedClassName = [button(), className].filter(Boolean).join(\" \");\n\tconst isDisabled = Boolean(props.disabled) || isLoading;\n\tconst computedAriaLabel = props[\"aria-label\"];\n\n\treturn (\n\t\t<button\n\t\t\t{...props}\n\t\t\tclassName={mergedClassName}\n\t\t\ttype={type}\n\t\t\tdisabled={isDisabled}\n\t\t\taria-busy={isLoading || undefined}\n\t\t\taria-label={computedAriaLabel}\n\t\t>\n\t\t\t{isLoading && <LoaderCircle data-slot=\"spinner\" className={spinner} aria-hidden />}\n\t\t\t{!isLoading && children}\n\t\t</button>\n\t);\n};\n\nButtonBase.displayName = \"Button\";\n\nexport const Button = Object.assign(ButtonBase, {\n\tIcon: ButtonIcon,\n\tValue: ButtonValue,\n});\n"]}
|
package/package.json
CHANGED
@@ -1,13 +1,22 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
3
3
|
"name": "@dinefy/react-button",
|
4
|
-
"version": "1.6.
|
4
|
+
"version": "1.6.1",
|
5
5
|
"description": "Dinefy React Web UI - Button component",
|
6
6
|
"type": "module",
|
7
7
|
"private": false,
|
8
8
|
"main": "./dist/index.cjs",
|
9
9
|
"module": "./dist/index.mjs",
|
10
10
|
"types": "./dist/index.d.ts",
|
11
|
+
"exports": {
|
12
|
+
".": {
|
13
|
+
"types": "./dist/index.d.ts",
|
14
|
+
"import": "./dist/index.mjs",
|
15
|
+
"require": "./dist/index.cjs",
|
16
|
+
"default": "./dist/index.mjs"
|
17
|
+
},
|
18
|
+
"./style.css": "./dist/index.css"
|
19
|
+
},
|
11
20
|
"files": [
|
12
21
|
"dist/**"
|
13
22
|
],
|