@uisatin/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 +21 -0
- package/README.md +67 -2
- package/chunk-2HKBZFIK.js +339 -0
- package/chunk-2HKBZFIK.js.map +1 -0
- package/chunk-2YEWSJD7.js +95 -0
- package/chunk-2YEWSJD7.js.map +1 -0
- package/chunk-3DINAQLL.js +153 -0
- package/chunk-3DINAQLL.js.map +1 -0
- package/chunk-3ERGAHKA.js +179 -0
- package/chunk-3ERGAHKA.js.map +1 -0
- package/chunk-6C7CGJX2.js +86 -0
- package/chunk-6C7CGJX2.js.map +1 -0
- package/chunk-6YXUBP27.js +474 -0
- package/chunk-6YXUBP27.js.map +1 -0
- package/chunk-72OCFAPT.js +175 -0
- package/chunk-72OCFAPT.js.map +1 -0
- package/chunk-7TXHCRAG.js +51 -0
- package/chunk-7TXHCRAG.js.map +1 -0
- package/chunk-A5XEM3GF.js +260 -0
- package/chunk-A5XEM3GF.js.map +1 -0
- package/chunk-AN2RNJLR.js +79 -0
- package/chunk-AN2RNJLR.js.map +1 -0
- package/chunk-B2K45IUR.js +36 -0
- package/chunk-B2K45IUR.js.map +1 -0
- package/chunk-B6V4VSGH.js +82 -0
- package/chunk-B6V4VSGH.js.map +1 -0
- package/chunk-BKZBWPUH.js +59 -0
- package/chunk-BKZBWPUH.js.map +1 -0
- package/chunk-BNTPPZCK.js +220 -0
- package/chunk-BNTPPZCK.js.map +1 -0
- package/chunk-BNZVTLHV.js +98 -0
- package/chunk-BNZVTLHV.js.map +1 -0
- package/chunk-CL2II6BX.js +89 -0
- package/chunk-CL2II6BX.js.map +1 -0
- package/chunk-DETGJAIC.js +147 -0
- package/chunk-DETGJAIC.js.map +1 -0
- package/chunk-DO3TBNSC.js +130 -0
- package/chunk-DO3TBNSC.js.map +1 -0
- package/chunk-ESC5JCVQ.js +90 -0
- package/chunk-ESC5JCVQ.js.map +1 -0
- package/chunk-FDKIX4DC.js +55 -0
- package/chunk-FDKIX4DC.js.map +1 -0
- package/chunk-GICKPMJU.js +239 -0
- package/chunk-GICKPMJU.js.map +1 -0
- package/chunk-GQA24FYG.js +57 -0
- package/chunk-GQA24FYG.js.map +1 -0
- package/chunk-H4NU7NPO.js +264 -0
- package/chunk-H4NU7NPO.js.map +1 -0
- package/chunk-H63FYCMY.js +11 -0
- package/chunk-H63FYCMY.js.map +1 -0
- package/chunk-HL42K2NH.js +76 -0
- package/chunk-HL42K2NH.js.map +1 -0
- package/chunk-HNQUX43Z.js +109 -0
- package/chunk-HNQUX43Z.js.map +1 -0
- package/chunk-HRKPV66B.js +32 -0
- package/chunk-HRKPV66B.js.map +1 -0
- package/chunk-J3NSDRVH.js +83 -0
- package/chunk-J3NSDRVH.js.map +1 -0
- package/chunk-JPNWHWAQ.js +151 -0
- package/chunk-JPNWHWAQ.js.map +1 -0
- package/chunk-KNUWZNFV.js +240 -0
- package/chunk-KNUWZNFV.js.map +1 -0
- package/chunk-L6NCCSIP.js +213 -0
- package/chunk-L6NCCSIP.js.map +1 -0
- package/chunk-LLHTVIM3.js +50 -0
- package/chunk-LLHTVIM3.js.map +1 -0
- package/chunk-LW3TRU5W.js +131 -0
- package/chunk-LW3TRU5W.js.map +1 -0
- package/chunk-LZMKSFCF.js +79 -0
- package/chunk-LZMKSFCF.js.map +1 -0
- package/chunk-MR3JDI7E.js +122 -0
- package/chunk-MR3JDI7E.js.map +1 -0
- package/chunk-NN6PKJWS.js +44 -0
- package/chunk-NN6PKJWS.js.map +1 -0
- package/chunk-NSRTTYQ4.js +252 -0
- package/chunk-NSRTTYQ4.js.map +1 -0
- package/chunk-O7F3CIDV.js +45 -0
- package/chunk-O7F3CIDV.js.map +1 -0
- package/chunk-P4O6TGDR.js +166 -0
- package/chunk-P4O6TGDR.js.map +1 -0
- package/chunk-PF3YBUKT.js +81 -0
- package/chunk-PF3YBUKT.js.map +1 -0
- package/chunk-PVOLDO4G.js +47 -0
- package/chunk-PVOLDO4G.js.map +1 -0
- package/chunk-QS4N4MNP.js +215 -0
- package/chunk-QS4N4MNP.js.map +1 -0
- package/chunk-QUF2IPOZ.js +98 -0
- package/chunk-QUF2IPOZ.js.map +1 -0
- package/chunk-RTJ76X5U.js +126 -0
- package/chunk-RTJ76X5U.js.map +1 -0
- package/chunk-SH6NG6VN.js +40 -0
- package/chunk-SH6NG6VN.js.map +1 -0
- package/chunk-SHDFUXYV.js +195 -0
- package/chunk-SHDFUXYV.js.map +1 -0
- package/chunk-TKO44NDI.js +84 -0
- package/chunk-TKO44NDI.js.map +1 -0
- package/chunk-TOMSU4S4.js +149 -0
- package/chunk-TOMSU4S4.js.map +1 -0
- package/chunk-TVLGZGYN.js +59 -0
- package/chunk-TVLGZGYN.js.map +1 -0
- package/chunk-TX3H3QMA.js +520 -0
- package/chunk-TX3H3QMA.js.map +1 -0
- package/chunk-UBNHSZSE.js +88 -0
- package/chunk-UBNHSZSE.js.map +1 -0
- package/chunk-UC3ZJWOD.js +73 -0
- package/chunk-UC3ZJWOD.js.map +1 -0
- package/chunk-UGRSWP6U.js +69 -0
- package/chunk-UGRSWP6U.js.map +1 -0
- package/chunk-VAGIAREV.js +214 -0
- package/chunk-VAGIAREV.js.map +1 -0
- package/chunk-WTMZT3IT.js +105 -0
- package/chunk-WTMZT3IT.js.map +1 -0
- package/chunk-WX6BP5ZP.js +39 -0
- package/chunk-WX6BP5ZP.js.map +1 -0
- package/chunk-X3PQANZO.js +255 -0
- package/chunk-X3PQANZO.js.map +1 -0
- package/chunk-XILQ7GXE.js +66 -0
- package/chunk-XILQ7GXE.js.map +1 -0
- package/chunk-XL75JRUA.js +130 -0
- package/chunk-XL75JRUA.js.map +1 -0
- package/chunk-XZNHT6MO.js +348 -0
- package/chunk-XZNHT6MO.js.map +1 -0
- package/chunk-Y5AYU7PK.js +44 -0
- package/chunk-Y5AYU7PK.js.map +1 -0
- package/chunk-YG7JOOLJ.js +28 -0
- package/chunk-YG7JOOLJ.js.map +1 -0
- package/chunk-YPJYW624.js +195 -0
- package/chunk-YPJYW624.js.map +1 -0
- package/chunk-YPNKBE5X.js +104 -0
- package/chunk-YPNKBE5X.js.map +1 -0
- package/components/accordion.d.ts +27 -0
- package/components/accordion.js +4 -0
- package/components/accordion.js.map +1 -0
- package/components/agent-loading.d.ts +65 -0
- package/components/agent-loading.js +4 -0
- package/components/agent-loading.js.map +1 -0
- package/components/agent-picker.d.ts +82 -0
- package/components/agent-picker.js +5 -0
- package/components/agent-picker.js.map +1 -0
- package/components/agent-suggestion.d.ts +69 -0
- package/components/agent-suggestion.js +6 -0
- package/components/agent-suggestion.js.map +1 -0
- package/components/announcement-bar.d.ts +39 -0
- package/components/announcement-bar.js +6 -0
- package/components/announcement-bar.js.map +1 -0
- package/components/attachment.d.ts +73 -0
- package/components/attachment.js +5 -0
- package/components/attachment.js.map +1 -0
- package/components/avatar.d.ts +34 -0
- package/components/avatar.js +6 -0
- package/components/avatar.js.map +1 -0
- package/components/badge.d.ts +19 -0
- package/components/badge.js +4 -0
- package/components/badge.js.map +1 -0
- package/components/banner.d.ts +54 -0
- package/components/banner.js +5 -0
- package/components/banner.js.map +1 -0
- package/components/bar-chart.d.ts +32 -0
- package/components/bar-chart.js +11 -0
- package/components/bar-chart.js.map +1 -0
- package/components/breadcrumb.d.ts +32 -0
- package/components/breadcrumb.js +6 -0
- package/components/breadcrumb.js.map +1 -0
- package/components/button.d.ts +32 -0
- package/components/button.js +4 -0
- package/components/button.js.map +1 -0
- package/components/card.d.ts +28 -0
- package/components/card.js +5 -0
- package/components/card.js.map +1 -0
- package/components/channel-chart.d.ts +14 -0
- package/components/channel-chart.js +11 -0
- package/components/channel-chart.js.map +1 -0
- package/components/chart.d.ts +88 -0
- package/components/chart.js +10 -0
- package/components/chart.js.map +1 -0
- package/components/checkbox.d.ts +17 -0
- package/components/checkbox.js +4 -0
- package/components/checkbox.js.map +1 -0
- package/components/chip.d.ts +54 -0
- package/components/chip.js +4 -0
- package/components/chip.js.map +1 -0
- package/components/citations.d.ts +37 -0
- package/components/citations.js +5 -0
- package/components/citations.js.map +1 -0
- package/components/code-block.d.ts +13 -0
- package/components/code-block.js +5 -0
- package/components/code-block.js.map +1 -0
- package/components/combobox.d.ts +58 -0
- package/components/combobox.js +10 -0
- package/components/combobox.js.map +1 -0
- package/components/command-menu.d.ts +54 -0
- package/components/command-menu.js +6 -0
- package/components/command-menu.js.map +1 -0
- package/components/context-menu.d.ts +46 -0
- package/components/context-menu.js +6 -0
- package/components/context-menu.js.map +1 -0
- package/components/cookie-consent.d.ts +26 -0
- package/components/cookie-consent.js +5 -0
- package/components/cookie-consent.js.map +1 -0
- package/components/date-picker.d.ts +112 -0
- package/components/date-picker.js +9 -0
- package/components/date-picker.js.map +1 -0
- package/components/decision-card.d.ts +65 -0
- package/components/decision-card.js +7 -0
- package/components/decision-card.js.map +1 -0
- package/components/dialog.d.ts +68 -0
- package/components/dialog.js +5 -0
- package/components/dialog.js.map +1 -0
- package/components/donut-chart.d.ts +20 -0
- package/components/donut-chart.js +11 -0
- package/components/donut-chart.js.map +1 -0
- package/components/dot.d.ts +21 -0
- package/components/dot.js +4 -0
- package/components/dot.js.map +1 -0
- package/components/dropdown.d.ts +74 -0
- package/components/dropdown.js +5 -0
- package/components/dropdown.js.map +1 -0
- package/components/empty-state.d.ts +25 -0
- package/components/empty-state.js +4 -0
- package/components/empty-state.js.map +1 -0
- package/components/file-upload.d.ts +78 -0
- package/components/file-upload.js +7 -0
- package/components/file-upload.js.map +1 -0
- package/components/floating.d.ts +30 -0
- package/components/floating.js +3 -0
- package/components/floating.js.map +1 -0
- package/components/form-field.d.ts +35 -0
- package/components/form-field.js +4 -0
- package/components/form-field.js.map +1 -0
- package/components/hover-card.d.ts +30 -0
- package/components/hover-card.js +4 -0
- package/components/hover-card.js.map +1 -0
- package/components/input-otp.d.ts +49 -0
- package/components/input-otp.js +8 -0
- package/components/input-otp.js.map +1 -0
- package/components/input.d.ts +28 -0
- package/components/input.js +5 -0
- package/components/input.js.map +1 -0
- package/components/kbd.d.ts +37 -0
- package/components/kbd.js +4 -0
- package/components/kbd.js.map +1 -0
- package/components/line-chart.d.ts +29 -0
- package/components/line-chart.js +12 -0
- package/components/line-chart.js.map +1 -0
- package/components/message-actions.d.ts +24 -0
- package/components/message-actions.js +5 -0
- package/components/message-actions.js.map +1 -0
- package/components/message.d.ts +40 -0
- package/components/message.js +8 -0
- package/components/message.js.map +1 -0
- package/components/number-input.d.ts +33 -0
- package/components/number-input.js +8 -0
- package/components/number-input.js.map +1 -0
- package/components/pagination.d.ts +45 -0
- package/components/pagination.js +6 -0
- package/components/pagination.js.map +1 -0
- package/components/popover.d.ts +44 -0
- package/components/popover.js +4 -0
- package/components/popover.js.map +1 -0
- package/components/progress.d.ts +24 -0
- package/components/progress.js +4 -0
- package/components/progress.js.map +1 -0
- package/components/prompt-bar.d.ts +63 -0
- package/components/prompt-bar.js +6 -0
- package/components/prompt-bar.js.map +1 -0
- package/components/radio.d.ts +27 -0
- package/components/radio.js +4 -0
- package/components/radio.js.map +1 -0
- package/components/search-bar.d.ts +20 -0
- package/components/search-bar.js +5 -0
- package/components/search-bar.js.map +1 -0
- package/components/segmented-control.d.ts +32 -0
- package/components/segmented-control.js +5 -0
- package/components/segmented-control.js.map +1 -0
- package/components/select.d.ts +97 -0
- package/components/select.js +7 -0
- package/components/select.js.map +1 -0
- package/components/sheet.d.ts +37 -0
- package/components/sheet.js +6 -0
- package/components/sheet.js.map +1 -0
- package/components/sidebar.d.ts +52 -0
- package/components/sidebar.js +4 -0
- package/components/sidebar.js.map +1 -0
- package/components/skeleton.d.ts +18 -0
- package/components/skeleton.js +4 -0
- package/components/skeleton.js.map +1 -0
- package/components/slider.d.ts +57 -0
- package/components/slider.js +8 -0
- package/components/slider.js.map +1 -0
- package/components/sliding-indicator.d.ts +23 -0
- package/components/sliding-indicator.js +3 -0
- package/components/sliding-indicator.js.map +1 -0
- package/components/streaming-text.d.ts +33 -0
- package/components/streaming-text.js +4 -0
- package/components/streaming-text.js.map +1 -0
- package/components/switch.d.ts +15 -0
- package/components/switch.js +4 -0
- package/components/switch.js.map +1 -0
- package/components/table.d.ts +57 -0
- package/components/table.js +5 -0
- package/components/table.js.map +1 -0
- package/components/tabs.d.ts +45 -0
- package/components/tabs.js +5 -0
- package/components/tabs.js.map +1 -0
- package/components/textarea.d.ts +30 -0
- package/components/textarea.js +5 -0
- package/components/textarea.js.map +1 -0
- package/components/thinking.d.ts +64 -0
- package/components/thinking.js +5 -0
- package/components/thinking.js.map +1 -0
- package/components/toast.d.ts +71 -0
- package/components/toast.js +5 -0
- package/components/toast.js.map +1 -0
- package/components/toggle.d.ts +30 -0
- package/components/toggle.js +4 -0
- package/components/toggle.js.map +1 -0
- package/components/tooltip.d.ts +35 -0
- package/components/tooltip.js +5 -0
- package/components/tooltip.js.map +1 -0
- package/index.d.ts +64 -0
- package/index.js +230 -0
- package/index.js.map +1 -0
- package/lib/utils.d.ts +3 -0
- package/lib/utils.js +3 -0
- package/lib/utils.js.map +1 -0
- package/package.json +54 -4
- package/styles.css +2 -0
- package/theme/create-theme.d.ts +44 -0
- package/theme/index.d.ts +1 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import type { BadgeTone } from './badge';
|
|
4
|
+
/**
|
|
5
|
+
* Chip, 1:1 with the uiKit `Chip` set (3206:79959): Subtle or Outline, md (28, control-height)
|
|
6
|
+
* or sm (24, control-height-xs), eight tones like Badge, an optional dot, avatar and remove
|
|
7
|
+
* button. Label medium 13/19.5, 8px side padding; the dot, avatar and close slots overlap
|
|
8
|
+
* the label padding by 4px, as in Figma.
|
|
9
|
+
*
|
|
10
|
+
* Neutral is its own look: Outline is a popover surface with a border-default edge and an
|
|
11
|
+
* xs drop shadow, Subtle is the secondary action fill. Every other tone uses the `tone/*`
|
|
12
|
+
* tokens (repointed by `data-tone`): tone-bg fill, tone-border edge, tone-fg text; hover and
|
|
13
|
+
* pressed fill with tone-border.
|
|
14
|
+
*
|
|
15
|
+
* States (satin-hover / satin-focus / satin-pressed, or `data-force`):
|
|
16
|
+
* - hover: neutral outline bg-hover + border-strong; neutral subtle border-input fill.
|
|
17
|
+
* - pressed: neutral border-input fill with a border-strong edge, no drop shadow.
|
|
18
|
+
* - focus: the 2px action/focus-ring spread, border-strong edge, no drop shadow.
|
|
19
|
+
* - disabled: 50% opacity, no drop shadow.
|
|
20
|
+
* Subtle pressed's 1px edge is an inset shadow so the chip doesn't grow by 2px.
|
|
21
|
+
*
|
|
22
|
+
* With `onRemove` the chip is a `span` holding a real remove button (a button can't hold
|
|
23
|
+
* a button); without it, the chip itself is the button.
|
|
24
|
+
*/
|
|
25
|
+
declare const chipVariants: (props?: ({
|
|
26
|
+
variant?: "outline" | "subtle" | null | undefined;
|
|
27
|
+
size?: "md" | "sm" | null | undefined;
|
|
28
|
+
neutral?: boolean | null | undefined;
|
|
29
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
30
|
+
type ChipBaseProps = Omit<VariantProps<typeof chipVariants>, 'neutral'> & {
|
|
31
|
+
tone?: BadgeTone;
|
|
32
|
+
/** A status dot before the label. */
|
|
33
|
+
dot?: boolean;
|
|
34
|
+
/** A 16px avatar before the label (an initials avatar or an image). */
|
|
35
|
+
avatar?: React.ReactNode;
|
|
36
|
+
/** Shows the close button; called when it's clicked. */
|
|
37
|
+
onRemove?: () => void;
|
|
38
|
+
/** Accessible name of the remove button. Defaults to "Remove <label>". */
|
|
39
|
+
removeLabel?: string;
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
children?: React.ReactNode;
|
|
42
|
+
className?: string;
|
|
43
|
+
};
|
|
44
|
+
export type ChipProps = ChipBaseProps & Omit<React.ComponentProps<'button'>, keyof ChipBaseProps> & {
|
|
45
|
+
'data-force'?: 'hover' | 'focus' | 'pressed';
|
|
46
|
+
};
|
|
47
|
+
export declare function Chip({ className, variant, size, tone, dot, avatar, onRemove, removeLabel, disabled, children, type, ...props }: ChipProps): React.JSX.Element;
|
|
48
|
+
/** The 16px initials avatar from Figma (Avatar 992:20199 at size 16): tone-bg, 7px semibold tone-fg. */
|
|
49
|
+
export declare function ChipAvatar({ initials, tone, className }: {
|
|
50
|
+
initials: string;
|
|
51
|
+
tone?: BadgeTone;
|
|
52
|
+
className?: string;
|
|
53
|
+
}): React.JSX.Element;
|
|
54
|
+
export { chipVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"chip.js"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Citations and sources, 1:1 with the uiKit design (🆕 citations): where an answer comes from.
|
|
4
|
+
*
|
|
5
|
+
* - `Citation`: a numbered chip right after the claim — 16 high, text/xs medium on bg/muted,
|
|
6
|
+
* radius-sm; hover bg/hover with a border/strong ring. Resting on it (or focusing it) opens a
|
|
7
|
+
* HoverCard with the source: logo and where it lives, the title, and the quoted passage.
|
|
8
|
+
* - `Sources`: under the message, a pill with the sources' logos stacked and "3 sources"; it
|
|
9
|
+
* opens into the list — number, logo, title, where it lives — each row a link.
|
|
10
|
+
*
|
|
11
|
+
* A source's `icon` is its logo (an app's or a site's favicon); without one it gets a tile with
|
|
12
|
+
* its first letter, so a missing favicon never leaves a hole.
|
|
13
|
+
*/
|
|
14
|
+
export interface CitationSource {
|
|
15
|
+
title: string;
|
|
16
|
+
/** Where it comes from: the app or site, "Notion" or "freshfarm.pl". */
|
|
17
|
+
origin?: string;
|
|
18
|
+
href?: string;
|
|
19
|
+
/** A 16px logo or favicon. */
|
|
20
|
+
icon?: React.ReactNode;
|
|
21
|
+
/** The passage the answer relies on, shown in the preview. */
|
|
22
|
+
quote?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface CitationProps {
|
|
25
|
+
/** 1-based, as in the Sources list. */
|
|
26
|
+
index: number;
|
|
27
|
+
source: CitationSource;
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function Citation({ index, source, className }: CitationProps): React.JSX.Element;
|
|
31
|
+
export interface SourcesProps {
|
|
32
|
+
sources: CitationSource[];
|
|
33
|
+
/** Start with the list open. */
|
|
34
|
+
defaultOpen?: boolean;
|
|
35
|
+
className?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare function Sources({ sources, defaultOpen, className }: SourcesProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"citations.js"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface CodeBlockProps extends Omit<React.ComponentProps<'div'>, 'children'> {
|
|
3
|
+
code: string;
|
|
4
|
+
filename?: string;
|
|
5
|
+
view?: 'code' | 'diff';
|
|
6
|
+
showHeader?: boolean;
|
|
7
|
+
showActions?: boolean;
|
|
8
|
+
/** 1-based line numbers to mark (code view). */
|
|
9
|
+
highlightLines?: number[];
|
|
10
|
+
/** Turn syntax colours off for plain output such as logs. */
|
|
11
|
+
highlight?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function CodeBlock({ code, filename, view, showHeader, showActions, highlightLines, highlight, className, ...props }: CodeBlockProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"code-block.js"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type SelectOption } from './select';
|
|
3
|
+
/**
|
|
4
|
+
* Combobox, 1:1 with the uiKit `Combobox` set (4023:3549): Select's field, opening a searchable
|
|
5
|
+
* list. The panel is the menu surface at the field's width (240 at least): a 36px search row
|
|
6
|
+
* (16px icon, 14px query, 12px in) over a border/subtle rule, then the matching options as
|
|
7
|
+
* inline menu rows 2px apart in 4px of padding.
|
|
8
|
+
*
|
|
9
|
+
* Single: a pick fills the field with its label and closes the list. Multiple: each pick
|
|
10
|
+
* toggles and the list stays open; the field shows the picks as small outline chips, 4px
|
|
11
|
+
* apart, each with its own remove button, and grows a row at a time as they wrap. The chips sit
|
|
12
|
+
* 3px from the field's edge, so their labels start where a value's text would. With more than
|
|
13
|
+
* one pick, Clear (the xs tertiary button) shows on the label's line at the field's right edge.
|
|
14
|
+
*
|
|
15
|
+
* `footer` adds Cancel (secondary) and Apply (primary) under a border/subtle rule, 8px in: picks
|
|
16
|
+
* then wait for Apply, which stays disabled until something is picked; Cancel or Escape drops
|
|
17
|
+
* them.
|
|
18
|
+
*
|
|
19
|
+
* Typing filters by label and description. Arrow keys move the highlight, Enter picks it, the
|
|
20
|
+
* pointer highlights what it is over. The query field is a `combobox` that owns the `listbox`.
|
|
21
|
+
*/
|
|
22
|
+
export interface ComboboxProps {
|
|
23
|
+
options: SelectOption[];
|
|
24
|
+
/** The applied picks. */
|
|
25
|
+
value?: string[];
|
|
26
|
+
defaultValue?: string[];
|
|
27
|
+
onValueChange?: (value: string[]) => void;
|
|
28
|
+
multiple?: boolean;
|
|
29
|
+
/** Cancel and Apply under the list; picks apply only with Apply. */
|
|
30
|
+
footer?: boolean;
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
searchPlaceholder?: string;
|
|
33
|
+
/** Shown when nothing matches the query. */
|
|
34
|
+
emptyText?: React.ReactNode;
|
|
35
|
+
applyLabel?: string;
|
|
36
|
+
cancelLabel?: string;
|
|
37
|
+
clearLabel?: string;
|
|
38
|
+
label?: React.ReactNode;
|
|
39
|
+
hint?: React.ReactNode;
|
|
40
|
+
error?: React.ReactNode | boolean;
|
|
41
|
+
size?: 'sm' | 'md' | 'lg';
|
|
42
|
+
leadingIcon?: React.ReactNode;
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
id?: string;
|
|
45
|
+
open?: boolean;
|
|
46
|
+
defaultOpen?: boolean;
|
|
47
|
+
onOpenChange?: (open: boolean) => void;
|
|
48
|
+
/** Portal target. Defaults to `document.body`. */
|
|
49
|
+
container?: HTMLElement | null;
|
|
50
|
+
/** Keep focus where it is when the panel opens (inline previews). */
|
|
51
|
+
onOpenAutoFocus?: (event: Event) => void;
|
|
52
|
+
/** A press outside the panel; `preventDefault()` keeps it open. */
|
|
53
|
+
onInteractOutside?: (event: Event) => void;
|
|
54
|
+
'aria-label'?: string;
|
|
55
|
+
wrapperClassName?: string;
|
|
56
|
+
className?: string;
|
|
57
|
+
}
|
|
58
|
+
export declare function Combobox({ options, value, defaultValue, onValueChange, multiple, footer, placeholder, searchPlaceholder, emptyText, applyLabel, cancelLabel, clearLabel, label, hint, error, size, leadingIcon, disabled, id, open: openProp, defaultOpen, onOpenChange, container, onOpenAutoFocus, onInteractOutside, wrapperClassName, className, ...props }: ComboboxProps): React.JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';export { Combobox } from '../chunk-NSRTTYQ4.js';
|
|
2
|
+
import '../chunk-3ERGAHKA.js';
|
|
3
|
+
import '../chunk-72OCFAPT.js';
|
|
4
|
+
import '../chunk-UBNHSZSE.js';
|
|
5
|
+
import '../chunk-3DINAQLL.js';
|
|
6
|
+
import '../chunk-BKZBWPUH.js';
|
|
7
|
+
import '../chunk-HNQUX43Z.js';
|
|
8
|
+
import '../chunk-H63FYCMY.js';
|
|
9
|
+
//# sourceMappingURL=combobox.js.map
|
|
10
|
+
//# sourceMappingURL=combobox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"combobox.js"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Command menu, 1:1 with the uiKit `Command menu` set (4024:3582): the ⌘K palette. A 520px
|
|
4
|
+
* popover surface (radius-2xl, border/subtle, the shadcn `lg` shadow) with a 48px search row
|
|
5
|
+
* (16px icon, 14px query, an Esc key, 16px in) over a border/subtle rule; titled groups 8px
|
|
6
|
+
* apart in 8px of padding, each with a 24px heading (12px medium, text/muted) and inline menu
|
|
7
|
+
* rows; and a 40px footer of key hints (Navigate, Open on the left, Close on the right).
|
|
8
|
+
*
|
|
9
|
+
* Rows are the Dropdown's: a 16px icon, the label, an optional description after it and an
|
|
10
|
+
* optional `shortcut` (Kbd sm) on the right. The highlighted row takes the menu highlight,
|
|
11
|
+
* bg/selected, whether the pointer or the arrow keys put it there. The first match is
|
|
12
|
+
* highlighted; Enter runs it and closes the menu.
|
|
13
|
+
*
|
|
14
|
+
* It sits in the middle of the screen (or of its `container`).
|
|
15
|
+
*
|
|
16
|
+
* Built on the Radix Dialog (focus trap, Escape, focus back to where it was). With `hotkey`,
|
|
17
|
+
* ⌘K or Ctrl+K anywhere on the page toggles it.
|
|
18
|
+
*/
|
|
19
|
+
export interface CommandItem {
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
icon?: React.ReactNode;
|
|
24
|
+
/** Keys that run it outside the menu, e.g. "⌘N". Optional. */
|
|
25
|
+
shortcut?: string;
|
|
26
|
+
/** More words to match on. */
|
|
27
|
+
keywords?: string[];
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
onSelect?: () => void;
|
|
30
|
+
}
|
|
31
|
+
export interface CommandGroup {
|
|
32
|
+
label: React.ReactNode;
|
|
33
|
+
items: CommandItem[];
|
|
34
|
+
}
|
|
35
|
+
export interface CommandMenuProps {
|
|
36
|
+
groups: CommandGroup[];
|
|
37
|
+
open?: boolean;
|
|
38
|
+
defaultOpen?: boolean;
|
|
39
|
+
onOpenChange?: (open: boolean) => void;
|
|
40
|
+
/** Toggle the menu with ⌘K / Ctrl+K. */
|
|
41
|
+
hotkey?: boolean;
|
|
42
|
+
placeholder?: string;
|
|
43
|
+
/** Shown when nothing matches; gets the query. */
|
|
44
|
+
emptyText?: (query: string) => React.ReactNode;
|
|
45
|
+
/** Show the footer of key hints. */
|
|
46
|
+
hints?: boolean;
|
|
47
|
+
/** Modal blocks the page and shows the overlay; turn it off for inline previews. */
|
|
48
|
+
modal?: boolean;
|
|
49
|
+
/** Portal target. Defaults to `document.body`. */
|
|
50
|
+
container?: HTMLElement | null;
|
|
51
|
+
onOpenAutoFocus?: (event: Event) => void;
|
|
52
|
+
className?: string;
|
|
53
|
+
}
|
|
54
|
+
export declare function CommandMenu({ groups, open: openProp, defaultOpen, onOpenChange, hotkey, placeholder, emptyText, hints, modal, container, onOpenAutoFocus, className, }: CommandMenuProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"command-menu.js"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ContextMenu as ContextPrimitive } from 'radix-ui';
|
|
3
|
+
import { type MenuItemContentProps } from './dropdown';
|
|
4
|
+
/**
|
|
5
|
+
* ContextMenu, 1:1 with the uiKit design (🆕 context menu & hover card): DropdownMenu's surface
|
|
6
|
+
* and rows, opened by right-click (or a long press) on its target, at the pointer. 255 wide, 4px
|
|
7
|
+
* in, rows 0 apart, separators a 1px bg/muted rule. Shortcuts on the right as Kbd; a submenu row
|
|
8
|
+
* ends in a text/muted chevron (the kit's `showSubmenu`) and opens beside it, 4px off; destructive
|
|
9
|
+
* rows are action/destructive/fg (red-400 in dark), icon included, and go last.
|
|
10
|
+
*
|
|
11
|
+
* Built on the Radix ContextMenu: arrow keys, typeahead, Escape, Shift+F10 / the menu key on the
|
|
12
|
+
* focused target.
|
|
13
|
+
*/
|
|
14
|
+
export interface ContextMenuProps {
|
|
15
|
+
/** What right-click opens the menu on. Rendered with `asChild`, so pass one element. */
|
|
16
|
+
trigger: React.ReactNode;
|
|
17
|
+
/** `ContextMenuItem`s, `ContextMenuSub`s and `ContextMenuSeparator`s. */
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
onOpenChange?: (open: boolean) => void;
|
|
20
|
+
/** Portal target. Defaults to `document.body`. */
|
|
21
|
+
container?: HTMLElement | null;
|
|
22
|
+
/** Modal menus block the rest of the page while open. */
|
|
23
|
+
modal?: boolean;
|
|
24
|
+
/** Focus moved outside a non-modal menu; call `preventDefault()` to keep it open. */
|
|
25
|
+
onFocusOutside?: (event: Event) => void;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function ContextMenu({ trigger, children, onOpenChange, container, modal, onFocusOutside, className, }: ContextMenuProps): React.JSX.Element;
|
|
29
|
+
export interface ContextMenuItemProps extends Omit<React.ComponentProps<typeof ContextPrimitive.Item>, 'children'>, Pick<MenuItemContentProps, 'icon' | 'shortcut' | 'description'> {
|
|
30
|
+
label: string;
|
|
31
|
+
/** Deletes or removes: action/destructive/fg, and best placed last. */
|
|
32
|
+
destructive?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare function ContextMenuItem({ label, icon, shortcut, description, destructive, className, ...props }: ContextMenuItemProps): React.JSX.Element;
|
|
35
|
+
export interface ContextMenuSubProps extends Pick<MenuItemContentProps, 'icon'> {
|
|
36
|
+
label: string;
|
|
37
|
+
/** The submenu's items. */
|
|
38
|
+
children: React.ReactNode;
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/** A row that opens a submenu beside it (hover, →, or Enter). */
|
|
42
|
+
export declare function ContextMenuSub({ label, icon, children, disabled }: ContextMenuSubProps): React.JSX.Element;
|
|
43
|
+
/** A 1px bg/muted rule between groups of rows. */
|
|
44
|
+
export declare function ContextMenuSeparator({ className }: {
|
|
45
|
+
className?: string;
|
|
46
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use client';export { ContextMenu, ContextMenuItem, ContextMenuSeparator, ContextMenuSub } from '../chunk-PF3YBUKT.js';
|
|
2
|
+
import '../chunk-3DINAQLL.js';
|
|
3
|
+
import '../chunk-BKZBWPUH.js';
|
|
4
|
+
import '../chunk-H63FYCMY.js';
|
|
5
|
+
//# sourceMappingURL=context-menu.js.map
|
|
6
|
+
//# sourceMappingURL=context-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"context-menu.js"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* CookieConsent: what the site stores and the three answers, in one floating card at the
|
|
4
|
+
* bottom of the page. bg/popover, border/subtle, radius-3xl, the shadcn lg shadow; 20 × 16 in.
|
|
5
|
+
*
|
|
6
|
+
* The message (Body/lg, text/muted) is kept to a narrow column so it reads in three short
|
|
7
|
+
* lines; the actions sit to its right: Customize as a tertiary button in text/muted, then
|
|
8
|
+
* Reject all as a rounded secondary button and Accept all as the rounded primary one. Below 640px the actions wrap under the message.
|
|
9
|
+
*
|
|
10
|
+
* `floating` pins it 16px above the bottom of the viewport, centred; leave it off to place the
|
|
11
|
+
* card yourself. It is a labelled region, not a modal: the page stays usable behind it.
|
|
12
|
+
*/
|
|
13
|
+
export interface CookieConsentProps extends Omit<React.ComponentProps<'section'>, 'children'> {
|
|
14
|
+
/** What the site stores and why. */
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
onAccept?: () => void;
|
|
17
|
+
onReject?: () => void;
|
|
18
|
+
/** Shows Customize; open your settings from here. */
|
|
19
|
+
onCustomize?: () => void;
|
|
20
|
+
acceptLabel?: string;
|
|
21
|
+
rejectLabel?: string;
|
|
22
|
+
customizeLabel?: string;
|
|
23
|
+
/** Fixed to the bottom of the viewport, centred, 16px up. */
|
|
24
|
+
floating?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare function CookieConsent({ children, onAccept, onReject, onCustomize, acceptLabel, rejectLabel, customizeLabel, floating, className, 'aria-label': ariaLabel, ...props }: CookieConsentProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"cookie-consent.js"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Calendar, DatePicker and DateRangePicker, 1:1 with the uiKit design (🆕 date picker).
|
|
4
|
+
*
|
|
5
|
+
* Calendar: one month (or two side by side), Monday first, weekdays as one letter in text/xs muted.
|
|
6
|
+
* Days are 36px in 40px cells, their numbers text/sm (13px) medium. A picked day is a primary circle; the two ends of a range are
|
|
7
|
+
* primary squares rounded radius-md, with a band in status/brand/bg — a tint of the brand —
|
|
8
|
+
* from the middle of the first to the middle of the last. While the end is being picked the day
|
|
9
|
+
* under the pointer gets a bg/hover circle and the band runs up to it. Today is a 12×2 primary
|
|
10
|
+
* dash under its number; days of other months are text/subtle.
|
|
11
|
+
*
|
|
12
|
+
* Header: "November 2026" in text/sm (13px) medium, with arrows, or (`header="picker"`) "‹ November ›" on the left and the
|
|
13
|
+
* year as a small Select on the right, newest first, the shown year checked. Always six weeks, so
|
|
14
|
+
* the height never jumps between months.
|
|
15
|
+
*
|
|
16
|
+
* Keyboard: the grid is one tab stop; arrows move a day or a week, Page Up / Down a month, Home /
|
|
17
|
+
* End the week, Enter or Space picks.
|
|
18
|
+
*/
|
|
19
|
+
export type DateRange = {
|
|
20
|
+
from: Date | null;
|
|
21
|
+
to: Date | null;
|
|
22
|
+
};
|
|
23
|
+
export declare const formatDate: (d: Date) => string;
|
|
24
|
+
export declare const formatRange: ({ from, to }: DateRange) => string;
|
|
25
|
+
export interface CalendarProps {
|
|
26
|
+
mode?: 'single' | 'range';
|
|
27
|
+
/** single: the picked day. */
|
|
28
|
+
value?: Date | null;
|
|
29
|
+
onValueChange?: (value: Date) => void;
|
|
30
|
+
/** range: the picked range. */
|
|
31
|
+
range?: DateRange;
|
|
32
|
+
onRangeChange?: (range: DateRange) => void;
|
|
33
|
+
/** The first month shown. Defaults to the value's month, or today's. */
|
|
34
|
+
month?: Date;
|
|
35
|
+
onMonthChange?: (month: Date) => void;
|
|
36
|
+
/** Two months side by side (the range picker). */
|
|
37
|
+
months?: 1 | 2;
|
|
38
|
+
header?: 'title' | 'picker';
|
|
39
|
+
min?: Date;
|
|
40
|
+
max?: Date;
|
|
41
|
+
/** Today, for the dash. Defaults to now. */
|
|
42
|
+
today?: Date;
|
|
43
|
+
className?: string;
|
|
44
|
+
}
|
|
45
|
+
export declare function Calendar({ mode, value, onValueChange, range, onRangeChange, month: monthProp, onMonthChange, months, header, min, max, today: todayProp, className, }: CalendarProps): React.JSX.Element;
|
|
46
|
+
interface FieldBits {
|
|
47
|
+
label?: React.ReactNode;
|
|
48
|
+
hint?: React.ReactNode;
|
|
49
|
+
error?: React.ReactNode | boolean;
|
|
50
|
+
placeholder?: string;
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
id?: string;
|
|
53
|
+
size?: 'sm' | 'md' | 'lg';
|
|
54
|
+
/** Classes for the outer wrapper (label + field + hint). `className` styles the field. */
|
|
55
|
+
wrapperClassName?: string;
|
|
56
|
+
className?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface DatePickerPanelProps {
|
|
59
|
+
value?: Date | null;
|
|
60
|
+
onValueChange?: (value: Date) => void;
|
|
61
|
+
min?: Date;
|
|
62
|
+
max?: Date;
|
|
63
|
+
today?: Date;
|
|
64
|
+
className?: string;
|
|
65
|
+
}
|
|
66
|
+
/** The date picker's panel on its own, in place: the popover surface with the Calendar, month and year to pick. */
|
|
67
|
+
export declare function DatePickerPanel({ value, onValueChange, min, max, today, className }: DatePickerPanelProps): React.JSX.Element;
|
|
68
|
+
export interface DatePickerProps extends FieldBits {
|
|
69
|
+
value?: Date | null;
|
|
70
|
+
defaultValue?: Date | null;
|
|
71
|
+
onValueChange?: (value: Date) => void;
|
|
72
|
+
min?: Date;
|
|
73
|
+
max?: Date;
|
|
74
|
+
today?: Date;
|
|
75
|
+
/** Portal target. */
|
|
76
|
+
container?: HTMLElement | null;
|
|
77
|
+
}
|
|
78
|
+
/** A date field: the kit Input's skin with a calendar icon; the Calendar opens 4px below, with month and year to pick. */
|
|
79
|
+
export declare function DatePicker({ value: valueProp, defaultValue, onValueChange, min, max, today, label, hint, error, placeholder, disabled, id, size, container, wrapperClassName, className, }: DatePickerProps): React.JSX.Element;
|
|
80
|
+
export interface DateRangePickerProps extends FieldBits {
|
|
81
|
+
value?: DateRange;
|
|
82
|
+
defaultValue?: DateRange;
|
|
83
|
+
/** Called on Apply. */
|
|
84
|
+
onValueChange?: (value: DateRange) => void;
|
|
85
|
+
min?: Date;
|
|
86
|
+
max?: Date;
|
|
87
|
+
today?: Date;
|
|
88
|
+
applyLabel?: string;
|
|
89
|
+
cancelLabel?: string;
|
|
90
|
+
container?: HTMLElement | null;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* A range field: two months, Cancel and Apply in the footer. Picks wait for Apply. Picking an
|
|
94
|
+
* end before the start swaps them.
|
|
95
|
+
*/
|
|
96
|
+
export declare function DateRangePicker({ value: valueProp, defaultValue, onValueChange, min, max, today, label, hint, error, placeholder, disabled, id, size, applyLabel, cancelLabel, container, wrapperClassName, className, }: DateRangePickerProps): React.JSX.Element;
|
|
97
|
+
export interface DateRangePickerPanelProps {
|
|
98
|
+
/** The range the panel starts from; picks stay in the panel until Apply. */
|
|
99
|
+
value?: DateRange;
|
|
100
|
+
/** Apply. */
|
|
101
|
+
onApply?: (value: DateRange) => void;
|
|
102
|
+
onCancel?: () => void;
|
|
103
|
+
min?: Date;
|
|
104
|
+
max?: Date;
|
|
105
|
+
today?: Date;
|
|
106
|
+
applyLabel?: string;
|
|
107
|
+
cancelLabel?: string;
|
|
108
|
+
className?: string;
|
|
109
|
+
}
|
|
110
|
+
/** The range picker's panel on its own, in place: two months, Cancel and Apply. */
|
|
111
|
+
export declare function DateRangePickerPanel({ value, onApply, onCancel, min, max, today, applyLabel, cancelLabel, className, }: DateRangePickerPanelProps): React.JSX.Element;
|
|
112
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use client';export { Calendar, DatePicker, DatePickerPanel, DateRangePicker, DateRangePickerPanel, formatDate, formatRange } from '../chunk-XZNHT6MO.js';
|
|
2
|
+
import '../chunk-72OCFAPT.js';
|
|
3
|
+
import '../chunk-UBNHSZSE.js';
|
|
4
|
+
import '../chunk-3DINAQLL.js';
|
|
5
|
+
import '../chunk-BKZBWPUH.js';
|
|
6
|
+
import '../chunk-HNQUX43Z.js';
|
|
7
|
+
import '../chunk-H63FYCMY.js';
|
|
8
|
+
//# sourceMappingURL=date-picker.js.map
|
|
9
|
+
//# sourceMappingURL=date-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"date-picker.js"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* DecisionCard, 1:1 with the uiKit `DecisionCard` set (3096:1626) and its `decisionItem` rows
|
|
4
|
+
* (3092:61608): one question an agent asks, its answers, and Skip / Continue.
|
|
5
|
+
*
|
|
6
|
+
* The card is 364 wide, bg/popover, border/default, radius-2xl, shadow-xs. The header is the
|
|
7
|
+
* medium 14/20 title with an optional step navigator (24px icon buttons around "1/3"); the
|
|
8
|
+
* footer is a tertiary Skip in text/muted and a primary Continue, 16px above and 12px below.
|
|
9
|
+
*
|
|
10
|
+
* - `radio` / `checkbox`: rows of 20px with 4px padding, hover bg action/secondary, 2px apart.
|
|
11
|
+
* - `chips`: wrapping 28px pills 6px apart; selected ones turn status/brand (fill, border, text).
|
|
12
|
+
* - `ranking`: 10px-radius rows with a grip, a rank dot (primary for #1) and the label. Drag to
|
|
13
|
+
* reorder, or Alt + Arrow keys; the dragged row lifts with border/strong and the md shadow.
|
|
14
|
+
* - `draft`: the agent's text in a bubble (radius-2xl, 4px top-left); Rewrite makes it editable.
|
|
15
|
+
* - `summary`: what the card collapses to once answered, with a Change action.
|
|
16
|
+
*
|
|
17
|
+
* Stepping between questions moves like Pagination: the new title and answers slide in 24px from
|
|
18
|
+
* the side of the step (from the right going forward), the old ones slide the other way and fade
|
|
19
|
+
* out a little faster, and the card eases to its new height, all 300 ms on the kit ease-out. The
|
|
20
|
+
* step navigator and the footer stay put. Stepping again mid-slide carries on from where things
|
|
21
|
+
* are. Under reduced motion the parts only cross-fade (150 ms) and the height snaps.
|
|
22
|
+
*/
|
|
23
|
+
export type DecisionOption = {
|
|
24
|
+
value: string;
|
|
25
|
+
label: string;
|
|
26
|
+
/** 14px icon, used by `chips`. */
|
|
27
|
+
icon?: React.ReactNode;
|
|
28
|
+
};
|
|
29
|
+
export type DecisionValue = string | string[];
|
|
30
|
+
export interface DecisionCardProps extends Omit<React.ComponentProps<'div'>, 'title' | 'defaultValue' | 'onChange'> {
|
|
31
|
+
type?: 'radio' | 'checkbox' | 'chips' | 'ranking' | 'draft' | 'summary';
|
|
32
|
+
title: string;
|
|
33
|
+
/** "1/3". Shows the step navigator. */
|
|
34
|
+
step?: string;
|
|
35
|
+
onPreviousStep?: () => void;
|
|
36
|
+
onNextStep?: () => void;
|
|
37
|
+
/** A muted line under the title, e.g. "Select up to 5". */
|
|
38
|
+
hint?: string;
|
|
39
|
+
options?: DecisionOption[];
|
|
40
|
+
/**
|
|
41
|
+
* radio: the chosen value. checkbox / chips: the chosen values. ranking: every value in order.
|
|
42
|
+
* draft: the text. summary: the values to list.
|
|
43
|
+
*/
|
|
44
|
+
value?: DecisionValue;
|
|
45
|
+
defaultValue?: DecisionValue;
|
|
46
|
+
onValueChange?: (value: DecisionValue) => void;
|
|
47
|
+
/** chips: how many can be picked. */
|
|
48
|
+
max?: number;
|
|
49
|
+
/** draft: the bold first line of the draft, e.g. the subject. */
|
|
50
|
+
draftTitle?: string;
|
|
51
|
+
onContinue?: (value: DecisionValue) => void;
|
|
52
|
+
onSkip?: () => void;
|
|
53
|
+
/** summary: reopens the question. */
|
|
54
|
+
onEdit?: () => void;
|
|
55
|
+
/** draft: called when Rewrite is pressed, after the field becomes editable. */
|
|
56
|
+
onRewrite?: () => void;
|
|
57
|
+
continueLabel?: string;
|
|
58
|
+
skipLabel?: string;
|
|
59
|
+
}
|
|
60
|
+
export declare function DecisionCard({ className, type, title, step, onPreviousStep, onNextStep, hint, options, value: valueProp, defaultValue, onValueChange, max, draftTitle, onContinue, onSkip, onEdit, onRewrite, continueLabel, skipLabel, ...props }: DecisionCardProps): React.JSX.Element;
|
|
61
|
+
/** A static `decisionItem` row in its hover state, for state sheets. */
|
|
62
|
+
export declare function DecisionItemPreview({ children, hover }: {
|
|
63
|
+
children: React.ReactNode;
|
|
64
|
+
hover?: boolean;
|
|
65
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use client';export { DecisionCard, DecisionItemPreview } from '../chunk-TX3H3QMA.js';
|
|
2
|
+
import '../chunk-J3NSDRVH.js';
|
|
3
|
+
import '../chunk-FDKIX4DC.js';
|
|
4
|
+
import '../chunk-HNQUX43Z.js';
|
|
5
|
+
import '../chunk-H63FYCMY.js';
|
|
6
|
+
//# sourceMappingURL=decision-card.js.map
|
|
7
|
+
//# sourceMappingURL=decision-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"decision-card.js"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Dialog as DialogPrimitive } from 'radix-ui';
|
|
3
|
+
/**
|
|
4
|
+
* Dialog, 1:1 with the uiKit `Dialog` set (465:66873): variant default or destructive.
|
|
5
|
+
* A 425px popover surface (min 360, max 560, never wider or taller than the screen less 16px a side; the body scrolls), radius-2xl, border/default, the shadcn `lg`
|
|
6
|
+
* shadow. Header 16 / 16 / 8 with a 14px medium title and a 13px muted description, a body
|
|
7
|
+
* 16px in with a 12px gap (body text, any content, an optional `DialogAlert`), then a
|
|
8
|
+
* right-aligned footer with 16px padding on both variants, on the same inset as the header and
|
|
9
|
+
* body. The close button is a 36px tertiary icon button 8px from the top-right corner.
|
|
10
|
+
*
|
|
11
|
+
* Built on the Radix Dialog. The destructive variant keeps the same primitive but takes
|
|
12
|
+
* `role="alertdialog"`, so screen readers announce it as an alert. Pass `container` to portal
|
|
13
|
+
* it into a positioned element (the docs stage) instead of the page; the dialog then centres
|
|
14
|
+
* inside that element rather than the viewport.
|
|
15
|
+
*/
|
|
16
|
+
export type DialogVariant = 'default' | 'destructive';
|
|
17
|
+
export interface DialogProps {
|
|
18
|
+
open?: boolean;
|
|
19
|
+
defaultOpen?: boolean;
|
|
20
|
+
onOpenChange?: (open: boolean) => void;
|
|
21
|
+
/** Optional element that opens the dialog (rendered with `asChild`, so pass a Button). */
|
|
22
|
+
trigger?: React.ReactNode;
|
|
23
|
+
title: React.ReactNode;
|
|
24
|
+
description?: React.ReactNode;
|
|
25
|
+
variant?: DialogVariant;
|
|
26
|
+
/** A `DialogAlert` shown under the body, for a side effect the user must know about. */
|
|
27
|
+
alert?: React.ReactNode;
|
|
28
|
+
/** The actions on the right of the footer. Leave it out for a read-only dialog. */
|
|
29
|
+
footer?: React.ReactNode;
|
|
30
|
+
/** Figma's `footerSlot`: content on the left of the footer, e.g. a "Don't ask again" checkbox. */
|
|
31
|
+
footerStart?: React.ReactNode;
|
|
32
|
+
/** Body. A string renders as body text (13px, text/default). */
|
|
33
|
+
children?: React.ReactNode;
|
|
34
|
+
/** Show the close button in the corner. */
|
|
35
|
+
closeButton?: boolean;
|
|
36
|
+
/** Modal blocks the page and shows the overlay; turn it off for inline previews. */
|
|
37
|
+
modal?: boolean;
|
|
38
|
+
/** Portal target. Defaults to `document.body`. */
|
|
39
|
+
container?: HTMLElement | null;
|
|
40
|
+
/** Called when focus moves into the dialog on open; `preventDefault()` keeps it where it was. */
|
|
41
|
+
onOpenAutoFocus?: (event: Event) => void;
|
|
42
|
+
className?: string;
|
|
43
|
+
}
|
|
44
|
+
/** The X from Figma's close button (`icon` 16px, 1.25 stroke). */
|
|
45
|
+
export declare function CloseIcon(): React.JSX.Element;
|
|
46
|
+
export declare function Dialog({ open, defaultOpen, onOpenChange, trigger, title, description, variant, alert, footer, footerStart, children, closeButton, modal, container, onOpenAutoFocus, className, }: DialogProps): React.JSX.Element;
|
|
47
|
+
/** Wrap a footer button in this to make it close the dialog: `<DialogClose asChild><Button…/></DialogClose>`. */
|
|
48
|
+
export declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
49
|
+
export type DialogAlertIntent = 'info' | 'success' | 'warning' | 'error';
|
|
50
|
+
/**
|
|
51
|
+
* Alert, 1:1 with the uiKit `Alert` set (475:27871): the inline notice inside a dialog.
|
|
52
|
+
* radius-xl, 16 / 12 padding, the intent's status bg, a 16px status icon in the intent's
|
|
53
|
+
* status fg, a 14px medium title over a 13px muted description, and an optional 28px close.
|
|
54
|
+
*/
|
|
55
|
+
export interface DialogAlertProps extends Omit<React.ComponentProps<'div'>, 'title'> {
|
|
56
|
+
intent?: DialogAlertIntent;
|
|
57
|
+
title: React.ReactNode;
|
|
58
|
+
description?: React.ReactNode;
|
|
59
|
+
/** Hide the status icon. */
|
|
60
|
+
icon?: boolean;
|
|
61
|
+
/** Shows the close button; called when it is pressed. */
|
|
62
|
+
onDismiss?: () => void;
|
|
63
|
+
}
|
|
64
|
+
/** The four status glyphs from Figma (16px, 1.25 stroke), drawn in currentColor. */
|
|
65
|
+
export declare function StatusIcon({ intent }: {
|
|
66
|
+
intent: DialogAlertIntent;
|
|
67
|
+
}): React.JSX.Element;
|
|
68
|
+
export declare function DialogAlert({ intent, title, description, icon, onDismiss, className, ...props }: DialogAlertProps): React.JSX.Element;
|