@stackshift-ui/input-file 7.0.0-beta.5 → 7.0.0-beta.7
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/chunk-ALMEZKLK.mjs +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.mjs +2 -0
- package/dist/input-file.d.ts +18 -0
- package/dist/input-file.js +1 -0
- package/dist/input-file.mjs +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DefaultComponent as x,useStackShiftUIComponents as C}from"@stackshift-ui/system";import F from"classnames";import{useState as N}from"react";import{jsx as r,jsxs as m}from"react/jsx-runtime";var e="InputFile",T=({required:d=!1,variant:c="primary",name:t,ariaLabel:n,children:I,className:u,as:S,...f})=>{var s;let{[e]:E=x}=C(),[y,o]=N(""),a="my-1 ml-auto cursor-pointer rounded px-4 py-3 text-xs font-semibold leading-none transition duration-200",i=`${a} bg-primary-foreground hover:bg-primary`,g=`${a} text-primary-foreground border border-solid border-primary-foreground hover:bg-slate-100`,h=(s={primary:i,outline:g}[c])!=null?s:i,b=v=>{var p;let l=(p=v.target.files)==null?void 0:p[0];o(l?l.name:"")};return m("div",{className:"relative rounded-global bg-white px-2 w-full","data-testid":e==null?void 0:e.toLowerCase(),children:[r("input",{"aria-label":n!=null?n:"Attach file",className:"absolute w-full h-full opacity-0 cursor-pointer",type:"file",name:t,required:d,id:t,onChange:b,...f}),m("div",{className:"flex",children:[r("span",{className:"px-2 py-4 text-xs font-semibold leading-none",children:y}),r("label",{htmlFor:t,className:F(h,u),children:t})]})]})};T.displayName=e;export{T as a};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./input-file";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";var S=Object.create;var s=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var V=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var H=(e,t)=>{for(var n in t)s(e,n,{get:t[n],enumerable:!0})},y=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of R(t))!w.call(e,a)&&a!==n&&s(e,a,{get:()=>t[a],enumerable:!(o=E(t,a))||o.enumerable});return e};var M=(e,t,n)=>(n=e!=null?S(V(e)):{},y(t||!e||!e.__esModule?s(n,"default",{value:e,enumerable:!0}):n,e)),P=e=>y(s({},"__esModule",{value:!0}),e);var k={};H(k,{InputFile:()=>x});module.exports=P(k);var l=require("@stackshift-ui/system"),g=M(require("classnames")),h=require("react"),r=require("react/jsx-runtime"),i="InputFile",x=({required:e=!1,variant:t="primary",name:n,ariaLabel:o,children:a,className:b,as:q,...v})=>{var d;let{[i]:L=l.DefaultComponent}=(0,l.useStackShiftUIComponents)(),[C,p]=(0,h.useState)(""),m="my-1 ml-auto cursor-pointer rounded px-4 py-3 text-xs font-semibold leading-none transition duration-200",c=`${m} bg-primary-foreground hover:bg-primary`,F=`${m} text-primary-foreground border border-solid border-primary-foreground hover:bg-slate-100`,N=(d={primary:c,outline:F}[t])!=null?d:c,T=I=>{var f;let u=(f=I.target.files)==null?void 0:f[0];p(u?u.name:"")};return(0,r.jsxs)("div",{className:"relative rounded-global bg-white px-2 w-full","data-testid":i==null?void 0:i.toLowerCase(),children:[(0,r.jsx)("input",{"aria-label":o!=null?o:"Attach file",className:"absolute w-full h-full opacity-0 cursor-pointer",type:"file",name:n,required:e,id:n,onChange:T,...v}),(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)("span",{className:"px-2 py-4 text-xs font-semibold leading-none",children:C}),(0,r.jsx)("label",{htmlFor:n,className:(0,g.default)(N,b),children:n})]})]})};x.displayName=i;0&&(module.exports={InputFile});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ElementType, HTMLProps, ReactNode } from "react";
|
|
2
|
+
type Variant = "primary" | "outline";
|
|
3
|
+
export interface InputFileProps extends Omit<HTMLProps<HTMLInputElement>, "as"> {
|
|
4
|
+
required?: boolean;
|
|
5
|
+
variant?: Variant;
|
|
6
|
+
name: string;
|
|
7
|
+
ariaLabel: string;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
as?: ElementType;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Redundant since Input component was added
|
|
15
|
+
* @use Input component
|
|
16
|
+
* */
|
|
17
|
+
export declare const InputFile: React.FC<InputFileProps>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var S=Object.create;var s=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var V=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var H=(e,t)=>{for(var n in t)s(e,n,{get:t[n],enumerable:!0})},y=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of R(t))!w.call(e,a)&&a!==n&&s(e,a,{get:()=>t[a],enumerable:!(o=E(t,a))||o.enumerable});return e};var M=(e,t,n)=>(n=e!=null?S(V(e)):{},y(t||!e||!e.__esModule?s(n,"default",{value:e,enumerable:!0}):n,e)),P=e=>y(s({},"__esModule",{value:!0}),e);var k={};H(k,{InputFile:()=>b});module.exports=P(k);var l=require("@stackshift-ui/system"),g=M(require("classnames")),h=require("react"),r=require("react/jsx-runtime"),i="InputFile",b=({required:e=!1,variant:t="primary",name:n,ariaLabel:o,children:a,className:v,as:q,...x})=>{var c;let{[i]:L=l.DefaultComponent}=(0,l.useStackShiftUIComponents)(),[C,p]=(0,h.useState)(""),m="my-1 ml-auto cursor-pointer rounded px-4 py-3 text-xs font-semibold leading-none transition duration-200",d=`${m} bg-primary-foreground hover:bg-primary`,F=`${m} text-primary-foreground border border-solid border-primary-foreground hover:bg-slate-100`,N=(c={primary:d,outline:F}[t])!=null?c:d,T=I=>{var f;let u=(f=I.target.files)==null?void 0:f[0];p(u?u.name:"")};return(0,r.jsxs)("div",{className:"relative rounded-global bg-white px-2 w-full","data-testid":i==null?void 0:i.toLowerCase(),children:[(0,r.jsx)("input",{"aria-label":o!=null?o:"Attach file",className:"absolute w-full h-full opacity-0 cursor-pointer",type:"file",name:n,required:e,id:n,onChange:T,...x}),(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)("span",{className:"px-2 py-4 text-xs font-semibold leading-none",children:C}),(0,r.jsx)("label",{htmlFor:n,className:(0,g.default)(N,v),children:n})]})]})};b.displayName=i;0&&(module.exports={InputFile});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-ALMEZKLK.mjs";export{a as InputFile};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackshift-ui/input-file",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "7.0.0-beta.
|
|
4
|
+
"version": "7.0.0-beta.7",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -29,20 +29,20 @@
|
|
|
29
29
|
"typescript": "^5.6.2",
|
|
30
30
|
"vite-tsconfig-paths": "^5.0.1",
|
|
31
31
|
"vitest": "^2.1.1",
|
|
32
|
-
"@stackshift-ui/
|
|
33
|
-
"@stackshift-ui/
|
|
32
|
+
"@stackshift-ui/eslint-config": "6.0.10",
|
|
33
|
+
"@stackshift-ui/typescript-config": "6.0.10"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"classnames": "^2.5.1",
|
|
37
|
-
"@stackshift-ui/
|
|
38
|
-
"@stackshift-ui/
|
|
37
|
+
"@stackshift-ui/scripts": "7.0.0-beta.6",
|
|
38
|
+
"@stackshift-ui/system": "7.0.0-beta.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@types/react": "16.8 - 19",
|
|
42
42
|
"next": "10 - 14",
|
|
43
43
|
"react": "16.8 - 19",
|
|
44
44
|
"react-dom": "16.8 - 19",
|
|
45
|
-
"@stackshift-ui/system": ">=7.0.0-beta.
|
|
45
|
+
"@stackshift-ui/system": ">=7.0.0-beta.7"
|
|
46
46
|
},
|
|
47
47
|
"peerDependenciesMeta": {
|
|
48
48
|
"next": {
|