@twoux/ui 0.0.0-stage → 0.1.0
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/LICENSE.md +61 -0
- package/LICENSES/Apache-2.0.txt +202 -0
- package/NOTICE.md +64 -0
- package/SHADCN-DIFF.md +228 -0
- package/agent/AGENTS.md +358 -0
- package/agent/docs-md/accessibility.md +49 -0
- package/agent/docs-md/action-catalogue.md +81 -0
- package/agent/docs-md/actions.md +74 -0
- package/agent/docs-md/agent-activity-log.md +70 -0
- package/agent/docs-md/agent-permissions.md +82 -0
- package/agent/docs-md/agent-run.md +90 -0
- package/agent/docs-md/agents-on-behalf.md +74 -0
- package/agent/docs-md/ai-column.md +85 -0
- package/agent/docs-md/ai-origin-label.md +70 -0
- package/agent/docs-md/announcing-features.md +73 -0
- package/agent/docs-md/answer-actions.md +81 -0
- package/agent/docs-md/app-shell.md +114 -0
- package/agent/docs-md/artifact-card.md +89 -0
- package/agent/docs-md/ask-on-screen.md +72 -0
- package/agent/docs-md/assistant-page.md +100 -0
- package/agent/docs-md/assistant-panel.md +142 -0
- package/agent/docs-md/avatar.md +82 -0
- package/agent/docs-md/banner.md +106 -0
- package/agent/docs-md/board.md +163 -0
- package/agent/docs-md/breadcrumb.md +89 -0
- package/agent/docs-md/breakdown-table.md +97 -0
- package/agent/docs-md/bulk-action-bar.md +112 -0
- package/agent/docs-md/button.md +293 -0
- package/agent/docs-md/card.md +115 -0
- package/agent/docs-md/change-list.md +99 -0
- package/agent/docs-md/change-request.md +166 -0
- package/agent/docs-md/chart-area.md +87 -0
- package/agent/docs-md/chart-bar.md +100 -0
- package/agent/docs-md/chart-box-plot.md +88 -0
- package/agent/docs-md/chart-bullet.md +89 -0
- package/agent/docs-md/chart-candlestick.md +112 -0
- package/agent/docs-md/chart-card-line.md +120 -0
- package/agent/docs-md/chart-donut.md +90 -0
- package/agent/docs-md/chart-drill-down.md +72 -0
- package/agent/docs-md/chart-funnel.md +71 -0
- package/agent/docs-md/chart-heatmap.md +76 -0
- package/agent/docs-md/chart-histogram.md +81 -0
- package/agent/docs-md/chart-map.md +165 -0
- package/agent/docs-md/chart-mixed.md +88 -0
- package/agent/docs-md/chart-price.md +92 -0
- package/agent/docs-md/chart-radial-bars.md +109 -0
- package/agent/docs-md/chart-radial-lines.md +111 -0
- package/agent/docs-md/chart-sankey.md +104 -0
- package/agent/docs-md/chart-scatter.md +87 -0
- package/agent/docs-md/chart-share-bar.md +89 -0
- package/agent/docs-md/chart-treemap.md +98 -0
- package/agent/docs-md/chart-waterfall.md +93 -0
- package/agent/docs-md/checkbox.md +131 -0
- package/agent/docs-md/choosing-selection-control.md +71 -0
- package/agent/docs-md/citations-sources.md +79 -0
- package/agent/docs-md/citing-sources.md +63 -0
- package/agent/docs-md/clarify-before-acting.md +69 -0
- package/agent/docs-md/clarifying-question.md +92 -0
- package/agent/docs-md/code-block.md +174 -0
- package/agent/docs-md/colours.md +87 -0
- package/agent/docs-md/columns-menu.md +140 -0
- package/agent/docs-md/combobox.md +161 -0
- package/agent/docs-md/command-palette.md +126 -0
- package/agent/docs-md/confidence-note.md +87 -0
- package/agent/docs-md/configurable-dashboard.md +76 -0
- package/agent/docs-md/confirmation-dialog.md +93 -0
- package/agent/docs-md/connected-tools.md +80 -0
- package/agent/docs-md/connector-picker.md +127 -0
- package/agent/docs-md/consistency.md +53 -0
- package/agent/docs-md/content-density.md +61 -0
- package/agent/docs-md/conversation-history.md +78 -0
- package/agent/docs-md/create-record.md +80 -0
- package/agent/docs-md/csv-import.md +88 -0
- package/agent/docs-md/dashboard-items.md +78 -0
- package/agent/docs-md/data-export.md +61 -0
- package/agent/docs-md/data-grid.md +137 -0
- package/agent/docs-md/data-vis-colours.md +76 -0
- package/agent/docs-md/data-visualisation.md +76 -0
- package/agent/docs-md/date-picker.md +178 -0
- package/agent/docs-md/delete-record.md +75 -0
- package/agent/docs-md/dense-table.md +495 -0
- package/agent/docs-md/design-tokens.md +53 -0
- package/agent/docs-md/disabled-read-only.md +75 -0
- package/agent/docs-md/drag-and-drop.md +74 -0
- package/agent/docs-md/dropdown-menu.md +137 -0
- package/agent/docs-md/edit-record.md +73 -0
- package/agent/docs-md/empty-loading-error.md +78 -0
- package/agent/docs-md/empty-state.md +128 -0
- package/agent/docs-md/error-messages.md +75 -0
- package/agent/docs-md/error-state.md +123 -0
- package/agent/docs-md/export-menu.md +86 -0
- package/agent/docs-md/feedback-prompt.md +88 -0
- package/agent/docs-md/field-mapping.md +78 -0
- package/agent/docs-md/file-drop.md +110 -0
- package/agent/docs-md/filter-bar.md +138 -0
- package/agent/docs-md/filter-panel.md +103 -0
- package/agent/docs-md/filtering-search.md +79 -0
- package/agent/docs-md/follow-ups-starters.md +79 -0
- package/agent/docs-md/form-validation.md +95 -0
- package/agent/docs-md/generated-columns.md +65 -0
- package/agent/docs-md/generated-drafts-files.md +71 -0
- package/agent/docs-md/grouped-list.md +89 -0
- package/agent/docs-md/guide-cue.md +170 -0
- package/agent/docs-md/help-panel.md +103 -0
- package/agent/docs-md/help-system.md +74 -0
- package/agent/docs-md/iconography.md +49 -0
- package/agent/docs-md/inbox.md +108 -0
- package/agent/docs-md/inline-editing-validation.md +80 -0
- package/agent/docs-md/inline-input-in-answer.md +70 -0
- package/agent/docs-md/items-palette.md +116 -0
- package/agent/docs-md/keyboard-model.md +47 -0
- package/agent/docs-md/keyboard-navigation.md +68 -0
- package/agent/docs-md/keyboard-shortcut-hint.md +87 -0
- package/agent/docs-md/keyboard-shortcut-sheet.md +90 -0
- package/agent/docs-md/labelling-ai-output.md +66 -0
- package/agent/docs-md/layout.md +47 -0
- package/agent/docs-md/list-table.md +254 -0
- package/agent/docs-md/loading-skeleton.md +91 -0
- package/agent/docs-md/managing-agents.md +71 -0
- package/agent/docs-md/message-composer.md +105 -0
- package/agent/docs-md/migrating.md +49 -0
- package/agent/docs-md/motion.md +93 -0
- package/agent/docs-md/navigation.md +76 -0
- package/agent/docs-md/notification-channels.md +65 -0
- package/agent/docs-md/notifications-decision.md +100 -0
- package/agent/docs-md/onboarding-step.md +114 -0
- package/agent/docs-md/order-book.md +108 -0
- package/agent/docs-md/page-header.md +96 -0
- package/agent/docs-md/pagination.md +88 -0
- package/agent/docs-md/pane-layout.md +105 -0
- package/agent/docs-md/period-comparison.md +66 -0
- package/agent/docs-md/plan-card.md +120 -0
- package/agent/docs-md/popover-rules.md +88 -0
- package/agent/docs-md/prompt-editor.md +90 -0
- package/agent/docs-md/propose-apply.md +65 -0
- package/agent/docs-md/provider-logo.md +97 -0
- package/agent/docs-md/radio.md +83 -0
- package/agent/docs-md/ranked-list.md +102 -0
- package/agent/docs-md/reasoning-progress.md +72 -0
- package/agent/docs-md/record-detail.md +71 -0
- package/agent/docs-md/regenerating-answers.md +70 -0
- package/agent/docs-md/run-status-bar.md +94 -0
- package/agent/docs-md/saved-tasks-schedules.md +63 -0
- package/agent/docs-md/saved-views.md +149 -0
- package/agent/docs-md/saving-views.md +68 -0
- package/agent/docs-md/scheduler.md +258 -0
- package/agent/docs-md/secondary-panels.md +72 -0
- package/agent/docs-md/segmented-control.md +88 -0
- package/agent/docs-md/selection-bulk-actions.md +70 -0
- package/agent/docs-md/separator.md +75 -0
- package/agent/docs-md/setup-checklist.md +92 -0
- package/agent/docs-md/shape-elevation.md +55 -0
- package/agent/docs-md/sheet-grid.md +211 -0
- package/agent/docs-md/side-panel.md +134 -0
- package/agent/docs-md/sign-in.md +114 -0
- package/agent/docs-md/spacing.md +55 -0
- package/agent/docs-md/split-button.md +100 -0
- package/agent/docs-md/stat-compare.md +82 -0
- package/agent/docs-md/static-dashboard.md +75 -0
- package/agent/docs-md/status-badge.md +140 -0
- package/agent/docs-md/step-card.md +75 -0
- package/agent/docs-md/stepper.md +92 -0
- package/agent/docs-md/suggested-changes.md +91 -0
- package/agent/docs-md/switch.md +78 -0
- package/agent/docs-md/table-settings.md +81 -0
- package/agent/docs-md/tabs.md +85 -0
- package/agent/docs-md/tag-input.md +108 -0
- package/agent/docs-md/tag.md +79 -0
- package/agent/docs-md/task-builder.md +87 -0
- package/agent/docs-md/team-instructions.md +72 -0
- package/agent/docs-md/templates-gallery.md +85 -0
- package/agent/docs-md/text-input.md +160 -0
- package/agent/docs-md/thinking-steps.md +89 -0
- package/agent/docs-md/timeline.md +189 -0
- package/agent/docs-md/timestamp.md +84 -0
- package/agent/docs-md/timestamps.md +70 -0
- package/agent/docs-md/toast.md +117 -0
- package/agent/docs-md/tooltip.md +90 -0
- package/agent/docs-md/typography.md +62 -0
- package/agent/docs-md/undo-destructive.md +66 -0
- package/agent/docs-md/unsaved-changes.md +71 -0
- package/agent/docs-md/usage-meter.md +80 -0
- package/agent/docs-md/user-feedback.md +71 -0
- package/agent/docs-md/voice-and-tone.md +60 -0
- package/agent/docs-md/why-choice.md +93 -0
- package/agent/docs-md/workspace-onboarding.md +74 -0
- package/agent/docs-md/writing.md +48 -0
- package/agent/llms-full.txt +18369 -0
- package/agent/llms.txt +198 -0
- package/agent/skills/twoux-audit/SKILL.md +49 -0
- package/agent/skills/twoux-build/SKILL.md +39 -0
- package/agent/skills/twoux-design/SKILL.md +54 -0
- package/agent/skills/twoux-write/SKILL.md +32 -0
- package/bin/check.mjs +123 -0
- package/bin/docs.mjs +24 -0
- package/bin/guard.mjs +27 -0
- package/bin/init.mjs +113 -0
- package/bin/knowledge.mjs +87 -0
- package/bin/mcp.mjs +116 -0
- package/bin/theme.mjs +168 -0
- package/bin/twoux.mjs +25 -0
- package/package.json +80 -3
- package/registry/jobs.json +1028 -0
- package/registry/palette.json +770 -0
- package/registry/rules.json +913 -0
- package/src/components/agent-review.tsx +364 -0
- package/src/components/ai-basics.tsx +212 -0
- package/src/components/ai-work.tsx +304 -0
- package/src/components/ai.tsx +227 -0
- package/src/components/alert-dialog.tsx +203 -0
- package/src/components/alert.tsx +86 -0
- package/src/components/avatar.tsx +114 -0
- package/src/components/badge.tsx +59 -0
- package/src/components/board.tsx +397 -0
- package/src/components/breadcrumb.tsx +114 -0
- package/src/components/button-group.tsx +90 -0
- package/src/components/button.tsx +109 -0
- package/src/components/calendar.tsx +247 -0
- package/src/components/card.tsx +102 -0
- package/src/components/chart-map.tsx +336 -0
- package/src/components/charts-more.tsx +1331 -0
- package/src/components/charts-radial.tsx +328 -0
- package/src/components/charts.tsx +390 -0
- package/src/components/checkbox.tsx +40 -0
- package/src/components/code.tsx +139 -0
- package/src/components/collapsible.tsx +37 -0
- package/src/components/combobox.tsx +339 -0
- package/src/components/command-extras.tsx +11 -0
- package/src/components/command.tsx +196 -0
- package/src/components/data-grid.tsx +213 -0
- package/src/components/data-table.tsx +334 -0
- package/src/components/data-views.tsx +740 -0
- package/src/components/date-picker.tsx +686 -0
- package/src/components/dense-table.tsx +207 -0
- package/src/components/dialog.tsx +162 -0
- package/src/components/dropdown-menu.tsx +264 -0
- package/src/components/empty.tsx +114 -0
- package/src/components/feedback-prompt.tsx +80 -0
- package/src/components/field.tsx +254 -0
- package/src/components/fields.tsx +112 -0
- package/src/components/flow.tsx +840 -0
- package/src/components/guide-cue.tsx +273 -0
- package/src/components/inbox.tsx +113 -0
- package/src/components/input-group.tsx +176 -0
- package/src/components/input.tsx +26 -0
- package/src/components/kbd.tsx +34 -0
- package/src/components/label.tsx +27 -0
- package/src/components/labels.tsx +176 -0
- package/src/components/motion.tsx +136 -0
- package/src/components/onboarding.tsx +454 -0
- package/src/components/order-book.tsx +185 -0
- package/src/components/pane-layout.tsx +417 -0
- package/src/components/popover.tsx +96 -0
- package/src/components/provider-logos.data.ts +49 -0
- package/src/components/radio-group.tsx +52 -0
- package/src/components/scheduler.tsx +997 -0
- package/src/components/segmented-control.tsx +28 -0
- package/src/components/select.tsx +195 -0
- package/src/components/separator.tsx +31 -0
- package/src/components/sheet.tsx +148 -0
- package/src/components/shell.tsx +426 -0
- package/src/components/shortcut-sheet.tsx +83 -0
- package/src/components/skeleton.tsx +18 -0
- package/src/components/sonner.tsx +107 -0
- package/src/components/spinner.tsx +13 -0
- package/src/components/split-button.tsx +58 -0
- package/src/components/stepper.tsx +78 -0
- package/src/components/switch.tsx +43 -0
- package/src/components/table.tsx +126 -0
- package/src/components/tabs.tsx +118 -0
- package/src/components/tag-input.tsx +253 -0
- package/src/components/textarea.tsx +21 -0
- package/src/components/theme.tsx +80 -0
- package/src/components/timeline.tsx +408 -0
- package/src/components/toggle-group.tsx +87 -0
- package/src/components/toggle.tsx +54 -0
- package/src/components/tooltip.tsx +65 -0
- package/src/components/workspace-actions.tsx +294 -0
- package/src/components/workspace-import.tsx +465 -0
- package/src/components/workspace.tsx +1884 -0
- package/src/index.ts +80 -0
- package/src/lib/active-indicator.tsx +53 -0
- package/src/lib/chart-kit.tsx +72 -0
- package/src/lib/cn.ts +6 -0
- package/src/lib/shortcuts.tsx +61 -0
- package/src/lib/workspace.tsx +10 -0
- package/src/shadcn/alert-dialog.tsx +196 -0
- package/src/shadcn/alert.tsx +65 -0
- package/src/shadcn/avatar.tsx +108 -0
- package/src/shadcn/badge.tsx +47 -0
- package/src/shadcn/breadcrumb.tsx +108 -0
- package/src/shadcn/button-group.tsx +83 -0
- package/src/shadcn/button.tsx +63 -0
- package/src/shadcn/calendar.tsx +220 -0
- package/src/shadcn/card.tsx +91 -0
- package/src/shadcn/checkbox.tsx +31 -0
- package/src/shadcn/collapsible.tsx +33 -0
- package/src/shadcn/command.tsx +184 -0
- package/src/shadcn/dialog.tsx +158 -0
- package/src/shadcn/dropdown-menu.tsx +256 -0
- package/src/shadcn/empty.tsx +103 -0
- package/src/shadcn/field.tsx +248 -0
- package/src/shadcn/input-group.tsx +170 -0
- package/src/shadcn/input.tsx +20 -0
- package/src/shadcn/kbd.tsx +28 -0
- package/src/shadcn/label.tsx +23 -0
- package/src/shadcn/popover.tsx +88 -0
- package/src/shadcn/radio-group.tsx +44 -0
- package/src/shadcn/select.tsx +189 -0
- package/src/shadcn/separator.tsx +27 -0
- package/src/shadcn/sheet.tsx +142 -0
- package/src/shadcn/skeleton.tsx +13 -0
- package/src/shadcn/sonner.tsx +40 -0
- package/src/shadcn/switch.tsx +34 -0
- package/src/shadcn/table.tsx +115 -0
- package/src/shadcn/tabs.tsx +90 -0
- package/src/shadcn/textarea.tsx +17 -0
- package/src/shadcn/toggle-group.tsx +83 -0
- package/src/shadcn/toggle.tsx +46 -0
- package/src/shadcn/tooltip.tsx +56 -0
- package/src/styles/palette.css +127 -0
- package/src/styles/theme.css +35 -0
- package/src/styles/twoux.css +236 -0
- package/theme.json +14 -0
- package/README.md +0 -3
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** TwoUX composition on shadcn ToggleGroup (type="single"): 2–3 views of the same data, one always selected. */
|
|
2
|
+
import type * as React from "react"
|
|
3
|
+
import { ActiveIndicator } from "../lib/active-indicator"
|
|
4
|
+
import { cn } from "../lib/cn"
|
|
5
|
+
import { ToggleGroup, ToggleGroupItem } from "./toggle-group"
|
|
6
|
+
|
|
7
|
+
export function SegmentedControl({ value, onValueChange, size = "md", className, children, "aria-label": label }: { value: string; onValueChange: (v: string) => void; size?: "sm" | "md"; className?: string; children: React.ReactNode; "aria-label": string }) {
|
|
8
|
+
return (
|
|
9
|
+
<ToggleGroup type="single" spacing={0.5} value={value} onValueChange={(v) => v && onValueChange(v)} aria-label={label} data-segsize={size} className={cn("group/seg relative rounded-sm bg-muted p-0.5", className)}>
|
|
10
|
+
{/* One pill slides to the chosen segment instead of jumping */}
|
|
11
|
+
<ActiveIndicator selector="[data-state=on]" className="rounded-xs bg-background shadow-card" />
|
|
12
|
+
{children}
|
|
13
|
+
</ToggleGroup>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function Segment({ className, ...props }: React.ComponentProps<typeof ToggleGroupItem>) {
|
|
18
|
+
return (
|
|
19
|
+
<ToggleGroupItem
|
|
20
|
+
className={cn(
|
|
21
|
+
"relative h-6 min-w-0 rounded-xs px-2 text-sm text-ink-2 transition-colors duration-(--duration-fast) ease-(--ease-out) hover:bg-transparent hover:text-ink data-[state=on]:bg-transparent data-[state=on]:text-ink data-[state=on]:hover:bg-transparent data-[state=on]:hover:text-ink [&_svg:not([class*='size-'])]:size-3.5",
|
|
22
|
+
"group-data-[segsize=sm]/seg:h-5 group-data-[segsize=sm]/seg:text-xs group-data-[segsize=sm]/seg:after:absolute group-data-[segsize=sm]/seg:after:inset-x-0 group-data-[segsize=sm]/seg:after:-inset-y-0.5",
|
|
23
|
+
className,
|
|
24
|
+
)}
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated from shadcn/ui new-york-v4 "select" by scripts/tailor-shadcn.mjs. Do not edit by hand.
|
|
3
|
+
* TwoUX changes:
|
|
4
|
+
* - Compact heights (32px, 28px small), field edge with hover, white fill, 14px chevron
|
|
5
|
+
* - The list floats: 8px corners, light edge, floating shadow
|
|
6
|
+
*/
|
|
7
|
+
"use client"
|
|
8
|
+
|
|
9
|
+
import * as React from "react"
|
|
10
|
+
import { cn } from "../lib/cn"
|
|
11
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
|
|
12
|
+
import { Select as SelectPrimitive } from "radix-ui"
|
|
13
|
+
|
|
14
|
+
function Select({
|
|
15
|
+
...props
|
|
16
|
+
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
17
|
+
return <SelectPrimitive.Root data-slot="select" {...props} />
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function SelectGroup({
|
|
21
|
+
...props
|
|
22
|
+
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
23
|
+
return <SelectPrimitive.Group data-slot="select-group" {...props} />
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function SelectValue({
|
|
27
|
+
...props
|
|
28
|
+
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
29
|
+
return <SelectPrimitive.Value data-slot="select-value" {...props} />
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function SelectTrigger({
|
|
33
|
+
className,
|
|
34
|
+
size = "default",
|
|
35
|
+
children,
|
|
36
|
+
...props
|
|
37
|
+
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
38
|
+
size?: "sm" | "default"
|
|
39
|
+
}) {
|
|
40
|
+
return (
|
|
41
|
+
<SelectPrimitive.Trigger
|
|
42
|
+
data-slot="select-trigger"
|
|
43
|
+
data-size={size}
|
|
44
|
+
className={cn(
|
|
45
|
+
"flex w-fit items-center justify-between gap-2 rounded-sm border border-input bg-background px-2.5 py-1.5 hover:border-input-hover text-base whitespace-nowrap shadow-xs transition-[color,background-color,border-color,box-shadow] duration-(--duration-fast) ease-(--ease-out) outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:not-focus-visible:border-destructive-edge data-[placeholder]:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
46
|
+
className
|
|
47
|
+
)}
|
|
48
|
+
{...props}
|
|
49
|
+
>
|
|
50
|
+
{children}
|
|
51
|
+
<SelectPrimitive.Icon asChild>
|
|
52
|
+
<ChevronDownIcon className="size-4 opacity-50" />
|
|
53
|
+
</SelectPrimitive.Icon>
|
|
54
|
+
</SelectPrimitive.Trigger>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function SelectContent({
|
|
59
|
+
className,
|
|
60
|
+
children,
|
|
61
|
+
position = "item-aligned",
|
|
62
|
+
align = "center",
|
|
63
|
+
...props
|
|
64
|
+
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
65
|
+
return (
|
|
66
|
+
<SelectPrimitive.Portal>
|
|
67
|
+
<SelectPrimitive.Content
|
|
68
|
+
data-slot="select-content"
|
|
69
|
+
className={cn(
|
|
70
|
+
"relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-line bg-popover text-popover-foreground shadow-pop data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
71
|
+
position === "popper" &&
|
|
72
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
73
|
+
className
|
|
74
|
+
)}
|
|
75
|
+
position={position}
|
|
76
|
+
align={align}
|
|
77
|
+
{...props}
|
|
78
|
+
>
|
|
79
|
+
<SelectScrollUpButton />
|
|
80
|
+
<SelectPrimitive.Viewport
|
|
81
|
+
className={cn(
|
|
82
|
+
"p-1",
|
|
83
|
+
position === "popper" &&
|
|
84
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
85
|
+
)}
|
|
86
|
+
>
|
|
87
|
+
{children}
|
|
88
|
+
</SelectPrimitive.Viewport>
|
|
89
|
+
<SelectScrollDownButton />
|
|
90
|
+
</SelectPrimitive.Content>
|
|
91
|
+
</SelectPrimitive.Portal>
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function SelectLabel({
|
|
96
|
+
className,
|
|
97
|
+
...props
|
|
98
|
+
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
99
|
+
return (
|
|
100
|
+
<SelectPrimitive.Label
|
|
101
|
+
data-slot="select-label"
|
|
102
|
+
className={cn("px-2 py-1.5 text-sm text-muted-foreground", className)}
|
|
103
|
+
{...props}
|
|
104
|
+
/>
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function SelectItem({
|
|
109
|
+
className,
|
|
110
|
+
children,
|
|
111
|
+
...props
|
|
112
|
+
}: React.ComponentProps<typeof SelectPrimitive.Item>) {
|
|
113
|
+
return (
|
|
114
|
+
<SelectPrimitive.Item
|
|
115
|
+
data-slot="select-item"
|
|
116
|
+
className={cn(
|
|
117
|
+
"relative flex w-full cursor-default items-center gap-2 rounded-xs py-1.5 pr-8 pl-2 text-base outline-hidden select-none transition-colors duration-(--duration-fast) ease-(--ease-out) focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
118
|
+
className
|
|
119
|
+
)}
|
|
120
|
+
{...props}
|
|
121
|
+
>
|
|
122
|
+
<span
|
|
123
|
+
data-slot="select-item-indicator"
|
|
124
|
+
className="absolute right-2 flex size-3.5 items-center justify-center"
|
|
125
|
+
>
|
|
126
|
+
<SelectPrimitive.ItemIndicator>
|
|
127
|
+
<CheckIcon className="size-4" />
|
|
128
|
+
</SelectPrimitive.ItemIndicator>
|
|
129
|
+
</span>
|
|
130
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
131
|
+
</SelectPrimitive.Item>
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function SelectSeparator({
|
|
136
|
+
className,
|
|
137
|
+
...props
|
|
138
|
+
}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
|
|
139
|
+
return (
|
|
140
|
+
<SelectPrimitive.Separator
|
|
141
|
+
data-slot="select-separator"
|
|
142
|
+
className={cn("pointer-events-none -mx-1 my-1 h-px bg-border", className)}
|
|
143
|
+
{...props}
|
|
144
|
+
/>
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function SelectScrollUpButton({
|
|
149
|
+
className,
|
|
150
|
+
...props
|
|
151
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
|
|
152
|
+
return (
|
|
153
|
+
<SelectPrimitive.ScrollUpButton
|
|
154
|
+
data-slot="select-scroll-up-button"
|
|
155
|
+
className={cn(
|
|
156
|
+
"flex cursor-default items-center justify-center py-1",
|
|
157
|
+
className
|
|
158
|
+
)}
|
|
159
|
+
{...props}
|
|
160
|
+
>
|
|
161
|
+
<ChevronUpIcon className="size-4" />
|
|
162
|
+
</SelectPrimitive.ScrollUpButton>
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function SelectScrollDownButton({
|
|
167
|
+
className,
|
|
168
|
+
...props
|
|
169
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
170
|
+
return (
|
|
171
|
+
<SelectPrimitive.ScrollDownButton
|
|
172
|
+
data-slot="select-scroll-down-button"
|
|
173
|
+
className={cn(
|
|
174
|
+
"flex cursor-default items-center justify-center py-1",
|
|
175
|
+
className
|
|
176
|
+
)}
|
|
177
|
+
{...props}
|
|
178
|
+
>
|
|
179
|
+
<ChevronDownIcon className="size-4" />
|
|
180
|
+
</SelectPrimitive.ScrollDownButton>
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export {
|
|
185
|
+
Select,
|
|
186
|
+
SelectContent,
|
|
187
|
+
SelectGroup,
|
|
188
|
+
SelectItem,
|
|
189
|
+
SelectLabel,
|
|
190
|
+
SelectScrollDownButton,
|
|
191
|
+
SelectScrollUpButton,
|
|
192
|
+
SelectSeparator,
|
|
193
|
+
SelectTrigger,
|
|
194
|
+
SelectValue,
|
|
195
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated from shadcn/ui new-york-v4 "separator" by scripts/tailor-shadcn.mjs. Do not edit by hand.
|
|
3
|
+
* TwoUX changes: shared changes only (imports, role tokens for light and dark, type scale).
|
|
4
|
+
*/
|
|
5
|
+
"use client"
|
|
6
|
+
|
|
7
|
+
import * as React from "react"
|
|
8
|
+
import { cn } from "../lib/cn"
|
|
9
|
+
import { Separator as SeparatorPrimitive } from "radix-ui"
|
|
10
|
+
|
|
11
|
+
function Separator({
|
|
12
|
+
className,
|
|
13
|
+
orientation = "horizontal",
|
|
14
|
+
decorative = true,
|
|
15
|
+
...props
|
|
16
|
+
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
|
|
17
|
+
return (
|
|
18
|
+
<SeparatorPrimitive.Root
|
|
19
|
+
data-slot="separator"
|
|
20
|
+
decorative={decorative}
|
|
21
|
+
orientation={orientation}
|
|
22
|
+
className={cn(
|
|
23
|
+
"shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
24
|
+
className
|
|
25
|
+
)}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { Separator }
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated from shadcn/ui new-york-v4 "sheet" by scripts/tailor-shadcn.mjs. Do not edit by hand.
|
|
3
|
+
* TwoUX changes:
|
|
4
|
+
* - Panels are 440px on the right (full width on phones), slide with TwoUX's motion, and float with the overlay shadow
|
|
5
|
+
* - Motion from shadcn's Base UI sheet: a 40px slide with a fade, 200ms ease-in-out both ways (the full-width 500ms slide felt heavy)
|
|
6
|
+
*/
|
|
7
|
+
"use client"
|
|
8
|
+
|
|
9
|
+
import * as React from "react"
|
|
10
|
+
import { cn } from "../lib/cn"
|
|
11
|
+
import { XIcon } from "lucide-react"
|
|
12
|
+
import { Dialog as SheetPrimitive } from "radix-ui"
|
|
13
|
+
|
|
14
|
+
function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
15
|
+
return <SheetPrimitive.Root data-slot="sheet" {...props} />
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function SheetTrigger({
|
|
19
|
+
...props
|
|
20
|
+
}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
21
|
+
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function SheetClose({
|
|
25
|
+
...props
|
|
26
|
+
}: React.ComponentProps<typeof SheetPrimitive.Close>) {
|
|
27
|
+
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function SheetPortal({
|
|
31
|
+
...props
|
|
32
|
+
}: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
33
|
+
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function SheetOverlay({
|
|
37
|
+
className,
|
|
38
|
+
...props
|
|
39
|
+
}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
|
|
40
|
+
return (
|
|
41
|
+
<SheetPrimitive.Overlay
|
|
42
|
+
data-slot="sheet-overlay"
|
|
43
|
+
className={cn(
|
|
44
|
+
"fixed inset-0 z-50 bg-scrim data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
45
|
+
className
|
|
46
|
+
)}
|
|
47
|
+
{...props}
|
|
48
|
+
/>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function SheetContent({
|
|
53
|
+
className,
|
|
54
|
+
children,
|
|
55
|
+
side = "right",
|
|
56
|
+
showCloseButton = true,
|
|
57
|
+
...props
|
|
58
|
+
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
59
|
+
side?: "top" | "right" | "bottom" | "left"
|
|
60
|
+
showCloseButton?: boolean
|
|
61
|
+
}) {
|
|
62
|
+
return (
|
|
63
|
+
<SheetPortal>
|
|
64
|
+
<SheetOverlay />
|
|
65
|
+
<SheetPrimitive.Content
|
|
66
|
+
data-slot="sheet-content"
|
|
67
|
+
className={cn(
|
|
68
|
+
"fixed z-50 flex flex-col gap-0 bg-background shadow-pop transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-200 data-[state=open]:animate-in data-[state=open]:duration-200",
|
|
69
|
+
side === "right" &&
|
|
70
|
+
"inset-y-0 right-0 h-full w-full border-l border-line data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-right-10 data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-right-10 sm:max-w-110",
|
|
71
|
+
side === "left" &&
|
|
72
|
+
"inset-y-0 left-0 h-full w-3/4 border-r border-line data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-left-10 data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-left-10 sm:max-w-64",
|
|
73
|
+
side === "top" &&
|
|
74
|
+
"inset-x-0 top-0 h-auto border-b data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-10 data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-top-10",
|
|
75
|
+
side === "bottom" &&
|
|
76
|
+
"inset-x-0 bottom-0 h-auto border-t data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-bottom-10 data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-bottom-10",
|
|
77
|
+
className
|
|
78
|
+
)}
|
|
79
|
+
{...props}
|
|
80
|
+
>
|
|
81
|
+
{children}
|
|
82
|
+
{showCloseButton && (
|
|
83
|
+
<SheetPrimitive.Close className="absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary">
|
|
84
|
+
<XIcon className="size-4" />
|
|
85
|
+
<span className="sr-only">Close</span>
|
|
86
|
+
</SheetPrimitive.Close>
|
|
87
|
+
)}
|
|
88
|
+
</SheetPrimitive.Content>
|
|
89
|
+
</SheetPortal>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
94
|
+
return (
|
|
95
|
+
<div
|
|
96
|
+
data-slot="sheet-header"
|
|
97
|
+
className={cn("flex flex-col gap-1.5 p-4", className)}
|
|
98
|
+
{...props}
|
|
99
|
+
/>
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
104
|
+
return (
|
|
105
|
+
<div
|
|
106
|
+
data-slot="sheet-footer"
|
|
107
|
+
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
108
|
+
{...props}
|
|
109
|
+
/>
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function SheetTitle({
|
|
114
|
+
className,
|
|
115
|
+
...props
|
|
116
|
+
}: React.ComponentProps<typeof SheetPrimitive.Title>) {
|
|
117
|
+
return (
|
|
118
|
+
<SheetPrimitive.Title
|
|
119
|
+
data-slot="sheet-title"
|
|
120
|
+
className={cn("text-md font-semibold text-foreground", className)}
|
|
121
|
+
{...props}
|
|
122
|
+
/>
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function SheetDescription({
|
|
127
|
+
className,
|
|
128
|
+
...props
|
|
129
|
+
}: React.ComponentProps<typeof SheetPrimitive.Description>) {
|
|
130
|
+
return (
|
|
131
|
+
<SheetPrimitive.Description
|
|
132
|
+
data-slot="sheet-description"
|
|
133
|
+
className={cn("text-base text-ink-2", className)}
|
|
134
|
+
{...props}
|
|
135
|
+
/>
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export {
|
|
140
|
+
Sheet,
|
|
141
|
+
SheetTrigger,
|
|
142
|
+
SheetClose,
|
|
143
|
+
SheetContent,
|
|
144
|
+
SheetHeader,
|
|
145
|
+
SheetFooter,
|
|
146
|
+
SheetTitle,
|
|
147
|
+
SheetDescription,
|
|
148
|
+
}
|