@sth87/shadcn-design-system 0.2.10 → 0.2.12
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/Table/data-table.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/command.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/input.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/textarea.cjs +1 -1
- package/dist/cjs/styles/index.css +1 -1
- package/dist/cjs/utils/data-table.cjs +1 -1
- package/dist/esm/components/Table/data-table.js +51 -47
- package/dist/esm/packages/ui/src/components/command.js +1 -1
- package/dist/esm/packages/ui/src/components/input.js +1 -1
- package/dist/esm/packages/ui/src/components/textarea.js +3 -3
- package/dist/esm/styles/index.css +1 -1
- package/dist/esm/utils/data-table.js +6 -0
- package/dist/types/components/Table/data-table.d.ts.map +1 -1
- package/dist/types/utils/data-table.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),T=require("@tanstack/react-table"),y=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),T=require("@tanstack/react-table"),y=require("react"),I=require("./data-table-pagination.cjs"),d=require("../../packages/ui/src/lib/utils.cjs"),n=require("../../packages/ui/src/components/table.cjs"),v=require("../../utils/data-table.cjs"),N=require("./data-table-column-header.cjs");function M({table:r,actionBar:m,children:S,className:C,pagination:a=!0,sticky:c=!0,stickyFooter:R=!1,bordered:k=!0,loading:g,loadingIndicator:P,footer:f,emptyState:q,onRowClick:u,rowClassName:b,renderRow:x,renderCell:h,classNames:t,showTotalCount:H=!0,totalCount:D,...z}){const i=c?{offsetHeader:typeof c=="object"?c.offsetHeader??0:0,offsetScroll:typeof c=="object"?c.offsetScroll:void 0}:null,p=r.getVisibleLeafColumns().length;return e.jsxs("div",{className:d.cn("ds:flex ds:w-full ds:flex-col ds:gap-2.5 ds:relative",C),...z,children:[S,g&&e.jsx("div",{className:d.cn("ds:absolute ds:inset-0 ds:bg-background/50 ds:flex ds:items-center ds:justify-center ds:z-20",t?.loadingOverlay),children:P??"Loading..."}),e.jsxs(n.Table,{className:d.cn("ds:table-fixed",t?.table),style:{minWidth:r.getTotalSize()},containerClassName:d.cn(k&&"ds:rounded-md ds:border ds:border-border","ds:[scrollbar-width:thin] ds:[scrollbar-color:var(--border)_transparent]","ds:[&::-webkit-scrollbar]:h-1.5 ds:[&::-webkit-scrollbar]:w-1.5","ds:[&::-webkit-scrollbar-track]:bg-transparent","ds:[&::-webkit-scrollbar-thumb]:rounded-full ds:[&::-webkit-scrollbar-thumb]:bg-border","ds:[&::-webkit-scrollbar-thumb:hover]:bg-muted-foreground","ds:[container-type:inline-size]",g&&"ds:blur-sm",t?.container),containerStyle:i?{maxHeight:`calc(100vh - ${i.offsetScroll??0}px)`}:void 0,children:[e.jsx(n.TableHeader,{children:r.getHeaderGroups().map(o=>e.jsx(n.TableRow,{className:t?.headerRow,children:o.headers.map(l=>e.jsx(n.TableHead,{colSpan:l.colSpan,className:d.cn(t?.headerCell,l.column.getIsPinned()&&"ds:bg-background"),style:{...v.getCommonPinningStyles({column:l.column,withBorder:!0}),...i&&{position:"sticky",top:i.offsetHeader,zIndex:l.column.getIsPinned()?3:2,background:"var(--background)"}},children:l.isPlaceholder?null:l.column.columnDef.header?typeof l.column.columnDef.header=="function"?T.flexRender(l.column.columnDef.header,l.getContext()):e.jsx(N.DataTableColumnHeader,{column:l.column}):null},l.id))},o.id))}),e.jsx(n.TableBody,{className:t?.body,children:r.getRowModel().rows?.length?r.getRowModel().rows.map(o=>{const l=typeof b=="function"?b(o):b,j=e.jsx(n.TableRow,{"data-state":o.getIsSelected()&&"selected",className:d.cn(t?.row,l,u&&"ds:cursor-pointer"),onClick:u?s=>u(o,s):void 0,children:o.getVisibleCells().map(s=>{const w=e.jsx(n.TableCell,{className:d.cn("ds:overflow-hidden ds:text-ellipsis",t?.cell,s.column.getIsPinned()&&"ds:bg-background"),style:{...v.getCommonPinningStyles({column:s.column,withBorder:!0})},children:T.flexRender(s.column.columnDef.cell,s.getContext())},s.id);return h?e.jsx(y.Fragment,{children:h(s,w)},s.id):w})},o.id);return x?e.jsx(y.Fragment,{children:x(o,j)},o.id):j}):e.jsx(n.TableRow,{className:t?.emptyRow,children:e.jsx(n.TableCell,{colSpan:p,className:d.cn("ds:h-24 ds:text-center",t?.emptyCell),children:q??"No results."})})}),f&&e.jsx(n.TableFooter,{children:e.jsx(n.TableRow,{className:t?.footerRow,children:e.jsx(n.TableCell,{colSpan:p,className:t?.footerCell,style:R?{position:"sticky",bottom:0,zIndex:2}:void 0,children:e.jsx("div",{className:"ds:sticky ds:left-2 ds:w-[calc(100cqw-1rem)]",children:f(r.getRowModel().rows.map(o=>o.original))})})})})]}),e.jsxs("div",{className:"ds:flex ds:flex-col ds:gap-2.5",children:[a&&e.jsx(I.DataTablePagination,{showTotalCount:H,totalCount:D,showPageSizeOptions:!0,showRowSelectionCount:!0,table:r,...a===!0?{}:a}),m&&r.getFilteredSelectedRowModel().rows.length>0&&m]})]})}exports.DataTable=M;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("cmdk"),u=require("lucide-react"),t=require("../lib/utils.cjs"),n=require("./dialog.cjs");function a({className:d,...e}){return s.jsx(o.Command,{"data-slot":"command",className:t.cn("ds:bg-popover ds:text-popover-foreground ds:flex ds:h-full ds:w-full ds:flex-col ds:overflow-hidden ds:rounded-md",d),...e})}function l({title:d="Command Palette",description:e="Search for a command to run...",children:m,className:r,showCloseButton:c=!0,...i}){return s.jsxs(n.Dialog,{...i,children:[s.jsxs(n.DialogHeader,{className:"ds:sr-only",children:[s.jsx(n.DialogTitle,{children:d}),s.jsx(n.DialogDescription,{children:e})]}),s.jsx(n.DialogContent,{className:t.cn("ds:overflow-hidden ds:p-0",r),showCloseButton:c,children:s.jsx(a,{className:"ds:[&_[cmdk-group-heading]]:text-muted-foreground ds:**:data-[slot=command-input-wrapper]:h-12 ds:[&_[cmdk-group-heading]]:px-2 ds:[&_[cmdk-group-heading]]:font-medium ds:[&_[cmdk-group]]:px-2 ds:[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 ds:[&_[cmdk-input-wrapper]_svg]:h-5 ds:[&_[cmdk-input-wrapper]_svg]:w-5 ds:[&_[cmdk-input]]:h-12 ds:[&_[cmdk-item]]:px-2 ds:[&_[cmdk-item]]:py-3 ds:[&_[cmdk-item]_svg]:h-5 ds:[&_[cmdk-item]_svg]:w-5",children:m})})]})}function p({className:d,...e}){return s.jsxs("div",{"data-slot":"command-input-wrapper",className:"ds:flex ds:h-9 ds:items-center ds:gap-2 ds:border-b ds:px-3",children:[s.jsx(u.SearchIcon,{className:"ds:size-4 ds:shrink-0 ds:opacity-50"}),s.jsx(o.Command.Input,{"data-slot":"command-input",className:t.cn("ds:placeholder:text-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("cmdk"),u=require("lucide-react"),t=require("../lib/utils.cjs"),n=require("./dialog.cjs");function a({className:d,...e}){return s.jsx(o.Command,{"data-slot":"command",className:t.cn("ds:bg-popover ds:text-popover-foreground ds:flex ds:h-full ds:w-full ds:flex-col ds:overflow-hidden ds:rounded-md",d),...e})}function l({title:d="Command Palette",description:e="Search for a command to run...",children:m,className:r,showCloseButton:c=!0,...i}){return s.jsxs(n.Dialog,{...i,children:[s.jsxs(n.DialogHeader,{className:"ds:sr-only",children:[s.jsx(n.DialogTitle,{children:d}),s.jsx(n.DialogDescription,{children:e})]}),s.jsx(n.DialogContent,{className:t.cn("ds:overflow-hidden ds:p-0",r),showCloseButton:c,children:s.jsx(a,{className:"ds:[&_[cmdk-group-heading]]:text-muted-foreground ds:**:data-[slot=command-input-wrapper]:h-12 ds:[&_[cmdk-group-heading]]:px-2 ds:[&_[cmdk-group-heading]]:font-medium ds:[&_[cmdk-group]]:px-2 ds:[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 ds:[&_[cmdk-input-wrapper]_svg]:h-5 ds:[&_[cmdk-input-wrapper]_svg]:w-5 ds:[&_[cmdk-input]]:h-12 ds:[&_[cmdk-item]]:px-2 ds:[&_[cmdk-item]]:py-3 ds:[&_[cmdk-item]_svg]:h-5 ds:[&_[cmdk-item]_svg]:w-5",children:m})})]})}function p({className:d,...e}){return s.jsxs("div",{"data-slot":"command-input-wrapper",className:"ds:flex ds:h-9 ds:items-center ds:gap-2 ds:border-b ds:px-3",children:[s.jsx(u.SearchIcon,{className:"ds:size-4 ds:shrink-0 ds:opacity-50"}),s.jsx(o.Command.Input,{"data-slot":"command-input",className:t.cn("ds:placeholder:text-subtle-foreground ds:flex ds:h-10 ds:w-full ds:rounded-md ds:bg-transparent ds:py-3 ds:text-sm ds:outline-hidden ds:disabled:cursor-not-allowed ds:disabled:opacity-50",d),...e})]})}function g({className:d,...e}){return s.jsx(o.Command.List,{"data-slot":"command-list",className:t.cn("ds:max-h-[300px] ds:scroll-py-1 ds:overflow-x-hidden ds:overflow-y-auto",d),...e})}function x({...d}){return s.jsx(o.Command.Empty,{"data-slot":"command-empty",className:"ds:py-6 ds:text-center ds:text-sm",...d})}function h({className:d,...e}){return s.jsx(o.Command.Group,{"data-slot":"command-group",className:t.cn("ds:text-foreground ds:[&_[cmdk-group-heading]]:text-muted-foreground ds:overflow-hidden ds:p-1 ds:[&_[cmdk-group-heading]]:px-2 ds:[&_[cmdk-group-heading]]:py-1.5 ds:[&_[cmdk-group-heading]]:text-xs ds:[&_[cmdk-group-heading]]:font-medium",d),...e})}function f({className:d,...e}){return s.jsx(o.Command.Separator,{"data-slot":"command-separator",className:t.cn("ds:bg-border ds:-mx-1 ds:h-px",d),...e})}function C({className:d,...e}){return s.jsx(o.Command.Item,{"data-slot":"command-item",className:t.cn("ds:data-[selected=true]:bg-accent ds:data-[selected=true]:text-accent-foreground ds:[&_svg:not([class*='text-'])]:text-muted-foreground ds:relative ds:flex ds:cursor-default ds:items-center ds:gap-2 ds:rounded-sm ds:px-2 ds:py-1.5 ds:text-sm ds:outline-hidden ds:select-none ds:data-[disabled=true]:pointer-events-none ds:data-[disabled=true]:opacity-50 ds:[&_svg]:pointer-events-none ds:[&_svg]:shrink-0 ds:[&_svg:not([class*='size-'])]:size-4",d),...e})}function _({className:d,...e}){return s.jsx("span",{"data-slot":"command-shortcut",className:t.cn("ds:text-muted-foreground ds:ml-auto ds:text-xs ds:tracking-widest",d),...e})}exports.Command=a;exports.CommandDialog=l;exports.CommandEmpty=x;exports.CommandGroup=h;exports.CommandInput=p;exports.CommandItem=C;exports.CommandList=g;exports.CommandSeparator=f;exports.CommandShortcut=_;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),u=require("react"),c=require("class-variance-authority"),l=require("../lib/utils.cjs");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),u=require("react"),c=require("class-variance-authority"),l=require("../lib/utils.cjs");function b(s){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const e in s)if(e!=="default"){const d=Object.getOwnPropertyDescriptor(s,e);Object.defineProperty(r,e,d.get?d:{enumerable:!0,get:()=>s[e]})}}return r.default=s,Object.freeze(r)}const f=b(u),t=c.cva("ds:file:text-foreground ds:placeholder:text-subtle-foreground ds:selection:bg-primary ds:selection:text-primary-foreground ds:dark:bg-background ds:border-input ds:w-full ds:min-w-0 ds:rounded-md ds:border ds:bg-transparent ds:shadow-xs ds:transition-[color,box-shadow] ds:outline-none ds:file:inline-flex ds:file:h-7 ds:file:border-0 ds:file:bg-transparent ds:file:text-sm ds:file:font-medium ds:disabled:pointer-events-none ds:disabled:cursor-not-allowed ds:disabled:opacity-50 ds:focus-visible:border-ring ds:focus-visible:ring-ring/50 ds:focus-visible:ring-[3px] ds:aria-invalid:ring-destructive/20 ds:dark:aria-invalid:ring-destructive/40 ds:aria-invalid:border-destructive",{variants:{size:{xs:"ds:h-6 ds:text-xs ds:px-2 ds:py-0.5",sm:"ds:h-8 ds:text-sm ds:px-2.5 ds:py-1",normal:"ds:h-9 ds:px-3 ds:py-1",lg:"ds:h-11 ds:px-4 ds:py-2",xl:"ds:h-14 ds:px-5 ds:py-3"},state:{default:"",success:"ds:border-success ds:ring-success/30 ds:focus-visible:border-success ds:focus-visible:ring-success/50",error:"ds:border-destructive ds:ring-destructive/30 ds:focus-visible:border-destructive ds:focus-visible:ring-destructive/50",warning:"ds:border-warning ds:ring-warning/30 ds:focus-visible:border-warning ds:focus-visible:ring-warning/50"}},defaultVariants:{size:"normal",state:"default"}}),i=f.forwardRef(({className:s,type:r,size:e,state:d="default",...n},o)=>a.jsx("input",{ref:o,type:r,"data-slot":"input",className:l.cn(t({size:e,state:d,className:s})),...n}));i.displayName="Input";exports.Input=i;exports.inputVariants=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),t=require("../lib/utils.cjs"),a=require("class-variance-authority"),n=a.cva("ds:border-input ds:placeholder:text-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),t=require("../lib/utils.cjs"),a=require("class-variance-authority"),n=a.cva("ds:border-input ds:placeholder:text-subtle-foreground ds:focus-visible:border-ring ds:focus-visible:ring-ring/50 ds:aria-invalid:ring-destructive/20 ds:dark:aria-invalid:ring-destructive/40 ds:aria-invalid:border-destructive ds:dark:background ds:flex field-sizing-content ds:min-h-16 ds:w-full ds:max-w-full ds:break-words ds:whitespace-pre-wrap ds:rounded-md ds:border ds:bg-transparent ds:text-base ds:shadow-xs ds:transition-[color,box-shadow] ds:outline-none ds:focus-visible:ring-[3px] ds:disabled:cursor-not-allowed ds:disabled:opacity-50 ds:md:text-sm",{variants:{size:{xs:"ds:text-xs ds:min-h-32 ds:px-2 ds:py-0.5",sm:"ds:text-sm ds:min-h-32 ds:px-2.5 ds:py-1",normal:"ds:min-h-32 ds:px-3 ds:py-1",lg:"ds:min-h-32 ds:px-4 ds:py-2",xl:"ds:min-h-32 ds:px-5 ds:py-3"},state:{default:"",success:"ds:border-success ds:ring-success/30 ds:focus-visible:border-success ds:focus-visible:ring-success/50",error:"ds:border-destructive ds:ring-destructive/30 ds:focus-visible:border-destructive ds:focus-visible:ring-destructive/50",warning:"ds:border-warning ds:ring-warning/30 ds:focus-visible:border-warning ds:focus-visible:ring-warning/50"}},defaultVariants:{size:"normal",state:"default"}});function o({size:d,state:e,className:s,...r}){return i.jsx("textarea",{"data-slot":"textarea",className:t.cn(n({size:d,state:e,className:s}),s),...r})}exports.Textarea=o;
|