@clicktap/ui 2.3.2 → 2.3.3
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/Badge/Badge.d.ts +2 -2
- package/components/Badge/Badge.js +1 -1
- package/components/Button/Button.js +1 -1
- package/components/Checkbox/Checkbox.js +1 -1
- package/components/Collection/CollectionFilterChips/CollectionFilterChips.js +1 -1
- package/components/Collection/CollectionFilters/CollectionFilters.js +1 -1
- package/components/Collection/CollectionToolbar/CollectionToolbar.js +1 -1
- package/components/Collection/EmptyResults/EmptyResults.js +1 -1
- package/components/Collection/FilterRenderer/Renderer/Swatch/SwatchText.js +1 -1
- package/components/Collection/ProductCardSwatches/ProductCardSwatches.js +1 -1
- package/components/Collection/ProductPrice/ProductPrice.js +1 -1
- package/components/ContextMenu/ContextMenu.js +1 -1
- package/components/CreditCardExpirationInput/CreditCardExpirationInput.js +1 -1
- package/components/CreditCardInput/CreditCardInput.js +1 -1
- package/components/DateInput/DateInput.js +1 -1
- package/components/Dialog/Dialog.js +1 -1
- package/components/Divider/Divider.js +1 -1
- package/components/DobInput/DobInput.js +1 -1
- package/components/Drawer/Drawer.js +1 -1
- package/components/FeatureGate/AccessDenied.js +1 -1
- package/components/FeatureGate/PermissionRequired.js +1 -1
- package/components/FeatureGate/UpgradePrompt.js +1 -1
- package/components/Input/Input.js +1 -1
- package/components/Link/Link.js +1 -1
- package/components/LinkAsButton/LinkAsButton.js +1 -1
- package/components/Loader/Pulse.js +1 -1
- package/components/Menu/ContextMenu.js +1 -1
- package/components/Meter/Meter.js +1 -1
- package/components/NumberInput/NumberInput.js +1 -1
- package/components/Pagination/Pagination.js +1 -1
- package/components/PasswordCheck/PasswordCheck.js +1 -1
- package/components/PhoneInput/PhoneInput.js +1 -1
- package/components/PinInput/PinInput.js +1 -1
- package/components/Progressbar/CircularProgressbar.js +1 -1
- package/components/Progressbar/LinearProgressbar.js +1 -1
- package/components/Select/ButtonSelect.js +1 -1
- package/components/Select/ComboBoxSelect.js +1 -1
- package/components/Select/MultiButtonSelect.js +1 -1
- package/components/Select/parts.js +1 -1
- package/components/Skeleton/Skeleton.js +1 -1
- package/components/Slider/Slider.js +1 -1
- package/components/Switch/Switch.js +1 -1
- package/components/Tabs/Tab.js +1 -1
- package/components/Tabs/TabList.js +1 -1
- package/components/TimeInput/TimeInput.js +1 -1
- package/components/ToggleButton/ToggleButton.js +1 -1
- package/components/Tooltip/Tooltip.js +1 -1
- package/components/UploadImage/UploadImage.js +1 -1
- package/docs/migrations/2026/09/ui-2026-09-24-dialog-semantic-surface-tokens.md +81 -0
- package/docs/migrations/2026/09/ui-2026-09-24-semantic-color-token-lint-rule.md +283 -0
- package/docs/migrations/index.json +20 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as d,Fragment as O}from"react/jsx-runtime";import{Children as V,isValidElement as _,Fragment as q}from"react";import{DisclosureGroup as H,Disclosure as J,Button as L,DisclosurePanel as Q}from"react-aria-components";import{cn as r}from"../../utils/cn.js";import{DownArrow as y}from"../Icon/DownArrow.js";function E(p){return null}function C({children:p,selectionMode:N="single",defaultSelectedKeys:w,defaultExpandedKeys:k,selectedKeys:A,onSelectionChange:I,disallowEmptySelection:v=!1,hideIndicator:D=!1,showDivider:S=!0,dividerProps:K,variant:
|
|
1
|
+
"use client";import{jsx as e,jsxs as d,Fragment as O}from"react/jsx-runtime";import{Children as V,isValidElement as _,Fragment as q}from"react";import{DisclosureGroup as H,Disclosure as J,Button as L,DisclosurePanel as Q}from"react-aria-components";import{cn as r}from"../../utils/cn.js";import{DownArrow as y}from"../Icon/DownArrow.js";function E(p){return null}function C({children:p,selectionMode:N="single",defaultSelectedKeys:w,defaultExpandedKeys:k,selectedKeys:A,onSelectionChange:I,disallowEmptySelection:v=!1,hideIndicator:D=!1,showDivider:S=!0,dividerProps:K,variant:i,isCompact:s,className:F,itemClasses:n}){const c=V.toArray(p).filter(_),b=(t,l)=>String(t.key??l).replace(/^\.\$/,"").replace(/=2/g,":").replace(/=0/g,"="),j=c.map(b),h=t=>t==="all"?j:t?[...t].map(String):void 0,P=h(w??k)??[],W=h(A);return e(H,{allowsMultipleExpanded:N==="multiple",defaultExpandedKeys:P,expandedKeys:W,onExpandedChange:t=>{const l=new Set([...t].map(String));v&&l.size===0||I?.(l)},className:r("px-0",i==="bordered"&&["px-4 py-4 rounded-xl border-2 border-border-subtle"],i==="shadow"&&["px-4 py-4 rounded-xl bg-surface-subtle border border-border-subtle"],F),children:c.map((t,l)=>{const f=b(t,l),{title:$,subtitle:m,startContent:g,indicator:u,hideIndicator:z,disableIndicatorAnimation:x,isDisabled:B,classNames:o,onPress:G,children:M}=t.props;return d(q,{children:[e(J,{id:f,isDisabled:B,className:r("w-full py-2","data-disabled:pointer-events-none data-disabled:opacity-50",i==="bordered"&&["rounded-xl py-0"],i==="splitted"&&["flex flex-col bg-surface-subtle rounded-xl border border-border-subtle"],s&&"py-0",n?.base,o?.base),children:({isExpanded:a})=>d(O,{children:[e("h2",{"data-open":a||void 0,className:r(n?.heading,o?.heading),children:d(L,{slot:"trigger","data-open":a||void 0,onPress:G,"aria-label":t.props["aria-label"],className:r("w-full h-full flex items-center gap-3 py-0 appearance-none cursor-pointer select-none","border-0 focus-visible:outline-2 focus-visible:outline focus-visible:outline-border-subtle","bg-transparent text-inherit",s&&["py-2"],n?.trigger,o?.trigger),children:[g!=null&&e("span",{className:r("shrink-0",n?.startContent,o?.startContent),children:g}),d("span",{className:r("flex-1 text-left",n?.titleWrapper,o?.titleWrapper),children:[e("span",{className:r("block text-xl font-semibold",s&&"text-base",n?.title,o?.title),children:$}),m!=null&&e("span",{className:r("block text-base",s&&"text-sm",n?.subtitle,o?.subtitle),children:m})]}),z||D?null:e("span",{"aria-hidden":"true","data-open":a||void 0,className:r("shrink-0",!x&&"transition-transform duration-200",!x&&a&&"-rotate-180",n?.indicator,o?.indicator),children:typeof u=="function"?e(u,{isOpen:a}):u??e(y,{className:"w-4 h-4"})})]})}),e("div",{className:r("grid transition-[grid-template-rows] duration-200 ease-in-out",a?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:e("div",{className:"overflow-hidden min-h-0",children:e(Q,{className:r(s?"py-1":"py-2",n?.content,o?.content),children:M})})})]})}),S&&l<c.length-1&&e("hr",{className:r("border-solid border-b-0 border-x-0",K?.className??["my-2 border-border-subtle",i==="shadow"&&"border-border"])})]},f)})})}function ee(){return e(y,{className:"w-4 h-4"})}export{C as Accordion,E as AccordionItem,ee as AccordionItemArrow,C as default};
|
|
@@ -7,14 +7,14 @@ import { BadgeProps } from './Badge.types';
|
|
|
7
7
|
* the badge. CTAP-1383 replaced it with this component, which splits that element in two — a
|
|
8
8
|
* positioning span and an animated pill — and the slot stayed on the positioning half. The pill
|
|
9
9
|
* then had no slot at all, so a consumer restyling "the badge" painted and sized a transparent
|
|
10
|
-
* wrapper while the pill kept its `variant` styling underneath: a
|
|
10
|
+
* wrapper while the pill kept its `variant` styling underneath: a colored square behind the pill.
|
|
11
11
|
*
|
|
12
12
|
* Applying `badge` to both halves is not the fix — that is what paints the wrapper. So each element
|
|
13
13
|
* has its own slot:
|
|
14
14
|
*
|
|
15
15
|
* base the relative anchor (unchanged)
|
|
16
16
|
* wrapper the absolutely-positioned span — placement and offset only
|
|
17
|
-
* badge the visible pill —
|
|
17
|
+
* badge the visible pill — color, size, radius, typography
|
|
18
18
|
*/
|
|
19
19
|
export declare function Badge({ children, isInvisible, disableAnimation, placement, shape, className, classNames, showOutline, content, isDot, isOneChar, size, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export default Badge;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as V,jsx as a}from"react/jsx-runtime";import{useId as v}from"react";import{AnimatePresence as z,m as C}from"framer-motion";import{cn as l}from"../../utils/cn.js";const S={hidden:{opacity:0,scale:0},show:{opacity:1,scale:1}};function P({children:
|
|
1
|
+
"use client";import{jsxs as V,jsx as a}from"react/jsx-runtime";import{useId as v}from"react";import{AnimatePresence as z,m as C}from"framer-motion";import{cn as l}from"../../utils/cn.js";const S={hidden:{opacity:0,scale:0},show:{opacity:1,scale:1}};function P({children:f,isInvisible:g,disableAnimation:d,placement:t="top-right",shape:e="rectangle",className:h,classNames:i,showOutline:c=!1,content:o,isDot:s,isOneChar:x,size:n="md",variant:r="solid",...b}){const m=v(),u=d?{duration:0}:{type:"spring",bounce:.3},p=String(o)?.length===1||x,w={sm:"text-xs",md:"text-sm",lg:"text-sm"},y=p?{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[n]:{sm:"min-w-4 h-4",md:"min-w-5 h-5",lg:"min-w-6 h-6"}[n];return V("div",{...b,className:l("relative","inline-flex shrink-0",h,i?.base),children:[f,a("span",{className:l("p-0","border-0","absolute z-10","flex",[t==="top-right"&&e==="rectangle"&&"top-0.5 right-px",t==="top-right"&&e==="circle"&&"top-1 right-1",t==="bottom-right"&&e==="rectangle"&&"bottom-0.5 right-px",t==="bottom-right"&&e==="circle"&&"bottom-1 right-1",t==="top-left"&&e==="rectangle"&&"top-0.5 left-px",t==="top-left"&&e==="circle"&&"top-1 left-1",t==="bottom-left"&&e==="rectangle"&&"bottom-0.5 left-px",t==="bottom-left"&&e==="circle"&&"bottom-1 left-1"],[t==="top-right"&&"translate-x-1/2 -translate-y-1/2",t==="bottom-right"&&"translate-x-1/2 translate-y-1/2",t==="bottom-left"&&"-translate-x-1/2 translate-y-1/2",t==="top-left"&&"-translate-x-1/2 -translate-y-1/2"],i?.wrapper),children:a(z,{children:!g&&a(C.span,{layout:!0,variants:S,initial:d?"show":"hidden",transition:u,animate:"show",exit:"hidden",className:l("flex flex-wrap","place-content-center","z-10","box-border","rounded-full","py-0 px-1","font-normal text-fg","select-none","whitespace-normal",r==="faded"?"text-fg":"text-fg-inverse",!o||s?"w-3.5 h-3.5":y,typeof o=="string"&&o.length>1||s?"text-xs":w[n],[r==="solid"&&"bg-surface-inverse-hover",r==="shadow"&&"bg-surface-inverse-hover",r==="flat"&&"bg-surface-inverse-hover/55",r==="faded"&&"bg-surface"],[r==="faded"&&"border-2 border-solid border-surface-inverse-hover",c&&r!=="faded"&&"border-2 border-solid border-surface"],i?.badge),children:!s&&o},`badge-${m}`)})})]})}export{P as Badge,P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as f}from"react/jsx-runtime";import{forwardRef as p}from"react";import{Button as c}from"react-aria-components";import{cn as g}from"../../utils/cn.js";function h(t){switch(t){case"primary":return"solid";case"secondary":return"outline";case"tertiary":return"ghost";default:return t}}const
|
|
1
|
+
"use client";import{jsx as f}from"react/jsx-runtime";import{forwardRef as p}from"react";import{Button as c}from"react-aria-components";import{cn as g}from"../../utils/cn.js";function h(t){switch(t){case"primary":return"solid";case"secondary":return"outline";case"tertiary":return"ghost";default:return t}}const B=p(function({className:s,isDisabled:n=!1,isLoading:e=!1,size:o="md",variant:d="solid",...a},b){const r=h(d),u=["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","cursor-pointer disabled:cursor-not-allowed","focus:outline-2 focus:outline focus:outline-border-subtle pressed:scale-95",o==="sm"&&"h-8",o==="md"&&"h-10",o==="lg"&&"h-12",r==="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",e&&"disabled:text-fg"],r==="link"&&["bg-transparent hover:bg-transparent focus:bg-transparent disabled:bg-transparent","border-transparent hover:border-transparent focus:border-transparent disabled:border-transparent","inline-flex h-auto p-0 rounded-none","underline underline-offset-2","text-fg disabled:text-fg-muted hover:opacity-70",e&&"disabled:text-fg"],r==="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",e&&["disabled:border-border","disabled:text-fg"]],r==="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-fg-inverse disabled:text-fg-subtle",e&&["disabled:border-fg","disabled:text-fg-inverse"]]];return f(c,{ref:b,type:"button",isDisabled:n,className:i=>{const l=typeof s=="function"?s(i):s;return g(u,l)},...a})});export{B as Button,B as default,h as resolveVariant};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as n,jsxs as c,Fragment as h}from"react/jsx-runtime";import{Checkbox as s}from"react-aria-components";import{cn as l}from"../../utils/cn.js";function x({control:e,isHovered:u,isFocused:a,isDisabled:t,isIndeterminate:r,isInvalid:o,isSelected:b,isPressed:f,classNames:d,...g}){return e?typeof e=="function"?e({isHovered:u,isFocused:a,isDisabled:t,isIndeterminate:r,isInvalid:o,isSelected:b,isPressed:f,...g}):e:n("div",{className:l("flex items-center justify-center","w-6 h-6","border border-solid border-border rounded","transition-all duration-200 ease-in-out","checkbox-control",u&&["border-border-emphasis"],a&&["border-border-emphasis outline-2 outline outline-border-subtle"],(t||t&&r)&&["border-border-subtle bg-surface-subtle"],o&&["bg-surface-subtle text-danger border-danger-soft"],o&&u&&["border-danger"],o&&a&&["border-danger outline-danger-ring"],o&&b&&r&&["bg-danger-soft border-danger-soft"],o&&b&&r&&f&&["bg-danger border-danger"],(b||r)&&["border-border bg-border"],(b||r)&&f&&["border-border-emphasis bg-border-emphasis"],d?.control),children:n("svg",{viewBox:"0 0 18 18","aria-hidden":"true",style:{strokeDasharray:"22px",strokeDashoffset:b||r?44:66},className:l("w-4 h-4 fill-none","stroke-white stroke-[3px]","transition-all duration-200 ease-in-out",t&&r&&["stroke-none fill-border"],r&&["stroke-none fill-white"]),children:r?n("rect",{x:1,y:7.5,width:15,height:3}):n("polyline",{points:"1 9 7 14 15 4"})})})}function w({children:e,slots:u,className:a,classNames:t,...r}){return n(s,{className:l("flex items-center gap-2 cursor-pointer","text-xs text-fg-muted forced-color-adjust-none disabled:text-fg-subtle disabled:cursor-not-allowed group","invalid:text-danger-soft",a),...r,children:o=>c(h,{children:[n(x,{control:u?.control,classNames:t,...o}),typeof e=="function"?e(o):e]})})}export{w as Checkbox,w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as m,jsx as o}from"react/jsx-runtime";import{useMemo as i}from"react";import{Button as s}from"../../Button/Button.js";import"../../../utils/cn.js";import{CrossSmall as n}from"../../Icon/CrossSmall.js";import{getAppliedFilterChips as
|
|
1
|
+
"use client";import{jsxs as m,jsx as o}from"react/jsx-runtime";import{useMemo as i}from"react";import{Button as s}from"../../Button/Button.js";import"../../../utils/cn.js";import{CrossSmall as n}from"../../Icon/CrossSmall.js";import{getAppliedFilterChips as d}from"../../../utils/collection/getAppliedFilterChips.js";import{removeFilterChip as p}from"../../../utils/collection/removeFilterChip.js";import"react-aria-components";function g({appliedFilters:e,onFilterChange:t}){const l=i(()=>d(e),[e]);return l.length===0?null:m("div",{className:"pt-6 mt-5 border-t border-solid border-border-subtle",children:[o("div",{className:"flex gap-3 flex-wrap mb-3",children:l.map(r=>m(s,{variant:"outline",className:"px-2 py-1 h-6 font-medium text-xs flex items-center gap-x-1 rounded-md",onPress:()=>t(p(e,r)),children:[r.label,o(n,{})]},`${r.filterCode}-${r.optionId??"bool"}`))}),o(s,{variant:"ghost",className:"px-2 py-1 h-6 font-bold text-xs text-danger-soft",onPress:()=>t([]),children:"Clear All"})]})}export{g as CollectionFilterChips};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as l,Fragment as h,jsx as e}from"react/jsx-runtime";import{useMemo as b,Suspense as x,useState as v}from"react";import{Accordion as g,AccordionItem as w}from"../../Accordion/Accordion.js";import{Button as f}from"../../Button/Button.js";import"../../../utils/cn.js";import{ModalOverlay as
|
|
1
|
+
"use client";import{jsxs as l,Fragment as h,jsx as e}from"react/jsx-runtime";import{useMemo as b,Suspense as x,useState as v}from"react";import{Accordion as g,AccordionItem as w}from"../../Accordion/Accordion.js";import{Button as f}from"../../Button/Button.js";import"../../../utils/cn.js";import{ModalOverlay as N}from"../../ModalOverlay/ModalOverlay.js";import{Modal as y}from"../../Modal/Modal.js";import{Drawer as k}from"../../Drawer/Drawer.js";import{Cross as C}from"../../Icon/Cross.js";import{CrossSmall as A}from"../../Icon/CrossSmall.js";import{Search as D}from"../../Icon/Search.js";import{FilterRenderer as I}from"../FilterRenderer/FilterRenderer.js";import{mergeFilters as S}from"../../../utils/collection/mergeFilters.js";import{FilterAccordionTitle as j}from"../FilterAccordionTitle/FilterAccordionTitle.js";import{EmptyResults as L}from"../EmptyResults/EmptyResults.js";import"react-aria-components";import"../../Icon/DownArrow.js";import"framer-motion";import"../../../utils/env.js";import"../../../utils/swatch.js";import"../FilterRenderer/Renderer/Option.js";import"../../Checkbox/Checkbox.js";import"../FilterRenderer/Renderer/useOptionFilterToggle.js";import"../FilterRenderer/Renderer/Swatch.js";import"../FilterRenderer/Renderer/Swatch/SwatchColor.js";import"../../Icon/CheckIcon.js";import"../../../utils/color.js";import"../FilterRenderer/Renderer/Swatch/SwatchImage.js";import"../FilterRenderer/Renderer/Swatch/SwatchText.js";import"../FilterRenderer/Renderer/Boolean.js";import"../../RadioGroup/RadioGroup.js";import"../../Radio/Radio.js";import"../FilterRenderer/Renderer/Range.js";function M(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function V({value:a,onChange:r}){const[o,c]=v(a),m=()=>{r(o.trim())};return l("div",{className:"relative",children:[e("input",{type:"search",value:o,onChange:i=>c(i.target.value),onKeyDown:i=>{i.key==="Enter"&&(i.preventDefault(),m())},onBlur:m,placeholder:"Search products...","aria-label":"Search products",autoComplete:"off",className:"w-full h-9 pl-8 pr-8 rounded-md border border-border bg-surface text-sm text-fg placeholder:text-fg-subtle focus:outline-none focus:border-border-emphasis [&::-webkit-search-cancel-button]:hidden"}),o&&e("button",{type:"button",onClick:()=>{c(""),r("")},"aria-label":"Clear search",className:"absolute right-2 top-1/2 -translate-y-1/2 p-0.5 rounded-full hover:bg-surface-subtle transition-colors cursor-pointer",children:e(A,{})}),e("span",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 [&>svg]:w-full [&>svg]:h-full text-fg-subtle",children:e(D,{})})]})}function ue({availableFilters:a,appliedFilters:r,onFilterChange:o,showMobileFilters:c,setShowMobileFilters:m,searchQuery:s,onSearchChange:n,totalItems:i}){const u=b(()=>S(r,a).filter(t=>t.includeInFilters!==!1),[r,a]),d=n&&e(V,{value:s??"",onChange:n},s),p=()=>u.length>0&&e(g,{selectionMode:"multiple",defaultSelectedKeys:"all",className:"pt-2 mt-3",showDivider:!1,itemClasses:{base:"py-1",title:"text-sm font-medium leading-7",trigger:"py-2 border-b border-border-subtle",indicator:'data-[open="true"]:rotate-180',content:"pt-2 pb-3"},children:u.map(t=>e(w,{textValue:t.label,title:e(j,{filter:t,appliedFilters:r,onFilterChange:o}),disableIndicatorAnimation:!0,indicator:M,children:e("div",{className:"pt-2",children:e(I,{filter:t,onFilterChange:o,appliedFilters:r,variant:"sidebar"})})},t.code))});return l(h,{children:[l("div",{className:"hidden lg:flex lg:flex-col lg:basis-[16.5rem] lg:shrink-0",children:[d,p(),r.length>0&&e("button",{type:"button",className:"text-sm text-fg-muted hover:text-fg transition-colors mt-4 mb-8 cursor-pointer",onClick:()=>o([]),children:"Clear all filters"})]}),e("div",{className:"lg:hidden",children:e(x,{children:e(N,{isOpen:c,onOpenChange:t=>m(t),isDismissable:!0,children:e(y,{children:e(k,{size:"30rem",direction:"left","aria-label":"Filters",className:"p-5",children:({close:t})=>l("div",{className:"flex flex-col w-full h-full overflow-hidden",children:[l("div",{className:"flex items-center w-full justify-between",children:[e("span",{className:"text-xl font-bold text-fg",children:"Filters"}),e(f,{variant:"ghost","aria-label":"Close",onPress:()=>t(),className:"justify-start size-auto p-0",children:e(C,{})})]}),l("div",{className:"flex flex-col flex-1 overflow-x-hidden overflow-y-auto [scrollbar-width:none] [-webkit-overflow-scrolling:touch] [&::-webkit-scrollbar]:hidden",children:[d&&e("div",{className:"mt-3",children:d}),p(),i===0&&e(L,{searchQuery:s,hasFilters:r.length>0,onClearFilters:()=>o([]),onClearSearch:s&&n?()=>n(""):void 0})]}),l("div",{className:"shrink-0 pt-3 flex flex-col gap-3 border-t border-border-subtle",children:[r.length>0&&e("button",{type:"button",className:"text-sm py-2 text-fg-muted hover:text-fg transition-colors cursor-pointer",onClick:()=>o([]),children:"Clear all"}),e(f,{className:"w-full py-6 text-base rounded-xl",variant:"primary",onPress:()=>t(),children:"View Results"})]})]})})})})})})]})}export{ue as CollectionFilters};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as i,jsx as l}from"react/jsx-runtime";import{Option as p}from"../../Select/Option.js";import{Select as x}from"../../Select/Select.js";import{Button as h}from"../../Button/Button.js";import"../../../utils/cn.js";import{FilterIcon as u}from"../../Icon/FilterIcon.js";import"react-stately";import"react";import"../../Select/ButtonSelect.js";import"react-aria";import"@react-aria/interactions";import"../../Select/parts.js";import"react-aria-components";import"../../Select/ComboBoxSelect.js";import"../../Loader/Pulse.js";import"../../Select/MultiButtonSelect.js";function D({totalItems:o,startItem:
|
|
1
|
+
"use client";import{jsxs as i,jsx as l}from"react/jsx-runtime";import{Option as p}from"../../Select/Option.js";import{Select as x}from"../../Select/Select.js";import{Button as h}from"../../Button/Button.js";import"../../../utils/cn.js";import{FilterIcon as u}from"../../Icon/FilterIcon.js";import"react-stately";import"react";import"../../Select/ButtonSelect.js";import"react-aria";import"@react-aria/interactions";import"../../Select/parts.js";import"react-aria-components";import"../../Select/ComboBoxSelect.js";import"../../Loader/Pulse.js";import"../../Select/MultiButtonSelect.js";function D({totalItems:o,startItem:m,endItem:s,setShowMobileFilters:n,availableSortOrders:r,appliedSortOrder:e,onSortChange:a}){const c=[...e?[e]:[],...r];return i("div",{className:"flex flex-col gap-y-5 mb-3",children:[i("div",{className:"flex items-center justify-between lg:justify-end gap-x-2",children:[i(h,{className:"lg:hidden grow-0 shrink-0 basis-auto gap-x-3 px-4",size:"sm",variant:"outline",onPress:()=>n(!0),children:[l(u,{className:"w-3 h-3"}),"Filters"]}),l(x,{className:"w-44",selectedKey:e?`${e.code}_${e.direction}`:null,onSelectionChange:a,placeholder:"Sort by",label:"Sort By:",classNames:{input:"text-xs w-44 h-8 min-h-0",value:"text-xs",label:"hidden lg:block text-xs text-fg-muted whitespace-nowrap"},children:c.map(t=>l(p,{textValue:t.label,children:t.label},`${t.code}_${t.direction}`))})]}),o>0&&i("p",{className:"text-sm text-fg-muted",children:["Displaying ",m," - ",s," of ",o," items"]})]})}export{D as CollectionToolbar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as
|
|
1
|
+
"use client";import{jsxs as i,jsx as t}from"react/jsx-runtime";function r({searchQuery:e,hasFilters:n,onClearFilters:s,onClearSearch:o}){const c=n&&s||e&&o;return i("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center col-span-full",children:[i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-fg-subtle mb-4",children:[t("circle",{cx:"11",cy:"11",r:"8"}),t("path",{d:"m21 21-4.3-4.3"})]}),t("h3",{className:"text-lg font-semibold text-fg mb-2",children:"No results found"}),e&&i("p",{className:"text-sm text-fg-muted mb-4",children:["We couldn't find anything matching “",e,"”"]}),!e&&!n&&t("p",{className:"text-sm text-fg-muted mb-4",children:"No products match your current selection."}),c&&i("div",{className:"flex items-center gap-3",children:[e&&o&&t("button",{type:"button",onClick:o,className:"text-sm font-medium text-fg-muted hover:text-fg underline underline-offset-2 transition-colors cursor-pointer",children:"Clear search"}),n&&s&&e&&o&&t("span",{className:"text-fg-subtle",children:"|"}),n&&s&&t("button",{type:"button",onClick:s,className:"text-sm font-medium text-fg-muted hover:text-fg underline underline-offset-2 transition-colors cursor-pointer",children:"Clear all filters"})]}),!c&&t("p",{className:"text-xs text-fg-subtle",children:"Try a different search term or browse our categories."})]})}export{r as EmptyResults};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as x}from"react/jsx-runtime";import{Checkbox as b}from"../../../../Checkbox/Checkbox.js";import{cn as
|
|
1
|
+
"use client";import{jsx as r,jsxs as x}from"react/jsx-runtime";import{Checkbox as b}from"../../../../Checkbox/Checkbox.js";import{cn as f}from"../../../../../utils/cn.js";import{useOptionFilterToggle as h}from"../useOptionFilterToggle.js";import"react-aria-components";function $({filter:o,onFilterChange:n,appliedFilters:d,variant:a="drawer"}){const{handleOptionToggle:i,getOptionIsChecked:l}=h({filter:o,onFilterChange:n,appliedFilters:d}),t=o.options.map(e=>{const c=l(e.code),m=e.swatch?.text??e.label;return r("div",{children:r(b,{isSelected:c,className:"cursor-pointer",onChange:s=>i(e.code,s),slots:{control:({isSelected:s,isHovered:u})=>r("span",{className:f("inline-flex items-center justify-center px-3.5 py-2 text-xs font-medium border shrink-0 transition-colors duration-150",s?"bg-surface-inverse text-fg-inverse border-fg":"bg-surface text-fg border-border",u&&!s&&"border-fg-muted"),children:m})}},`swatch-${o.code}-${e.code}-${String(c)}`)},`${o.code}-${e.code}`)});return a==="sidebar"?r("div",{className:"flex flex-wrap gap-2 pb-2",children:t}):x("div",{className:"border border-border-subtle rounded-lg p-4",children:[r("h4",{className:"font-medium mb-3",children:o.label}),r("div",{className:"flex flex-wrap gap-2 max-h-60 overflow-y-auto",children:t})]})}export{$ as SwatchText};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as c,jsxs as I,Fragment as R}from"react/jsx-runtime";import{Button as p}from"react-aria-components";import{cn as b}from"../../../utils/cn.js";import{CheckIcon as M}from"../../Icon/CheckIcon.js";import{isDevelopment as x}from"../../../utils/env.js";import{isValidHex as P,isVeryLight as j}from"../../../utils/color.js";import{isSwatchRenderer as y,SwatchRenderer as $,isValidImageUrl as _}from"../../../utils/swatch.js";function L(d){const s=new Map;for(const
|
|
1
|
+
"use client";import{jsx as c,jsxs as I,Fragment as R}from"react/jsx-runtime";import{Button as p}from"react-aria-components";import{cn as b}from"../../../utils/cn.js";import{CheckIcon as M}from"../../Icon/CheckIcon.js";import{isDevelopment as x}from"../../../utils/env.js";import{isValidHex as P,isVeryLight as j}from"../../../utils/color.js";import{isSwatchRenderer as y,SwatchRenderer as $,isValidImageUrl as _}from"../../../utils/swatch.js";function L(d){const s=new Map;for(const i of d)if("renderer"in i&&y(i.renderer)&&"options"in i)for(const a of i.options)a.swatch&&s.set(a.id,{...a.swatch,attributeCode:i.code,optionCode:a.code});return s}function T(d){const s=new Set;for(const i of d)if(i.simpleProduct?.saleability?.isSaleable!==!1)for(const a of i.attributes)s.add(`${a.attribute.code}:${a.option.code}`);return s}function V(d,s,i,a){const m=new Set,h=[];for(const l of d)for(const r of l.attributes){const f=s.get(r.option.id);f&&!m.has(r.option.id)&&i.has(r.attribute.code)&&(m.add(r.option.id),h.push({optionId:r.option.id,optionCode:f.optionCode,attributeCode:r.attribute.code,label:r.option.label,swatch:f,image:l.simpleProduct.image??null,isSaleable:a.has(`${r.attribute.code}:${r.option.code}`)}))}return h.sort((l,r)=>l.isSaleable===r.isSaleable?0:l.isSaleable?-1:1),h}function O({variants:d,availableFilters:s,attributeSwatchConfigs:i=[],matchedOptionIds:a,selectedOptionId:m,onSelect:h}){const l=new Map;for(const e of i)e.swatch?.listRenderer&&(x&&!y(e.swatch.listRenderer)&&console.warn(`[Swatch] Unknown listRenderer "${e.swatch.listRenderer}" for attribute "${e.code}" — skipping list swatches`),l.set(e.code,e.swatch.listRenderer));const r=L(s),f=T(d),u=V(d,r,l,f);if(u.length===0)return null;const U=new Set(u.map(e=>e.optionId)),k=a.find(e=>U.has(e)),N=m??k??u[0]?.optionId??null,S=u[0]?l.get(u[0].attributeCode)??null:null;return c("div",{className:"flex flex-row flex-wrap items-center gap-2 mt-1.5",children:u.map(e=>{const o=N===e.optionId,g=e.isSaleable?e.label:`${e.label} (out of stock)`;if(S===$.IMAGE)return c(p,{"aria-label":g,className:"cursor-pointer p-0",onPress:()=>{h(e.optionId,e.optionCode,e.image,e.attributeCode)},children:({isHovered:t})=>c("span",{className:b("block w-8 aspect-[2.2/1] border bg-contain bg-center bg-no-repeat transition-all duration-150",o?"border-fg ring-1 ring-fg":"border-border-subtle",t&&!o&&"border-border-emphasis"),title:g,style:e.swatch.imageUrl?{backgroundImage:`url(${e.swatch.imageUrl})`}:void 0})},e.optionId);if(S===$.TEXT)return c(p,{"aria-label":g,className:"cursor-pointer p-0",onPress:()=>{h(e.optionId,e.optionCode,e.image,e.attributeCode)},children:({isHovered:t})=>c("span",{className:b("inline-flex items-center px-1.5 py-0.5 text-[10px] font-medium border transition-colors duration-150",o?"bg-surface-inverse text-fg-inverse border-fg":"bg-surface text-fg border-border",t&&!o&&"border-fg-muted"),children:e.swatch.text??e.label})},e.optionId);const n=_(e.swatch.imageUrl),C=P(e.swatch.hex);if(!n&&!C){if(x){const t=[];e.swatch.hex&&!C&&t.push(`invalid hex "${e.swatch.hex}"`),e.swatch.imageUrl&&!n&&t.push(`invalid imageUrl "${e.swatch.imageUrl}"`),!e.swatch.hex&&!e.swatch.imageUrl&&t.push("missing hex and imageUrl"),console.warn(`[Swatch] Skipping list swatch for attribute "${e.attributeCode}" option "${e.optionCode}" — ${t.join("; ")}`)}return null}x&&e.swatch.imageUrl&&!n&&console.warn(`[Swatch] Falling back to SWATCH (hex) renderer for attribute "${e.attributeCode}" option "${e.optionCode}" — invalid imageUrl "${e.swatch.imageUrl}"`);const w=n?!1:j(e.swatch.hex??null),v=n?{backgroundImage:`url(${e.swatch.imageUrl})`}:{backgroundColor:e.swatch.hex??void 0};return c(p,{"aria-label":g,className:"cursor-pointer size-4 flex items-center justify-center p-0",onPress:()=>{h(e.optionId,e.optionCode,e.image,e.attributeCode)},children:({isHovered:t})=>I("span",{className:b("relative inline-flex items-center justify-center size-4 rounded-full transition-all duration-150 overflow-hidden",n&&"bg-cover bg-center",n&&o&&"ring-2 ring-inset ring-white shadow-[0_0_0_2px_#222]",n&&t&&!o&&"ring-1 ring-border-emphasis",!n&&w&&"border border-border"),style:v,children:[!e.isSaleable&&I(R,{children:[c("span",{className:b("absolute top-1/2 left-1/2 w-[141%] h-[1.5px] -translate-x-1/2 -translate-y-1/2 -rotate-45",w?"bg-slate-400":"bg-white drop-shadow-sm",t&&!o&&"opacity-70")}),(o||t)&&c("span",{className:b("absolute top-1/2 left-1/2 w-[141%] h-[1.5px] -translate-x-1/2 -translate-y-1/2 rotate-45",w?"bg-slate-400":"bg-white drop-shadow-sm",t&&!o&&"opacity-70")})]}),!n&&e.isSaleable&&(o||t)&&c(M,{className:b("w-2.5 h-2.5 transition-opacity duration-150",w?"text-fg-subtle":"text-white drop-shadow-sm",t&&!o&&"opacity-70")})]})},e.optionId)})})}export{O as ProductCardSwatches};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as c}from"react/jsx-runtime";const r=e=>Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(e);function
|
|
1
|
+
"use client";import{jsx as c}from"react/jsx-runtime";const r=e=>Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(e);function s({product:e}){const t=e.type.code;if(t==="simple"&&e.price!=null)return c("span",{className:"text-fg",children:r(e.price)});if(t==="configurable"){const n=e.minPrice??0,i=e.maxPrice??0;if(n===0&&i===0)return null;const m=n!==i&&i>0?`${r(n)} - ${r(i)}`:r(n);return c("span",{className:"text-fg",children:m})}return null}export{s as ProductPrice};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as n}from"react/jsx-runtime";import{Popover as
|
|
1
|
+
"use client";import{jsx as n}from"react/jsx-runtime";import{Popover as h,Menu as l}from"react-aria-components";import{forwardRef as _}from"react";import{m as v}from"framer-motion";import{cn as t}from"../../utils/cn.js";const c=_(({style:e,...o},r)=>{const i=typeof e=="function"?e(o):e;return n(h,{...o,ref:r,style:i})});let d=null;function w(){return typeof window>"u"?null:(d||(d=v.create(c)),d)}const s=w();function C({children:e,key:o,onAction:r,setAnimation:i,animation:a="hidden",className:x,classNames:u,...m}){const p=t("px-0 py-1.5","shadow-[0_10px_15px_-3px_rgba(0,0,0,0.1),0_4px_6px_-4px_rgba(0,0,0,0.1)]","rounded-md","w-56","bg-surface","border border-solid border-border",x);return s?n(s,{className:p,isExiting:a==="hidden",onAnimationComplete:b=>{i(f=>b==="hidden"&&f==="hidden"?"unmounted":f)},variants:{hidden:{opacity:0,y:-10},visible:{opacity:1,y:0}},initial:"hidden",animate:a,...m,children:n(l,{className:t("outline-none",u?.menu),onAction:r,children:e})},o):n(c,{className:p,...m,children:n(l,{className:t("outline-none",u?.menu),onAction:r,children:e})},o)}export{C as ContextMenu,C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as N,jsx as o}from"react/jsx-runtime";import{N as V}from"../../assets/react-number-format.es-Bf_lGveD.js";import{TextField as v,Label as I,Text as C,FieldError as
|
|
1
|
+
"use client";import{jsxs as N,jsx as o}from"react/jsx-runtime";import{N as V}from"../../assets/react-number-format.es-Bf_lGveD.js";import{TextField as v,Label as I,Text as C,FieldError as F,Input as $}from"react-aria-components";import{useState as j}from"react";import{cn as t}from"../../utils/cn.js";function w({className:a,...n}){return o($,{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-surface","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),...n})}function L({label:a,description:n,errorMessage:i,placeholder:s,value:u,className:d,classNames:l,onChange:f,...m}){const[b,c]=j(""),x=u??b,g=r=>{if(r==="")return"";let e=r.substring(0,2);const h=r.substring(2,4);return e.length===1&&Number(e[0])>1?e=`0${e[0]}`:e.length===2&&(Number(e)===0?e="01":Number(e)>12&&(e="12")),`${e}/${h}`},p=r=>{c(r.formattedValue),f?.(r.formattedValue)};return N(v,{className:t("flex flex-col w-full text-fg",d),...m,children:[o(I,{className:t("flex text-fg-muted text-xs",l?.label),children:a}),o(V,{format:g,customInput:w,className:t(l?.input),placeholder:s,value:x,onValueChange:p}),n&&o(C,{className:t("flex text-fg-muted text-sm",l?.description),slot:"description",children:n}),o(F,{className:t("flex text-danger-soft text-sm",l?.error),children:i})]})}export{L as CreditCardExpirationInput,L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as I,jsx as l}from"react/jsx-runtime";import{useState as N}from"react";import{N as
|
|
1
|
+
"use client";import{jsxs as I,jsx as l}from"react/jsx-runtime";import{useState as N}from"react";import{N as P}from"../../assets/react-number-format.es-Bf_lGveD.js";import{TextField as j,Label as w,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-surface","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(j,{className:t("flex flex-col w-full text-fg",b),...p,children:[l(w,{className:t("flex text-fg-muted text-sm",d?.label),children:a}),l(P,{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};
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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 g,FieldError as x}from"react-aria-components";import{cn as e}from"../../utils/cn.js";function v({label:a,description:i,errorMessage:o,className:d,classNames:t,...n}){return s(u,{className:e("text-fg",d),...n,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-surface","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:l=>r(b,{segment:l,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-border-subtle focus:outline-0 focus:rounded-md focus:caret-transparent focus:invalid:bg-danger-soft focus:invalid:text-fg-inverse","type-literal:p-0","data-[placeholder]:text-fg-subtle data-[placeholder]:invalid:text-danger-soft data-[placeholder]:invalid:focus:text-fg-inverse","aria-[readonly]:focus-visible:outline aria-[readonly]:focus-visible:outline-fg-muted aria-[readonly]:focus-visible:outline-1","aria-[readonly]:focus:outline aria-[readonly]:focus:outline-fg-muted aria-[readonly]:focus:bg-transparent aria-[readonly]:focus:outline-2",t?.segment)})}),i&&r(g,{className:e("flex text-fg-muted text-sm",t?.description),slot:"description",children:i}),r(x,{className:e("flex text-danger-soft text-sm",t?.error),children:o})]})}export{v as DateInput,v as default};
|
|
@@ -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 f}from"react";import{Dialog as m}from"react-aria-components";import{motion as u}from"framer-motion";import{cn as c}from"../../utils/cn.js";const s=f(({style:o,animationVariants:a,...t},i)=>{const r=typeof o=="function"?o(t):o;return e(m,{...t,ref:i,style:r})});let n=null;function d(){return typeof window>"u"?null:(n||(n=u.create(s)),n)}const l=d();function y({className:o,children:a,animationVariants:t,...i}){const r={className:c("p-8 outline-0 max-w-max w-screen absolute top-2/4 left-2/4","-translate-x-1/2 -translate-y-1/2","max-h-[calc(100dvh-2rem)] overflow-y-auto","bg-surface text-fg","shadow-[0_8px_24px_rgba(0,0,0,0.1)]","rounded-lg border border-solid border-border-emphasis",o),...i};return l?e(l,{...r,variants:t||{hidden:{opacity:0},visible:{opacity:1}},children:a}):e(s,{...r,children:a})}export{y as Dialog,y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import{useSeparator as n}from"react-aria";import{cn as m}from"../../utils/cn.js";function p({orientation:
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import{useSeparator as n}from"react-aria";import{cn as m}from"../../utils/cn.js";function p({orientation:t="horizontal",className:a,...r}){const{separatorProps:i}=n({...r,orientation:t}),o={...r,...i};return e("div",{...o,className:m("bg-border-subtle",["w-full","h-px","my-4","mx-0"],["aria-[orientation=vertical]:w-px","aria-[orientation=vertical]:h-auto","aria-[orientation=vertical]:my-0","aria-[orientation=vertical]:mx-4"],a)})}export{p as Divider,p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as
|
|
1
|
+
"use client";import{jsxs as j,jsx as o}from"react/jsx-runtime";import{useId as w,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=w(),[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 j(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-surface","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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as s}from"react/jsx-runtime";import{forwardRef as m}from"react";import{Dialog as b}from"react-aria-components";import{m as d}from"framer-motion";import{cn as p}from"../../utils/cn.js";const h={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"}}}},u=m(({style:t,size:e="20rem",...o},a)=>{const r=typeof t=="function"?t(o):{...t,"--drawer-size":`${e}`};return s(b,{...o,ref:a,style:r})});let i=null;function w(){return typeof window>"u"?null:(i||(i=d.create(u)),i)}const l=w();function y({direction:t="right",children:e,className:o,animationVariants:a,fullScreen:r=!1,...f}){const n={className:p("fixed p-8 bg-surface","outline-none focus:outline-none focus-visible:outline-none","border-solid border-border-subtle",(t==="top"||t==="bottom")&&(r?"max-h-[var(--visual-viewport-height)]":"max-h-[min(var(--visual-viewport-height),88vh)]"),(t==="left"||t==="right")&&(r?"max-w-full":"max-w-[88vw]"),t==="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)]",t==="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)]",t==="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)]",t==="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":t,...f};return l?s(l,{variants:a||h[t],...n,children:e}):s(u,{...n,children:e})}export{y as Drawer,y as default};
|
|
@@ -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
|
|
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 l({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-fg-muted 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{l as AccessDenied,l as default};
|
|
@@ -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 d({featureName:t,icon:i,children:s}){return s||e("div",{className:"border border-border-subtle rounded-lg bg-surface",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-fg-muted 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{d as PermissionRequired,d as default};
|
|
@@ -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"../../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-
|
|
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-surface",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-fg-muted 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-fg-inverse 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 s,jsx as e}from"react/jsx-runtime";import{Label as f,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 M}from"../Skeleton/Skeleton.js";import S from"../../hooks/useIsClient.js";function j({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 y({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 E({className:t}){return e(M,{className:r("w-full h-10 rounded-md z-20 relative",t)})}const W=I(({inputProps:t,label:l,description:a,errorMessage:
|
|
1
|
+
"use client";import{jsxs as s,jsx as e}from"react/jsx-runtime";import{Label as f,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 M}from"../Skeleton/Skeleton.js";import S from"../../hooks/useIsClient.js";function j({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 y({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 E({className:t}){return e(M,{className:r("w-full h-10 rounded-md z-20 relative",t)})}const W=I(({inputProps:t,label:l,description:a,errorMessage:m,placeholder:p,className:u,classNames:o,disableSkeleton:x,type:c,...h},b)=>{const g=S(),d=c==="password",[n,w]=N(!1);return!g&&!x?s("div",{className:r("flex flex-col w-full text-fg",u),children:[l?e(f,{className:r("flex text-fg-muted text-xs",o?.label),children:l}):null,e(E,{className:o?.skeleton})]}):s(v,{className:r("flex flex-col w-full text-fg",u),type:d?n?"text":"password":c,...h,children:[e(f,{className:r("flex text-fg-muted text-xs",o?.label),children:l}),s("div",{className:"relative",children:[e(k,{ref:b,placeholder:p,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-surface","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",d&&"pr-10",o?.input),...t}),d&&e("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-fg-subtle hover:text-fg-muted bg-transparent border-none cursor-pointer select-none",onMouseDown:i=>i.preventDefault(),onClick:()=>w(i=>!i),"aria-label":n?"Hide password":"Show password","aria-pressed":n,children:n?e(y,{className:"w-5 h-5"}):e(j,{className:"w-5 h-5"})})]}),a&&e(L,{className:r("flex text-fg-muted text-sm",o?.description),slot:"description",children:a}),e(C,{className:r("flex text-danger-soft text-sm",o?.error),children:m})]})});export{W as Input,W as default};
|
package/components/Link/Link.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as m}from"react/jsx-runtime";import{forwardRef as p,useMemo as c}from"react";import{Link as x}from"react-aria-components";import{cn as b}from"../../utils/cn.js";import{useLinkConfig as g}from"./LinkContext.js";import{isExternalUrl as k}from"./utils.js";const L=p(({children:n,isDisabled:i,className:e,href:t,target:s,rel:a,...l},u)=>{const{baseUrl:r}=g(),o=c(()=>t?k(t,r):!1,[t,r]);return m(x,{...l,href:t,isDisabled:i,target:s??(o?"_blank":void 0),rel:a??(o?"noopener noreferrer":void 0),className:d=>{const f=typeof e=="function"?e(d):e;return b("flex items-center cursor-pointer","text-fg-muted","no-underline","transition-colors duration-300","hover:text-fg",['data-[disabled="true"]:cursor-default','data-[disabled="true"]:text-fg-subtle','data-[disabled="true"]:hover:text-fg-subtle'],f)},ref:u,children:n})});L.displayName="Link";export{L as Link,L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as u}from"react/jsx-runtime";import{forwardRef as p}from"react";import{cn as g}from"../../utils/cn.js";import{Link as c}from"../Link/Link.js";import"../Link/LinkContext.js";import{resolveVariant as m}from"../Button/Button.js";import"react-aria-components";import"../Link/utils.js";const
|
|
1
|
+
"use client";import{jsx as u}from"react/jsx-runtime";import{forwardRef as p}from"react";import{cn as g}from"../../utils/cn.js";import{Link as c}from"../Link/Link.js";import"../Link/LinkContext.js";import{resolveVariant as m}from"../Button/Button.js";import"react-aria-components";import"../Link/utils.js";const v=p(({className:t,isDisabled:o,isLoading:e=!1,size:s="md",variant:n="solid",children:d,...a},b)=>{const r=m(n),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",s==="sm"&&"h-8",s==="md"&&"h-10",s==="lg"&&"h-12",r==="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",e&&"disabled:text-fg"],r==="link"&&["bg-transparent hover:bg-transparent focus:bg-transparent disabled:bg-transparent","border-transparent hover:border-transparent focus:border-transparent disabled:border-transparent","inline-flex h-auto p-0 rounded-none","underline underline-offset-2","text-fg disabled:text-fg-muted hover:opacity-70",e&&"disabled:text-fg"],r==="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",e&&["disabled:border-border","disabled:text-fg"]],r==="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-fg-inverse disabled:text-fg-subtle hover:text-fg-inverse",e&&["disabled:border-fg","disabled:text-fg-inverse"]]];return u(c,{ref:b,isDisabled:o,className:f=>{const l=typeof t=="function"?t(f):t;return g(i,l)},...a,children:d})});v.displayName="LinkAsButton";export{v as LinkAsButton,v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as a}from"react/jsx-runtime";import{cn as n}from"../../utils/cn.js";function i({classNames:e}){return a("span",{className:n(e?.base),children:Array.from(new Array(3)).map((o,r)=>a("div",{style:{animationDelay:`${r*.1}s`},className:n("animate-ct-loader-pulse","bg-border","inline-block","w-2","h-2","m-0.5","rounded-lg",e?.dot)},r))})}export{i as Pulse,i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as n}from"react/jsx-runtime";import{cloneElement as i}from"react";import{AnimatePresence as s}from"framer-motion";import{cn as a}from"../../utils/cn.js";import{Menu as l}from"./Menu.js";import"react-dom";function g({slots:e,role:r="tooltip",arrow:t,...u}){const c={width:24,height:8,className:a("fill-surface-subtle",t?.className),...t},o=e?.submenu?i(e?.submenu,{...e.submenu.props}):null,m=e?.contentRoot?i(e.contentRoot,{...e.contentRoot.props},o):n("div",{className:"relative rounded-md py-4 px-6 bg-surface-subtle shadow",children:o});return n(s,{children:n(l,{role:r,arrow:c,hidden:{opacity:0,y:-5,visibility:"hidden",transition:{type:"spring",duration:.3,bounce:0}},visible:{opacity:1,y:0,visibility:"visible",transition:{type:"spring",duration:.75,bounce:0,staggerChildren:.075,delayChildren:.1}},slots:{submenu:m,submenuRoot:e?.submenuRoot,content:e?.content},...u})})}export{g as ContextMenu,g as default};
|
|
@@ -1 +1 @@
|
|
|
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{m as x}from"framer-motion";import{cn as e}from"../../utils/cn.js";function w({label:
|
|
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{m 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:d=100,formatOptions:c={style:"percent"},className:m,classNames:r,...s}){return t(p,{className:e("flex flex-col gap-2",m),value:n,minValue:o,maxValue:d,formatOptions:c,...s,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-border 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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as u,jsx as e}from"react/jsx-runtime";import{NumberField as p,Label as h,Group as m,Button as a,Input as x,Text as v,FieldError as w}from"react-aria-components";import{cn as r}from"../../utils/cn.js";const k=e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M5 12H19",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),y=e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M12 5V19M5 12H19",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});function L({label:b,description:n,errorMessage:c,isInvalid:d,isReadOnly:i,slots:s,className:g,classNames:o,...f}){const t=["group-hover:border-border-emphasis","group-disabled:border-border-subtle","group-invalid:border-danger-soft group-invalid:bg-danger-surface group-invalid:text-danger","group-invalid:group-hover:border-danger","group-invalid:group-focus:border-danger"],l=["flex items-center justify-center shrink-0","rounded-md border-solid border","font-semibold text-sm","w-10 h-10 py-0 px-0 cursor-pointer disabled:cursor-default","transition-all duration-200 ease-in-out","focus:outline-2 focus:outline focus:outline-border-subtle pressed:scale-95","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","group-aria-readonly:bg-surface-subtle group-aria-readonly:text-fg-muted group-aria-readonly:border-border-subtle group-aria-readonly:cursor-default"];return u(p,{isInvalid:d,isReadOnly:i,className:r("flex flex-col w-full",g),...f,children:[e(h,{className:r("flex text-fg-muted text-sm",o?.label),children:b}),u(m,{isInvalid:d,"aria-readonly":i,className:r("flex rounded-md group","focus-within:outline-2 focus-within:outline focus-within:outline-border-subtle","focus-within:invalid:outline-2 focus-within:invalid:outline focus-within:invalid:outline-border-subtle","disabled:bg-surface-subtle",o?.group),children:[e(a,{slot:"decrement",className:r(l,t,"border-r-0 rounded-r-none",o?.decrementBtn),children:s?.decrementIcon||k}),e(x,{className:r("border-solid border border-border text-center","text-sm text-fg placeholder-fg-subtle","h-10 px-2 py-0 m-0 w-full","bg-
|
|
1
|
+
"use client";import{jsxs as u,jsx as e}from"react/jsx-runtime";import{NumberField as p,Label as h,Group as m,Button as a,Input as x,Text as v,FieldError as w}from"react-aria-components";import{cn as r}from"../../utils/cn.js";const k=e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M5 12H19",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),y=e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M12 5V19M5 12H19",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});function L({label:b,description:n,errorMessage:c,isInvalid:d,isReadOnly:i,slots:s,className:g,classNames:o,...f}){const t=["group-hover:border-border-emphasis","group-disabled:border-border-subtle","group-invalid:border-danger-soft group-invalid:bg-danger-surface group-invalid:text-danger","group-invalid:group-hover:border-danger","group-invalid:group-focus:border-danger"],l=["flex items-center justify-center shrink-0","rounded-md border-solid border","font-semibold text-sm","w-10 h-10 py-0 px-0 cursor-pointer disabled:cursor-default","transition-all duration-200 ease-in-out","focus:outline-2 focus:outline focus:outline-border-subtle pressed:scale-95","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","group-aria-readonly:bg-surface-subtle group-aria-readonly:text-fg-muted group-aria-readonly:border-border-subtle group-aria-readonly:cursor-default"];return u(p,{isInvalid:d,isReadOnly:i,className:r("flex flex-col w-full",g),...f,children:[e(h,{className:r("flex text-fg-muted text-sm",o?.label),children:b}),u(m,{isInvalid:d,"aria-readonly":i,className:r("flex rounded-md group","focus-within:outline-2 focus-within:outline focus-within:outline-border-subtle","focus-within:invalid:outline-2 focus-within:invalid:outline focus-within:invalid:outline-border-subtle","disabled:bg-surface-subtle",o?.group),children:[e(a,{slot:"decrement",className:r(l,t,"border-r-0 rounded-r-none",o?.decrementBtn),children:s?.decrementIcon||k}),e(x,{className:r("border-solid border border-border text-center","text-sm text-fg placeholder-fg-subtle","h-10 px-2 py-0 m-0 w-full","bg-surface","transition-all duration-200 ease-in-out","hover:border-border-emphasis","focus:outline-0 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",t,o?.input)}),e(a,{slot:"increment",className:r(l,t,"border-l-0 rounded-l-none",o?.incrementBtn),children:s?.incrementIcon||y})]}),n&&e(v,{className:r("flex text-fg-muted text-sm",o?.description),slot:"description",children:n}),e(w,{className:r("flex text-danger-soft text-sm",o?.error),children:c})]})}export{L as NumberInput,L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as a,jsxs as N}from"react/jsx-runtime";import{useState as j}from"react";import{cn as l}from"../../utils/cn.js";import{DownArrow as
|
|
1
|
+
"use client";import{jsx as a,jsxs as N}from"react/jsx-runtime";import{useState as j}from"react";import{cn as l}from"../../utils/cn.js";import{DownArrow as g}from"../Icon/DownArrow.js";const v=l("w-8 h-8 flex justify-center items-center cursor-pointer shadow-none","border border-solid border-border-subtle data-[disabled=true]:border-0","rounded transition-colors duration-300 focus-visible:outline-fg-inverse focus-visible:outline-offset-4","bg-transparent hover:bg-surface-subtle data-[disabled=true]:bg-surface-subtle data-[disabled=true]:text-fg-subtle","[&>svg]:w-4.5 [&>svg]:h-auto");function M(e,f,t,d){const s=(m,n)=>Array.from({length:n-m+1},(h,o)=>m+o);if(e<=t*2+d*2+3)return s(1,e);const b=Math.max(f-d,t+2),c=Math.min(f+d,e-t-1);return[...s(1,t),b>t+2?"ellipsis":t+1,...s(b,c),c<e-t-1?"ellipsis":e-t,...s(e-t+1,e)]}function $({total:e,page:f,initialPage:t=1,onChange:d,boundaries:s=1,siblings:b=1,showControls:c=!0,isCompact:m=!1,isDisabled:n,className:h,classNames:o}){const[x,w]=j(t),r=f??x,p=i=>{const u=Math.min(Math.max(i,1),e);u!==r&&(w(u),d?.(u))};return a("nav",{"aria-label":"Pagination",className:l("text-fg-muted",h),children:N("ul",{className:l("flex flex-nowrap gap-2 lg:gap-3 list-none p-0 m-0",o?.wrapper),children:[c&&a("li",{children:a("button",{type:"button","aria-label":"Previous page",disabled:n||r<=1,"data-disabled":n||r<=1||void 0,onClick:()=>p(r-1),className:l(v,o?.prev),children:a(g,{className:"rotate-90 w-4 h-4"})})}),M(e,r,s,b).map((i,u)=>i==="ellipsis"?a("li",{"aria-hidden":"true",className:l("w-4 h-4.5 scale-110 translate-y-1",o?.ellipsis),children:"…"},`e-${u}`):a("li",{children:a("button",{type:"button","aria-label":`Page ${i}`,"aria-current":i===r?"page":void 0,disabled:n,"data-active":i===r||void 0,onClick:()=>p(i),className:l(m?"w-6 h-6 text-xs":"w-8 h-8 text-sm","flex justify-center items-center cursor-pointer rounded shadow-none","border-solid border border-border-subtle bg-transparent transition-colors duration-300","data-[active=true]:bg-fg-muted data-[active=true]:text-fg-inverse focus-visible:outline-fg-inverse focus-visible:outline-offset-4","hover:not-data-[active=true]:border-border-subtle",o?.item),children:i})},i)),c&&a("li",{children:a("button",{type:"button","aria-label":"Next page",disabled:n||r>=e,"data-disabled":n||r>=e||void 0,onClick:()=>p(r+1),className:l(v,o?.next),children:a(g,{className:"-rotate-90 w-4 h-4"})})})]})})}export{$ as Pagination,$ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as n,jsx as t}from"react/jsx-runtime";import{cn as
|
|
1
|
+
"use client";import{jsxs as n,jsx as t}from"react/jsx-runtime";import{cn as a}from"../../utils/cn.js";import{checkStrength as d,getProgressText as c}from"./PasswordCheck.utils.js";const g=[{label:"At least 8 characters",test:s=>s.length>=8},{label:"At least one uppercase letter",test:s=>/[A-Z]/.test(s)},{label:"At least one digit",test:s=>/\d/.test(s)},{label:"At least one special character",test:s=>/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?~]/.test(s)}];function h({value:s,variant:i="default",requirements:o=g}){const e=d(s);return i==="requirements"?s?n("div",{className:"mt-4 flex flex-col gap-2",children:[t("ul",{className:"flex flex-col gap-1 text-xs text-left",children:o.map(r=>{const l=r.test(s);return n("li",{className:"flex items-center gap-1.5",children:[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:a("shrink-0 transition-colors",l?"text-success":"text-fg-subtle"),children:l?t("path",{d:"M20 6 9 17l-5-5"}):t("circle",{cx:"12",cy:"12",r:"4"})}),t("span",{className:a("transition-colors",l?"text-success":"text-fg-muted"),children:r.label})]},r.label)})}),n("div",{className:"flex flex-col",children:[t("div",{className:"w-full flex gap-x-2",children:Array.from({length:5},(r,l)=>l).map((r,l)=>t("div",{className:a("grow shrink basis-1/5 h-1 rounded-full transition-colors duration-700 ease bg-border-subtle",e<=l&&"bg-fg-muted",(e===1||e===2)&&"bg-danger",e===3&&"bg-warning",e===4&&"bg-success",e===5&&"bg-info")},r))}),n("div",{className:a("inline-flex gap-x-1 text-xs text-fg-strong transition-opacity mt-1",e?"opacity-100":"opacity-0"),children:[t("span",{children:"Password Strength:"}),t("span",{className:a((e===1||e===2)&&"text-danger",e===3&&"text-warning",e===4&&"text-success",e===5&&"text-info"),children:c(e)})]})]})]}):null:t("div",{children:n("div",{className:a("relative w-full flex gap-x-2",i==="default"&&"mb-8 -mt-1"),children:[Array.from({length:5},(r,l)=>l).map((r,l)=>t("div",{className:a("grow shrink basis-1/5 h-1 rounded-full transition-colors duration-700 ease bg-border-subtle",e<=l&&"bg-fg-muted",(e===1||e===2)&&"bg-danger",e===3&&"bg-warning",e===4&&"bg-success",e===5&&"bg-info")},r)),i==="default"&&n("div",{className:a("inline-flex gap-x-1 absolute top-0 left-0 text-xs translate-y-2/4 text-fg-strong",e?"opacity-100":"opacity-0"),children:[t("span",{children:"Password Strength:"}),t("span",{className:a((e===1||e===2)&&"text-danger",e===3&&"text-warning",e===4&&"text-success",e===5&&"text-info"),children:c(e)})]})]})})}export{h as PasswordCheck,h as default};
|