@cryptlex/web-components 6.6.6-alpha30 → 6.6.6-alpha32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/data-table.js +1 -1
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/file-trigger.d.ts +5 -0
- package/dist/components/file-trigger.js +2 -0
- package/dist/components/file-trigger.js.map +1 -0
- package/dist/components/icons.d.ts +1 -0
- package/dist/components/icons.js +29 -24
- package/dist/components/icons.js.map +1 -1
- package/dist/components/menu.d.ts +2 -1
- package/dist/components/menu.js +1 -1
- package/dist/components/menu.js.map +1 -1
- package/dist/components/multi-select.js +1 -1
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/select.js.map +1 -1
- package/dist/utilities/numbers.d.ts +1 -1
- package/dist/utilities/numbers.js +1 -1
- package/dist/utilities/numbers.js.map +1 -1
- package/package.json +1 -1
package/dist/components/menu.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as u,jsx as o,Fragment as c}from"react/jsx-runtime";import{MenuTrigger as
|
|
1
|
+
import{jsxs as u,jsx as o,Fragment as c}from"react/jsx-runtime";import{MenuTrigger as p,MenuItem as d,composeRenderProps as m,Menu as f,SubmenuTrigger as b,Header as g,Separator as M,Keyboard as y}from"react-aria-components";import{classNames as a}from"../utilities/theme.js";import{IcDot as N,IcCheck as x,IcRight as h}from"./icons.js";import{ListBoxCollection as S}from"./list-box.js";import{SelectTrigger as v,SelectPopover as I}from"./select.js";import"clsx";import"react";import"./button.js";import"class-variance-authority";import"./loader.js";import"../utilities/form.js";import"../utilities/form-context.js";import"@tanstack/react-form";import"./form.js";import"./popover.js";const T=p,O=b,P=S;function j({className:e,...t}){return o(I,{className:m(e,r=>a(r)),...t})}function z({className:e,...t}){return o(f,{className:a("overflow-auto p-1 outline-0 body-base",e),escapeKeyBehavior:"none",...t})}function Q({children:e,className:t,...r}){return o(d,{textValue:r.textValue||(typeof e=="string"?e:void 0),className:m(t,n=>a("btn btn-ghost relative flex justify-start input-dim","data-[selection-mode]:pl-input",n)),...r,children:m(e,(n,i)=>u(c,{children:[o("span",{className:"absolute left-2 flex size-icon items-center justify-center",children:i.isSelected&&u(c,{children:[i.selectionMode=="single"&&o(N,{className:"size-icon fill-current"}),i.selectionMode=="multiple"&&o(x,{className:"size-icon"})]})}),n,i.hasSubmenu&&o(h,{className:"ml-auto size-icon"})]}))})}function U({className:e,inset:t,separator:r=!0,...n}){return o(g,{className:a("px-3 py-1.5 body font-semibold",t&&"pl-input",r&&"-mx-1 mb-1 border-b border-b-border pb-2.5",e),...n})}function W({className:e,...t}){return o(M,{className:a("-mx-1 my-1 h-px bg-muted",e),...t})}function X({className:e,...t}){return o(y,{className:a("ml-auto body-sm tracking-widest opacity-60",e),...t})}function Y({label:e,children:t,variant:r,isDisabled:n,size:i,isNonModal:w,id:l,...s}){return u(T,{...s,children:[o(v,{id:l,isDisabled:n,autoFocus:!!s.autoFocus,variant:r,size:i,children:e}),o(j,{className:"overflow-auto",children:o(z,{...s,children:t})})]})}export{Y as EasyMenu,z as Menu,P as MenuCollection,U as MenuHeader,Q as MenuItem,X as MenuKeyboard,j as MenuPopover,W as MenuSeparator,O as MenuSubTrigger,T as MenuTrigger};
|
|
2
2
|
//# sourceMappingURL=menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.js","sources":["../../lib/components/menu.tsx"],"sourcesContent":["import { VariantProps } from 'class-variance-authority';\nimport {\n Header as AriaHeader,\n Keyboard as AriaKeyboard,\n Menu as AriaMenu,\n MenuItem as AriaMenuItem,\n MenuItemProps as AriaMenuItemProps,\n MenuProps as AriaMenuProps,\n MenuTrigger as AriaMenuTrigger,\n MenuTriggerProps as AriaMenuTriggerProps,\n Separator as AriaSeparator,\n SeparatorProps as AriaSeparatorProps,\n SubmenuTrigger as AriaSubmenuTrigger,\n composeRenderProps,\n PopoverProps,\n} from 'react-aria-components';\n\nimport { classNames } from '../utilities/theme';\n\nimport { buttonVariants } from './button';\nimport { IcCheck, IcDot, IcRight } from './icons';\nimport { ListBoxCollection } from './list-box';\nimport { SelectPopover, SelectTrigger } from './select';\n\nexport const MenuTrigger = AriaMenuTrigger;\nexport const MenuSubTrigger = AriaSubmenuTrigger;\nexport const MenuCollection = ListBoxCollection;\n\nexport function MenuPopover({ className, ...props }: PopoverProps) {\n return <SelectPopover className={composeRenderProps(className, className => classNames(className))} {...props} />;\n}\n\nexport function Menu<T extends object>({ className, ...props }: AriaMenuProps<T>) {\n return (\n <AriaMenu\n className={classNames('overflow-auto p-1 outline-0 body-base', className)}\n escapeKeyBehavior=\"none\"\n {...props}\n />\n );\n}\n\nexport function MenuItem({ children, className, ...props }: AriaMenuItemProps & { ref?: React.Ref<HTMLDivElement> }) {\n return (\n <AriaMenuItem\n textValue={props.textValue || (typeof children === 'string' ? children : undefined)}\n className={composeRenderProps(className, className =>\n classNames(\n 'btn btn-ghost relative flex justify-start input-dim',\n /* Selection Mode */\n 'data-[selection-mode]:pl-input',\n className\n )\n )}\n {...props}\n >\n {composeRenderProps(children, (children, renderProps) => (\n <>\n <span className=\"absolute left-2 flex size-icon items-center justify-center\">\n {renderProps.isSelected && (\n <>\n {renderProps.selectionMode == 'single' && <IcDot className=\"size-icon fill-current\" />}\n {renderProps.selectionMode == 'multiple' && <IcCheck className=\"size-icon\" />}\n </>\n )}\n </span>\n\n {children}\n\n {renderProps.hasSubmenu && <IcRight className=\"ml-auto size-icon\" />}\n </>\n ))}\n </AriaMenuItem>\n );\n}\n\ninterface MenuHeaderProps extends React.ComponentProps<typeof AriaHeader> {\n inset?: boolean;\n separator?: boolean;\n}\n\nexport function MenuHeader({ className, inset, separator = true, ...props }: MenuHeaderProps) {\n return (\n <AriaHeader\n className={classNames(\n 'px-3 py-1.5 body font-semibold',\n inset && 'pl-input',\n separator && '-mx-1 mb-1 border-b border-b-border pb-2.5',\n className\n )}\n {...props}\n />\n );\n}\n\nexport function MenuSeparator({ className, ...props }: AriaSeparatorProps) {\n return <AriaSeparator className={classNames('-mx-1 my-1 h-px bg-muted', className)} {...props} />;\n}\n\nexport function MenuKeyboard({ className, ...props }: React.ComponentProps<typeof AriaKeyboard>) {\n return <AriaKeyboard className={classNames('ml-auto body-sm tracking-widest opacity-60', className)} {...props} />;\n}\ninterface MenuProps<T>\n extends AriaMenuProps<T>,\n VariantProps<typeof buttonVariants>,\n Omit<AriaMenuTriggerProps, 'children'> {\n label?: React.ReactNode;\n isDisabled?: boolean;\n isNonModal?: boolean;\n}\n// TODO name this better\nexport function EasyMenu<T extends object>({\n label,\n children,\n variant,\n isDisabled,\n size,\n isNonModal,\n ...props\n}: MenuProps<T>) {\n return (\n <MenuTrigger {...props}>\n <SelectTrigger isDisabled={isDisabled} autoFocus={!!props.autoFocus} variant={variant} size={size}>\n {label}\n </SelectTrigger>\n <MenuPopover className=\"overflow-auto\">\n <Menu {...props}>{children}</Menu>\n </MenuPopover>\n </MenuTrigger>\n );\n}\n"],"names":["MenuTrigger","AriaMenuTrigger","MenuSubTrigger","AriaSubmenuTrigger","MenuCollection","ListBoxCollection","MenuPopover","className","props","jsx","SelectPopover","composeRenderProps","classNames","Menu","AriaMenu","MenuItem","children","AriaMenuItem","renderProps","jsxs","Fragment","IcDot","IcCheck","IcRight","MenuHeader","inset","separator","AriaHeader","MenuSeparator","AriaSeparator","MenuKeyboard","AriaKeyboard","EasyMenu","label","variant","isDisabled","size","isNonModal","SelectTrigger"],"mappings":"4qBAwBO,MAAMA,EAAcC,EACdC,EAAiBC,EACjBC,EAAiBC,EAEvB,SAASC,EAAY,CAAE,UAAAC,EAAW,GAAGC,GAAuB,CAC/D,OAAOC,EAACC,EAAA,CAAc,UAAWC,EAAmBJ,EAAWA,GAAaK,EAAWL,CAAS,CAAC,EAAI,GAAGC,CAAA,CAAO,CACnH,CAEO,SAASK,EAAuB,CAAE,UAAAN,EAAW,GAAGC,GAA2B,CAC9E,OACIC,EAACK,EA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ib/components/menu.tsx"],"sourcesContent":["import { VariantProps } from 'class-variance-authority';\nimport {\n Header as AriaHeader,\n Keyboard as AriaKeyboard,\n Menu as AriaMenu,\n MenuItem as AriaMenuItem,\n MenuItemProps as AriaMenuItemProps,\n MenuProps as AriaMenuProps,\n MenuTrigger as AriaMenuTrigger,\n MenuTriggerProps as AriaMenuTriggerProps,\n Separator as AriaSeparator,\n SeparatorProps as AriaSeparatorProps,\n SubmenuTrigger as AriaSubmenuTrigger,\n composeRenderProps,\n PopoverProps,\n} from 'react-aria-components';\n\nimport { classNames } from '../utilities/theme';\n\nimport { buttonVariants } from './button';\nimport { IcCheck, IcDot, IcRight } from './icons';\nimport { ListBoxCollection } from './list-box';\nimport { SelectPopover, SelectTrigger } from './select';\n\nexport const MenuTrigger = AriaMenuTrigger;\nexport const MenuSubTrigger = AriaSubmenuTrigger;\nexport const MenuCollection = ListBoxCollection;\n\nexport function MenuPopover({ className, ...props }: PopoverProps) {\n return <SelectPopover className={composeRenderProps(className, className => classNames(className))} {...props} />;\n}\n\nexport function Menu<T extends object>({ className, ...props }: AriaMenuProps<T>) {\n return (\n <AriaMenu\n className={classNames('overflow-auto p-1 outline-0 body-base', className)}\n escapeKeyBehavior=\"none\"\n {...props}\n />\n );\n}\n\nexport function MenuItem({ children, className, ...props }: AriaMenuItemProps & { ref?: React.Ref<HTMLDivElement> }) {\n return (\n <AriaMenuItem\n textValue={props.textValue || (typeof children === 'string' ? children : undefined)}\n className={composeRenderProps(className, className =>\n classNames(\n 'btn btn-ghost relative flex justify-start input-dim',\n /* Selection Mode */\n 'data-[selection-mode]:pl-input',\n className\n )\n )}\n {...props}\n >\n {composeRenderProps(children, (children, renderProps) => (\n <>\n <span className=\"absolute left-2 flex size-icon items-center justify-center\">\n {renderProps.isSelected && (\n <>\n {renderProps.selectionMode == 'single' && <IcDot className=\"size-icon fill-current\" />}\n {renderProps.selectionMode == 'multiple' && <IcCheck className=\"size-icon\" />}\n </>\n )}\n </span>\n\n {children}\n\n {renderProps.hasSubmenu && <IcRight className=\"ml-auto size-icon\" />}\n </>\n ))}\n </AriaMenuItem>\n );\n}\n\ninterface MenuHeaderProps extends React.ComponentProps<typeof AriaHeader> {\n inset?: boolean;\n separator?: boolean;\n}\n\nexport function MenuHeader({ className, inset, separator = true, ...props }: MenuHeaderProps) {\n return (\n <AriaHeader\n className={classNames(\n 'px-3 py-1.5 body font-semibold',\n inset && 'pl-input',\n separator && '-mx-1 mb-1 border-b border-b-border pb-2.5',\n className\n )}\n {...props}\n />\n );\n}\n\nexport function MenuSeparator({ className, ...props }: AriaSeparatorProps) {\n return <AriaSeparator className={classNames('-mx-1 my-1 h-px bg-muted', className)} {...props} />;\n}\n\nexport function MenuKeyboard({ className, ...props }: React.ComponentProps<typeof AriaKeyboard>) {\n return <AriaKeyboard className={classNames('ml-auto body-sm tracking-widest opacity-60', className)} {...props} />;\n}\ninterface MenuProps<T>\n extends AriaMenuProps<T>,\n VariantProps<typeof buttonVariants>,\n Omit<AriaMenuTriggerProps, 'children'> {\n label?: React.ReactNode;\n isDisabled?: boolean;\n isNonModal?: boolean;\n id?: string;\n}\n// TODO name this better\nexport function EasyMenu<T extends object>({\n label,\n children,\n variant,\n isDisabled,\n size,\n isNonModal,\n id,\n ...props\n}: MenuProps<T>) {\n return (\n <MenuTrigger {...props}>\n <SelectTrigger id={id} isDisabled={isDisabled} autoFocus={!!props.autoFocus} variant={variant} size={size}>\n {label}\n </SelectTrigger>\n <MenuPopover className=\"overflow-auto\">\n <Menu {...props}>{children}</Menu>\n </MenuPopover>\n </MenuTrigger>\n );\n}\n"],"names":["MenuTrigger","AriaMenuTrigger","MenuSubTrigger","AriaSubmenuTrigger","MenuCollection","ListBoxCollection","MenuPopover","className","props","jsx","SelectPopover","composeRenderProps","classNames","Menu","AriaMenu","MenuItem","children","AriaMenuItem","renderProps","jsxs","Fragment","IcDot","IcCheck","IcRight","MenuHeader","inset","separator","AriaHeader","MenuSeparator","AriaSeparator","MenuKeyboard","AriaK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nB,CAAA,EAEH,GAAGC,CAAA,CAAA,CAGhB,CAEO,SAASoB,EAAc,CAAE,UAAArB,EAAW,GAAGC,GAA6B,CACvE,OAAOC,EAACoB,GAAc,UAAWjB,EAAW,2BAA4BL,CAAS,EAAI,GAAGC,EAAO,CACnG,CAEO,SAASsB,EAAa,CAAE,UAAAvB,EAAW,GAAGC,GAAoD,CAC7F,OAAOC,EAACsB,GAAa,UAAWnB,EAAW,6CAA8CL,CAAS,EAAI,GAAGC,EAAO,CACpH,CAWO,SAASwB,EAA2B,CACvC,MAAAC,EACA,SAAAjB,EACA,QAAAkB,EACA,WAAAC,EACA,KAAAC,EACA,WAAAC,EACA,GAAAC,EACA,GAAG9B,CACP,EAAiB,CACb,OACIW,EAACnB,EAAA,CAAa,GAAGQ,EACb,SAAA,CAAAC,EAAC8B,EAAA,CAAc,GAAAD,EAAQ,WAAAH,EAAwB,UAAW,CAAC,CAAC3B,EAAM,UAAW,QAAA0B,EAAkB,KAAAE,EAC1F,SAAAH,CAAA,CACL,EACAxB,EAACH,GAAY,UAAU,gBACnB,WAACO,EAAA,CAAM,GAAGL,EAAQ,SAAAQ,CAAA,CAAS,CAAA,CAC/B,CAAA,EACJ,CAER"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as i}from"react/jsx-runtime";import{EasyMenu as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{useId as c}from"react";import{EasyMenu as f,MenuItem as p}from"./menu.js";import{getFieldErrorMessage as g}from"../utilities/form.js";import{useFieldContext as h}from"../utilities/form-context.js";import{FormField as b}from"./form.js";import"react-aria-components";import"../utilities/theme.js";import"clsx";import"./icons.js";import"./list-box.js";import"./select.js";import"./button.js";import"class-variance-authority";import"./loader.js";import"./popover.js";import"@tanstack/react-form";function M({items:o,value:e,onChange:t,label:d,errorMessage:s,description:m,requiredIndicator:a,...l}){const u=c(),n=l.id||u;return i("div",{className:"group form-field",children:i(b,{label:d,description:m,errorMessage:s,requiredIndicator:a,htmlFor:n,children:i(f,{id:n,isNonModal:!1,selectionMode:"multiple",selectedKeys:e,onSelectionChange:r=>{typeof r!="string"&&t(r)},items:o,label:l.triggerLabel??i("span",{className:"tabular-nums",children:e.size}),...l,children:r=>i(p,{id:r.id,isDisabled:r?.disabled,children:r.label},r.id)})})})}function T({...o}){const e=h({disabled:o.isDisabled});return i(M,{value:new Set(e.state.value),onChange:t=>e.setValue(Array.from(t)),onClose:e.handleBlur,errorMessage:g(e),...o})}export{M as MultiSelect,T as TfMultiSelect};
|
|
2
2
|
//# sourceMappingURL=multi-select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-select.js","sources":["../../lib/components/multi-select.tsx"],"sourcesContent":["import React from 'react';\nimport { EasyMenu, MenuItem } from '../components/menu';\nimport type { SelectOption } from '../components/select-options';\nimport { getFieldErrorMessage } from '../utilities/form';\nimport { useFieldContext } from '../utilities/form-context';\nimport { FormField, type FormFieldProps } from './form';\n\ninterface MultipleSelectionProps {\n value: Set<string | number>;\n onChange: (v: Set<string | number>) => void;\n buttonLabel?: React.ReactNode;\n items: SelectOption[];\n}\n\nexport interface MultiSelectProps\n extends MultipleSelectionProps,\n FormFieldProps,\n Omit<React.ComponentProps<typeof EasyMenu>, 'label' | 'items'> {\n triggerLabel?: React.ReactNode;\n}\n\nexport function MultiSelect({\n items,\n value,\n onChange: setValue,\n label,\n errorMessage,\n description,\n requiredIndicator,\n ...props\n}: MultiSelectProps) {\n return (\n <div className=\"group form-field\">\n <FormField {...{ label, description, errorMessage, requiredIndicator }}>\n <EasyMenu\n isNonModal={false}\n selectionMode=\"multiple\"\n selectedKeys={value}\n onSelectionChange={v => {\n if (typeof v === 'string') return;\n setValue(v);\n }}\n items={items}\n label={props.triggerLabel ?? <span className=\"tabular-nums\">{value.size}</span>}\n {...props}\n >\n {item => (\n <MenuItem id={item.id} key={item.id} isDisabled={item?.disabled}>\n {item.label}\n </MenuItem>\n )}\n </EasyMenu>\n </FormField>\n </div>\n );\n}\n\nexport interface TfMultiSelectProps extends Omit<MultiSelectProps, 'value' | 'onChange'> {}\nexport function TfMultiSelect({ ...props }: TfMultiSelectProps) {\n const field = useFieldContext<string[]>({\n disabled: props.isDisabled,\n });\n\n return (\n <MultiSelect\n value={new Set(field.state.value)}\n // @ts-expect-error\n onChange={e => field.setValue(Array.from(e))}\n onClose={field.handleBlur}\n errorMessage={getFieldErrorMessage(field)}\n {...props}\n />\n );\n}\n"],"names":["MultiSelect","items","value","setValue","label","errorMessage","description","requiredIndicator","props","jsx","FormField","EasyMenu","v","item","MenuItem","TfMultiSelect","field","useFieldContext","e","getFieldErrorMessage"],"mappings":"
|
|
1
|
+
{"version":3,"file":"multi-select.js","sources":["../../lib/components/multi-select.tsx"],"sourcesContent":["import React, { useId } from 'react';\nimport { EasyMenu, MenuItem } from '../components/menu';\nimport type { SelectOption } from '../components/select-options';\nimport { getFieldErrorMessage } from '../utilities/form';\nimport { useFieldContext } from '../utilities/form-context';\nimport { FormField, type FormFieldProps } from './form';\n\ninterface MultipleSelectionProps {\n value: Set<string | number>;\n onChange: (v: Set<string | number>) => void;\n buttonLabel?: React.ReactNode;\n items: SelectOption[];\n}\n\nexport interface MultiSelectProps\n extends MultipleSelectionProps,\n FormFieldProps,\n Omit<React.ComponentProps<typeof EasyMenu>, 'label' | 'items'> {\n triggerLabel?: React.ReactNode;\n}\n\nexport function MultiSelect({\n items,\n value,\n onChange: setValue,\n label,\n errorMessage,\n description,\n requiredIndicator,\n ...props\n}: MultiSelectProps) {\n const generatedId = useId();\n const fieldId = props.id || generatedId;\n\n return (\n <div className=\"group form-field\">\n <FormField {...{ label, description, errorMessage, requiredIndicator, htmlFor: fieldId }}>\n <EasyMenu\n id={fieldId}\n isNonModal={false}\n selectionMode=\"multiple\"\n selectedKeys={value}\n onSelectionChange={v => {\n if (typeof v === 'string') return;\n setValue(v);\n }}\n items={items}\n label={props.triggerLabel ?? <span className=\"tabular-nums\">{value.size}</span>}\n {...props}\n >\n {item => (\n <MenuItem id={item.id} key={item.id} isDisabled={item?.disabled}>\n {item.label}\n </MenuItem>\n )}\n </EasyMenu>\n </FormField>\n </div>\n );\n}\n\nexport interface TfMultiSelectProps extends Omit<MultiSelectProps, 'value' | 'onChange'> {}\nexport function TfMultiSelect({ ...props }: TfMultiSelectProps) {\n const field = useFieldContext<string[]>({\n disabled: props.isDisabled,\n });\n\n return (\n <MultiSelect\n value={new Set(field.state.value)}\n // @ts-expect-error\n onChange={e => field.setValue(Array.from(e))}\n onClose={field.handleBlur}\n errorMessage={getFieldErrorMessage(field)}\n {...props}\n />\n );\n}\n"],"names":["MultiSelect","items","value","setValue","label","errorMessage","description","requiredIndicator","props","generatedId","useId","fieldId","jsx","FormField","EasyMenu","v","item","MenuItem","TfMultiSelect","field","useFieldContext","e","getFieldErrorMessage"],"mappings":"2hBAqBO,SAASA,EAAY,CACxB,MAAAC,EACA,MAAAC,EACA,SAAUC,EACV,MAAAC,EACA,aAAAC,EACA,YAAAC,EACA,kBAAAC,EACA,GAAGC,CACP,EAAqB,CACjB,MAAMC,EAAcC,EAAA,EACdC,EAAUH,EAAM,IAAMC,EAE5B,OACIG,EAAC,MAAA,CAAI,UAAU,mBACX,WAACC,EAAA,CAAgB,MAAAT,EAAO,YAAAE,EAAa,aAAAD,EAAc,kBAAAE,EAAmB,QAASI,EAC3E,SAAAC,EAACE,EAAA,CACG,GAAIH,EACJ,WAAY,GACZ,cAAc,WACd,aAAcT,EACd,kBAAmBa,GAAK,CAChB,OAAOA,GAAM,UACjBZ,EAASY,CAAC,CACd,EACA,MAAAd,EACA,MAAOO,EAAM,cAAgBI,EAAC,QAAK,UAAU,eAAgB,WAAM,IAAA,CAAK,EACvE,GAAGJ,EAEH,SAAAQ,GACGJ,EAACK,EAAA,CAAS,GAAID,EAAK,GAAkB,WAAYA,GAAM,SAClD,SAAAA,EAAK,KAAA,EADkBA,EAAK,EAEjC,CAAA,CAAA,EAGZ,CAAA,CACJ,CAER,CAGO,SAASE,EAAc,CAAE,GAAGV,GAA6B,CAC5D,MAAMW,EAAQC,EAA0B,CACpC,SAAUZ,EAAM,UAAA,CACnB,EAED,OACII,EAACZ,EAAA,CACG,MAAO,IAAI,IAAImB,EAAM,MAAM,KAAK,EAEhC,SAAUE,GAAKF,EAAM,SAAS,MAAM,KAAKE,CAAC,CAAC,EAC3C,QAASF,EAAM,WACf,aAAcG,EAAqBH,CAAK,EACvC,GAAGX,CAAA,CAAA,CAGhB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as o,jsxs as
|
|
1
|
+
"use client";import{jsx as o,jsxs as a,Fragment as p}from"react/jsx-runtime";import{useId as h}from"react";import{Select as g,composeRenderProps as i,SelectValue as S,ListBox as x}from"react-aria-components";import{Button as N}from"./button.js";import{getFieldErrorMessage as B}from"../utilities/form.js";import{useFieldContext as w}from"../utilities/form-context.js";import{classNames as l}from"../utilities/theme.js";import{FormField as F}from"./form.js";import{IcDown as I}from"./icons.js";import{ListBoxItem as b,ListBoxHeader as v,ListBoxCollection as C}from"./list-box.js";import{Popover as L}from"./popover.js";import"class-variance-authority";import"./loader.js";import"clsx";import"@tanstack/react-form";const j=g,y=b,X=v,Y=C,P=({className:r,...t})=>o(S,{className:i(r,e=>l("line-clamp-1 data-[placeholder]:text-muted-foreground","[&>[slot=description]]:hidden",e)),...t});function V({className:r,children:t,...e}){return o(N,{type:"button",...e,className:l("justify-between px-2",r),children:i(t,n=>a(p,{children:[o("span",{className:"inline-flex gap-1",children:n}),o(I,{"aria-hidden":"true"})]}))})}function D({className:r,...t}){return o(L,{className:i(r,e=>l("w-auto min-w-[--trigger-width]",e)),...t})}function H({className:r,...t}){return o(x,{className:i(r,e=>l("overflow-auto p-1 outline-none",e)),...t})}function M({label:r,description:t,errorMessage:e,children:n,className:d,requiredIndicator:m,items:u,...c}){const f=h(),s=c.id||f;return o("div",{className:l("group form-field",d),children:o(F,{label:r,description:t,errorMessage:e,requiredIndicator:m,htmlFor:s,children:a(j,{...c,children:[o(V,{className:"w-full",id:s,children:o(P,{className:"inline-flex gap-1 items-center"})}),o(D,{children:o(H,{items:u,children:n})})]})})})}function Z({...r}){const t=w({disabled:r.isDisabled});return o(M,{selectedKey:t.state.value,onSelectionChange:e=>t.handleChange(e.toString()),onBlur:t.handleBlur,errorMessage:B(t),...r,children:e=>o(y,{id:e.id,children:e.label},e.id)})}export{Y as SelectCollection,X as SelectHeader,y as SelectItem,D as SelectPopover,V as SelectTrigger,P as SelectValue,M as SingleSelect,Z as TfSingleSelect};
|
|
2
2
|
//# sourceMappingURL=select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sources":["../../lib/components/select.tsx"],"sourcesContent":["'use client';\nimport {\n ListBox as AriaListBox,\n ListBoxProps as AriaListBoxProps,\n PopoverProps as AriaPopoverProps,\n Select as AriaSelect,\n SelectProps as AriaSelectProps,\n SelectValue as AriaSelectValue,\n SelectValueProps as AriaSelectValueProps,\n composeRenderProps,\n} from 'react-aria-components';\n\nimport { Button } from '../components/button';\nimport type { SelectOption } from '../components/select-options';\nimport { getFieldErrorMessage } from '../utilities/form';\nimport { useFieldContext } from '../utilities/form-context';\nimport { classNames } from '../utilities/theme';\nimport { FormField, type FormFieldProps } from './form';\nimport { IcDown } from './icons';\nimport { ListBoxCollection, ListBoxHeader, ListBoxItem } from './list-box';\nimport { Popover } from './popover';\n\nconst ASelect = AriaSelect;\nexport const SelectItem = ListBoxItem;\nexport const SelectHeader = ListBoxHeader;\nexport const SelectCollection = ListBoxCollection;\n\nexport const SelectValue = <T extends object>({ className, ...props }: AriaSelectValueProps<T>) => (\n <AriaSelectValue\n className={composeRenderProps(className, className =>\n classNames(\n 'line-clamp-1 data-[placeholder]:text-muted-foreground',\n /* Description */\n '[&>[slot=description]]:hidden',\n className\n )\n )}\n {...props}\n />\n);\nexport function SelectTrigger({ className, children, ...props }: React.ComponentProps<typeof Button>) {\n return (\n <Button type=\"button\" {...props} className
|
|
1
|
+
{"version":3,"file":"select.js","sources":["../../lib/components/select.tsx"],"sourcesContent":["'use client';\nimport { useId } from 'react';\nimport {\n ListBox as AriaListBox,\n ListBoxProps as AriaListBoxProps,\n PopoverProps as AriaPopoverProps,\n Select as AriaSelect,\n SelectProps as AriaSelectProps,\n SelectValue as AriaSelectValue,\n SelectValueProps as AriaSelectValueProps,\n composeRenderProps,\n} from 'react-aria-components';\n\nimport { Button } from '../components/button';\nimport type { SelectOption } from '../components/select-options';\nimport { getFieldErrorMessage } from '../utilities/form';\nimport { useFieldContext } from '../utilities/form-context';\nimport { classNames } from '../utilities/theme';\nimport { FormField, type FormFieldProps } from './form';\nimport { IcDown } from './icons';\nimport { ListBoxCollection, ListBoxHeader, ListBoxItem } from './list-box';\nimport { Popover } from './popover';\n\nconst ASelect = AriaSelect;\nexport const SelectItem = ListBoxItem;\nexport const SelectHeader = ListBoxHeader;\nexport const SelectCollection = ListBoxCollection;\n\nexport const SelectValue = <T extends object>({ className, ...props }: AriaSelectValueProps<T>) => (\n <AriaSelectValue\n className={composeRenderProps(className, className =>\n classNames(\n 'line-clamp-1 data-[placeholder]:text-muted-foreground',\n /* Description */\n '[&>[slot=description]]:hidden',\n className\n )\n )}\n {...props}\n />\n);\nexport function SelectTrigger({ className, children, ...props }: React.ComponentProps<typeof Button>) {\n return (\n <Button type=\"button\" {...props} className={classNames('justify-between px-2', className)}>\n {composeRenderProps(children, children => (\n <>\n <span className=\"inline-flex gap-1\">{children}</span>\n <IcDown aria-hidden=\"true\" />\n </>\n ))}\n </Button>\n );\n}\n\nexport function SelectPopover({ className, ...props }: AriaPopoverProps) {\n return (\n <Popover\n className={composeRenderProps(className, className =>\n classNames('w-auto min-w-[--trigger-width]', className)\n )}\n {...props}\n />\n );\n}\n\nfunction SelectListBox<T extends object>({ className, ...props }: AriaListBoxProps<T>) {\n return (\n <AriaListBox\n className={composeRenderProps(className, className =>\n classNames('overflow-auto p-1 outline-none', className)\n )}\n {...props}\n />\n );\n}\n\nexport interface SingleSelectProps<T extends SelectOption>\n extends Omit<AriaSelectProps<T>, 'children'>,\n FormFieldProps {\n items: Iterable<T>;\n children: React.ReactNode | ((item: T) => React.ReactNode);\n}\n\nexport function SingleSelect<T extends SelectOption>({\n label,\n description,\n errorMessage,\n children,\n className,\n requiredIndicator,\n items,\n ...props\n}: SingleSelectProps<T>) {\n const generatedId = useId();\n const fieldId = props.id || generatedId;\n\n return (\n <div className={classNames('group form-field', className)}>\n <FormField {...{ label, description, errorMessage, requiredIndicator, htmlFor: fieldId }}>\n <ASelect {...props}>\n <SelectTrigger className={'w-full'} id={fieldId}>\n <SelectValue className={'inline-flex gap-1 items-center'} />\n </SelectTrigger>\n <SelectPopover>\n <SelectListBox items={items}>{children}</SelectListBox>\n </SelectPopover>\n </ASelect>\n </FormField>\n </div>\n );\n}\n\ntype TfSingleSelectProps<T extends SelectOption> = Omit<SingleSelectProps<T>, 'value' | 'setValue' | 'children'>;\n\nexport function TfSingleSelect<T extends SelectOption>({ ...props }: TfSingleSelectProps<T>) {\n const field = useFieldContext<string>({ disabled: props.isDisabled });\n\n return (\n <SingleSelect\n selectedKey={field.state.value}\n onSelectionChange={e => field.handleChange(e!.toString())}\n onBlur={field.handleBlur}\n errorMessage={getFieldErrorMessage(field)}\n {...props}\n >\n {item => (\n <SelectItem id={item.id} key={item.id}>\n {item.label}\n </SelectItem>\n )}\n </SingleSelect>\n );\n}\n"],"names":["ASelect","AriaSelect","SelectItem","ListBoxItem","SelectHeader","ListBoxHeader","SelectCollection","ListBoxCollection","SelectValue","className","props","jsx","AriaSelectValue","composeRenderProps","classNames","SelectTrigger","children","Button","jsxs","Fragment","IcDown","SelectPopover","Popover","SelectListBox","AriaListBox","SingleSelect","label","description","errorMessage","requiredIndicator","items","generatedId","useId","fieldId","FormField","TfSingleSelect","field","useFieldContext","getFieldErrorMessage","item"],"mappings":"ysBAuBA,MAAMA,EAAUC,EACHC,EAAaC,EACbC,EAAeC,EACfC,EAAmBC,EAEnBC,EAAc,CAA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ACI,EAAA,CAAc,UAAW,SAAU,GAAIkB,EACpC,SAAAtB,EAACH,EAAA,CAAY,UAAW,gCAAA,CAAkC,CAAA,CAC9D,IACCa,EAAA,CACG,SAAAV,EAACY,EAAA,CAAc,MAAAO,EAAe,SAAAd,EAAS,CAAA,CAC3C,CAAA,CAAA,CACJ,EACJ,EACJ,CAER,CAIO,SAASmB,EAAuC,CAAE,GAAGzB,GAAiC,CACzF,MAAM0B,EAAQC,EAAwB,CAAE,SAAU3B,EAAM,WAAY,EAEpE,OACIC,EAACc,EAAA,CACG,YAAaW,EAAM,MAAM,MACzB,kBAAmB,GAAKA,EAAM,aAAa,EAAG,UAAU,EACxD,OAAQA,EAAM,WACd,aAAcE,EAAqBF,CAAK,EACvC,GAAG1B,EAEH,SAAA6B,KACIrC,EAAA,CAAW,GAAIqC,EAAK,GAChB,SAAAA,EAAK,KAAA,EADoBA,EAAK,EAEnC,CAAA,CAAA,CAIhB"}
|
|
@@ -5,7 +5,7 @@ export declare const MIN_INT32 = -2147483648;
|
|
|
5
5
|
export declare const MIN_INT32_DAYS: number;
|
|
6
6
|
export declare function getNumberValidator(min: number, max: number): z.ZodNumber;
|
|
7
7
|
export declare function getDaysValidator(min: number): z.ZodNumber;
|
|
8
|
-
export declare function formatNumber(num: number | bigint): string;
|
|
8
|
+
export declare function formatNumber(num: number | bigint, options?: Intl.NumberFormatOptions): string;
|
|
9
9
|
/**
|
|
10
10
|
* @returns A formatted string for the number of bytes
|
|
11
11
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import n from"zod";const u=2147483647,i=Math.floor(u/86400),a=-2147483648,l=Math.ceil(a/86400);function m(r,
|
|
1
|
+
import n from"zod";const u=2147483647,i=Math.floor(u/86400),a=-2147483648,l=Math.ceil(a/86400);function m(r,t){return n.number().min(r,{error:e=>{if(e.code==="too_small")return`The number must be at least ${o(r)}.`}}).max(t,{error:e=>{if(e.code==="too_big")return`The number must be at most ${o(t)}.`}})}function c(r){return m(r,i)}function o(r,t){return Intl.NumberFormat(navigator.language,t).format(r)}function N(r){return r<1024?`${r} B`:r<1024*1024?`${(r/1024).toFixed(1)} KB`:r<1024*1024*1024?`${(r/(1024*1024)).toFixed(2)} MB`:`${(r/(1024*1024*1024)).toFixed(2)} GB`}export{u as MAX_INT32,i as MAX_INT32_DAYS,a as MIN_INT32,l as MIN_INT32_DAYS,N as formatFilesize,o as formatNumber,c as getDaysValidator,m as getNumberValidator};
|
|
2
2
|
//# sourceMappingURL=numbers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numbers.js","sources":["../../lib/utilities/numbers.ts"],"sourcesContent":["import z from 'zod';\n\nexport const MAX_INT32 = 2147483647;\nexport const MAX_INT32_DAYS = Math.floor(MAX_INT32 / 86400);\nexport const MIN_INT32 = -2147483648;\nexport const MIN_INT32_DAYS = Math.ceil(MIN_INT32 / 86400);\n\nexport function getNumberValidator(min: number, max: number) {\n return z\n .number()\n .min(min, {\n error: issue => {\n if (issue.code === 'too_small') return `The number must be at least ${formatNumber(min)}.`;\n },\n })\n .max(max, {\n error: issue => {\n if (issue.code === 'too_big') return `The number must be at most ${formatNumber(max)}.`;\n },\n });\n}\n\nexport function getDaysValidator(min: number) {\n return getNumberValidator(min, MAX_INT32_DAYS);\n}\n\nexport function formatNumber(num: number | bigint) {\n return Intl.NumberFormat(navigator.language).format(num);\n}\n\n/**\n * @returns A formatted string for the number of bytes\n */\nexport function formatFilesize(bytes: number): string {\n if (bytes < 1024) {\n return `${bytes} B`;\n } else if (bytes < 1024 * 1024) {\n return `${(bytes / 1024).toFixed(1)} KB`;\n } else if (bytes < 1024 * 1024 * 1024) {\n return `${(bytes / (1024 * 1024)).toFixed(2)} MB`;\n } else {\n return `${(bytes / (1024 * 1024 * 1024)).toFixed(2)} GB`;\n }\n}\n"],"names":["MAX_INT32","MAX_INT32_DAYS","MIN_INT32","MIN_INT32_DAYS","getNumberValidator","min","max","z","issue","formatNumber","getDaysValidator","num","formatFilesize","bytes"],"mappings":"mBAEO,MAAMA,EAAY,WACZC,EAAiB,KAAK,MAAMD,EAAY,KAAK,EAC7CE,EAAY,YACZC,EAAiB,KAAK,KAAKD,EAAY,KAAK,EAElD,SAASE,EAAmBC,EAAaC,EAAa,CACzD,OAAOC,EACF,SACA,IAAIF,EAAK,CACN,MAAOG,GAAS,CACZ,GAAIA,EAAM,OAAS,kBAAoB,+BAA+BC,EAAaJ,CAAG,CAAC,GAC3F,CAAA,CACH,EACA,IAAIC,EAAK,CACN,MAAOE,GAAS,CACZ,GAAIA,EAAM,OAAS,gBAAkB,8BAA8BC,EAAaH,CAAG,CAAC,GACxF,CAAA,CACH,CACT,CAEO,SAASI,EAAiBL,EAAa,CAC1C,OAAOD,EAAmBC,EAAKJ,CAAc,CACjD,CAEO,SAASQ,EAAaE,
|
|
1
|
+
{"version":3,"file":"numbers.js","sources":["../../lib/utilities/numbers.ts"],"sourcesContent":["import z from 'zod';\n\nexport const MAX_INT32 = 2147483647;\nexport const MAX_INT32_DAYS = Math.floor(MAX_INT32 / 86400);\nexport const MIN_INT32 = -2147483648;\nexport const MIN_INT32_DAYS = Math.ceil(MIN_INT32 / 86400);\n\nexport function getNumberValidator(min: number, max: number) {\n return z\n .number()\n .min(min, {\n error: issue => {\n if (issue.code === 'too_small') return `The number must be at least ${formatNumber(min)}.`;\n },\n })\n .max(max, {\n error: issue => {\n if (issue.code === 'too_big') return `The number must be at most ${formatNumber(max)}.`;\n },\n });\n}\n\nexport function getDaysValidator(min: number) {\n return getNumberValidator(min, MAX_INT32_DAYS);\n}\n\nexport function formatNumber(num: number | bigint, options?: Intl.NumberFormatOptions) {\n return Intl.NumberFormat(navigator.language, options).format(num);\n}\n\n/**\n * @returns A formatted string for the number of bytes\n */\nexport function formatFilesize(bytes: number): string {\n if (bytes < 1024) {\n return `${bytes} B`;\n } else if (bytes < 1024 * 1024) {\n return `${(bytes / 1024).toFixed(1)} KB`;\n } else if (bytes < 1024 * 1024 * 1024) {\n return `${(bytes / (1024 * 1024)).toFixed(2)} MB`;\n } else {\n return `${(bytes / (1024 * 1024 * 1024)).toFixed(2)} GB`;\n }\n}\n"],"names":["MAX_INT32","MAX_INT32_DAYS","MIN_INT32","MIN_INT32_DAYS","getNumberValidator","min","max","z","issue","formatNumber","getDaysValidator","num","options","formatFilesize","bytes"],"mappings":"mBAEO,MAAMA,EAAY,WACZC,EAAiB,KAAK,MAAMD,EAAY,KAAK,EAC7CE,EAAY,YACZC,EAAiB,KAAK,KAAKD,EAAY,KAAK,EAElD,SAASE,EAAmBC,EAAaC,EAAa,CACzD,OAAOC,EACF,SACA,IAAIF,EAAK,CACN,MAAOG,GAAS,CACZ,GAAIA,EAAM,OAAS,kBAAoB,+BAA+BC,EAAaJ,CAAG,CAAC,GAC3F,CAAA,CACH,EACA,IAAIC,EAAK,CACN,MAAOE,GAAS,CACZ,GAAIA,EAAM,OAAS,gBAAkB,8BAA8BC,EAAaH,CAAG,CAAC,GACxF,CAAA,CACH,CACT,CAEO,SAASI,EAAiBL,EAAa,CAC1C,OAAOD,EAAmBC,EAAKJ,CAAc,CACjD,CAEO,SAASQ,EAAaE,EAAsBC,EAAoC,CACnF,OAAO,KAAK,aAAa,UAAU,SAAUA,CAAO,EAAE,OAAOD,CAAG,CACpE,CAKO,SAASE,EAAeC,EAAuB,CAClD,OAAIA,EAAQ,KACD,GAAGA,CAAK,KACRA,EAAQ,KAAO,KACf,IAAIA,EAAQ,MAAM,QAAQ,CAAC,CAAC,MAC5BA,EAAQ,KAAO,KAAO,KACtB,IAAIA,GAAS,KAAO,OAAO,QAAQ,CAAC,CAAC,MAErC,IAAIA,GAAS,KAAO,KAAO,OAAO,QAAQ,CAAC,CAAC,KAE3D"}
|