@cryptlex/web-components 5.3.0-alpha02 → 5.3.0-alpha03
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/alert.js +2 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/avatar.js +2 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.js +2 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumbs.js +2 -0
- package/dist/components/breadcrumbs.js.map +1 -0
- package/dist/components/{ui/button.d.ts → button.d.ts} +2 -2
- package/dist/components/button.js +2 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.js +2 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.js +2 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/{inputs/checkbox.d.ts → checkbox.d.ts} +1 -1
- package/dist/components/checkbox.js +2 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/data-table-commons.js +2 -0
- package/dist/components/data-table-commons.js.map +1 -0
- package/dist/components/{data-table/data-table-filter.d.ts → data-table-filter.d.ts} +3 -3
- package/dist/components/data-table-filter.js +2 -0
- package/dist/components/{data-table/data-table.d.ts → data-table.d.ts} +5 -5
- package/dist/components/data-table.js +2 -0
- package/dist/components/data-table.js.map +1 -0
- package/dist/components/{inputs/date-picker.d.ts → date-picker.d.ts} +1 -1
- package/dist/components/date-picker.js +2 -0
- package/dist/components/date-picker.js.map +1 -0
- package/dist/components/datefield.js +2 -0
- package/dist/components/datefield.js.map +1 -0
- package/dist/components/{ui/dialog.d.ts → dialog.d.ts} +1 -1
- package/dist/components/dialog.js +2 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/disclosure.js +2 -0
- package/dist/components/disclosure.js.map +1 -0
- package/dist/components/{inputs/field.d.ts → field.d.ts} +1 -1
- package/dist/components/field.js +2 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/id-search.js +2 -0
- package/dist/components/id-search.js.map +1 -0
- package/dist/components/input-otp.js +2 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/key-value-card.js +2 -0
- package/dist/components/key-value-card.js.map +1 -0
- package/dist/components/list-box.js +2 -0
- package/dist/components/list-box.js.map +1 -0
- package/dist/components/loader.js +2 -0
- package/dist/components/loader.js.map +1 -0
- package/dist/components/menu.js +2 -0
- package/dist/components/menu.js.map +1 -0
- package/dist/components/{inputs/multi-select.d.ts → multi-select.d.ts} +3 -3
- package/dist/components/multi-select.js +2 -0
- package/dist/components/multi-select.js.map +1 -0
- package/dist/components/numberfield.js +2 -0
- package/dist/components/numberfield.js.map +1 -0
- package/dist/components/popover.js +2 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/searchfield.js +2 -0
- package/dist/components/searchfield.js.map +1 -0
- package/dist/components/select-options.js.map +1 -0
- package/dist/components/{inputs/select.d.ts → select.d.ts} +3 -3
- package/dist/components/select.js +2 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/{ui/sidebar.d.ts → sidebar.d.ts} +2 -2
- package/dist/components/sidebar.js +2 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/skeleton.js +2 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/table.js +2 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.js +2 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textfield.js +2 -0
- package/dist/components/textfield.js.map +1 -0
- package/dist/components/timeline.js +2 -0
- package/dist/components/timeline.js.map +1 -0
- package/dist/components/tooltip.js +2 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/utils/form-hook.d.ts +6 -6
- package/dist/utils/form-hook.js +1 -1
- package/dist/utils/form-hook.js.map +1 -1
- package/package.json +2 -6
- package/dist/components/data-table/data-table-filter.js +0 -2
- package/dist/components/data-table/data-table.js +0 -2
- package/dist/components/data-table/data-table.js.map +0 -1
- package/dist/components/data-table/table-commons.js +0 -2
- package/dist/components/data-table/table-commons.js.map +0 -1
- package/dist/components/inputs/checkbox.js +0 -2
- package/dist/components/inputs/checkbox.js.map +0 -1
- package/dist/components/inputs/date-picker.js +0 -2
- package/dist/components/inputs/date-picker.js.map +0 -1
- package/dist/components/inputs/datefield.js +0 -2
- package/dist/components/inputs/datefield.js.map +0 -1
- package/dist/components/inputs/field.js +0 -2
- package/dist/components/inputs/field.js.map +0 -1
- package/dist/components/inputs/id-search.js +0 -2
- package/dist/components/inputs/id-search.js.map +0 -1
- package/dist/components/inputs/input-otp.js +0 -2
- package/dist/components/inputs/input-otp.js.map +0 -1
- package/dist/components/inputs/multi-select.js +0 -2
- package/dist/components/inputs/multi-select.js.map +0 -1
- package/dist/components/inputs/numberfield.js +0 -2
- package/dist/components/inputs/numberfield.js.map +0 -1
- package/dist/components/inputs/searchfield.js +0 -2
- package/dist/components/inputs/searchfield.js.map +0 -1
- package/dist/components/inputs/select-options.js.map +0 -1
- package/dist/components/inputs/select.js +0 -2
- package/dist/components/inputs/select.js.map +0 -1
- package/dist/components/inputs/textfield.js +0 -2
- package/dist/components/inputs/textfield.js.map +0 -1
- package/dist/components/key-value-card/key-value-card.js +0 -2
- package/dist/components/key-value-card/key-value-card.js.map +0 -1
- package/dist/components/ui/alert.js +0 -2
- package/dist/components/ui/alert.js.map +0 -1
- package/dist/components/ui/avatar.js +0 -2
- package/dist/components/ui/avatar.js.map +0 -1
- package/dist/components/ui/badge.js +0 -2
- package/dist/components/ui/badge.js.map +0 -1
- package/dist/components/ui/breadcrumbs.js +0 -2
- package/dist/components/ui/breadcrumbs.js.map +0 -1
- package/dist/components/ui/button.js +0 -2
- package/dist/components/ui/button.js.map +0 -1
- package/dist/components/ui/calendar.js +0 -2
- package/dist/components/ui/calendar.js.map +0 -1
- package/dist/components/ui/card.js +0 -2
- package/dist/components/ui/card.js.map +0 -1
- package/dist/components/ui/dialog.js +0 -2
- package/dist/components/ui/dialog.js.map +0 -1
- package/dist/components/ui/disclosure.js +0 -2
- package/dist/components/ui/disclosure.js.map +0 -1
- package/dist/components/ui/list-box.js +0 -2
- package/dist/components/ui/list-box.js.map +0 -1
- package/dist/components/ui/loader.js +0 -2
- package/dist/components/ui/loader.js.map +0 -1
- package/dist/components/ui/menu.js +0 -2
- package/dist/components/ui/menu.js.map +0 -1
- package/dist/components/ui/popover.js +0 -2
- package/dist/components/ui/popover.js.map +0 -1
- package/dist/components/ui/sidebar.js +0 -2
- package/dist/components/ui/sidebar.js.map +0 -1
- package/dist/components/ui/skeleton.js +0 -2
- package/dist/components/ui/skeleton.js.map +0 -1
- package/dist/components/ui/sonner.js.map +0 -1
- package/dist/components/ui/table.js +0 -2
- package/dist/components/ui/table.js.map +0 -1
- package/dist/components/ui/tabs.js +0 -2
- package/dist/components/ui/tabs.js.map +0 -1
- package/dist/components/ui/timeline.js +0 -2
- package/dist/components/ui/timeline.js.map +0 -1
- package/dist/components/ui/tooltip.js +0 -2
- package/dist/components/ui/tooltip.js.map +0 -1
- /package/dist/components/{ui/alert.d.ts → alert.d.ts} +0 -0
- /package/dist/components/{ui/avatar.d.ts → avatar.d.ts} +0 -0
- /package/dist/components/{ui/badge.d.ts → badge.d.ts} +0 -0
- /package/dist/components/{ui/breadcrumbs.d.ts → breadcrumbs.d.ts} +0 -0
- /package/dist/components/{ui/calendar.d.ts → calendar.d.ts} +0 -0
- /package/dist/components/{ui/card.d.ts → card.d.ts} +0 -0
- /package/dist/components/{data-table/table-commons.d.ts → data-table-commons.d.ts} +0 -0
- /package/dist/components/{data-table/data-table-filter.js.map → data-table-filter.js.map} +0 -0
- /package/dist/components/{inputs/datefield.d.ts → datefield.d.ts} +0 -0
- /package/dist/components/{ui/disclosure.d.ts → disclosure.d.ts} +0 -0
- /package/dist/components/{inputs/id-search.d.ts → id-search.d.ts} +0 -0
- /package/dist/components/{inputs/input-otp.d.ts → input-otp.d.ts} +0 -0
- /package/dist/components/{key-value-card/key-value-card.d.ts → key-value-card.d.ts} +0 -0
- /package/dist/components/{ui/list-box.d.ts → list-box.d.ts} +0 -0
- /package/dist/components/{ui/loader.d.ts → loader.d.ts} +0 -0
- /package/dist/components/{ui/menu.d.ts → menu.d.ts} +0 -0
- /package/dist/components/{inputs/numberfield.d.ts → numberfield.d.ts} +0 -0
- /package/dist/components/{ui/popover.d.ts → popover.d.ts} +0 -0
- /package/dist/components/{inputs/searchfield.d.ts → searchfield.d.ts} +0 -0
- /package/dist/components/{inputs/select-options.d.ts → select-options.d.ts} +0 -0
- /package/dist/components/{inputs/select-options.js → select-options.js} +0 -0
- /package/dist/components/{ui/skeleton.d.ts → skeleton.d.ts} +0 -0
- /package/dist/components/{ui/sonner.d.ts → sonner.d.ts} +0 -0
- /package/dist/components/{ui/sonner.js → sonner.js} +0 -0
- /package/dist/components/{ui/table.d.ts → table.d.ts} +0 -0
- /package/dist/components/{ui/tabs.d.ts → tabs.d.ts} +0 -0
- /package/dist/components/{inputs/textfield.d.ts → textfield.d.ts} +0 -0
- /package/dist/components/{ui/timeline.d.ts → timeline.d.ts} +0 -0
- /package/dist/components/{ui/tooltip.d.ts → tooltip.d.ts} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsxs as o,Fragment as l,jsx as n}from"react/jsx-runtime";import{cva as s}from"class-variance-authority";import{Group as d,composeRenderProps as m,Label as c,Text as u}from"react-aria-components";import{classNames as r}from"../utils/primitives.js";import{Info as f,CircleX as p}from"lucide-react";import"clsx";const x=s(["select-none text-sm font-medium leading-none","disabled-muted","group-data-[invalid]:text-destructive"]);function g({className:e,...t}){return n(c,{className:r(x(),e),...t})}function h({className:e,children:t,...i}){return o(u,{className:r("text-sm text-muted leading-tight",e),...i,slot:"description",children:[t,n(f,{className:"inline size-2 align-text-top ms-0.5"})]})}function v({className:e,children:t,...i}){return o("div",{className:r("text-sm leading-tight text-destructive duration-150 animate-in transition-transform slide-in-from-top-5 fade-in",e),...i,children:[t,n(p,{className:"inline size-2 align-text-top ms-0.5"})]})}const b=s("",{variants:{variant:{default:["relative flex h-input w-full items-center overflow-hidden border border-input bg-card px-2 py-2 text-sm ring-offset-background","focus-ring","disabled-muted"],ghost:""}},defaultVariants:{variant:"default"}});function z({className:e,variant:t,...i}){return n(d,{className:m(e,a=>r(b({variant:t}),a)),...i})}function L({label:e,description:t,errorMessage:i,children:a}){return o(l,{children:[e&&n(g,{children:e}),a,t&&n(h,{children:t}),i&&n(v,{children:i})]})}export{h as FieldDescription,v as FieldError,z as FieldGroup,g as FieldLabel,L as FormField,b as fieldGroupVariants,x as labelVariants};
|
|
2
|
+
//# sourceMappingURL=field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.js","sources":["../../lib/components/field.tsx"],"sourcesContent":["\"use client\"\n\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport {\n Group as AriaGroup,\n GroupProps as AriaGroupProps,\n Label as AriaLabel,\n LabelProps as AriaLabelProps,\n Text as AriaText,\n TextProps as AriaTextProps,\n composeRenderProps\n} from \"react-aria-components\"\n\nimport { classNames } from \"lib/utils/primitives\"\nimport { CircleX, Info } from \"lucide-react\"\n\nexport const labelVariants = cva([\n \"select-none text-sm font-medium leading-none\",\n /* Disabled */\n \"disabled-muted\",\n /* Invalid */\n \"group-data-[invalid]:text-destructive\",\n])\n\nexport function FieldLabel({ className, ...props }: AriaLabelProps) {\n return (\n <AriaLabel className={classNames(labelVariants(), className)} {...props} />\n )\n}\n\nexport function FieldDescription({ className, children, ...props }: AriaTextProps) {\n return (\n <AriaText\n className={classNames(\"text-sm text-muted leading-tight\", className)}\n {...props}\n slot=\"description\"\n >\n {children}<Info className=\"inline size-2 align-text-top ms-0.5\" />\n </AriaText>\n )\n}\n// TODO, if we were to use AriaFieldError, it would use the internal ValidationState Context object, which might be useful for composing inputs but\n// this would have significant overlap with what Tanstack Form is already doing for us. It has pros and cons, needs to be discussed and explored.\nexport function FieldError({ className, children, ...props }: React.ComponentPropsWithRef<'div'>) {\n return (\n <div\n className={classNames(\"text-sm leading-tight text-destructive duration-150 animate-in transition-transform slide-in-from-top-5 fade-in\", className)}\n {...props}\n >\n {children}<CircleX className=\"inline size-2 align-text-top ms-0.5\" />\n </div>\n )\n}\n\nexport const fieldGroupVariants = cva(\"\", {\n variants: {\n variant: {\n default: [\n // TODO standardize the padding here\n \"relative flex h-input w-full items-center overflow-hidden border border-input bg-card px-2 py-2 text-sm ring-offset-background\",\n /* Focus Within */\n \"focus-ring\",\n /* Disabled */\n \"disabled-muted\",\n ],\n ghost: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n})\n\nexport interface GroupProps\n extends AriaGroupProps,\n VariantProps<typeof fieldGroupVariants> { }\n\nexport function FieldGroup({ className, variant, ...props }: GroupProps) {\n return (\n <AriaGroup\n className={composeRenderProps(className, (className) =>\n classNames(fieldGroupVariants({ variant }), className)\n )}\n {...props}\n />\n )\n}\n\nexport type FormFieldProps = {\n label?: string\n description?: React.ReactNode\n errorMessage?: string\n // | ((validation: AriaValidationResult) => string)\n}\n\nexport function FormField({ label, description, errorMessage, children }: FormFieldProps & {\n children: React.ReactNode\n}) {\n return <>\n {label && <FieldLabel>{label}</FieldLabel>}\n {children}\n {description && (<FieldDescription>{description}</FieldDescription>)}\n {errorMessage && <FieldError>{errorMessage}</FieldError>}\n </>\n}\n"],"names":["labelVariants","cva","FieldLabel","className","props","jsx","AriaLabel","classNames","FieldDescription","children","jsxs","AriaText","Info","FieldError","CircleX","fieldGroupVariants","FieldGroup","variant","AriaGroup","composeRenderProps","FormField","label","description","errorMessage","Fragment"],"mappings":"yUAgBO,MAAMA,EAAgBC,EAAI,CAC/B,+CAEA,iBAEA,uCACF,CAAC,EAEM,SAASC,EAAW,CAAE,UAAAC,EAAW,GAAGC,GAAyB,CAClE,OACEC,EAACC,GAAU,UAAWC,EAAWP,IAAiBG,CAAS,EAAI,GAAGC,EAAO,CAE7E,CAEO,SAASI,EAAiB,CAAE,UAAAL,EAAW,SAAAM,EAAU,GAAGL,GAAwB,CACjF,OACEM,EAACC,EAAA,CACC,UAAWJ,EAAW,mCAAoCJ,CAAS,EAClE,GAAGC,EACJ,KAAK,cAEJ,SAAA,CAAAK,EAASJ,EAACO,EAAA,CAAK,UAAU,qCAAA,CAAsC,CAAA,CAAA,CAAA,CAGtE,CAGO,SAASC,EAAW,CAAE,UAAAV,EAAW,SAAAM,EAAU,GAAGL,GAA6C,CAChG,OACEM,EAAC,MAAA,CACC,UAAWH,EAAW,mHAAoHJ,CAAS,EAClJ,GAAGC,EAEH,SAAA,CAAAK,EAASJ,EAACS,EAAA,CAAQ,UAAU,qCAAA,CAAsC,CAAA,CAAA,CAAA,CAGzE,CAEO,MAAMC,EAAqBd,EAAI,GAAI,CACxC,SAAU,CACR,QAAS,CACP,QAAS,CAEP,iIAEA,aAEA,gBAAA,EAEF,MAAO,EAAA,CACT,EAEF,gBAAiB,CACf,QAAS,SAAA,CAEb,CAAC,EAMM,SAASe,EAAW,CAAE,UAAAb,EAAW,QAAAc,EAAS,GAAGb,GAAqB,CACvE,OACEC,EAACa,EAAA,CACC,UAAWC,EAAmBhB,EAAYA,GACxCI,EAAWQ,EAAmB,CAAE,QAAAE,CAAA,CAAS,EAAGd,CAAS,CAAA,EAEtD,GAAGC,CAAA,CAAA,CAGV,CASO,SAASgB,EAAU,CAAE,MAAAC,EAAO,YAAAC,EAAa,aAAAC,EAAc,SAAAd,GAE3D,CACD,OAAOC,EAAAc,EAAA,CACJ,SAAA,CAAAH,GAAShB,EAACH,GAAY,SAAAmB,CAAA,CAAM,EAC5BZ,EACAa,GAAgBjB,EAACG,EAAA,CAAkB,SAAAc,CAAA,CAAY,EAC/CC,GAAgBlB,EAACQ,EAAA,CAAY,SAAAU,CAAA,CAAa,CAAA,EAC7C,CACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as r,Fragment as x,jsxs as d}from"react/jsx-runtime";import{useQuery as l}from"@tanstack/react-query";import{Button as F}from"./button.js";import{Loader as I}from"./loader.js";import{Menu as N,MenuItem as C}from"./menu.js";import{PopoverTrigger as B,Popover as q}from"./popover.js";import{SearchField as j}from"./searchfield.js";import{useFieldContext as K}from"../utils/form-context.js";import{useId as M,useState as v}from"react";import{Autocomplete as A}from"react-aria-components";import"class-variance-authority";import"../utils/primitives.js";import"clsx";import"lucide-react";import"./list-box.js";import"./select.js";import"./field.js";import"@tanstack/react-form";function E({value:t,disabled:i=!1,searchFn:n,multiple:o,onChange:p,onBlur:f,accessor:h="id",idLookup:m}){const a=M(),[s,g]=v(""),{data:y,isError:c,isFetching:u,error:S}=l({queryKey:[a,s],queryFn:()=>n(s)}),b=l({queryKey:[a,t],queryFn:()=>m(Array.from(t.keys()).map(e=>e.toString())),enabled:m&&t.size>0});return r(x,{children:d(B,{onOpenChange:e=>{e||f?.(t)},children:[r(F,{className:"min-w-3xs",isDisabled:i,children:b.data?.join(",")}),r(q,{className:"p-2",children:d(A,{inputValue:s,onInputChange:g,children:[r(j,{className:"mb-icon",autoFocus:!0}),u&&r(I,{className:"p-input"}),!u&&!c&&r(N,{selectedKeys:t,selectionMode:o?"multiple":"single",onSelectionChange:e=>{typeof e!="string"&&p(e)},className:"text-sm",items:y,renderEmptyState:()=>"No results found.",children:e=>r(C,{id:e[h],children:e.name},e.id)}),c&&r("div",{className:"text-destructive p-icon",children:S.message})]})})]})})}function Z({disabled:t,...i}){const n=K();return r(E,{...i,disabled:t||n.form.state.isSubmitting,value:n.state.value,onBlur:o=>n.handleBlur(),onChange:o=>n.handleChange(o)})}export{E as IdSearchInput,Z as TfIdSearchInput};
|
|
2
|
+
//# sourceMappingURL=id-search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id-search.js","sources":["../../lib/components/id-search.tsx"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { Button } from \"lib/components/button\";\nimport { Loader } from \"lib/components/loader\";\nimport { Menu, MenuItem } from \"lib/components/menu\";\nimport { Popover, PopoverTrigger } from \"lib/components/popover\";\nimport { SearchField } from \"lib/components/searchfield\";\nimport { useFieldContext } from \"lib/utils/form-context\";\nimport { useId, useState } from \"react\";\nimport { Autocomplete } from 'react-aria-components';\n\nexport type SelectState = Set<number | string>;\n\ntype SearchInputProps<T> = {\n value: SelectState;\n onChange: (v: SelectState) => void\n onBlur?: (v: SelectState) => void\n multiple: boolean\n disabled?: boolean\n idLookup?: (ids: string[]) => Promise<string[] | undefined>\n searchFn: (q: string) => Promise<T[] | undefined>\n accessor: 'id' | 'name';\n}\nexport function IdSearchInput<T extends { id: string; name: string }>({ value, disabled = false, searchFn, multiple, onChange, onBlur, accessor = 'id', idLookup }: SearchInputProps<T>) {\n const id = useId();\n const [search, _setSearch] = useState('');\n const { data, isError, isFetching, error } = useQuery({\n queryKey: [id, search],\n queryFn: () => searchFn(search)\n })\n\n const namesQuery = useQuery({\n queryKey: [id, value],\n queryFn: () => idLookup!(Array.from(value.keys()).map(id => id.toString())),\n enabled: idLookup && value.size > 0\n })\n\n const renderButtonLabel = () => {\n return namesQuery.data?.join(',');\n };\n\n return <>\n <PopoverTrigger onOpenChange={(o) => {\n if (!o) {\n // searchInputRef.current?.focus();\n onBlur?.(value);\n }\n }}>\n <Button className={'min-w-3xs'} isDisabled={disabled}>{renderButtonLabel()}</Button>\n <Popover className={'p-2'}>\n <Autocomplete\n inputValue={search}\n onInputChange={_setSearch}\n >\n <SearchField className={'mb-icon'} autoFocus />\n {isFetching && <Loader className=\"p-input\" />}\n {!isFetching && !isError && <Menu selectedKeys={value} selectionMode={multiple ? \"multiple\" : 'single'} onSelectionChange={(s) => {\n if (typeof (s) === 'string') return;\n onChange(s)\n }} className={'text-sm'} items={data} renderEmptyState={() => 'No results found.'}>\n {(item) => (<MenuItem key={item['id']} id={item[accessor]}>{item.name}</MenuItem>)}\n </Menu>}\n {\n isError && <div className=\"text-destructive p-icon\">{error.message}</div>\n }\n </Autocomplete>\n </Popover>\n </PopoverTrigger >\n </>\n\n}\n\nexport function TfIdSearchInput<T extends { id: string; name: string }>({ disabled, ...props }: Omit<SearchInputProps<T>, 'value' | 'onChange'>) {\n const field = useFieldContext<SelectState>();\n return (\n <IdSearchInput\n {...props}\n disabled={disabled || field.form.state.isSubmitting}\n value={field.state.value}\n onBlur={_ => field.handleBlur()}\n onChange={(e) => field.handleChange(e)}\n />\n );\n}"],"names":["IdSearchInput","value","disabled","searchFn","multiple","onChange","onBlur","accessor","idLookup","id","useId","search","_setSearch","useState","data","isError","isFetching","error","useQuery","namesQuery","jsx","Fragment","jsxs","PopoverTrigger","o","Button","Popover","Autocomplete","SearchField","Loader","Menu","s","item","MenuItem","TfIdSearchInput","props","field","useFieldContext","_","e"],"mappings":"4qBAsBO,SAASA,EAAsD,CAAE,MAAAC,EAAO,SAAAC,EAAW,GAAO,SAAAC,EAAU,SAAAC,EAAU,SAAAC,EAAU,OAAAC,EAAQ,SAAAC,EAAW,KAAM,SAAAC,CAAA,EAAiC,CACrL,MAAMC,EAAKC,EAAA,EACL,CAACC,EAAQC,CAAU,EAAIC,EAAS,EAAE,EAClC,CAAE,KAAAC,EAAM,QAAAC,EAAS,WAAAC,EAAY,MAAAC,CAAA,EAAUC,EAAS,CAClD,SAAU,CAACT,EAAIE,CAAM,EACrB,QAAS,IAAMR,EAASQ,CAAM,CAAA,CACjC,EAEKQ,EAAaD,EAAS,CACxB,SAAU,CAACT,EAAIR,CAAK,EACpB,QAAS,IAAMO,EAAU,MAAM,KAAKP,EAAM,MAAM,EAAE,IAAIQ,GAAMA,EAAG,SAAA,CAAU,CAAC,EAC1E,QAASD,GAAYP,EAAM,KAAO,CAAA,CACrC,EAMD,OAAOmB,EAAAC,EAAA,CACH,SAAAC,EAACC,EAAA,CAAe,aAAeC,GAAM,CAC5BA,GAEDlB,IAASL,CAAK,CAEtB,EACI,SAAA,CAAAmB,EAACK,GAAO,UAAW,YAAa,WAAYvB,EAAW,SAVpDiB,EAAW,MAAM,KAAK,GAAG,EAU+C,EAC3EC,EAACM,EAAA,CAAQ,UAAW,MAChB,SAAAJ,EAACK,EAAA,CACG,WAAYhB,EACZ,cAAeC,EAEf,SAAA,CAAAQ,EAACQ,EAAA,CAAY,UAAW,UAAW,UAAS,GAAC,EAC5CZ,GAAcI,EAACS,EAAA,CAAO,UAAU,SAAA,CAAU,EAC1C,CAACb,GAAc,CAACD,KAAYe,EAAA,CAAK,aAAc7B,EAAO,cAAeG,EAAW,WAAa,SAAU,kBAAoB2B,GAAM,CAC1H,OAAQA,GAAO,UACnB1B,EAAS0B,CAAC,CACd,EAAG,UAAW,UAAW,MAAOjB,EAAM,iBAAkB,IAAM,oBACzD,SAACkB,KAAWC,EAAA,CAA0B,GAAID,EAAKzB,CAAQ,EAAI,WAAK,MAAtCyB,EAAK,EAAsC,CAAA,CAC1E,EAEIjB,GAAWK,EAAC,MAAA,CAAI,UAAU,0BAA2B,WAAM,OAAA,CAAQ,CAAA,CAAA,CAAA,CAE3E,CACJ,CAAA,CAAA,CACJ,CAAA,CACJ,CAEJ,CAEO,SAASc,EAAwD,CAAE,SAAAhC,EAAU,GAAGiC,GAA0D,CAC7I,MAAMC,EAAQC,EAAA,EACd,OACIjB,EAACpB,EAAA,CACI,GAAGmC,EACJ,SAAUjC,GAAYkC,EAAM,KAAK,MAAM,aACvC,MAAOA,EAAM,MAAM,MACnB,OAAQE,GAAKF,EAAM,WAAA,EACnB,SAAWG,GAAMH,EAAM,aAAaG,CAAC,CAAA,CAAA,CAGjD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as t,jsxs as l}from"react/jsx-runtime";import{OTPInput as u,OTPInputContext as m}from"input-otp";import{classNames as n}from"../utils/primitives.js";import{Minus as p}from"lucide-react";import{use as d}from"react";import"clsx";function O({className:e,containerClassName:r,...i}){return t(u,{containerClassName:n("flex items-center gap-2 has-disabled:opacity-50",r),className:n("disabled:cursor-not-allowed",e),...i})}function P({className:e,...r}){return t("div",{className:n("flex items-center",e),...r})}function T({index:e,className:r,...i}){const o=d(m),{char:s,hasFakeCaret:a,isActive:c}=o.slots[e];return l("div",{className:n("relative flex h-input w-9 items-center justify-center border-2 border-input body transition-all",c?"z-10 border-2 border-primary":"",r),...i,children:[s,a&&t("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:t("div",{className:"h-icon w-px animate-caret-blink bg-foreground duration-1000"})})]})}function I({...e}){return t("div",{role:"separator",...e,children:t(p,{})})}export{O as InputOTP,P as InputOTPGroup,I as InputOTPSeparator,T as InputOTPSlot};
|
|
2
|
+
//# sourceMappingURL=input-otp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-otp.js","sources":["../../lib/components/input-otp.tsx"],"sourcesContent":["import { OTPInput, OTPInputContext } from \"input-otp\";\nimport { classNames } from \"lib/utils/primitives\";\nimport { Minus } from \"lucide-react\";\nimport { use } from \"react\";\n\nexport function InputOTP({\n\tclassName,\n\tcontainerClassName,\n\t...props\n}: React.ComponentProps<typeof OTPInput>) {\n\treturn (\n\t\t<OTPInput\n\t\t\tcontainerClassName={classNames(\n\t\t\t\t\"flex items-center gap-2 has-disabled:opacity-50\",\n\t\t\t\tcontainerClassName,\n\t\t\t)}\n\t\t\tclassName={classNames(\"disabled:cursor-not-allowed\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function InputOTPGroup({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"div\">) {\n\treturn <div className={classNames(\"flex items-center\", className)} {...props} />;\n}\n\nexport function InputOTPSlot({\n\tindex,\n\tclassName,\n\t...props\n}: React.ComponentProps<\"div\"> & { index: number }) {\n\tconst inputOTPContext = use(OTPInputContext);\n\tconst { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\t\"relative flex h-input w-9 items-center justify-center border-2 border-input body transition-all\",\n\t\t\t\tisActive ? \"z-10 border-2 border-primary\" : \"\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{char}\n\t\t\t{hasFakeCaret && (\n\t\t\t\t<div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n\t\t\t\t\t<div className=\"h-icon w-px animate-caret-blink bg-foreground duration-1000\" />\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nexport function InputOTPSeparator({ ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div role=\"separator\" {...props}>\n\t\t\t<Minus />\n\t\t</div>\n\t);\n}\n"],"names":["InputOTP","className","containerClassName","props","jsx","OTPInput","classNames","InputOTPGroup","InputOTPSlot","index","inputOTPContext","use","OTPInputContext","char","hasFakeCaret","isActive","jsxs","InputOTPSeparator","Minus"],"mappings":"8OAKO,SAASA,EAAS,CACxB,UAAAC,EACA,mBAAAC,EACA,GAAGC,CACJ,EAA0C,CACzC,OACCC,EAACC,EAAA,CACA,mBAAoBC,EACnB,kDACAJ,CAAA,EAED,UAAWI,EAAW,8BAA+BL,CAAS,EAC7D,GAAGE,CAAA,CAAA,CAGP,CAEO,SAASI,EAAc,CAC7B,UAAAN,EACA,GAAGE,CACJ,EAAgC,CAC/B,OAAOC,EAAC,OAAI,UAAWE,EAAW,oBAAqBL,CAAS,EAAI,GAAGE,EAAO,CAC/E,CAEO,SAASK,EAAa,CAC5B,MAAAC,EACA,UAAAR,EACA,GAAGE,CACJ,EAAoD,CACnD,MAAMO,EAAkBC,EAAIC,CAAe,EACrC,CAAE,KAAAC,EAAM,aAAAC,EAAc,SAAAC,GAAaL,EAAgB,MAAMD,CAAK,EAEpE,OACCO,EAAC,MAAA,CACA,UAAWV,EACV,kGACAS,EAAW,gCAAkC,GAC7Cd,CAAA,EAEA,GAAGE,EAEH,SAAA,CAAAU,EACAC,KACC,MAAA,CAAI,UAAU,wEACd,SAAAV,EAAC,MAAA,CAAI,UAAU,6DAAA,CAA8D,CAAA,CAC9E,CAAA,CAAA,CAAA,CAIJ,CAEO,SAASa,EAAkB,CAAE,GAAGd,GAAsC,CAC5E,OACCC,EAAC,OAAI,KAAK,YAAa,GAAGD,EACzB,SAAAC,EAACc,IAAM,CAAA,CACR,CAEF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as i,jsx as t}from"react/jsx-runtime";import{Badge as p}from"./badge.js";import{Card as m,CardHeader as d,CardTitle as f,CardContent as h}from"./card.js";import{formatDate as x}from"./data-table-commons.js";import{Skeleton as u}from"./skeleton.js";import"../utils/primitives.js";import"clsx";import"@tanstack/react-table";import"date-fns";import"./checkbox.js";import"react-aria-components";import"./field.js";import"class-variance-authority";import"lucide-react";import"../utils/form-context.js";import"@tanstack/react-form";const Y=({data:n,label:l,fields:o})=>{const c=(e,r)=>{if(e.transform)return e.transform(r);if(r==null)return"-";switch(e.type){case"date":return t("span",{children:x(r)});case"yesno":return t("span",{children:r?"Yes":"No"});case"badge":return t("div",{className:"flex flex-wrap gap-1",children:Array.isArray(r)?r.map((s,a)=>t(p,{children:typeof s=="object"?s?.name||s?.id:s},a)):r});case"boolean":return t("span",{children:r.toString()});default:return t("span",{children:r})}};return i(m,{children:[t(d,{children:t(f,{children:l})}),t(h,{children:t("div",{className:"flex flex-col gap-2",children:n?o.map(e=>{const r=e.accessor?e.accessor.split(".").reduce((s,a)=>s&&a in s?s[a]:void 0,n):null;return i("div",{className:"flex w-full flex-col md:flex-row justify-between first:pt-0 last:pb-0",children:[t("p",{className:"text-sm flex w-full justify-start col-span-1",children:e.display}),t("div",{className:"text-sm flex w-full justify-start text-wrap break-all",children:c(e,r)})]},e.display)}):o.map((e,r)=>t(u,{className:"h-12 w-full"},r))})})]})};export{Y as KeyValueCard};
|
|
2
|
+
//# sourceMappingURL=key-value-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key-value-card.js","sources":["../../lib/components/key-value-card.tsx"],"sourcesContent":["import { Badge } from \"lib/components/badge\";\nimport { Card, CardContent, CardHeader, CardTitle } from \"lib/components/card\";\nimport { formatDate } from \"lib/components/data-table-commons\";\nimport { Skeleton } from \"lib/components/skeleton\";\n\n// Utility type to handle nested keys (dot notation) in any object\ntype NestedKeyOf<T> = T extends object\n\t? {\n\t\t[K in keyof T]: K extends string | number\n\t\t? `${K & string}` | `${K & string}.${NestedKeyOf<T[K]>}`\n\t\t: never;\n\t}[keyof T]\n\t: never;\n\n// DisplayField type that works with nested keys\nexport type DisplayField<T> = {\n\tdisplay: string;\n\taccessor: NestedKeyOf<T>;\n\ttype?:\n\t| \"text\"\n\t| \"badge\"\n\t| \"boolean\"\n\t| \"date\"\n\t| \"yesno\"\n\t| \"copyButton\"\n\t| \"link\"; // Field types\n\ttransform?: (value: any) => React.ReactNode;\n};\n\nexport interface KeyValueCardProps<T> {\n\tdata: T; // Ensure data is of type T\n\tlabel: string;\n\tfields: DisplayField<T>[];\n\tclassName?: string;\n}\n\nexport const KeyValueCard = <T extends {}>({\n\tdata,\n\tlabel,\n\tfields,\n}: KeyValueCardProps<T>) => {\n\tconst renderValue = (field: DisplayField<T>, value: any) => {\n\t\tif (field.transform) {\n\t\t\treturn field.transform(value);\n\t\t}\n\t\tif (value === undefined || value === null) {\n\t\t\treturn \"-\";\n\t\t}\n\t\tswitch (field.type) {\n\t\t\tcase \"date\":\n\t\t\t\treturn <span>{formatDate(value)}</span>;\n\t\t\tcase \"yesno\":\n\t\t\t\treturn <span>{value ? \"Yes\" : \"No\"}</span>;\n\t\t\tcase \"badge\":\n\t\t\t\treturn (\n\t\t\t\t\t<div className=\"flex flex-wrap gap-1\">\n\t\t\t\t\t\t{Array.isArray(value)\n\t\t\t\t\t\t\t? value.map((item, index) => (\n\t\t\t\t\t\t\t\t<Badge key={index}>\n\t\t\t\t\t\t\t\t\t{typeof item === \"object\" ? item?.name || item?.id : item}\n\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t))\n\t\t\t\t\t\t\t: value}\n\t\t\t\t\t</div>\n\t\t\t\t);\n\n\t\t\tcase \"boolean\":\n\t\t\t\treturn <span>{value.toString()}</span>;\n\t\t\tdefault:\n\t\t\t\treturn <span>{value}</span>;\n\t\t}\n\t};\n\n\treturn (\n\t\t<Card>\n\t\t\t<CardHeader>\n\t\t\t\t<CardTitle>{label}</CardTitle>\n\t\t\t</CardHeader>\n\t\t\t<CardContent>\n\t\t\t\t<div className=\"flex flex-col gap-2\">\n\t\t\t\t\t{data\n\t\t\t\t\t\t? fields.map((field) => {\n\t\t\t\t\t\t\t// TODO: improve this\n\t\t\t\t\t\t\tconst value = field.accessor\n\t\t\t\t\t\t\t\t? field.accessor\n\t\t\t\t\t\t\t\t\t.split(\".\")\n\t\t\t\t\t\t\t\t\t.reduce(\n\t\t\t\t\t\t\t\t\t\t(obj, key) =>\n\t\t\t\t\t\t\t\t\t\t\tobj && key in obj ? obj[key] : undefined,\n\t\t\t\t\t\t\t\t\t\tdata as Record<string, any>,\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t: null;\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tkey={field.display}\n\t\t\t\t\t\t\t\t\tclassName=\"flex w-full flex-col md:flex-row justify-between first:pt-0 last:pb-0\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<p className=\"text-sm flex w-full justify-start col-span-1\">\n\t\t\t\t\t\t\t\t\t\t{field.display}\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t<div className=\"text-sm flex w-full justify-start text-wrap break-all\">\n\t\t\t\t\t\t\t\t\t\t{renderValue(field, value)}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})\n\t\t\t\t\t\t: fields.map((_, index) => (\n\t\t\t\t\t\t\t<Skeleton key={index} className=\"h-12 w-full\" />\n\t\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t</CardContent>\n\t\t</Card>\n\t);\n};\n"],"names":["KeyValueCard","data","label","fields","renderValue","field","value","jsx","formatDate","item","index","Badge","Card","CardHeader","CardTitle","CardContent","obj","key","jsxs","_","Skeleton"],"mappings":"0hBAoCO,MAAMA,EAAe,CAAe,CAC1C,KAAAC,EACA,MAAAC,EACA,OAAAC,CACD,IAA4B,CAC3B,MAAMC,EAAc,CAACC,EAAwBC,IAAe,CAC3D,GAAID,EAAM,UACT,OAAOA,EAAM,UAAUC,CAAK,EAE7B,GAA2BA,GAAU,KACpC,MAAO,IAER,OAAQD,EAAM,KAAA,CACb,IAAK,OACJ,OAAOE,EAAC,OAAA,CAAM,SAAAC,EAAWF,CAAK,EAAE,EACjC,IAAK,QACJ,OAAOC,EAAC,OAAA,CAAM,SAAAD,EAAQ,MAAQ,KAAK,EACpC,IAAK,QACJ,OACCC,EAAC,MAAA,CAAI,UAAU,uBACb,SAAA,MAAM,QAAQD,CAAK,EACjBA,EAAM,IAAI,CAACG,EAAMC,MACjBC,EAAA,CACC,SAAA,OAAOF,GAAS,SAAWA,GAAM,MAAQA,GAAM,GAAKA,CAAA,EAD1CC,CAEZ,CACA,EACCJ,CAAA,CACJ,EAGF,IAAK,UACJ,OAAOC,EAAC,OAAA,CAAM,SAAAD,EAAM,SAAA,EAAW,EAChC,QACC,OAAOC,EAAC,QAAM,SAAAD,CAAA,CAAM,CAAA,CAEvB,EAEA,SACEM,EAAA,CACA,SAAA,CAAAL,EAACM,EAAA,CACA,SAAAN,EAACO,EAAA,CAAW,SAAAZ,CAAA,CAAM,EACnB,EACAK,EAACQ,EAAA,CACA,SAAAR,EAAC,MAAA,CAAI,UAAU,sBACb,SAAAN,EACEE,EAAO,IAAKE,GAAU,CAEvB,MAAMC,EAAQD,EAAM,SACjBA,EAAM,SACN,MAAM,GAAG,EACT,OACA,CAACW,EAAKC,IACLD,GAAOC,KAAOD,EAAMA,EAAIC,CAAG,EAAI,OAChChB,CAAA,EAEA,KAEH,OACCiB,EAAC,MAAA,CAEA,UAAU,wEAEV,SAAA,CAAAX,EAAC,IAAA,CAAE,UAAU,+CACX,SAAAF,EAAM,QACR,IACC,MAAA,CAAI,UAAU,wDACb,SAAAD,EAAYC,EAAOC,CAAK,CAAA,CAC1B,CAAA,CAAA,EARKD,EAAM,OAAA,CAWd,CAAC,EACCF,EAAO,IAAI,CAACgB,EAAGT,IAChBH,EAACa,EAAA,CAAqB,UAAU,aAAA,EAAjBV,CAA+B,CAC9C,EACH,CAAA,CACD,CAAA,EACD,CAEF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as o,jsxs as c,Fragment as m}from"react/jsx-runtime";import{ListBoxItem as l,composeRenderProps as r,Collection as d,ListBox as p,Header as u}from"react-aria-components";import{classNames as n}from"../utils/primitives.js";import{Check as x}from"lucide-react";import"clsx";const v=d;function y({className:t,...e}){return o(p,{className:r(t,s=>n(s,"group overflow-auto border bg-popover p-1 text-popover-foreground shadow-md outline-none","data-[empty]:p-6 data-[empty]:text-center data-[empty]:text-sm")),...e})}function N({className:t,children:e,...s}){return o(l,{textValue:s.textValue||(typeof e=="string"?e:void 0),className:r(t,a=>n("relative flex w-full cursor-default select-none items-center px-2 py-1.5 text-sm outline-none","disabled-muted","data-[focused]:bg-accent data-[focused]:text-accent-foreground","data-[hovered]:bg-accent data-[hovered]:text-accent-foreground","data-[selection-mode]:pl-input",a)),...s,children:r(e,(a,i)=>c(m,{children:[i.isSelected&&o("span",{className:"absolute left-2 flex size-icon items-center justify-center",children:o(x,{className:"size-icon"})}),a]}))})}function h({className:t,...e}){return o(u,{className:n("py-1.5 pl-input pr-2 text-sm font-semibold",t),...e})}export{y as ListBox,v as ListBoxCollection,h as ListBoxHeader,N as ListBoxItem};
|
|
2
|
+
//# sourceMappingURL=list-box.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-box.js","sources":["../../lib/components/list-box.tsx"],"sourcesContent":["import {\n Collection as AriaCollection,\n Header as AriaHeader,\n ListBox as AriaListBox,\n ListBoxItem as AriaListBoxItem,\n ListBoxItemProps as AriaListBoxItemProps,\n ListBoxProps as AriaListBoxProps,\n composeRenderProps\n} from \"react-aria-components\"\n\nimport { classNames } from \"lib/utils/primitives\"\nimport { Check } from \"lucide-react\"\n\n\nexport const ListBoxCollection = AriaCollection\n\nexport function ListBox<T extends object>({\n className,\n ...props\n}: AriaListBoxProps<T>) {\n return (\n <AriaListBox\n className={composeRenderProps(className, (className) =>\n classNames(\n className,\n \"group overflow-auto border bg-popover p-1 text-popover-foreground shadow-md outline-none\",\n /* Empty */\n \"data-[empty]:p-6 data-[empty]:text-center data-[empty]:text-sm\"\n )\n )}\n {...props}\n />\n )\n}\n\nexport function ListBoxItem<T extends object>({\n className,\n children,\n ...props\n}: AriaListBoxItemProps<T>) {\n return (\n <AriaListBoxItem\n textValue={\n props.textValue || (typeof children === \"string\" ? children : undefined)\n }\n className={composeRenderProps(className, (className) =>\n classNames(\n \"relative flex w-full cursor-default select-none items-center px-2 py-1.5 text-sm outline-none\",\n /* Disabled */\n \"disabled-muted\",\n /* Focused */\n \"data-[focused]:bg-accent data-[focused]:text-accent-foreground\",\n /* Hovered */\n \"data-[hovered]:bg-accent data-[hovered]:text-accent-foreground\",\n /* Selection */\n \"data-[selection-mode]:pl-input\",\n className\n )\n )}\n {...props}\n >\n {composeRenderProps(children, (children, renderProps) => (\n <>\n {renderProps.isSelected && (\n <span className=\"absolute left-2 flex size-icon items-center justify-center\">\n <Check className=\"size-icon\" />\n </span>\n )}\n {children}\n </>\n ))}\n </AriaListBoxItem>\n )\n}\n\nexport function ListBoxHeader({\n className,\n ...props\n}: React.ComponentProps<typeof AriaHeader>) {\n return (\n <AriaHeader\n className={classNames(\"py-1.5 pl-input pr-2 text-sm font-semibold\", className)}\n {...props}\n />\n )\n}\n"],"names":["ListBoxCollection","AriaCollection","ListBox","className","props","jsx","AriaListBox","composeRenderProps","classNames","ListBoxItem","children","AriaListBoxItem","renderProps","jsxs","Fragment","Check","ListBoxHeader","AriaHeader"],"mappings":"2RAcO,MAAMA,EAAoBC,EAE1B,SAASC,EAA0B,CACxC,UAAAC,EACA,GAAGC,CACL,EAAwB,CACtB,OACEC,EAACC,EAAA,CACC,UAAWC,EAAmBJ,EAAYA,GACxCK,EACEL,EACA,2FAEA,gEAAA,CACF,EAED,GAAGC,CAAA,CAAA,CAGV,CAEO,SAASK,EAA8B,CAC5C,UAAAN,EACA,SAAAO,EACA,GAAGN,CACL,EAA4B,CAC1B,OACEC,EAACM,EAAA,CACC,UACEP,EAAM,YAAc,OAAOM,GAAa,SAAWA,EAAW,QAEhE,UAAWH,EAAmBJ,EAAYA,GACxCK,EACE,gGAEA,iBAEA,iEAEA,iEAEA,iCACAL,CAAA,CACF,EAED,GAAGC,EAEH,SAAAG,EAAmBG,EAAU,CAACA,EAAUE,IACvCC,EAAAC,EAAA,CACG,SAAA,CAAAF,EAAY,cACV,OAAA,CAAK,UAAU,6DACd,SAAAP,EAACU,EAAA,CAAM,UAAU,WAAA,CAAY,CAAA,CAC/B,EAEDL,CAAA,EACH,CACD,CAAA,CAAA,CAGP,CAEO,SAASM,EAAc,CAC5B,UAAAb,EACA,GAAGC,CACL,EAA4C,CAC1C,OACEC,EAACY,EAAA,CACC,UAAWT,EAAW,6CAA8CL,CAAS,EAC5E,GAAGC,CAAA,CAAA,CAGV"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{classNames as m}from"../utils/primitives.js";import{Loader2 as i}from"lucide-react";import"clsx";function n({className:o}){return r(i,{className:m("animate-spin size-icon",o)})}export{n as Loader};
|
|
2
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sources":["../../lib/components/loader.tsx"],"sourcesContent":["import { classNames } from \"lib/utils/primitives\";\nimport { Loader2 } from \"lucide-react\";\n\ninterface LoaderProps {\n\tclassName?: string; // Define props interface\n}\n\nexport function Loader({ className }: LoaderProps) {\n\treturn <Loader2 className={classNames(`animate-spin size-icon`, className)} />;\n}\n"],"names":["Loader","className","Loader2","classNames"],"mappings":"gJAOO,SAASA,EAAO,CAAE,UAAAC,GAA0B,CAClD,SAAQC,EAAA,CAAQ,UAAWC,EAAW,yBAA0BF,CAAS,EAAG,CAC7E"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as s,jsx as o,Fragment as m}from"react/jsx-runtime";import{MenuTrigger as l,MenuItem as p,composeRenderProps as u,Menu as d,SubmenuTrigger as f,Header as g,Separator as x,Keyboard as b}from"react-aria-components";import{classNames as a}from"../utils/primitives.js";import{Dot as M,Check as h,ChevronRight as N}from"lucide-react";import{Button as y}from"./button.js";import{ListBoxCollection as v}from"./list-box.js";import{SelectPopover as S}from"./select.js";import"clsx";import"class-variance-authority";import"./loader.js";import"./field.js";import"../utils/form-context.js";import"@tanstack/react-form";import"./popover.js";const T=l,L=f,q=v;function _({className:e,...t}){return o(S,{className:u(e,n=>a(n)),...t})}function z({className:e,...t}){return o(d,{className:a("overflow-auto p-1 outline-0 [clip-path:inset(0_0_0_0_round_calc(var(--radius)-2px))]",e),escapeKeyBehavior:"none",...t})}function A({children:e,className:t,...n}){return o(p,{textValue:n.textValue||(typeof e=="string"?e:void 0),className:u(t,r=>a("relative flex cursor-default select-none items-center gap-2 px-2 py-1.5 text-sm outline-none transition-colors","disabled-muted","data-[focused]:bg-accent data-[focused]:text-accent-foreground ","data-[selection-mode]:pl-input",r)),...n,children:u(e,(r,i)=>s(m,{children:[o("span",{className:"absolute left-2 flex size-icon items-center justify-center",children:i.isSelected&&s(m,{children:[i.selectionMode=="single"&&o(M,{className:"size-icon fill-current"}),i.selectionMode=="multiple"&&o(h,{className:"size-icon"})]})}),r,i.hasSubmenu&&o(N,{className:"ml-auto size-icon"})]}))})}function G({className:e,inset:t,separator:n=!0,...r}){return o(g,{className:a("px-3 py-1.5 text-sm font-semibold",t&&"pl-input",n&&"-mx-1 mb-1 border-b border-b-border pb-2.5",e),...r})}function J({className:e,...t}){return o(x,{className:a("-mx-1 my-1 h-px bg-muted",e),...t})}function O({className:e,...t}){return o(b,{className:a("ml-auto text-xs tracking-widest opacity-60",e),...t})}function P({label:e,children:t,variant:n,isDisabled:r,size:i,...c}){return s(T,{...c,children:[o(y,{isDisabled:r,type:"button",variant:n,size:i,children:e}),o(_,{className:"overflow-auto",children:o(z,{...c,children:t})})]})}export{P as EasyMenu,z as Menu,q as MenuCollection,G as MenuHeader,A as MenuItem,O as MenuKeyboard,_ as MenuPopover,J as MenuSeparator,L as MenuSubTrigger,T as MenuTrigger};
|
|
2
|
+
//# sourceMappingURL=menu.js.map
|
|
@@ -0,0 +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 \"lib/utils/primitives\"\n\nimport { Check, ChevronRight, Dot } from \"lucide-react\"\nimport { Button, buttonVariants } from \"./button\"\nimport { ListBoxCollection } from \"./list-box\"\nimport { SelectPopover } from \"./select\"\n\nexport const MenuTrigger = AriaMenuTrigger\nexport const MenuSubTrigger = AriaSubmenuTrigger\nexport const MenuCollection = ListBoxCollection\n\nexport function MenuPopover({ className, ...props }: PopoverProps) {\n return (\n <SelectPopover\n className={composeRenderProps(className, (className) =>\n classNames(className)\n )}\n {...props}\n />\n )\n}\n\nexport function Menu<T extends object>({ className, ...props }: AriaMenuProps<T>) {\n return (\n <AriaMenu\n className={classNames(\n \"overflow-auto p-1 outline-0 [clip-path:inset(0_0_0_0_round_calc(var(--radius)-2px))]\",\n className\n )}\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={\n props.textValue || (typeof children === \"string\" ? children : undefined)\n }\n className={composeRenderProps(className, (className) =>\n classNames(\n \"relative flex cursor-default select-none items-center gap-2 px-2 py-1.5 text-sm outline-none transition-colors\",\n /* Disabled */\n \"disabled-muted\",\n /* Focused */\n \"data-[focused]:bg-accent data-[focused]:text-accent-foreground \",\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\" && (\n <Dot className=\"size-icon fill-current\" />\n )}\n {renderProps.selectionMode == \"multiple\" && (\n <Check className=\"size-icon\" />\n )}\n </>\n )}\n </span>\n\n {children}\n\n {renderProps.hasSubmenu && <ChevronRight 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({\n className,\n inset,\n separator = true,\n ...props\n}: MenuHeaderProps) {\n return (\n <AriaHeader\n className={classNames(\n \"px-3 py-1.5 text-sm 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 (\n <AriaSeparator\n className={classNames(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n )\n}\n\nexport function MenuKeyboard({\n className,\n ...props\n}: React.ComponentProps<typeof AriaKeyboard>) {\n return (\n <AriaKeyboard\n className={classNames(\"ml-auto text-xs tracking-widest opacity-60\", className)}\n {...props}\n />\n )\n}\ninterface MenuProps<T>\n extends AriaMenuProps<T>,\n VariantProps<typeof buttonVariants>,\n Omit<AriaMenuTriggerProps, \"children\"> {\n label?: React.ReactNode\n isDisabled?: boolean\n}\n// TODO name this better\nexport function EasyMenu<T extends object>({\n label,\n children,\n variant,\n isDisabled,\n size,\n ...props\n}: MenuProps<T>) {\n return (\n <MenuTrigger {...props}>\n <Button isDisabled={isDisabled} type=\"button\" variant={variant} size={size}>\n {label}\n </Button>\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","Dot","Check","ChevronRight","MenuHeader","inset","separator","AriaHeader","MenuSeparator","AriaSeparator","MenuKeyboard","AriaKeyboard","EasyMenu","label","variant","isDisabled","size","Button"],"mappings":"goBAwBO,MAAMA,EAAcC,EACdC,EAAiBC,EACjBC,EAAiBC,EAEvB,SAASC,EAAY,CAAE,UAAAC,EAAW,GAAGC,GAAuB,CACjE,OACEC,EAACC,EAAA,CACC,UAAWC,EAAmBJ,EAAYA,GACxCK,EAAWL,CAAS,CAAA,EAErB,GAAGC,CAAA,CAAA,CAGV,CAEO,SAASK,EAAuB,CAAE,UAAAN,EAAW,GAAGC,GAA2B,CAChF,OACEC,EAACK,EAAA,CACC,UAAWF,EACT,uFACAL,CAAA,EAEF,kBAAkB,OACjB,GAAGC,CAAA,CAAA,CAGV,CAEO,SAASO,EAAS,CAAE,SAAAC,EAAU,UAAAT,EAAW,GAAGC,GAAkE,CACnH,OACEC,EAACQ,EAAA,CACC,UACET,EAAM,YAAc,OAAOQ,GAAa,SAAWA,EAAW,QAEhE,UAAWL,EAAmBJ,EAAYA,GACxCK,EACE,iHAEA,iBAEA,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ACO,EAAA,CAAM,GAAGL,EAAQ,SAAAQ,CAAA,CAAS,CAAA,CAC7B,CAAA,EACF,CAEJ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FormFieldProps } from 'lib/components/
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { FormFieldProps } from 'lib/components/field';
|
|
2
|
+
import { EasyMenu } from 'lib/components/menu';
|
|
3
|
+
import { SelectOption } from 'lib/components/select-options';
|
|
4
4
|
interface MultipleSelectionProps {
|
|
5
5
|
value: Set<string | number>;
|
|
6
6
|
onChange: (v: Set<string | number>) => void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{FormField as d}from"./field.js";import{EasyMenu as p,MenuItem as a}from"./menu.js";import{useFieldContext as u}from"../utils/form-context.js";import{getFieldErrorMessage as c}from"../utils/primitives.js";import"class-variance-authority";import"react-aria-components";import"lucide-react";import"./button.js";import"./loader.js";import"./list-box.js";import"./select.js";import"./popover.js";import"@tanstack/react-form";import"clsx";function f({items:i,value:e,onChange:t,label:l,errorMessage:n,description:m,...s}){return o("div",{className:"group form-field",children:o(d,{label:l,description:m,errorMessage:n,children:o(p,{selectionMode:"multiple",selectedKeys:e,onSelectionChange:r=>{typeof r!="string"&&t(r)},items:i,label:e.size,...s,children:r=>o(a,{id:r.id,isDisabled:r?.disabled,children:r.label},r.id)})})})}function I({...i}){const e=u();return o(f,{value:e.state.value,onChange:e.setValue,onClose:e.handleBlur,errorMessage:c(e),...i})}export{f as MultiSelect,I as TfMultiSelect};
|
|
2
|
+
//# sourceMappingURL=multi-select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi-select.js","sources":["../../lib/components/multi-select.tsx"],"sourcesContent":["import { FormField, type FormFieldProps } from \"lib/components/field\";\nimport { EasyMenu, MenuItem } from \"lib/components/menu\";\nimport type { SelectOption } from \"lib/components/select-options\";\nimport { useFieldContext } from \"lib/utils/form-context\";\nimport { getFieldErrorMessage } from \"lib/utils/primitives\";\ninterface MultipleSelectionProps {\n\tvalue: Set<string | number>;\n\tonChange: (v: Set<string | number>) => void;\n\tbuttonLabel?: React.ReactNode;\n\titems: SelectOption[];\n}\n\nexport interface MultiSelectProps extends MultipleSelectionProps, FormFieldProps, Omit<React.ComponentProps<typeof EasyMenu>, 'label' | 'items'> { }\n\nexport function MultiSelect({\n\titems,\n\tvalue,\n\tonChange: setValue,\n\tlabel,\n\terrorMessage,\n\tdescription,\n\t...props\n}: MultiSelectProps) {\n\treturn (\n\t\t<div className=\"group form-field\">\n\t\t\t<FormField {...{ label, description, errorMessage }}>\n\t\t\t\t<EasyMenu\n\t\t\t\t\tselectionMode=\"multiple\"\n\t\t\t\t\tselectedKeys={value}\n\t\t\t\t\tonSelectionChange={(v) => {\n\t\t\t\t\t\tif (typeof (v) === 'string') return\n\t\t\t\t\t\tsetValue(v)\n\t\t\t\t\t}}\n\t\t\t\t\titems={items}\n\t\t\t\t\tlabel={value.size}\n\t\t\t\t\t{...props}>\n\t\t\t\t\t{(item) => <MenuItem id={item.id} key={item.id} isDisabled={item?.disabled}>{item.label}</MenuItem>}\n\t\t\t\t</EasyMenu>\n\t\t\t</FormField>\n\t\t</div>\n\t);\n};\n\n\n// TODO implement isDisabled\nexport interface TfMultiSelectProps\n\textends Omit<MultiSelectProps, \"value\" | \"onChange\"> { }\nexport function TfMultiSelect({ ...props }: TfMultiSelectProps) {\n\tconst field = useFieldContext<Set<number | string>>();\n\n\treturn (\n\t\t<MultiSelect\n\t\t\tvalue={field.state.value}\n\t\t\tonChange={field.setValue}\n\t\t\tonClose={field.handleBlur}\n\t\t\terrorMessage={getFieldErrorMessage(field)}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n"],"names":["MultiSelect","items","value","setValue","label","errorMessage","description","props","jsx","FormField","EasyMenu","v","item","MenuItem","TfMultiSelect","field","useFieldContext","getFieldErrorMessage"],"mappings":"geAcO,SAASA,EAAY,CAC3B,MAAAC,EACA,MAAAC,EACA,SAAUC,EACV,MAAAC,EACA,aAAAC,EACA,YAAAC,EACA,GAAGC,CACJ,EAAqB,CACpB,OACCC,EAAC,MAAA,CAAI,UAAU,mBACd,SAAAA,EAACC,EAAA,CAAgB,MAAAL,EAAO,YAAAE,EAAa,aAAAD,EACpC,SAAAG,EAACE,EAAA,CACA,cAAc,WACd,aAAcR,EACd,kBAAoBS,GAAM,CACrB,OAAQA,GAAO,UACnBR,EAASQ,CAAC,CACX,EACA,MAAAV,EACA,MAAOC,EAAM,KACZ,GAAGK,EACH,SAACK,GAASJ,EAACK,EAAA,CAAS,GAAID,EAAK,GAAkB,WAAYA,GAAM,SAAW,SAAAA,EAAK,KAAA,EAA3CA,EAAK,EAA4C,CAAA,CAAA,EAE1F,CAAA,CACD,CAEF,CAMO,SAASE,EAAc,CAAE,GAAGP,GAA6B,CAC/D,MAAMQ,EAAQC,EAAA,EAEd,OACCR,EAACR,EAAA,CACA,MAAOe,EAAM,MAAM,MACnB,SAAUA,EAAM,SAChB,QAASA,EAAM,WACf,aAAcE,EAAqBF,CAAK,EACvC,GAAGR,CAAA,CAAA,CAGP"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as r,jsxs as d}from"react/jsx-runtime";import{NumberField as c,composeRenderProps as n,Input as p}from"react-aria-components";import{Button as f}from"./button.js";import{useFieldContext as h}from"../utils/form-context.js";import{getFieldErrorMessage as l,classNames as t}from"../utils/primitives.js";import{ChevronUp as b,ChevronDown as N}from"lucide-react";import{FormField as g,FieldGroup as F}from"./field.js";import"class-variance-authority";import"./loader.js";import"@tanstack/react-form";import"clsx";const x=c;function v({className:o,...i}){return r(p,{className:n(o,e=>t("w-fit min-w-0 flex-1 border-r border-transparent bg-card pr-2 outline-0 placeholder:text-muted-foreground [&::-webkit-search-cancel-button]:hidden",e)),...i})}function w({className:o,...i}){return d("div",{className:t("absolute right-0 flex h-full flex-col border-l",o),...i,children:[r(s,{slot:"increment",children:r(b,{"aria-hidden":!0,className:"size-icon"})}),r("div",{className:"border-b"}),r(s,{slot:"decrement",children:r(N,{"aria-hidden":!0,className:"size-icon"})})]})}function s({className:o,...i}){return r(f,{className:n(o,e=>t("w-auto grow h-3 px-0.5 text-muted-foreground",e)),variant:"ghost",size:"none",...i})}function C({label:o,description:i,errorMessage:e,className:m,...a}){return r(x,{className:n(m,u=>t("group form-field",u)),...a,children:r(g,{label:o,description:i,errorMessage:e,children:d(F,{children:[r(v,{}),r(w,{})]})})})}function P({isDisabled:o,...i}){const e=h();return r(C,{isInvalid:!!l(e),isDisabled:o||e.form.state.isSubmitting,value:e.state.value,id:e.name,onChange:e.handleChange,onBlur:e.handleBlur,errorMessage:l(e),...i})}export{C as NumberField,P as TfNumberField};
|
|
2
|
+
//# sourceMappingURL=numberfield.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numberfield.js","sources":["../../lib/components/numberfield.tsx"],"sourcesContent":["import {\n ButtonProps as AriaButtonProps,\n Input as AriaInput,\n InputProps as AriaInputProps,\n NumberField as AriaNumberField,\n NumberFieldProps as AriaNumberFieldProps,\n composeRenderProps\n} from \"react-aria-components\"\n\nimport { Button } from \"lib/components/button\"\nimport { useFieldContext } from \"lib/utils/form-context\"\nimport { classNames, getFieldErrorMessage } from \"lib/utils/primitives\"\nimport { ChevronDown, ChevronUp } from \"lucide-react\"\nimport { FieldGroup, FormField, type FormFieldProps } from \"./field\"\n\nconst ANumberField = AriaNumberField\n\nfunction NumberFieldInput({ className, ...props }: AriaInputProps) {\n return (\n <AriaInput\n className={composeRenderProps(className, (className) =>\n classNames(\n \"w-fit min-w-0 flex-1 border-r border-transparent bg-card pr-2 outline-0 placeholder:text-muted-foreground [&::-webkit-search-cancel-button]:hidden\",\n className\n )\n )}\n {...props}\n />\n )\n}\n\nfunction NumberFieldSteppers({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n className={classNames(\n \"absolute right-0 flex h-full flex-col border-l\",\n className\n )}\n {...props}\n >\n <NumberFieldStepper slot=\"increment\">\n <ChevronUp aria-hidden className=\"size-icon\" />\n </NumberFieldStepper>\n <div className=\"border-b\" />\n <NumberFieldStepper slot=\"decrement\">\n <ChevronDown aria-hidden className=\"size-icon\" />\n </NumberFieldStepper>\n </div>\n )\n}\n\nfunction NumberFieldStepper({ className, ...props }: AriaButtonProps) {\n return (\n <Button\n className={composeRenderProps(className, (className) =>\n classNames(\"w-auto grow h-3 px-0.5 text-muted-foreground\", className)\n )}\n variant={\"ghost\"}\n size={\"none\"}\n {...props}\n />\n )\n}\n\ntype NumberFieldProps = AriaNumberFieldProps & FormFieldProps\nexport function NumberField({\n label,\n description,\n errorMessage,\n className,\n ...props\n}: NumberFieldProps) {\n return (\n <ANumberField\n className={composeRenderProps(className, (className) =>\n classNames(\"group form-field\", className)\n )}\n {...props}\n >\n <FormField label={label} description={description} errorMessage={errorMessage}>\n <FieldGroup>\n <NumberFieldInput />\n <NumberFieldSteppers />\n </FieldGroup>\n </FormField>\n </ANumberField>\n )\n}\n\nexport function TfNumberField({ isDisabled, ...props }: Omit<React.ComponentProps<typeof NumberField>, 'value' | 'id' | 'onChange' | 'onBlur'>) {\n const field = useFieldContext<number>();\n\n return (\n <NumberField\n isInvalid={!!getFieldErrorMessage(field)}\n isDisabled={isDisabled || field.form.state.isSubmitting}\n value={field.state.value}\n id={field.name}\n onChange={field.handleChange}\n onBlur={field.handleBlur}\n errorMessage={getFieldErrorMessage(field)}\n {...props}\n />)\n}\n\n"],"names":["ANumberField","AriaNumberField","NumberFieldInput","className","props","jsx","AriaInput","composeRenderProps","classNames","NumberFieldSteppers","jsxs","NumberFieldStepper","ChevronUp","ChevronDown","Button","NumberField","label","description","errorMessage","FormField","FieldGroup","TfNumberField","isDisabled","field","useFieldContext","getFieldErrorMessage"],"mappings":"ugBAeA,MAAMA,EAAeC,EAErB,SAASC,EAAiB,CAAE,UAAAC,EAAW,GAAGC,GAAyB,CACjE,OACEC,EAACC,EAAA,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,GAAcC,EAAM,KAAK,MAAM,aAC3C,MAAOA,EAAM,MAAM,MACnB,GAAIA,EAAM,KACV,SAAUA,EAAM,aAChB,OAAQA,EAAM,WACd,aAAcE,EAAqBF,CAAK,EACvC,GAAGnB,CAAA,CAAA,CAEV"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{Popover as n,composeRenderProps as m,DialogTrigger as p,Dialog as d}from"react-aria-components";import{classNames as a}from"../utils/primitives.js";import"clsx";const c=p,u=({className:o,offset:e=4,...i})=>t(n,{offset:e,className:m(o,r=>a("z-50 border bg-popover text-popover-foreground outline-none max-w-lg","data-[entering]:animate-in data-[entering]:fade-in-0 data-[entering]:zoom-in-95","data-[exiting]:animate-out data-[exiting]:fade-out-0 data-[exiting]:zoom-out-95","data-[placement=bottom]:slide-in-from-top-2 data-[placement=left]:slide-in-from-right-2 data-[placement=right]:slide-in-from-left-2 data-[placement=top]:slide-in-from-bottom-2",r)),...i});function v({className:o,...e}){return t(d,{className:a("p-icon outline-0",o),...e})}export{u as Popover,v as PopoverDialog,c as PopoverTrigger};
|
|
2
|
+
//# sourceMappingURL=popover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.js","sources":["../../lib/components/popover.tsx"],"sourcesContent":["import {\n\tDialog as AriaDialog,\n\tDialogProps as AriaDialogProps,\n\tDialogTrigger as AriaDialogTrigger,\n\tPopover as AriaPopover,\n\tPopoverProps as AriaPopoverProps,\n\tcomposeRenderProps,\n} from \"react-aria-components\"\n\nimport { classNames } from \"lib/utils/primitives\"\n\nexport const PopoverTrigger = AriaDialogTrigger\n\nexport const Popover = ({ className, offset = 4, ...props }: AriaPopoverProps) => (\n\t<AriaPopover\n\t\toffset={offset}\n\t\tclassName={composeRenderProps(className, (className) =>\n\t\t\tclassNames(\n\t\t\t\t\"z-50 border bg-popover text-popover-foreground outline-none max-w-lg\",\n\t\t\t\t/* Entering */\n\t\t\t\t\"data-[entering]:animate-in data-[entering]:fade-in-0 data-[entering]:zoom-in-95\",\n\t\t\t\t/* Exiting */\n\t\t\t\t\"data-[exiting]:animate-out data-[exiting]:fade-out-0 data-[exiting]:zoom-out-95\",\n\t\t\t\t/* Placement */\n\t\t\t\t\"data-[placement=bottom]:slide-in-from-top-2 data-[placement=left]:slide-in-from-right-2 data-[placement=right]:slide-in-from-left-2 data-[placement=top]:slide-in-from-bottom-2\",\n\t\t\t\tclassName\n\t\t\t)\n\t\t)}\n\t\t{...props}\n\t/>\n)\n\nexport function PopoverDialog({ className, ...props }: AriaDialogProps) {\n\treturn (\n\t\t<AriaDialog className={classNames(\"p-icon outline-0\", className)} {...props} />\n\t)\n}\n"],"names":["PopoverTrigger","AriaDialogTrigger","Popover","className","offset","props","jsx","AriaPopover","composeRenderProps","classNames","PopoverDialog","AriaDialog"],"mappings":"gNAWO,MAAMA,EAAiBC,EAEjBC,EAAU,CAAC,CAAE,UAAAC,EAAW,OAAAC,EAAS,EAAG,GAAGC,KACnDC,EAACC,EAAA,CACA,OAAAH,EACA,UAAWI,EAAmBL,EAAYA,GACzCM,EACC,uEAEA,kFAEA,kFAEA,kLACAN,CAAA,CACD,EAEA,GAAGE,CAAA,CACL,EAGM,SAASK,EAAc,CAAE,UAAAP,EAAW,GAAGE,GAA0B,CACvE,OACCC,EAACK,GAAW,UAAWF,EAAW,mBAAoBN,CAAS,EAAI,GAAGE,EAAO,CAE/E"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as l}from"react/jsx-runtime";import{SearchIcon as s,XIcon as m}from"lucide-react";import{composeRenderProps as n,SearchField as p,Input as u,Button as h}from"react-aria-components";import{classNames as a}from"../utils/primitives.js";import{FormField as f,FieldGroup as g}from"./field.js";import"clsx";import"class-variance-authority";function F({className:r,...i}){return e(p,{className:n(r,o=>a("group",o)),...i})}function b({className:r,...i}){return e(u,{className:n(r,o=>a("min-w-0 ring-0 focus-visible:outline-none flex-1 bg-card px-2 py-1.5 placeholder:text-muted-foreground [&::-webkit-search-cancel-button]:hidden",o)),...i})}function x({className:r,...i}){return e(h,{className:n(r,o=>a("mr-1 opacity-70 ring-offset-background transition-opacity","data-[hovered]:opacity-100","data-[disabled]:pointer-events-none","group-data-[empty]:invisible",o)),...i})}function w({label:r,description:i,className:o,errorMessage:t,...c}){return e(F,{className:n(o,d=>a("group form-field",d)),...c,children:e(f,{label:r,description:i,errorMessage:t,children:l(g,{children:[e(s,{"aria-hidden":!0,className:"size-icon text-muted-foreground"}),e(b,{placeholder:""}),e(x,{children:e(m,{"aria-hidden":!0,className:"size-icon"})})]})})})}export{w as SearchField};
|
|
2
|
+
//# sourceMappingURL=searchfield.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searchfield.js","sources":["../../lib/components/searchfield.tsx"],"sourcesContent":["import { SearchIcon, XIcon } from \"lucide-react\"\nimport {\n Button as AriaButton,\n ButtonProps as AriaButtonProps,\n Input as AriaInput,\n InputProps as AriaInputProps,\n SearchField as AriaSearchField,\n SearchFieldProps as AriaSearchFieldProps,\n composeRenderProps\n} from \"react-aria-components\"\n\nimport { classNames } from \"lib/utils/primitives\"\n\nimport { FieldGroup, FormField, type FormFieldProps } from \"./field\"\n\nfunction ASearchField({ className, ...props }: AriaSearchFieldProps) {\n return (\n <AriaSearchField\n className={composeRenderProps(className, (className) =>\n classNames(\"group\", className)\n )}\n {...props}\n />\n )\n}\n\nfunction ASearchFieldInput({ className, ...props }: AriaInputProps) {\n return (\n <AriaInput\n className={composeRenderProps(className, (className) =>\n classNames(\n \"min-w-0 ring-0 focus-visible:outline-none flex-1 bg-card px-2 py-1.5 placeholder:text-muted-foreground [&::-webkit-search-cancel-button]:hidden\",\n className\n )\n )}\n {...props}\n />\n )\n}\n\nfunction SearchFieldClear({ className, ...props }: AriaButtonProps) {\n return (\n <AriaButton\n className={composeRenderProps(className, (className) =>\n classNames(\n \"mr-1 opacity-70 ring-offset-background transition-opacity\",\n /* Hover */\n \"data-[hovered]:opacity-100\",\n /* Disabled */\n \"data-[disabled]:pointer-events-none\",\n /* Empty */\n \"group-data-[empty]:invisible\",\n className\n )\n )}\n {...props}\n />\n )\n}\n\nexport interface SearchFieldProps extends AriaSearchFieldProps, FormFieldProps { };\nexport function SearchField({\n label,\n description,\n className,\n errorMessage,\n ...props\n}: SearchFieldProps) {\n return (\n <ASearchField\n className={composeRenderProps(className, (className) =>\n classNames(\"group form-field\", className)\n )}\n {...props}\n >\n <FormField label={label} description={description} errorMessage={errorMessage}>\n <FieldGroup>\n <SearchIcon aria-hidden className=\"size-icon text-muted-foreground\" />\n <ASearchFieldInput placeholder=\"\" />\n <SearchFieldClear>\n <XIcon aria-hidden className=\"size-icon\" />\n </SearchFieldClear>\n </FieldGroup>\n </FormField>\n </ASearchField>\n )\n}"],"names":["ASearchField","className","props","jsx","AriaSearchField","composeRenderProps","classNames","ASearchFieldInput","AriaInput","SearchFieldClear","AriaButton","SearchField","label","description","errorMessage","FormField","FieldGroup","SearchIcon","XIcon"],"mappings":"mWAeA,SAASA,EAAa,CAAE,UAAAC,EAAW,GAAGC,GAA+B,CACnE,OACEC,EAACC,EAAA,CACC,UAAWC,EAAmBJ,EAAYA,GACxCK,EAAW,QAASL,CAAS,CAAA,EAE9B,GAAGC,CAAA,CAAA,CAGV,CAEA,SAASK,EAAkB,CAAE,UAAAN,EAAW,GAAGC,GAAyB,CAClE,OACEC,EAACK,EAAA,CACC,UAAWH,EAAmBJ,EAAYA,GACxCK,EACE,kJACAL,CAAA,CACF,EAED,GAAGC,CAAA,CAAA,CAGV,CAEA,SAASO,EAAiB,CAAE,UAAAR,EAAW,GAAGC,GAA0B,CAClE,OACEC,EAACO,EAAA,CACC,UAAWL,EAAmBJ,EAAYA,GACxCK,EACE,4DAEA,6BAEA,sCAEA,+BACAL,CAAA,CACF,EAED,GAAGC,CAAA,CAAA,CAGV,CAGO,SAASS,EAAY,CAC1B,MAAAC,EACA,YAAAC,EACA,UAAAZ,EACA,aAAAa,EACA,GAAGZ,CACL,EAAqB,CACnB,OACEC,EAACH,EAAA,CACC,UAAWK,EAAmBJ,EAAYA,GACxCK,EAAW,mBAAoBL,CAAS,CAAA,EAEzC,GAAGC,EAEJ,WAACa,EAAA,CAAU,MAAAH,EAAc,YAAAC,EAA0B,aAAAC,EACjD,WAACE,EAAA,CACC,SAAA,CAAAb,EAACc,EAAA,CAAW,cAAW,GAAC,UAAU,kCAAkC,EACpEd,EAACI,EAAA,CAAkB,YAAY,EAAA,CAAG,EAClCJ,EAACM,GACC,SAAAN,EAACe,EAAA,CAAM,cAAW,GAAC,UAAU,YAAY,CAAA,CAC3C,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CAAA,CAGN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-options.js","sources":["../../lib/components/select-options.tsx"],"sourcesContent":["export type SelectOption = {\n\tid: string\n\tlabel: React.ReactNode,\n\tdisabled?: boolean\n}\nexport const LICENSE_TYPE_OPTIONS: SelectOption[] = [\n\t{\n\t\tlabel: <>Node-locked</>,\n\t\tid: \"node-locked\",\n\t},\n\t{\n\t\tlabel: <>Hosted floating</>,\n\t\tid: \"hosted-floating\",\n\t},\n\t{\n\t\tlabel: <>LexFloatServer</>,\n\t\tid: \"on-premise-floating\",\n\t},\n];\n\n\n/**\n * Creates Unicode flag from a two-letter ISO country code.\n * https://stackoverflow.com/questions/24050671/how-to-put-japan-flag-character-in-a-string\n * @param {string} country — A two-letter ISO country code (case-insensitive).\n * @return {string}\n */\nfunction getCountryFlag(country: string) {\n\tfunction getRegionalIndicatorSymbol(letter: string) {\n\t\treturn String.fromCodePoint(\n\t\t\t0x1f1e6 - 65 + letter.toUpperCase().charCodeAt(0),\n\t\t);\n\t}\n\n\treturn (\n\t\tgetRegionalIndicatorSymbol(country[0]) +\n\t\tgetRegionalIndicatorSymbol(country[1])\n\t);\n}\n\nconst ALL_COUNTRIES: { [key: string]: string } = {\n\tAF: \"Afghanistan\",\n\tAX: \"Åland Islands\",\n\tAL: \"Albania\",\n\tDZ: \"Algeria\",\n\tAS: \"American Samoa\",\n\tAD: \"Andorra\",\n\tAO: \"Angola\",\n\tAI: \"Anguilla\",\n\tAQ: \"Antarctica\",\n\tAG: \"Antigua and Barbuda\",\n\tAR: \"Argentina\",\n\tAM: \"Armenia\",\n\tAW: \"Aruba\",\n\tAU: \"Australia\",\n\tAT: \"Austria\",\n\tAZ: \"Azerbaijan\",\n\tBS: \"Bahamas\",\n\tBH: \"Bahrain\",\n\tBD: \"Bangladesh\",\n\tBB: \"Barbados\",\n\tBY: \"Belarus\",\n\tBE: \"Belgium\",\n\tBZ: \"Belize\",\n\tBJ: \"Benin\",\n\tBM: \"Bermuda\",\n\tBT: \"Bhutan\",\n\tBO: \"Bolivia (Plurinational State of)\",\n\tBQ: \"Bonaire, Sint Eustatius and Saba\",\n\tBA: \"Bosnia and Herzegovina\",\n\tBW: \"Botswana\",\n\tBV: \"Bouvet Island\",\n\tBR: \"Brazil\",\n\tIO: \"British Indian Ocean Territory\",\n\tBN: \"Brunei Darussalam\",\n\tBG: \"Bulgaria\",\n\tBF: \"Burkina Faso\",\n\tBI: \"Burundi\",\n\tCV: \"Caboe Verde\",\n\tKH: \"Cambodia\",\n\tCM: \"Cameroon\",\n\tCA: \"Canada\",\n\tKY: \"Cayman Islands\",\n\tCF: \"Central African Republic\",\n\tTD: \"Chad\",\n\tCL: \"Chile\",\n\tCN: \"China\",\n\tCX: \"Christmas Island\",\n\tCC: \"Cocos (Keeling) Islands\",\n\tCO: \"Colombia\",\n\tKM: \"Comoros\",\n\tCG: \"Congo\",\n\tCD: \"Congo, Democratic Republic of the\",\n\tCK: \"Cook Islands\",\n\tCR: \"Costa Rica\",\n\tCI: \"Côte d'voire\",\n\tHR: \"Croatia\",\n\tCU: \"Cuba\",\n\tCW: \"Curaçao\",\n\tCY: \"Cyprus\",\n\tCZ: \"Czechia\",\n\tDK: \"Denmark\",\n\tDJ: \"Djibouti\",\n\tDM: \"Dominica\",\n\tDO: \"Dominican Republic\",\n\tEC: \"Ecuador\",\n\tEG: \"Egypt\",\n\tSV: \"El Salvador\",\n\tGQ: \"Equatorial Guinea\",\n\tER: \"Eritrea\",\n\tEE: \"Estonia\",\n\tSZ: \"Eswatini\",\n\tET: \"Ethiopia\",\n\tFK: \"Falkland Islands (Malvinas)\",\n\tFO: \"Faroe Islands\",\n\tFJ: \"Fiji\",\n\tFI: \"Finland\",\n\tFR: \"France\",\n\tGF: \"French Guiana\",\n\tPF: \"French Polynesia\",\n\tTF: \"French Southern Territories\",\n\tGA: \"Gabon\",\n\tGM: \"Gambia\",\n\tGE: \"Georgia\",\n\tDE: \"Germany\",\n\tGH: \"Ghana\",\n\tGI: \"Gibraltar\",\n\tGR: \"Greece\",\n\tGL: \"Greenland\",\n\tGD: \"Grenada\",\n\tGP: \"Guadeloupe\",\n\tGU: \"Guam\",\n\tGT: \"Guatemala\",\n\tGG: \"Guernsey\",\n\tGN: \"Guinea\",\n\tGW: \"Guinea-Bissau\",\n\tGY: \"Guyana\",\n\tHT: \"Haiti\",\n\tHM: \"Heard Island and Mcdonald Islands\",\n\tVA: \"Holy See\",\n\tHN: \"Honduras\",\n\tHK: \"Hong Kong\",\n\tHU: \"Hungary\",\n\tIS: \"Iceland\",\n\tIN: \"India\",\n\tID: \"Indonesia\",\n\tIR: \"Iran (Islamic Republic of)\",\n\tIQ: \"Iraq\",\n\tIE: \"Ireland\",\n\tIM: \"Isle of Man\",\n\tIL: \"Israel\",\n\tIT: \"Italy\",\n\tJM: \"Jamaica\",\n\tJP: \"Japan\",\n\tJE: \"Jersey\",\n\tJO: \"Jordan\",\n\tKZ: \"Kazakhstan\",\n\tKE: \"Kenya\",\n\tKI: \"Kiribati\",\n\tKP: \"Korea (Democratic People's Republic of)\",\n\tKR: \"Korea (Republic of)\",\n\tKW: \"Kuwait\",\n\tKG: \"Kyrgyzstan\",\n\tLA: \"Lao People's Democratic Republic\",\n\tLV: \"Latvia\",\n\tLB: \"Lebanon\",\n\tLS: \"Lesotho\",\n\tLR: \"Liberia\",\n\tLY: \"Libya\",\n\tLI: \"Liechtenstein\",\n\tLT: \"Lithuania\",\n\tLU: \"Luxembourg\",\n\tMO: \"Macao\",\n\tMG: \"Madagascar\",\n\tMW: \"Malawi\",\n\tMY: \"Malaysia\",\n\tMV: \"Maldives\",\n\tML: \"Mali\",\n\tMT: \"Malta\",\n\tMH: \"Marshall Islands\",\n\tMQ: \"Martinique\",\n\tMR: \"Mauritania\",\n\tMU: \"Mauritius\",\n\tYT: \"Mayotte\",\n\tMX: \"Mexico\",\n\tFM: \"Micronesia (Federated States of)\",\n\tMD: \"Moldova, Republic of\",\n\tMC: \"Monaco\",\n\tMN: \"Mongolia\",\n\tME: \"Montenegro\",\n\tMS: \"Montserrat\",\n\tMA: \"Morocco\",\n\tMZ: \"Mozambique\",\n\tMM: \"Myanmar\",\n\tNA: \"Namibia\",\n\tNR: \"Nauru\",\n\tNP: \"Nepal\",\n\tNL: \"Netherlands, Kingdom of the\",\n\tNC: \"New Caledonia\",\n\tNZ: \"New Zealand\",\n\tNI: \"Nicaragua\",\n\tNE: \"Niger\",\n\tNG: \"Nigeria\",\n\tNU: \"Niue\",\n\tNF: \"Norfolk Island\",\n\tMK: \"North Macedonia\",\n\tMP: \"Northern Mariana Islands\",\n\tNO: \"Norway\",\n\tOM: \"Oman\",\n\tPK: \"Pakistan\",\n\tPW: \"Palau\",\n\tPS: \"Palestine, State of\",\n\tPA: \"Panama\",\n\tPG: \"Papua New Guinea\",\n\tPY: \"Paraguay\",\n\tPE: \"Peru\",\n\tPH: \"Philippines\",\n\tPN: \"Pitcairn\",\n\tPL: \"Poland\",\n\tPT: \"Portugal\",\n\tPR: \"Puerto Rico\",\n\tQA: \"Qatar\",\n\tRE: \"Réunion\",\n\tRO: \"Romania\",\n\tRU: \"Russian Federation\",\n\tRW: \"Rwanda\",\n\tBL: \"Saint Barthélemy\",\n\tSH: \"Saint Helena, Ascension Island, Tristan da Cunha\",\n\tKN: \"Saint Kitts and Nevis\",\n\tLC: \"Saint Lucia\",\n\tMF: \"Saint Martin (French part)\",\n\tPM: \"Saint Pierre and Miquelon\",\n\tVC: \"Saint Vincent and the Grenadines\",\n\tWS: \"Samoa\",\n\tSM: \"San Marino\",\n\tST: \"Sao Tome and Principe\",\n\tSA: \"Saudi Arabia\",\n\tSN: \"Senegal\",\n\tRS: \"Serbia\",\n\tSC: \"Seychelles\",\n\tSL: \"Sierra Leone\",\n\tSG: \"Singapore\",\n\tSX: \"Sint Maarten (Dutch part)\",\n\tSK: \"Slovakia\",\n\tSI: \"Slovenia\",\n\tSB: \"Solomon Islands\",\n\tSO: \"Somalia\",\n\tZA: \"South Africa\",\n\tGS: \"South Georgia and the South Sandwich Islands\",\n\tSS: \"South Sudan\",\n\tES: \"Spain\",\n\tLK: \"Sri Lanka\",\n\tSD: \"Sudan\",\n\tSR: \"Suriname\",\n\tSJ: \"Svalbard and Jan Mayen\",\n\tSE: \"Sweden\",\n\tCH: \"Switzerland\",\n\tSY: \"Syrian Arab Republic\",\n\tTW: \"Taiwan, Province of China\",\n\tTJ: \"Tajikistan\",\n\tTZ: \"Tanzania, United Republic of\",\n\tTH: \"Thailand\",\n\tTL: \"Timor-Leste\",\n\tTG: \"Togo\",\n\tTK: \"Tokelau\",\n\tTO: \"Tonga\",\n\tTT: \"Trinidad and Tobago\",\n\tTN: \"Tunisia\",\n\tTR: \"Türkiye\",\n\tTM: \"Turkmenistan\",\n\tTC: \"Turks and Caicos Islands\",\n\tTV: \"Tuvalu\",\n\tUG: \"Uganda\",\n\tUA: \"Ukraine\",\n\tAE: \"United Arab Emirates\",\n\tGB: \"United Kingdom of Great Britain and Northern Ireland\",\n\tUM: \"United States Minor Outlying Islands\",\n\tUS: \"United States of America\",\n\tUY: \"Uruguay\",\n\tUZ: \"Uzbekistan\",\n\tVU: \"Vanuatu\",\n\tVE: \"Venezuela (Bolivarian Republic of)\",\n\tVN: \"Viet Nam\",\n\tVG: \"Virgin Islands (British)\",\n\tVI: \"Virgin Islands (U.S)\",\n\tWF: \"Wallis and Futuna\",\n\tEH: \"Western Sahara\",\n\tYE: \"Yemen\",\n\tZM: \"Zambia\",\n\tZW: \"Zimbabwe\",\n};\n\n/** Options for MultiSelect component */\nexport const COUNTRY_OPTIONS: SelectOption[] = Object.entries(ALL_COUNTRIES).map((v) => {\n\treturn {\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{getCountryFlag(v[0])} {v[1]}\n\t\t\t</>\n\t\t),\n\t\tid: v[0],\n\t};\n});"],"names":["LICENSE_TYPE_OPTIONS","getCountryFlag","country","getRegionalIndicatorSymbol","letter","ALL_COUNTRIES","COUNTRY_OPTIONS","v","jsxs","Fragment"],"mappings":"gEAKO,MAAMA,EAAuC,CACnD,CACC,WAAS,SAAA,aAAA,CAAW,EACpB,GAAI,aAAA,EAEL,CACC,WAAS,SAAA,iBAAA,CAAe,EACxB,GAAI,iBAAA,EAEL,CACC,WAAS,SAAA,gBAAA,CAAc,EACvB,GAAI,qBAAA,CAEN,EASA,SAASC,EAAeC,EAAiB,CACxC,SAASC,EAA2BC,EAAgB,CACnD,OAAO,OAAO,cACb,OAAeA,EAAO,YAAA,EAAc,WAAW,CAAC,CAAA,CAElD,CAEA,OACCD,EAA2BD,EAAQ,CAAC,CAAC,EACrCC,EAA2BD,EAAQ,CAAC,CAAC,CAEvC,CAEA,MAAMG,EAA2C,CAChD,GAAI,cACJ,GAAI,gBACJ,GAAI,UACJ,GAAI,UACJ,GAAI,iBACJ,GAAI,UACJ,GAAI,SACJ,GAAI,WACJ,GAAI,aACJ,GAAI,sBACJ,GAAI,YACJ,GAAI,UACJ,GAAI,QACJ,GAAI,YACJ,GAAI,UACJ,GAAI,aACJ,GAAI,UACJ,GAAI,UACJ,GAAI,aACJ,GAAI,WACJ,GAAI,UACJ,GAAI,UACJ,GAAI,SACJ,GAAI,QACJ,GAAI,UACJ,GAAI,SACJ,GAAI,mCACJ,GAAI,mCACJ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J,GAAI,eACJ,GAAI,2BACJ,GAAI,SACJ,GAAI,SACJ,GAAI,UACJ,GAAI,uBACJ,GAAI,uDACJ,GAAI,uCACJ,GAAI,2BACJ,GAAI,UACJ,GAAI,aACJ,GAAI,UACJ,GAAI,qCACJ,GAAI,WACJ,GAAI,2BACJ,GAAI,uBACJ,GAAI,oBACJ,GAAI,iBACJ,GAAI,QACJ,GAAI,SACJ,GAAI,UACL,EAGaC,EAAkC,OAAO,QAAQD,CAAa,EAAE,IAAKE,IAC1E,CACN,MACCC,EAAAC,EAAA,CACE,SAAA,CAAAR,EAAeM,EAAE,CAAC,CAAC,EAAE,IAAEA,EAAE,CAAC,CAAA,EAC5B,EAED,GAAIA,EAAE,CAAC,CAAA,EAER"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PopoverProps as AriaPopoverProps, SelectProps as AriaSelectProps, SelectValueProps as AriaSelectValueProps } from 'react-aria-components';
|
|
2
|
-
import { FormFieldProps } from 'lib/components/
|
|
3
|
-
import { SelectOption } from 'lib/components/
|
|
4
|
-
import { ListBoxHeader, ListBoxItem } from '
|
|
2
|
+
import { FormFieldProps } from 'lib/components/field';
|
|
3
|
+
import { SelectOption } from 'lib/components/select-options';
|
|
4
|
+
import { ListBoxHeader, ListBoxItem } from './list-box';
|
|
5
5
|
export declare const SelectItem: typeof ListBoxItem;
|
|
6
6
|
export declare const SelectHeader: typeof ListBoxHeader;
|
|
7
7
|
export declare const SelectCollection: typeof import('react-aria-components').Collection;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as o,jsxs as c,Fragment as u}from"react/jsx-runtime";import{Select as p,composeRenderProps as i,SelectValue as f,ListBox as h}from"react-aria-components";import{Button as S}from"./button.js";import{FormField as g}from"./field.js";import{useFieldContext as x}from"../utils/form-context.js";import{getFieldErrorMessage as B,classNames as l}from"../utils/primitives.js";import{ChevronDown as N}from"lucide-react";import{ListBoxItem as v,ListBoxHeader as C,ListBoxCollection as w}from"./list-box.js";import{Popover as F}from"./popover.js";import"class-variance-authority";import"./loader.js";import"clsx";import"@tanstack/react-form";const L=p,_=v,G=C,J=w,P=({className:r,...t})=>o(f,{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(S,{...e,children:i(t,n=>c(u,{children:[n,o(N,{"aria-hidden":"true",className:"size-icon opacity-50"})]}))})}function j({className:r,...t}){return o(F,{className:i(r,e=>l("w-auto min-w-[--trigger-width]",e)),...t})}function y({className:r,...t}){return o(h,{className:i(r,e=>l("overflow-auto p-1 outline-none [clip-path:inset(0_0_0_0_round_calc(var(--radius)-2px))]",e)),...t})}function H({label:r,description:t,errorMessage:e,children:n,className:s,items:a,...m}){return o(L,{className:i(s,d=>l("group form-field",d)),...m,children:c(g,{label:r,description:t,errorMessage:e,children:[o(V,{children:o(P,{})}),o(j,{children:o(y,{items:a,children:n})})]})})}function O({...r}){const t=x();return o(H,{selectedKey:t.state.value,onSelectionChange:e=>t.handleChange(e.toString()),onBlur:t.handleBlur,errorMessage:B(t),...r,children:e=>o(_,{id:e.id,children:e.label},e.id)})}export{J as SelectCollection,G as SelectHeader,_ as SelectItem,j as SelectPopover,P as SelectValue,H as SingleSelect,O as TfSingleSelect};
|
|
2
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +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 \"lib/components/button\"\nimport { FormField, type FormFieldProps } from \"lib/components/field\"\nimport type { SelectOption } from \"lib/components/select-options\"\nimport { useFieldContext } from \"lib/utils/form-context\"\nimport { classNames, getFieldErrorMessage } from \"lib/utils/primitives\"\nimport { ChevronDown } from \"lucide-react\"\nimport {\n ListBoxCollection,\n ListBoxHeader,\n ListBoxItem,\n} 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>({\n className,\n ...props\n}: 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)\n\nfunction SelectTrigger({ className, children, ...props }: React.ComponentProps<typeof Button>) {\n return (\n <Button {...props}>\n {composeRenderProps(children, (children) => (\n <>\n {children}\n <ChevronDown aria-hidden=\"true\" className=\"size-icon opacity-50\" />\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>({\n className,\n ...props\n}: AriaListBoxProps<T>) {\n return (\n <AriaListBox\n className={composeRenderProps(className, (className) =>\n classNames(\n \"overflow-auto p-1 outline-none [clip-path:inset(0_0_0_0_round_calc(var(--radius)-2px))]\",\n className\n )\n )}\n {...props}\n />\n )\n}\n\nexport interface SingleSelectProps<T extends SelectOption> extends Omit<AriaSelectProps<T>, \"children\">, 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 items,\n ...props\n}: SingleSelectProps<T>) {\n return (\n <ASelect\n className={composeRenderProps(className, (className) =>\n classNames(\"group form-field\", className)\n )}\n {...props}\n >\n <FormField label={label} description={description} errorMessage={errorMessage}>\n <SelectTrigger>\n <SelectValue />\n </SelectTrigger>\n <SelectPopover>\n <SelectListBox items={items}>{children}</SelectListBox>\n </SelectPopover>\n </FormField>\n </ASelect>\n )\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>();\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) => <SelectItem id={item.id} key={item.id}>{item.label}</SelectItem>}\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","ChevronDown","SelectPopover","Popover","SelectListBox","AriaListBox","SingleSelect","label","description","errorMessage","items","FormField","TfSingleSelect","field","useFieldContext","getFieldErrorMessage","item"],"mappings":"8oBAyBA,MAAMA,EAAUC,EACHC,EAAaC,EACbC,EAAeC,EACfC,EAAmBC,EAEnBC,EAAc,CAAmB,CAC5C,UAAAC,EACA,GAAGC,CACL,IACEC,EAACC,EAAA,CACC,UAAWC,EAAmBJ,EAAYA,GACxCK,EACE,wDAEA,gCACAL,CAAA,CACF,EAED,GAAGC,CAAA,CACN,EAGF,SAASK,EAAc,CAAE,UAAAN,EAAW,SAAAO,EAAU,GAAGN,GAA8C,CAC7F,OACEC,EAACM,GAAQ,GAAGP,EACT,WAAmBM,EAAWA,GAC7BE,EAAAC,EAAA,CACG,SAAA,CAAAH,EACDL,EAACS,EAAA,CAAY,cAAY,OAAO,UAAU,sBAAA,CAAuB,CAAA,CAAA,CACnE,CACD,CAAA,CACH,CAEJ,CAEO,SAASC,EAAc,CAAE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ib/components/
|
|
1
|
+
import { Button } from 'lib/components/button';
|
|
2
|
+
import { Tooltip } from 'lib/components/tooltip';
|
|
3
3
|
type SidebarContextProps = {
|
|
4
4
|
state: "expanded" | "collapsed";
|
|
5
5
|
open: boolean;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as a,Fragment as I,jsxs as x}from"react/jsx-runtime";import{PanelLeftClose as D,PanelLeftOpen as T}from"lucide-react";import{Button as B}from"./button.js";import{DialogTrigger as O,DialogOverlay as E,DialogContent as R}from"./dialog.js";import{Skeleton as w}from"./skeleton.js";import{TooltipTrigger as A,Tooltip as L}from"./tooltip.js";import{classNames as r}from"../utils/primitives.js";import{useIsMobile as j}from"../utils/use-mobile.js";import{createContext as H,forwardRef as G,use as K,useState as S,useCallback as N,useEffect as P,useMemo as k}from"react";import"class-variance-authority";import"react-aria-components";import"./loader.js";import"clsx";const W="16rem",q="18rem",F="3rem",U="b",y=H(null);function h(){const t=K(y);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function se({defaultOpen:t=!0,open:e,onOpenChange:i,className:n,style:s,children:d,...c}){const l=j(),[p,b]=S(!1),[_,z]=S(t),f=e??_,m=N(o=>{const u=typeof o=="function"?o(f):o;i?i(u):z(u)},[i,f]),g=N(()=>l?b(o=>!o):m(o=>!o),[l,m,b]);P(()=>{const o=u=>{u.key===U&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),g())};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[g]);const v=f?"expanded":"collapsed",C=k(()=>({state:v,open:f,setOpen:m,isMobile:l,openMobile:p,setOpenMobile:b,toggleSidebar:g}),[v,f,m,l,p,b,g]);return a(y.Provider,{value:C,children:a("div",{style:{"--sidebar-width":W,"--sidebar-width-icon":F,...s},className:r("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar-background",n),...c,children:d})})}function de({side:t="left",variant:e="sidebar",collapsible:i="offcanvas",className:n,children:s,...d}){const{isMobile:c,state:l,openMobile:p,setOpenMobile:b}=h();return i==="none"?a("div",{className:r("flex h-full w-[--sidebar-width] flex-col bg-sidebar-background text-sidebar-foreground",n),...d,children:s}):c?a(O,{style:{"--sidebar-width":q},isOpen:p,onOpenChange:b,...d,children:a(E,{children:a(R,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] p-0 [&>button]:hidden",side:"right",children:()=>a(I,{children:s})})})}):x("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":l,"data-collapsible":l==="collapsed"?i:"","data-variant":e,"data-side":t,children:[a("div",{className:r("relative w-(--sidebar-width) bg-sidebar-background transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),a("div",{className:r("absolute z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...d,children:a("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar-background group-data-[variant=floating]:border group-data-[variant=floating]:border-border group-data-[variant=floating]:shadow",children:s})})]})}function le({className:t,onClick:e,...i}){const{toggleSidebar:n,open:s}=h();return a(B,{"data-sidebar":"trigger",variant:"neutral",size:"icon",onClick:d=>{e?.(d),n()},...i,children:s?a(D,{}):a(T,{})})}const V=G(({className:t,...e},i)=>{const{toggleSidebar:n}=h();return a("button",{ref:i,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:r("absolute inset-y-0 z-20 hidden w-icon -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-border group-data-[side=left]:-right-icon group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar-background","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...e})});V.displayName="SidebarRail";function ue({className:t,...e}){return a("main",{className:r("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",t),...e})}function ce({className:t,...e}){return a("div",{"data-sidebar":"header",className:r("flex flex-col gap-2 p-2",t),...e})}function be({className:t,...e}){return a("div",{"data-sidebar":"footer",className:r("flex flex-col gap-2 p-2",t),...e})}function fe({className:t,...e}){return a("div",{"data-sidebar":"content",className:r("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...e})}function pe({className:t,...e}){return a("div",{"data-sidebar":"group",className:r("relative flex w-full min-w-0 flex-col p-2",t),...e})}function me({className:t,...e}){return a("div",{"data-sidebar":"group-label",className:r("flex h-input shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-icon [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-input group-data-[collapsible=icon]:opacity-0",t),...e})}function ge({className:t,...e}){return a("button",{"data-sidebar":"group-action",className:r("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-ring transition-transform hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 [&>svg]:size-icon [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",t),...e})}function he({className:t,...e}){return a("div",{"data-sidebar":"group-content",className:r("w-full text-sm",t),...e})}function xe({className:t,...e}){return a("ul",{"data-sidebar":"menu",className:r("flex w-full min-w-0 flex-col gap-1",t),...e})}function ve({className:t,...e}){return a("li",{"data-sidebar":"menu-item",className:r("group/menu-item relative list-none",t),...e})}function we({className:t,showOnHover:e=!1,...i}){return a("button",{"data-sidebar":"menu-action",className:r("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-ring transition-transform hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-accent-foreground [&>svg]:size-icon [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-accent-foreground md:opacity-0",t),...i})}function Se({className:t,...e}){return a("div",{"data-sidebar":"menu-badge",className:r("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-accent-foreground peer-data-[active=true]/menu-button:text-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...e})}function Ne({className:t,showIcon:e=!1,...i}){const n=k(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return x("div",{"data-sidebar":"menu-skeleton",className:r("flex h-input items-center gap-2 px-2",t),...i,children:[e&&a(w,{className:"size-icon","data-sidebar":"menu-skeleton-icon"}),a(w,{className:"h-icon max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":n}})]})}function ke({className:t,...e}){return a("ul",{"data-sidebar":"menu-sub",className:r("mx-2 flex min-w-0 translate-x-px flex-col gap-1 border-l border-border px-2","group-data-[collapsible=icon]:hidden",t),...e})}function ye({className:t,...e}){return a("li",{className:r("list-none ms-0",t),...e})}const M="flex w-full items-center gap-2 truncate p-2 text-sm btn btn-ghost h-input text-accent data-[active=true]:bg-primary/20 data-[active=true]:font-medium data-[active=true]:text-primary [&>span:last-child]:truncate [&>svg]:size-icon [&>svg]:shrink-0";function Me({isActive:t=!1,tooltip:e,className:i,...n}){const{isMobile:s,state:d}=h(),c=a("button",{"data-sidebar":"menu-button","data-active":t,className:r("peer/menu-button group-has-[[data-sidebar=menu-action]]/menu-item:pr-input group-data-[collapsible=icon]:!size-icon group-data-[collapsible=icon]:!p-2 ",M,i),...n});return e?x(A,{children:[c,a(L,{hidden:d!=="collapsed"||s,...e})]}):c}function _e({isActive:t,className:e,...i}){return a("a",{"data-sidebar":"menu-sub-button","data-active":t,className:r("-translate-x-px [&>svg]:text-accent-foreground","group-data-[collapsible=icon]:hidden",M,e),...i})}export{de as Sidebar,fe as SidebarContent,y as SidebarContext,be as SidebarFooter,pe as SidebarGroup,ge as SidebarGroupAction,he as SidebarGroupContent,me as SidebarGroupLabel,ce as SidebarHeader,ue as SidebarInset,xe as SidebarMenu,we as SidebarMenuAction,Se as SidebarMenuBadge,Me as SidebarMenuButton,ve as SidebarMenuItem,Ne as SidebarMenuSkeleton,ke as SidebarMenuSub,_e as SidebarMenuSubButton,ye as SidebarMenuSubItem,se as SidebarProvider,V as SidebarRail,le as SidebarTrigger,h as useSidebar};
|
|
2
|
+
//# sourceMappingURL=sidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar.js","sources":["../../lib/components/sidebar.tsx"],"sourcesContent":["\"use client\"\nimport { PanelLeftClose, PanelLeftOpen } from \"lucide-react\"\n\nimport { Button } from \"lib/components/button\"\nimport { DialogContent, DialogOverlay, DialogTrigger } from \"lib/components/dialog\"\nimport { Skeleton } from \"lib/components/skeleton\"\nimport { Tooltip, TooltipTrigger } from \"lib/components/tooltip\"\nimport { classNames } from \"lib/utils/primitives\"\nimport { useIsMobile } from \"lib/utils/use-mobile\"\nimport { createContext, forwardRef, use, useCallback, useEffect, useMemo, useState } from \"react\"\n\n// TODO use tailwind variables\nconst SIDEBAR_WIDTH = \"16rem\"\nconst SIDEBAR_WIDTH_MOBILE = \"18rem\"\nconst SIDEBAR_WIDTH_ICON = \"3rem\"\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\"\n\ntype SidebarContextProps = {\n\tstate: \"expanded\" | \"collapsed\"\n\topen: boolean\n\tsetOpen: (open: boolean) => void\n\topenMobile: boolean\n\tsetOpenMobile: (open: boolean) => void\n\tisMobile: boolean\n\ttoggleSidebar: () => void\n}\n\nexport const SidebarContext = createContext<SidebarContextProps | null>(null)\n\nexport function useSidebar() {\n\tconst context = use(SidebarContext)\n\tif (!context) {\n\t\tthrow new Error(\"useSidebar must be used within a SidebarProvider.\")\n\t}\n\n\treturn context\n}\n\nexport function SidebarProvider(\n\t{\n\t\tdefaultOpen = true,\n\t\topen: openProp,\n\t\tonOpenChange: setOpenProp,\n\t\tclassName,\n\t\tstyle,\n\t\tchildren,\n\t\t...props\n\t}: React.ComponentProps<'div'> & {\n\t\tdefaultOpen?: boolean\n\t\topen?: boolean\n\t\tonOpenChange?: (open: boolean) => void\n\t}) {\n\tconst isMobile = useIsMobile()\n\tconst [openMobile, setOpenMobile] = useState(false)\n\n\t// This is the internal state of the sidebar.\n\t// We use openProp and setOpenProp for control from outside the component.\n\tconst [_open, _setOpen] = useState(defaultOpen)\n\tconst open = openProp ?? _open\n\tconst setOpen = useCallback(\n\t\t(value: boolean | ((value: boolean) => boolean)) => {\n\t\t\tconst openState = typeof value === \"function\" ? value(open) : value\n\t\t\tif (setOpenProp) {\n\t\t\t\tsetOpenProp(openState)\n\t\t\t} else {\n\t\t\t\t_setOpen(openState)\n\t\t\t}\n\n\t\t\t// TODO, use different model for persistence\n\t\t\t// This sets the cookie to keep the sidebar state.\n\t\t\t// document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`\n\t\t},\n\t\t[setOpenProp, open]\n\t)\n\n\t// Helper to toggle the sidebar.\n\tconst toggleSidebar = useCallback(() => {\n\t\treturn isMobile\n\t\t\t? setOpenMobile((open) => !open)\n\t\t\t: setOpen((open) => !open)\n\t}, [isMobile, setOpen, setOpenMobile])\n\n\t// Adds a keyboard shortcut to toggle the sidebar.\n\tuseEffect(() => {\n\t\tconst handleKeyDown = (event: KeyboardEvent) => {\n\t\t\tif (\n\t\t\t\tevent.key === SIDEBAR_KEYBOARD_SHORTCUT &&\n\t\t\t\t(event.metaKey || event.ctrlKey)\n\t\t\t) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\ttoggleSidebar()\n\t\t\t}\n\t\t}\n\n\t\twindow.addEventListener(\"keydown\", handleKeyDown)\n\t\treturn () => window.removeEventListener(\"keydown\", handleKeyDown)\n\t}, [toggleSidebar])\n\n\t// We add a state so that we can do data-state=\"expanded\" or \"collapsed\".\n\t// This makes it easier to style the sidebar with Tailwind classes.\n\tconst state = open ? \"expanded\" : \"collapsed\"\n\n\tconst contextValue = useMemo<SidebarContextProps>(\n\t\t() => ({\n\t\t\tstate,\n\t\t\topen,\n\t\t\tsetOpen,\n\t\t\tisMobile,\n\t\t\topenMobile,\n\t\t\tsetOpenMobile,\n\t\t\ttoggleSidebar,\n\t\t}),\n\t\t[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]\n\t)\n\n\treturn (\n\t\t<SidebarContext.Provider value={contextValue}>\n\t\t\t<div\n\t\t\t\tstyle={\n\t\t\t\t\t{\n\t\t\t\t\t\t\"--sidebar-width\": SIDEBAR_WIDTH,\n\t\t\t\t\t\t\"--sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\n\t\t\t\t\t\t...style,\n\t\t\t\t\t} as React.CSSProperties\n\t\t\t\t}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t\"group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar-background\",\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</SidebarContext.Provider>\n\t)\n}\n\n\nexport function Sidebar(\n\t{\n\t\tside = \"left\",\n\t\tvariant = \"sidebar\",\n\t\tcollapsible = \"offcanvas\",\n\t\tclassName,\n\t\tchildren,\n\t\t...props\n\t}: React.ComponentProps<\"div\"> & {\n\t\tside?: \"left\" | \"right\"\n\t\tvariant?: \"sidebar\" | \"floating\" | \"inset\"\n\t\tcollapsible?: \"offcanvas\" | \"icon\" | \"none\"\n\t}\n) {\n\tconst { isMobile, state, openMobile, setOpenMobile } = useSidebar()\n\n\tif (collapsible === \"none\") {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t\"flex h-full w-[--sidebar-width] flex-col bg-sidebar-background text-sidebar-foreground\",\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t)\n\t}\n\n\tif (isMobile) {\n\t\treturn (\n\t\t\t<DialogTrigger style={{ \"--sidebar-width\": SIDEBAR_WIDTH_MOBILE, } as React.CSSProperties} isOpen={openMobile} onOpenChange={setOpenMobile} {...props} >\n\t\t\t\t<DialogOverlay>\n\t\t\t\t\t<DialogContent\n\t\t\t\t\t\tdata-sidebar=\"sidebar\"\n\t\t\t\t\t\tdata-mobile=\"true\"\n\t\t\t\t\t\tclassName=\"w-[--sidebar-width] p-0 [&>button]:hidden\" side=\"right\">\n\t\t\t\t\t\t{() => (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</DialogContent>\n\t\t\t\t</DialogOverlay>\n\t\t\t</DialogTrigger>\n\t\t)\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"group peer hidden text-sidebar-foreground md:block\"\n\t\t\tdata-state={state}\n\t\t\tdata-collapsible={state === \"collapsed\" ? collapsible : \"\"}\n\t\t\tdata-variant={variant}\n\t\t\tdata-side={side}\n\t\t>\n\t\t\t{/* This is what handles the sidebar gap on desktop */}\n\t\t\t<div\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t\"relative w-(--sidebar-width) bg-sidebar-background transition-[width] duration-200 ease-linear\",\n\t\t\t\t\t\"group-data-[collapsible=offcanvas]:w-0\",\n\t\t\t\t\t\"group-data-[side=right]:rotate-180\",\n\t\t\t\t\tvariant === \"floating\" || variant === \"inset\"\n\t\t\t\t\t\t? \"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]\"\n\t\t\t\t\t\t: \"group-data-[collapsible=icon]:w-[--sidebar-width-icon]\"\n\t\t\t\t)}\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t\"absolute z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex\",\n\t\t\t\t\tside === \"left\"\n\t\t\t\t\t\t? \"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]\"\n\t\t\t\t\t\t: \"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]\",\n\t\t\t\t\t// Adjust the padding for floating and inset variants.\n\t\t\t\t\tvariant === \"floating\" || variant === \"inset\"\n\t\t\t\t\t\t? \"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]\"\n\t\t\t\t\t\t: \"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l\",\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tdata-sidebar=\"sidebar\"\n\t\t\t\t\tclassName=\"flex h-full w-full flex-col bg-sidebar-background group-data-[variant=floating]:border group-data-[variant=floating]:border-border group-data-[variant=floating]:shadow\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n\n\n\nexport function SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>) {\n\tconst { toggleSidebar, open } = useSidebar()\n\n\treturn (\n\t\t<Button\n\t\t\tdata-sidebar=\"trigger\"\n\t\t\tvariant=\"neutral\"\n\t\t\tsize=\"icon\"\n\t\t\tonClick={(event) => {\n\t\t\t\tonClick?.(event)\n\t\t\t\ttoggleSidebar()\n\t\t\t}}\n\t\t\t{...props}\n\t\t>{open ? <PanelLeftClose /> : <PanelLeftOpen />}</Button>\n\t)\n}\n\n// TODO, evaluate if we need this??\nexport const SidebarRail = forwardRef<\n\tHTMLButtonElement,\n\tReact.ComponentProps<\"button\">\n>(({ className, ...props }, ref) => {\n\tconst { toggleSidebar } = useSidebar()\n\n\treturn (\n\t\t<button\n\t\t\tref={ref}\n\t\t\tdata-sidebar=\"rail\"\n\t\t\taria-label=\"Toggle Sidebar\"\n\t\t\ttabIndex={-1}\n\t\t\tonClick={toggleSidebar}\n\t\t\ttitle=\"Toggle Sidebar\"\n\t\t\tclassName={classNames(\n\t\t\t\t\"absolute inset-y-0 z-20 hidden w-icon -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-border group-data-[side=left]:-right-icon group-data-[side=right]:left-0 sm:flex\",\n\t\t\t\t\"[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize\",\n\t\t\t\t\"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize\",\n\t\t\t\t\"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar-background\",\n\t\t\t\t\"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2\",\n\t\t\t\t\"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2\",\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n})\nSidebarRail.displayName = \"SidebarRail\"\n\nexport function SidebarInset({ className, ...props }: React.ComponentProps<'main'>) {\n\treturn (\n\t\t<main\n\t\t\tclassName={classNames(\n\t\t\t\t\"relative flex w-full flex-1 flex-col bg-background\",\n\t\t\t\t\"md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow\",\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\n\nexport function SidebarHeader({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\n\t\t\tdata-sidebar=\"header\"\n\t\t\tclassName={classNames(\"flex flex-col gap-2 p-2\", className)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function SidebarFooter({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"footer\"\n\t\t\tclassName={classNames(\"flex flex-col gap-2 p-2\", className)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function SidebarContent({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"content\"\n\t\t\tclassName={classNames(\n\t\t\t\t\"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden\",\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function SidebarGroup({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"group\"\n\t\t\tclassName={classNames(\"relative flex w-full min-w-0 flex-col p-2\", className)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\n\nexport function SidebarGroupLabel({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"group-label\"\n\t\t\tclassName={classNames(\n\t\t\t\t\"flex h-input shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-icon [&>svg]:shrink-0\",\n\t\t\t\t\"group-data-[collapsible=icon]:-mt-input group-data-[collapsible=icon]:opacity-0\",\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\nexport function SidebarGroupAction({ className, ...props }: React.ComponentProps<\"button\">) {\n\treturn (\n\t\t<button\n\t\t\tdata-sidebar=\"group-action\"\n\t\t\tclassName={classNames(\n\t\t\t\t\"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-ring transition-transform hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 [&>svg]:size-icon [&>svg]:shrink-0\",\n\t\t\t\t// Increases the hit area of the button on mobile.\n\t\t\t\t\"after:absolute after:-inset-2 after:md:hidden\",\n\t\t\t\t\"group-data-[collapsible=icon]:hidden\",\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function SidebarGroupContent({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"group-content\"\n\t\t\tclassName={classNames(\"w-full text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function SidebarMenu({ className, ...props }: React.ComponentProps<'ul'>) {\n\treturn (\n\t\t<ul\n\t\t\tdata-sidebar=\"menu\"\n\t\t\tclassName={classNames(\"flex w-full min-w-0 flex-col gap-1\", className)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function SidebarMenuItem({ className, ...props }: React.ComponentProps<'li'>) {\n\treturn (\n\t\t<li\n\t\t\tdata-sidebar=\"menu-item\"\n\t\t\tclassName={classNames(\"group/menu-item relative list-none\", className)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\n/// TODO fix positioning\nexport function SidebarMenuAction({ className, showOnHover = false, ...props }: React.ComponentProps<\"button\"> & {\n\tshowOnHover?: boolean\n}) {\n\n\treturn (\n\t\t<button\n\t\t\tdata-sidebar=\"menu-action\"\n\t\t\tclassName={classNames(\n\t\t\t\t\"absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-ring transition-transform hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-accent-foreground [&>svg]:size-icon [&>svg]:shrink-0\",\n\t\t\t\t// Increases the hit area of the button on mobile.\n\t\t\t\t\"after:absolute after:-inset-2 after:md:hidden\",\n\t\t\t\t\"peer-data-[size=sm]/menu-button:top-1\",\n\t\t\t\t\"peer-data-[size=default]/menu-button:top-1.5\",\n\t\t\t\t\"peer-data-[size=lg]/menu-button:top-2.5\",\n\t\t\t\t\"group-data-[collapsible=icon]:hidden\",\n\t\t\t\tshowOnHover &&\n\t\t\t\t\"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-accent-foreground md:opacity-0\",\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function SidebarMenuBadge({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"menu-badge\"\n\t\t\tclassName={classNames(\n\t\t\t\t\"pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground\",\n\t\t\t\t\"peer-hover/menu-button:text-accent-foreground peer-data-[active=true]/menu-button:text-accent-foreground\",\n\t\t\t\t\"peer-data-[size=sm]/menu-button:top-1\",\n\t\t\t\t\"peer-data-[size=default]/menu-button:top-1.5\",\n\t\t\t\t\"peer-data-[size=lg]/menu-button:top-2.5\",\n\t\t\t\t\"group-data-[collapsible=icon]:hidden\",\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function SidebarMenuSkeleton({ className, showIcon = false, ...props }: React.ComponentProps<\"div\"> & {\n\tshowIcon?: boolean\n}) {\n\t// Random width between 50 to 90%.\n\tconst width = useMemo(() => {\n\t\treturn `${Math.floor(Math.random() * 40) + 50}%`\n\t}, [])\n\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"menu-skeleton\"\n\t\t\tclassName={classNames(\"flex h-input items-center gap-2 px-2\", className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{showIcon && (\n\t\t\t\t<Skeleton\n\t\t\t\t\tclassName=\"size-icon\"\n\t\t\t\t\tdata-sidebar=\"menu-skeleton-icon\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<Skeleton\n\t\t\t\tclassName=\"h-icon max-w-[--skeleton-width] flex-1\"\n\t\t\t\tdata-sidebar=\"menu-skeleton-text\"\n\t\t\t\tstyle={\n\t\t\t\t\t{\n\t\t\t\t\t\t\"--skeleton-width\": width,\n\t\t\t\t\t} as React.CSSProperties\n\t\t\t\t}\n\t\t\t/>\n\t\t</div>\n\t)\n}\n\nexport function SidebarMenuSub({ className, ...props }: React.ComponentProps<'ul'>) {\n\treturn (\n\t\t<ul\n\t\t\tdata-sidebar=\"menu-sub\"\n\t\t\tclassName={classNames(\n\t\t\t\t\"mx-2 flex min-w-0 translate-x-px flex-col gap-1 border-l border-border px-2\",\n\t\t\t\t\"group-data-[collapsible=icon]:hidden\",\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<'li'>) { return <li className={classNames(\"list-none ms-0\", className)} {...props} /> }\n\n// Common interaction logic for SidebarMenuButton and SidebarMenuSubButton\nconst Cs_SidebarButton = \"flex w-full items-center gap-2 truncate p-2 text-sm btn btn-ghost h-input text-accent data-[active=true]:bg-primary/20 data-[active=true]:font-medium data-[active=true]:text-primary [&>span:last-child]:truncate [&>svg]:size-icon [&>svg]:shrink-0\";\nexport function SidebarMenuButton\n\t(\n\t\t{\n\t\t\tisActive = false,\n\t\t\ttooltip,\n\t\t\tclassName,\n\t\t\t...props\n\t\t}: React.ComponentProps<\"button\"> & {\n\t\t\tisActive?: boolean\n\t\t\ttooltip?: React.ComponentProps<typeof Tooltip>\n\t\t}\n\t) {\n\tconst { isMobile, state } = useSidebar()\n\n\tconst button = (\n\t\t<button\n\t\t\tdata-sidebar=\"menu-button\"\n\t\t\tdata-active={isActive}\n\t\t\tclassName={classNames(\n\t\t\t\t\"peer/menu-button group-has-[[data-sidebar=menu-action]]/menu-item:pr-input group-data-[collapsible=icon]:!size-icon group-data-[collapsible=icon]:!p-2 \",\n\t\t\t\tCs_SidebarButton,\n\t\t\t\tclassName)}\n\t\t\t{...props}\n\t\t/>\n\t)\n\n\tif (!tooltip) {\n\t\treturn button\n\t}\n\n\treturn (\n\t\t<TooltipTrigger>\n\t\t\t{button}\n\t\t\t<Tooltip\n\t\t\t\thidden={state !== \"collapsed\" || isMobile}\n\t\t\t\t{...tooltip}\n\t\t\t/>\n\t\t</TooltipTrigger>\n\t)\n}\n\nexport function SidebarMenuSubButton({ isActive, className, ...props }: React.ComponentProps<'a'> & {\n\tisActive?: boolean\n}) {\n\n\treturn (\n\t\t<a\n\t\t\tdata-sidebar=\"menu-sub-button\"\n\t\t\tdata-active={isActive}\n\t\t\tclassName={classNames(\n\t\t\t\t\"-translate-x-px [&>svg]:text-accent-foreground\",\n\t\t\t\t\"group-data-[collapsible=icon]:hidden\",\n\t\t\t\tCs_SidebarButton,\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n// TODO, standardize heights here"],"names":["SIDEBAR_WIDTH","SIDEBAR_WIDTH_MOBILE","SIDEBAR_WIDTH_ICON","SIDEBAR_KEYBOARD_SHORTCUT","SidebarContext","createContext","useSidebar","context","use","SidebarProvider","defaultOpen","openProp","setOpenProp","className","style","children","props","isMobile","useIsMobile","openMobile","setOpenMobile","useState","_open","_setOpen","open","setOpen","useCallback","value","openState","toggleSidebar","useEffect","handleKeyDown","event","state","contextValue","useMemo","jsx","classNames","Sidebar","side","variant","collapsible","DialogTrigger","DialogOverlay","DialogContent","jsxs","SidebarTrigger","onClick","Button","PanelLeftClose","PanelLeftOpen","SidebarRail","forwardRef","ref","SidebarInset","SidebarHeader","SidebarFooter","SidebarContent","SidebarGroup","SidebarGroupLabel","SidebarGroupAction","SidebarGroupContent","SidebarMenu","SidebarMenuItem","SidebarMenuAction","showOnHover","SidebarMenuBadge","SidebarMenuSkeleton","showIcon","width","Skeleton","SidebarMenuSub","SidebarMenuSubItem","Cs_SidebarButton","SidebarMenuButton","isActive","tooltip","button","TooltipTrigger","Tooltip","SidebarMenuSubButton"],"mappings":"4qBAYA,MAAMA,EAAgB,QAChBC,EAAuB,QACvBC,EAAqB,OACrBC,EAA4B,IAYrBC,EAAiBC,EAA0C,IAAI,EAErE,SAASC,GAAa,CAC5B,MAAMC,EAAUC,EAAIJ,CAAc,EAClC,GAAI,CAACG,EACJ,MAAM,IAAI,MAAM,mDAAmD,EAGpE,OAAOA,CACR,CAEO,SAASE,GACf,CACC,YAAAC,EAAc,GACd,KAAMC,EACN,aAAcC,EACd,UAAAC,EACA,MAAAC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b,cAAauC,EACb,UAAWtC,EACV,iDACA,uCACAoC,EACA5D,CAAA,EAEA,GAAGG,CAAA,CAAA,CAGP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.js","sources":["../../lib/components/skeleton.tsx"],"sourcesContent":["import { classNames } from \"lib/utils/primitives\";\n\nexport function Skeleton({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div className={classNames(\"animate-pulse bg-primary/10\", className)} {...props} />\n\t);\n}\n"],"names":["Skeleton","className","props","jsx","classNames"],"mappings":"yGAEO,SAASA,EAAS,CAAE,UAAAC,EAAW,GAAGC,GAAsC,CAC9E,OACCC,EAAC,OAAI,UAAWC,EAAW,8BAA+BH,CAAS,EAAI,GAAGC,EAAO,CAEnF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sonner.js","sources":["../../lib/components/sonner.tsx"],"sourcesContent":["\"use client\";\nimport { Toaster as Sonner } from \"sonner\";\n\ntype ToasterProps = React.ComponentProps<typeof Sonner>;\n\nexport function Toaster({ ...props }: ToasterProps) {\n\treturn (\n\t\t<Sonner\n\t\t\tclassName=\"toaster group\"\n\t\t\ttoastOptions={{\n\t\t\t\tclassNames: {\n\t\t\t\t\ttoast:\n\t\t\t\t\t\t\"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg\",\n\t\t\t\t\tdescription: \"group-[.toast]:text-muted-foreground\",\n\t\t\t\t\tactionButton:\n\t\t\t\t\t\t\"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground\",\n\t\t\t\t\tcancelButton:\n\t\t\t\t\t\t\"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground\",\n\t\t\t\t},\n\t\t\t}}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n\n\n"],"names":["Toaster","props","jsx","Sonner"],"mappings":"sFAKO,SAASA,EAAQ,CAAE,GAAGC,GAAuB,CACnD,OACCC,EAACC,EAAA,CACA,UAAU,gBACV,aAAc,CACb,WAAY,CACX,MACC,wIACD,YAAa,uCACb,aACC,mEACD,aACC,8DAAA,CACF,EAEA,GAAGF,CAAA,CAAA,CAGP"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{classNames as o}from"../utils/primitives.js";import"clsx";function s({className:t,...e}){return r("table",{className:o("caption-bottom text-sm [&_tr:last-child]:border-0 my-0 whitespace-nowrap",t),...e})}function d({className:t,...e}){return r("thead",{className:o("[&_tr]:border-b border-b",t),...e})}function m({className:t,...e}){return r("tbody",{className:o(t),...e})}function b({className:t,...e}){return r("tfoot",{className:o("border-t font-medium last:[&>tr]:border-b-0",t),...e})}function c({className:t,...e}){return r("tr",{className:o("border-b border-border",t),...e})}function i({className:t,...e}){return r("th",{className:o("text-left align-middle font-medium",t),...e})}function u({className:t,...e}){return r("td",{className:o("[&_tr:last-child]:border-dotted",t),...e})}function f({className:t,...e}){return r("caption",{className:o("mt-icon text-sm text-muted-foreground",t),...e})}export{s as Table,m as TableBody,f as TableCaption,u as TableCell,b as TableFooter,i as TableHead,d as TableHeader,c as TableRow};
|
|
2
|
+
//# sourceMappingURL=table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.js","sources":["../../lib/components/table.tsx"],"sourcesContent":["import { classNames } from \"lib/utils/primitives\";\n\nexport function Table({ className, ...props }: React.ComponentProps<\"table\">) {\n\treturn (\n\t\t<table\n\t\t\tclassName={classNames(\n\t\t\t\t\"caption-bottom text-sm [&_tr:last-child]:border-0 my-0 whitespace-nowrap\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function TableHeader({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"thead\">) {\n\treturn (\n\t\t<thead\n\t\t\tclassName={classNames(\"[&_tr]:border-b border-b\", className)} // Added border-b to apply a bottom border\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function TableBody({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"tbody\">) {\n\treturn <tbody className={classNames(className)} {...props} />;\n}\n\nexport function TableFooter({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"tfoot\">) {\n\treturn (\n\t\t<tfoot\n\t\t\tclassName={classNames(\"border-t font-medium last:[&>tr]:border-b-0\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function TableRow({ className, ...props }: React.ComponentProps<\"tr\">) {\n\treturn <tr className={classNames(\"border-b border-border\", className)} {...props} />;\n}\n\nexport function TableHead({ className, ...props }: React.ComponentProps<\"th\">) {\n\treturn (\n\t\t<th\n\t\t\tclassName={classNames(\"text-left align-middle font-medium\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function TableCell({ className, ...props }: React.ComponentProps<\"td\">) {\n\treturn (\n\t\t<td\n\t\t\tclassName={classNames(\"[&_tr:last-child]:border-dotted\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function TableCaption({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"caption\">) {\n\treturn (\n\t\t<caption\n\t\t\tclassName={classNames(\"mt-icon text-sm text-muted-foreground\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n"],"names":["Table","className","props","jsx","classNames","TableHeader","TableBody","TableFooter","TableRow","TableHead","TableCell","TableCaption"],"mappings":"yGAEO,SAASA,EAAM,CAAE,UAAAC,EAAW,GAAGC,GAAwC,CAC7E,OACCC,EAAC,QAAA,CACA,UAAWC,EACV,2EACAH,CAAA,EAEA,GAAGC,CAAA,CAAA,CAGP,CAEO,SAASG,EAAY,CAC3B,UAAAJ,EACA,GAAGC,CACJ,EAAkC,CACjC,OACCC,EAAC,QAAA,CACA,UAAWC,EAAW,2BAA4BH,CAAS,EAC1D,GAAGC,CAAA,CAAA,CAGP,CAEO,SAASI,EAAU,CACzB,UAAAL,EACA,GAAGC,CACJ,EAAkC,CACjC,SAAQ,QAAA,CAAM,UAAWE,EAAWH,CAAS,EAAI,GAAGC,EAAO,CAC5D,CAEO,SAASK,EAAY,CAC3B,UAAAN,EACA,GAAGC,CACJ,EAAkC,CACjC,OACCC,EAAC,QAAA,CACA,UAAWC,EAAW,8CAA+CH,CAAS,EAC7E,GAAGC,CAAA,CAAA,CAGP,CAEO,SAASM,EAAS,CAAE,UAAAP,EAAW,GAAGC,GAAqC,CAC7E,OAAOC,EAAC,MAAG,UAAWC,EAAW,yBAA0BH,CAAS,EAAI,GAAGC,EAAO,CACnF,CAEO,SAASO,EAAU,CAAE,UAAAR,EAAW,GAAGC,GAAqC,CAC9E,OACCC,EAAC,KAAA,CACA,UAAWC,EAAW,qCAAsCH,CAAS,EACpE,GAAGC,CAAA,CAAA,CAGP,CAEO,SAASQ,EAAU,CAAE,UAAAT,EAAW,GAAGC,GAAqC,CAC9E,OACCC,EAAC,KAAA,CACA,UAAWC,EAAW,kCAAmCH,CAAS,EACjE,GAAGC,CAAA,CAAA,CAGP,CAEO,SAASS,EAAa,CAC5B,UAAAV,EACA,GAAGC,CACJ,EAAoC,CACnC,OACCC,EAAC,UAAA,CACA,UAAWC,EAAW,wCAAyCH,CAAS,EACvE,GAAGC,CAAA,CAAA,CAGP"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as n}from"react/jsx-runtime";import{Tabs as i,composeRenderProps as r,TabList as s,Tab as l,TabPanel as c}from"react-aria-components";import{classNames as o}from"../utils/primitives.js";import"clsx";function d({className:t,...a}){return n(i,{className:r(t,e=>o("group flex flex-col gap-2","data-[orientation=vertical]:flex-row",e)),...a})}function p({className:t,...a}){return n(s,{className:r(t,e=>o("inline-flex items-center border-b text-muted-foreground","data-[orientation=vertical]:h-auto data-[orientation=vertical]:flex-col",e)),...a})}function x({className:t,...a}){return n(l,{className:r(t,e=>o("btn btn-ghost leading-none text-accent h-input truncate inline-flex items-center px-3 body font-medium transition-all","data-[selected]:bg-primary/20 data-[selected]:text-primary","group-data-[orientation=vertical]:w-full",e)),...a})}function T({className:t,...a}){return n(c,{className:r(t,e=>o("ring-offset-background","focus-ring",e)),...a})}export{x as Tab,p as TabList,T as TabPanel,d as Tabs};
|
|
2
|
+
//# sourceMappingURL=tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.js","sources":["../../lib/components/tabs.tsx"],"sourcesContent":["\"use client\"\nimport {\n Tab as AriaTab,\n TabList as AriaTabList,\n TabListProps as AriaTabListProps,\n TabPanel as AriaTabPanel,\n TabPanelProps as AriaTabPanelProps,\n TabProps as AriaTabProps,\n Tabs as AriaTabs,\n TabsProps as AriaTabsProps,\n composeRenderProps,\n} from \"react-aria-components\"\n\nimport { classNames } from \"lib/utils/primitives\"\n\nexport function Tabs({ className, ...props }: AriaTabsProps) {\n return (\n <AriaTabs\n className={composeRenderProps(className, (className) =>\n classNames(\n \"group flex flex-col gap-2\",\n /* Orientation */\n \"data-[orientation=vertical]:flex-row\",\n className\n )\n )}\n {...props}\n />\n )\n}\n\nexport function TabList<T extends object>({\n className,\n ...props\n}: AriaTabListProps<T>) {\n return (\n <AriaTabList\n className={composeRenderProps(className, (className) =>\n classNames(\n \"inline-flex items-center border-b text-muted-foreground\",\n /* Orientation */\n \"data-[orientation=vertical]:h-auto data-[orientation=vertical]:flex-col\",\n className\n )\n )}\n {...props}\n />\n )\n}\n\nexport function Tab({ className, ...props }: AriaTabProps) {\n return (\n <AriaTab\n className={composeRenderProps(className, (className) =>\n classNames(\n \"btn btn-ghost leading-none text-accent h-input truncate inline-flex items-center px-3 body font-medium transition-all\",\n /* Selected */\n \"data-[selected]:bg-primary/20 data-[selected]:text-primary\",\n /* Orientation */\n \"group-data-[orientation=vertical]:w-full\",\n className\n )\n )}\n {...props}\n />\n )\n}\n\nexport function TabPanel({ className, ...props }: AriaTabPanelProps) {\n return (\n <AriaTabPanel\n className={composeRenderProps(className, (className) =>\n classNames(\n \"ring-offset-background\",\n /* Focus Visible */\n \"focus-ring\",\n className\n )\n )}\n {...props}\n />\n )\n}"],"names":["Tabs","className","props","jsx","AriaTabs","composeRenderProps","classNames","TabList","AriaTabList","Tab","AriaTab","TabPanel","AriaTabPanel"],"mappings":"+NAeO,SAASA,EAAK,CAAE,UAAAC,EAAW,GAAGC,GAAwB,CAC3D,OACEC,EAACC,EAAA,CACC,UAAWC,EAAmBJ,EAAYA,GACxCK,EACE,4BAEA,uCACAL,CAAA,CACF,EAED,GAAGC,CAAA,CAAA,CAGV,CAEO,SAASK,EAA0B,CACxC,UAAAN,EACA,GAAGC,CACL,EAAwB,CACtB,OACEC,EAACK,EAAA,CACC,UAAWH,EAAmBJ,EAAYA,GACxCK,EACE,0DAEA,0EACAL,CAAA,CACF,EAED,GAAGC,CAAA,CAAA,CAGV,CAEO,SAASO,EAAI,CAAE,UAAAR,EAAW,GAAGC,GAAuB,CACzD,OACEC,EAACO,EAAA,CACC,UAAWL,EAAmBJ,EAAYA,GACxCK,EACE,wHAEA,6DAEA,2CACAL,CAAA,CACF,EAED,GAAGC,CAAA,CAAA,CAGV,CAEO,SAASS,EAAS,CAAE,UAAAV,EAAW,GAAGC,GAA4B,CACnE,OACEC,EAACS,EAAA,CACC,UAAWP,EAAmBJ,EAAYA,GACxCK,EACE,yBAEA,aACAL,CAAA,CACF,EAED,GAAGC,CAAA,CAAA,CAGV"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{TextField as u,composeRenderProps as i,TextArea as f,Input as p}from"react-aria-components";import{useFieldContext as c}from"../utils/form-context.js";import{getFieldErrorMessage as d,classNames as n}from"../utils/primitives.js";import{FormField as g}from"./field.js";import"@tanstack/react-form";import"clsx";import"class-variance-authority";import"lucide-react";const x=u;function b({className:r,...t}){return o(p,{className:i(r,e=>n("flex input-dim w-full border border-input bg-card ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","disabled-muted","focus-ring",e)),...t})}function h({className:r,...t}){return o(f,{className:i(r,e=>n("flex min-h-32 w-full border border-input bg-card px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground","focus-ring","disabled-muted",e)),...t})}function F({label:r,description:t,errorMessage:e,textArea:l,className:a,...s}){return o(x,{className:i(a,m=>n("group form-field",m)),...s,children:o(g,{label:r,errorMessage:e,description:t,children:l?o(h,{}):o(b,{})})})}function B({isDisabled:r,...t}){const e=c();return o(F,{isDisabled:r||e.form.state.isSubmitting,value:e.state.value,id:e.name,name:e.name,onBlur:e.handleBlur,onChange:e.handleChange,isInvalid:!!d(e),errorMessage:d(e),...t})}export{F as TextField,B as TfTextField};
|
|
2
|
+
//# sourceMappingURL=textfield.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textfield.js","sources":["../../lib/components/textfield.tsx"],"sourcesContent":["import {\n Input as AriaInput,\n InputProps as AriaInputProps,\n TextArea as AriaTextArea,\n TextAreaProps as AriaTextAreaProps,\n TextField as AriaTextField,\n TextFieldProps as AriaTextFieldProps,\n composeRenderProps\n} from \"react-aria-components\"\n\n\nimport { useFieldContext } from \"lib/utils/form-context\"\nimport { classNames, getFieldErrorMessage } from \"lib/utils/primitives\"\nimport { FormField, type FormFieldProps } from \"./field\"\n\nconst ATextField = AriaTextField\n\nfunction Input({ className, ...props }: AriaInputProps) {\n return (\n <AriaInput\n className={composeRenderProps(className, (className) =>\n classNames(\n \"flex input-dim w-full border border-input bg-card ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground\",\n /* Disabled */\n \"disabled-muted\",\n /* Focused */\n \"focus-ring\",\n className\n )\n )}\n {...props}\n />\n )\n}\n\nfunction TextArea({ className, ...props }: AriaTextAreaProps) {\n return (\n <AriaTextArea\n className={composeRenderProps(className, (className) =>\n classNames(\n \"flex min-h-32 w-full border border-input bg-card px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground\",\n /* Focused */\n \"focus-ring\",\n /* Disabled */\n \"disabled-muted\",\n className\n )\n )}\n {...props}\n />\n )\n}\n\nexport interface TextFieldProps extends AriaTextFieldProps, FormFieldProps {\n textArea?: boolean\n}\n\nexport function TextField({\n label,\n description,\n errorMessage,\n textArea,\n className,\n ...props\n}: TextFieldProps) {\n return (\n <ATextField\n className={composeRenderProps(className, (className) =>\n classNames(\"group form-field\", className)\n )}\n {...props}\n >\n <FormField label={label} errorMessage={errorMessage} description={description}>\n {textArea ? <TextArea /> : <Input />}\n </FormField>\n </ATextField>\n )\n}\n\nexport function TfTextField({ isDisabled, ...props }: React.ComponentProps<typeof TextField>) {\n const field = useFieldContext<string>();\n\n return (\n <TextField\n isDisabled={isDisabled || field.form.state.isSubmitting}\n value={field.state.value}\n id={field.name}\n name={field.name}\n onBlur={field.handleBlur}\n onChange={field.handleChange}\n isInvalid={!!getFieldErrorMessage(field)}\n errorMessage={getFieldErrorMessage(field)}\n {...props} />)\n}\n\n\n"],"names":["ATextField","AriaTextField","Input","className","props","jsx","AriaInput","composeRenderProps","classNames","TextArea","AriaTextArea","TextField","label","description","errorMessage","textArea","FormField","TfTextField","isDisabled","field","useFieldContext","getFieldErrorMessage"],"mappings":"2ZAeA,MAAMA,EAAaC,EAEnB,SAASC,EAAM,CAAE,UAAAC,EAAW,GAAGC,GAAyB,CACtD,OACEC,EAACC,EAAA,CACC,UAAWC,EAAmBJ,EAAYA,GACxCK,EACE,6KAEA,iBAEA,aACAL,CAAA,CACF,EAED,GAAGC,CAAA,CAAA,CAGV,CAEA,SAASK,EAAS,CAAE,UAAAN,EAAW,GAAGC,GAA4B,CAC5D,OACEC,EAACK,EAAA,CACC,UAAWH,EAAmBJ,EAAYA,GACxCK,EACE,8HAEA,aAEA,iBACAL,CAAA,CACF,EAED,GAAGC,CAAA,CAAA,CAGV,CAMO,SAASO,EAAU,CACxB,MAAAC,EACA,YAAAC,EACA,aAAAC,EACA,SAAAC,EACA,UAAAZ,EACA,GAAGC,CACL,EAAmB,CACjB,OACEC,EAACL,EAAA,CACC,UAAWO,EAAmBJ,EAAYA,GACxCK,EAAW,mBAAoBL,CAAS,CAAA,EAEzC,GAAGC,EAEJ,SAAAC,EAACW,EAAA,CAAU,MAAAJ,EAAc,aAAAE,EAA4B,YAAAD,EAClD,SAAAE,EAAWV,EAACI,EAAA,CAAA,CAAS,EAAKJ,EAACH,EAAA,CAAA,CAAM,CAAA,CACpC,CAAA,CAAA,CAGN,CAEO,SAASe,EAAY,CAAE,WAAAC,EAAY,GAAGd,GAAiD,CAC5F,MAAMe,EAAQC,EAAA,EAEd,OACEf,EAACM,EAAA,CACC,WAAYO,GAAcC,EAAM,KAAK,MAAM,aAC3C,MAAOA,EAAM,MAAM,MACnB,GAAIA,EAAM,KACV,KAAMA,EAAM,KACZ,OAAQA,EAAM,WACd,SAAUA,EAAM,aAChB,UAAW,CAAC,CAACE,EAAqBF,CAAK,EACvC,aAAcE,EAAqBF,CAAK,EACvC,GAAGf,CAAA,CAAA,CACV"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as i,jsxs as c}from"react/jsx-runtime";import{cva as a}from"class-variance-authority";import{classNames as n}from"../utils/primitives.js";import"clsx";function f({className:t,...e}){return i("ol",{className:n("grid grid-col-1 gap-icon",t),...e})}function p({className:t,...e}){return i("li",{className:n("grid grid-cols-[4rem_2rem_1fr] grid-rows-subgrid list-none gap-icon",t),...e})}const l=a("p-1 rounded-full",{variants:{variant:{destructive:"text-destructive-foreground bg-destructive",success:"text-success-foreground bg-success",muted:"text-muted-foreground bg-muted"}},defaultVariants:{variant:"muted"}});function v({icon:t,className:e,variant:r,...s}){return c("div",{...s,className:"flex flex-col items-center gap-2",children:[i("div",{className:n(l({variant:r,className:e})),children:i(t,{className:"size-icon "})}),i("div",{className:"h-full w-[1px]"})]})}function x({className:t,date:e,dateFormatter:r,...s}){const o=`${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getFullYear()}`;return i("time",{...s,dateTime:e.toISOString(),className:n("font-mono leading-none text-muted",t),children:r?r(e):o})}function N({className:t,...e}){return i("section",{className:n("",t),...e})}export{f as Timeline,N as TimelineContent,x as TimelineDate,v as TimelineIcon,p as TimelineItem,l as timelineIconVariants};
|
|
2
|
+
//# sourceMappingURL=timeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline.js","sources":["../../lib/components/timeline.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport { classNames } from \"lib/utils/primitives\";\nimport type { LucideIcon } from \"lucide-react\";\n\nexport function Timeline({ className, ...props }: React.ComponentProps<'ol'>) {\n return <ol className={classNames(\"grid grid-col-1 gap-icon\", className)} {...props} />\n}\n\nexport function TimelineItem({ className, ...props }: React.ComponentProps<'li'> & {}) {\n return (\n <li className={classNames(\"grid grid-cols-[4rem_2rem_1fr] grid-rows-subgrid list-none gap-icon\", className)} {...props} />\n )\n}\n\nexport const timelineIconVariants = cva(\n `p-1 rounded-full`,\n {\n variants: {\n variant: {\n destructive: \"text-destructive-foreground bg-destructive\",\n success: \"text-success-foreground bg-success\",\n muted: \"text-muted-foreground bg-muted\",\n },\n },\n defaultVariants: {\n variant: \"muted\",\n },\n },\n);\n\nexport function TimelineIcon({ icon: Icon, className, variant, ...props }: Omit<React.ComponentProps<'div'>, 'children'> & VariantProps<typeof timelineIconVariants> & {\n icon: LucideIcon\n}) {\n return <div {...props} className=\"flex flex-col items-center gap-2\">\n <div className={classNames(timelineIconVariants({ variant, className }))}>\n <Icon className=\"size-icon \" />\n </div>\n <div className=\"h-full w-[1px]\" />\n </div>\n}\n\nexport function TimelineDate({ className, date, dateFormatter, ...props }: Omit<React.ComponentProps<'time'>, 'dateTime' | 'children'> & {\n date: Date\n dateFormatter?: (d: Date) => string;\n}) {\n const defaultDateDisplay = `${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getFullYear()}`;\n return <time {...props} dateTime={date.toISOString()} className={classNames(\"font-mono leading-none text-muted\", className)}>{dateFormatter ? dateFormatter(date) : defaultDateDisplay}</time>\n}\n\nexport function TimelineContent({ className, ...props }: React.ComponentProps<'section'>) {\n return <section className={classNames(\"\", className)} {...props} />;\n}"],"names":["Timeline","className","props","jsx","classNames","TimelineItem","timelineIconVariants","cva","TimelineIcon","Icon","variant","jsxs","TimelineDate","date","dateFormatter","defaultDateDisplay","TimelineContent"],"mappings":"kKAIO,SAASA,EAAS,CAAE,UAAAC,EAAW,GAAGC,GAAqC,CAC1E,OAAOC,EAAC,MAAG,UAAWC,EAAW,2BAA4BH,CAAS,EAAI,GAAGC,EAAO,CACxF,CAEO,SAASG,EAAa,CAAE,UAAAJ,EAAW,GAAGC,GAA0C,CACnF,OACIC,EAAC,MAAG,UAAWC,EAAW,sEAAuEH,CAAS,EAAI,GAAGC,EAAO,CAEhI,CAEO,MAAMI,EAAuBC,EAChC,mBACA,CACI,SAAU,CACN,QAAS,CACL,YAAa,6CACb,QAAS,qCACT,MAAO,gCAAA,CACX,EAEJ,gBAAiB,CACb,QAAS,OAAA,CACb,CAER,EAEO,SAASC,EAAa,CAAE,KAAMC,EAAM,UAAAR,EAAW,QAAAS,EAAS,GAAGR,GAE/D,CACC,OAAOS,EAAC,MAAA,CAAK,GAAGT,EAAO,UAAU,mCAC7B,SAAA,CAAAC,EAAC,MAAA,CAAI,UAAWC,EAAWE,EAAqB,CAAE,QAAAI,EAAS,UAAAT,CAAA,CAAW,CAAC,EACnE,SAAAE,EAACM,EAAA,CAAK,UAAU,aAAa,EACjC,EACAN,EAAC,MAAA,CAAI,UAAU,gBAAA,CAAiB,CAAA,EACpC,CACJ,CAEO,SAASS,EAAa,CAAE,UAAAX,EAAW,KAAAY,EAAM,cAAAC,EAAe,GAAGZ,GAG/D,CACC,MAAMa,EAAqB,IAAIF,EAAK,SAAA,EAAa,GAAG,SAAA,EAAW,SAAS,EAAG,GAAG,CAAC,IAAIA,EAAK,aAAa,GACrG,SAAQ,OAAA,CAAM,GAAGX,EAAO,SAAUW,EAAK,YAAA,EAAe,UAAWT,EAAW,oCAAqCH,CAAS,EAAI,WAAgBa,EAAcD,CAAI,EAAIE,EAAmB,CAC3L,CAEO,SAASC,EAAgB,CAAE,UAAAf,EAAW,GAAGC,GAA0C,CACtF,OAAOC,EAAC,WAAQ,UAAWC,EAAW,GAAIH,CAAS,EAAI,GAAGC,EAAO,CACrE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{TooltipTrigger as r,Tooltip as m,composeRenderProps as p}from"react-aria-components";import{classNames as d}from"../utils/primitives.js";import"clsx";const f=r,c=({className:o,offset:t=4,...e})=>a(m,{offset:t,className:p(o,i=>d("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0","data-[entering]:zoom-in-95","data-[exiting]:animate-out data-[exiting]:fade-out-0 data-[exiting]:zoom-out-95","data-[placement=bottom]:slide-in-from-top-2 data-[placement=left]:slide-in-from-right-2 data-[placement=right]:slide-in-from-left-2 data-[placement=top]:slide-in-from-bottom-2",i)),...e});export{c as Tooltip,f as TooltipTrigger};
|
|
2
|
+
//# sourceMappingURL=tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.js","sources":["../../lib/components/tooltip.tsx"],"sourcesContent":["import {\n\tTooltip as AriaTooltip,\n\tTooltipTrigger as AriaTooltipTrigger,\n\tcomposeRenderProps,\n\ttype TooltipProps as AriaTooltipProps,\n} from \"react-aria-components\"\n\nimport { classNames } from \"lib/utils/primitives\"\n\nconst TooltipTrigger = AriaTooltipTrigger\nconst Tooltip = ({ className, offset = 4, ...props }: AriaTooltipProps) => (\n\t<AriaTooltip\n\t\toffset={offset}\n\t\tclassName={composeRenderProps(className, (className) =>\n\t\t\tclassNames(\n\t\t\t\t\"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0\",\n\t\t\t\t/* Entering */\n\t\t\t\t\"data-[entering]:zoom-in-95\",\n\t\t\t\t/* Exiting */\n\t\t\t\t\"data-[exiting]:animate-out data-[exiting]:fade-out-0 data-[exiting]:zoom-out-95\",\n\t\t\t\t/* Placement */\n\t\t\t\t\"data-[placement=bottom]:slide-in-from-top-2 data-[placement=left]:slide-in-from-right-2 data-[placement=right]:slide-in-from-left-2 data-[placement=top]:slide-in-from-bottom-2\",\n\t\t\t\tclassName\n\t\t\t)\n\t\t)}\n\t\t{...props}\n\t/>\n)\n\nexport { Tooltip, TooltipTrigger }\n"],"names":["TooltipTrigger","AriaTooltipTrigger","Tooltip","className","offset","props","jsx","AriaTooltip","composeRenderProps","classNames"],"mappings":"qMASA,MAAMA,EAAiBC,EACjBC,EAAU,CAAC,CAAE,UAAAC,EAAW,OAAAC,EAAS,EAAG,GAAGC,KAC5CC,EAACC,EAAA,CACA,OAAAH,EACA,UAAWI,EAAmBL,EAAYA,GACzCM,EACC,+HAEA,6BAEA,kFAEA,kLACAN,CAAA,CACD,EAEA,GAAGE,CAAA,CACL"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { Button } from 'lib/components/button';
|
|
2
|
+
import { TfCheckbox } from 'lib/components/checkbox';
|
|
3
|
+
import { TfMultiSelect } from 'lib/components/multi-select';
|
|
4
|
+
import { TfNumberField } from 'lib/components/numberfield';
|
|
5
|
+
import { TfSingleSelect } from 'lib/components/select';
|
|
6
|
+
import { TfTextField } from 'lib/components/textfield';
|
|
7
7
|
/** Don't put this in the same file as form-context.tsx, this causes circular dependencies. */
|
|
8
8
|
/** TODO, lazy loading when fieldComponents are large */
|
|
9
9
|
/**
|
package/dist/utils/form-hook.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createFormHook as o}from"@tanstack/react-form";import{
|
|
1
|
+
import{createFormHook as o}from"@tanstack/react-form";import{Button as m}from"../components/button.js";import{TfCheckbox as r}from"../components/checkbox.js";import{TfMultiSelect as t}from"../components/multi-select.js";import{TfNumberField as i}from"../components/numberfield.js";import{TfSingleSelect as p}from"../components/select.js";import{TfTextField as e}from"../components/textfield.js";import{formContext as f,fieldContext as n}from"./form-context.js";import"react/jsx-runtime";import"class-variance-authority";import"./primitives.js";import"clsx";import"react-aria-components";import"../components/loader.js";import"lucide-react";import"../components/field.js";import"../components/menu.js";import"../components/list-box.js";import"../components/popover.js";const{useAppForm:N}=o({fieldComponents:{TfTextField:e,TfNumberField:i,TfMultiSelect:t,TfSingleSelect:p,TfCheckbox:r},formComponents:{Button:m},fieldContext:n,formContext:f});export{N as useAppForm};
|
|
2
2
|
//# sourceMappingURL=form-hook.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-hook.js","sources":["../../lib/utils/form-hook.tsx"],"sourcesContent":["import { createFormHook } from \"@tanstack/react-form\";\nimport {
|
|
1
|
+
{"version":3,"file":"form-hook.js","sources":["../../lib/utils/form-hook.tsx"],"sourcesContent":["import { createFormHook } from \"@tanstack/react-form\";\nimport { Button } from \"lib/components/button\";\nimport { TfCheckbox } from \"lib/components/checkbox\";\nimport { TfMultiSelect } from \"lib/components/multi-select\";\nimport { TfNumberField } from \"lib/components/numberfield\";\nimport { TfSingleSelect } from \"lib/components/select\";\nimport { TfTextField } from \"lib/components/textfield\";\nimport { fieldContext, formContext } from \"lib/utils/form-context\";\n\n/** Don't put this in the same file as form-context.tsx, this causes circular dependencies. */\n/** TODO, lazy loading when fieldComponents are large */\n/**\n * Builder for form logic and user interfaces\n */\nexport const { useAppForm } = createFormHook({\n\tfieldComponents: {\n\t\tTfTextField,\n\t\tTfNumberField,\n\t\tTfMultiSelect,\n\t\tTfSingleSelect,\n\t\tTfCheckbox,\n\t},\n\tformComponents: {\n\t\tButton,\n\t},\n\tfieldContext,\n\tformContext,\n});\n"],"names":["useAppForm","createFormHook","TfTextField","TfNumberField","TfMultiSelect","TfSingleSelect","TfCheckbox","Button","fieldContext","formContext"],"mappings":"gwBAcO,KAAM,CAAE,WAAAA,CAAA,EAAeC,EAAe,CAC5C,gBAAiB,CAChB,YAAAC,EACA,cAAAC,EACA,cAAAC,EACA,eAAAC,EACA,WAAAC,CAAA,EAED,eAAgB,CACf,OAAAC,CAAA,EAED,aAAAC,EACA,YAAAC,CACD,CAAC"}
|