sparkdesign 0.4.6 → 0.4.7
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/AI_README.md +60 -0
- package/README.md +1 -1
- package/cli/dist/commands/add.js +1 -1
- package/cli/dist/commands/init.js +1 -1
- package/cli/registry/AGENTS.md +9 -2
- package/cli/registry/agent-manifest.json +794 -0
- package/cli/registry/basic/alert.tsx +76 -0
- package/cli/registry/basic/aspect-ratio.tsx +8 -0
- package/cli/registry/basic/breadcrumb.tsx +117 -0
- package/cli/registry/basic/button-group.tsx +79 -0
- package/cli/registry/basic/button.tsx +1 -1
- package/cli/registry/basic/calendar.tsx +221 -0
- package/cli/registry/basic/card.tsx +103 -0
- package/cli/registry/basic/carousel.tsx +241 -0
- package/cli/registry/basic/chart.tsx +372 -0
- package/cli/registry/basic/checkbox.tsx +42 -0
- package/cli/registry/basic/collapsible-card.tsx +2 -2
- package/cli/registry/basic/combobox.tsx +75 -0
- package/cli/registry/basic/command.tsx +184 -0
- package/cli/registry/basic/context-menu.tsx +239 -0
- package/cli/registry/basic/data-table.tsx +73 -0
- package/cli/registry/basic/date-picker.tsx +13 -0
- package/cli/registry/basic/dialog.tsx +169 -0
- package/cli/registry/basic/direction.tsx +25 -0
- package/cli/registry/basic/drawer.tsx +164 -0
- package/cli/registry/basic/dropdown-menu.tsx +0 -4
- package/cli/registry/basic/empty.tsx +104 -0
- package/cli/registry/basic/field.tsx +248 -0
- package/cli/registry/basic/hover-card.tsx +58 -0
- package/cli/registry/basic/input-group.tsx +168 -0
- package/cli/registry/basic/input-otp.tsx +75 -0
- package/cli/registry/basic/input.tsx +27 -0
- package/cli/registry/basic/item.tsx +204 -0
- package/cli/registry/basic/label.tsx +24 -0
- package/cli/registry/basic/menubar.tsx +274 -0
- package/cli/registry/basic/native-select.tsx +62 -0
- package/cli/registry/basic/navigation-menu.tsx +168 -0
- package/cli/registry/basic/popover.tsx +59 -0
- package/cli/registry/basic/scroll-area.tsx +58 -0
- package/cli/registry/basic/select.tsx +2 -1
- package/cli/registry/basic/separator.tsx +26 -0
- package/cli/registry/basic/sheet.tsx +18 -0
- package/cli/registry/basic/textarea.tsx +25 -0
- package/cli/registry/basic/toggle.tsx +1 -1
- package/cli/registry/basic/typography.tsx +1 -1
- package/cli/registry/chat/chat-input/chat-input-textarea.tsx +1 -1
- package/cli/registry/chat/chat-input/compound.tsx +4 -3
- package/cli/registry/chat/chat-input/context.tsx +4 -1
- package/cli/registry/chat/code-block-part.tsx +1 -1
- package/cli/registry/chat/conversation-anchor-nav.tsx +349 -0
- package/cli/registry/chat/file-attachment.tsx +2 -1
- package/cli/registry/chat/file-review-part.tsx +21 -21
- package/cli/registry/chat/markdown.tsx +2 -2
- package/cli/registry/chat/queue-indicator.tsx +1 -0
- package/cli/registry/chat/streaming-markdown-block.tsx +12 -8
- package/cli/registry/chat/tool-invocation-card.tsx +4 -1
- package/cli/registry/lib/file-icon-maps.ts +22 -22
- package/cli/registry/meta.json +518 -0
- package/cli/registry/tokens/ontology.json +404 -0
- package/cli/registry/tokens/scale/presets/compact.css +16 -5
- package/cli/registry/tokens/scale/presets/dense.css +13 -2
- package/cli/registry/tokens/scale/presets/sharp.css +18 -6
- package/cli/registry/tokens/scale/presets/soft.css +23 -1
- package/dist/registry/basic/alert.d.ts +24 -0
- package/dist/registry/basic/aspect-ratio.d.ts +16 -0
- package/dist/registry/basic/breadcrumb.d.ts +24 -0
- package/dist/registry/basic/button-group.d.ts +26 -0
- package/dist/registry/basic/button.d.ts +1 -1
- package/dist/registry/basic/calendar.d.ts +22 -0
- package/dist/registry/basic/card.d.ts +27 -0
- package/dist/registry/basic/carousel.d.ts +19 -0
- package/dist/registry/basic/chart.d.ts +55 -0
- package/dist/registry/basic/checkbox.d.ts +21 -0
- package/dist/registry/basic/combobox.d.ts +26 -0
- package/dist/registry/basic/command.d.ts +18 -0
- package/dist/registry/basic/context-menu.d.ts +44 -0
- package/dist/registry/basic/data-table.d.ts +26 -0
- package/dist/registry/basic/date-picker.d.ts +18 -0
- package/dist/registry/basic/dialog.d.ts +39 -0
- package/dist/registry/basic/direction.d.ts +19 -0
- package/dist/registry/basic/drawer.d.ts +37 -0
- package/dist/registry/basic/empty.d.ts +22 -0
- package/dist/registry/basic/field.d.ts +24 -0
- package/dist/registry/basic/hover-card.d.ts +22 -0
- package/dist/registry/basic/input-group.d.ts +27 -0
- package/dist/registry/basic/input-otp.d.ts +22 -0
- package/dist/registry/basic/input.d.ts +15 -0
- package/dist/registry/basic/item.d.ts +34 -0
- package/dist/registry/basic/label.d.ts +16 -0
- package/dist/registry/basic/menubar.d.ts +37 -0
- package/dist/registry/basic/native-select.d.ts +18 -0
- package/dist/registry/basic/navigation-menu.d.ts +25 -0
- package/dist/registry/basic/popover.d.ts +23 -0
- package/dist/registry/basic/scroll-area.d.ts +5 -0
- package/dist/registry/basic/separator.d.ts +16 -0
- package/dist/registry/basic/sheet.d.ts +13 -0
- package/dist/registry/basic/textarea.d.ts +15 -0
- package/dist/registry/basic/toggle.d.ts +1 -1
- package/dist/registry/chat/chat-input/context.d.ts +3 -1
- package/dist/registry/chat/conversation-anchor-nav.d.ts +72 -0
- package/dist/registry/chat/tool-invocation-card.d.ts +2 -0
- package/dist/scale/presets/compact.css +16 -5
- package/dist/scale/presets/dense.css +13 -2
- package/dist/scale/presets/sharp.css +18 -6
- package/dist/scale/presets/soft.css +23 -1
- package/dist/spark-design.cjs.js +40 -36
- package/dist/spark-design.es.js +8647 -8657
- package/dist/sparkdesign.css +1 -1
- package/dist/src/components/basic/Alert/index.d.ts +13 -0
- package/dist/src/components/basic/AspectRatio/index.d.ts +13 -0
- package/dist/src/components/basic/Breadcrumb/index.d.ts +12 -0
- package/dist/src/components/basic/ButtonGroup/index.d.ts +13 -0
- package/dist/src/components/basic/Calendar/index.d.ts +13 -0
- package/dist/src/components/basic/Card/index.d.ts +13 -0
- package/dist/src/components/basic/Carousel/index.d.ts +12 -0
- package/dist/src/components/basic/Chart/index.d.ts +13 -0
- package/dist/src/components/basic/Checkbox/index.d.ts +13 -0
- package/dist/src/components/basic/Combobox/index.d.ts +13 -0
- package/dist/src/components/basic/Command/index.d.ts +12 -0
- package/dist/src/components/basic/ContextMenu/index.d.ts +19 -0
- package/dist/src/components/basic/DataTable/index.d.ts +13 -0
- package/dist/src/components/basic/DatePicker/index.d.ts +13 -0
- package/dist/src/components/basic/Dialog/index.d.ts +16 -0
- package/dist/src/components/basic/Direction/index.d.ts +13 -0
- package/dist/src/components/basic/Drawer/index.d.ts +16 -0
- package/dist/src/components/basic/Empty/index.d.ts +12 -0
- package/dist/src/components/basic/Field/index.d.ts +12 -0
- package/dist/src/components/basic/HoverCard/index.d.ts +16 -0
- package/dist/src/components/basic/Input/index.d.ts +13 -0
- package/dist/src/components/basic/InputGroup/index.d.ts +12 -0
- package/dist/src/components/basic/InputOTP/index.d.ts +12 -0
- package/dist/src/components/basic/Item/index.d.ts +12 -0
- package/dist/src/components/basic/Label/index.d.ts +13 -0
- package/dist/src/components/basic/Menubar/index.d.ts +12 -0
- package/dist/src/components/basic/NativeSelect/index.d.ts +12 -0
- package/dist/src/components/basic/NavigationMenu/index.d.ts +12 -0
- package/dist/src/components/basic/Popover/index.d.ts +16 -0
- package/dist/src/components/basic/ScrollArea/index.d.ts +12 -0
- package/dist/src/components/basic/Separator/index.d.ts +13 -0
- package/dist/src/components/basic/Sheet/index.d.ts +13 -0
- package/dist/src/components/basic/Textarea/index.d.ts +13 -0
- package/dist/src/components/chat/ConversationAnchorNav/index.d.ts +13 -0
- package/dist/src/components/chat/StreamingMarkdownBlock/index.d.ts +13 -0
- package/dist/src/components/index.d.ts +57 -0
- package/dist/tokens/AGENTS.md +1 -0
- package/dist/tokens/scale/presets/compact.css +16 -5
- package/dist/tokens/scale/presets/dense.css +13 -2
- package/dist/tokens/scale/presets/sharp.css +18 -6
- package/dist/tokens/scale/presets/soft.css +23 -1
- package/docs/agent/component-selection.md +60 -0
- package/docs/agent/token-ontology.md +37 -0
- package/package.json +31 -5
- package/registry/agent-manifest.json +794 -0
- package/registry/tokens/ontology.json +404 -0
- package/dist/_basePickBy-DnQN8w3y.js +0 -151
- package/dist/_basePickBy-a-kPMlkg.cjs +0 -1
- package/dist/_baseUniq-B-N2NQ50.js +0 -614
- package/dist/_baseUniq-Cc_zbSif.cjs +0 -1
- package/dist/arc-BQBhijZ6.js +0 -83
- package/dist/arc-mWQt0Yph.cjs +0 -1
- package/dist/architectureDiagram-VXUJARFQ-BMZEucno.cjs +0 -36
- package/dist/architectureDiagram-VXUJARFQ-DTdjD3Bp.js +0 -4661
- package/dist/blockDiagram-VD42YOAC-CzHn0yob.js +0 -2256
- package/dist/blockDiagram-VD42YOAC-DDxdHAlz.cjs +0 -122
- package/dist/c4Diagram-YG6GDRKO-4Gz0I4gj.cjs +0 -10
- package/dist/c4Diagram-YG6GDRKO-BIy--yVN.js +0 -1580
- package/dist/channel-BQn0o8bs.js +0 -5
- package/dist/channel-DaN7XniJ.cjs +0 -1
- package/dist/chunk-4BX2VUAB-BlQFTQqz.cjs +0 -1
- package/dist/chunk-4BX2VUAB-Czitj3Kc.js +0 -8
- package/dist/chunk-55IACEB6-DXacNZbO.js +0 -8
- package/dist/chunk-55IACEB6-DnDxpye9.cjs +0 -1
- package/dist/chunk-B4BG7PRW-CBdN0q_V.js +0 -1375
- package/dist/chunk-B4BG7PRW-DbGvUkGO.cjs +0 -165
- package/dist/chunk-DI55MBZ5-D1YJMs6x.cjs +0 -220
- package/dist/chunk-DI55MBZ5-NCQTvayw.js +0 -1370
- package/dist/chunk-FMBD7UC4-CsGMbrtr.js +0 -19
- package/dist/chunk-FMBD7UC4-Di7cUUh5.cjs +0 -15
- package/dist/chunk-QN33PNHL-0j5LC8Lm.cjs +0 -1
- package/dist/chunk-QN33PNHL-3GERZBRm.js +0 -19
- package/dist/chunk-QZHKN3VN-AVEY9ImQ.js +0 -15
- package/dist/chunk-QZHKN3VN-s8Z0a8mc.cjs +0 -1
- package/dist/chunk-TZMSLE5B-CAf87HPt.cjs +0 -1
- package/dist/chunk-TZMSLE5B-sbiflal0.js +0 -64
- package/dist/classDiagram-2ON5EDUG-Ct9JLIN2.cjs +0 -1
- package/dist/classDiagram-2ON5EDUG-Dzfrft3a.js +0 -16
- package/dist/classDiagram-v2-WZHVMYZB-Ct9JLIN2.cjs +0 -1
- package/dist/classDiagram-v2-WZHVMYZB-Dzfrft3a.js +0 -16
- package/dist/clone-Cde_NQ8V.js +0 -8
- package/dist/clone-DCNjWuM2.cjs +0 -1
- package/dist/cose-bilkent-S5V4N54A-0uLijMro.cjs +0 -1
- package/dist/cose-bilkent-S5V4N54A-Bb08N431.js +0 -2608
- package/dist/cytoscape.esm-CNUX3VTg.cjs +0 -321
- package/dist/cytoscape.esm-Cvf3sx9F.js +0 -18704
- package/dist/dagre-6UL2VRFP-CY_Wz5Zd.js +0 -444
- package/dist/dagre-6UL2VRFP-Dxe7_qZc.cjs +0 -4
- package/dist/defaultLocale-BgPVtth8.js +0 -171
- package/dist/defaultLocale-C4wbwF1n.cjs +0 -1
- package/dist/diagram-PSM6KHXK-D2bdb7MT.js +0 -531
- package/dist/diagram-PSM6KHXK-YF69SUjY.cjs +0 -24
- package/dist/diagram-QEK2KX5R-BpUSoh0-.js +0 -217
- package/dist/diagram-QEK2KX5R-DZPGteon.cjs +0 -43
- package/dist/diagram-S2PKOQOG-ht-zdvFG.cjs +0 -24
- package/dist/diagram-S2PKOQOG-zFeLJ50Z.js +0 -142
- package/dist/erDiagram-Q2GNP2WA-B38iJ6ts.js +0 -841
- package/dist/erDiagram-Q2GNP2WA-RgS80DDU.cjs +0 -60
- package/dist/flowDiagram-NV44I4VS-BHilOs2p.cjs +0 -162
- package/dist/flowDiagram-NV44I4VS-BrBJcoce.js +0 -1620
- package/dist/ganttDiagram-JELNMOA3-pZiJeFio.cjs +0 -267
- package/dist/ganttDiagram-JELNMOA3-tw6FhkWJ.js +0 -2670
- package/dist/gitGraphDiagram-V2S2FVAM-BWn5uIK5.js +0 -699
- package/dist/gitGraphDiagram-V2S2FVAM-DKKeG-9R.cjs +0 -65
- package/dist/graph-DIbblrZP.cjs +0 -1
- package/dist/graph-DPcK91G3.js +0 -247
- package/dist/infoDiagram-HS3SLOUP-B8gwwhct.cjs +0 -2
- package/dist/infoDiagram-HS3SLOUP-D47PNcP_.js +0 -24
- package/dist/init-CHZsXQcr.cjs +0 -1
- package/dist/init-DjUOC4st.js +0 -16
- package/dist/journeyDiagram-XKPGCS4Q-BG3cfhyU.js +0 -834
- package/dist/journeyDiagram-XKPGCS4Q-D8DVLJof.cjs +0 -139
- package/dist/kanban-definition-3W4ZIXB7-4OCnEouP.cjs +0 -89
- package/dist/kanban-definition-3W4ZIXB7-CWi_ssF9.js +0 -719
- package/dist/layout-Byuh8f-J.cjs +0 -1
- package/dist/layout-CdLdvj1j.js +0 -1335
- package/dist/linear-C2Q_PI9B.js +0 -259
- package/dist/linear-C69aPBW1.cjs +0 -1
- package/dist/mermaid.core-DBwAx_jp.cjs +0 -249
- package/dist/mermaid.core-gFR0XUlD.js +0 -15300
- package/dist/mindmap-definition-VGOIOE7T-8P7obVV4.cjs +0 -68
- package/dist/mindmap-definition-VGOIOE7T-DnOa7WJ9.js +0 -784
- package/dist/ordinal-B6-f3MAq.js +0 -61
- package/dist/ordinal-CagbB1m8.cjs +0 -1
- package/dist/pieDiagram-ADFJNKIX-5NAlvhMo.js +0 -161
- package/dist/pieDiagram-ADFJNKIX-CQBG4yR9.cjs +0 -30
- package/dist/quadrantDiagram-AYHSOK5B-Oe4y7RZ0.cjs +0 -7
- package/dist/quadrantDiagram-AYHSOK5B-rh2DPEP1.js +0 -1022
- package/dist/requirementDiagram-UZGBJVZJ-DcWaCuXr.js +0 -850
- package/dist/requirementDiagram-UZGBJVZJ-gfdlrFiq.cjs +0 -64
- package/dist/sankeyDiagram-TZEHDZUN-CQIKFwD0.js +0 -810
- package/dist/sankeyDiagram-TZEHDZUN-DvPtzQvC.cjs +0 -10
- package/dist/sequenceDiagram-WL72ISMW-BNrsMagL.cjs +0 -145
- package/dist/sequenceDiagram-WL72ISMW-iCX3ckKx.js +0 -2511
- package/dist/stateDiagram-FKZM4ZOC-DBvJ_eeL.cjs +0 -1
- package/dist/stateDiagram-FKZM4ZOC-ZVsJlaHJ.js +0 -263
- package/dist/stateDiagram-v2-4FDKWEC3-CB_nTHcE.js +0 -16
- package/dist/stateDiagram-v2-4FDKWEC3-Xkx17v6T.cjs +0 -1
- package/dist/timeline-definition-IT6M3QCI-BmGkYQiz.cjs +0 -61
- package/dist/timeline-definition-IT6M3QCI-Ck8zTt6w.js +0 -795
- package/dist/treemap-GDKQZRPO-B9sfERx8.js +0 -17922
- package/dist/treemap-GDKQZRPO-BVfJRs0Z.cjs +0 -160
- package/dist/xychartDiagram-PRI3JC2R-By_S8NzN.js +0 -1340
- package/dist/xychartDiagram-PRI3JC2R-CNfDrGxM.cjs +0 -7
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { cn } from '@/lib/utils'
|
|
3
|
+
import { Input } from './input'
|
|
4
|
+
|
|
5
|
+
export interface ComboboxOption {
|
|
6
|
+
value: string
|
|
7
|
+
label: string
|
|
8
|
+
disabled?: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ComboboxProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
12
|
+
options: ComboboxOption[]
|
|
13
|
+
value?: string
|
|
14
|
+
onValueChange?: (value: string) => void
|
|
15
|
+
placeholder?: string
|
|
16
|
+
emptyText?: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function Combobox({
|
|
20
|
+
options,
|
|
21
|
+
value,
|
|
22
|
+
onValueChange,
|
|
23
|
+
placeholder = 'Search...',
|
|
24
|
+
emptyText = 'No option found.',
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}: ComboboxProps) {
|
|
28
|
+
const [query, setQuery] = React.useState('')
|
|
29
|
+
const selected = options.find((option) => option.value === value)
|
|
30
|
+
const filtered = options.filter((option) =>
|
|
31
|
+
option.label.toLowerCase().includes(query.toLowerCase()),
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div className={cn('w-full rounded-lg border border-border-tertiary bg-bg-container p-1', className)} {...props}>
|
|
36
|
+
<Input
|
|
37
|
+
role="combobox"
|
|
38
|
+
aria-expanded="true"
|
|
39
|
+
value={query || selected?.label || ''}
|
|
40
|
+
onChange={(event) => setQuery(event.target.value)}
|
|
41
|
+
placeholder={placeholder}
|
|
42
|
+
className="border-0 bg-transparent shadow-none"
|
|
43
|
+
/>
|
|
44
|
+
<div role="listbox" className="mt-1 max-h-60 overflow-auto rounded-md">
|
|
45
|
+
{filtered.length > 0 ? (
|
|
46
|
+
filtered.map((option) => (
|
|
47
|
+
<button
|
|
48
|
+
key={option.value}
|
|
49
|
+
type="button"
|
|
50
|
+
role="option"
|
|
51
|
+
aria-selected={option.value === value}
|
|
52
|
+
disabled={option.disabled}
|
|
53
|
+
className={cn(
|
|
54
|
+
'flex w-full items-center rounded-md px-3 py-2 text-left text-sm text-text transition-colors',
|
|
55
|
+
'hover:bg-fill-secondary focus:bg-fill-secondary focus:outline-none',
|
|
56
|
+
'disabled:pointer-events-none disabled:opacity-50',
|
|
57
|
+
option.value === value && 'bg-fill-secondary',
|
|
58
|
+
)}
|
|
59
|
+
onClick={() => {
|
|
60
|
+
onValueChange?.(option.value)
|
|
61
|
+
setQuery('')
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
{option.label}
|
|
65
|
+
</button>
|
|
66
|
+
))
|
|
67
|
+
) : (
|
|
68
|
+
<div className="px-3 py-2 text-sm text-text-tertiary">{emptyText}</div>
|
|
69
|
+
)}
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export { Combobox }
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Command as CommandPrimitive } from "cmdk"
|
|
5
|
+
import { SearchIcon } from "lucide-react"
|
|
6
|
+
|
|
7
|
+
import { cn } from "@/lib/utils"
|
|
8
|
+
import {
|
|
9
|
+
Dialog,
|
|
10
|
+
DialogContent,
|
|
11
|
+
DialogDescription,
|
|
12
|
+
DialogHeader,
|
|
13
|
+
DialogTitle,
|
|
14
|
+
} from "./dialog"
|
|
15
|
+
|
|
16
|
+
function Command({
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
}: React.ComponentProps<typeof CommandPrimitive>) {
|
|
20
|
+
return (
|
|
21
|
+
<CommandPrimitive
|
|
22
|
+
data-slot="command"
|
|
23
|
+
className={cn(
|
|
24
|
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-bg-container text-text",
|
|
25
|
+
className
|
|
26
|
+
)}
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function CommandDialog({
|
|
33
|
+
title = "Command Palette",
|
|
34
|
+
description = "Search for a command to run...",
|
|
35
|
+
children,
|
|
36
|
+
className,
|
|
37
|
+
showCloseButton = true,
|
|
38
|
+
...props
|
|
39
|
+
}: React.ComponentProps<typeof Dialog> & {
|
|
40
|
+
title?: string
|
|
41
|
+
description?: string
|
|
42
|
+
className?: string
|
|
43
|
+
showCloseButton?: boolean
|
|
44
|
+
}) {
|
|
45
|
+
return (
|
|
46
|
+
<Dialog {...props}>
|
|
47
|
+
<DialogHeader className="sr-only">
|
|
48
|
+
<DialogTitle>{title}</DialogTitle>
|
|
49
|
+
<DialogDescription>{description}</DialogDescription>
|
|
50
|
+
</DialogHeader>
|
|
51
|
+
<DialogContent
|
|
52
|
+
className={cn("overflow-hidden p-0", className)}
|
|
53
|
+
hideCloseButton={!showCloseButton}
|
|
54
|
+
>
|
|
55
|
+
<Command className="**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-text-tertiary [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
|
|
56
|
+
{children}
|
|
57
|
+
</Command>
|
|
58
|
+
</DialogContent>
|
|
59
|
+
</Dialog>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function CommandInput({
|
|
64
|
+
className,
|
|
65
|
+
...props
|
|
66
|
+
}: React.ComponentProps<typeof CommandPrimitive.Input>) {
|
|
67
|
+
return (
|
|
68
|
+
<div
|
|
69
|
+
data-slot="command-input-wrapper"
|
|
70
|
+
className="flex h-9 items-center gap-2 border-b px-3"
|
|
71
|
+
>
|
|
72
|
+
<SearchIcon className="size-4 shrink-0 opacity-50" />
|
|
73
|
+
<CommandPrimitive.Input
|
|
74
|
+
data-slot="command-input"
|
|
75
|
+
className={cn(
|
|
76
|
+
"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-text-tertiary disabled:cursor-not-allowed disabled:opacity-50",
|
|
77
|
+
className
|
|
78
|
+
)}
|
|
79
|
+
{...props}
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function CommandList({
|
|
86
|
+
className,
|
|
87
|
+
...props
|
|
88
|
+
}: React.ComponentProps<typeof CommandPrimitive.List>) {
|
|
89
|
+
return (
|
|
90
|
+
<CommandPrimitive.List
|
|
91
|
+
data-slot="command-list"
|
|
92
|
+
className={cn(
|
|
93
|
+
"max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto",
|
|
94
|
+
className
|
|
95
|
+
)}
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function CommandEmpty({
|
|
102
|
+
...props
|
|
103
|
+
}: React.ComponentProps<typeof CommandPrimitive.Empty>) {
|
|
104
|
+
return (
|
|
105
|
+
<CommandPrimitive.Empty
|
|
106
|
+
data-slot="command-empty"
|
|
107
|
+
className="py-6 text-center text-sm"
|
|
108
|
+
{...props}
|
|
109
|
+
/>
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function CommandGroup({
|
|
114
|
+
className,
|
|
115
|
+
...props
|
|
116
|
+
}: React.ComponentProps<typeof CommandPrimitive.Group>) {
|
|
117
|
+
return (
|
|
118
|
+
<CommandPrimitive.Group
|
|
119
|
+
data-slot="command-group"
|
|
120
|
+
className={cn(
|
|
121
|
+
"overflow-hidden p-1 text-text [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-text-tertiary",
|
|
122
|
+
className
|
|
123
|
+
)}
|
|
124
|
+
{...props}
|
|
125
|
+
/>
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function CommandSeparator({
|
|
130
|
+
className,
|
|
131
|
+
...props
|
|
132
|
+
}: React.ComponentProps<typeof CommandPrimitive.Separator>) {
|
|
133
|
+
return (
|
|
134
|
+
<CommandPrimitive.Separator
|
|
135
|
+
data-slot="command-separator"
|
|
136
|
+
className={cn("-mx-1 h-px bg-border", className)}
|
|
137
|
+
{...props}
|
|
138
|
+
/>
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function CommandItem({
|
|
143
|
+
className,
|
|
144
|
+
...props
|
|
145
|
+
}: React.ComponentProps<typeof CommandPrimitive.Item>) {
|
|
146
|
+
return (
|
|
147
|
+
<CommandPrimitive.Item
|
|
148
|
+
data-slot="command-item"
|
|
149
|
+
className={cn(
|
|
150
|
+
"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-fill-secondary data-[selected=true]:text-text [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-text-tertiary",
|
|
151
|
+
className
|
|
152
|
+
)}
|
|
153
|
+
{...props}
|
|
154
|
+
/>
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function CommandShortcut({
|
|
159
|
+
className,
|
|
160
|
+
...props
|
|
161
|
+
}: React.ComponentProps<"span">) {
|
|
162
|
+
return (
|
|
163
|
+
<span
|
|
164
|
+
data-slot="command-shortcut"
|
|
165
|
+
className={cn(
|
|
166
|
+
"ml-auto text-xs tracking-widest text-text-tertiary",
|
|
167
|
+
className
|
|
168
|
+
)}
|
|
169
|
+
{...props}
|
|
170
|
+
/>
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export {
|
|
175
|
+
Command,
|
|
176
|
+
CommandDialog,
|
|
177
|
+
CommandInput,
|
|
178
|
+
CommandList,
|
|
179
|
+
CommandEmpty,
|
|
180
|
+
CommandGroup,
|
|
181
|
+
CommandItem,
|
|
182
|
+
CommandShortcut,
|
|
183
|
+
CommandSeparator,
|
|
184
|
+
}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { motion } from 'framer-motion'
|
|
3
|
+
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu'
|
|
4
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
5
|
+
import { cn } from '@/lib/utils'
|
|
6
|
+
import { ArrowRightLine, CheckLine } from './icons-inline'
|
|
7
|
+
import { getThemeFromDocument } from './theme-from-document'
|
|
8
|
+
|
|
9
|
+
const ContextMenu = ContextMenuPrimitive.Root
|
|
10
|
+
const ContextMenuTrigger = ContextMenuPrimitive.Trigger
|
|
11
|
+
const ContextMenuGroup = ContextMenuPrimitive.Group
|
|
12
|
+
const ContextMenuPortal = ContextMenuPrimitive.Portal
|
|
13
|
+
const ContextMenuSub = ContextMenuPrimitive.Sub
|
|
14
|
+
const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup
|
|
15
|
+
|
|
16
|
+
const contentClasses =
|
|
17
|
+
'z-50 min-w-32 overflow-hidden rounded-lg border border-border-tertiary bg-bg-container p-1 text-text shadow-lg outline-none'
|
|
18
|
+
|
|
19
|
+
export interface ContextMenuContentProps
|
|
20
|
+
extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content> {
|
|
21
|
+
dataStyle?: string
|
|
22
|
+
dataTheme?: string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const ContextMenuContent = React.forwardRef<
|
|
26
|
+
React.ElementRef<typeof ContextMenuPrimitive.Content>,
|
|
27
|
+
ContextMenuContentProps
|
|
28
|
+
>(({ className, children, dataStyle, dataTheme, ...props }, ref) => {
|
|
29
|
+
const fromDoc = getThemeFromDocument()
|
|
30
|
+
const dataProps =
|
|
31
|
+
dataStyle !== undefined
|
|
32
|
+
? { 'data-style': dataStyle, 'data-theme': dataTheme ?? fromDoc['data-theme'] ?? '' }
|
|
33
|
+
: fromDoc
|
|
34
|
+
return (
|
|
35
|
+
<ContextMenuPrimitive.Portal>
|
|
36
|
+
<div style={{ display: 'contents' }} {...dataProps}>
|
|
37
|
+
<ContextMenuPrimitive.Content
|
|
38
|
+
ref={ref}
|
|
39
|
+
className={cn(contentClasses, className)}
|
|
40
|
+
{...props}
|
|
41
|
+
>
|
|
42
|
+
<motion.div
|
|
43
|
+
initial={{ opacity: 0 }}
|
|
44
|
+
animate={{ opacity: 1 }}
|
|
45
|
+
transition={{ duration: 0.12, ease: [0.4, 0, 0.2, 1] }}
|
|
46
|
+
>
|
|
47
|
+
{children}
|
|
48
|
+
</motion.div>
|
|
49
|
+
</ContextMenuPrimitive.Content>
|
|
50
|
+
</div>
|
|
51
|
+
</ContextMenuPrimitive.Portal>
|
|
52
|
+
)
|
|
53
|
+
})
|
|
54
|
+
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName
|
|
55
|
+
|
|
56
|
+
const subTriggerVariants = cva(
|
|
57
|
+
'flex h-9 w-full cursor-pointer select-none items-center gap-2 rounded-sm px-3 text-sm outline-none hover:bg-fill-secondary focus:bg-fill-secondary data-[highlighted]:bg-fill-secondary data-[state=open]:bg-fill-secondary',
|
|
58
|
+
{
|
|
59
|
+
variants: { inset: { true: 'pl-8 pr-3', false: '' } },
|
|
60
|
+
defaultVariants: { inset: false },
|
|
61
|
+
},
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
const ContextMenuSubTrigger = React.forwardRef<
|
|
65
|
+
React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,
|
|
66
|
+
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> &
|
|
67
|
+
VariantProps<typeof subTriggerVariants>
|
|
68
|
+
>(({ className, inset = false, children, ...props }, ref) => (
|
|
69
|
+
<ContextMenuPrimitive.SubTrigger
|
|
70
|
+
ref={ref}
|
|
71
|
+
className={cn(subTriggerVariants({ inset }), className)}
|
|
72
|
+
{...props}
|
|
73
|
+
>
|
|
74
|
+
{children}
|
|
75
|
+
<span className="ml-auto flex h-4 w-4 items-center justify-center">
|
|
76
|
+
<ArrowRightLine className="h-4 w-4" />
|
|
77
|
+
</span>
|
|
78
|
+
</ContextMenuPrimitive.SubTrigger>
|
|
79
|
+
))
|
|
80
|
+
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName
|
|
81
|
+
|
|
82
|
+
const ContextMenuSubContent = React.forwardRef<
|
|
83
|
+
React.ElementRef<typeof ContextMenuPrimitive.SubContent>,
|
|
84
|
+
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent> & {
|
|
85
|
+
dataStyle?: string
|
|
86
|
+
dataTheme?: string
|
|
87
|
+
}
|
|
88
|
+
>(({ className, dataStyle, dataTheme, ...props }, ref) => {
|
|
89
|
+
const fromDoc = getThemeFromDocument()
|
|
90
|
+
const dataProps =
|
|
91
|
+
dataStyle !== undefined
|
|
92
|
+
? { 'data-style': dataStyle, 'data-theme': dataTheme ?? fromDoc['data-theme'] ?? '' }
|
|
93
|
+
: fromDoc
|
|
94
|
+
return (
|
|
95
|
+
<ContextMenuPrimitive.Portal>
|
|
96
|
+
<div style={{ display: 'contents' }} {...dataProps}>
|
|
97
|
+
<ContextMenuPrimitive.SubContent
|
|
98
|
+
ref={ref}
|
|
99
|
+
className={cn(contentClasses, className)}
|
|
100
|
+
{...props}
|
|
101
|
+
/>
|
|
102
|
+
</div>
|
|
103
|
+
</ContextMenuPrimitive.Portal>
|
|
104
|
+
)
|
|
105
|
+
})
|
|
106
|
+
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName
|
|
107
|
+
|
|
108
|
+
const itemVariants = cva(
|
|
109
|
+
'relative flex h-9 w-full min-w-0 cursor-pointer select-none items-center gap-2 rounded-sm px-3 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
110
|
+
{
|
|
111
|
+
variants: {
|
|
112
|
+
variant: {
|
|
113
|
+
default:
|
|
114
|
+
'hover:bg-fill-secondary focus:bg-fill-secondary focus:text-text data-[highlighted]:bg-fill-secondary data-[highlighted]:text-text',
|
|
115
|
+
destructive:
|
|
116
|
+
'text-error hover:bg-error-bg focus:bg-error-bg focus:text-error data-[highlighted]:bg-error-bg data-[highlighted]:text-error',
|
|
117
|
+
},
|
|
118
|
+
inset: { true: 'pl-8 pr-3', false: '' },
|
|
119
|
+
},
|
|
120
|
+
defaultVariants: { variant: 'default', inset: false },
|
|
121
|
+
},
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
const ContextMenuItem = React.forwardRef<
|
|
125
|
+
React.ElementRef<typeof ContextMenuPrimitive.Item>,
|
|
126
|
+
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> &
|
|
127
|
+
VariantProps<typeof itemVariants>
|
|
128
|
+
>(({ className, inset = false, variant = 'default', ...props }, ref) => (
|
|
129
|
+
<ContextMenuPrimitive.Item
|
|
130
|
+
ref={ref}
|
|
131
|
+
className={cn(itemVariants({ variant, inset }), className)}
|
|
132
|
+
{...props}
|
|
133
|
+
/>
|
|
134
|
+
))
|
|
135
|
+
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName
|
|
136
|
+
|
|
137
|
+
const itemIndicatorClasses =
|
|
138
|
+
'relative flex h-9 w-full min-w-0 cursor-pointer select-none items-center gap-2 rounded-sm pl-8 pr-3 text-sm outline-none hover:bg-fill-secondary focus:bg-fill-secondary focus:text-text data-[highlighted]:bg-fill-secondary data-[highlighted]:text-text data-[disabled]:pointer-events-none data-[disabled]:opacity-50'
|
|
139
|
+
|
|
140
|
+
const ContextMenuCheckboxItem = React.forwardRef<
|
|
141
|
+
React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,
|
|
142
|
+
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>
|
|
143
|
+
>(({ className, children, checked, ...rest }, ref) => (
|
|
144
|
+
<ContextMenuPrimitive.CheckboxItem
|
|
145
|
+
ref={ref}
|
|
146
|
+
checked={checked}
|
|
147
|
+
className={cn(itemIndicatorClasses, className)}
|
|
148
|
+
{...rest}
|
|
149
|
+
>
|
|
150
|
+
<span className="absolute left-2 top-1/2 flex h-3.5 w-3.5 -translate-y-1/2 items-center justify-center">
|
|
151
|
+
<ContextMenuPrimitive.ItemIndicator>
|
|
152
|
+
<CheckLine className="h-4 w-4" />
|
|
153
|
+
</ContextMenuPrimitive.ItemIndicator>
|
|
154
|
+
</span>
|
|
155
|
+
{children}
|
|
156
|
+
</ContextMenuPrimitive.CheckboxItem>
|
|
157
|
+
))
|
|
158
|
+
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName
|
|
159
|
+
|
|
160
|
+
const ContextMenuRadioItem = React.forwardRef<
|
|
161
|
+
React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,
|
|
162
|
+
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>
|
|
163
|
+
>(({ className, children, ...props }, ref) => (
|
|
164
|
+
<ContextMenuPrimitive.RadioItem
|
|
165
|
+
ref={ref}
|
|
166
|
+
className={cn(itemIndicatorClasses, className)}
|
|
167
|
+
{...props}
|
|
168
|
+
>
|
|
169
|
+
<span className="absolute left-2 top-1/2 flex h-3.5 w-3.5 -translate-y-1/2 items-center justify-center">
|
|
170
|
+
<ContextMenuPrimitive.ItemIndicator>
|
|
171
|
+
<div className="h-2 w-2 rounded-full bg-primary" />
|
|
172
|
+
</ContextMenuPrimitive.ItemIndicator>
|
|
173
|
+
</span>
|
|
174
|
+
{children}
|
|
175
|
+
</ContextMenuPrimitive.RadioItem>
|
|
176
|
+
))
|
|
177
|
+
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName
|
|
178
|
+
|
|
179
|
+
const labelVariants = cva(
|
|
180
|
+
'flex h-9 items-center px-3 text-sm font-semibold text-text-secondary',
|
|
181
|
+
{
|
|
182
|
+
variants: { inset: { true: 'pl-8 pr-3', false: '' } },
|
|
183
|
+
defaultVariants: { inset: false },
|
|
184
|
+
},
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
const ContextMenuLabel = React.forwardRef<
|
|
188
|
+
React.ElementRef<typeof ContextMenuPrimitive.Label>,
|
|
189
|
+
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> &
|
|
190
|
+
VariantProps<typeof labelVariants>
|
|
191
|
+
>(({ className, inset = false, ...props }, ref) => (
|
|
192
|
+
<ContextMenuPrimitive.Label
|
|
193
|
+
ref={ref}
|
|
194
|
+
className={cn(labelVariants({ inset }), className)}
|
|
195
|
+
{...props}
|
|
196
|
+
/>
|
|
197
|
+
))
|
|
198
|
+
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName
|
|
199
|
+
|
|
200
|
+
const ContextMenuSeparator = React.forwardRef<
|
|
201
|
+
React.ElementRef<typeof ContextMenuPrimitive.Separator>,
|
|
202
|
+
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>
|
|
203
|
+
>(({ className, ...props }, ref) => (
|
|
204
|
+
<ContextMenuPrimitive.Separator
|
|
205
|
+
ref={ref}
|
|
206
|
+
className={cn('my-1 mx-1 h-px bg-border-tertiary', className)}
|
|
207
|
+
{...props}
|
|
208
|
+
/>
|
|
209
|
+
))
|
|
210
|
+
ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName
|
|
211
|
+
|
|
212
|
+
const ContextMenuShortcut: React.FC<React.HTMLAttributes<HTMLSpanElement>> = ({
|
|
213
|
+
className,
|
|
214
|
+
...props
|
|
215
|
+
}) => (
|
|
216
|
+
<span
|
|
217
|
+
className={cn('ml-auto text-xs tracking-widest text-text-tertiary', className)}
|
|
218
|
+
{...props}
|
|
219
|
+
/>
|
|
220
|
+
)
|
|
221
|
+
ContextMenuShortcut.displayName = 'ContextMenuShortcut'
|
|
222
|
+
|
|
223
|
+
export {
|
|
224
|
+
ContextMenu,
|
|
225
|
+
ContextMenuTrigger,
|
|
226
|
+
ContextMenuContent,
|
|
227
|
+
ContextMenuItem,
|
|
228
|
+
ContextMenuCheckboxItem,
|
|
229
|
+
ContextMenuRadioItem,
|
|
230
|
+
ContextMenuLabel,
|
|
231
|
+
ContextMenuSeparator,
|
|
232
|
+
ContextMenuShortcut,
|
|
233
|
+
ContextMenuGroup,
|
|
234
|
+
ContextMenuPortal,
|
|
235
|
+
ContextMenuSub,
|
|
236
|
+
ContextMenuSubContent,
|
|
237
|
+
ContextMenuSubTrigger,
|
|
238
|
+
ContextMenuRadioGroup,
|
|
239
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { cn } from '@/lib/utils'
|
|
3
|
+
import {
|
|
4
|
+
Table,
|
|
5
|
+
TableBody,
|
|
6
|
+
TableCell,
|
|
7
|
+
TableHead,
|
|
8
|
+
TableHeader,
|
|
9
|
+
TableRow,
|
|
10
|
+
} from './table'
|
|
11
|
+
|
|
12
|
+
export interface DataTableColumn<TData> {
|
|
13
|
+
key: string
|
|
14
|
+
header: React.ReactNode
|
|
15
|
+
cell?: (row: TData, index: number) => React.ReactNode
|
|
16
|
+
accessor?: keyof TData
|
|
17
|
+
className?: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface DataTableProps<TData> extends React.HTMLAttributes<HTMLDivElement> {
|
|
21
|
+
columns: DataTableColumn<TData>[]
|
|
22
|
+
data: TData[]
|
|
23
|
+
emptyText?: React.ReactNode
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function DataTable<TData extends Record<string, unknown>>({
|
|
27
|
+
columns,
|
|
28
|
+
data,
|
|
29
|
+
emptyText = 'No results.',
|
|
30
|
+
className,
|
|
31
|
+
...props
|
|
32
|
+
}: DataTableProps<TData>) {
|
|
33
|
+
return (
|
|
34
|
+
<div className={cn('w-full overflow-auto rounded-lg border border-border-tertiary', className)} {...props}>
|
|
35
|
+
<Table>
|
|
36
|
+
<TableHeader>
|
|
37
|
+
<TableRow>
|
|
38
|
+
{columns.map((column) => (
|
|
39
|
+
<TableHead key={column.key} className={column.className}>
|
|
40
|
+
{column.header}
|
|
41
|
+
</TableHead>
|
|
42
|
+
))}
|
|
43
|
+
</TableRow>
|
|
44
|
+
</TableHeader>
|
|
45
|
+
<TableBody>
|
|
46
|
+
{data.length > 0 ? (
|
|
47
|
+
data.map((row, rowIndex) => (
|
|
48
|
+
<TableRow key={rowIndex}>
|
|
49
|
+
{columns.map((column) => (
|
|
50
|
+
<TableCell key={column.key} className={column.className}>
|
|
51
|
+
{column.cell
|
|
52
|
+
? column.cell(row, rowIndex)
|
|
53
|
+
: column.accessor
|
|
54
|
+
? String(row[column.accessor] ?? '')
|
|
55
|
+
: null}
|
|
56
|
+
</TableCell>
|
|
57
|
+
))}
|
|
58
|
+
</TableRow>
|
|
59
|
+
))
|
|
60
|
+
) : (
|
|
61
|
+
<TableRow>
|
|
62
|
+
<TableCell colSpan={columns.length} className="h-24 text-center text-text-tertiary">
|
|
63
|
+
{emptyText}
|
|
64
|
+
</TableCell>
|
|
65
|
+
</TableRow>
|
|
66
|
+
)}
|
|
67
|
+
</TableBody>
|
|
68
|
+
</Table>
|
|
69
|
+
</div>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { DataTable }
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { Input, type InputProps } from './input'
|
|
3
|
+
|
|
4
|
+
export interface DatePickerProps extends Omit<InputProps, 'type'> {
|
|
5
|
+
type?: 'date' | 'datetime-local' | 'month' | 'time' | 'week'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const DatePicker = React.forwardRef<HTMLInputElement, DatePickerProps>(
|
|
9
|
+
({ type = 'date', ...props }, ref) => <Input ref={ref} type={type} {...props} />,
|
|
10
|
+
)
|
|
11
|
+
DatePicker.displayName = 'DatePicker'
|
|
12
|
+
|
|
13
|
+
export { DatePicker }
|