@gbmtech/aurora-ui 0.6.2 → 0.6.4
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/cjs/components/alert-dialog/alert-dialog.cjs +1 -1
- package/dist/cjs/components/app-layout/sidebar/sidebar.cjs +1 -1
- package/dist/cjs/components/button/button.cjs +1 -0
- package/dist/{esm/components → cjs/components/button}/button.d.ts +5 -7
- package/dist/cjs/components/button/button.d.ts.map +1 -0
- package/dist/cjs/components/button/index.cjs +1 -0
- package/dist/cjs/components/button/index.d.ts +2 -0
- package/dist/cjs/components/button/index.d.ts.map +1 -0
- package/dist/cjs/components/calendar.cjs +1 -1
- package/dist/cjs/components/combobox.cjs +1 -1
- package/dist/cjs/components/command.cjs +1 -1
- package/dist/cjs/components/data-table/data-table-action-bar.cjs +1 -1
- package/dist/cjs/components/data-table/data-table-date-filter.cjs +1 -1
- package/dist/cjs/components/data-table/data-table-faceted-filter.cjs +1 -1
- package/dist/cjs/components/data-table/data-table-filter-list.cjs +1 -1
- package/dist/cjs/components/data-table/data-table-filter-menu.cjs +1 -1
- package/dist/cjs/components/data-table/data-table-pagination.cjs +1 -1
- package/dist/cjs/components/data-table/data-table-range-filter.cjs +1 -1
- package/dist/cjs/components/data-table/data-table-slider-filter.cjs +1 -1
- package/dist/cjs/components/data-table/data-table-sort-list.cjs +1 -1
- package/dist/cjs/components/data-table/data-table-toolbar.cjs +1 -1
- package/dist/cjs/components/data-table/data-table-view-options.cjs +1 -1
- package/dist/cjs/components/data-table/index.cjs +1 -1
- package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
- package/dist/cjs/components/date-picker-with-range.cjs +1 -1
- package/dist/cjs/components/date-time-picker/date-time-picker.cjs +1 -1
- package/dist/cjs/components/date-time-picker-with-range.cjs +1 -1
- package/dist/cjs/components/dialog/dialog.cjs +2 -0
- package/dist/cjs/components/dialog/dialog.d.ts +39 -0
- package/dist/cjs/components/dialog/dialog.d.ts.map +1 -0
- package/dist/cjs/components/dialog/index.cjs +1 -0
- package/dist/cjs/components/dialog/index.d.ts +2 -0
- package/dist/cjs/components/dialog/index.d.ts.map +1 -0
- package/dist/cjs/components/input/index.cjs +1 -0
- package/dist/cjs/components/input/index.d.ts +3 -0
- package/dist/cjs/components/input/index.d.ts.map +1 -0
- package/dist/cjs/components/input/input-variants.cjs +1 -0
- package/dist/cjs/components/input/input-variants.d.ts +103 -0
- package/dist/cjs/components/input/input-variants.d.ts.map +1 -0
- package/dist/cjs/components/input/input.cjs +2 -0
- package/dist/cjs/components/input/input.d.ts +14 -0
- package/dist/cjs/components/input/input.d.ts.map +1 -0
- package/dist/cjs/components/input-otp/index.cjs +1 -0
- package/dist/cjs/components/input-otp/index.d.ts +2 -0
- package/dist/cjs/components/input-otp/index.d.ts.map +1 -0
- package/dist/cjs/components/input-otp/input-otp.cjs +2 -0
- package/dist/cjs/components/input-otp/input-otp.d.ts +16 -0
- package/dist/cjs/components/input-otp/input-otp.d.ts.map +1 -0
- package/dist/cjs/components/input-password/index.cjs +1 -0
- package/dist/cjs/components/input-password/index.d.ts +2 -0
- package/dist/cjs/components/input-password/index.d.ts.map +1 -0
- package/dist/cjs/components/input-password/input-password.cjs +2 -0
- package/dist/cjs/components/input-password/input-password.d.ts +8 -0
- package/dist/cjs/components/input-password/input-password.d.ts.map +1 -0
- package/dist/cjs/components/mask-input.cjs +1 -1
- package/dist/cjs/components/month-picker.cjs +1 -1
- package/dist/cjs/components/month-picker.d.ts +3 -2
- package/dist/cjs/components/month-picker.d.ts.map +1 -1
- package/dist/cjs/components/multi-select.cjs +1 -1
- package/dist/cjs/components/pagination.cjs +1 -1
- package/dist/cjs/components/sheet/sheet.cjs +1 -1
- package/dist/cjs/components/switch/index.cjs +1 -0
- package/dist/cjs/components/switch/index.d.ts +2 -0
- package/dist/cjs/components/switch/index.d.ts.map +1 -0
- package/dist/cjs/components/{switch.cjs → switch/switch.cjs} +1 -1
- package/dist/cjs/components/switch/switch.d.ts +7 -0
- package/dist/cjs/components/switch/switch.d.ts.map +1 -0
- package/dist/cjs/components/theme-toggle.cjs +1 -1
- package/dist/cjs/components/time-picker/time-picker-input.cjs +1 -1
- package/dist/cjs/components/tooltip/tooltip-content-variants.cjs +1 -1
- package/dist/cjs/components/tooltip/tooltip-content-variants.d.ts +2 -2
- package/dist/cjs/components/tooltip/tooltip-content-variants.d.ts.map +1 -1
- package/dist/cjs/hooks/use-data-table.cjs +1 -1
- package/dist/cjs/hooks/use-data-table.d.ts +1 -0
- package/dist/cjs/hooks/use-data-table.d.ts.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/lib/index.cjs +1 -1
- package/dist/cjs/primitives/input.d.ts.map +1 -0
- package/dist/esm/components/alert-dialog/alert-dialog.js +1 -1
- package/dist/esm/components/app-layout/sidebar/sidebar.js +1 -1
- package/dist/{cjs/components → esm/components/button}/button.d.ts +5 -7
- package/dist/esm/components/button/button.d.ts.map +1 -0
- package/dist/esm/components/button/button.js +1 -0
- package/dist/esm/components/button/index.d.ts +2 -0
- package/dist/esm/components/button/index.d.ts.map +1 -0
- package/dist/esm/components/button/index.js +1 -0
- package/dist/esm/components/calendar.js +1 -1
- package/dist/esm/components/combobox.js +1 -1
- package/dist/esm/components/command.js +1 -1
- package/dist/esm/components/data-table/data-table-action-bar.js +1 -1
- package/dist/esm/components/data-table/data-table-date-filter.js +1 -1
- package/dist/esm/components/data-table/data-table-faceted-filter.js +1 -1
- package/dist/esm/components/data-table/data-table-filter-list.js +1 -1
- package/dist/esm/components/data-table/data-table-filter-menu.js +1 -1
- package/dist/esm/components/data-table/data-table-pagination.js +1 -1
- package/dist/esm/components/data-table/data-table-range-filter.js +1 -1
- package/dist/esm/components/data-table/data-table-slider-filter.js +1 -1
- package/dist/esm/components/data-table/data-table-sort-list.js +1 -1
- package/dist/esm/components/data-table/data-table-toolbar.js +1 -1
- package/dist/esm/components/data-table/data-table-view-options.js +1 -1
- package/dist/esm/components/date-picker/date-picker.js +1 -1
- package/dist/esm/components/date-picker-with-range.js +1 -1
- package/dist/esm/components/date-time-picker/date-time-picker.js +1 -1
- package/dist/esm/components/date-time-picker-with-range.js +1 -1
- package/dist/esm/components/dialog/dialog.d.ts +39 -0
- package/dist/esm/components/dialog/dialog.d.ts.map +1 -0
- package/dist/esm/components/dialog/dialog.js +2 -0
- package/dist/esm/components/dialog/index.d.ts +2 -0
- package/dist/esm/components/dialog/index.d.ts.map +1 -0
- package/dist/esm/components/dialog/index.js +1 -0
- package/dist/esm/components/input/index.d.ts +3 -0
- package/dist/esm/components/input/index.d.ts.map +1 -0
- package/dist/esm/components/input/index.js +1 -0
- package/dist/esm/components/input/input-variants.d.ts +103 -0
- package/dist/esm/components/input/input-variants.d.ts.map +1 -0
- package/dist/esm/components/input/input-variants.js +1 -0
- package/dist/esm/components/input/input.d.ts +14 -0
- package/dist/esm/components/input/input.d.ts.map +1 -0
- package/dist/esm/components/input/input.js +2 -0
- package/dist/esm/components/input-otp/index.d.ts +2 -0
- package/dist/esm/components/input-otp/index.d.ts.map +1 -0
- package/dist/esm/components/input-otp/index.js +1 -0
- package/dist/esm/components/input-otp/input-otp.d.ts +16 -0
- package/dist/esm/components/input-otp/input-otp.d.ts.map +1 -0
- package/dist/esm/components/input-otp/input-otp.js +2 -0
- package/dist/esm/components/input-password/index.d.ts +2 -0
- package/dist/esm/components/input-password/index.d.ts.map +1 -0
- package/dist/esm/components/input-password/index.js +1 -0
- package/dist/esm/components/input-password/input-password.d.ts +8 -0
- package/dist/esm/components/input-password/input-password.d.ts.map +1 -0
- package/dist/esm/components/input-password/input-password.js +2 -0
- package/dist/esm/components/mask-input.js +1 -1
- package/dist/esm/components/month-picker.d.ts +3 -2
- package/dist/esm/components/month-picker.d.ts.map +1 -1
- package/dist/esm/components/month-picker.js +1 -1
- package/dist/esm/components/multi-select.js +1 -1
- package/dist/esm/components/pagination.js +1 -1
- package/dist/esm/components/sheet/sheet.js +1 -1
- package/dist/esm/components/switch/index.d.ts +2 -0
- package/dist/esm/components/switch/index.d.ts.map +1 -0
- package/dist/esm/components/switch/index.js +1 -0
- package/dist/esm/components/switch/switch.d.ts +7 -0
- package/dist/esm/components/switch/switch.d.ts.map +1 -0
- package/dist/esm/components/switch/switch.js +2 -0
- package/dist/esm/components/theme-toggle.js +1 -1
- package/dist/esm/components/time-picker/time-picker-input.js +1 -1
- package/dist/esm/components/tooltip/tooltip-content-variants.d.ts +2 -2
- package/dist/esm/components/tooltip/tooltip-content-variants.d.ts.map +1 -1
- package/dist/esm/components/tooltip/tooltip-content-variants.js +1 -1
- package/dist/esm/hooks/use-data-table.d.ts +1 -0
- package/dist/esm/hooks/use-data-table.d.ts.map +1 -1
- package/dist/esm/hooks/use-data-table.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/primitives/input.d.ts.map +1 -0
- package/dist/styles/index.css +1 -1
- package/package.json +1 -1
- package/dist/cjs/components/button.cjs +0 -1
- package/dist/cjs/components/button.d.ts.map +0 -1
- package/dist/cjs/components/dialog.cjs +0 -2
- package/dist/cjs/components/dialog.d.ts +0 -59
- package/dist/cjs/components/dialog.d.ts.map +0 -1
- package/dist/cjs/components/input-otp.cjs +0 -2
- package/dist/cjs/components/input-otp.d.ts +0 -23
- package/dist/cjs/components/input-otp.d.ts.map +0 -1
- package/dist/cjs/components/input-password.cjs +0 -2
- package/dist/cjs/components/input-password.d.ts +0 -10
- package/dist/cjs/components/input-password.d.ts.map +0 -1
- package/dist/cjs/components/input.cjs +0 -2
- package/dist/cjs/components/input.d.ts +0 -46
- package/dist/cjs/components/input.d.ts.map +0 -1
- package/dist/cjs/components/switch.d.ts +0 -5
- package/dist/cjs/components/switch.d.ts.map +0 -1
- package/dist/cjs/primitive/input.d.ts.map +0 -1
- package/dist/esm/components/button.d.ts.map +0 -1
- package/dist/esm/components/button.js +0 -1
- package/dist/esm/components/dialog.d.ts +0 -59
- package/dist/esm/components/dialog.d.ts.map +0 -1
- package/dist/esm/components/dialog.js +0 -2
- package/dist/esm/components/input-otp.d.ts +0 -23
- package/dist/esm/components/input-otp.d.ts.map +0 -1
- package/dist/esm/components/input-otp.js +0 -2
- package/dist/esm/components/input-password.d.ts +0 -10
- package/dist/esm/components/input-password.d.ts.map +0 -1
- package/dist/esm/components/input-password.js +0 -2
- package/dist/esm/components/input.d.ts +0 -46
- package/dist/esm/components/input.d.ts.map +0 -1
- package/dist/esm/components/input.js +0 -2
- package/dist/esm/components/switch.d.ts +0 -5
- package/dist/esm/components/switch.d.ts.map +0 -1
- package/dist/esm/components/switch.js +0 -2
- package/dist/esm/primitive/input.d.ts.map +0 -1
- /package/dist/cjs/{primitive → primitives}/input.cjs +0 -0
- /package/dist/cjs/{primitive → primitives}/input.d.ts +0 -0
- /package/dist/esm/{primitive → primitives}/input.d.ts +0 -0
- /package/dist/esm/{primitive → primitives}/input.js +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{ArrowsDownUpIcon as n,CaretUpDownIcon as a,DotsSixVerticalIcon as r,TrashIcon as t}from"@phosphor-icons/react";import{useCallback as l,useEffect as o,useId as s,useMemo as d,useRef as c,useState as m}from"react";import{Badge as h}from"../badge/index.js";import{Button as p}from"../button.js";import{Command as u,CommandEmpty as g,CommandGroup as f,CommandInput as v,CommandItem as x,CommandList as b}from"../command.js";import{Popover as w,PopoverContent as N,PopoverTrigger as y}from"../popover.js";import{Select as C,SelectContent as k,SelectItem as z,SelectTrigger as L,SelectValue as j}from"../select.js";import{Sortable as S,SortableContent as D,SortableItem as T,SortableItemHandle as E,SortableOverlay as I}from"../sortable.js";import{dataTableConfig as K}from"../../lib/data-table-config.js";import{cn as M}from"../../lib/utils.js";let O=["backspace","delete"];function A({table:a,...r}){let t=s(),u=s(),g=s(),[f,v]=m(!1),x=c(null),b=a.getState().sorting,C=a.setSorting,{columnLabels:k,columns:z}=d(()=>{let e=new Map,i=new Set(b.map(e=>e.id)),n=[];for(let r of a.getAllColumns()){if(!r.getCanSort())continue;let a=r.columnDef.meta?.label??r.id;e.set(r.id,a),i.has(r.id)||n.push({id:r.id,label:a})}return{columnLabels:e,columns:n}},[b,a]),L=l(()=>{let e=z[0];e&&C(i=>[...i,{id:e.id,desc:!1}])},[z,C]),j=l((e,i)=>{C(n=>n?n.map(n=>n.id===e?{...n,...i}:n):n)},[C]),T=l(e=>{C(i=>i.filter(i=>i.id!==e))},[C]),E=l(()=>C(a.initialState.sorting),[C,a.initialState.sorting]);o(()=>{function e(e){!(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)&&("s"!==e.key.toLowerCase()||e.ctrlKey||e.metaKey||e.shiftKey||(e.preventDefault(),v(!0)),"s"===e.key.toLowerCase()&&e.shiftKey&&b.length>0&&(e.preventDefault(),E()))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[b.length,E]);let K=l(e=>{O.includes(e.key.toLowerCase())&&b.length>0&&(e.preventDefault(),E())},[b.length,E]);return i(S,{value:b,onValueChange:C,getItemValue:e=>e.id,children:[i(w,{open:f,onOpenChange:v,children:[e(y,{asChild:!0,children:i(p,{variant:"outline",size:"sm",onKeyDown:K,children:[e(n,{}),"Ordenar",b.length>0&&e(h,{variant:"secondary",className:"h-[18.24px] rounded-[3.2px] px-[5.12px] font-mono font-normal text-[10.4px]",children:b.length})]})}),i(N,{"aria-labelledby":u,"aria-describedby":g,className:"flex w-full max-w-[var(--radix-popover-content-available-width)] origin-[var(--radix-popover-content-transform-origin)] flex-col gap-3.5 p-4 sm:min-w-[380px]",...r,children:[i("div",{className:"flex flex-col gap-1",children:[e("h4",{id:u,className:"font-medium leading-none",children:b.length>0?"Ordenar por":"Nenhuma ordena\xe7\xe3o aplicada"}),e("p",{id:g,className:M("text-gray-500 text-sm",b.length>0&&"sr-only"),children:b.length>0?"Modifique a ordena\xe7\xe3o para organizar suas linhas.":"Adicione uma ordena\xe7\xe3o para organizar suas linhas."})]}),b.length>0&&e(D,{asChild:!0,children:e("div",{role:"list",className:"flex max-h-[300px] flex-col gap-2 overflow-y-auto p-1",children:b.map(i=>e($,{sort:i,sortItemId:`${t}-sort-${i.id}`,columns:z,columnLabels:k,onSortUpdate:j,onSortRemove:T},i.id))})}),i("div",{className:"flex w-full items-center gap-2",children:[e(p,{size:"sm",className:"rounded",ref:x,onClick:L,disabled:0===z.length,children:"Adicionar"}),b.length>0&&e(p,{variant:"outline",size:"sm",className:"rounded",onClick:E,children:"Resetar"})]})]})]}),e(I,{children:i("div",{className:"flex items-center gap-2",children:[e("div",{className:"h-10 w-[180px] rounded-sm bg-primary/10"}),e("div",{className:"h-10 w-24 rounded-sm bg-primary/10"}),e("div",{className:"size-8 shrink-0 rounded-sm bg-primary/10"}),e("div",{className:"size-8 shrink-0 rounded-sm bg-primary/10"})]})})]})}function $({sort:n,sortItemId:o,columns:s,columnLabels:d,onSortUpdate:c,onSortRemove:h}){let S=`${o}-field-listbox`,D=`${o}-field-trigger`,I=`${o}-direction-listbox`,[M,A]=m(!1),[$,H]=m(!1),V=l(e=>{!(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)&&(M||$||O.includes(e.key.toLowerCase())&&(e.preventDefault(),h(n.id)))},[n.id,M,$,h]);return e(T,{value:n.id,asChild:!0,children:i("div",{role:"listitem",id:o,tabIndex:-1,className:"flex items-center gap-2",onKeyDown:V,children:[i(w,{open:M,onOpenChange:A,children:[e(y,{asChild:!0,children:i(p,{id:D,role:"combobox","aria-controls":S,variant:"outline",size:"sm",className:"w-44 justify-between rounded font-normal",children:[e("span",{className:"truncate",children:d.get(n.id)}),e(a,{className:"opacity-50"})]})}),e(N,{id:S,className:"w-[var(--radix-popover-trigger-width)] origin-[var(--radix-popover-content-transform-origin)] p-0",children:i(u,{children:[e(v,{placeholder:"Buscar campo..."}),i(b,{children:[e(g,{children:"Nenhum campo encontrado."}),e(f,{children:s.map(i=>e(x,{value:i.id,onSelect:e=>c(n.id,{id:e}),children:e("span",{className:"truncate",children:i.label})},i.id))})]})]})})]}),i(C,{open:$,onOpenChange:H,value:n.desc?"desc":"asc",onValueChange:e=>c(n.id,{desc:"desc"===e}),children:[e(L,{"aria-controls":I,className:"h-10 w-24 rounded [&[data-size]]:h-10",children:e(j,{})}),e(k,{id:I,className:"min-w-[var(--radix-select-trigger-width)] origin-[var(--radix-select-content-transform-origin)]",children:K.sortOrders.map(i=>e(z,{value:i.value,children:i.label},i.value))})]}),e(p,{"aria-controls":o,variant:"outline",size:"icon",className:"size-10 shrink-0 rounded",onClick:()=>h(n.id),children:e(t,{weight:"bold"})}),e(E,{asChild:!0,children:e(p,{variant:"outline",size:"icon",className:"size-10 shrink-0 rounded",children:e(r,{weight:"bold"})})})]})})}export{A as DataTableSortList};
|
|
2
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{ArrowsDownUpIcon as n,CaretUpDownIcon as a,DotsSixVerticalIcon as r,TrashIcon as t}from"@phosphor-icons/react";import{useCallback as l,useEffect as o,useId as s,useMemo as d,useRef as c,useState as m}from"react";import{Badge as h}from"../badge/index.js";import{Button as p}from"../button/index.js";import{Command as u,CommandEmpty as g,CommandGroup as f,CommandInput as v,CommandItem as x,CommandList as b}from"../command.js";import{Popover as w,PopoverContent as N,PopoverTrigger as y}from"../popover.js";import{Select as C,SelectContent as k,SelectItem as z,SelectTrigger as L,SelectValue as j}from"../select.js";import{Sortable as S,SortableContent as D,SortableItem as T,SortableItemHandle as E,SortableOverlay as I}from"../sortable.js";import{dataTableConfig as K}from"../../lib/data-table-config.js";import{cn as M}from"../../lib/utils.js";let O=["backspace","delete"];function A({table:a,...r}){let t=s(),u=s(),g=s(),[f,v]=m(!1),x=c(null),b=a.getState().sorting,C=a.setSorting,{columnLabels:k,columns:z}=d(()=>{let e=new Map,i=new Set(b.map(e=>e.id)),n=[];for(let r of a.getAllColumns()){if(!r.getCanSort())continue;let a=r.columnDef.meta?.label??r.id;e.set(r.id,a),i.has(r.id)||n.push({id:r.id,label:a})}return{columnLabels:e,columns:n}},[b,a]),L=l(()=>{let e=z[0];e&&C(i=>[...i,{id:e.id,desc:!1}])},[z,C]),j=l((e,i)=>{C(n=>n?n.map(n=>n.id===e?{...n,...i}:n):n)},[C]),T=l(e=>{C(i=>i.filter(i=>i.id!==e))},[C]),E=l(()=>C(a.initialState.sorting),[C,a.initialState.sorting]);o(()=>{function e(e){!(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)&&("s"!==e.key.toLowerCase()||e.ctrlKey||e.metaKey||e.shiftKey||(e.preventDefault(),v(!0)),"s"===e.key.toLowerCase()&&e.shiftKey&&b.length>0&&(e.preventDefault(),E()))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[b.length,E]);let K=l(e=>{O.includes(e.key.toLowerCase())&&b.length>0&&(e.preventDefault(),E())},[b.length,E]);return i(S,{value:b,onValueChange:C,getItemValue:e=>e.id,children:[i(w,{open:f,onOpenChange:v,children:[e(y,{asChild:!0,children:i(p,{variant:"outline",size:"sm",onKeyDown:K,children:[e(n,{}),"Ordenar",b.length>0&&e(h,{variant:"secondary",className:"h-[18.24px] rounded-[3.2px] px-[5.12px] font-mono font-normal text-[10.4px]",children:b.length})]})}),i(N,{"aria-labelledby":u,"aria-describedby":g,className:"flex w-full max-w-[var(--radix-popover-content-available-width)] origin-[var(--radix-popover-content-transform-origin)] flex-col gap-3.5 p-4 sm:min-w-[380px]",...r,children:[i("div",{className:"flex flex-col gap-1",children:[e("h4",{id:u,className:"font-medium leading-none",children:b.length>0?"Ordenar por":"Nenhuma ordena\xe7\xe3o aplicada"}),e("p",{id:g,className:M("text-gray-500 text-sm",b.length>0&&"sr-only"),children:b.length>0?"Modifique a ordena\xe7\xe3o para organizar suas linhas.":"Adicione uma ordena\xe7\xe3o para organizar suas linhas."})]}),b.length>0&&e(D,{asChild:!0,children:e("div",{role:"list",className:"flex max-h-[300px] flex-col gap-2 overflow-y-auto p-1",children:b.map(i=>e($,{sort:i,sortItemId:`${t}-sort-${i.id}`,columns:z,columnLabels:k,onSortUpdate:j,onSortRemove:T},i.id))})}),i("div",{className:"flex w-full items-center gap-2",children:[e(p,{size:"sm",className:"rounded",ref:x,onClick:L,disabled:0===z.length,children:"Adicionar"}),b.length>0&&e(p,{variant:"outline",size:"sm",className:"rounded",onClick:E,children:"Resetar"})]})]})]}),e(I,{children:i("div",{className:"flex items-center gap-2",children:[e("div",{className:"h-10 w-[180px] rounded-sm bg-primary/10"}),e("div",{className:"h-10 w-24 rounded-sm bg-primary/10"}),e("div",{className:"size-8 shrink-0 rounded-sm bg-primary/10"}),e("div",{className:"size-8 shrink-0 rounded-sm bg-primary/10"})]})})]})}function $({sort:n,sortItemId:o,columns:s,columnLabels:d,onSortUpdate:c,onSortRemove:h}){let S=`${o}-field-listbox`,D=`${o}-field-trigger`,I=`${o}-direction-listbox`,[M,A]=m(!1),[$,H]=m(!1),V=l(e=>{!(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)&&(M||$||O.includes(e.key.toLowerCase())&&(e.preventDefault(),h(n.id)))},[n.id,M,$,h]);return e(T,{value:n.id,asChild:!0,children:i("div",{role:"listitem",id:o,tabIndex:-1,className:"flex items-center gap-2",onKeyDown:V,children:[i(w,{open:M,onOpenChange:A,children:[e(y,{asChild:!0,children:i(p,{id:D,role:"combobox","aria-controls":S,variant:"outline",size:"sm",className:"w-44 justify-between rounded font-normal",children:[e("span",{className:"truncate",children:d.get(n.id)}),e(a,{className:"opacity-50"})]})}),e(N,{id:S,className:"w-[var(--radix-popover-trigger-width)] origin-[var(--radix-popover-content-transform-origin)] p-0",children:i(u,{children:[e(v,{placeholder:"Buscar campo..."}),i(b,{children:[e(g,{children:"Nenhum campo encontrado."}),e(f,{children:s.map(i=>e(x,{value:i.id,onSelect:e=>c(n.id,{id:e}),children:e("span",{className:"truncate",children:i.label})},i.id))})]})]})})]}),i(C,{open:$,onOpenChange:H,value:n.desc?"desc":"asc",onValueChange:e=>c(n.id,{desc:"desc"===e}),children:[e(L,{"aria-controls":I,className:"h-10 w-24 rounded [&[data-size]]:h-10",children:e(j,{})}),e(k,{id:I,className:"min-w-[var(--radix-select-trigger-width)] origin-[var(--radix-select-content-transform-origin)]",children:K.sortOrders.map(i=>e(z,{value:i.value,children:i.label},i.value))})]}),e(p,{"aria-controls":o,variant:"outline",size:"icon",className:"size-10 shrink-0 rounded",onClick:()=>h(n.id),children:e(t,{weight:"bold"})}),e(E,{asChild:!0,children:e(p,{variant:"outline",size:"icon",className:"size-10 shrink-0 rounded",children:e(r,{weight:"bold"})})})]})})}export{A as DataTableSortList};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{XIcon as l}from"@phosphor-icons/react";import{useCallback as a,useMemo as r}from"react";import{Button as i}from"../button.js";import{DataTableDateFilter as n}from"./data-table-date-filter.js";import{DataTableFacetedFilter as o}from"./data-table-faceted-filter.js";import{DataTableSliderFilter as s}from"./data-table-slider-filter.js";import{DataTableViewOptions as m}from"./data-table-view-options.js";import{Input as u}from"../input.js";import{cn as c}from"../../lib/utils.js";function p({table:n,children:o,className:s,...u}){let p=n.getState().columnFilters.length>0,f=r(()=>n.getAllColumns().filter(e=>e.getCanFilter()),[n]),b=a(()=>{n.resetColumnFilters()},[n]);return t("div",{role:"toolbar","aria-orientation":"horizontal",className:c("flex w-full items-start justify-between gap-2",s),...u,children:[t("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:[f.map(t=>e(d,{column:t},t.id)),p&&t(i,{"aria-label":"Reset filters",variant:"outline",size:"sm",onClick:b,children:[e(l,{}),"Limpar"]})]}),t("div",{className:"flex items-center gap-2",children:[o,e(m,{table:n})]})]})}function d({column:l}){{let r=l.columnDef.meta;return a(()=>{if(!r?.variant)return null;switch(r.variant){case"text":return e(u,{placeholder:r.placeholder??r.label,value:l.getFilterValue()??"",onChange:e=>l.setFilterValue(e.target.value),className:"h-9 w-40 lg:w-56",classNames:{input:"text-sm"}});case"number":return t("div",{className:"relative",children:[e(u,{type:"number",inputMode:"numeric",placeholder:r.placeholder??r.label,value:l.getFilterValue()??"",onChange:e=>l.setFilterValue(e.target.value),className:c("h-10 w-[120px]",r.unit&&"pr-8"),classNames:{input:"text-sm"}}),r.unit&&e("span",{className:"absolute top-0 right-0 bottom-0 flex items-center rounded-r-md bg-accent px-2 text-muted-foreground text-sm",children:r.unit})]});case"range":return e(s,{column:l,title:r.label??l.id});case"date":case"dateRange":return e(n,{column:l,title:r.label??l.id,multiple:"dateRange"===r.variant});case"select":case"multiSelect":return e(o,{column:l,title:r.label??l.id,options:r.options??[],multiple:"multiSelect"===r.variant});default:return null}},[l,r])()}}export{p as DataTableToolbar};
|
|
2
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{XIcon as l}from"@phosphor-icons/react";import{useCallback as a,useMemo as r}from"react";import{Button as i}from"../button/index.js";import{DataTableDateFilter as n}from"./data-table-date-filter.js";import{DataTableFacetedFilter as o}from"./data-table-faceted-filter.js";import{DataTableSliderFilter as s}from"./data-table-slider-filter.js";import{DataTableViewOptions as m}from"./data-table-view-options.js";import{Input as u}from"../input/index.js";import{cn as c}from"../../lib/utils.js";function p({table:n,children:o,className:s,...u}){let p=n.getState().columnFilters.length>0,f=r(()=>n.getAllColumns().filter(e=>e.getCanFilter()),[n]),b=a(()=>{n.resetColumnFilters()},[n]);return t("div",{role:"toolbar","aria-orientation":"horizontal",className:c("flex w-full items-start justify-between gap-2",s),...u,children:[t("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:[f.map(t=>e(d,{column:t},t.id)),p&&t(i,{"aria-label":"Reset filters",variant:"outline",size:"sm",onClick:b,children:[e(l,{}),"Limpar"]})]}),t("div",{className:"flex items-center gap-2",children:[o,e(m,{table:n})]})]})}function d({column:l}){{let r=l.columnDef.meta;return a(()=>{if(!r?.variant)return null;switch(r.variant){case"text":return e(u,{placeholder:r.placeholder??r.label,value:l.getFilterValue()??"",onChange:e=>l.setFilterValue(e.target.value),className:"h-9 w-40 lg:w-56",classNames:{input:"text-sm"}});case"number":return t("div",{className:"relative",children:[e(u,{type:"number",inputMode:"numeric",placeholder:r.placeholder??r.label,value:l.getFilterValue()??"",onChange:e=>l.setFilterValue(e.target.value),className:c("h-10 w-[120px]",r.unit&&"pr-8"),classNames:{input:"text-sm"}}),r.unit&&e("span",{className:"absolute top-0 right-0 bottom-0 flex items-center rounded-r-md bg-accent px-2 text-muted-foreground text-sm",children:r.unit})]});case"range":return e(s,{column:l,title:r.label??l.id});case"date":case"dateRange":return e(n,{column:l,title:r.label??l.id,multiple:"dateRange"===r.variant});case"select":case"multiSelect":return e(o,{column:l,title:r.label??l.id,options:r.options??[],multiple:"multiSelect"===r.variant});default:return null}},[l,r])()}}export{p as DataTableToolbar};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import{jsx as e,jsxs as l}from"react/jsx-runtime";import{CaretUpDownIcon as i,CheckIcon as o,SlidersHorizontalIcon as a}from"@phosphor-icons/react";import{Button as r}from"../button.js";import{Command as t,CommandEmpty as n,CommandGroup as c,CommandInput as s,CommandItem as m,CommandList as d}from"../command.js";import{Popover as p,PopoverContent as h,PopoverTrigger as u}from"../popover.js";import{cn as f}from"../../lib/utils.js";import{useMemo as g}from"react";function b({table:b}){let N=g(()=>b.getAllColumns().filter(e=>void 0!==e.accessorFn&&e.getCanHide()),[b]);return N.length<=0?null:l(p,{children:[e(u,{asChild:!0,children:l(r,{"aria-label":"Toggle columns",role:"combobox",variant:"outline",size:"sm",className:"ml-auto hidden lg:flex",children:[e(a,{}),"Ver",e(i,{className:"ml-auto opacity-50"})]})}),e(h,{align:"end",className:"w-44 p-0",children:l(t,{children:[e(s,{placeholder:"Buscar colunas..."}),l(d,{children:[e(n,{children:"Nenhuma coluna encontrada."}),e(c,{children:N.map(i=>l(m,{onSelect:()=>i.toggleVisibility(!i.getIsVisible()),children:[e("span",{className:"truncate",children:i.columnDef.meta?.label??i.id}),e(o,{className:f("ml-auto size-4 shrink-0",i.getIsVisible()?"opacity-100":"opacity-0")})]},i.id))})]})]})})]})}export{b as DataTableViewOptions};
|
|
2
|
+
import{jsx as e,jsxs as l}from"react/jsx-runtime";import{CaretUpDownIcon as i,CheckIcon as o,SlidersHorizontalIcon as a}from"@phosphor-icons/react";import{Button as r}from"../button/index.js";import{Command as t,CommandEmpty as n,CommandGroup as c,CommandInput as s,CommandItem as m,CommandList as d}from"../command.js";import{Popover as p,PopoverContent as h,PopoverTrigger as u}from"../popover.js";import{cn as f}from"../../lib/utils.js";import{useMemo as g}from"react";function b({table:b}){let N=g(()=>b.getAllColumns().filter(e=>void 0!==e.accessorFn&&e.getCanHide()),[b]);return N.length<=0?null:l(p,{children:[e(u,{asChild:!0,children:l(r,{"aria-label":"Toggle columns",role:"combobox",variant:"outline",size:"sm",className:"ml-auto hidden lg:flex",children:[e(a,{}),"Ver",e(i,{className:"ml-auto opacity-50"})]})}),e(h,{align:"end",className:"w-44 p-0",children:l(t,{children:[e(s,{placeholder:"Buscar colunas..."}),l(d,{children:[e(n,{children:"Nenhuma coluna encontrada."}),e(c,{children:N.map(i=>l(m,{onSelect:()=>i.toggleVisibility(!i.getIsVisible()),children:[e("span",{className:"truncate",children:i.columnDef.meta?.label??i.id}),e(o,{className:f("ml-auto size-4 shrink-0",i.getIsVisible()?"opacity-100":"opacity-0")})]},i.id))})]})]})})]})}export{b as DataTableViewOptions};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{CalendarBlankIcon as r}from"@phosphor-icons/react";import{format as o}from"date-fns";import{useState as i}from"react";import{cn as
|
|
2
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{CalendarBlankIcon as r}from"@phosphor-icons/react";import{format as o}from"date-fns";import{useState as i}from"react";import{cn as n}from"../../lib/utils.js";import{Button as a}from"../button/index.js";import{Calendar as m}from"../calendar.js";import{Popover as d,PopoverContent as s,PopoverTrigger as l}from"../popover.js";function c({value:c,date:f,defaultValue:p,placeholder:u,className:h,disabled:x=!1,onChange:b,...g}){let[j,y]=i(c||f);return t(d,{children:[e(l,{asChild:!0,children:t(a,{id:"date",variant:"outline",size:"default",className:n("min-w-60 justify-between rounded-md px-4 text-left font-normal text-sm hover:bg-background",!j&&"text-muted-foreground",h),disabled:x,children:[j?o(j,"dd/MM/yyyy"):e("span",{children:u||"Selecione a data"}),e(r,{className:"ml-4 size-4 text-foreground"})]})}),e(s,{className:"w-auto p-0",align:"start",children:e(m,{...g,mode:"single",selected:j??p,onSelect:e=>{y(e),b?.(e)}})})]})}export{c as DatePicker};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import{Fragment as e,jsx as r,jsxs as o}from"react/jsx-runtime";import{CalendarBlankIcon as t}from"@phosphor-icons/react";import{format as i}from"date-fns";import{useState as n}from"react";import{cn as d}from"../lib/utils.js";import{Button as m}from"./button.js";import{Calendar as a}from"./calendar.js";import{Popover as l,PopoverContent as s,PopoverTrigger as f}from"./popover.js";function c({startDate:c,endDate:u,onChange:h,placeholder:p,className:y,disabled:g=!1}){let[b,
|
|
2
|
+
import{Fragment as e,jsx as r,jsxs as o}from"react/jsx-runtime";import{CalendarBlankIcon as t}from"@phosphor-icons/react";import{format as i}from"date-fns";import{useState as n}from"react";import{cn as d}from"../lib/utils.js";import{Button as m}from"./button/index.js";import{Calendar as a}from"./calendar.js";import{Popover as l,PopoverContent as s,PopoverTrigger as f}from"./popover.js";function c({startDate:c,endDate:u,onChange:h,placeholder:p,className:y,disabled:g=!1}){let[b,x]=n({from:c,to:u});return o(l,{children:[r(f,{asChild:!0,children:r(m,{id:"date",variant:"outline",className:d("h-10 min-w-60 justify-between overflow-hidden rounded-md px-4 text-left font-normal hover:bg-background dark:hover:bg-input/50",!(b?.from||b?.to)&&"text-muted-foreground",y),disabled:g,children:o("div",{className:"flex flex-grow items-center",children:[r(t,{weight:"regular",className:"mr-2 size-4 text-foreground"}),b?.from?b.to?o(e,{children:[i(b.from,"dd/MM/yyyy")," -"," ",i(b.to,"dd/MM/yyyy")]}):i(b.from,"dd/MM/yyyy"):p||"Selecione um per\xedodo"]})})}),r(s,{className:"w-auto p-0",align:"start",children:r(a,{autoFocus:!0,mode:"range",defaultMonth:b?.from,selected:b,onSelect:e=>{x(e),h?.(e)},numberOfMonths:2,disabled:g,hasMonthAndYearSelection:!1})})]})}export{c as DatePickerWithRange};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import{Fragment as e,jsx as r,jsxs as t}from"react/jsx-runtime";import{CalendarBlankIcon as o,XIcon as s}from"@phosphor-icons/react";import{add as i,format as n}from"date-fns";import{forwardRef as a,useEffect as l,useImperativeHandle as
|
|
2
|
+
import{Fragment as e,jsx as r,jsxs as t}from"react/jsx-runtime";import{CalendarBlankIcon as o,XIcon as s}from"@phosphor-icons/react";import{add as i,format as n}from"date-fns";import{forwardRef as a,useEffect as l,useImperativeHandle as d,useRef as m,useState as c}from"react";import{ptBR as u}from"react-day-picker/locale";import{Button as h}from"../button/index.js";import{Popover as p,PopoverContent as f,PopoverTrigger as g}from"../popover.js";import{cn as y}from"../../lib/utils.js";import{Calendar as b}from"../calendar.js";import{TimePicker as H}from"../time-picker/index.js";let M=a(({locale:a=u,defaultPopupValue:M=new Date(new Date().setHours(0,0,0,0)),value:v,onChange:j,onMonthChange:x,hourCycle:N=24,yearRange:k=50,disabled:w=!1,displayFormat:C,granularity:D="minute",placeholder:S,className:T,min:P,max:$,triggerProps:z,hasCalendarIcon:E=!0,clearable:K=!1,...R},U)=>{let q,[A,B]=c(v??M),F=m(null),[G,I]=c(v??void 0);l(()=>{I(v)},[v]),d(U,()=>({...F.current,value:G}),[G]);let J={hour24:C?.hour24??`dd/MM/yyyy HH:mm${!D||"second"===D?":ss":""}`,hour12:C?.hour12??`dd/MM/yyyy hh:mm${!D||"second"===D?":ss":""} b`},L=u,{options:O,localize:Q,formatLong:V}=a;return O&&Q&&V&&(L={...u,options:O,localize:Q,formatLong:V}),P&&(q={before:P}),$&&(q={...q,after:$}),t(p,{children:[r(g,{disabled:w,asChild:!0,children:t(h,{variant:"outline",className:y("w-full justify-start gap-0 text-left font-normal",!G&&"text-muted-foreground",T),ref:F,...z,children:[E&&r(o,{className:"mr-2 h-4 w-4"}),G?t(e,{children:[r("span",{className:"flex-1",children:n(G,24===N?J.hour24:J.hour12,{locale:L})}),K&&r("div",{role:"button",onClick:e=>{e.stopPropagation(),e.preventDefault(),j?.(null)},onKeyUp:e=>{"Enter"===e.key&&j?.(null)},children:r(s,{className:"size-4"})})]}):r("span",{children:S})]})}),t(f,{className:"w-auto p-0",children:[r(b,{mode:"single",selected:G||void 0,month:A,onSelect:e=>{e&&(e.setHours(A?.getHours()??0,A?.getMinutes()??0,A?.getSeconds()??0),e&&(j?.(e),B(e),I(e)))},onMonthChange:e=>{if(!e)return;if(!M){e.setHours(A?.getHours()??0,A?.getMinutes()??0,A?.getSeconds()??0),x?.(e),B(e);return}let r=e.getTime()-M.getTime(),t=i(M,{days:Math.ceil(r/864e5)});t.setHours(A?.getHours()??0,A?.getMinutes()??0,A?.getSeconds()??0),x?.(t),B(t)},yearRange:k,locale:a,disabled:q,...R}),"day"!==D&&r("div",{className:"border-border border-t p-3",children:r(H,{onChange:e=>{j?.(e),I(e),e&&B(e)},date:A,hourCycle:N,granularity:D})})]})]})});M.displayName="DateTimePicker";export{M as DateTimePicker};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{CalendarBlankIcon as r,XIcon as t}from"@phosphor-icons/react";import{format as
|
|
2
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{CalendarBlankIcon as r,XIcon as t}from"@phosphor-icons/react";import{format as i}from"date-fns";import{useState as m}from"react";import{cn as n}from"../lib/utils.js";import{Button as a}from"./button/index.js";import{Calendar as l}from"./calendar.js";import{Popover as f,PopoverContent as d,PopoverTrigger as s}from"./popover.js";import{TimePicker as c}from"./time-picker/index.js";function p({startDate:p,endDate:h,onChange:y,placeholder:x,className:u,disabled:j=!1}){let[v,b]=m({from:p,to:h}),g=e=>{if(!e){b(void 0),y?.(void 0);return}b({from:e.from??v?.from,to:e.to}),y?.({from:e.from??v?.from,to:e.to})};return o(f,{children:[e(s,{asChild:!0,children:o(a,{id:"date",variant:"outline",className:n("h-12 min-w-96 justify-between px-4 text-left font-normal",!v?.from&&!v?.to&&"text-gray-400",u),disabled:j,children:[v?.from?v.to?`${i(v.from,"dd/MM/yyyy HH:mm")} - ${i(v.to,"dd/MM/yyyy HH:mm")}`:i(v.from,"dd/MM/yyyy HH:mm"):e("span",{children:x||"Selecione o per\xedodo"}),e(r,{size:20,className:"ml-2 text-gray-600"})]})}),o(d,{className:"w-auto p-0",children:[e(l,{mode:"range",selected:v,onSelect:g,numberOfMonths:2}),e("div",{className:"flex flex-col border-stroke border-t p-3",children:o("div",{className:"flex justify-between gap-4",children:[e(c,{onChange:e=>g({...v,from:e}),date:v?.from}),e(c,{onChange:e=>g({...v,to:e}),date:v?.to})]})}),e("div",{className:"flex flex-1 justify-center",children:o(a,{variant:"outline",className:"flex h-12 flex-1",onClick:()=>g(void 0),children:[e(t,{size:12})," Clear"]})})]})]})}export{p as DateTimePickerWithRange};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
import { buttonVariants } from '../button';
|
|
4
|
+
import { VariantProps } from '../../lib/utils';
|
|
5
|
+
type DialogProps = ComponentProps<typeof DialogPrimitive.Root>;
|
|
6
|
+
declare function Dialog(props: DialogProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
type DialogTriggerProps = ComponentProps<typeof DialogPrimitive.Trigger>;
|
|
8
|
+
declare function DialogTrigger(props: DialogTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
type DialogPortalProps = ComponentProps<typeof DialogPrimitive.Portal>;
|
|
10
|
+
declare function DialogPortal({ ...props }: DialogPortalProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
type DialogCloseProps = Omit<ComponentProps<typeof DialogPrimitive.Close>, 'ref'> & {
|
|
12
|
+
className?: string;
|
|
13
|
+
size?: VariantProps<typeof buttonVariants>['size'];
|
|
14
|
+
variant?: VariantProps<typeof buttonVariants>['variant'];
|
|
15
|
+
};
|
|
16
|
+
declare function DialogClose({ className, size, variant, ...props }: DialogCloseProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
type DialogOverlayProps = ComponentProps<typeof DialogPrimitive.Overlay>;
|
|
18
|
+
declare function DialogOverlay({ className, ...props }: DialogOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
type DialogContentProps = ComponentProps<typeof DialogPrimitive.Content> & {
|
|
20
|
+
classNames?: {
|
|
21
|
+
close?: string;
|
|
22
|
+
content?: string;
|
|
23
|
+
overlay?: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
declare function DialogContent({ children, className, classNames, ...props }: DialogContentProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
type DialogHeaderProps = ComponentProps<'div'>;
|
|
28
|
+
declare function DialogHeader({ className, ...props }: DialogHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
type DialogBodyProps = ComponentProps<'div'>;
|
|
30
|
+
declare function DialogBody({ className, ...props }: DialogBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
type DialogFooterProps = ComponentProps<'div'>;
|
|
32
|
+
declare function DialogFooter({ className, ...props }: DialogFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
type DialogTitleProps = ComponentProps<typeof DialogPrimitive.Title>;
|
|
34
|
+
declare function DialogTitle({ className, ...props }: DialogTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
type DialogDescriptionProps = ComponentProps<typeof DialogPrimitive.Description>;
|
|
36
|
+
declare function DialogDescription({ className, ...props }: DialogDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogBody, DialogFooter, DialogTitle, DialogDescription, DialogClose, DialogPortal, DialogOverlay, };
|
|
38
|
+
export type { DialogProps, DialogTriggerProps, DialogContentProps, DialogHeaderProps, DialogBodyProps, DialogFooterProps, DialogTitleProps, DialogDescriptionProps, DialogCloseProps, DialogPortalProps, DialogOverlayProps, };
|
|
39
|
+
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/dialog/dialog.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAM,YAAY,EAAE,MAAM,aAAa,CAAA;AAM9C,KAAK,WAAW,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAA;AAE9D,iBAAS,MAAM,CAAC,KAAK,EAAE,WAAW,2CAEjC;AAMD,KAAK,kBAAkB,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,CAAA;AAExE,iBAAS,aAAa,CAAC,KAAK,EAAE,kBAAkB,2CAE/C;AAMD,KAAK,iBAAiB,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,CAAA;AAEtE,iBAAS,YAAY,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,2CAEpD;AAMD,KAAK,gBAAgB,GAAG,IAAI,CAC1B,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,EAC5C,KAAK,CACN,GAAG;IACF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAA;IAClD,OAAO,CAAC,EAAE,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC,SAAS,CAAC,CAAA;CACzD,CAAA;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,IAAI,EACJ,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,gBAAgB,2CAQlB;AAMD,KAAK,kBAAkB,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,CAAA;AAExE,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,2CAWjE;AAMD,KAAK,kBAAkB,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG;IACzE,UAAU,CAAC,EAAE;QACX,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,CAAA;CACF,CAAA;AAED,iBAAS,aAAa,CAAC,EACrB,QAAQ,EACR,SAAS,EACT,UAAU,EACV,GAAG,KAAK,EACT,EAAE,kBAAkB,2CA2BpB;AAMD,KAAK,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAA;AAE9C,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,2CAW/D;AAMD,KAAK,eAAe,GAAG,cAAc,CAAC,KAAK,CAAC,CAAA;AAE5C,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,2CAQ3D;AAMD,KAAK,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAA;AAE9C,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,2CAW/D;AAMD,KAAK,gBAAgB,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAA;AAEpE,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,2CAW7D;AAMD,KAAK,sBAAsB,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,CAAA;AAEhF,iBAAS,iBAAiB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,sBAAsB,2CAQzE;AAMD,OAAO,EACL,MAAM,EACN,aAAa,EACb,aAAa,EACb,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,aAAa,GACd,CAAA;AACD,YAAY,EACV,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACnB,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import{jsx as a,jsxs as t}from"react/jsx-runtime";import{XIcon as e}from"@phosphor-icons/react";import{Close as o,Content as l,Description as s,Overlay as i,Portal as n,Root as r,Title as d,Trigger as c}from"@radix-ui/react-dialog";import{buttonVariants as g}from"../button/index.js";import{cn as m}from"../../lib/utils.js";function u(t){return a(r,{"data-slot":"dialog",...t})}function f(t){return a(c,{"data-slot":"dialog-trigger",...t})}function p({...t}){return a(n,{"data-slot":"dialog-portal",...t})}function x({className:t,size:e,variant:l="outline",...s}){return a(o,{className:g({className:t,size:e,variant:l}),"data-slot":"dialog-close",...s})}function N({className:t,...e}){return a(i,{className:m("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",t),"data-slot":"dialog-overlay",...e})}function D({children:s,className:i,classNames:n,...r}){return t(p,{children:[a(N,{className:n?.overlay}),t(l,{className:m("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg sm:rounded-lg",i,n?.content),"data-slot":"dialog-content-wrapper",...r,children:[s,t(o,{className:g({className:["absolute top-2.5 right-2.5 size-7",n?.close],size:"icon",variant:"ghost"}),children:[a(e,{className:"size-4"}),a("span",{className:"sr-only",children:"Close"})]})]})]})}function h({className:t,...e}){return a("div",{className:m("flex flex-col space-y-1.5 text-center sm:text-left",t),"data-slot":"dialog-header",...e})}function y({className:t,...e}){return a("main",{className:m("py-2",t),"data-slot":"dialog-body",...e})}function b({className:t,...e}){return a("footer",{className:m("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),"data-slot":"dialog-footer",...e})}function z({className:t,...e}){return a(d,{className:m("font-semibold text-lg leading-none tracking-tight",t),"data-slot":"dialog-title",...e})}function v({className:t,...e}){return a(s,{className:m("text-gray-600 text-sm",t),"data-slot":"dialog-description",...e})}export{u as Dialog,y as DialogBody,x as DialogClose,D as DialogContent,v as DialogDescription,b as DialogFooter,h as DialogHeader,N as DialogOverlay,p as DialogPortal,z as DialogTitle,f as DialogTrigger};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/dialog/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./dialog.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/input/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./input.js";export*from"./input-variants.js";
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { VariantProps } from 'tailwind-variants';
|
|
2
|
+
declare const inputVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
[key: string]: {
|
|
4
|
+
[key: string]: import("tailwind-variants").ClassValue | {
|
|
5
|
+
input?: import("tailwind-variants").ClassValue;
|
|
6
|
+
root?: import("tailwind-variants").ClassValue;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
} | {
|
|
10
|
+
[x: string]: {
|
|
11
|
+
[x: string]: import("tailwind-variants").ClassValue | {
|
|
12
|
+
input?: import("tailwind-variants").ClassValue;
|
|
13
|
+
root?: import("tailwind-variants").ClassValue;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
} | {}, {
|
|
17
|
+
root: string;
|
|
18
|
+
input: string;
|
|
19
|
+
}, undefined, {
|
|
20
|
+
[key: string]: {
|
|
21
|
+
[key: string]: import("tailwind-variants").ClassValue | {
|
|
22
|
+
input?: import("tailwind-variants").ClassValue;
|
|
23
|
+
root?: import("tailwind-variants").ClassValue;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
} | {}, {
|
|
27
|
+
root: string;
|
|
28
|
+
input: string;
|
|
29
|
+
}, import("tailwind-variants").TVReturnType<unknown, {
|
|
30
|
+
root: string;
|
|
31
|
+
input: string;
|
|
32
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
33
|
+
type InputVariants = VariantProps<typeof inputVariants>;
|
|
34
|
+
declare const inputVariantsSlots: {
|
|
35
|
+
root: (slotProps?: ({
|
|
36
|
+
[x: string]: string | number | undefined;
|
|
37
|
+
[x: number]: string | number | undefined;
|
|
38
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
39
|
+
[x: string]: string | number | undefined;
|
|
40
|
+
[x: number]: string | number | undefined;
|
|
41
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
42
|
+
[x: string]: string | number | undefined;
|
|
43
|
+
[x: number]: string | number | undefined;
|
|
44
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
45
|
+
[x: string]: string | number | undefined;
|
|
46
|
+
[x: number]: string | number | undefined;
|
|
47
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
48
|
+
[x: string]: string | number | undefined;
|
|
49
|
+
[x: number]: string | number | undefined;
|
|
50
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
51
|
+
input: (slotProps?: ({
|
|
52
|
+
[x: string]: string | number | undefined;
|
|
53
|
+
[x: number]: string | number | undefined;
|
|
54
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
55
|
+
[x: string]: string | number | undefined;
|
|
56
|
+
[x: number]: string | number | undefined;
|
|
57
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
58
|
+
[x: string]: string | number | undefined;
|
|
59
|
+
[x: number]: string | number | undefined;
|
|
60
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
61
|
+
[x: string]: string | number | undefined;
|
|
62
|
+
[x: number]: string | number | undefined;
|
|
63
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
64
|
+
[x: string]: string | number | undefined;
|
|
65
|
+
[x: number]: string | number | undefined;
|
|
66
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
67
|
+
} & {
|
|
68
|
+
root: (slotProps?: ({
|
|
69
|
+
[x: string]: string | number | undefined;
|
|
70
|
+
[x: number]: string | number | undefined;
|
|
71
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
72
|
+
[x: string]: string | number | undefined;
|
|
73
|
+
[x: number]: string | number | undefined;
|
|
74
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
75
|
+
[x: string]: string | number | undefined;
|
|
76
|
+
[x: number]: string | number | undefined;
|
|
77
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
78
|
+
[x: string]: string | number | undefined;
|
|
79
|
+
[x: number]: string | number | undefined;
|
|
80
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
81
|
+
[x: string]: string | number | undefined;
|
|
82
|
+
[x: number]: string | number | undefined;
|
|
83
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
84
|
+
input: (slotProps?: ({
|
|
85
|
+
[x: string]: string | number | undefined;
|
|
86
|
+
[x: number]: string | number | undefined;
|
|
87
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
88
|
+
[x: string]: string | number | undefined;
|
|
89
|
+
[x: number]: string | number | undefined;
|
|
90
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
91
|
+
[x: string]: string | number | undefined;
|
|
92
|
+
[x: number]: string | number | undefined;
|
|
93
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
94
|
+
[x: string]: string | number | undefined;
|
|
95
|
+
[x: number]: string | number | undefined;
|
|
96
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
97
|
+
[x: string]: string | number | undefined;
|
|
98
|
+
[x: number]: string | number | undefined;
|
|
99
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
100
|
+
} & {};
|
|
101
|
+
export { inputVariants, inputVariantsSlots };
|
|
102
|
+
export type { InputVariants };
|
|
103
|
+
//# sourceMappingURL=input-variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-variants.d.ts","sourceRoot":"","sources":["../../../../src/components/input/input-variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAMpD,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAMjB,CAAA;AAEF,KAAK,aAAa,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAA;AAEvD,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAkB,CAAA;AAM1C,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,CAAA;AAC5C,YAAY,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{tv as e}from"tailwind-variants";let t=e({slots:{root:"flex h-10 w-full items-center gap-4 rounded-md border border-input bg-background px-4 shadow-xs placeholder:text-muted-foreground focus-within:border-primary focus-within:outline-none data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50",input:"peer h-full w-full flex-1 overflow-hidden bg-transparent text-sm outline-none placeholder:text-muted-foreground"}}),r=t();export{t as inputVariants,r as inputVariantsSlots};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import * as InputPrimitive from '../../primitives/input';
|
|
3
|
+
import { InputVariants } from './input-variants';
|
|
4
|
+
type InputProps = ComponentProps<typeof InputPrimitive.Root> & Omit<ComponentProps<typeof InputPrimitive.Field>, 'prefix' | 'type'> & InputVariants & {
|
|
5
|
+
type?: string;
|
|
6
|
+
classNames?: {
|
|
7
|
+
wrapper?: string;
|
|
8
|
+
input?: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
declare function Input({ className, disabled, loaderPosition, loading, prefix, readOnly, spinner, suffix, classNames, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export { Input };
|
|
13
|
+
export type { InputProps };
|
|
14
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../src/components/input/input.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,cAAc,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,aAAa,EAAsB,MAAM,kBAAkB,CAAA;AAMpE,KAAK,UAAU,GAAG,cAAc,CAAC,OAAO,cAAc,CAAC,IAAI,CAAC,GAC1D,IAAI,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,KAAK,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC,GACpE,aAAa,GAAG;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE;QACX,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;CACF,CAAA;AAEH,iBAAS,KAAK,CAAC,EACb,SAAS,EACT,QAAQ,EACR,cAAc,EACd,OAAO,EACP,MAAM,EACN,QAAQ,EACR,OAAO,EACP,MAAM,EACN,UAAU,EACV,GAAG,KAAK,EACT,EAAE,UAAU,2CAsBZ;AAMD,OAAO,EAAE,KAAK,EAAE,CAAA;AAChB,YAAY,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import{jsx as i}from"react/jsx-runtime";import{Spinner as t}from"../spinner.js";import{Field as r,Root as s}from"../../primitives/input.js";import{inputVariantsSlots as a}from"./input-variants.js";function n({className:n,disabled:e,loaderPosition:o,loading:p,prefix:m,readOnly:l,spinner:u,suffix:d,classNames:f,...c}){return i(s,{className:a.root({className:[n,f?.wrapper]}),"data-slot":"input",disabled:e,loaderPosition:o,loading:p,prefix:m,readOnly:l,spinner:u||i(t,{}),suffix:d,children:i(r,{className:a.input({className:f?.input}),"data-slot":"input-item",...c})})}export{n as Input};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/input-otp/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./input-otp.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OTPInput } from 'input-otp';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
type InputOTPProps = ComponentProps<typeof OTPInput>;
|
|
4
|
+
declare function InputOTP({ className, containerClassName, pattern, ...props }: InputOTPProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
type InputOTPGroupProps = ComponentProps<'div'>;
|
|
6
|
+
declare function InputOTPGroup({ className, ...props }: InputOTPGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
type InputOTPSlotProps = ComponentProps<'div'> & {
|
|
8
|
+
index: number;
|
|
9
|
+
};
|
|
10
|
+
declare function InputOTPSlot({ className, index, ...props }: InputOTPSlotProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
type InputOTPSeparatorProps = ComponentProps<'div'>;
|
|
12
|
+
declare function InputOTPSeparator({ ...props }: InputOTPSeparatorProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS, } from 'input-otp';
|
|
14
|
+
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
|
|
15
|
+
export type { InputOTPProps, InputOTPGroupProps, InputOTPSlotProps, InputOTPSeparatorProps, };
|
|
16
|
+
//# sourceMappingURL=input-otp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-otp.d.ts","sourceRoot":"","sources":["../../../../src/components/input-otp/input-otp.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,QAAQ,EAGT,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,cAAc,EAAc,MAAM,OAAO,CAAA;AAOlD,KAAK,aAAa,GAAG,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAA;AAEpD,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,kBAAkB,EAClB,OAAO,EACP,GAAG,KAAK,EACT,EAAE,aAAa,2CAcf;AAMD,KAAK,kBAAkB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAA;AAE/C,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,2CASjE;AAMD,KAAK,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/C,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,2CAsBtE;AAMD,KAAK,sBAAsB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAA;AAEnD,iBAAS,iBAAiB,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,sBAAsB,2CAM9D;AAMD,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,4BAA4B,GAC7B,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAA;AACnE,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,GACvB,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{MinusIcon as r}from"@phosphor-icons/react";import{OTPInput as a,OTPInputContext as o,REGEXP_ONLY_CHARS as i,REGEXP_ONLY_DIGITS as n,REGEXP_ONLY_DIGITS_AND_CHARS as s}from"input-otp";import{useContext as l}from"react";import{cn as p}from"../../lib/utils.js";function u({className:e,containerClassName:r,pattern:o,...i}){return t(a,{"aria-label":"One-time password",className:p("disabled:cursor-not-allowed",e),containerClassName:p("flex items-center gap-2 has-[:disabled]:opacity-50",r),"data-slot":"input-otp",pattern:o||s,...i})}function c({className:e,...r}){return t("div",{className:p("flex items-center gap-1",e),"data-slot":"input-otp-group",role:"group",...r})}function d({className:r,index:a,...i}){let{isActive:n,char:s,hasFakeCaret:u}=l(o).slots[a];return e("div",{className:p("relative flex h-12 w-11 items-center justify-center rounded border border-stroke border-y text-base shadow-sm transition-all data-[active=true]:z-10 data-[active=true]:ring-1 data-[active=true]:ring-ring",r),"data-active":n,"data-slot":"input-otp-slot",...i,children:[s,u&&t("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:t("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})}function m({...e}){return t("div",{"data-slot":"input-otp-separator",...e,children:t(r,{})})}export{u as InputOTP,c as InputOTPGroup,m as InputOTPSeparator,d as InputOTPSlot,i as REGEXP_ONLY_CHARS,n as REGEXP_ONLY_DIGITS,s as REGEXP_ONLY_DIGITS_AND_CHARS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/input-password/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./input-password.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { InputVariants } from '../input';
|
|
3
|
+
import * as InputPrimitive from '../../primitives/input';
|
|
4
|
+
type InputPasswordProps = ComponentProps<typeof InputPrimitive.Root> & Omit<ComponentProps<typeof InputPrimitive.Field>, 'prefix' | 'type'> & InputVariants;
|
|
5
|
+
declare function InputPassword({ className, disabled, loaderPosition, loading, prefix, readOnly, spinner, suffix, ...props }: InputPasswordProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { InputPassword };
|
|
7
|
+
export type { InputPasswordProps };
|
|
8
|
+
//# sourceMappingURL=input-password.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-password.d.ts","sourceRoot":"","sources":["../../../../src/components/input-password/input-password.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAA4C,MAAM,OAAO,CAAA;AAEhF,OAAO,EAAE,aAAa,EAAsB,MAAM,oBAAoB,CAAA;AAEtE,OAAO,KAAK,cAAc,MAAM,oBAAoB,CAAA;AAMpD,KAAK,kBAAkB,GAAG,cAAc,CAAC,OAAO,cAAc,CAAC,IAAI,CAAC,GAClE,IAAI,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,KAAK,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC,GACpE,aAAa,CAAA;AAEf,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,cAAc,EACd,OAAO,EACP,MAAM,EACN,QAAQ,EACR,OAAO,EACP,MAAM,EACN,GAAG,KAAK,EACT,EAAE,kBAAkB,2CAgDpB;AAMD,OAAO,EAAE,aAAa,EAAE,CAAA;AACxB,YAAY,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import{jsx as s,jsxs as o}from"react/jsx-runtime";import{EyeIcon as i,EyeSlashIcon as r}from"@phosphor-icons/react";import{useCallback as a,useState as t}from"react";import{Button as e}from"../button/index.js";import{inputVariantsSlots as p}from"../input/index.js";import{Spinner as n}from"../spinner.js";import{Field as d,Root as l}from"../../primitives/input.js";function m({className:m,disabled:u,loaderPosition:c,loading:f,prefix:w,readOnly:x,spinner:N,suffix:b,...g}){let[h,j]=t("password"),z=a(()=>{j(s=>"password"===s?"text":"password")},[]);return o(l,{className:p.root({className:[!b&&"pr-1.5",m]}),"data-slot":"input-password",disabled:u,loaderPosition:c,loading:f,prefix:w,readOnly:x,spinner:N||s(n,{}),suffix:b,children:[s(d,{autoCapitalize:"none",className:p.input(),"data-slot":"input-password-item",type:h,...g}),s(e,{"aria-label":"password"===h?"Show password":"Hide password",className:"full size-8 rounded-full focus-visible:ring-0","data-slot":"input-password-toggle",disabled:u,prefix:"password"===h?s(r,{className:"size-6"}):s(i,{className:"size-6"}),size:"icon",variant:"ghost",onClick:z})]})}export{m as InputPassword};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import{jsx as t}from"react/jsx-runtime";import{useEffect as e,useState as r}from"react";import{cn as m}from"../lib/utils.js";import{Input as
|
|
2
|
+
import{jsx as t}from"react/jsx-runtime";import{useEffect as e,useState as r}from"react";import{cn as m}from"../lib/utils.js";import{Input as i}from"./input/index.js";function a({value:a,onChange:n,decimals:o=3,language:u="pt-BR",className:l,...p}){let c=10**o,[f,s]=r("");return e(()=>{"number"!=typeof a||Number.isNaN(a)||s(Math.round(a*c).toString())},[a,c]),t(i,{value:function(t){let e=Number(t)/c;return new Intl.NumberFormat(u,{style:"decimal",minimumFractionDigits:o,maximumFractionDigits:o}).format(e)}(f),onChange:function(t){let e=t.target.value,r=new Intl.NumberFormat(u).formatToParts(12345.6),m=r.find(t=>"group"===t.type)?.value||",",i=r.find(t=>"decimal"===t.type)?.value||".",a=e.replace(RegExp(`\\${m}`,"g"),"").replace(RegExp(`\\${i}`,"g"),"").replace(/\D/g,""),o=Number(a)/c;s(a),n(o)},className:m("h-10",l),...p})}export{a as MaskInput};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Locale } from 'date-fns';
|
|
2
2
|
interface MonthPickerProps {
|
|
3
|
-
|
|
3
|
+
value?: Date;
|
|
4
4
|
placeholder?: string;
|
|
5
5
|
className?: string;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
locale?: Locale;
|
|
8
8
|
onChange?: (date: Date | undefined) => void;
|
|
9
9
|
}
|
|
10
|
-
declare function MonthPicker({
|
|
10
|
+
declare function MonthPicker({ value, placeholder, className, disabled, locale, onChange, }: MonthPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export { MonthPicker };
|
|
12
|
+
export type { MonthPickerProps };
|
|
12
13
|
//# sourceMappingURL=month-picker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"month-picker.d.ts","sourceRoot":"","sources":["../../../src/components/month-picker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"month-picker.d.ts","sourceRoot":"","sources":["../../../src/components/month-picker.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAU,MAAM,EAAE,MAAM,UAAU,CAAA;AAWzC,UAAU,gBAAgB;IACxB,KAAK,CAAC,EAAE,IAAI,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI,CAAA;CAC5C;AAED,iBAAS,WAAW,CAAC,EACnB,KAAK,EACL,WAAW,EACX,SAAS,EACT,QAAgB,EAChB,MAAa,EACb,QAAQ,GACT,EAAE,gBAAgB,2CAqFlB;AAMD,OAAO,EAAE,WAAW,EAAE,CAAA;AACtB,YAAY,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{
|
|
2
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{CalendarBlankIcon as t,CaretLeftIcon as i,CaretRightIcon as n}from"@phosphor-icons/react";import{format as o}from"date-fns";import{ptBR as l}from"date-fns/locale";import{useMemo as a,useState as s}from"react";import{Button as m}from"./button/index.js";import{Popover as c,PopoverContent as d,PopoverTrigger as u}from"./popover.js";import{cn as f}from"../lib/utils.js";function p({value:p,placeholder:h,className:x,disabled:g=!1,locale:N=l,onChange:b}){let[v,M]=s(p),[w,y]=s(p?.getFullYear()??new Date().getFullYear()),j=a(()=>Array.from({length:12},(e,r)=>{let t=o(new Date(w,r,1),"MMMM",{locale:N});return{label:t.charAt(0).toUpperCase()+t.slice(1),index:r}}),[w,N]);return r(c,{children:[e(u,{asChild:!0,children:e(m,{id:"month",variant:"outline",className:f("min-w-60 justify-between rounded-md px-4 text-left font-normal hover:bg-background",!v&&"text-muted-foreground",x),disabled:g,children:r("div",{className:"flex flex-grow items-center",children:[e(t,{className:"mr-2 size-4 text-foreground"}),v?o(v,"MMMM yyyy",{locale:N}):h||"Selecione o m\xeas"]})})}),e(d,{className:"w-auto p-0",align:"start",children:r("div",{className:"w-64 p-4",children:[r("div",{className:"mb-4 flex items-center justify-between",children:[e(m,{onClick:()=>y(e=>e-1),variant:"outline",size:"icon",children:e(i,{className:"size-4 text-foreground"})}),e("span",{className:"font-medium text-lg",children:w}),e(m,{onClick:()=>y(e=>e+1),variant:"outline",size:"icon",children:e(n,{className:"size-4 text-foreground"})})]}),e("div",{className:"grid grid-cols-3 gap-2",children:j.map(r=>e(m,{variant:v?.getFullYear()===w&&v.getMonth()===r.index?"primary":"outline",className:f("rounded-md px-4 text-xs transition-colors"),onClick:()=>(e=>{let r=new Date(w,e,1);M(r),b?.(r)})(r.index),children:r.label},r.index))})]})})]})}export{p as MonthPicker};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import{jsx as e,jsxs as l}from"react/jsx-runtime";import{CaretDownIcon as r,CaretUpIcon as
|
|
2
|
+
import{jsx as e,jsxs as l}from"react/jsx-runtime";import{CaretDownIcon as r,CaretUpIcon as n,XIcon as t}from"@phosphor-icons/react";import{useEffect as a,useState as i}from"react";import{cn as o}from"../lib/utils.js";import{Badge as s,badgeVariants as c}from"./badge/index.js";import{Button as m}from"./button/index.js";import{Checkbox as d}from"./checkbox/index.js";import{Command as p,CommandEmpty as h,CommandGroup as u,CommandInput as f,CommandItem as g,CommandList as N}from"./command.js";import{Popover as b,PopoverContent as x,PopoverTrigger as w}from"./popover.js";function v({options:v=[],onValueChange:y,variant:j="secondary",value:k=[],placeholder:S="Select options",maxCount:z=2,modalPopover:C=!1,className:P,hasRemoveOptionBadge:D=!1,size:E,...K}){let[q,M]=i(k),[O,$]=i(!1),A=e=>{let l=q.includes(e)?q.filter(l=>l!==e):[...q,e];M(l),y?.(l)};return a(()=>{k.length>0&&k!==q&&M(k)},[k]),l(b,{open:O,onOpenChange:$,modal:C,children:[e(w,{asChild:!0,children:e(m,{...K,onClick:()=>{$(e=>!e)},variant:"outline",className:o("flex h-10 w-auto min-w-60 items-center justify-between rounded-md border border-input bg-background px-3 py-2 hover:bg-background dark:hover:bg-input/50",P),children:q.length>0?l("div",{className:"flex w-full items-center justify-between",children:[l("div",{className:"flex items-center gap-x-1",children:[q.slice(0,z).map(r=>{let n=v.find(e=>e.value===r);return l(s,{className:o(c({variant:j,size:E})),children:[D&&e(t,{className:"mr-1 size-3 cursor-pointer",onClick:e=>{e.stopPropagation(),A(r)}}),e("span",{className:"max-w-32 truncate",children:n?.label})]},r)}),q.length>z&&l(s,{className:o(c({variant:j,size:E})),children:[e(t,{className:"mr-1 size-3 cursor-pointer",onClick:e=>{e.stopPropagation();let l=q.slice(0,z);M(l),y?.(l)}}),`+ ${q.length-z} ...`]})]}),e("div",{className:"ml-4 flex items-center",children:O?e(n,{weight:"bold",className:"size-4 opacity-50"}):e(r,{weight:"bold",className:"size-4 opacity-50"})})]}):l("div",{className:"mx-auto flex w-full items-center justify-between",children:[e("span",{className:"font-normal text-sm placeholder:text-muted-foreground",children:"Select options"===S?"Selecione as op\xe7\xf5es":S}),O?e(n,{weight:"bold",className:"ml-2 size-4 opacity-50"}):e(r,{weight:"bold",className:"ml-2 size-4 opacity-50"})]})})}),e(x,{className:"w-auto p-0",align:"start",onEscapeKeyDown:()=>$(!1),children:l(p,{children:[e(f,{placeholder:"Pesquisar...",onKeyDown:e=>{"Enter"===e.key&&$(!0)}}),l(N,{children:[e(h,{children:"Nenhum resultado encontrado."}),l(u,{children:[l(g,{onSelect:()=>{if(q.length===v.length)M([]),y?.([]);else{let e=v.map(e=>e.value);M(e),y?.(e)}},className:"cursor-pointer",children:[e(d,{checked:q.length===v.length,className:"mr-2"}),e("span",{children:"(Selecionar todos)"})]},"all"),v.map(r=>l(g,{onSelect:()=>A(r.value),className:"cursor-pointer",children:[e(d,{checked:q.includes(r.value),className:"mr-2"}),e("span",{children:r.label})]},r.value))]})]})]})})]})}export{v as MultiSelect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as a,jsxs as i}from"react/jsx-runtime";import{CaretLeftIcon as n,CaretRightIcon as t,DotsThreeIcon as e}from"@phosphor-icons/react";import{cn as o}from"../lib/utils.js";import{buttonVariants as s}from"./button.js";function r({className:i,...n}){return a("nav",{"aria-label":"pagination",className:o("mx-auto flex w-full justify-center",i),"data-slot":"pagination",...n})}function l({className:i,...n}){return a("ul",{className:o("flex flex-row items-center gap-1",i),"data-slot":"pagination-content",...n})}function c(i){return a("li",{"data-slot":"pagination-item",...i})}function u({children:i,className:n,isActive:t,size:e="icon",...o}){return a("a",{"aria-current":t?"page":void 0,className:s({className:n,size:e,variant:t?"outline":"ghost"}),"data-slot":"pagination-link",...o,children:i})}function p({...t}){return i(u,{"aria-label":"Go to previous page","data-slot":"pagination-previous",size:"default",...t,children:[a(n,{className:"size-4"}),a("span",{children:"Previous"})]})}function m({...n}){return i(u,{"aria-label":"Go to next page","data-slot":"pagination-next",size:"default",...n,children:[a("span",{children:"Next"}),a(t,{className:"size-4"})]})}function g({className:n,...t}){return i("span",{"aria-hidden":!0,className:o("flex size-10 items-center justify-center",n),"data-slot":"pagination-ellipsis",...t,children:[a(e,{className:"size-4"}),a("span",{className:"sr-only",children:"More pages"})]})}export{r as Pagination,l as PaginationContent,g as PaginationEllipsis,c as PaginationItem,u as PaginationLink,m as PaginationNext,p as PaginationPrevious};
|
|
1
|
+
import{jsx as a,jsxs as i}from"react/jsx-runtime";import{CaretLeftIcon as n,CaretRightIcon as t,DotsThreeIcon as e}from"@phosphor-icons/react";import{cn as o}from"../lib/utils.js";import{buttonVariants as s}from"./button/index.js";function r({className:i,...n}){return a("nav",{"aria-label":"pagination",className:o("mx-auto flex w-full justify-center",i),"data-slot":"pagination",...n})}function l({className:i,...n}){return a("ul",{className:o("flex flex-row items-center gap-1",i),"data-slot":"pagination-content",...n})}function c(i){return a("li",{"data-slot":"pagination-item",...i})}function u({children:i,className:n,isActive:t,size:e="icon",...o}){return a("a",{"aria-current":t?"page":void 0,className:s({className:n,size:e,variant:t?"outline":"ghost"}),"data-slot":"pagination-link",...o,children:i})}function p({...t}){return i(u,{"aria-label":"Go to previous page","data-slot":"pagination-previous",size:"default",...t,children:[a(n,{className:"size-4"}),a("span",{children:"Previous"})]})}function m({...n}){return i(u,{"aria-label":"Go to next page","data-slot":"pagination-next",size:"default",...n,children:[a("span",{children:"Next"}),a(t,{className:"size-4"})]})}function g({className:n,...t}){return i("span",{"aria-hidden":!0,className:o("flex size-10 items-center justify-center",n),"data-slot":"pagination-ellipsis",...t,children:[a(e,{className:"size-4"}),a("span",{className:"sr-only",children:"More pages"})]})}export{r as Pagination,l as PaginationContent,g as PaginationEllipsis,c as PaginationItem,u as PaginationLink,m as PaginationNext,p as PaginationPrevious};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import{jsx as
|
|
2
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{XIcon as a}from"@phosphor-icons/react";import{Close as s,Content as o,Description as r,Overlay as n,Portal as i,Root as l,Title as c,Trigger as d}from"@radix-ui/react-dialog";import{buttonVariants as h}from"../button/index.js";import{sheetContentVariants as m}from"./sheet-content-variants.js";import{cn as u}from"../../lib/utils.js";function f({children:t,...a}){return e(l,{"data-slot":"sheet",...a,children:t})}function p({...t}){return e(d,{"data-slot":"sheet-trigger",...t})}function x({...t}){return e(i,{"data-slot":"sheet-portal",...t})}function g({className:t,...a}){return e(n,{"data-slot":"sheet-overlay",className:u("data-[state=open]:animation-duration-500 data-[state=closed]:animation-duration-500 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in",t),...a})}function N({children:s,className:r,classNames:n,side:i="right",...l}){return t(x,{children:[e(g,{className:n?.overlay}),t(o,{className:m({className:[n?.content,r],side:i}),"data-slot":"sheet-content",...l,children:[s,t(z,{className:h({className:["absolute top-4 right-4 size-7 p-0",n?.close],size:"icon",variant:"ghost"}),children:[e(a,{className:"size-4"}),e("span",{className:"sr-only",children:"Close"})]})]})]})}function S({className:t,...a}){return e("header",{className:u("flex shrink-0 flex-col gap-1.5 px-6 pt-6 pb-4 text-center sm:text-left",t),"data-slot":"sheet-header",...a})}function b({className:t,...a}){return e("main",{className:u("px-6 py-2",t),"data-slot":"sheet-body",...a})}function y({className:t,...a}){return e("footer",{className:u("flex shrink-0 flex-col-reverse gap-2 px-6 pt-4 pb-6 sm:flex-row sm:justify-end",t),"data-slot":"sheet-footer",...a})}function v({className:t,...a}){return e(c,{className:u("font-semibold text-lg",t),"data-slot":"sheet-title",...a})}function j({className:t,...a}){return e(r,{className:u("text-gray-400 text-sm",t),"data-slot":"sheet-description",...a})}function z({className:t,size:a,variant:o="ghost",...r}){return e(s,{className:h({className:t,size:a,variant:o}),"data-slot":"sheet-close",...r})}export{f as Sheet,b as SheetBody,z as SheetClose,N as SheetContent,j as SheetDescription,y as SheetFooter,S as SheetHeader,g as SheetOverlay,x as SheetPortal,v as SheetTitle,p as SheetTrigger};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/switch/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./switch.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
type SwitchProps = ComponentProps<typeof SwitchPrimitives.Root>;
|
|
4
|
+
declare function Switch({ className, ...props }: SwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export { Switch };
|
|
6
|
+
export type { SwitchProps };
|
|
7
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../../src/components/switch/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAO3C,KAAK,WAAW,GAAG,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAA;AAE/D,iBAAS,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,2CAgBnD;AAMD,OAAO,EAAE,MAAM,EAAE,CAAA;AACjB,YAAY,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import{jsx as t}from"react/jsx-runtime";import{Root as a,Thumb as e}from"@radix-ui/react-switch";import{cn as r}from"../../lib/utils.js";function i({className:i,...o}){return t(a,{className:r("relative h-6 w-11 rounded-full bg-input outline-none enabled:cursor-pointer disabled:cursor-not-allowed disabled:opacity-25 data-[state=checked]:bg-primary",i),"data-slot":"switch",...o,children:t(e,{className:"block size-5 translate-x-0.5 rounded-full bg-white shadow-elevation transition-transform duration-100 will-change-transform data-[state=checked]:translate-x-5.5","data-slot":"switch-thumb"})})}export{i as Switch};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{MoonStar as t,Sun as a}from"lucide-react";import{useTheme as
|
|
2
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{MoonStar as t,Sun as a}from"lucide-react";import{useTheme as i}from"next-themes";import{Button as l}from"./button/index.js";import{DropdownMenu as n,DropdownMenuContent as o,DropdownMenuItem as m,DropdownMenuTrigger as s}from"./dropdown-menu.js";function c(){let{setTheme:c}=i();return r(n,{children:[e(s,{asChild:!0,children:r(l,{variant:"outline",size:"icon",children:[e(a,{className:"dark:-rotate-90 h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:scale-0"}),e(t,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),e("span",{className:"sr-only",children:"Toggle theme"})]})}),r(o,{align:"end",children:[e(m,{onClick:()=>c("light"),children:"Light"}),e(m,{onClick:()=>c("dark"),children:"Dark"}),e(m,{onClick:()=>c("system"),children:"System"})]})]})}export{c as ThemeToggle};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import{jsx as e}from"react/jsx-runtime";import{useEffect as t,useMemo as r,useState as n}from"react";import{cn as o}from"../../lib/index.js";import{getArrowByType as a,getDateByType as i,setDateByType as p}from"../../lib/date-picker.js";import{Input as s}from"../input.js";function u({className:u,type:c="tel",value:l,id:m,name:f,date:w=new Date(new Date().setHours(0,0,0,0)),onDateChange:k,onChange:y,onKeyDown:D,picker:
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import{useEffect as t,useMemo as r,useState as n}from"react";import{cn as o}from"../../lib/index.js";import{getArrowByType as a,getDateByType as i,setDateByType as p}from"../../lib/date-picker.js";import{Input as s}from"../input/index.js";function u({className:u,type:c="tel",value:l,id:m,name:f,date:w=new Date(new Date().setHours(0,0,0,0)),onDateChange:k,onChange:y,onKeyDown:D,picker:d,period:x,onLeftFocus:b,onRightFocus:A,...T}){let[g,h]=n(!1),[j,v]=n("0");t(()=>{if(g){let e=setTimeout(()=>{h(!1)},2e3);return()=>clearTimeout(e)}},[g]);let N=r(()=>i(w,d),[w,d]);return e(s,{id:m||d,name:f||d,className:o("w-[48px] px-3 font-mono text-base tabular-nums caret-transparent focus:bg-accent focus:text-accent-foreground [&::-webkit-inner-spin-button]:appearance-none",u),classNames:{input:"text-center "},value:l||N,onChange:e=>{e.preventDefault(),y?.(e)},type:c,inputMode:"decimal",onKeyDown:e=>{D?.(e),(e=>{if("Tab"!==e.key){if(e.preventDefault(),"ArrowRight"===e.key&&A?.(),"ArrowLeft"===e.key&&b?.(),["ArrowUp","ArrowDown"].includes(e.key)){let t=a(N,"ArrowUp"===e.key?1:-1,d);g&&h(!1);let r=w?new Date(w):new Date;k?.(p(r,t,d,x))}if(e.key>="0"&&e.key<="9"){var t;"12hours"===d&&v(e.key);let r=(t=e.key,"12hours"===d&&g&&"1"===N.slice(1,2)&&"0"===j?`0${t}`:g?N.slice(1,2)+t:`0${t}`);g&&A?.(),h(e=>!e);let n=w?new Date(w):new Date;k?.(p(n,r,d,x))}}})(e)},...T})}u.displayName="TimePickerInput";export{u as TimePickerInput};
|