@paolojulian.dev/design-system 4.2.1 → 4.3.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/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +49 -2
- package/dist/index.es.js +226 -126
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("./utils.cjs.js"),g=require("react"),L=({children:t,gap:a=void 0,alignItems:e=void 0,justifyContent:n=void 0,className:s=""})=>r.jsx("div",{className:c.cn("flex flex-row",s),style:{gap:a,alignItems:e,justifyContent:n},children:t}),I=({children:t,gap:a=void 0,alignItems:e=void 0,justifyContent:n=void 0,className:s=""})=>r.jsx("div",{className:c.cn("flex flex-col",s),style:{gap:a,alignItems:e,justifyContent:n},children:t});function C(t){var a,e,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(a=0;a<t.length;a++)t[a]&&(e=C(t[a]))&&(n&&(n+=" "),n+=e);else for(a in t)t[a]&&(n&&(n+=" "),n+=a);return n}function O(){for(var t,a,e=0,n="";e<arguments.length;)(t=arguments[e++])&&(a=C(t))&&(n&&(n+=" "),n+=a);return n}const N=t=>typeof t=="boolean"?"".concat(t):t===0?"0":t,P=O,$=(t,a)=>e=>{var n;if((a==null?void 0:a.variants)==null)return P(t,e==null?void 0:e.class,e==null?void 0:e.className);const{variants:s,defaultVariants:i}=a,l=Object.keys(s).map(o=>{const u=e==null?void 0:e[o],f=i==null?void 0:i[o];if(u===null)return null;const d=N(u)||N(f);return s[o][d]}),x=e&&Object.entries(e).reduce((o,u)=>{let[f,d]=u;return d===void 0||(o[f]=d),o},{}),b=a==null||(n=a.compoundVariants)===null||n===void 0?void 0:n.reduce((o,u)=>{let{class:f,className:d,...v}=u;return Object.entries(v).every(m=>{let[p,h]=m;return Array.isArray(h)?h.includes({...i,...x}[p]):{...i,...x}[p]===h})?[...o,f,d]:o},[]);return P(t,l,b,e==null?void 0:e.class,e==null?void 0:e.className)},H={serif:"font-serif",body:"text-base","body-wide":"text-sm tracking-[0.40em] font-medium",heading:"text-[1.5rem] md:text-4xl tracking-[-0.04em] font-medium","heading-lg":"text-[2.5rem] md:text-[4rem] tracking-[-0.04em] font-medium leading-[2.75rem] md:leading-[4.5rem]","heading-xl":"text-[4rem] md:text-[7rem] tracking-[-0.04em] leading-[3.5rem] md:leading-[5.5rem] font-medium"},W=$("font-sans",{variants:{variant:H},defaultVariants:{variant:"body"}});function S({as:t="p",children:a,className:e="",variant:n,...s}){return r.jsx(t,{className:c.cn(W({variant:n,className:e})),...s,children:a})}function F({title:t}){return r.jsx(I,{className:"pt-2 border-t border-white text-white",children:r.jsx(S,{className:"uppercase",variant:"body-wide",children:t})})}function M(){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[r.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),r.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function z(){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[r.jsx("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),r.jsx("path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"}),r.jsx("path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"}),r.jsx("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]})}const A=g.forwardRef(({className:t,inputClassName:a,type:e,label:n,helperText:s,id:i,isError:l=!1,errorMessage:x,rightAdornment:b,disabled:o,readOnly:u,style:f,...d},v)=>{const m=g.useId(),p=i??m,h=`${p}-error`,w=`${p}-helper`,y=e==="password",k=!!b&&!y,[j,T]=g.useState(!1),q=y?j?"text":"password":e??"text",B=[l&&x?h:null,!l&&s?w:null].filter(Boolean).join(" ")||void 0;return r.jsxs("div",{className:c.cn("p-text-input relative w-full",t),style:f,children:[r.jsx("input",{...d,id:p,ref:v,type:q,disabled:o,readOnly:u,placeholder:" ","aria-invalid":l||void 0,"aria-describedby":B,"aria-required":d.required,"aria-disabled":o,"aria-readonly":u,autoComplete:d.autoComplete??(y?"current-password":void 0),className:c.cn("peer h-16 w-full rounded px-4 pt-6 pb-2",(y||k)&&"pr-12","bg-(--p-input-bg) text-(--p-input-text)","font-sans text-sm outline-none","border border-(--p-input-border) focus:border-(--p-input-border-focus)","focus:bg-(--p-input-bg-focus)","focus:ring-2 focus:ring-(--p-input-ring)","transition-all duration-150 ease-in","disabled:cursor-not-allowed disabled:opacity-50","read-only:cursor-default read-only:bg-(--p-input-bg-readonly)",l&&"ring-2 ring-red-500",k&&e==="date"&&"[&::-webkit-calendar-picker-indicator]:absolute [&::-webkit-calendar-picker-indicator]:right-0 [&::-webkit-calendar-picker-indicator]:h-full [&::-webkit-calendar-picker-indicator]:w-full [&::-webkit-calendar-picker-indicator]:cursor-pointer [&::-webkit-calendar-picker-indicator]:opacity-0",a)}),r.jsx("span",{"aria-hidden":"true",className:c.cn("pointer-events-none absolute top-2 left-4","font-sans text-xs","origin-left transition-all duration-150 ease-in","scale-0 opacity-0",l?"text-red-500":"text-(--p-input-label) peer-focus:text-(--p-input-label-focus)","peer-focus:scale-100 peer-focus:opacity-100","peer-not-placeholder-shown:scale-100 peer-not-placeholder-shown:opacity-100"),children:n}),r.jsx("label",{htmlFor:p,className:c.cn("pointer-events-none absolute top-1/2 left-4 -translate-y-1/2","font-sans text-sm text-(--p-input-text)","origin-left transition-all duration-150 ease-in","peer-focus:scale-0 peer-focus:opacity-0","peer-not-placeholder-shown:scale-0 peer-not-placeholder-shown:opacity-0",o&&"opacity-50"),children:n}),y&&r.jsx("button",{type:"button",onClick:()=>T(R=>!R),disabled:o,className:c.cn("absolute top-1/2 right-4 -translate-y-1/2","text-(--p-input-label) hover:text-(--p-input-text)","transition-colors duration-150","focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-(--p-input-ring)","disabled:pointer-events-none disabled:opacity-50"),"aria-label":j?"Hide password":"Show password","aria-pressed":j,"aria-controls":p,children:j?r.jsx(M,{}):r.jsx(z,{})}),k&&r.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 right-4 -translate-y-1/2 text-(--p-input-label)",children:b}),l&&x&&r.jsx("p",{id:h,role:"alert",className:"mt-1 px-4 font-sans text-xs text-red-500",children:x}),!l&&s&&r.jsx("p",{id:w,className:"mt-1 px-4 font-sans text-xs text-(--p-input-text-helper)",children:s})]})});A.displayName="PTextInput";const V=g.forwardRef(({className:t,textareaClassName:a,label:e,helperText:n,id:s,isError:i=!1,errorMessage:l,disabled:x,readOnly:b,rows:o=4,style:u,...f},d)=>{const v=g.useId(),m=s??v,p=`${m}-error`,h=`${m}-helper`,w=[i&&l?p:null,!i&&n?h:null].filter(Boolean).join(" ")||void 0;return r.jsxs("div",{className:c.cn("p-text-area relative w-full",t),style:u,children:[r.jsx("textarea",{...f,id:m,ref:d,rows:o,disabled:x,readOnly:b,placeholder:" ","aria-invalid":i||void 0,"aria-describedby":w,"aria-required":f.required,"aria-disabled":x,"aria-readonly":b,className:c.cn("peer w-full rounded px-4 pt-8 pb-3","bg-(--p-textarea-bg) text-(--p-textarea-text)","font-sans text-sm outline-none","border border-(--p-textarea-border) focus:border-(--p-textarea-border-focus)","focus:bg-(--p-textarea-bg-focus)","focus:ring-2 focus:ring-(--p-textarea-ring)","resize-y","transition-all duration-150 ease-in","disabled:cursor-not-allowed disabled:opacity-50","read-only:cursor-default read-only:bg-(--p-textarea-bg-readonly)",i&&"ring-2 ring-red-500",a)}),r.jsx("span",{"aria-hidden":"true",className:c.cn("pointer-events-none absolute top-2 left-4","font-sans text-xs","origin-left transition-all duration-150 ease-in","scale-0 opacity-0",i?"text-red-500":"text-(--p-textarea-label) peer-focus:text-(--p-textarea-label-focus)","peer-focus:scale-100 peer-focus:opacity-100","peer-not-placeholder-shown:scale-100 peer-not-placeholder-shown:opacity-100"),children:e}),r.jsx("label",{htmlFor:m,className:c.cn("pointer-events-none absolute top-4 left-4","font-sans text-sm text-(--p-textarea-text)","origin-left transition-all duration-150 ease-in","peer-focus:scale-0 peer-focus:opacity-0","peer-not-placeholder-shown:scale-0 peer-not-placeholder-shown:opacity-0",x&&"opacity-50"),children:e}),i&&l&&r.jsx("p",{id:p,role:"alert",className:"mt-1 px-4 font-sans text-xs text-red-500",children:l}),!i&&n&&r.jsx("p",{id:h,className:"mt-1 px-4 font-sans text-xs text-(--p-textarea-text-helper)",children:n})]})});V.displayName="PTextArea";exports.PSectionHeader=F;exports.PTextArea=V;exports.PTextInput=A;exports.PTypography=S;exports.Row=L;exports.Stack=I;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/components/PContainers/Row/Row.tsx","../src/components/PContainers/Stack/Stack.tsx","../node_modules/class-variance-authority/node_modules/clsx/dist/clsx.mjs","../node_modules/class-variance-authority/dist/index.mjs","../src/components/PTypography/PTypography.constants.ts","../src/components/PTypography/PTypography.tsx","../src/components/PSectionHeader/PSectionHeader.tsx","../src/components/PTextInput/PTextInput.tsx"],"sourcesContent":["import { CSSProperties, FC, ReactNode } from 'react';\nimport cn from '../../../utils/cn';\n\nexport type RowProps = {\n children: ReactNode;\n gap?: CSSProperties['gap'];\n alignItems?: CSSProperties['alignItems'];\n justifyContent?: CSSProperties['justifyContent'];\n className?: string;\n};\n\nconst Row: FC<RowProps> = ({\n children,\n gap = undefined,\n alignItems = undefined,\n justifyContent = undefined,\n className = '',\n}) => {\n return (\n <div\n className={cn('flex flex-row', className)}\n style={{\n gap,\n alignItems,\n justifyContent,\n }}\n >\n {children}\n </div>\n );\n};\n\nexport default Row;\n","import { CSSProperties, FC, ReactNode } from 'react';\nimport cn from '../../../utils/cn';\n\nexport type StackProps = {\n children: ReactNode;\n gap?: CSSProperties['gap'];\n alignItems?: CSSProperties['alignItems'];\n justifyContent?: CSSProperties['justifyContent'];\n className?: string;\n};\n\nconst Stack: FC<StackProps> = ({\n children,\n gap = undefined,\n alignItems = undefined,\n justifyContent = undefined,\n className = '',\n}) => {\n return (\n <div\n className={cn('flex flex-col', className)}\n style={{\n gap,\n alignItems,\n justifyContent,\n }}\n >\n {children}\n </div>\n );\n};\n\nexport default Stack;\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f);else for(t in e)e[t]&&(n&&(n+=\" \"),n+=t);return n}export function clsx(){for(var e,t,f=0,n=\"\";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","import { clsx } from \"clsx\";\nconst falsyToString = (value)=>typeof value === \"boolean\" ? \"\".concat(value) : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>{\n return (props)=>{\n var ref;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants , defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (ref = config.compoundVariants) === null || ref === void 0 ? void 0 : ref.reduce((acc, param1)=>{\n let { class: cvClass , className: cvClassName , ...compoundVariantOptions } = param1;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n};\n\n\n//# sourceMappingURL=index.mjs.map","import { cva } from 'class-variance-authority';\n\ntype FontVariants =\n | 'serif'\n | 'body'\n | 'body-wide'\n | 'heading'\n | 'heading-lg'\n | 'heading-xl';\n\nconst fontVariantsMap = {\n serif: 'font-serif',\n body: 'text-base',\n 'body-wide': 'text-sm tracking-[0.40em] font-medium',\n heading: 'text-[1.5rem] md:text-4xl tracking-[-0.04em] font-medium',\n 'heading-lg':\n 'text-[2.5rem] md:text-[4rem] tracking-[-0.04em] font-medium leading-[2.75rem] md:leading-[4.5rem]',\n 'heading-xl':\n 'text-[4rem] md:text-[7rem] tracking-[-0.04em] leading-[3.5rem] md:leading-[5.5rem] font-medium',\n} satisfies Record<FontVariants, string>;\n\nexport const PTypographyVariants = cva('font-sans', {\n variants: {\n variant: fontVariantsMap,\n },\n defaultVariants: {\n variant: 'body',\n },\n});\n","import { VariantProps } from 'class-variance-authority';\nimport { HTMLAttributes } from 'react';\nimport '../../index.css';\nimport cn from '../../utils/cn';\nimport { PTypographyVariants } from './PTypography.constants';\n\nexport interface PTypographyProps\n extends VariantProps<typeof PTypographyVariants>,\n HTMLAttributes<HTMLElement> {\n as?: React.ElementType;\n children: React.ReactNode;\n}\n\nexport default function PTypography({\n as: Element = 'p',\n children,\n className = '',\n variant,\n ...props\n}: PTypographyProps) {\n return (\n <Element\n className={cn(PTypographyVariants({ variant, className }))}\n {...props}\n >\n {children}\n </Element>\n );\n}\n","import { Stack } from '../PContainers';\nimport { PTypography } from '../PTypography';\n\ninterface Props {\n title: string;\n}\n\nexport default function PSectionHeader({ title }: Props) {\n return (\n <Stack className='pt-2 border-t border-white text-white'>\n <PTypography className='uppercase' variant='body-wide'>\n {title}\n </PTypography>\n </Stack>\n );\n}\n","import { forwardRef, type InputHTMLAttributes, type ReactNode, useId, useState } from 'react';\nimport '../../index.css';\nimport cn from '../../utils/cn';\n\nexport type PTextInputRef = HTMLInputElement;\n\nexport type PTextInputProps = {\n /** Applied to the root wrapper element. */\n className?: string;\n /** Applied to the inner `<input>` element for layout / spacing overrides. */\n inputClassName?: string;\n /** Visible label — doubles as the floating label and the placeholder. */\n label: string;\n /** Shown below the field when there is no error. */\n helperText?: string;\n isError?: boolean;\n /** Shown below the field when `isError` is true. Announced immediately via `role=\"alert\"`. */\n errorMessage?: string;\n /** Decorative element placed on the trailing edge. Ignored when `type=\"password\"`. */\n rightAdornment?: ReactNode;\n} & Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'className' | 'placeholder' | 'aria-label' | 'aria-describedby'\n>;\n\n// ─── Inline SVG icons ────────────────────────────────────────────────────────\n\nfunction EyeIcon() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path d=\"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\nfunction EyeOffIcon() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path d=\"M9.88 9.88a3 3 0 1 0 4.24 4.24\" />\n <path d=\"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68\" />\n <path d=\"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61\" />\n <line x1=\"2\" x2=\"22\" y1=\"2\" y2=\"22\" />\n </svg>\n );\n}\n\n// ─── Component ───────────────────────────────────────────────────────────────\n\nexport const PTextInput = forwardRef<PTextInputRef, PTextInputProps>(\n (\n {\n className,\n inputClassName,\n type,\n label,\n helperText,\n id,\n isError = false,\n errorMessage,\n rightAdornment,\n disabled,\n readOnly,\n style,\n ...props\n },\n ref,\n ) => {\n const generatedId = useId();\n const inputId = id ?? generatedId;\n const errorId = `${inputId}-error`;\n const helperId = `${inputId}-helper`;\n\n const isPassword = type === 'password';\n const hasRightAdornment = Boolean(rightAdornment) && !isPassword;\n const [showPassword, setShowPassword] = useState(false);\n\n const inputType = isPassword ? (showPassword ? 'text' : 'password') : (type ?? 'text');\n\n const describedBy = [\n isError && errorMessage ? errorId : null,\n !isError && helperText ? helperId : null,\n ]\n .filter(Boolean)\n .join(' ') || undefined;\n\n return (\n <div className={cn('relative w-full', className)} style={style}>\n <input\n {...props}\n id={inputId}\n ref={ref}\n type={inputType}\n disabled={disabled}\n readOnly={readOnly}\n // Empty string required for the CSS peer-not-placeholder-shown trick.\n placeholder=\" \"\n // Accessibility\n aria-invalid={isError || undefined}\n aria-describedby={describedBy}\n aria-required={props.required}\n aria-disabled={disabled}\n aria-readonly={readOnly}\n autoComplete={props.autoComplete ?? (isPassword ? 'current-password' : undefined)}\n className={cn(\n // Layout — tall enough for the floating label + value\n 'peer h-16 w-full rounded px-4 pt-6 pb-2',\n (isPassword || hasRightAdornment) && 'pr-12',\n // Visuals\n 'bg-white text-black',\n 'font-sans text-sm outline-none',\n 'border border-black focus:border-black',\n // Focus\n 'focus:ring-2 focus:ring-primary',\n // Motion\n 'transition-all duration-150 ease-in',\n // States\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'read-only:cursor-default read-only:bg-gray-lighter',\n isError && 'ring-2 ring-red-500',\n // Date — hide native picker chrome so rightAdornment can replace it\n hasRightAdornment &&\n type === 'date' &&\n '[&::-webkit-calendar-picker-indicator]:absolute [&::-webkit-calendar-picker-indicator]:right-0 [&::-webkit-calendar-picker-indicator]:h-full [&::-webkit-calendar-picker-indicator]:w-full [&::-webkit-calendar-picker-indicator]:cursor-pointer [&::-webkit-calendar-picker-indicator]:opacity-0',\n inputClassName,\n )}\n />\n\n {/*\n * Floating label — shown above the value when focused or filled.\n * aria-hidden: the <label> below already provides the accessible name.\n */}\n <span\n aria-hidden=\"true\"\n className={cn(\n 'pointer-events-none absolute top-2 left-4',\n 'font-sans text-xs',\n 'origin-left transition-all duration-150 ease-in',\n // Hidden by default\n 'scale-0 opacity-0',\n isError\n ? 'text-red-500'\n : 'text-gray-darker peer-focus:text-primary',\n // Reveal when focused or filled\n 'peer-focus:scale-100 peer-focus:opacity-100',\n 'peer-not-placeholder-shown:scale-100 peer-not-placeholder-shown:opacity-100',\n )}\n >\n {label}\n </span>\n\n {/*\n * Placeholder label — centered in the field when empty and unfocused.\n * pointer-events-none lets clicks fall through to the input beneath;\n * htmlFor still wires up the accessible name correctly.\n */}\n <label\n htmlFor={inputId}\n className={cn(\n 'pointer-events-none absolute top-1/2 left-4 -translate-y-1/2',\n 'font-sans text-sm text-black',\n 'origin-left transition-all duration-150 ease-in',\n // Collapse when focused or filled\n 'peer-focus:scale-0 peer-focus:opacity-0',\n 'peer-not-placeholder-shown:scale-0 peer-not-placeholder-shown:opacity-0',\n disabled && 'opacity-50',\n )}\n >\n {label}\n </label>\n\n {/* Password toggle */}\n {isPassword && (\n <button\n type=\"button\"\n onClick={() => setShowPassword((v) => !v)}\n disabled={disabled}\n className={cn(\n 'absolute top-1/2 right-4 -translate-y-1/2',\n 'text-gray-darker hover:text-black',\n 'transition-colors duration-150',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary',\n 'disabled:pointer-events-none disabled:opacity-50',\n )}\n aria-label={showPassword ? 'Hide password' : 'Show password'}\n aria-pressed={showPassword}\n aria-controls={inputId}\n >\n {showPassword ? <EyeIcon /> : <EyeOffIcon />}\n </button>\n )}\n\n {/* Right adornment — decorative, hidden from assistive tech */}\n {hasRightAdornment && (\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute top-1/2 right-4 -translate-y-1/2 text-gray-darker\"\n >\n {rightAdornment}\n </span>\n )}\n\n {/* Error message — announced immediately via role=\"alert\" */}\n {isError && errorMessage && (\n <p id={errorId} role=\"alert\" className=\"mt-1 px-4 font-sans text-xs text-red-500\">\n {errorMessage}\n </p>\n )}\n\n {/* Helper text — visible only when there is no error */}\n {!isError && helperText && (\n <p id={helperId} className=\"mt-1 px-4 font-sans text-xs text-gray-darker\">\n {helperText}\n </p>\n )}\n </div>\n );\n },\n);\n\nPTextInput.displayName = 'PTextInput';\n"],"names":["Row","children","gap","alignItems","justifyContent","className","jsx","cn","Stack","r","e","t","f","n","clsx","falsyToString","value","cx","cva","base","config","props","ref","variants","defaultVariants","getVariantClassNames","variant","variantProp","defaultVariantProp","variantKey","propsWithoutUndefined","acc","param","key","getCompoundVariantClassNames","param1","cvClass","cvClassName","compoundVariantOptions","fontVariantsMap","PTypographyVariants","PTypography","Element","PSectionHeader","title","EyeIcon","jsxs","EyeOffIcon","PTextInput","forwardRef","inputClassName","type","label","helperText","id","isError","errorMessage","rightAdornment","disabled","readOnly","style","generatedId","useId","inputId","errorId","helperId","isPassword","hasRightAdornment","showPassword","setShowPassword","useState","inputType","describedBy","v"],"mappings":"oKAWMA,EAAoB,CAAC,CACzB,SAAAC,EACA,IAAAC,EAAM,OACN,WAAAC,EAAa,OACb,eAAAC,EAAiB,OACjB,UAAAC,EAAY,EACd,IAEIC,EAAA,IAAC,MAAA,CACC,UAAWC,EAAAA,GAAG,gBAAiBF,CAAS,EACxC,MAAO,CACL,IAAAH,EACA,WAAAC,EACA,eAAAC,CACF,EAEC,SAAAH,CAAA,CAAA,EChBDO,EAAwB,CAAC,CAC7B,SAAAP,EACA,IAAAC,EAAM,OACN,WAAAC,EAAa,OACb,eAAAC,EAAiB,OACjB,UAAAC,EAAY,EACd,IAEIC,EAAA,IAAC,MAAA,CACC,UAAWC,EAAAA,GAAG,gBAAiBF,CAAS,EACxC,MAAO,CACL,IAAAH,EACA,WAAAC,EACA,eAAAC,CACF,EAEC,SAAAH,CAAA,CAAA,EC3BP,SAASQ,EAAEC,EAAE,CAAC,IAAIC,EAAEC,EAAEC,EAAE,GAAG,GAAa,OAAOH,GAAjB,UAA8B,OAAOA,GAAjB,SAAmBG,GAAGH,UAAoB,OAAOA,GAAjB,SAAmB,GAAG,MAAM,QAAQA,CAAC,EAAE,IAAIC,EAAE,EAAEA,EAAED,EAAE,OAAOC,IAAID,EAAEC,CAAC,IAAIC,EAAEH,EAAEC,EAAEC,CAAC,CAAC,KAAKE,IAAIA,GAAG,KAAKA,GAAGD,OAAQ,KAAID,KAAKD,EAAEA,EAAEC,CAAC,IAAIE,IAAIA,GAAG,KAAKA,GAAGF,GAAG,OAAOE,CAAC,CAAQ,SAASC,GAAM,CAAC,QAAQJ,EAAEC,E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I2D,EAAU,UAAU,+CACxB,SACHZ,CAAA,CAAA,CAEJ,CAAA,CAAA,CAEJ,CACF,EAEAL,EAAW,YAAc","x_google_ignoreList":[2,3]}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/components/PContainers/Row/Row.tsx","../src/components/PContainers/Stack/Stack.tsx","../node_modules/class-variance-authority/node_modules/clsx/dist/clsx.mjs","../node_modules/class-variance-authority/dist/index.mjs","../src/components/PTypography/PTypography.constants.ts","../src/components/PTypography/PTypography.tsx","../src/components/PSectionHeader/PSectionHeader.tsx","../src/components/PTextInput/PTextInput.tsx","../src/components/PTextArea/PTextArea.tsx"],"sourcesContent":["import { CSSProperties, FC, ReactNode } from 'react';\nimport cn from '../../../utils/cn';\n\nexport type RowProps = {\n children: ReactNode;\n gap?: CSSProperties['gap'];\n alignItems?: CSSProperties['alignItems'];\n justifyContent?: CSSProperties['justifyContent'];\n className?: string;\n};\n\nconst Row: FC<RowProps> = ({\n children,\n gap = undefined,\n alignItems = undefined,\n justifyContent = undefined,\n className = '',\n}) => {\n return (\n <div\n className={cn('flex flex-row', className)}\n style={{\n gap,\n alignItems,\n justifyContent,\n }}\n >\n {children}\n </div>\n );\n};\n\nexport default Row;\n","import { CSSProperties, FC, ReactNode } from 'react';\nimport cn from '../../../utils/cn';\n\nexport type StackProps = {\n children: ReactNode;\n gap?: CSSProperties['gap'];\n alignItems?: CSSProperties['alignItems'];\n justifyContent?: CSSProperties['justifyContent'];\n className?: string;\n};\n\nconst Stack: FC<StackProps> = ({\n children,\n gap = undefined,\n alignItems = undefined,\n justifyContent = undefined,\n className = '',\n}) => {\n return (\n <div\n className={cn('flex flex-col', className)}\n style={{\n gap,\n alignItems,\n justifyContent,\n }}\n >\n {children}\n </div>\n );\n};\n\nexport default Stack;\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f);else for(t in e)e[t]&&(n&&(n+=\" \"),n+=t);return n}export function clsx(){for(var e,t,f=0,n=\"\";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","import { clsx } from \"clsx\";\nconst falsyToString = (value)=>typeof value === \"boolean\" ? \"\".concat(value) : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>{\n return (props)=>{\n var ref;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants , defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (ref = config.compoundVariants) === null || ref === void 0 ? void 0 : ref.reduce((acc, param1)=>{\n let { class: cvClass , className: cvClassName , ...compoundVariantOptions } = param1;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n};\n\n\n//# sourceMappingURL=index.mjs.map","import { cva } from 'class-variance-authority';\n\ntype FontVariants =\n | 'serif'\n | 'body'\n | 'body-wide'\n | 'heading'\n | 'heading-lg'\n | 'heading-xl';\n\nconst fontVariantsMap = {\n serif: 'font-serif',\n body: 'text-base',\n 'body-wide': 'text-sm tracking-[0.40em] font-medium',\n heading: 'text-[1.5rem] md:text-4xl tracking-[-0.04em] font-medium',\n 'heading-lg':\n 'text-[2.5rem] md:text-[4rem] tracking-[-0.04em] font-medium leading-[2.75rem] md:leading-[4.5rem]',\n 'heading-xl':\n 'text-[4rem] md:text-[7rem] tracking-[-0.04em] leading-[3.5rem] md:leading-[5.5rem] font-medium',\n} satisfies Record<FontVariants, string>;\n\nexport const PTypographyVariants = cva('font-sans', {\n variants: {\n variant: fontVariantsMap,\n },\n defaultVariants: {\n variant: 'body',\n },\n});\n","import { VariantProps } from 'class-variance-authority';\nimport { HTMLAttributes } from 'react';\nimport '../../index.css';\nimport cn from '../../utils/cn';\nimport { PTypographyVariants } from './PTypography.constants';\n\nexport interface PTypographyProps\n extends VariantProps<typeof PTypographyVariants>,\n HTMLAttributes<HTMLElement> {\n as?: React.ElementType;\n children: React.ReactNode;\n}\n\nexport default function PTypography({\n as: Element = 'p',\n children,\n className = '',\n variant,\n ...props\n}: PTypographyProps) {\n return (\n <Element\n className={cn(PTypographyVariants({ variant, className }))}\n {...props}\n >\n {children}\n </Element>\n );\n}\n","import { Stack } from '../PContainers';\nimport { PTypography } from '../PTypography';\n\ninterface Props {\n title: string;\n}\n\nexport default function PSectionHeader({ title }: Props) {\n return (\n <Stack className='pt-2 border-t border-white text-white'>\n <PTypography className='uppercase' variant='body-wide'>\n {title}\n </PTypography>\n </Stack>\n );\n}\n","import { forwardRef, type InputHTMLAttributes, type ReactNode, useId, useState } from 'react';\nimport './PTextInput.css';\nimport cn from '../../utils/cn';\n\nexport type PTextInputRef = HTMLInputElement;\n\nexport type PTextInputProps = {\n /**\n * Applied to the root wrapper element.\n * Override design tokens via CSS custom properties, e.g.:\n * `[--p-input-ring:blue] [--p-input-bg:#f5f5f5]`\n */\n className?: string;\n /** Applied to the inner `<input>` element for layout / spacing overrides. */\n inputClassName?: string;\n /** Visible label — doubles as the floating label and the placeholder. */\n label: string;\n /** Shown below the field when there is no error. */\n helperText?: string;\n isError?: boolean;\n /** Shown below the field when `isError` is true. Announced immediately via `role=\"alert\"`. */\n errorMessage?: string;\n /** Decorative element placed on the trailing edge. Ignored when `type=\"password\"`. */\n rightAdornment?: ReactNode;\n} & Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'className' | 'placeholder' | 'aria-label' | 'aria-describedby'\n>;\n\n// ─── Inline SVG icons ────────────────────────────────────────────────────────\n\nfunction EyeIcon() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path d=\"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\nfunction EyeOffIcon() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path d=\"M9.88 9.88a3 3 0 1 0 4.24 4.24\" />\n <path d=\"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68\" />\n <path d=\"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61\" />\n <line x1=\"2\" x2=\"22\" y1=\"2\" y2=\"22\" />\n </svg>\n );\n}\n\n// ─── Component ───────────────────────────────────────────────────────────────\n\nexport const PTextInput = forwardRef<PTextInputRef, PTextInputProps>(\n (\n {\n className,\n inputClassName,\n type,\n label,\n helperText,\n id,\n isError = false,\n errorMessage,\n rightAdornment,\n disabled,\n readOnly,\n style,\n ...props\n },\n ref,\n ) => {\n const generatedId = useId();\n const inputId = id ?? generatedId;\n const errorId = `${inputId}-error`;\n const helperId = `${inputId}-helper`;\n\n const isPassword = type === 'password';\n const hasRightAdornment = Boolean(rightAdornment) && !isPassword;\n const [showPassword, setShowPassword] = useState(false);\n\n const inputType = isPassword ? (showPassword ? 'text' : 'password') : (type ?? 'text');\n\n const describedBy = [\n isError && errorMessage ? errorId : null,\n !isError && helperText ? helperId : null,\n ]\n .filter(Boolean)\n .join(' ') || undefined;\n\n return (\n <div className={cn('p-text-input relative w-full', className)} style={style}>\n <input\n {...props}\n id={inputId}\n ref={ref}\n type={inputType}\n disabled={disabled}\n readOnly={readOnly}\n // Empty string required for the CSS peer-not-placeholder-shown trick.\n placeholder=\" \"\n // Accessibility\n aria-invalid={isError || undefined}\n aria-describedby={describedBy}\n aria-required={props.required}\n aria-disabled={disabled}\n aria-readonly={readOnly}\n autoComplete={props.autoComplete ?? (isPassword ? 'current-password' : undefined)}\n className={cn(\n // Layout — tall enough for the floating label + value\n 'peer h-16 w-full rounded px-4 pt-6 pb-2',\n (isPassword || hasRightAdornment) && 'pr-12',\n // Visuals\n 'bg-(--p-input-bg) text-(--p-input-text)',\n 'font-sans text-sm outline-none',\n 'border border-(--p-input-border) focus:border-(--p-input-border-focus)',\n // Focus\n 'focus:bg-(--p-input-bg-focus)',\n 'focus:ring-2 focus:ring-(--p-input-ring)',\n // Motion\n 'transition-all duration-150 ease-in',\n // States\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'read-only:cursor-default read-only:bg-(--p-input-bg-readonly)',\n isError && 'ring-2 ring-red-500',\n // Date — hide native picker chrome so rightAdornment can replace it\n hasRightAdornment &&\n type === 'date' &&\n '[&::-webkit-calendar-picker-indicator]:absolute [&::-webkit-calendar-picker-indicator]:right-0 [&::-webkit-calendar-picker-indicator]:h-full [&::-webkit-calendar-picker-indicator]:w-full [&::-webkit-calendar-picker-indicator]:cursor-pointer [&::-webkit-calendar-picker-indicator]:opacity-0',\n inputClassName,\n )}\n />\n\n {/*\n * Floating label — shown above the value when focused or filled.\n * aria-hidden: the <label> below already provides the accessible name.\n */}\n <span\n aria-hidden=\"true\"\n className={cn(\n 'pointer-events-none absolute top-2 left-4',\n 'font-sans text-xs',\n 'origin-left transition-all duration-150 ease-in',\n // Hidden by default\n 'scale-0 opacity-0',\n isError\n ? 'text-red-500'\n : 'text-(--p-input-label) peer-focus:text-(--p-input-label-focus)',\n // Reveal when focused or filled\n 'peer-focus:scale-100 peer-focus:opacity-100',\n 'peer-not-placeholder-shown:scale-100 peer-not-placeholder-shown:opacity-100',\n )}\n >\n {label}\n </span>\n\n {/*\n * Placeholder label — centered in the field when empty and unfocused.\n * pointer-events-none lets clicks fall through to the input beneath;\n * htmlFor still wires up the accessible name correctly.\n */}\n <label\n htmlFor={inputId}\n className={cn(\n 'pointer-events-none absolute top-1/2 left-4 -translate-y-1/2',\n 'font-sans text-sm text-(--p-input-text)',\n 'origin-left transition-all duration-150 ease-in',\n // Collapse when focused or filled\n 'peer-focus:scale-0 peer-focus:opacity-0',\n 'peer-not-placeholder-shown:scale-0 peer-not-placeholder-shown:opacity-0',\n disabled && 'opacity-50',\n )}\n >\n {label}\n </label>\n\n {/* Password toggle */}\n {isPassword && (\n <button\n type=\"button\"\n onClick={() => setShowPassword((v) => !v)}\n disabled={disabled}\n className={cn(\n 'absolute top-1/2 right-4 -translate-y-1/2',\n 'text-(--p-input-label) hover:text-(--p-input-text)',\n 'transition-colors duration-150',\n 'focus-visible:outline-2 focus-visible:outline-offset-2',\n 'focus-visible:outline-(--p-input-ring)',\n 'disabled:pointer-events-none disabled:opacity-50',\n )}\n aria-label={showPassword ? 'Hide password' : 'Show password'}\n aria-pressed={showPassword}\n aria-controls={inputId}\n >\n {showPassword ? <EyeIcon /> : <EyeOffIcon />}\n </button>\n )}\n\n {/* Right adornment — decorative, hidden from assistive tech */}\n {hasRightAdornment && (\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute top-1/2 right-4 -translate-y-1/2 text-(--p-input-label)\"\n >\n {rightAdornment}\n </span>\n )}\n\n {/* Error message — announced immediately via role=\"alert\" */}\n {isError && errorMessage && (\n <p id={errorId} role=\"alert\" className=\"mt-1 px-4 font-sans text-xs text-red-500\">\n {errorMessage}\n </p>\n )}\n\n {/* Helper text — visible only when there is no error */}\n {!isError && helperText && (\n <p id={helperId} className=\"mt-1 px-4 font-sans text-xs text-(--p-input-text-helper)\">\n {helperText}\n </p>\n )}\n </div>\n );\n },\n);\n\nPTextInput.displayName = 'PTextInput';\n","import { forwardRef, type TextareaHTMLAttributes, useId } from 'react';\nimport './PTextArea.css';\nimport cn from '../../utils/cn';\n\nexport type PTextAreaRef = HTMLTextAreaElement;\n\nexport type PTextAreaProps = {\n /**\n * Applied to the root wrapper element.\n * Override design tokens via CSS custom properties, e.g.:\n * `[--p-textarea-ring:blue] [--p-textarea-bg:#f5f5f5]`\n */\n className?: string;\n /** Applied to the inner `<textarea>` element for layout / spacing overrides. */\n textareaClassName?: string;\n /** Visible label — doubles as the floating label and the placeholder. */\n label: string;\n /** Shown below the field when there is no error. */\n helperText?: string;\n isError?: boolean;\n /** Shown below the field when `isError` is true. Announced immediately via `role=\"alert\"`. */\n errorMessage?: string;\n} & Omit<\n TextareaHTMLAttributes<HTMLTextAreaElement>,\n 'className' | 'placeholder' | 'aria-label' | 'aria-describedby'\n>;\n\n// ─── Component ───────────────────────────────────────────────────────────────\n\nexport const PTextArea = forwardRef<PTextAreaRef, PTextAreaProps>(\n (\n {\n className,\n textareaClassName,\n label,\n helperText,\n id,\n isError = false,\n errorMessage,\n disabled,\n readOnly,\n rows = 4,\n style,\n ...props\n },\n ref,\n ) => {\n const generatedId = useId();\n const textareaId = id ?? generatedId;\n const errorId = `${textareaId}-error`;\n const helperId = `${textareaId}-helper`;\n\n const describedBy = [\n isError && errorMessage ? errorId : null,\n !isError && helperText ? helperId : null,\n ]\n .filter(Boolean)\n .join(' ') || undefined;\n\n return (\n <div className={cn('p-text-area relative w-full', className)} style={style}>\n <textarea\n {...props}\n id={textareaId}\n ref={ref}\n rows={rows}\n disabled={disabled}\n readOnly={readOnly}\n // Empty string required for the CSS peer-not-placeholder-shown trick.\n placeholder=\" \"\n // Accessibility\n aria-invalid={isError || undefined}\n aria-describedby={describedBy}\n aria-required={props.required}\n aria-disabled={disabled}\n aria-readonly={readOnly}\n className={cn(\n // Layout\n 'peer w-full rounded px-4 pt-8 pb-3',\n // Visuals\n 'bg-(--p-textarea-bg) text-(--p-textarea-text)',\n 'font-sans text-sm outline-none',\n 'border border-(--p-textarea-border) focus:border-(--p-textarea-border-focus)',\n // Focus\n 'focus:bg-(--p-textarea-bg-focus)',\n 'focus:ring-2 focus:ring-(--p-textarea-ring)',\n // Resize\n 'resize-y',\n // Motion\n 'transition-all duration-150 ease-in',\n // States\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'read-only:cursor-default read-only:bg-(--p-textarea-bg-readonly)',\n isError && 'ring-2 ring-red-500',\n textareaClassName,\n )}\n />\n\n {/*\n * Floating label — shown above the value when focused or filled.\n * aria-hidden: the <label> below already provides the accessible name.\n */}\n <span\n aria-hidden=\"true\"\n className={cn(\n 'pointer-events-none absolute top-2 left-4',\n 'font-sans text-xs',\n 'origin-left transition-all duration-150 ease-in',\n // Hidden by default\n 'scale-0 opacity-0',\n isError\n ? 'text-red-500'\n : 'text-(--p-textarea-label) peer-focus:text-(--p-textarea-label-focus)',\n // Reveal when focused or filled\n 'peer-focus:scale-100 peer-focus:opacity-100',\n 'peer-not-placeholder-shown:scale-100 peer-not-placeholder-shown:opacity-100',\n )}\n >\n {label}\n </span>\n\n {/*\n * Placeholder label — sits near the top of the field when empty and unfocused.\n * pointer-events-none lets clicks fall through to the textarea beneath;\n * htmlFor still wires up the accessible name correctly.\n */}\n <label\n htmlFor={textareaId}\n className={cn(\n 'pointer-events-none absolute top-4 left-4',\n 'font-sans text-sm text-(--p-textarea-text)',\n 'origin-left transition-all duration-150 ease-in',\n // Collapse when focused or filled\n 'peer-focus:scale-0 peer-focus:opacity-0',\n 'peer-not-placeholder-shown:scale-0 peer-not-placeholder-shown:opacity-0',\n disabled && 'opacity-50',\n )}\n >\n {label}\n </label>\n\n {/* Error message — announced immediately via role=\"alert\" */}\n {isError && errorMessage && (\n <p id={errorId} role=\"alert\" className=\"mt-1 px-4 font-sans text-xs text-red-500\">\n {errorMessage}\n </p>\n )}\n\n {/* Helper text — visible only when there is no error */}\n {!isError && helperText && (\n <p id={helperId} className=\"mt-1 px-4 font-sans text-xs text-(--p-textarea-text-helper)\">\n {helperText}\n </p>\n )}\n </div>\n );\n },\n);\n\nPTextArea.displayName = 'PTextArea';\n"],"names":["Row","children","gap","alignItems","justifyContent","className","jsx","cn","Stack","r","e","t","f","clsx","falsyToString","value","cx","cva","base","config","props","ref","variants","defaultVariants","getVariantClassNames","variant","variantProp","defaultVariantProp","variantKey","propsWithoutUndefined","acc","param","key","getCompoundVariantClassNames","param1","cvClass","cvClassName","compoundVariantOptions","fontVariantsMap","PTypographyVariants","PTypography","Element","PSectionHeader","title","EyeIcon","jsxs","EyeOffIcon","PTextInput","forwardRef","inputClassName","type","label","helperText","id","isError","errorMessage","rightAdornment","disabled","readOnly","style","generatedId","useId","inputId","errorId","helperId","isPassword","hasRightAdornment","showPassword","setShowPassword","useState","inputType","describedBy","v","PTextArea","textareaClassName","rows","textareaId"],"mappings":"oKAWMA,EAAoB,CAAC,CACzB,SAAAC,EACA,IAAAC,EAAM,OACN,WAAAC,EAAa,OACb,eAAAC,EAAiB,OACjB,UAAAC,EAAY,EACd,IAEIC,EAAA,IAAC,MAAA,CACC,UAAWC,EAAAA,GAAG,gBAAiBF,CAAS,EACxC,MAAO,CACL,IAAAH,EACA,WAAAC,EACA,eAAAC,CACF,EAEC,SAAAH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OAAO,EACd,KAAK,GAAG,GAAK,OAEhB,cACG,MAAI,CAAA,UAAWzD,EAAAA,GAAG,8BAA+BF,CAAS,EAAG,MAAAsD,EAC5D,SAAA,CAAArD,EAAA,IAAC,WAAA,CACE,GAAGc,EACJ,GAAIwD,EACJ,IAAAvD,EACA,KAAAsD,EACA,SAAAlB,EACA,SAAAC,EAEA,YAAY,IAEZ,eAAcJ,GAAW,OACzB,mBAAkBiB,EAClB,gBAAenD,EAAM,SACrB,gBAAeqC,EACf,gBAAeC,EACf,UAAWnD,EAAA,GAET,qCAEA,gDACA,iCACA,+EAEA,mCACA,8CAEA,WAEA,sCAEA,kDACA,mEACA+C,GAAW,sBACXoB,CACF,CAAA,CACF,EAMApE,EAAA,IAAC,OAAA,CACC,cAAY,OACZ,UAAWC,EAAA,GACT,4CACA,oBACA,kDAEA,oBACA+C,EACI,eACA,uEAEJ,8CACA,6EACF,EAEC,SAAAH,CAAA,CACH,EAOA7C,EAAA,IAAC,QAAA,CACC,QAASsE,EACT,UAAWrE,EAAA,GACT,4CACA,6CACA,kDAEA,0CACA,0EACAkD,GAAY,YACd,EAEC,SAAAN,CAAA,CACH,EAGCG,GAAWC,GACVjD,EAAAA,IAAC,IAAE,CAAA,GAAIyD,EAAS,KAAK,QAAQ,UAAU,2CACpC,SACHR,CAAA,CAAA,EAID,CAACD,GAAWF,GACX9C,EAAA,IAAC,KAAE,GAAI0D,EAAU,UAAU,8DACxB,SACHZ,CAAA,CAAA,CAEJ,CAAA,CAAA,CAEJ,CACF,EAEAqB,EAAU,YAAc","x_google_ignoreList":[2,3]}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { InputHTMLAttributes } from 'react';
|
|
|
7
7
|
import { JSX } from 'react/jsx-runtime';
|
|
8
8
|
import { ReactNode } from 'react';
|
|
9
9
|
import { RefAttributes } from 'react';
|
|
10
|
+
import { TextareaHTMLAttributes } from 'react';
|
|
10
11
|
import { VariantProps } from 'class-variance-authority';
|
|
11
12
|
|
|
12
13
|
declare interface Props {
|
|
@@ -15,8 +16,50 @@ declare interface Props {
|
|
|
15
16
|
|
|
16
17
|
export declare function PSectionHeader({ title }: Props): JSX.Element;
|
|
17
18
|
|
|
19
|
+
export declare const PTextArea: ForwardRefExoticComponent< {
|
|
20
|
+
/**
|
|
21
|
+
* Applied to the root wrapper element.
|
|
22
|
+
* Override design tokens via CSS custom properties, e.g.:
|
|
23
|
+
* `[--p-textarea-ring:blue] [--p-textarea-bg:#f5f5f5]`
|
|
24
|
+
*/
|
|
25
|
+
className?: string;
|
|
26
|
+
/** Applied to the inner `<textarea>` element for layout / spacing overrides. */
|
|
27
|
+
textareaClassName?: string;
|
|
28
|
+
/** Visible label — doubles as the floating label and the placeholder. */
|
|
29
|
+
label: string;
|
|
30
|
+
/** Shown below the field when there is no error. */
|
|
31
|
+
helperText?: string;
|
|
32
|
+
isError?: boolean;
|
|
33
|
+
/** Shown below the field when `isError` is true. Announced immediately via `role="alert"`. */
|
|
34
|
+
errorMessage?: string;
|
|
35
|
+
} & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "className" | "aria-describedby" | "aria-label" | "placeholder"> & RefAttributes<HTMLTextAreaElement>>;
|
|
36
|
+
|
|
37
|
+
export declare type PTextAreaProps = {
|
|
38
|
+
/**
|
|
39
|
+
* Applied to the root wrapper element.
|
|
40
|
+
* Override design tokens via CSS custom properties, e.g.:
|
|
41
|
+
* `[--p-textarea-ring:blue] [--p-textarea-bg:#f5f5f5]`
|
|
42
|
+
*/
|
|
43
|
+
className?: string;
|
|
44
|
+
/** Applied to the inner `<textarea>` element for layout / spacing overrides. */
|
|
45
|
+
textareaClassName?: string;
|
|
46
|
+
/** Visible label — doubles as the floating label and the placeholder. */
|
|
47
|
+
label: string;
|
|
48
|
+
/** Shown below the field when there is no error. */
|
|
49
|
+
helperText?: string;
|
|
50
|
+
isError?: boolean;
|
|
51
|
+
/** Shown below the field when `isError` is true. Announced immediately via `role="alert"`. */
|
|
52
|
+
errorMessage?: string;
|
|
53
|
+
} & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'className' | 'placeholder' | 'aria-label' | 'aria-describedby'>;
|
|
54
|
+
|
|
55
|
+
export declare type PTextAreaRef = HTMLTextAreaElement;
|
|
56
|
+
|
|
18
57
|
export declare const PTextInput: ForwardRefExoticComponent< {
|
|
19
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* Applied to the root wrapper element.
|
|
60
|
+
* Override design tokens via CSS custom properties, e.g.:
|
|
61
|
+
* `[--p-input-ring:blue] [--p-input-bg:#f5f5f5]`
|
|
62
|
+
*/
|
|
20
63
|
className?: string;
|
|
21
64
|
/** Applied to the inner `<input>` element for layout / spacing overrides. */
|
|
22
65
|
inputClassName?: string;
|
|
@@ -32,7 +75,11 @@ rightAdornment?: ReactNode;
|
|
|
32
75
|
} & Omit<InputHTMLAttributes<HTMLInputElement>, "className" | "aria-describedby" | "aria-label" | "placeholder"> & RefAttributes<HTMLInputElement>>;
|
|
33
76
|
|
|
34
77
|
export declare type PTextInputProps = {
|
|
35
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* Applied to the root wrapper element.
|
|
80
|
+
* Override design tokens via CSS custom properties, e.g.:
|
|
81
|
+
* `[--p-input-ring:blue] [--p-input-bg:#f5f5f5]`
|
|
82
|
+
*/
|
|
36
83
|
className?: string;
|
|
37
84
|
/** Applied to the inner `<input>` element for layout / spacing overrides. */
|
|
38
85
|
inputClassName?: string;
|