@gbmtech/aurora-ui 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/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-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.cjs +1 -1
- package/dist/cjs/components/input-password.cjs +1 -1
- package/dist/cjs/components/month-picker.cjs +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/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/index.cjs +1 -1
- package/dist/cjs/lib/index.cjs +1 -1
- 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/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-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.js +1 -1
- package/dist/esm/components/input-password.js +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/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/index.js +1 -1
- 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/switch.d.ts +0 -5
- package/dist/cjs/components/switch.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/switch.d.ts +0 -5
- package/dist/esm/components/switch.d.ts.map +0 -1
- package/dist/esm/components/switch.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import{Calendar as a,Check as l,FunnelSimple as r,SealCheck as i,TextAlignLeft as o,X as c}from"@phosphor-icons/react";import{useQueryState as s}from"nuqs";import{useCallback as d,useEffect as u,useId as m,useMemo as p,useRef as f,useState as h}from"react";import{Button as v}from"../button.js";import{Calendar as g}from"../calendar.js";import{Command as b,CommandEmpty as N,CommandGroup as w,CommandInput as x,CommandItem as D,CommandList as y}from"../command.js";import{DataTableRangeFilter as S}from"./data-table-range-filter.js";import{Input as C}from"../input.js";import{Popover as I,PopoverContent as k,PopoverTrigger as T}from"../popover.js";import{Select as F,SelectContent as j,SelectItem as z,SelectTrigger as E,SelectValue as $}from"../select.js";import{useDebouncedCallback as L}from"../../hooks/use-debounced-callback.js";import{getDefaultFilterOperator as A,getFilterOperators as O}from"../../lib/data-table.js";import{formatDate as K}from"../../lib/format.js";import{generateId as _}from"../../lib/id.js";import{getFiltersStateParser as B}from"../../lib/parsers.js";import{cn as M}from"../../lib/utils.js";let H=["backspace","delete"];function R({table:a,debounceMs:l=300,throttleMs:i=50,shallow:o=!0,align:g="start",...S}){let C=m(),F=p(()=>a.getAllColumns().filter(e=>e.columnDef.enableColumnFilter),[a]),[j,z]=h(!1),[E,$]=h(null),[O,K]=h(""),R=f(null),U=f(null),P=d(e=>{z(e),e||setTimeout(()=>{$(null),K("")},100)},[]),G=d(e=>{H.includes(e.key.toLowerCase())&&!O&&E&&(e.preventDefault(),$(null))},[O,E]),[J,Q]=s("filters",B(F.map(e=>e.id)).withDefault([]).withOptions({clearOnDefault:!0,shallow:o,throttleMs:i})),W=L(Q,l),X=d((e,t)=>{if(!t.trim()&&e.columnDef.meta?.variant!=="boolean")return;let n=e.columnDef.meta?.variant==="multiSelect"?[t]:t;W([...J,{id:e.id,value:n,variant:e.columnDef.meta?.variant??"text",operator:A(e.columnDef.meta?.variant??"text"),filterId:_({length:8})}]),z(!1),setTimeout(()=>{$(null),K("")},100)},[J,W]),Y=d(e=>{W(J.filter(t=>t.filterId!==e)),requestAnimationFrame(()=>{R.current?.focus()})},[J,W]),Z=d((e,t)=>{W(n=>n.map(n=>n.filterId===e?{...n,...t}:n))},[W]),ee=d(()=>{W([])},[W]);u(()=>{function e(e){!(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)&&("f"!==e.key.toLowerCase()||e.ctrlKey||e.metaKey||e.shiftKey||(e.preventDefault(),z(!0)),"f"===e.key.toLowerCase()&&e.shiftKey&&!j&&J.length>0&&(e.preventDefault(),Y(J[J.length-1]?.filterId??"")))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[j,J,Y]);let et=d(e=>{H.includes(e.key.toLowerCase())&&J.length>0&&(e.preventDefault(),Y(J[J.length-1]?.filterId??""))},[J,Y]);return n("div",{className:"flex flex-wrap items-center gap-2",children:[J.map(e=>t(V,{filter:e,filterItemId:`${C}-filter-${e.filterId}`,columns:F,onFilterUpdate:Z,onFilterRemove:Y},e.filterId)),J.length>0&&t(v,{"aria-label":"Reset all filters",variant:"outline",size:"icon",className:"size-8",onClick:ee,children:t(c,{})}),n(I,{open:j,onOpenChange:P,children:[t(T,{asChild:!0,children:n(v,{"aria-label":"Open filter command menu",variant:"outline",size:J.length>0?"icon":"sm",className:M(J.length>0&&"size-8","h-10"),ref:R,onKeyDown:et,children:[t(r,{}),J.length>0?null:"Filter"]})}),t(k,{align:g,className:"w-full max-w-[var(--radix-popover-content-available-width)] origin-[var(--radix-popover-content-transform-origin)] p-0",...S,children:n(b,{loop:!0,className:"[&_[cmdk-input-wrapper]_svg]:hidden",children:[t(x,{ref:U,placeholder:E?E.columnDef.meta?.label??E.id:"Search fields...",value:O,onValueChange:K,onKeyDown:G}),t(y,{children:E?n(e,{children:[E.columnDef.meta?.options&&t(N,{children:"No options found."}),t(q,{column:E,value:O,onSelect:e=>X(E,e)})]}):n(e,{children:[t(N,{children:"No fields found."}),t(w,{children:F.map(e=>n(D,{value:e.id,onSelect:()=>{$(e),K(""),requestAnimationFrame(()=>{U.current?.focus()})},children:[e.columnDef.meta?.icon&&t(e.columnDef.meta.icon,{}),t("span",{className:"truncate",children:e.columnDef.meta?.label??e.id})]},e.id))})]})})]})})]})]})}function V({filter:r,filterItemId:i,columns:o,onFilterUpdate:s,onFilterRemove:u}){{let[m,p]=h(!1),[f,L]=h(!1),[_,B]=h(!1),R=o.find(e=>e.id===r.id);if(!R)return null;let V=`${i}-operator-listbox`,q=`${i}-input`,U=R.columnDef.meta,P=O(r.variant);return n("div",{role:"listitem",id:i,className:"flex h-10 items-center rounded-md bg-background",onKeyDown:d(e=>{!(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)&&(m||f||_||H.includes(e.key.toLowerCase())&&(e.preventDefault(),u(r.filterId)))},[r.filterId,m,f,_,u]),children:[n(I,{open:m,onOpenChange:p,children:[t(T,{asChild:!0,children:n(v,{variant:"ghost",size:"sm",className:"rounded-none rounded-l-md border border-r-0 font-normal dark:bg-input/30",children:[U?.icon&&t(U.icon,{className:"text-muted-foreground"}),U?.label??R.id]})}),t(k,{align:"start",className:"w-48 origin-[var(--radix-popover-content-transform-origin)] p-0",children:n(b,{loop:!0,children:[t(x,{placeholder:"Search fields..."}),n(y,{children:[t(N,{children:"No fields found."}),t(w,{children:o.map(e=>n(D,{value:e.id,onSelect:()=>{s(r.filterId,{id:e.id,variant:e.columnDef.meta?.variant??"text",operator:A(e.columnDef.meta?.variant??"text"),value:""}),p(!1)},children:[e.columnDef.meta?.icon&&t(e.columnDef.meta.icon,{}),t("span",{className:"truncate",children:e.columnDef.meta?.label??e.id}),t(l,{className:M("ml-auto",e.id===r.id?"opacity-100":"opacity-0")})]},e.id))})]})]})})]}),n(F,{open:f,onOpenChange:L,value:r.operator,onValueChange:e=>s(r.filterId,{operator:e,value:"isEmpty"===e||"isNotEmpty"===e?"":r.value}),children:[t(E,{"aria-controls":V,className:"h-10 rounded-none border-r-0 px-2.5 lowercase [&[data-size]]:h-10 [&_svg]:hidden",children:t($,{placeholder:r.operator})}),t(j,{id:V,className:"origin-[var(--radix-select-content-transform-origin)]",children:P.map(e=>t(z,{className:"lowercase",value:e.value,children:e.label},e.value))})]}),function({filter:r,column:i,inputId:o,onFilterUpdate:c,showValueSelector:s,setShowValueSelector:d}){if("isEmpty"===r.operator||"isNotEmpty"===r.operator)return t("div",{id:o,role:"status","aria-label":`${i.columnDef.meta?.label} filter is ${"isEmpty"===r.operator?"empty":"not empty"}`,"aria-live":"polite",className:"h-full w-16 rounded-none border bg-transparent px-1.5 py-0.5 text-muted-foreground dark:bg-input/30"});switch(r.variant){case"text":case"number":case"range":{if("range"===r.variant&&"isBetween"===r.operator||"isBetween"===r.operator)return t(S,{filter:r,column:i,inputId:o,onFilterUpdate:c,className:"size-full max-w-28 gap-0 [&_[data-slot='range-min']]:border-r-0 [&_input]:rounded-none [&_input]:px-1.5"});let e="number"===r.variant||"range"===r.variant;return t(C,{id:o,type:e?"number":"text",inputMode:e?"numeric":void 0,placeholder:i.columnDef.meta?.placeholder??"Enter value...",className:"h-full w-24 rounded-none px-1.5",defaultValue:"string"==typeof r.value?r.value:"",onChange:e=>c(r.filterId,{value:e.target.value})})}case"boolean":{let e=`${o}-listbox`;return n(F,{open:s,onOpenChange:d,value:"string"==typeof r.value?r.value:"true",onValueChange:e=>c(r.filterId,{value:e}),children:[t(E,{id:o,"aria-controls":e,className:"rounded-none bg-transparent px-1.5 py-0.5 [&_svg]:hidden",children:t($,{placeholder:r.value?"True":"False"})}),n(j,{id:e,children:[t(z,{value:"true",children:"True"}),t(z,{value:"false",children:"False"})]})]})}case"select":case"multiSelect":{let a=`${o}-listbox`,u=i.columnDef.meta?.options??[],m=Array.isArray(r.value)?r.value:[r.value],p=u.filter(e=>m.includes(e.value));return n(I,{open:s,onOpenChange:d,children:[t(T,{asChild:!0,children:t(v,{id:o,"aria-controls":a,variant:"ghost",size:"sm",className:"h-full min-w-16 rounded-none border px-1.5 font-normal dark:bg-input/30",children:0===p.length?"multiSelect"===r.variant?"Select options...":"Select option...":n(e,{children:[t("div",{className:"-space-x-2 flex items-center rtl:space-x-reverse",children:p.map(e=>e.icon?t("div",{className:"rounded-full border bg-background p-0.5",children:t(e.icon,{className:"size-3.5"})},e.value):null)}),t("span",{className:"truncate",children:p.length>1?`${p.length} selected`:p[0]?.label})]})})}),t(k,{id:a,align:"start",className:"w-48 origin-[var(--radix-popover-content-transform-origin)] p-0",children:n(b,{children:[t(x,{placeholder:"Search options..."}),n(y,{children:[t(N,{children:"No options found."}),t(w,{children:u.map(e=>n(D,{value:e.value,onSelect:()=>{let t="multiSelect"===r.variant?m.includes(e.value)?m.filter(t=>t!==e.value):[...m,e.value]:e.value;c(r.filterId,{value:t})},children:[e.icon&&t(e.icon,{}),t("span",{className:"truncate",children:e.label}),"multiSelect"===r.variant&&t(l,{className:M("ml-auto",m.includes(e.value)?"opacity-100":"opacity-0")})]},e.value))})]})]})})]})}case"date":case"dateRange":{let e=`${o}-listbox`,l=Array.isArray(r.value)?r.value.filter(Boolean):[r.value,r.value].filter(Boolean),i="isBetween"===r.operator&&2===l.length?`${K(new Date(Number(l[0])))} - ${K(new Date(Number(l[1])))}`:l[0]?K(new Date(Number(l[0]))):"Pick date...";return n(I,{open:s,onOpenChange:d,children:[t(T,{asChild:!0,children:n(v,{id:o,"aria-controls":e,variant:"ghost",size:"sm",className:M("h-full rounded-none border px-1.5 font-normal dark:bg-input/30",!r.value&&"text-muted-foreground"),children:[t(a,{className:"size-3.5"}),t("span",{className:"truncate",children:i})]})}),t(k,{id:e,align:"start",className:"w-auto origin-[var(--radix-popover-content-transform-origin)] p-0",children:"isBetween"===r.operator?t(g,{mode:"range",initialFocus:!0,selected:2===l.length?{from:new Date(Number(l[0])),to:new Date(Number(l[1]))}:{from:new Date,to:new Date},onSelect:e=>{c(r.filterId,{value:e?[(e.from?.getTime()??"").toString(),(e.to?.getTime()??"").toString()]:[]})}}):t(g,{mode:"single",initialFocus:!0,selected:l[0]?new Date(Number(l[0])):void 0,onSelect:e=>{c(r.filterId,{value:(e?.getTime()??"").toString()})}})})]})}default:return null}}({filter:r,column:R,inputId:q,onFilterUpdate:s,showValueSelector:_,setShowValueSelector:B}),t(v,{"aria-controls":i,variant:"ghost",size:"sm",className:"h-full rounded-none rounded-r-md border border-l-0 px-1.5 font-normal dark:bg-input/30",onClick:()=>u(r.filterId),children:t(c,{className:"size-3.5"})})]},r.filterId)}}function q({column:a,value:l,onSelect:r}){switch(a.columnDef.meta?.variant??"text"){case"boolean":return n(w,{children:[t(D,{value:"true",onSelect:()=>r("true"),children:"True"}),t(D,{value:"false",onSelect:()=>r("false"),children:"False"})]});case"select":case"multiSelect":return t(w,{children:a.columnDef.meta?.options?.map(e=>n(D,{value:e.value,onSelect:()=>r(e.value),children:[e.icon&&t(e.icon,{}),t("span",{className:"truncate",children:e.label}),e.count&&t("span",{className:"ml-auto font-mono text-xs",children:e.count})]},e.value))});case"date":case"dateRange":return t(g,{initialFocus:!0,mode:"single",selected:l?new Date(l):void 0,onSelect:e=>r(e?.getTime().toString()??"")});default:{let a=!l.trim();return t(w,{children:t(D,{value:l,onSelect:()=>r(l),disabled:a,children:a?n(e,{children:[t(o,{}),t("span",{children:"Type to add filter..."})]}):n(e,{children:[t(i,{}),n("span",{className:"truncate",children:['Filter by "',l,'"']})]})})})}}}export{R as DataTableFilterMenu};
|
|
2
|
+
import{Fragment as e,jsx as n,jsxs as t}from"react/jsx-runtime";import{Calendar as a,Check as l,FunnelSimple as r,SealCheck as i,TextAlignLeft as o,X as c}from"@phosphor-icons/react";import{useQueryState as s}from"nuqs";import{useCallback as d,useEffect as u,useId as m,useMemo as p,useRef as f,useState as h}from"react";import{Button as v}from"../button/index.js";import{Calendar as g}from"../calendar.js";import{Command as b,CommandEmpty as N,CommandGroup as w,CommandInput as x,CommandItem as D,CommandList as y}from"../command.js";import{DataTableRangeFilter as S}from"./data-table-range-filter.js";import{Input as C}from"../input.js";import{Popover as I,PopoverContent as k,PopoverTrigger as T}from"../popover.js";import{Select as F,SelectContent as j,SelectItem as z,SelectTrigger as E,SelectValue as $}from"../select.js";import{useDebouncedCallback as L}from"../../hooks/use-debounced-callback.js";import{getDefaultFilterOperator as A,getFilterOperators as O}from"../../lib/data-table.js";import{formatDate as K}from"../../lib/format.js";import{generateId as _}from"../../lib/id.js";import{getFiltersStateParser as B}from"../../lib/parsers.js";import{cn as M}from"../../lib/utils.js";let H=["backspace","delete"];function R({table:a,debounceMs:l=300,throttleMs:i=50,shallow:o=!0,align:g="start",...S}){let C=m(),F=p(()=>a.getAllColumns().filter(e=>e.columnDef.enableColumnFilter),[a]),[j,z]=h(!1),[E,$]=h(null),[O,K]=h(""),R=f(null),U=f(null),P=d(e=>{z(e),e||setTimeout(()=>{$(null),K("")},100)},[]),G=d(e=>{H.includes(e.key.toLowerCase())&&!O&&E&&(e.preventDefault(),$(null))},[O,E]),[J,Q]=s("filters",B(F.map(e=>e.id)).withDefault([]).withOptions({clearOnDefault:!0,shallow:o,throttleMs:i})),W=L(Q,l),X=d((e,n)=>{if(!n.trim()&&e.columnDef.meta?.variant!=="boolean")return;let t=e.columnDef.meta?.variant==="multiSelect"?[n]:n;W([...J,{id:e.id,value:t,variant:e.columnDef.meta?.variant??"text",operator:A(e.columnDef.meta?.variant??"text"),filterId:_({length:8})}]),z(!1),setTimeout(()=>{$(null),K("")},100)},[J,W]),Y=d(e=>{W(J.filter(n=>n.filterId!==e)),requestAnimationFrame(()=>{R.current?.focus()})},[J,W]),Z=d((e,n)=>{W(t=>t.map(t=>t.filterId===e?{...t,...n}:t))},[W]),ee=d(()=>{W([])},[W]);u(()=>{function e(e){!(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)&&("f"!==e.key.toLowerCase()||e.ctrlKey||e.metaKey||e.shiftKey||(e.preventDefault(),z(!0)),"f"===e.key.toLowerCase()&&e.shiftKey&&!j&&J.length>0&&(e.preventDefault(),Y(J[J.length-1]?.filterId??"")))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[j,J,Y]);let en=d(e=>{H.includes(e.key.toLowerCase())&&J.length>0&&(e.preventDefault(),Y(J[J.length-1]?.filterId??""))},[J,Y]);return t("div",{className:"flex flex-wrap items-center gap-2",children:[J.map(e=>n(V,{filter:e,filterItemId:`${C}-filter-${e.filterId}`,columns:F,onFilterUpdate:Z,onFilterRemove:Y},e.filterId)),J.length>0&&n(v,{"aria-label":"Reset all filters",variant:"outline",size:"icon",className:"size-8",onClick:ee,children:n(c,{})}),t(I,{open:j,onOpenChange:P,children:[n(T,{asChild:!0,children:t(v,{"aria-label":"Open filter command menu",variant:"outline",size:J.length>0?"icon":"sm",className:M(J.length>0&&"size-8","h-10"),ref:R,onKeyDown:en,children:[n(r,{}),J.length>0?null:"Filter"]})}),n(k,{align:g,className:"w-full max-w-[var(--radix-popover-content-available-width)] origin-[var(--radix-popover-content-transform-origin)] p-0",...S,children:t(b,{loop:!0,className:"[&_[cmdk-input-wrapper]_svg]:hidden",children:[n(x,{ref:U,placeholder:E?E.columnDef.meta?.label??E.id:"Search fields...",value:O,onValueChange:K,onKeyDown:G}),n(y,{children:E?t(e,{children:[E.columnDef.meta?.options&&n(N,{children:"No options found."}),n(q,{column:E,value:O,onSelect:e=>X(E,e)})]}):t(e,{children:[n(N,{children:"No fields found."}),n(w,{children:F.map(e=>t(D,{value:e.id,onSelect:()=>{$(e),K(""),requestAnimationFrame(()=>{U.current?.focus()})},children:[e.columnDef.meta?.icon&&n(e.columnDef.meta.icon,{}),n("span",{className:"truncate",children:e.columnDef.meta?.label??e.id})]},e.id))})]})})]})})]})]})}function V({filter:r,filterItemId:i,columns:o,onFilterUpdate:s,onFilterRemove:u}){{let[m,p]=h(!1),[f,L]=h(!1),[_,B]=h(!1),R=o.find(e=>e.id===r.id);if(!R)return null;let V=`${i}-operator-listbox`,q=`${i}-input`,U=R.columnDef.meta,P=O(r.variant);return t("div",{role:"listitem",id:i,className:"flex h-10 items-center rounded-md bg-background",onKeyDown:d(e=>{!(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)&&(m||f||_||H.includes(e.key.toLowerCase())&&(e.preventDefault(),u(r.filterId)))},[r.filterId,m,f,_,u]),children:[t(I,{open:m,onOpenChange:p,children:[n(T,{asChild:!0,children:t(v,{variant:"ghost",size:"sm",className:"rounded-none rounded-l-md border border-r-0 font-normal dark:bg-input/30",children:[U?.icon&&n(U.icon,{className:"text-muted-foreground"}),U?.label??R.id]})}),n(k,{align:"start",className:"w-48 origin-[var(--radix-popover-content-transform-origin)] p-0",children:t(b,{loop:!0,children:[n(x,{placeholder:"Search fields..."}),t(y,{children:[n(N,{children:"No fields found."}),n(w,{children:o.map(e=>t(D,{value:e.id,onSelect:()=>{s(r.filterId,{id:e.id,variant:e.columnDef.meta?.variant??"text",operator:A(e.columnDef.meta?.variant??"text"),value:""}),p(!1)},children:[e.columnDef.meta?.icon&&n(e.columnDef.meta.icon,{}),n("span",{className:"truncate",children:e.columnDef.meta?.label??e.id}),n(l,{className:M("ml-auto",e.id===r.id?"opacity-100":"opacity-0")})]},e.id))})]})]})})]}),t(F,{open:f,onOpenChange:L,value:r.operator,onValueChange:e=>s(r.filterId,{operator:e,value:"isEmpty"===e||"isNotEmpty"===e?"":r.value}),children:[n(E,{"aria-controls":V,className:"h-10 rounded-none border-r-0 px-2.5 lowercase [&[data-size]]:h-10 [&_svg]:hidden",children:n($,{placeholder:r.operator})}),n(j,{id:V,className:"origin-[var(--radix-select-content-transform-origin)]",children:P.map(e=>n(z,{className:"lowercase",value:e.value,children:e.label},e.value))})]}),function({filter:r,column:i,inputId:o,onFilterUpdate:c,showValueSelector:s,setShowValueSelector:d}){if("isEmpty"===r.operator||"isNotEmpty"===r.operator)return n("div",{id:o,role:"status","aria-label":`${i.columnDef.meta?.label} filter is ${"isEmpty"===r.operator?"empty":"not empty"}`,"aria-live":"polite",className:"h-full w-16 rounded-none border bg-transparent px-1.5 py-0.5 text-muted-foreground dark:bg-input/30"});switch(r.variant){case"text":case"number":case"range":{if("range"===r.variant&&"isBetween"===r.operator||"isBetween"===r.operator)return n(S,{filter:r,column:i,inputId:o,onFilterUpdate:c,className:"size-full max-w-28 gap-0 [&_[data-slot='range-min']]:border-r-0 [&_input]:rounded-none [&_input]:px-1.5"});let e="number"===r.variant||"range"===r.variant;return n(C,{id:o,type:e?"number":"text",inputMode:e?"numeric":void 0,placeholder:i.columnDef.meta?.placeholder??"Enter value...",className:"h-full w-24 rounded-none px-1.5",defaultValue:"string"==typeof r.value?r.value:"",onChange:e=>c(r.filterId,{value:e.target.value})})}case"boolean":{let e=`${o}-listbox`;return t(F,{open:s,onOpenChange:d,value:"string"==typeof r.value?r.value:"true",onValueChange:e=>c(r.filterId,{value:e}),children:[n(E,{id:o,"aria-controls":e,className:"rounded-none bg-transparent px-1.5 py-0.5 [&_svg]:hidden",children:n($,{placeholder:r.value?"True":"False"})}),t(j,{id:e,children:[n(z,{value:"true",children:"True"}),n(z,{value:"false",children:"False"})]})]})}case"select":case"multiSelect":{let a=`${o}-listbox`,u=i.columnDef.meta?.options??[],m=Array.isArray(r.value)?r.value:[r.value],p=u.filter(e=>m.includes(e.value));return t(I,{open:s,onOpenChange:d,children:[n(T,{asChild:!0,children:n(v,{id:o,"aria-controls":a,variant:"ghost",size:"sm",className:"h-full min-w-16 rounded-none border px-1.5 font-normal dark:bg-input/30",children:0===p.length?"multiSelect"===r.variant?"Select options...":"Select option...":t(e,{children:[n("div",{className:"-space-x-2 flex items-center rtl:space-x-reverse",children:p.map(e=>e.icon?n("div",{className:"rounded-full border bg-background p-0.5",children:n(e.icon,{className:"size-3.5"})},e.value):null)}),n("span",{className:"truncate",children:p.length>1?`${p.length} selected`:p[0]?.label})]})})}),n(k,{id:a,align:"start",className:"w-48 origin-[var(--radix-popover-content-transform-origin)] p-0",children:t(b,{children:[n(x,{placeholder:"Search options..."}),t(y,{children:[n(N,{children:"No options found."}),n(w,{children:u.map(e=>t(D,{value:e.value,onSelect:()=>{let n="multiSelect"===r.variant?m.includes(e.value)?m.filter(n=>n!==e.value):[...m,e.value]:e.value;c(r.filterId,{value:n})},children:[e.icon&&n(e.icon,{}),n("span",{className:"truncate",children:e.label}),"multiSelect"===r.variant&&n(l,{className:M("ml-auto",m.includes(e.value)?"opacity-100":"opacity-0")})]},e.value))})]})]})})]})}case"date":case"dateRange":{let e=`${o}-listbox`,l=Array.isArray(r.value)?r.value.filter(Boolean):[r.value,r.value].filter(Boolean),i="isBetween"===r.operator&&2===l.length?`${K(new Date(Number(l[0])))} - ${K(new Date(Number(l[1])))}`:l[0]?K(new Date(Number(l[0]))):"Pick date...";return t(I,{open:s,onOpenChange:d,children:[n(T,{asChild:!0,children:t(v,{id:o,"aria-controls":e,variant:"ghost",size:"sm",className:M("h-full rounded-none border px-1.5 font-normal dark:bg-input/30",!r.value&&"text-muted-foreground"),children:[n(a,{className:"size-3.5"}),n("span",{className:"truncate",children:i})]})}),n(k,{id:e,align:"start",className:"w-auto origin-[var(--radix-popover-content-transform-origin)] p-0",children:"isBetween"===r.operator?n(g,{mode:"range",initialFocus:!0,selected:2===l.length?{from:new Date(Number(l[0])),to:new Date(Number(l[1]))}:{from:new Date,to:new Date},onSelect:e=>{c(r.filterId,{value:e?[(e.from?.getTime()??"").toString(),(e.to?.getTime()??"").toString()]:[]})}}):n(g,{mode:"single",initialFocus:!0,selected:l[0]?new Date(Number(l[0])):void 0,onSelect:e=>{c(r.filterId,{value:(e?.getTime()??"").toString()})}})})]})}default:return null}}({filter:r,column:R,inputId:q,onFilterUpdate:s,showValueSelector:_,setShowValueSelector:B}),n(v,{"aria-controls":i,variant:"ghost",size:"sm",className:"h-full rounded-none rounded-r-md border border-l-0 px-1.5 font-normal dark:bg-input/30",onClick:()=>u(r.filterId),children:n(c,{className:"size-3.5"})})]},r.filterId)}}function q({column:a,value:l,onSelect:r}){switch(a.columnDef.meta?.variant??"text"){case"boolean":return t(w,{children:[n(D,{value:"true",onSelect:()=>r("true"),children:"True"}),n(D,{value:"false",onSelect:()=>r("false"),children:"False"})]});case"select":case"multiSelect":return n(w,{children:a.columnDef.meta?.options?.map(e=>t(D,{value:e.value,onSelect:()=>r(e.value),children:[e.icon&&n(e.icon,{}),n("span",{className:"truncate",children:e.label}),e.count&&n("span",{className:"ml-auto font-mono text-xs",children:e.count})]},e.value))});case"date":case"dateRange":return n(g,{initialFocus:!0,mode:"single",selected:l?new Date(l):void 0,onSelect:e=>r(e?.getTime().toString()??"")});default:{let a=!l.trim();return n(w,{children:n(D,{value:l,onSelect:()=>r(l),disabled:a,children:a?t(e,{children:[n(o,{}),n("span",{children:"Type to add filter..."})]}):t(e,{children:[n(i,{}),t("span",{className:"truncate",children:['Filter by "',l,'"']})]})})})}}}export{R as DataTableFilterMenu};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{CaretDoubleLeftIcon as i,CaretDoubleRightIcon as t,CaretLeftIcon as l,CaretRightIcon as s}from"@phosphor-icons/react";import{Button as n}from"../button.js";import{Select as o,SelectContent as r,SelectItem as c,SelectTrigger as d,SelectValue as g}from"../select.js";import{cn as m}from"../../lib/utils.js";function p({table:p,pageSizeOptions:h=[10,20,30,40,50],className:u
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{CaretDoubleLeftIcon as i,CaretDoubleRightIcon as t,CaretLeftIcon as l,CaretRightIcon as s}from"@phosphor-icons/react";import{Button as n}from"../button/index.js";import{Select as o,SelectContent as r,SelectItem as c,SelectTrigger as d,SelectValue as g}from"../select.js";import{cn as m}from"../../lib/utils.js";function p({table:p,pageSizeOptions:h=[10,20,30,40,50],className:x,...u}){return a("div",{className:m("flex w-full flex-col-reverse items-center justify-between gap-4 overflow-auto p-1 sm:flex-row sm:gap-8",x),...u,children:[a("div",{className:"flex-1 whitespace-nowrap text-muted-foreground text-sm",children:[p.getFilteredSelectedRowModel().rows.length," de"," ",p.getFilteredRowModel().rows.length," linhas selecionadas."]}),a("div",{className:"flex flex-col-reverse items-center gap-4 sm:flex-row sm:gap-6 lg:gap-8",children:[a("div",{className:"flex items-center space-x-2",children:[e("p",{className:"whitespace-nowrap font-medium text-sm",children:"Linhas por p\xe1gina"}),a(o,{value:`${p.getState().pagination.pageSize}`,onValueChange:e=>{p.setPageSize(Number(e))},children:[e(d,{className:"h-10 w-[5.5rem] [&[data-size]]:h-10",children:e(g,{placeholder:p.getState().pagination.pageSize})}),e(r,{side:"top",children:h.map(a=>e(c,{value:`${a}`,children:a},a))})]})]}),a("div",{className:"flex items-center justify-center font-medium text-sm",children:["P\xe1gina ",p.getState().pagination.pageIndex+1," de"," ",p.getPageCount()]}),a("div",{className:"flex items-center space-x-2",children:[e(n,{"aria-label":"Go to first page",variant:"outline",size:"icon",className:"hidden size-10 lg:flex",onClick:()=>p.setPageIndex(0),disabled:!p.getCanPreviousPage(),children:e(i,{})}),e(n,{"aria-label":"Go to previous page",variant:"outline",size:"icon",className:"size-10",onClick:()=>p.previousPage(),disabled:!p.getCanPreviousPage(),children:e(l,{})}),e(n,{"aria-label":"Go to next page",variant:"outline",size:"icon",className:"size-10",onClick:()=>p.nextPage(),disabled:!p.getCanNextPage(),children:e(s,{})}),e(n,{"aria-label":"Go to last page",variant:"outline",size:"icon",className:"hidden size-10 lg:flex",onClick:()=>p.setPageIndex(p.getPageCount()-1),disabled:!p.getCanNextPage(),children:e(t,{})})]})]})]})}export{p as DataTablePagination};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import{Fragment as e,jsx as r,jsxs as t}from"react/jsx-runtime";import{useCallback as a,useId as i,useMemo as l}from"react";import{Button as n}from"../button.js";import{Input as o}from"../input.js";import{Label as m}from"../label.js";import{Popover as s,PopoverContent as c,PopoverTrigger as u}from"../popover.js";import{Separator as d}from"../separator.js";import{Slider as p}from"../slider.js";import{cn as h}from"../../lib/utils.js";import{PlusCircle as f,XCircle as g}from"@phosphor-icons/react";function b(e){return Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function v({column:v,title:x}){let N=i(),y=b(v.getFilterValue())?v.getFilterValue():void 0,F=v.columnDef.meta?.range,$=v.columnDef.meta?.unit,{min:j,max:C,step:V}=l(()=>{let e=0,r=100;if(F&&b(F))[e,r]=F;else{let t=v.getFacetedMinMaxValues();if(t&&Array.isArray(t)&&2===t.length){let[a,i]=t;"number"==typeof a&&"number"==typeof i&&(e=a,r=i)}}let t=r-e;return{min:e,max:r,step:t<=20?1:t<=100?Math.ceil(t/20):Math.ceil(t/50)}},[v,F]),M=l(()=>y??[j,C],[y,j,C]),A=a(e=>e.toLocaleString(void 0,{maximumFractionDigits:0}),[]),S=a(e=>{let r=Number(e.target.value);!Number.isNaN(r)&&r>=j&&r<=M[1]&&v.setFilterValue([r,M[1]])},[v,j,M]),D=a(e=>{let r=Number(e.target.value);!Number.isNaN(r)&&r<=C&&r>=M[0]&&v.setFilterValue([M[0],r])},[v,C,M]),w=a(e=>{Array.isArray(e)&&2===e.length&&v.setFilterValue(e)},[v]),L=a(e=>{e.target instanceof HTMLDivElement&&e.stopPropagation(),v.setFilterValue(void 0)},[v]);return t(s,{children:[r(u,{asChild:!0,children:t(n,{variant:"outline",size:"sm",children:[y?r("div",{role:"button","aria-label":`Clear ${x} filter`,tabIndex:0,className:"rounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-gray-500",onClick:L,children:r(g,{})}):r(f,{}),r("span",{children:x}),y?t(e,{children:[r(d,{orientation:"vertical",className:"mx-0.5 data-[orientation=vertical]:h-4"}),A(y[0])," -"," ",A(y[1]),$?` ${$}`:""]}):null]})}),t(c,{align:"start",className:"flex w-auto flex-col gap-4",children:[t("div",{className:"flex flex-col gap-3",children:[r("p",{className:"font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:x}),t("div",{className:"flex items-center gap-4",children:[r(m,{htmlFor:`${N}-from`,className:"sr-only",children:"From"}),t("div",{className:"relative",children:[r(o,{id:`${N}-from`,type:"number","aria-valuemin":j,"aria-valuemax":C,inputMode:"numeric",pattern:"[0-9]*",placeholder:j.toString(),min:j,max:C,value:M[0]?.toString(),onChange:S,className:h("h-10 w-24",$&&"pr-8")}),$&&r("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(m,{htmlFor:`${N}-to`,className:"sr-only",children:"to"}),t("div",{className:"relative",children:[r(o,{id:`${N}-to`,type:"number","aria-valuemin":j,"aria-valuemax":C,inputMode:"numeric",pattern:"[0-9]*",placeholder:C.toString(),min:j,max:C,value:M[1]?.toString(),onChange:D,className:h("h-10 w-24",$&&"pr-8")}),$&&r("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:$})]})]}),t(m,{htmlFor:`${N}-slider`,className:"sr-only",children:[x," slider"]}),r(p,{id:`${N}-slider`,min:j,max:C,step:V,value:M,onValueChange:w})]}),r(n,{"aria-label":`Clear ${x} filter`,variant:"outline",size:"sm",onClick:L,children:"Limpar"})]})]})}export{v as DataTableSliderFilter};
|
|
2
|
+
import{Fragment as e,jsx as r,jsxs as t}from"react/jsx-runtime";import{useCallback as a,useId as i,useMemo as l}from"react";import{Button as n}from"../button/index.js";import{Input as o}from"../input.js";import{Label as m}from"../label.js";import{Popover as s,PopoverContent as c,PopoverTrigger as u}from"../popover.js";import{Separator as d}from"../separator.js";import{Slider as p}from"../slider.js";import{cn as h}from"../../lib/utils.js";import{PlusCircle as f,XCircle as g}from"@phosphor-icons/react";function b(e){return Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function v({column:v,title:x}){let N=i(),y=b(v.getFilterValue())?v.getFilterValue():void 0,F=v.columnDef.meta?.range,$=v.columnDef.meta?.unit,{min:j,max:C,step:V}=l(()=>{let e=0,r=100;if(F&&b(F))[e,r]=F;else{let t=v.getFacetedMinMaxValues();if(t&&Array.isArray(t)&&2===t.length){let[a,i]=t;"number"==typeof a&&"number"==typeof i&&(e=a,r=i)}}let t=r-e;return{min:e,max:r,step:t<=20?1:t<=100?Math.ceil(t/20):Math.ceil(t/50)}},[v,F]),M=l(()=>y??[j,C],[y,j,C]),A=a(e=>e.toLocaleString(void 0,{maximumFractionDigits:0}),[]),S=a(e=>{let r=Number(e.target.value);!Number.isNaN(r)&&r>=j&&r<=M[1]&&v.setFilterValue([r,M[1]])},[v,j,M]),D=a(e=>{let r=Number(e.target.value);!Number.isNaN(r)&&r<=C&&r>=M[0]&&v.setFilterValue([M[0],r])},[v,C,M]),w=a(e=>{Array.isArray(e)&&2===e.length&&v.setFilterValue(e)},[v]),L=a(e=>{e.target instanceof HTMLDivElement&&e.stopPropagation(),v.setFilterValue(void 0)},[v]);return t(s,{children:[r(u,{asChild:!0,children:t(n,{variant:"outline",size:"sm",children:[y?r("div",{role:"button","aria-label":`Clear ${x} filter`,tabIndex:0,className:"rounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-gray-500",onClick:L,children:r(g,{})}):r(f,{}),r("span",{children:x}),y?t(e,{children:[r(d,{orientation:"vertical",className:"mx-0.5 data-[orientation=vertical]:h-4"}),A(y[0])," -"," ",A(y[1]),$?` ${$}`:""]}):null]})}),t(c,{align:"start",className:"flex w-auto flex-col gap-4",children:[t("div",{className:"flex flex-col gap-3",children:[r("p",{className:"font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:x}),t("div",{className:"flex items-center gap-4",children:[r(m,{htmlFor:`${N}-from`,className:"sr-only",children:"From"}),t("div",{className:"relative",children:[r(o,{id:`${N}-from`,type:"number","aria-valuemin":j,"aria-valuemax":C,inputMode:"numeric",pattern:"[0-9]*",placeholder:j.toString(),min:j,max:C,value:M[0]?.toString(),onChange:S,className:h("h-10 w-24",$&&"pr-8")}),$&&r("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(m,{htmlFor:`${N}-to`,className:"sr-only",children:"to"}),t("div",{className:"relative",children:[r(o,{id:`${N}-to`,type:"number","aria-valuemin":j,"aria-valuemax":C,inputMode:"numeric",pattern:"[0-9]*",placeholder:C.toString(),min:j,max:C,value:M[1]?.toString(),onChange:D,className:h("h-10 w-24",$&&"pr-8")}),$&&r("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:$})]})]}),t(m,{htmlFor:`${N}-slider`,className:"sr-only",children:[x," slider"]}),r(p,{id:`${N}-slider`,min:j,max:C,step:V,value:M,onValueChange:w})]}),r(n,{"aria-label":`Clear ${x} filter`,variant:"outline",size:"sm",onClick:L,children:"Limpar"})]})]})}export{v as DataTableSliderFilter};
|
|
@@ -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.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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
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 i,Overlay as s,Portal as r,Root as n,Title as d,Trigger as c}from"@radix-ui/react-dialog";import{cn as g}from"../lib/utils.js";import{buttonVariants as m}from"./button.js";function p(t){return a(n,{"data-slot":"dialog",...t})}function u(t){return a(c,{"data-slot":"dialog-trigger",...t})}function f({...t}){return a(r,{"data-slot":"dialog-portal",...t})}function y({className:t,size:e,variant:l="outline",...i}){return a(o,{className:m({className:t,size:e,variant:l}),"data-slot":"dialog-close",...i})}function D({className:t,...e}){return a(s,{className:g("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 N({children:i,className:s,classNames:r,...n}){return t(f,{children:[a(D,{className:r?.overlay}),t(l,{className:g("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",s,r?.content),"data-slot":"dialog-content-wrapper",...n,children:[i,t(o,{className:m({className:["absolute top-2.5 right-2.5 size-7",r?.close],size:"icon",variant:"ghost"}),children:[a(e,{className:"size-4"}),a("span",{className:"sr-only",children:"Close"})]})]})]})}function x({className:t,...e}){return a("div",{className:g("flex flex-col space-y-1.5 text-center sm:text-left",t),"data-slot":"dialog-header",...e})}function h({className:t,...e}){return a("main",{className:g("py-2",t),"data-slot":"dialog-body",...e})}function b({className:t,...e}){return a("footer",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),"data-slot":"dialog-footer",...e})}function v({className:t,...e}){return a(d,{className:g("font-semibold text-lg leading-none tracking-tight",t),"data-slot":"dialog-title",...e})}function z({className:t,...e}){return a(i,{className:g("text-gray-600 text-sm",t),"data-slot":"dialog-description",...e})}p.displayName="Dialog",u.displayName="DialogTrigger",f.displayName="DialogPortal",y.displayName="DialogClose",D.displayName="DialogOverlay",N.displayName="DialogContent",x.displayName="DialogHeader",h.displayName="DialogBody",b.displayName="DialogFooter",v.displayName="DialogTitle",z.displayName="DialogDescription";export{p as Dialog,h as DialogBody,y as DialogClose,N as DialogContent,z as DialogDescription,b as DialogFooter,x as DialogHeader,D as DialogOverlay,f as DialogPortal,v as DialogTitle,u as DialogTrigger};
|
|
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 i,Overlay as s,Portal as r,Root as n,Title as d,Trigger as c}from"@radix-ui/react-dialog";import{cn as g}from"../lib/utils.js";import{buttonVariants as m}from"./button/index.js";function p(t){return a(n,{"data-slot":"dialog",...t})}function u(t){return a(c,{"data-slot":"dialog-trigger",...t})}function f({...t}){return a(r,{"data-slot":"dialog-portal",...t})}function y({className:t,size:e,variant:l="outline",...i}){return a(o,{className:m({className:t,size:e,variant:l}),"data-slot":"dialog-close",...i})}function D({className:t,...e}){return a(s,{className:g("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 N({children:i,className:s,classNames:r,...n}){return t(f,{children:[a(D,{className:r?.overlay}),t(l,{className:g("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",s,r?.content),"data-slot":"dialog-content-wrapper",...n,children:[i,t(o,{className:m({className:["absolute top-2.5 right-2.5 size-7",r?.close],size:"icon",variant:"ghost"}),children:[a(e,{className:"size-4"}),a("span",{className:"sr-only",children:"Close"})]})]})]})}function x({className:t,...e}){return a("div",{className:g("flex flex-col space-y-1.5 text-center sm:text-left",t),"data-slot":"dialog-header",...e})}function h({className:t,...e}){return a("main",{className:g("py-2",t),"data-slot":"dialog-body",...e})}function b({className:t,...e}){return a("footer",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),"data-slot":"dialog-footer",...e})}function v({className:t,...e}){return a(d,{className:g("font-semibold text-lg leading-none tracking-tight",t),"data-slot":"dialog-title",...e})}function z({className:t,...e}){return a(i,{className:g("text-gray-600 text-sm",t),"data-slot":"dialog-description",...e})}p.displayName="Dialog",u.displayName="DialogTrigger",f.displayName="DialogPortal",y.displayName="DialogClose",D.displayName="DialogOverlay",N.displayName="DialogContent",x.displayName="DialogHeader",h.displayName="DialogBody",b.displayName="DialogFooter",v.displayName="DialogTitle",z.displayName="DialogDescription";export{p as Dialog,h as DialogBody,y as DialogClose,N as DialogContent,z as DialogDescription,b as DialogFooter,x as DialogHeader,D as DialogOverlay,f as DialogPortal,v as DialogTitle,u as DialogTrigger};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import{jsx as s,jsxs as a}from"react/jsx-runtime";import{EyeIcon as o,EyeSlashIcon as r}from"@phosphor-icons/react";import{useCallback as i,useState as t}from"react";import{Field as e,Root as p}from"../primitive/input.js";import{Spinner as
|
|
2
|
+
import{jsx as s,jsxs as a}from"react/jsx-runtime";import{EyeIcon as o,EyeSlashIcon as r}from"@phosphor-icons/react";import{useCallback as i,useState as t}from"react";import{Field as e,Root as p}from"../primitive/input.js";import{Spinner as n}from"./spinner.js";import{Button as d}from"./button/index.js";import{inputVariants as l}from"./input.js";let{input:m,root:u}=l();function c({className:l,disabled:c,loaderPosition:f,loading:w,prefix:x,readOnly:N,spinner:b,suffix:g,...h}){let[j,z]=t("password"),v=i(()=>{z(s=>"password"===s?"text":"password")},[]);return a(p,{className:u({className:[!g&&"pr-1.5",l]}),"data-slot":"input-password",disabled:c,loaderPosition:f,loading:w,prefix:x,readOnly:N,spinner:b||s(n,{}),suffix:g,children:[s(e,{autoCapitalize:"none",className:m(),"data-slot":"input-password-item",type:j,...h}),s(d,{"aria-label":"password"===j?"Show password":"Hide password",className:"full size-8 rounded-full focus-visible:ring-0","data-slot":"input-password-toggle",disabled:c,prefix:"password"===j?s(r,{className:"size-6"}):s(o,{className:"size-6"}),size:"icon",variant:"ghost",onClick:v})]})}c.displayName="InputPassword";export{c as InputPassword};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{format as t}from"date-fns";import{ptBR as i}from"date-fns/locale";import{useMemo as n,useState as o}from"react";import{CalendarBlankIcon as l,CaretLeftIcon as a,CaretRightIcon as s}from"@phosphor-icons/react";import{cn as m}from"../lib/utils.js";import{Button as c}from"./button.js";import{Popover as d,PopoverContent as u,PopoverTrigger as f}from"./popover.js";function p({date:p,placeholder:h,className:x,disabled:g=!1,locale:N=i,onChange:b}){let[v,M]=o(p),[w,y]=o(p?.getFullYear()??new Date().getFullYear()),j=n(()=>Array.from({length:12},(e,r)=>{let i=t(new Date(w,r,1),"MMMM",{locale:N});return{label:i.charAt(0).toUpperCase()+i.slice(1),index:r}}),[w,N]);return r(d,{children:[e(f,{asChild:!0,children:e(c,{id:"month",variant:"outline",className:m("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(l,{className:"mr-2 size-4 text-foreground"}),v?t(v,"MMMM yyyy",{locale:N}):h||"Selecione o m\xeas"]})})}),e(u,{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(c,{onClick:()=>y(e=>e-1),variant:"outline",size:"icon",children:e(a,{className:"size-4 text-foreground"})}),e("span",{className:"font-medium text-lg",children:w}),e(c,{onClick:()=>y(e=>e+1),variant:"outline",size:"icon",children:e(s,{className:"size-4 text-foreground"})})]}),e("div",{className:"grid grid-cols-3 gap-2",children:j.map(r=>e(c,{variant:v?.getFullYear()===w&&v.getMonth()===r.index?"primary":"outline",className:m("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};
|
|
2
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{format as t}from"date-fns";import{ptBR as i}from"date-fns/locale";import{useMemo as n,useState as o}from"react";import{CalendarBlankIcon as l,CaretLeftIcon as a,CaretRightIcon as s}from"@phosphor-icons/react";import{cn as m}from"../lib/utils.js";import{Button as c}from"./button/index.js";import{Popover as d,PopoverContent as u,PopoverTrigger as f}from"./popover.js";function p({date:p,placeholder:h,className:x,disabled:g=!1,locale:N=i,onChange:b}){let[v,M]=o(p),[w,y]=o(p?.getFullYear()??new Date().getFullYear()),j=n(()=>Array.from({length:12},(e,r)=>{let i=t(new Date(w,r,1),"MMMM",{locale:N});return{label:i.charAt(0).toUpperCase()+i.slice(1),index:r}}),[w,N]);return r(d,{children:[e(f,{asChild:!0,children:e(c,{id:"month",variant:"outline",className:m("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(l,{className:"mr-2 size-4 text-foreground"}),v?t(v,"MMMM yyyy",{locale:N}):h||"Selecione o m\xeas"]})})}),e(u,{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(c,{onClick:()=>y(e=>e-1),variant:"outline",size:"icon",children:e(a,{className:"size-4 text-foreground"})}),e("span",{className:"font-medium text-lg",children:w}),e(c,{onClick:()=>y(e=>e+1),variant:"outline",size:"icon",children:e(s,{className:"size-4 text-foreground"})})]}),e("div",{className:"grid grid-cols-3 gap-2",children:j.map(r=>e(c,{variant:v?.getFullYear()===w&&v.getMonth()===r.index?"primary":"outline",className:m("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};
|
|
@@ -3,7 +3,7 @@ declare const tooltipContentVariants: import("tailwind-variants").TVReturnType<{
|
|
|
3
3
|
default: string;
|
|
4
4
|
secondary: string;
|
|
5
5
|
};
|
|
6
|
-
}, undefined, "data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[state=delayed-open]:data-[side=top]:slide-in-from-bottom-2 data-[state=delayed-open]:data-[side=right]:slide-in-from-left-2 data-[state=delayed-open]:data-[side=bottom]:slide-in-from-top-2 data-[state=delayed-open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 rounded-lg px-3 py-1.5 font-medium text-sm shadow-
|
|
6
|
+
}, undefined, "data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[state=delayed-open]:data-[side=top]:slide-in-from-bottom-2 data-[state=delayed-open]:data-[side=right]:slide-in-from-left-2 data-[state=delayed-open]:data-[side=bottom]:slide-in-from-top-2 data-[state=delayed-open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 rounded-lg px-3 py-1.5 font-medium text-sm shadow-elevation data-[state=closed]:animate-out data-[state=delayed-open]:animate-in", {
|
|
7
7
|
variant: {
|
|
8
8
|
default: string;
|
|
9
9
|
secondary: string;
|
|
@@ -13,6 +13,6 @@ declare const tooltipContentVariants: import("tailwind-variants").TVReturnType<{
|
|
|
13
13
|
default: string;
|
|
14
14
|
secondary: string;
|
|
15
15
|
};
|
|
16
|
-
}, undefined, "data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[state=delayed-open]:data-[side=top]:slide-in-from-bottom-2 data-[state=delayed-open]:data-[side=right]:slide-in-from-left-2 data-[state=delayed-open]:data-[side=bottom]:slide-in-from-top-2 data-[state=delayed-open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 rounded-lg px-3 py-1.5 font-medium text-sm shadow-
|
|
16
|
+
}, undefined, "data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[state=delayed-open]:data-[side=top]:slide-in-from-bottom-2 data-[state=delayed-open]:data-[side=right]:slide-in-from-left-2 data-[state=delayed-open]:data-[side=bottom]:slide-in-from-top-2 data-[state=delayed-open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 rounded-lg px-3 py-1.5 font-medium text-sm shadow-elevation data-[state=closed]:animate-out data-[state=delayed-open]:animate-in", unknown, unknown, undefined>>;
|
|
17
17
|
export { tooltipContentVariants };
|
|
18
18
|
//# sourceMappingURL=tooltip-content-variants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip-content-variants.d.ts","sourceRoot":"","sources":["../../../../src/components/tooltip/tooltip-content-variants.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,sBAAsB;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"tooltip-content-variants.d.ts","sourceRoot":"","sources":["../../../../src/components/tooltip/tooltip-content-variants.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,sBAAsB;;;;;;;;;;;;;;;wyBAW1B,CAAA;AAMF,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{tv as t}from"../../lib/utils.js";let a=t({base:"data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[state=delayed-open]:data-[side=top]:slide-in-from-bottom-2 data-[state=delayed-open]:data-[side=right]:slide-in-from-left-2 data-[state=delayed-open]:data-[side=bottom]:slide-in-from-top-2 data-[state=delayed-open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 rounded-lg px-3 py-1.5 font-medium text-sm shadow-
|
|
1
|
+
import{tv as t}from"../../lib/utils.js";let a=t({base:"data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[state=delayed-open]:data-[side=top]:slide-in-from-bottom-2 data-[state=delayed-open]:data-[side=right]:slide-in-from-left-2 data-[state=delayed-open]:data-[side=bottom]:slide-in-from-top-2 data-[state=delayed-open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 rounded-lg px-3 py-1.5 font-medium text-sm shadow-elevation data-[state=closed]:animate-out data-[state=delayed-open]:animate-in",variants:{variant:{default:"bg-card text-foreground",secondary:"bg-foreground text-accent"}},defaultVariants:{variant:"default"}});export{a as tooltipContentVariants};
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./components/alert-dialog/index.js";export*from"./components/app-layout/index.js";export*from"./components/autocomplete/index.js";export*from"./components/avatar/index.js";export*from"./components/badge/index.js";export*from"./components/breadcrumb.js";export*from"./components/button.js";export*from"./components/calendar.js";export*from"./components/checkbox/index.js";export*from"./components/combobox.js";export*from"./components/command.js";export*from"./components/context-menu.js";export*from"./components/data-table/index.js";export*from"./components/date-picker/index.js";export*from"./components/date-picker-with-range.js";export*from"./components/date-time-picker/index.js";export*from"./components/date-time-picker-with-range.js";export*from"./components/dialog.js";export*from"./components/dropdown-menu.js";export*from"./components/form.js";export*from"./components/input.js";export*from"./components/input-otp.js";export*from"./components/input-password.js";export*from"./components/label.js";export*from"./components/mask-input.js";export*from"./components/month-picker.js";export*from"./components/multi-select.js";export*from"./components/pagination.js";export*from"./components/popover.js";export*from"./components/radio-group.js";export*from"./components/scroll-area.js";export*from"./components/select.js";export*from"./components/separator.js";export*from"./components/sheet/index.js";export*from"./components/skeleton/index.js";export*from"./components/spinner.js";export*from"./components/switch.js";export*from"./components/table.js";export*from"./components/table-expandable.js";export*from"./components/tabs/index.js";export*from"./components/textarea.js";export*from"./components/theme-provider.js";export*from"./components/theme-toggle.js";export*from"./components/title.js";export*from"./components/tokens-grid.js";export*from"./components/tooltip/index.js";export*from"./hooks/use-data-table.js";export*from"./lib/data-table-config.js";export*from"./lib/format.js";export*from"./lib/utils.js";
|
|
1
|
+
export*from"./components/alert-dialog/index.js";export*from"./components/app-layout/index.js";export*from"./components/autocomplete/index.js";export*from"./components/avatar/index.js";export*from"./components/badge/index.js";export*from"./components/breadcrumb.js";export*from"./components/button/index.js";export*from"./components/calendar.js";export*from"./components/checkbox/index.js";export*from"./components/combobox.js";export*from"./components/command.js";export*from"./components/context-menu.js";export*from"./components/data-table/index.js";export*from"./components/date-picker/index.js";export*from"./components/date-picker-with-range.js";export*from"./components/date-time-picker/index.js";export*from"./components/date-time-picker-with-range.js";export*from"./components/dialog.js";export*from"./components/dropdown-menu.js";export*from"./components/form.js";export*from"./components/input.js";export*from"./components/input-otp.js";export*from"./components/input-password.js";export*from"./components/label.js";export*from"./components/mask-input.js";export*from"./components/month-picker.js";export*from"./components/multi-select.js";export*from"./components/pagination.js";export*from"./components/popover.js";export*from"./components/radio-group.js";export*from"./components/scroll-area.js";export*from"./components/select.js";export*from"./components/separator.js";export*from"./components/sheet/index.js";export*from"./components/skeleton/index.js";export*from"./components/spinner.js";export*from"./components/switch/index.js";export*from"./components/table.js";export*from"./components/table-expandable.js";export*from"./components/tabs/index.js";export*from"./components/textarea.js";export*from"./components/theme-provider.js";export*from"./components/theme-toggle.js";export*from"./components/title.js";export*from"./components/tokens-grid.js";export*from"./components/tooltip/index.js";export*from"./hooks/use-data-table.js";export*from"./lib/data-table-config.js";export*from"./lib/format.js";export*from"./lib/utils.js";
|
package/dist/styles/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import "tw-animate-css";@custom-variant dark (&:is(.dark*));:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--background:oklch(1 0 0);--foreground:oklch(.3156 .0121 258.37);--card:oklch(1 0 0);--card-foreground:oklch(.3156 .0121 258.37);--popover:oklch(1 0 0);--popover-foreground:oklch(.3156 .0121 258.37);--primary:oklch(.5333 .2593 263.57);--primary-foreground:oklch(.9558 .020851 271.195);--secondary:oklch(.967 .001 286.375);--secondary-foreground:oklch(.21 .006 285.885);--muted:oklch(.9684 .0042 236.5);--muted-foreground:oklch(.5956 .0236 241.6);--accent:oklch(.967 .001 286.375);--accent-foreground:oklch(.21 .006 285.885);--destructive:oklch(.5908 .2288 21.65);--border:oklch(.9042 .0116 252.09);--input:oklch(.8726 .0152 251.17);--ring:oklch(.5333 .2593 263.57);--sidebar:oklch(1 0 0);--sidebar-foreground:oklch(.145 0 0);--sidebar-primary:oklch(.205 0 0);--sidebar-primary-foreground:oklch(.985 0 0);--sidebar-accent:oklch(.97 0 0);--sidebar-accent-foreground:oklch(.205 0 0);--sidebar-border:oklch(.922 0 0);--sidebar-ring:oklch(.708 0 0)}.dark{--background:oklch(.1779 .0064 271.04);--foreground:oklch(.985 0 0);--card:oklch(.2318 .0097 276.64);--card-foreground:oklch(1 0 0);--popover:oklch(.1779 .0064 271.04);--popover-foreground:oklch(1 0 0);--primary:oklch(.5528 .2466 263.74);--primary-foreground:oklch(.3372 .129 259.5);--muted:oklch(.2217 .0084 264.39);--muted-foreground:oklch(.705 .015 286.067);--accent:oklch(.274 .006 286.033);--accent-foreground:oklch(.985 0 0);--destructive:oklch(.641 .209 16.57);--border:oklch(.313 .0132 267.12);--input:oklch(.4083 .018 264.35);--ring:oklch(.5528 .2466 263.74);--sidebar:oklch(.1779 .0064 271.04);--sidebar-foreground:oklch(.985 0 0);--sidebar-primary:oklch(.488 .243 264.376);--sidebar-primary-foreground:oklch(.985 0 0);--sidebar-accent:oklch(.269 0 0);--sidebar-accent-foreground:oklch(.985 0 0);--sidebar-border:oklch(1 0 0/10%);--sidebar-ring:oklch(.556 0 0)}.lucide{stroke-width:1.25px}@theme inline{--color-background: var(--background); --color-foreground: var(--foreground); --color-card: var(--card); --color-card-foreground: var(--card-foreground); --color-popover: var(--popover); --color-popover-foreground: var(--popover-foreground); --color-primary: var(--primary); --color-primary-foreground: var(--primary-foreground); --color-secondary: var(--secondary); --color-secondary-foreground: var(--secondary-foreground); --color-muted: var(--muted); --color-muted-foreground: var(--muted-foreground); --color-accent: var(--accent); --color-accent-foreground: var(--accent-foreground); --color-destructive: var(--destructive); --color-border: var(--border); --color-input: var(--input); --color-ring: var(--ring); --color-chart-1: var(--chart-1); --color-chart-2: var(--chart-2); --color-chart-3: var(--chart-3); --color-chart-4: var(--chart-4); --color-chart-5: var(--chart-5); --color-sidebar: var(--sidebar); --color-sidebar-foreground: var(--sidebar-foreground); --color-sidebar-primary: var(--sidebar-primary); --color-sidebar-primary-foreground: var(--sidebar-primary-foreground); --color-sidebar-accent: var(--sidebar-accent); --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); --color-sidebar-border: var(--sidebar-border); --color-sidebar-ring: var(--sidebar-ring); --color-gbm-sky: #1154ff; --color-gbm-ocean: #0a3ec2; --color-gbm-blue: #033278; --color-gbm-dark: #2e3238; --color-gbm-black: #191919; --color-gbm-gray: #40464f; --color-header: #f6f8f9; --color-stroke: #dae0e7; --color-section: #cfd7dc; --color-success: #21c561; --color-success-light: #87efae; --color-success-dark: #0f552e; --color-error: #e6183a; --color-error-light: #f6a0ad; --color-error-dark: #4e0113; --color-warning: #f68f18; --color-warning-light: #f7bc91; --color-warning-dark: #542a08; --color-sun: #fdd227; --color-sun-light: #fef18f; --color-sun-dark: #624a04; --color-gray-50: #f4f5f6; --color-gray-100: #edeef1; --color-gray-200: #d8dbdf; --color-gray-300: #b6bcc3; --color-gray-400: #909aa6; --color-gray-500: #717c8a; --color-gray-600: #5b6571; --color-gray-700: #4b535d; --color-gray-800: #3b4148; --color-gray-900: #333b47; --color-red-50: #f7e4e9; --color-red-100: #ffcad9; --color-red-200: #f6a0ad; --color-red-300: #fb6c80; --color-red-400: #f9536c; --color-red-500: #e6183a; --color-red-600: #c00d32; --color-red-700: #a20d2d; --color-red-800: #4e0113; --color-red-900: #2b0010; --color-orange-50: #ffead9; --color-orange-100: #facfb2; --color-orange-200: #f8bc91; --color-orange-300: #f59059; --color-orange-400: #f68f18; --color-orange-500: #f78221; --color-orange-600: #de6908; --color-orange-700: #ac5106; --color-orange-800: #542a08; --color-orange-900: #3a1a0b; --color-yellow-50: #fefac6; --color-yellow-100: #fef18f; --color-yellow-200: #fedf4c; --color-yellow-300: #fdd227; --color-yellow-400: #edbc0a; --color-yellow-500: #cc9a06; --color-yellow-600: #a47d08; --color-yellow-700: #8c6d0f; --color-yellow-800: #624a04; --color-yellow-900: #4a3a05; --color-lime-50: #ebfbcc; --color-lime-100: #ddf7a3; --color-lime-200: #c0f36e; --color-lime-300: #a3e63d; --color-lime-400: #86cc20; --color-lime-500: #65a311; --color-lime-600: #4b7c18; --color-lime-700: #416414; --color-lime-800: #324d0f; --color-lime-900: #293e0c; --color-grass-50: #dbfde6; --color-grass-100: #bef8d3; --color-grass-200: #87efae; --color-grass-300: #4cdd86; --color-grass-400: #1fbc5c; --color-grass-500: #15a24a; --color-grass-600: #138040; --color-grass-700: #0f552e; --color-grass-800: #0b4123; --color-grass-900: #082f1b; --color-turquoise-50: #f4fafb; --color-turquoise-100: #d3faf9; --color-turquoise-200: #a3f6f0; --color-turquoise-300: #6fe6f6; --color-turquoise-400: #21d1e3; --color-turquoise-500: #0ab1cd; --color-turquoise-600: #098eaf; --color-turquoise-700: #076888; --color-turquoise-800: #054a61; --color-turquoise-900: #043c4c; --color-azure-50: #d7ecff; --color-azure-100: #aedaff; --color-azure-200: #7bc2ff; --color-azure-300: #35a1ff; --color-azure-400: #007de9; --color-azure-500: #007be5; --color-azure-600: #005fb0; --color-azure-700: #004988; --color-azure-800: #003868; --color-azure-900: #002c50; --color-royal-50: #e2eafd; --color-royal-100: #c7d8fd; --color-royal-200: #a4c0fb; --color-royal-300: #819af4; --color-royal-400: #6178ea; --color-royal-500: #4355de; --color-royal-600: #374397; --color-royal-700: #313a7d; --color-royal-800: #0f1557; --color-royal-900: #0c0f3e; --color-purple-50: #f0e9fe; --color-purple-100: #dfd5fa; --color-purple-200: #cfb4f9; --color-purple-300: #b184f0; --color-purple-400: #9354ed; --color-purple-500: #8233e0; --color-purple-600: #6624b5; --color-purple-700: #4d2180; --color-purple-800: #351856; --color-purple-900: #2a1440; --shadow-
|
|
1
|
+
@import "tw-animate-css";@custom-variant dark (&:is(.dark*));:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--background:oklch(1 0 0);--foreground:oklch(.3156 .0121 258.37);--card:oklch(1 0 0);--card-foreground:oklch(.3156 .0121 258.37);--popover:oklch(1 0 0);--popover-foreground:oklch(.3156 .0121 258.37);--primary:oklch(.5333 .2593 263.57);--primary-foreground:oklch(.9558 .020851 271.195);--secondary:oklch(.967 .001 286.375);--secondary-foreground:oklch(.21 .006 285.885);--muted:oklch(.9684 .0042 236.5);--muted-foreground:oklch(.5956 .0236 241.6);--accent:oklch(.967 .001 286.375);--accent-foreground:oklch(.21 .006 285.885);--destructive:oklch(.5908 .2288 21.65);--border:oklch(.9042 .0116 252.09);--input:oklch(.8726 .0152 251.17);--ring:oklch(.5333 .2593 263.57);--sidebar:oklch(1 0 0);--sidebar-foreground:oklch(.145 0 0);--sidebar-primary:oklch(.205 0 0);--sidebar-primary-foreground:oklch(.985 0 0);--sidebar-accent:oklch(.97 0 0);--sidebar-accent-foreground:oklch(.205 0 0);--sidebar-border:oklch(.922 0 0);--sidebar-ring:oklch(.708 0 0)}.dark{--background:oklch(.1779 .0064 271.04);--foreground:oklch(.985 0 0);--card:oklch(.2318 .0097 276.64);--card-foreground:oklch(1 0 0);--popover:oklch(.1779 .0064 271.04);--popover-foreground:oklch(1 0 0);--primary:oklch(.5528 .2466 263.74);--primary-foreground:oklch(.3372 .129 259.5);--muted:oklch(.2217 .0084 264.39);--muted-foreground:oklch(.705 .015 286.067);--accent:oklch(.274 .006 286.033);--accent-foreground:oklch(.985 0 0);--destructive:oklch(.641 .209 16.57);--border:oklch(.313 .0132 267.12);--input:oklch(.4083 .018 264.35);--ring:oklch(.5528 .2466 263.74);--sidebar:oklch(.1779 .0064 271.04);--sidebar-foreground:oklch(.985 0 0);--sidebar-primary:oklch(.488 .243 264.376);--sidebar-primary-foreground:oklch(.985 0 0);--sidebar-accent:oklch(.269 0 0);--sidebar-accent-foreground:oklch(.985 0 0);--sidebar-border:oklch(1 0 0/10%);--sidebar-ring:oklch(.556 0 0)}.lucide{stroke-width:1.25px}@theme inline{--color-background: var(--background); --color-foreground: var(--foreground); --color-card: var(--card); --color-card-foreground: var(--card-foreground); --color-popover: var(--popover); --color-popover-foreground: var(--popover-foreground); --color-primary: var(--primary); --color-primary-foreground: var(--primary-foreground); --color-secondary: var(--secondary); --color-secondary-foreground: var(--secondary-foreground); --color-muted: var(--muted); --color-muted-foreground: var(--muted-foreground); --color-accent: var(--accent); --color-accent-foreground: var(--accent-foreground); --color-destructive: var(--destructive); --color-border: var(--border); --color-input: var(--input); --color-ring: var(--ring); --color-chart-1: var(--chart-1); --color-chart-2: var(--chart-2); --color-chart-3: var(--chart-3); --color-chart-4: var(--chart-4); --color-chart-5: var(--chart-5); --color-sidebar: var(--sidebar); --color-sidebar-foreground: var(--sidebar-foreground); --color-sidebar-primary: var(--sidebar-primary); --color-sidebar-primary-foreground: var(--sidebar-primary-foreground); --color-sidebar-accent: var(--sidebar-accent); --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); --color-sidebar-border: var(--sidebar-border); --color-sidebar-ring: var(--sidebar-ring); --color-gbm-sky: #1154ff; --color-gbm-ocean: #0a3ec2; --color-gbm-blue: #033278; --color-gbm-dark: #2e3238; --color-gbm-black: #191919; --color-gbm-gray: #40464f; --color-header: #f6f8f9; --color-stroke: #dae0e7; --color-section: #cfd7dc; --color-success: #21c561; --color-success-light: #87efae; --color-success-dark: #0f552e; --color-error: #e6183a; --color-error-light: #f6a0ad; --color-error-dark: #4e0113; --color-warning: #f68f18; --color-warning-light: #f7bc91; --color-warning-dark: #542a08; --color-sun: #fdd227; --color-sun-light: #fef18f; --color-sun-dark: #624a04; --color-gray-50: #f4f5f6; --color-gray-100: #edeef1; --color-gray-200: #d8dbdf; --color-gray-300: #b6bcc3; --color-gray-400: #909aa6; --color-gray-500: #717c8a; --color-gray-600: #5b6571; --color-gray-700: #4b535d; --color-gray-800: #3b4148; --color-gray-900: #333b47; --color-red-50: #f7e4e9; --color-red-100: #ffcad9; --color-red-200: #f6a0ad; --color-red-300: #fb6c80; --color-red-400: #f9536c; --color-red-500: #e6183a; --color-red-600: #c00d32; --color-red-700: #a20d2d; --color-red-800: #4e0113; --color-red-900: #2b0010; --color-orange-50: #ffead9; --color-orange-100: #facfb2; --color-orange-200: #f8bc91; --color-orange-300: #f59059; --color-orange-400: #f68f18; --color-orange-500: #f78221; --color-orange-600: #de6908; --color-orange-700: #ac5106; --color-orange-800: #542a08; --color-orange-900: #3a1a0b; --color-yellow-50: #fefac6; --color-yellow-100: #fef18f; --color-yellow-200: #fedf4c; --color-yellow-300: #fdd227; --color-yellow-400: #edbc0a; --color-yellow-500: #cc9a06; --color-yellow-600: #a47d08; --color-yellow-700: #8c6d0f; --color-yellow-800: #624a04; --color-yellow-900: #4a3a05; --color-lime-50: #ebfbcc; --color-lime-100: #ddf7a3; --color-lime-200: #c0f36e; --color-lime-300: #a3e63d; --color-lime-400: #86cc20; --color-lime-500: #65a311; --color-lime-600: #4b7c18; --color-lime-700: #416414; --color-lime-800: #324d0f; --color-lime-900: #293e0c; --color-grass-50: #dbfde6; --color-grass-100: #bef8d3; --color-grass-200: #87efae; --color-grass-300: #4cdd86; --color-grass-400: #1fbc5c; --color-grass-500: #15a24a; --color-grass-600: #138040; --color-grass-700: #0f552e; --color-grass-800: #0b4123; --color-grass-900: #082f1b; --color-turquoise-50: #f4fafb; --color-turquoise-100: #d3faf9; --color-turquoise-200: #a3f6f0; --color-turquoise-300: #6fe6f6; --color-turquoise-400: #21d1e3; --color-turquoise-500: #0ab1cd; --color-turquoise-600: #098eaf; --color-turquoise-700: #076888; --color-turquoise-800: #054a61; --color-turquoise-900: #043c4c; --color-azure-50: #d7ecff; --color-azure-100: #aedaff; --color-azure-200: #7bc2ff; --color-azure-300: #35a1ff; --color-azure-400: #007de9; --color-azure-500: #007be5; --color-azure-600: #005fb0; --color-azure-700: #004988; --color-azure-800: #003868; --color-azure-900: #002c50; --color-royal-50: #e2eafd; --color-royal-100: #c7d8fd; --color-royal-200: #a4c0fb; --color-royal-300: #819af4; --color-royal-400: #6178ea; --color-royal-500: #4355de; --color-royal-600: #374397; --color-royal-700: #313a7d; --color-royal-800: #0f1557; --color-royal-900: #0c0f3e; --color-purple-50: #f0e9fe; --color-purple-100: #dfd5fa; --color-purple-200: #cfb4f9; --color-purple-300: #b184f0; --color-purple-400: #9354ed; --color-purple-500: #8233e0; --color-purple-600: #6624b5; --color-purple-700: #4d2180; --color-purple-800: #351856; --color-purple-900: #2a1440; --shadow-elevation: 0px 1.5px 3px 0px #12426424;}@layer base{*{@apply border-border outline-ring/50;}body{@apply bg-background text-foreground;}}@utility animation-repeat-infinite{animation-iteration-count: infinite;}@utility animation-repeat-initial{animation-iteration-count: initial;}@utility animation-repeat-*{animation-iteration-count: --value(integer,[integer]);}@utility animation-delay-initial{animation-delay: initial;}@utility animation-delay-*{animation-delay: calc(--value(integer)*1ms); animation-delay: --value([*]);}@utility animation-duration-initial{animation-duration: initial;}@utility animation-duration-*{animation-duration: calc(--value(integer)*1ms); animation-duration: --value([*]);}@utility spin-in-*{--tw-enter-rotate: calc(1deg*--value(integer));}@utility spin-out-*{--tw-exit-rotate: calc(1deg*--value(integer));}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{buttonVariants:()=>buttonVariants,Button:()=>Button});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),react_slot_namespaceObject=require("@radix-ui/react-slot"),utils_cjs_namespaceObject=require("../lib/utils.cjs"),external_spinner_cjs_namespaceObject=require("./spinner.cjs"),buttonVariants=(0,utils_cjs_namespaceObject.tv)({base:"flex cursor-pointer items-center justify-center whitespace-nowrap rounded-md font-medium text-sm transition-colors focus-visible:border-primary focus-visible:outline-none",variants:{variant:{primary:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",tertiary:"border bg-background text-primary shadow-xs hover:bg-accent dark:border-input dark:bg-input/30 dark:hover:bg-input/50",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",success:"bg-success text-white shadow-xs hover:bg-success/90 focus-visible:ring-success/20 dark:bg-success/60 dark:focus-visible:ring-success/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{xxs:"h-7 gap-1 rounded px-[0.4375rem] text-[0.8125rem]",xs:"h-8 gap-1 px-2.5 text-xs",sm:"h-9 gap-1.5 p-3 text-sm",default:"h-10 gap-4 p-3",lg:"h-11 gap-6 p-3.5 text-lg",icon:"size-10"},rounded:{true:"rounded-full"},loading:{true:"pointer-events-none",false:""},disabled:{true:"pointer-events-none opacity-50",false:""}},defaultVariants:{variant:"primary",size:"default",rounded:!1,loading:!1}});function Button({children:e,className:t,disabled:r,loaderPosition:a,loading:n,prefix:s,size:_,spinner:i,suffix:c,variant:o,asChild:u,rounded:p,...b}){let d=u?react_slot_namespaceObject.Slot:"button";return(0,jsx_runtime_namespaceObject.jsxs)(d,{className:(0,utils_cjs_namespaceObject.cn)(buttonVariants({variant:o,size:_,rounded:p,loading:n,className:t,disabled:n||r})),"data-slot":"button","data-variant":o,disabled:n||r,type:"button",...b,children:[n&&"prefix"===a?i||(0,jsx_runtime_namespaceObject.jsx)(external_spinner_cjs_namespaceObject.Spinner,{}):s,(0,jsx_runtime_namespaceObject.jsx)(react_slot_namespaceObject.Slottable,{children:n&&!a?(0,jsx_runtime_namespaceObject.jsx)(external_spinner_cjs_namespaceObject.Spinner,{}):e}),n&&"suffix"===a?i||(0,jsx_runtime_namespaceObject.jsx)(external_spinner_cjs_namespaceObject.Spinner,{}):c]})}for(var __webpack_i__ in Button.displayName="Button",exports.Button=__webpack_exports__.Button,exports.buttonVariants=__webpack_exports__.buttonVariants,__webpack_exports__)-1===["Button","buttonVariants"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAOhD,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yNA8ClB,CAAA;AAMF,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,QAAQ,CAAC,GAChD,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAEH,iBAAS,MAAM,CAAC,EACd,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,cAAc,EACd,OAAO,EACP,MAAM,EACN,IAAI,EACJ,OAAO,EACP,MAAM,EACN,OAAO,EACP,OAAO,EACP,OAAO,EACP,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,GACzC,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,cAAc,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,GAAG,GAAG,CAAC,OAAO,CA4BhB;kBAnDQ,MAAM;;;AA0Df,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
2
|
-
import type { ComponentProps } from 'react';
|
|
3
|
-
declare function Switch({ className, ...props }: ComponentProps<typeof SwitchPrimitives.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export { Switch };
|
|
5
|
-
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/components/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAQ3C,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,2CAgB9C;AAMD,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAOhD,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yNA8ClB,CAAA;AAMF,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,QAAQ,CAAC,GAChD,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAEH,iBAAS,MAAM,CAAC,EACd,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,cAAc,EACd,OAAO,EACP,MAAM,EACN,IAAI,EACJ,OAAO,EACP,MAAM,EACN,OAAO,EACP,OAAO,EACP,OAAO,EACP,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,GACzC,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,cAAc,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,GAAG,GAAG,CAAC,OAAO,CA4BhB;kBAnDQ,MAAM;;;AA0Df,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Slot as t,Slottable as s}from"@radix-ui/react-slot";import{cn as o,tv as i}from"../lib/utils.js";import{Spinner as a}from"./spinner.js";let n=i({base:"flex cursor-pointer items-center justify-center whitespace-nowrap rounded-md font-medium text-sm transition-colors focus-visible:border-primary focus-visible:outline-none",variants:{variant:{primary:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",tertiary:"border bg-background text-primary shadow-xs hover:bg-accent dark:border-input dark:bg-input/30 dark:hover:bg-input/50",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",success:"bg-success text-white shadow-xs hover:bg-success/90 focus-visible:ring-success/20 dark:bg-success/60 dark:focus-visible:ring-success/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{xxs:"h-7 gap-1 rounded px-[0.4375rem] text-[0.8125rem]",xs:"h-8 gap-1 px-2.5 text-xs",sm:"h-9 gap-1.5 p-3 text-sm",default:"h-10 gap-4 p-3",lg:"h-11 gap-6 p-3.5 text-lg",icon:"size-10"},rounded:{true:"rounded-full"},loading:{true:"pointer-events-none",false:""},disabled:{true:"pointer-events-none opacity-50",false:""}},defaultVariants:{variant:"primary",size:"default",rounded:!1,loading:!1}});function d({children:i,className:d,disabled:u,loaderPosition:c,loading:b,prefix:g,size:p,spinner:l,suffix:v,variant:x,asChild:h,rounded:f,...m}){return r(h?t:"button",{className:o(n({variant:x,size:p,rounded:f,loading:b,className:d,disabled:b||u})),"data-slot":"button","data-variant":x,disabled:b||u,type:"button",...m,children:[b&&"prefix"===c?l||e(a,{}):g,e(s,{children:b&&!c?e(a,{}):i}),b&&"suffix"===c?l||e(a,{}):v]})}d.displayName="Button";export{d as Button,n as buttonVariants};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
2
|
-
import type { ComponentProps } from 'react';
|
|
3
|
-
declare function Switch({ className, ...props }: ComponentProps<typeof SwitchPrimitives.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export { Switch };
|
|
5
|
-
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/components/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAQ3C,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,2CAgB9C;AAMD,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import{jsx as t}from"react/jsx-runtime";import{Root as a,Thumb as r}from"@radix-ui/react-switch";import{cn as e}from"../lib/utils.js";function o({className:o,...i}){return t(a,{className:e("relative h-8 w-14 rounded-full bg-gray-200 outline-none enabled:cursor-pointer disabled:cursor-not-allowed disabled:opacity-25 data-[state=checked]:bg-primary",o),"data-slot":"switch",...i,children:t(r,{className:"block size-6 translate-x-1 rounded-full border bg-white transition-transform duration-100 will-change-transform data-[state=checked]:translate-x-7 data-[state=checked]:border-royal-100 data-[state=unchecked]:border-gray-300","data-slot":"switch-thumb"})})}export{o as Switch};
|