@clicktap/ui 0.41.1 → 0.42.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/components/Accordion/Accordion.js +1 -1
- package/components/Accordion.d.ts +1 -0
- package/components/Accordion.js +1 -0
- package/components/AssetRenderer/renderers/DownloadLink.d.ts +1 -1
- package/components/AssetRenderer/renderers.d.ts +1 -0
- package/components/AssetRenderer/renderers.js +1 -0
- package/components/AssetRenderer.d.ts +1 -0
- package/components/AssetRenderer.js +1 -0
- package/components/Avatar/Avatar.js +1 -1
- package/components/Avatar.d.ts +1 -0
- package/components/Avatar.js +1 -0
- package/components/Badge/Badge.js +1 -1
- package/components/Badge.d.ts +1 -0
- package/components/Badge.js +1 -0
- package/components/Breadcrumbs/BreadcrumbLink.js +1 -1
- package/components/Breadcrumbs.d.ts +1 -0
- package/components/Breadcrumbs.js +1 -0
- package/components/Button/Button.js +1 -1
- package/components/Button/ButtonLoadingContent.js +1 -1
- package/components/Button/index.js +1 -1
- package/components/Button.d.ts +1 -0
- package/components/Button.js +1 -0
- package/components/Card.d.ts +1 -0
- package/components/Card.js +1 -0
- package/components/Checkbox/Checkbox.js +1 -1
- package/components/Checkbox.d.ts +1 -0
- package/components/Checkbox.js +1 -0
- package/components/Collapsible.d.ts +1 -0
- package/components/Collapsible.js +1 -0
- package/components/Collection/AttributeDataProvider.d.ts +1 -0
- package/components/Collection/AttributeDataProvider.js +1 -0
- package/components/Collection/CollectionFilterChips/CollectionFilterChips.js +1 -1
- package/components/Collection/CollectionFilterChips/index.js +1 -1
- package/components/Collection/CollectionFilterChips.d.ts +1 -0
- package/components/Collection/CollectionFilterChips.js +1 -0
- package/components/Collection/CollectionFilters/CollectionFilters.js +1 -1
- package/components/Collection/CollectionFilters/index.js +1 -1
- package/components/Collection/CollectionFilters.d.ts +1 -0
- package/components/Collection/CollectionFilters.js +1 -0
- package/components/Collection/CollectionToolbar/CollectionToolbar.js +1 -1
- package/components/Collection/CollectionToolbar/index.js +1 -1
- package/components/Collection/CollectionToolbar.d.ts +1 -0
- package/components/Collection/CollectionToolbar.js +1 -0
- package/components/Collection/EmptyResults/EmptyResults.js +1 -1
- package/components/Collection/EmptyResults.d.ts +1 -0
- package/components/Collection/EmptyResults.js +1 -0
- package/components/Collection/FilterAccordionTitle/FilterAccordionTitle.js +1 -1
- package/components/Collection/FilterAccordionTitle.d.ts +1 -0
- package/components/Collection/FilterAccordionTitle.js +1 -0
- package/components/Collection/FilterRenderer/Renderer/Boolean.js +1 -1
- package/components/Collection/FilterRenderer/Renderer/Option.js +1 -1
- package/components/Collection/FilterRenderer/Renderer/Range.js +1 -1
- package/components/Collection/FilterRenderer/Renderer/Swatch/SwatchColor.js +1 -1
- package/components/Collection/FilterRenderer/Renderer/Swatch/SwatchImage.js +1 -1
- package/components/Collection/FilterRenderer/Renderer/Swatch/SwatchText.js +1 -1
- package/components/Collection/FilterRenderer/Renderer.d.ts +1 -0
- package/components/Collection/FilterRenderer/Renderer.js +1 -0
- package/components/Collection/FilterRenderer.d.ts +1 -0
- package/components/Collection/FilterRenderer.js +1 -0
- package/components/Collection/ProductCardSwatches/ProductCardSwatches.js +1 -1
- package/components/Collection/ProductCardSwatches.d.ts +1 -0
- package/components/Collection/ProductCardSwatches.js +1 -0
- package/components/Collection/ProductPrice.d.ts +1 -0
- package/components/Collection/ProductPrice.js +1 -0
- package/components/Collection/index.js +1 -1
- package/components/Collection.d.ts +1 -0
- package/components/Collection.js +1 -0
- package/components/Container.d.ts +1 -0
- package/components/Container.js +1 -0
- package/components/ContextMenu/ContextMenu.js +1 -1
- package/components/ContextMenu.d.ts +1 -0
- package/components/ContextMenu.js +1 -0
- package/components/CreditCardExpirationInput/CreditCardExpirationInput.js +1 -1
- package/components/CreditCardExpirationInput.d.ts +1 -0
- package/components/CreditCardExpirationInput.js +1 -0
- package/components/CreditCardInput/CreditCardInput.js +1 -1
- package/components/CreditCardInput.d.ts +1 -0
- package/components/CreditCardInput.js +1 -0
- package/components/DateInput/DateInput.js +1 -1
- package/components/DateInput.d.ts +1 -0
- package/components/DateInput.js +1 -0
- package/components/DateTimeFormat/DateTimeFormat.d.ts +1 -1
- package/components/DateTimeFormat.d.ts +1 -0
- package/components/DateTimeFormat.js +1 -0
- package/components/Dialog/Dialog.js +1 -1
- package/components/Dialog.d.ts +1 -0
- package/components/Dialog.js +1 -0
- package/components/DialogTrigger.d.ts +1 -0
- package/components/DialogTrigger.js +1 -0
- package/components/Divider.d.ts +1 -0
- package/components/Divider.js +1 -0
- package/components/DobInput/DobInput.js +1 -1
- package/components/DobInput.d.ts +1 -0
- package/components/DobInput.js +1 -0
- package/components/Drawer/Drawer.js +1 -1
- package/components/Drawer.d.ts +1 -0
- package/components/Drawer.js +1 -0
- package/components/FeatureGate/AccessDenied.d.ts +2 -2
- package/components/FeatureGate/AccessDenied.js +1 -1
- package/components/FeatureGate/FeatureGate.d.ts +1 -1
- package/components/FeatureGate/FeatureGate.js +1 -1
- package/components/FeatureGate/PermissionRequired.d.ts +1 -1
- package/components/FeatureGate/PermissionRequired.js +1 -1
- package/components/FeatureGate/UpgradePrompt.d.ts +1 -1
- package/components/FeatureGate/UpgradePrompt.js +1 -1
- package/components/Icon/NoEntryIcon.js +1 -1
- package/components/Icon/StarIcon.js +1 -1
- package/components/Icon.d.ts +1 -0
- package/components/Icon.js +1 -0
- package/components/Image/Image.d.ts +44 -3
- package/components/Image/Image.js +1 -1
- package/components/Image/ImageContext.d.ts +30 -0
- package/components/Image/ImageContext.js +1 -0
- package/components/Image/imageShared.d.ts +74 -0
- package/components/Image/imageShared.js +1 -0
- package/components/Image/index.d.ts +3 -1
- package/components/Image/index.js +1 -1
- package/components/Image.d.ts +1 -0
- package/components/Image.js +1 -0
- package/components/Input/Input.js +1 -1
- package/components/Input.d.ts +1 -0
- package/components/Input.js +1 -0
- package/components/Link/Link.js +1 -1
- package/components/Link.d.ts +1 -0
- package/components/Link.js +1 -0
- package/components/LinkAsButton/LinkAsButton.js +1 -1
- package/components/LinkAsButton/index.js +1 -1
- package/components/LinkAsButton.d.ts +1 -0
- package/components/LinkAsButton.js +1 -0
- package/components/Loader/CircularEasing.js +1 -1
- package/components/Loader/Pulse.js +1 -1
- package/components/Loader/index.js +1 -1
- package/components/Loader.d.ts +1 -0
- package/components/Loader.js +1 -0
- package/components/Menu.d.ts +1 -0
- package/components/Menu.js +1 -0
- package/components/Meter/Meter.js +1 -1
- package/components/Meter.d.ts +1 -0
- package/components/Meter.js +1 -0
- package/components/Modal.d.ts +1 -0
- package/components/Modal.js +1 -0
- package/components/ModalOverlay.d.ts +1 -0
- package/components/ModalOverlay.js +1 -0
- package/components/NumberFormat/NumberFormat.d.ts +1 -1
- package/components/NumberFormat.d.ts +1 -0
- package/components/NumberFormat.js +1 -0
- package/components/NumberInput/NumberInput.js +1 -1
- package/components/NumberInput.d.ts +1 -0
- package/components/NumberInput.js +1 -0
- package/components/NumberTicker.d.ts +1 -0
- package/components/NumberTicker.js +1 -0
- package/components/Pagination/Pagination.js +1 -1
- package/components/Pagination.d.ts +1 -0
- package/components/Pagination.js +1 -0
- package/components/PasswordCheck/PasswordCheck.js +1 -1
- package/components/PasswordCheck.d.ts +1 -0
- package/components/PasswordCheck.js +1 -0
- package/components/PhoneInput/PhoneInput.js +1 -1
- package/components/PhoneInput.d.ts +1 -0
- package/components/PhoneInput.js +1 -0
- package/components/PinInput/PinInput.js +1 -1
- package/components/PinInput.d.ts +1 -0
- package/components/PinInput.js +1 -0
- package/components/Progressbar/LinearProgressbar.js +1 -1
- package/components/Progressbar.d.ts +1 -0
- package/components/Progressbar.js +1 -0
- package/components/Radio/Radio.js +1 -1
- package/components/Radio.d.ts +1 -0
- package/components/Radio.js +1 -0
- package/components/RadioGroup/RadioGroup.js +1 -1
- package/components/RadioGroup.d.ts +1 -0
- package/components/RadioGroup.js +1 -0
- package/components/ResendCode.d.ts +1 -0
- package/components/ResendCode.js +1 -0
- package/components/Select/ButtonSelect.js +1 -1
- package/components/Select/ComboBoxSelect.js +1 -1
- package/components/Select/MultiButtonSelect.js +1 -1
- package/components/Select/Select.js +1 -1
- package/components/Select/index.js +1 -1
- package/components/Select/parts.js +1 -1
- package/components/Select.d.ts +1 -0
- package/components/Select.js +1 -0
- package/components/Skeleton.d.ts +1 -0
- package/components/Skeleton.js +1 -0
- package/components/Slider/Slider.js +1 -1
- package/components/Slider.d.ts +1 -0
- package/components/Slider.js +1 -0
- package/components/Switch/Switch.js +1 -1
- package/components/Switch.d.ts +1 -0
- package/components/Switch.js +1 -0
- package/components/Table.d.ts +1 -0
- package/components/Table.js +1 -0
- package/components/Tabs/Tab.js +1 -1
- package/components/Tabs/TabList.js +1 -1
- package/components/Tabs.d.ts +1 -0
- package/components/Tabs.js +1 -0
- package/components/Time.d.ts +1 -0
- package/components/Time.js +1 -0
- package/components/TimeInput/TimeInput.js +1 -1
- package/components/TimeInput.d.ts +1 -0
- package/components/TimeInput.js +1 -0
- package/components/Timezone.d.ts +1 -0
- package/components/Timezone.js +1 -0
- package/components/ToggleButton/ToggleButton.js +1 -1
- package/components/ToggleButton.d.ts +1 -0
- package/components/ToggleButton.js +1 -0
- package/components/Tooltip.d.ts +1 -0
- package/components/Tooltip.js +1 -0
- package/components/UploadImage/UploadImage.js +1 -1
- package/components/UploadImage/index.js +1 -1
- package/components/UploadImage.d.ts +1 -0
- package/components/UploadImage.js +1 -0
- package/docs/migrations/2026/04/2026-04-24-image-placeholder-frontend-fallback.md +3 -3
- package/docs/migrations/2026/04/2026-04-30-prune-invalid-pdp-selections.md +2 -2
- package/docs/migrations/2026/04/2026-04-30-top-down-pdp-option-dependency.md +2 -2
- package/docs/migrations/2026/08/2026-08-06-clicktap-ui-image-next-subpath.md +101 -0
- package/docs/migrations/2026/08/2026-08-06-clicktap-ui-loaders-drop-framer-motion.md +77 -0
- package/docs/migrations/2026/08/2026-08-06-clicktap-ui-semantic-tokens.md +106 -0
- package/docs/migrations/README.md +1 -0
- package/hooks/useCollectionState.d.ts +1 -0
- package/hooks/useCollectionState.js +1 -0
- package/hooks/useRoute/RouteContext.d.ts +8 -0
- package/hooks/useRoute/index.js +1 -1
- package/hooks/useRoute/useRoute.js +1 -1
- package/hooks/useRoute.d.ts +1 -0
- package/hooks/useRoute.js +1 -0
- package/next/Image.d.ts +11 -0
- package/next/Image.js +1 -0
- package/next/index.d.ts +8 -0
- package/next/index.js +1 -0
- package/package.json +62 -6
- package/theme.css +162 -0
- package/utils/collection.d.ts +1 -0
- package/utils/collection.js +1 -0
- package/utils/variantOptions.d.ts +1 -0
- package/utils/variantOptions.js +1 -0
- package/tailwind.config.js +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as I,jsx as
|
|
1
|
+
"use client";import{jsxs as I,jsx as l}from"react/jsx-runtime";import{useState as N}from"react";import{N as w}from"../../assets/react-number-format.es-Bf_lGveD.js";import{TextField as P,Label as j,Text as L,FieldError as T,Input as k}from"react-aria-components";import{cn as t}from"../../utils/cn.js";const m=a=>{const s=[{regex:/^4[0-9]{0,15}/,format:"#### #### #### ####"},{regex:/^5[1-5][0-9]{0,14}/,format:"#### #### #### ####"},{regex:/^3[47][0-9]{0,13}/,format:"#### ###### #####"},{regex:/^6(?:011|5[0-9]{2})[0-9]{0,12}/,format:"#### #### #### ####"},{regex:/^3(?:0[0-5]|[68][0-9])[0-9]{0,11}/,format:"#### ###### ####"},{regex:/^(?:2131|1800|35\d{3})\d{0,11}/,format:"#### #### #### ####"}].find(f=>f.regex.test(a));return s?s.format:"#### #### #### #### ###"};function y({className:a,...o}){return l(k,{className:t("border-solid border border-border rounded-md","text-sm text-fg placeholder-fg-subtle","h-10 px-2 py-0 m-0 w-full","bg-white","transition-all duration-200 ease-in-out","hover:border-border-emphasis","focus:outline-2 focus:outline focus:outline-border-subtle focus:border-border-emphasis","disabled:border-border-subtle disabled:bg-surface-subtle","invalid:border-danger-soft invalid:bg-danger-surface invalid:text-danger","invalid:hover:border-danger invalid:focus:border-danger invalid:focus:outline-danger-ring",a),...o})}function z({label:a,description:o,errorMessage:s,placeholder:f,value:g,onChange:x,className:b,classNames:d,...p}){const[h,v]=N(""),V=g??h,F=i=>{if(i==="")return"";const e=i.replace(/\s+/g,""),u=m(e);let n="",r=0;for(let c=0;c<u.length;c+=1)if(u[c]==="#")if(r<e.length)n+=e[r],r+=1;else break;else n+=u[c];return n},C=i=>{const e=i.value.replace(/\s+/g,""),n=m(e).replace(/[^#]/g,"").length,r=e.slice(0,n);v(r),x?.(r)};return I(P,{className:t("flex flex-col w-full text-fg",b),...p,children:[l(j,{className:t("flex text-fg-muted text-sm",d?.label),children:a}),l(w,{value:V,format:F,customInput:y,className:t(d?.input),placeholder:f,onValueChange:C}),o&&l(L,{className:t("flex text-fg-muted text-sm",d?.description),slot:"description",children:o}),l(T,{className:t("flex text-danger-soft text-sm",d?.error),children:s})]})}export{z as CreditCardInput,z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CreditCardInput/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CreditCardInput/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as
|
|
1
|
+
"use client";import{jsxs as s,jsx as r}from"react/jsx-runtime";import{DateField as u,Label as f,DateInput as c,DateSegment as b,Text as x,FieldError as g}from"react-aria-components";import{cn as e}from"../../utils/cn.js";function v({label:a,description:i,errorMessage:o,className:l,classNames:t,...d}){return s(u,{className:e("text-fg",l),...d,children:[r(f,{className:e("flex text-fg-muted text-xs",t?.label),children:a}),r(c,{className:e("flex items-center","border-solid border border-border rounded-md","text-sm text-fg","h-10 px-1 py-0 m-0 w-full","bg-white","transition-all duration-200 ease-in-out","hover:border-border-emphasis","focus-within:outline-2 focus-within:outline focus-within:outline-border-subtle focus-within:border-border-emphasis","disabled:border-border-subtle disabled:bg-surface-subtle","invalid:border-danger-soft invalid:bg-danger-surface invalid:text-danger","invalid:hover:border-danger invalid:focus-within:border-danger invalid:focus-within:outline-danger-ring",t?.input),children:n=>r(b,{segment:n,className:e("p-1 tabular-nums text-end text-fg","invalid:text-danger-soft","disabled:cursor-default disabled:select-none disabled:text-fg-subtle","focus:text-fg focus:bg-slate-200 focus:outline-0 focus:rounded-md focus:caret-transparent focus:invalid:bg-danger-soft focus:invalid:text-white","type-literal:p-0","data-[placeholder]:text-fg-subtle data-[placeholder]:invalid:text-danger-soft data-[placeholder]:invalid:focus:text-white","aria-[readonly]:focus-visible:outline aria-[readonly]:focus-visible:outline-slate-500 aria-[readonly]:focus-visible:outline-1","aria-[readonly]:focus:outline aria-[readonly]:focus:outline-slate-500 aria-[readonly]:focus:bg-transparent aria-[readonly]:focus:outline-2",t?.segment)})}),i&&r(x,{className:e("flex text-fg-muted text-sm",t?.description),slot:"description",children:i}),r(g,{className:e("flex text-danger-soft text-sm",t?.error),children:o})]})}export{v as DateInput,v as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DateInput/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DateInput/index.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DateTimeFormatProps } from './DateTimeFormat.types';
|
|
2
|
-
export declare function DateTimeFormat({ locale, fallback, children, ...options }: DateTimeFormatProps): string | number |
|
|
2
|
+
export declare function DateTimeFormat({ locale, fallback, children, ...options }: DateTimeFormatProps): string | number | boolean | import('react').ReactElement<any, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null;
|
|
3
3
|
export default DateTimeFormat;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DateTimeFormat/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DateTimeFormat/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import{forwardRef as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import{forwardRef as m}from"react";import{Dialog as f}from"react-aria-components";import{motion as d}from"framer-motion";import{cn as u}from"../../utils/cn.js";const s=m(({style:o,animationVariants:i,...t},n)=>{const r=typeof o=="function"?o(t):o;return e(f,{...t,ref:n,style:r})});let a=null;function c(){return typeof window>"u"?null:(a||(a=d.create(s)),a)}const l=c();function D({className:o,children:i,animationVariants:t,...n}){const r={className:u("p-8 outline-0 max-w-max w-screen absolute top-2/4 left-2/4","-translate-x-1/2 -translate-y-1/2","shadow-[0_8px_24px_rgba(0,0,0,0.1)] rounded-lg bg-white border border-solid border-border-emphasis",o),...n};return l?e(l,{...r,variants:t||{hidden:{opacity:0},visible:{opacity:1}},children:i}):e(s,{...r,children:i})}export{D as Dialog,D as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Dialog/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Dialog/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DialogTrigger/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DialogTrigger/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Divider/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Divider/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as w,jsx as
|
|
1
|
+
"use client";import{jsxs as w,jsx as o}from"react/jsx-runtime";import{useId as j,useState as C}from"react";import{TextField as k,Label as y,FieldError as A,Input as B}from"react-aria-components";import{N as D}from"../../assets/react-number-format.es-Bf_lGveD.js";import{cn as r}from"../../utils/cn.js";function E({className:l,...s}){return o(B,{className:r("peer h-11",l),...s})}function z({label:l,description:s,errorMessage:u,type:m,className:p,classNames:n,id:f,value:g,onChange:h,...x}){const c=j(),[V,v]=C(""),I=g??V,F=e=>{if(e==="")return"";const b=e.replace(/\s+/g,""),a="##-##-####";let i="",d=0;for(let t=0;t<a.length;t+=1)if(a[t]==="#")if(d<b.length)i+=b[d],d+=1;else break;else i+=a[t];return i},N=e=>{v(e.formattedValue),h?.(e.formattedValue)};return w(k,{className:r("flex flex-col w-full text-fg",p),type:m,...x,children:[o(y,{className:r("flex text-fg-muted text-xs",n?.label),htmlFor:f||c,children:l}),o(D,{id:f||c,value:I,format:F,customInput:E,className:r("border-solid border border-border rounded-md","text-sm text-fg placeholder-fg-subtle","h-10 px-2 py-0 m-0 w-full","bg-white","transition-all duration-200 ease-in-out","hover:border-border-emphasis","focus:outline-2 focus:outline focus:outline-border-subtle focus:border-border-emphasis","disabled:border-border-subtle disabled:bg-surface-subtle","invalid:border-danger-soft invalid:bg-danger-surface invalid:text-danger","invalid:hover:border-danger invalid:focus:border-danger invalid:focus:outline-danger-ring",n?.input),onValueChange:N}),u&&o(A,{className:r(n?.error),children:u})]})}export{z as DobInput,z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DobInput/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DobInput/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as n}from"react/jsx-runtime";import{forwardRef as u}from"react";import{Dialog as f}from"react-aria-components";import{motion as
|
|
1
|
+
"use client";import{jsx as n}from"react/jsx-runtime";import{forwardRef as u}from"react";import{Dialog as f}from"react-aria-components";import{motion as b}from"framer-motion";import{cn as m}from"../../utils/cn.js";const p={top:{hidden:{y:"-100%",transition:{ease:"easeIn"}},visible:{y:0,transition:{ease:"easeOut"}}},bottom:{hidden:{y:"100%",transition:{ease:"easeIn"}},visible:{y:0,transition:{ease:"easeOut"}}},right:{hidden:{x:"100%",transition:{ease:"easeIn"}},visible:{x:0,transition:{ease:"easeOut"}}},left:{hidden:{x:"-100%",transition:{ease:"easeIn"}},visible:{x:0,transition:{ease:"easeOut"}}}},l=u(({style:e,size:t="20rem",...o},r)=>{const a=typeof e=="function"?e(o):{...e,"--drawer-size":`${t}`};return n(f,{...o,ref:r,style:a})});let i=null;function w(){return typeof window>"u"?null:(i||(i=b.create(l)),i)}const d=w();function c({direction:e="right",children:t,className:o,animationVariants:r,...a}){const s={className:m("fixed p-8 bg-white","outline-none focus:outline-none focus-visible:outline-none","border-solid border-border-subtle","max-w-full max-h-[var(--visual-viewport-height)]",e==="top"&&"top-0 left-0 right-0 bottom-auto border-b shadow-[0_8px_24px_rgba(0,0,0,0.1)] h-[var(--drawer-size)]",e==="right"&&"top-0 left-auto bottom-0 right-0 border-l shadow-[-8px_0_24px_rgba(0,0,0,0.1)] w-[var(--drawer-size)]",e==="bottom"&&"bottom-0 left-0 right-0 top-auto border-t shadow-[0_-8px_24px_rgba(0,0,0,0.1)] h-[var(--drawer-size)]",e==="left"&&"top-0 bottom-0 left-0 right-auto border-r shadow-[8px_0_24px_rgba(0,0,0,0.1)] w-[var(--drawer-size)]",o),"data-direction":e,...a};return d?n(d,{variants:r||p[e],...s,children:t}):n(l,{...s,children:t})}export{c as Drawer,c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Drawer/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Drawer/index.js';
|
|
@@ -25,7 +25,7 @@ export interface AccessDeniedProps {
|
|
|
25
25
|
* />
|
|
26
26
|
*
|
|
27
27
|
* // Custom icon
|
|
28
|
-
* <AccessDenied icon={<LockIcon size={24} className="text-
|
|
28
|
+
* <AccessDenied icon={<LockIcon size={24} className="text-danger-soft" />} />
|
|
29
29
|
*
|
|
30
30
|
* // Fully custom content
|
|
31
31
|
* <AccessDenied>
|
|
@@ -33,5 +33,5 @@ export interface AccessDeniedProps {
|
|
|
33
33
|
* </AccessDenied>
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
export declare function AccessDenied({ title, message, icon, children, }: AccessDeniedProps): string | number |
|
|
36
|
+
export declare function AccessDenied({ title, message, icon, children, }: AccessDeniedProps): string | number | true | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element;
|
|
37
37
|
export default AccessDenied;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as i,jsx as e}from"react/jsx-runtime";import"../../utils/cn.js";import{LockIcon as n}from"../Icon/LockIcon.js";function m({title:s,message:r,icon:c,children:t}){return t||i("div",{className:"flex flex-col items-center justify-center min-h-[50vh] px-4",children:[e("div",{className:"w-12 h-12 rounded-full bg-
|
|
1
|
+
"use client";import{jsxs as i,jsx as e}from"react/jsx-runtime";import"../../utils/cn.js";import{LockIcon as n}from"../Icon/LockIcon.js";function m({title:s,message:r,icon:c,children:t}){return t||i("div",{className:"flex flex-col items-center justify-center min-h-[50vh] px-4",children:[e("div",{className:"w-12 h-12 rounded-full bg-danger-surface flex items-center justify-center mb-4",children:c??e(n,{size:24,className:"text-danger-soft"})}),e("h1",{className:"text-xl font-semibold text-fg mb-2",children:s??"Access Denied"}),e("p",{className:"text-sm text-slate-600 text-center max-w-md",children:r??"You don't have permission to access this resource. If you believe this is an error, please contact support."})]})}export{m as AccessDenied,m as default};
|
|
@@ -58,5 +58,5 @@ export interface FeatureGateProps {
|
|
|
58
58
|
* </FeatureGate>
|
|
59
59
|
* ```
|
|
60
60
|
*/
|
|
61
|
-
export declare function FeatureGate({ permission, featureName, children, upgradeContent, upgradeIcon, upgradeUrl, onManageSubscription, permissionContent, permissionIcon, }: FeatureGateProps): string | number |
|
|
61
|
+
export declare function FeatureGate({ permission, featureName, children, upgradeContent, upgradeIcon, upgradeUrl, onManageSubscription, permissionContent, permissionIcon, }: FeatureGateProps): string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
62
62
|
export default FeatureGate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as n}from"react/jsx-runtime";import{usePermissions as P,useAccountPermissions as d}from"./PermissionsProvider.js";import{UpgradePrompt as A}from"./UpgradePrompt.js";import{PermissionRequired as h}from"./PermissionRequired.js";import"react";import"../Button/Button.js";import"react-aria-components";import"../../utils/cn.js";import"
|
|
1
|
+
"use client";import{jsx as n}from"react/jsx-runtime";import{usePermissions as P,useAccountPermissions as d}from"./PermissionsProvider.js";import{UpgradePrompt as A}from"./UpgradePrompt.js";import{PermissionRequired as h}from"./PermissionRequired.js";import"react";import"../Button/Button.js";import"react-aria-components";import"../../utils/cn.js";import"../Link/Link.js";import"../Link/LinkContext.js";import"../Link/utils.js";import"../Icon/GemIcon.js";import"../Icon/LockIcon.js";function y({permission:i,featureName:r,children:o,upgradeContent:e,upgradeIcon:m,upgradeUrl:u,onManageSubscription:c,permissionContent:p,permissionIcon:l}){const t=P(),s=d();if(t===null||s===null)return o;const f=s.includes(i),a=t.includes(i);return f?a?o:n(h,{featureName:r,icon:l,children:p}):n(A,{featureName:r,icon:m,upgradeUrl:u,onManageSubscription:c,children:e})}export{y as FeatureGate,y as default};
|
|
@@ -28,5 +28,5 @@ export interface PermissionRequiredProps {
|
|
|
28
28
|
* </PermissionRequired>
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
|
-
export declare function PermissionRequired({ featureName, icon, children, }: PermissionRequiredProps): string | number |
|
|
31
|
+
export declare function PermissionRequired({ featureName, icon, children, }: PermissionRequiredProps): string | number | true | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element;
|
|
32
32
|
export default PermissionRequired;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import"../../utils/cn.js";import{LockIcon as o}from"../Icon/LockIcon.js";function
|
|
1
|
+
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import"../../utils/cn.js";import{LockIcon as o}from"../Icon/LockIcon.js";function m({featureName:t,icon:i,children:s}){return s||e("div",{className:"border border-border-subtle rounded-lg bg-white",children:r("div",{className:"flex flex-col items-center justify-center py-12 px-4",children:[e("div",{className:"w-12 h-12 rounded-full bg-yellow-100 flex items-center justify-center mb-4",children:i??e(o,{size:24})}),e("p",{className:"text-lg font-medium text-slate-600 mb-2",children:"Permission Required"}),r("p",{className:"text-sm text-fg-muted text-center max-w-md",children:[t?`You don't have permission to access ${t}.`:"You don't have permission to access this feature."," ","Please contact your account administrator to request access."]})]})})}export{m as PermissionRequired,m as default};
|
|
@@ -42,5 +42,5 @@ export interface UpgradePromptProps {
|
|
|
42
42
|
* </UpgradePrompt>
|
|
43
43
|
* ```
|
|
44
44
|
*/
|
|
45
|
-
export declare function UpgradePrompt({ featureName, icon, children, upgradeUrl, onManageSubscription, }: UpgradePromptProps): string | number |
|
|
45
|
+
export declare function UpgradePrompt({ featureName, icon, children, upgradeUrl, onManageSubscription, }: UpgradePromptProps): string | number | true | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element;
|
|
46
46
|
export default UpgradePrompt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import{Button as m}from"../Button/Button.js";import"
|
|
1
|
+
"use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import{Button as m}from"../Button/Button.js";import"../../utils/cn.js";import{Link as c}from"../Link/Link.js";import"../Link/LinkContext.js";import{GemIcon as u}from"../Icon/GemIcon.js";import"react";import"react-aria-components";import"../Link/utils.js";function v({featureName:r,icon:o,children:t,upgradeUrl:i,onManageSubscription:n}){return t||e("div",{className:"border border-border-subtle rounded-lg bg-white",children:s("div",{className:"flex flex-col items-center justify-center py-12 px-4",children:[e("div",{className:"w-12 h-12 rounded-full bg-purple-100 flex items-center justify-center mb-4",children:o??e(u,{size:24})}),e("p",{className:"text-lg font-medium text-slate-600 mb-2",children:"Upgrade Your Account"}),s("p",{className:"text-sm text-fg-muted text-center max-w-md",children:[r?`Access to ${r} requires a premium subscription.`:"This feature requires a premium subscription."," ","Upgrade your account to unlock this and other powerful features."]}),i?e(c,{href:i,className:"mt-8 inline-flex items-center justify-center px-4 py-2 bg-surface-inverse text-white font-medium rounded-lg hover:bg-surface-inverse-hover transition-colors",children:"Manage Subscription"}):e(m,{variant:"solid",className:"mt-8",onPress:n,children:"Manage Subscription"})]})})}export{v as UpgradePrompt,v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as n,jsx as
|
|
1
|
+
"use client";import{jsxs as n,jsx as o}from"react/jsx-runtime";import{cn as i}from"../../utils/cn.js";function l({className:t,size:r=24,style:e}){return n("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i("text-danger-soft",t),style:e,stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o("circle",{cx:"12",cy:"12",r:"10"}),o("line",{x1:"4.93",y1:"4.93",x2:"19.07",y2:"19.07"})]})}export{l as NoEntryIcon,l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import{cn as s}from"../../utils/cn.js";function a({className:o,size:t=16,style:n,filled:r=!1}){return e("svg",{width:t,height:t,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:s(r?"text-amber-400":"text-
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import{cn as s}from"../../utils/cn.js";function a({className:o,size:t=16,style:n,filled:r=!1}){return e("svg",{width:t,height:t,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:s(r?"text-amber-400":"text-fg-subtle",o),style:n,fill:r?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:e("path",{d:"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"})})}export{a as StarIcon,a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Icon/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Icon/index.js';
|
|
@@ -1,5 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ImgHTMLAttributes } from 'react';
|
|
2
|
+
import { ImageLoader, ImageSrcLike } from './imageShared';
|
|
3
|
+
export type ImageProps = Omit<ImgHTMLAttributes<HTMLImageElement>, 'src' | 'width' | 'height' | 'srcSet'> & {
|
|
4
|
+
src: ImageSrcLike;
|
|
5
|
+
width?: number | string;
|
|
6
|
+
height?: number | string;
|
|
7
|
+
/**
|
|
8
|
+
* Pre-built `srcset`, e.g. from a build-time image pipeline. Takes precedence
|
|
9
|
+
* over the loader — the bundler already produced real variants, so there is
|
|
10
|
+
* nothing for a loader to add.
|
|
11
|
+
*/
|
|
12
|
+
srcSet?: string;
|
|
13
|
+
/** Widths hint for the browser. Only meaningful alongside a `srcSet`. */
|
|
14
|
+
sizes?: string;
|
|
15
|
+
/** Passed to the loader. Ignored when `srcSet` is supplied or no loader is set. */
|
|
16
|
+
quality?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Fetch this image eagerly at high priority — for above-the-fold art.
|
|
19
|
+
*
|
|
20
|
+
* Honoured natively here (`loading="eager"` + `fetchPriority="high"`), but it
|
|
21
|
+
* does NOT inject `<link rel="preload">`; that is Next head management and
|
|
22
|
+
* only happens in `@clicktap/ui/next`.
|
|
23
|
+
*/
|
|
24
|
+
priority?: boolean;
|
|
25
|
+
/** Fill the nearest positioned ancestor instead of using width/height. */
|
|
26
|
+
fill?: boolean;
|
|
27
|
+
/** Per-call loader, overriding `ImageProvider`. */
|
|
28
|
+
loader?: ImageLoader;
|
|
3
29
|
/** Reduce opacity to 50% (e.g., while waiting for data) */
|
|
4
30
|
dimmed?: boolean;
|
|
5
31
|
/** Hide image completely — opacity 0 (e.g., before grid rearrange) */
|
|
@@ -7,5 +33,20 @@ export type ExtendedImageProps = ImageProps & {
|
|
|
7
33
|
/** Fires when a new image has loaded after a src change */
|
|
8
34
|
onReady?: () => void;
|
|
9
35
|
};
|
|
10
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Framework-free image.
|
|
38
|
+
*
|
|
39
|
+
* Renders a plain `<img>` and carries no dependency on any framework — that is
|
|
40
|
+
* the point (CTAP-1125): consumers outside the Next lineage could not previously
|
|
41
|
+
* take a single component from this package without installing Next.
|
|
42
|
+
*
|
|
43
|
+
* Optimization is not lost, it is *injected*. Supply `srcSet` (build-time
|
|
44
|
+
* variants) or a `loader` (a resizing service) and this emits a real `srcset`,
|
|
45
|
+
* which is what makes `sizes` and `quality` do anything. With neither it renders
|
|
46
|
+
* one `src` — correct, just unoptimized.
|
|
47
|
+
*
|
|
48
|
+
* For Next's own optimizer, blur placeholders and `priority` preloading, import
|
|
49
|
+
* `@clicktap/ui/next/Image` instead. See the CTAP-1125 migration guide.
|
|
50
|
+
*/
|
|
51
|
+
export declare function Image({ src, className, style, srcSet, sizes, quality, priority, fill, loader, dimmed, hidden, onReady, onLoad: externalOnLoad, width, height, alt, ...rest }: ImageProps): import("react/jsx-runtime").JSX.Element;
|
|
11
52
|
export default Image;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as w}from"react/jsx-runtime";import{cn as F}from"../../utils/cn.js";import{useImageConfig as R}from"./ImageContext.js";import{useManagedOpacity as x,useImageStyle as C,buildSrcSet as E,resolveSrc as M}from"./imageShared.js";import"react";const N={position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"};function B({src:e,className:c,style:t,srcSet:m,sizes:g,quality:u,priority:i,fill:o,loader:p,dimmed:S,hidden:f,onReady:h,onLoad:s,width:a,height:n,alt:v,...y}){const{loader:l,widths:L}=R(),{managed:z,setLoadingImg:I,onReadyRef:b,opacityStyle:r}=x({src:e,dimmed:S,hidden:f,onReady:h}),P=C(t,a!==void 0&&n!==void 0&&!o),d=m??E(e,p??l,u,L);return w("img",{src:M(e),srcSet:d,sizes:d?g:void 0,alt:v??"",className:F(z&&"transition-opacity duration-200 ease-in-out",c),style:o?{...N,...t,...r}:{...P,...r},width:o?void 0:a,height:o?void 0:n,loading:i?"eager":"lazy",fetchPriority:i?"high":void 0,onLoad:j=>{I(!1),b.current?.(),typeof s=="function"&&s(j)},...y})}export{B as Image,B as default};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ImageLoader } from './imageShared';
|
|
3
|
+
export type ImageProviderConfig = {
|
|
4
|
+
/**
|
|
5
|
+
* Turns a `src` + width into a URL. Supplying one lets `<Image>` emit a
|
|
6
|
+
* `srcset`, which is what makes `sizes` and `quality` meaningful on the plain
|
|
7
|
+
* `<img>` base component.
|
|
8
|
+
*
|
|
9
|
+
* Omit it and images render single-`src` — correct, just unoptimized.
|
|
10
|
+
*
|
|
11
|
+
* This is deliberately injected rather than imported, the same way
|
|
12
|
+
* `RouteProvider` takes `pathname`: it is what lets `@clicktap/ui` stay
|
|
13
|
+
* framework-agnostic (CTAP-1125). A Next app can supply the Next optimizer, an
|
|
14
|
+
* app behind a resizing CDN supplies a URL-param loader.
|
|
15
|
+
*
|
|
16
|
+
* A loader only helps RUNTIME urls. Images the bundler can see are better
|
|
17
|
+
* served by build-time variants — pass the resulting string to `srcSet`
|
|
18
|
+
* instead, which wins over the loader.
|
|
19
|
+
*/
|
|
20
|
+
loader?: ImageLoader;
|
|
21
|
+
/** Override the width ladder used to build `srcset`. */
|
|
22
|
+
widths?: number[];
|
|
23
|
+
};
|
|
24
|
+
type ImageProviderProps = {
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
config: ImageProviderConfig;
|
|
27
|
+
};
|
|
28
|
+
export declare function ImageProvider({ children, config }: ImageProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare function useImageConfig(): ImageProviderConfig;
|
|
30
|
+
export default ImageProvider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as n}from"react/jsx-runtime";import{createContext as r,useContext as u}from"react";const i={},e=r(i);function m({children:t,config:o}){return n(e.Provider,{value:o,children:t})}function s(){return u(e)}export{m as ImageProvider,m as default,s as useImageConfig};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A `src` this library accepts. Structurally compatible with Next's
|
|
4
|
+
* `StaticImageData` (what `import hero from './hero.png'` yields under a bundler
|
|
5
|
+
* that emits metadata) without importing anything from `next` — see CTAP-1125.
|
|
6
|
+
*/
|
|
7
|
+
export type ImageSrcLike = string | {
|
|
8
|
+
src: string;
|
|
9
|
+
width?: number;
|
|
10
|
+
height?: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Produces a URL for one width. Same shape as `next/image`'s loader, so the Next
|
|
14
|
+
* variant can hand its own straight through.
|
|
15
|
+
*
|
|
16
|
+
* This is the seam that makes optimization portable: a Next app supplies the
|
|
17
|
+
* Next optimizer, an app behind a resizing CDN supplies a URL-param loader, and
|
|
18
|
+
* an app with neither supplies nothing and gets a correct single-src `<img>`.
|
|
19
|
+
* It cannot conjure variants that do not exist — see the guide.
|
|
20
|
+
*/
|
|
21
|
+
export type ImageLoader = (args: {
|
|
22
|
+
src: string;
|
|
23
|
+
width: number;
|
|
24
|
+
quality?: number;
|
|
25
|
+
}) => string;
|
|
26
|
+
/**
|
|
27
|
+
* Accepted by the helpers below, which are shared with the Next variant. Wider
|
|
28
|
+
* than `ImageSrcLike` on purpose: Next's `StaticImport` also admits a
|
|
29
|
+
* `{ default: StaticImageData }` wrapper, and these need to take it without the
|
|
30
|
+
* framework-free half importing Next's types.
|
|
31
|
+
*/
|
|
32
|
+
type SrcInput = unknown;
|
|
33
|
+
/** Stable identity for a `src`, used to detect changes across renders. */
|
|
34
|
+
export declare function getSrcKey(src: SrcInput): string;
|
|
35
|
+
/** The URL out of any accepted `src` shape. */
|
|
36
|
+
export declare function resolveSrc(src: SrcInput): string;
|
|
37
|
+
/**
|
|
38
|
+
* Default width ladder for loader-generated `srcset`. Mirrors the storefront's
|
|
39
|
+
* `next.config` `deviceSizes`/`imageSizes` closely enough that swapping between
|
|
40
|
+
* the base and Next variants does not change which file a browser picks.
|
|
41
|
+
*/
|
|
42
|
+
export declare const DEFAULT_IMAGE_WIDTHS: number[];
|
|
43
|
+
/**
|
|
44
|
+
* Build a `srcset` by calling `loader` at each width.
|
|
45
|
+
*
|
|
46
|
+
* Returns undefined with no loader — the caller then renders a single-`src`
|
|
47
|
+
* `<img>`, which is correct, just unoptimized.
|
|
48
|
+
*/
|
|
49
|
+
export declare function buildSrcSet(src: SrcInput, loader: ImageLoader | undefined, quality?: number, widths?: number[]): string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* When width/height are given (and not `fill`), default height to `auto` so the
|
|
52
|
+
* aspect ratio is preserved rather than squashed to the declared height.
|
|
53
|
+
*/
|
|
54
|
+
export declare function useImageStyle(style: CSSProperties | undefined, hasSizedProps: boolean): CSSProperties | undefined;
|
|
55
|
+
type ManagedOpacityArgs = {
|
|
56
|
+
src: SrcInput;
|
|
57
|
+
dimmed?: boolean;
|
|
58
|
+
hidden?: boolean;
|
|
59
|
+
onReady?: () => void;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* The `dimmed` / `hidden` / `onReady` fade behaviour, shared by both variants.
|
|
63
|
+
*
|
|
64
|
+
* Only engages when one of those props is passed (`managed`), so a plain
|
|
65
|
+
* `<Image src=… />` pays nothing and renders with no transition class.
|
|
66
|
+
*/
|
|
67
|
+
export declare function useManagedOpacity({ src, dimmed, hidden, onReady, }: ManagedOpacityArgs): {
|
|
68
|
+
managed: boolean;
|
|
69
|
+
loadingImg: boolean;
|
|
70
|
+
setLoadingImg: import('react').Dispatch<import('react').SetStateAction<boolean>>;
|
|
71
|
+
onReadyRef: import('react').MutableRefObject<(() => void) | undefined>;
|
|
72
|
+
opacityStyle: CSSProperties;
|
|
73
|
+
};
|
|
74
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useState as y,useRef as s}from"react";function a(t){return typeof t=="string"?t:JSON.stringify(t)}function S(t){if(typeof t=="string")return t;if(typeof t!="object"||t===null)return"";if("src"in t&&typeof t.src=="string")return t.src;const n=t.default;return typeof n?.src=="string"?n.src:""}const l=[16,32,48,64,96,128,256,384,640,750,828,1080,1200,1920,2048,3840];function m(t,n,i,e=l){if(!n)return;const r=S(t);if(r)return e.map(o=>`${n({src:r,width:o,quality:i})} ${o}w`).join(", ")}function I(t,n){return n?{height:"auto",...t}:t}function K({src:t,dimmed:n,hidden:i,onReady:e}){const[r,o]=y(!0),c=s(t),f=s(e);f.current=e;const u=n!==void 0||i!==void 0||e!==void 0;if(u){const g=a(t),p=a(c.current);g!==p&&(c.current=t,o(!0))}return{managed:u,loadingImg:r,setLoadingImg:o,onReadyRef:f,opacityStyle:u?{opacity:i?0:r||n?.5:1}:{}}}export{l as DEFAULT_IMAGE_WIDTHS,m as buildSrcSet,a as getSrcKey,S as resolveSrc,I as useImageStyle,K as useManagedOpacity};
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export { Image } from './Image';
|
|
1
|
+
export { Image, type ImageProps } from './Image';
|
|
2
|
+
export { ImageProvider, useImageConfig, type ImageProviderConfig, } from './ImageContext';
|
|
3
|
+
export { buildSrcSet, resolveSrc, DEFAULT_IMAGE_WIDTHS, type ImageLoader, type ImageSrcLike, } from './imageShared';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Image as
|
|
1
|
+
import{Image as i}from"./Image.js";import{ImageProvider as I,useImageConfig as f}from"./ImageContext.js";import{DEFAULT_IMAGE_WIDTHS as S,buildSrcSet as a,resolveSrc as x}from"./imageShared.js";import"react/jsx-runtime";import"../../utils/cn.js";import"react";export{S as DEFAULT_IMAGE_WIDTHS,i as Image,I as ImageProvider,a as buildSrcSet,x as resolveSrc,f as useImageConfig};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Image/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Image/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as
|
|
1
|
+
"use client";import{jsxs as s,jsx as e}from"react/jsx-runtime";import{Label as p,TextField as v,Input as k,Text as L,FieldError as C}from"react-aria-components";import{forwardRef as I,useState as N}from"react";import{cn as r}from"../../utils/cn.js";import{Skeleton as P}from"../Skeleton/Skeleton.js";import M from"../../hooks/useIsClient.js";function S({className:t}){return s("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:[e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.64 0 8.577 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.64 0-8.577-3.007-9.963-7.178Z"}),e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})]})}function j({className:t}){return e("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"})})}function y({className:t}){return e(P,{className:r("w-full h-10 rounded-md z-20 relative",t)})}const W=I(({inputProps:t,label:l,description:d,errorMessage:x,placeholder:m,className:u,classNames:o,disableSkeleton:h,type:c,...b},w)=>{const g=M(),i=c==="password",[f,n]=N(!1);return!g&&!h?s("div",{className:r("flex flex-col w-full text-fg",u),children:[l?e(p,{className:r("flex text-fg-muted text-xs",o?.label),children:l}):null,e(y,{className:o?.skeleton})]}):s(v,{className:r("flex flex-col w-full text-fg",u),type:i?f?"text":"password":c,...b,children:[e(p,{className:r("flex text-fg-muted text-xs",o?.label),children:l}),s("div",{className:"relative",children:[e(k,{ref:w,placeholder:m,className:r("border-solid border border-border rounded-md","text-sm text-fg placeholder-fg-subtle","h-10 px-2 py-0 m-0 w-full","bg-white","transition-all duration-200 ease-in-out","hover:border-border-emphasis","focus:outline-2 focus:outline focus:outline-border-subtle focus:border-border-emphasis","disabled:border-border-subtle disabled:bg-surface-subtle","invalid:border-danger-soft invalid:bg-danger-surface invalid:text-danger","invalid:hover:border-danger invalid:focus:border-danger invalid:focus:outline-danger-ring",i&&"pr-10",o?.input),...t}),i&&e("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-fg-subtle hover:text-slate-600 bg-transparent border-none cursor-pointer select-none",onPointerDown:a=>{a.preventDefault(),n(!0)},onPointerUp:()=>n(!1),onPointerLeave:()=>n(!1),onPointerCancel:()=>n(!1),onContextMenu:a=>a.preventDefault(),"aria-label":"Show password while pressed",tabIndex:-1,children:f?e(j,{className:"w-5 h-5"}):e(S,{className:"w-5 h-5"})})]}),d&&e(L,{className:r("flex text-fg-muted text-sm",o?.description),slot:"description",children:d}),e(C,{className:r("flex text-danger-soft text-sm",o?.error),children:x})]})});export{W as Input,W as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Input/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Input/index.js';
|
package/components/Link/Link.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as f}from"react/jsx-runtime";import{forwardRef as p,useMemo as c}from"react";import{Link as x}from"react-aria-components";import{cn as k}from"../../utils/cn.js";import{useLinkConfig as b}from"./LinkContext.js";import{isExternalUrl as L}from"./utils.js";const v=p(({children:n,isDisabled:
|
|
1
|
+
"use client";import{jsx as f}from"react/jsx-runtime";import{forwardRef as p,useMemo as c}from"react";import{Link as x}from"react-aria-components";import{cn as k}from"../../utils/cn.js";import{useLinkConfig as b}from"./LinkContext.js";import{isExternalUrl as L}from"./utils.js";const v=p(({children:n,isDisabled:i,className:e,href:t,target:s,rel:a,...l},d)=>{const{baseUrl:r}=b(),o=c(()=>t?L(t,r):!1,[t,r]);return f(x,{...l,href:t,isDisabled:i,target:s??(o?"_blank":void 0),rel:a??(o?"noopener noreferrer":void 0),className:u=>{const m=typeof e=="function"?e(u):e;return k("flex items-center cursor-pointer","text-fg-muted","no-underline","transition-colors duration-300","hover:text-slate-800",['data-[disabled="true"]:cursor-default','data-[disabled="true"]:text-slate-300','data-[disabled="true"]:hover:text-slate-300'],m)},ref:d,children:n})});v.displayName="Link";export{v as Link,v as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Link/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Link/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as u}from"react/jsx-runtime";import{forwardRef as
|
|
1
|
+
"use client";import{jsx as u}from"react/jsx-runtime";import{forwardRef as p}from"react";import{cn as c}from"../../utils/cn.js";import{Link as m}from"../Link/Link.js";import"../Link/LinkContext.js";import{resolveVariant as g}from"../Button/Button.js";import"react-aria-components";import"../Link/utils.js";const h=p(({className:e,isDisabled:o,isLoading:r=!1,size:t="md",variant:d="solid",children:a,...b},n)=>{const s=g(d),i=["flex items-center justify-center","rounded-md border-solid border","font-semibold text-sm","py-2 px-8","transition-all duration-200 ease-in-out","focus:outline-2 focus:outline focus:outline-border-subtle pressed:scale-95",t==="sm"&&"h-8",t==="md"&&"h-10",t==="lg"&&"h-12",s==="ghost"&&["bg-transparent hover:bg-transparent focus:bg-transparent disabled:bg-transparent","border-transparent hover:border-transparent focus:border-transparent disabled:border-transparent","text-fg disabled:text-fg-subtle",r&&"disabled:text-fg"],s==="outline"&&["bg-transparent hover:bg-transparent focus:bg-transparent disabled:bg-transparent","border-border hover:border-border-emphasis focus:border-border-emphasis disabled:border-border-subtle","text-fg disabled:text-fg-muted",r&&["disabled:border-border","disabled:text-fg"]],s==="solid"&&["bg-surface-inverse-hover hover:bg-surface-inverse focus:bg-surface-inverse disabled:bg-surface-inverse","border-surface-inverse-hover hover:border-fg focus:border-fg disabled:border-border-subtle","text-white disabled:text-fg-subtle hover:text-white",r&&["disabled:border-fg","disabled:text-white"]]];return u(m,{ref:n,isDisabled:o,className:l=>{const f=typeof e=="function"?e(l):e;return c(i,f)},...b,children:a})});h.displayName="LinkAsButton";export{h as LinkAsButton,h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{LinkAsButton as
|
|
1
|
+
import{LinkAsButton as s}from"./LinkAsButton.js";import"react/jsx-runtime";import"react";import"../../utils/cn.js";import"../Link/Link.js";import"react-aria-components";import"../Link/LinkContext.js";import"../Link/utils.js";import"../Button/Button.js";export{s as LinkAsButton};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LinkAsButton/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LinkAsButton/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import{
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import{cn as a}from"../../utils/cn.js";function u({width:t,stroke:r,strokeLinecap:s="round",strokeWidth:i=5,className:l,style:n,...o}){return e("div",{style:{width:`${t}px`,...n},...o,className:a("relative","m-0","aspect-square",l),children:e("svg",{viewBox:"25 25 50 50",className:a("w-full h-full","absolute inset-x-0 inset-y-0","origin-center","m-auto","animate-ct-loader-spin"),children:e("circle",{className:"path animate-ct-loader-dash",cx:"50",cy:"50",fill:"none",r:"20",strokeDasharray:"1, 200",strokeDashoffset:"0",stroke:r,strokeLinecap:s,strokeMiterlimit:"10",strokeWidth:i})})})}export{u as CircularEasing,u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as r}from"react/jsx-runtime";import{cn as n}from"../../utils/cn.js";function s({classNames:e}){return r("span",{className:n(e?.base),children:Array.from(new Array(3)).map((l,a)=>r("div",{style:{animationDelay:`${a*.1}s`},className:n("animate-ct-loader-pulse","bg-slate-300","inline-block","w-2","h-2","m-0.5","rounded-lg",e?.dot)},a))})}export{s as Pulse,s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CircularEasing as
|
|
1
|
+
import{CircularEasing as p}from"./CircularEasing.js";import{Pulse as e}from"./Pulse.js";import"react/jsx-runtime";import"../../utils/cn.js";export{p as CircularEasing,e as Pulse};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Loader/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Loader/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Menu/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Menu/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as t,jsxs as f}from"react/jsx-runtime";import{Meter as p,Label as h}from"react-aria-components";import{motion as x}from"framer-motion";import{cn as e}from"../../utils/cn.js";function w({label:i,showValue:l=!0,value:n=0,minValue:o=0,maxValue:s=100,formatOptions:c={style:"percent"},className:d,classNames:r,...m}){return t(p,{className:e("flex flex-col gap-2",d),value:n,minValue:o,maxValue:s,formatOptions:c,...m,children:({percentage:a,valueText:u})=>f("div",{className:e("flex justify-between items-center gap-4",r?.labelWrapper),children:[i&&t(h,{className:e("text-sm",r?.label),children:i}),t("div",{className:e("flex-auto h-2.5 rounded-md bg-slate-300 forced-color-adjust-none overflow-hidden",r?.trackWrapepr),children:t(x.div,{className:e("h-full bg-surface-inverse-hover",r?.track),initial:{width:`${a}%`},animate:{width:`${a}%`},transition:{type:"spring",bounce:0}})}),l&&t("span",{className:e("text-sm tabular-nums ml-auto",r?.value),children:u})]})})}export{w as Meter,w as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Meter/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Meter/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Modal/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Modal/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ModalOverlay/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ModalOverlay/index.js';
|