@widgetic/design-system 0.5.40 → 0.5.42
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/README.md +73 -0
- package/dist/components/ContentRefreshOverlay.svelte +103 -0
- package/dist/components/ContentRefreshOverlay.svelte.d.ts +18 -0
- package/dist/components/EmptyState.svelte +6 -2
- package/dist/components/chat/Composer.svelte +380 -19
- package/dist/components/chat/Composer.svelte.d.ts +88 -1
- package/dist/components/chat/PlanCard.svelte +218 -88
- package/dist/components/chat/PlanCard.svelte.d.ts +11 -0
- package/dist/components/chat/QuestionCard.svelte +180 -70
- package/dist/components/chat/QuestionCard.svelte.d.ts +28 -2
- package/dist/components/chat/QuestionCardSummary.svelte +96 -0
- package/dist/components/chat/QuestionCardSummary.svelte.d.ts +20 -0
- package/dist/components/chat/QueueCard.svelte +185 -0
- package/dist/components/chat/QueueCard.svelte.d.ts +40 -0
- package/dist/components/chat/composerLogic.d.ts +31 -0
- package/dist/components/chat/composerLogic.js +37 -0
- package/dist/components/chat/composerReferences.d.ts +28 -0
- package/dist/components/chat/composerReferences.js +23 -0
- package/dist/components/chat/index.d.ts +8 -3
- package/dist/components/chat/index.js +10 -2
- package/dist/components/chat/questionCardLogic.d.ts +40 -3
- package/dist/components/chat/questionCardLogic.js +54 -3
- package/dist/components/chat/queueCardLogic.d.ts +7 -0
- package/dist/components/chat/queueCardLogic.js +5 -0
- package/dist/components/creator/CreatorBar.svelte +54 -1
- package/dist/components/creator/CreatorBar.svelte.d.ts +5 -0
- package/dist/components/creator/index.d.ts +1 -2
- package/dist/components/creator/index.js +2 -0
- package/dist/components/index.d.ts +8 -7
- package/dist/components/index.js +8 -6
- package/dist/components/modals/BaseModal.svelte +23 -4
- package/dist/components/modals/BaseModal.svelte.d.ts +5 -0
- package/dist/components/navigation/breadcrumbSlideIn.d.ts +6 -2
- package/dist/components/navigation/breadcrumbSlideIn.js +6 -6
- package/dist/components/search-input/SearchInput.svelte +317 -14
- package/dist/components/search-input/SearchInput.svelte.d.ts +3 -0
- package/dist/components/search-input/index.d.ts +1 -0
- package/dist/components/search-input/index.js +1 -0
- package/dist/components/search-input/index2.d.ts +4 -0
- package/dist/components/search-input/recentSearches.d.ts +16 -0
- package/dist/components/search-input/recentSearches.js +141 -0
- package/dist/components/shell/NavRow.svelte +53 -10
- package/dist/components/shell/NavRow.svelte.d.ts +23 -2
- package/dist/components/shell/NotificationRow.svelte +3 -2
- package/dist/components/shell/ProfileRow.svelte +6 -4
- package/dist/components/shell/ProfileRow.svelte.d.ts +2 -2
- package/dist/components/shell/SettingsDialog.svelte +23 -1
- package/dist/components/shell/WidgetRow.svelte +4 -3
- package/dist/components/shell/WidgetRow.svelte.d.ts +2 -2
- package/dist/components/toast/ToasterModal.svelte +8 -3
- package/dist/components/toast/ToasterModal.svelte.d.ts +2 -0
- package/dist/components/ui/accordion/accordion-trigger.svelte +19 -0
- package/dist/components/ui/button/button.svelte +4 -2
- package/dist/components/ui/chip/chip.svelte +39 -1
- package/dist/components/ui/chip/chip.svelte.d.ts +8 -0
- package/dist/components/ui/chip/chipProgress.d.ts +14 -0
- package/dist/components/ui/chip/chipProgress.js +21 -0
- package/dist/components/ui/dialog/dialog-content.svelte +24 -2
- package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte +2 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +2 -1
- package/dist/components/ui/hover-card/hover-card-content.svelte +2 -1
- package/dist/components/ui/icon-button/icon-button.svelte +2 -0
- package/dist/components/ui/icon-button/icon-button.svelte.d.ts +5 -0
- package/dist/components/ui/number-controls/index.d.ts +2 -0
- package/dist/components/ui/number-controls/index.js +2 -0
- package/dist/components/ui/number-controls/number-controls.svelte +530 -0
- package/dist/components/ui/number-controls/number-controls.svelte.d.ts +46 -0
- package/dist/components/ui/number-controls/numberControlsSteps.d.ts +17 -0
- package/dist/components/ui/number-controls/numberControlsSteps.js +23 -0
- package/dist/components/ui/number-controls/numberControlsValueArea.d.ts +29 -0
- package/dist/components/ui/number-controls/numberControlsValueArea.js +51 -0
- package/dist/components/ui/popover/popover-content.svelte +2 -1
- package/dist/components/ui/select/select-content.svelte +2 -1
- package/dist/components/ui/text-flip/index.d.ts +1 -0
- package/dist/components/ui/text-flip/index.js +1 -0
- package/dist/components/ui/text-flip/text-flip.svelte +103 -0
- package/dist/components/ui/text-flip/text-flip.svelte.d.ts +15 -0
- package/dist/components/ui/text-flip/textFlipLogic.d.ts +49 -0
- package/dist/components/ui/text-flip/textFlipLogic.js +151 -0
- package/dist/components/ui/tooltip/tooltip-content.svelte +1 -1
- package/dist/inline-completion/completionAnswer.d.ts +11 -0
- package/dist/inline-completion/completionAnswer.js +49 -0
- package/dist/inline-completion/completionCache.d.ts +24 -0
- package/dist/inline-completion/completionCache.js +47 -0
- package/dist/inline-completion/completionController.d.ts +61 -0
- package/dist/inline-completion/completionController.js +280 -0
- package/dist/inline-completion/completionKeys.d.ts +21 -0
- package/dist/inline-completion/completionKeys.js +19 -0
- package/dist/inline-completion/completionText.d.ts +53 -0
- package/dist/inline-completion/completionText.js +79 -0
- package/dist/inline-completion/completionTypes.d.ts +71 -0
- package/dist/inline-completion/completionTypes.js +5 -0
- package/dist/inline-completion/gatewayCompletion.d.ts +37 -0
- package/dist/inline-completion/gatewayCompletion.js +77 -0
- package/dist/inline-completion/ghostTap.d.ts +19 -0
- package/dist/inline-completion/ghostTap.js +20 -0
- package/dist/inline-completion/hintMemory.d.ts +43 -0
- package/dist/inline-completion/hintMemory.js +90 -0
- package/dist/inline-completion/httpSource.d.ts +40 -0
- package/dist/inline-completion/httpSource.js +149 -0
- package/dist/inline-completion/index.d.ts +30 -0
- package/dist/inline-completion/index.js +20 -0
- package/dist/inline-completion/inlineCompletionAction.d.ts +54 -0
- package/dist/inline-completion/inlineCompletionAction.js +310 -0
- package/dist/inline-completion/outcomeReporter.d.ts +49 -0
- package/dist/inline-completion/outcomeReporter.js +139 -0
- package/dist/inline-completion/promiseLike.d.ts +9 -0
- package/dist/inline-completion/promiseLike.js +9 -0
- package/dist/prompt-references/ReferenceMenu.svelte +344 -0
- package/dist/prompt-references/ReferenceMenu.svelte.d.ts +26 -0
- package/dist/prompt-references/index.d.ts +27 -0
- package/dist/prompt-references/index.js +20 -0
- package/dist/prompt-references/neutralizingSource.d.ts +21 -0
- package/dist/prompt-references/neutralizingSource.js +29 -0
- package/dist/prompt-references/promptReferences.d.ts +28 -0
- package/dist/prompt-references/promptReferences.js +766 -0
- package/dist/prompt-references/referenceBadge.d.ts +61 -0
- package/dist/prompt-references/referenceBadge.js +82 -0
- package/dist/prompt-references/referenceBadgePainter.d.ts +31 -0
- package/dist/prompt-references/referenceBadgePainter.js +106 -0
- package/dist/prompt-references/referenceEditing.d.ts +60 -0
- package/dist/prompt-references/referenceEditing.js +135 -0
- package/dist/prompt-references/referenceLabels.d.ts +56 -0
- package/dist/prompt-references/referenceLabels.js +215 -0
- package/dist/prompt-references/referenceMeasure.d.ts +12 -0
- package/dist/prompt-references/referenceMeasure.js +63 -0
- package/dist/prompt-references/referenceMenuHost.svelte.d.ts +29 -0
- package/dist/prompt-references/referenceMenuHost.svelte.js +43 -0
- package/dist/prompt-references/referenceMenuKeys.d.ts +26 -0
- package/dist/prompt-references/referenceMenuKeys.js +49 -0
- package/dist/prompt-references/referenceMenuPlacement.d.ts +63 -0
- package/dist/prompt-references/referenceMenuPlacement.js +66 -0
- package/dist/prompt-references/referenceTokens.d.ts +175 -0
- package/dist/prompt-references/referenceTokens.js +332 -0
- package/dist/prompt-references/referenceTrigger.d.ts +52 -0
- package/dist/prompt-references/referenceTrigger.js +100 -0
- package/dist/prompt-references/referenceTypes.d.ts +38 -0
- package/dist/prompt-references/referenceTypes.js +4 -0
- package/dist/prompt-references/sentReferences.d.ts +50 -0
- package/dist/prompt-references/sentReferences.js +122 -0
- package/dist/styles/tokens.css +126 -1
- package/dist/textarea-overlay/index.d.ts +9 -0
- package/dist/textarea-overlay/index.js +7 -0
- package/dist/textarea-overlay/mirrorSegments.d.ts +31 -0
- package/dist/textarea-overlay/mirrorSegments.js +47 -0
- package/dist/textarea-overlay/mirrorSizing.d.ts +39 -0
- package/dist/textarea-overlay/mirrorSizing.js +40 -0
- package/dist/textarea-overlay/textareaOverlay.d.ts +25 -0
- package/dist/textarea-overlay/textareaOverlay.js +277 -0
- package/dist/utils/modalEnterKey.d.ts +139 -0
- package/dist/utils/modalEnterKey.js +276 -0
- package/dist/utils/modalFocusTrap.d.ts +7 -0
- package/dist/utils/modalFocusTrap.js +22 -0
- package/dist/utils/overlayMotion.d.ts +10 -0
- package/dist/utils/overlayMotion.js +12 -3
- package/dist/utils/reducedMotion.d.ts +9 -0
- package/dist/utils/reducedMotion.js +13 -0
- package/dist/utils/revealOpeningSection.d.ts +51 -0
- package/dist/utils/revealOpeningSection.js +109 -0
- package/package.json +16 -1
- package/dist/components/ui/number-stepper/index.d.ts +0 -3
- package/dist/components/ui/number-stepper/index.js +0 -3
- package/dist/components/ui/number-stepper/number-stepper.svelte +0 -212
- package/dist/components/ui/number-stepper/number-stepper.svelte.d.ts +0 -24
- package/dist/components/ui/number-stepper/numberStepperSteps.d.ts +0 -26
- package/dist/components/ui/number-stepper/numberStepperSteps.js +0 -45
|
@@ -42,6 +42,11 @@
|
|
|
42
42
|
titleAsCaption?: boolean;
|
|
43
43
|
/** Figma title button min width varies by state (Failed 143px vs Ready 201px). */
|
|
44
44
|
titleButtonClass?: string;
|
|
45
|
+
/** Inline title rename state for the sketch bar. */
|
|
46
|
+
isRenaming?: boolean;
|
|
47
|
+
renameValue?: string;
|
|
48
|
+
onRenameCommit?: (nextTitle: string) => void;
|
|
49
|
+
onRenameCancel?: () => void;
|
|
45
50
|
trailing?: Snippet;
|
|
46
51
|
};
|
|
47
52
|
|
|
@@ -68,10 +73,39 @@
|
|
|
68
73
|
titleAsCaption = false,
|
|
69
74
|
// Figma 514:52 — the title hugs its text (143 px for "Untitled widget", 201 px for "Black Friday countdown"), so it has no minimum width.
|
|
70
75
|
titleButtonClass = 'min-w-0',
|
|
76
|
+
isRenaming = false,
|
|
77
|
+
renameValue = '',
|
|
78
|
+
onRenameCommit,
|
|
79
|
+
onRenameCancel,
|
|
71
80
|
trailing,
|
|
72
81
|
...restProps
|
|
73
82
|
}: Props = $props();
|
|
74
83
|
|
|
84
|
+
let renameDraft = $state('');
|
|
85
|
+
let renameInputEl = $state<HTMLInputElement | null>(null);
|
|
86
|
+
let renameCanceled = false;
|
|
87
|
+
|
|
88
|
+
$effect(() => {
|
|
89
|
+
if (isRenaming) {
|
|
90
|
+
renameCanceled = false;
|
|
91
|
+
renameDraft = renameValue || title;
|
|
92
|
+
queueMicrotask(() => {
|
|
93
|
+
renameInputEl?.focus();
|
|
94
|
+
renameInputEl?.select();
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
function commitRename() {
|
|
100
|
+
if (renameCanceled) return;
|
|
101
|
+
onRenameCommit?.(renameDraft);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function cancelRename() {
|
|
105
|
+
renameCanceled = true;
|
|
106
|
+
onRenameCancel?.();
|
|
107
|
+
}
|
|
108
|
+
|
|
75
109
|
const titleIsInteractive = $derived(
|
|
76
110
|
!titleAsCaption && (Boolean(titleMenu) || Boolean(onTitleClick) || showTitleChevron),
|
|
77
111
|
);
|
|
@@ -94,7 +128,26 @@
|
|
|
94
128
|
</IconButton>
|
|
95
129
|
{/if}
|
|
96
130
|
|
|
97
|
-
{#if
|
|
131
|
+
{#if isRenaming}
|
|
132
|
+
<input
|
|
133
|
+
bind:this={renameInputEl}
|
|
134
|
+
bind:value={renameDraft}
|
|
135
|
+
type="text"
|
|
136
|
+
data-testid="creator-bar-title-input"
|
|
137
|
+
aria-label="Rename widget"
|
|
138
|
+
class="border-input bg-background text-body-medium focus:border-ring h-8 w-52 max-w-[min(100%,16rem)] rounded-md border px-2.5 text-sm outline-none"
|
|
139
|
+
onkeydown={(e) => {
|
|
140
|
+
if (e.key === 'Enter') {
|
|
141
|
+
e.preventDefault();
|
|
142
|
+
commitRename();
|
|
143
|
+
} else if (e.key === 'Escape') {
|
|
144
|
+
e.preventDefault();
|
|
145
|
+
cancelRename();
|
|
146
|
+
}
|
|
147
|
+
}}
|
|
148
|
+
onblur={commitRename}
|
|
149
|
+
/>
|
|
150
|
+
{:else if titleAsCaption}
|
|
98
151
|
<span
|
|
99
152
|
data-testid="creator-bar-title"
|
|
100
153
|
class="text-caption text-muted-foreground max-w-[10rem] truncate px-2 leading-4"
|
|
@@ -28,6 +28,11 @@ type Props = HTMLAttributes<HTMLElement> & {
|
|
|
28
28
|
titleAsCaption?: boolean;
|
|
29
29
|
/** Figma title button min width varies by state (Failed 143px vs Ready 201px). */
|
|
30
30
|
titleButtonClass?: string;
|
|
31
|
+
/** Inline title rename state for the sketch bar. */
|
|
32
|
+
isRenaming?: boolean;
|
|
33
|
+
renameValue?: string;
|
|
34
|
+
onRenameCommit?: (nextTitle: string) => void;
|
|
35
|
+
onRenameCancel?: () => void;
|
|
31
36
|
trailing?: Snippet;
|
|
32
37
|
};
|
|
33
38
|
declare const CreatorBar: import("svelte").Component<Props, {}, "ref" | "titleMenuOpen">;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export { default as CreatorBar } from './CreatorBar.svelte';
|
|
2
|
-
export { default as CanvasBoardStatusChip } from './CanvasBoardStatusChip.svelte';
|
|
3
|
-
export type { CanvasBoardStatusChipVariant } from './CanvasBoardStatusChip.svelte';
|
|
2
|
+
export { default as CanvasBoardStatusChip, type CanvasBoardStatusChipVariant } from './CanvasBoardStatusChip.svelte';
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { default as CreatorBar } from './CreatorBar.svelte';
|
|
2
|
+
// The type is exported in the same block as the component, with an inline `type`: the generator of the root barrel
|
|
3
|
+
// (see __docs/how-to-develop.md) reads only `export { … }` blocks and would drop a separate `export type { … }` line.
|
|
2
4
|
export { default as CanvasBoardStatusChip } from './CanvasBoardStatusChip.svelte';
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
+
export { default as ContentRefreshOverlay } from './ContentRefreshOverlay.svelte';
|
|
1
2
|
export { default as CopyableHeader } from './CopyableHeader.svelte';
|
|
2
3
|
export { default as EmptyState } from './EmptyState.svelte';
|
|
3
4
|
export { default as GenerateLoader } from './GenerateLoader.svelte';
|
|
4
5
|
export { default as PasswordInput } from './PasswordInput.svelte';
|
|
5
6
|
export { default as ThumbHashImage } from './ThumbHashImage.svelte';
|
|
6
7
|
export { default as WScrollArea } from './WScrollArea.svelte';
|
|
7
|
-
export { Composer, type ComposerMessages, type ComposerProps, Message, type MessageMessages, type MessageProps, type MessageRole, ActivityRow, type ActivityRowProps, type ActivityRowStatus, OptionRow, type OptionRowProps, type OptionRowSelectionMode, TaskRow, type TaskRowProps, type TaskRowStatus, ScrollToBottom, type ScrollToBottomProps, canSendText, clampTextareaHeight, shouldSendOnKeyDown, ChatHeader, PlanCard, QuestionCard, canSubmitQuestion, formatQuestionStep, isFirstQuestion, isLastQuestion, moveFocusedIndex, optionItemRole, primaryQuestionLabel, selectionRole, toggleOption, SuggestionCard } from './chat';
|
|
8
|
-
export { CreatorBar, CanvasBoardStatusChip } from './creator';
|
|
9
|
-
export type { CanvasBoardStatusChipVariant } from './creator';
|
|
8
|
+
export { Composer, type ComposerCompletion, type ComposerEditing, type ComposerMessages, type ComposerProps, type ComposerReferenceMessages, type ComposerReferences, type ComposerSendOptions, assignReferenceLabel, genericLabelNumber, isValidReferenceLabel, referenceOccurrences, removeTokensOfLabel, unbadgeTokensWithoutFiles, type CollectedReference, type ReferenceHoverEvent, type ReferenceItem, QueueCard, type QueueCardItem, type QueueCardMessages, type QueueCardProps, queueRowMode, type QueueRowMode, Message, type MessageMessages, type MessageProps, type MessageRole, ChatAlertCard, type ChatAlertCardProps, ActivityRow, type ActivityRowProps, type ActivityRowStatus, OptionRow, type OptionRowProps, type OptionRowSelectionMode, TaskRow, type TaskRowProps, type TaskRowStatus, ScrollToBottom, type ScrollToBottomProps, canSendText, clampTextareaHeight, composerPrimaryAction, enterKeyAction, isQueueableText, shouldSendOnKeyDown, type ComposerPrimaryAction, type ComposerPrimaryState, ChatHeader, PlanCard, QuestionCard, QuestionCardSummary, type QuestionCardSummaryMessages, areAllQuestionsSkipped, canAdvanceQuestion, canStepBack, canStepForward, canSubmitQuestion, collectQuestionSelections, formatQuestionStep, isFirstQuestion, isLastQuestion, isQuestionSkipped, moveFocusedIndex, optionItemRole, primaryQuestionLabel, questionCardTitle, selectionRole, showsQuestionPager, stepQuestionIndex, toggleOption, type QuestionSummaryItem, SuggestionCard, MessageRatingActions, MessageCheckpointRow, shouldShowConsoleButton, shouldShowPinButton, shouldRenderMessageRatingBar, shouldShowCopyAction, shouldShowRatingActions, shouldShowRegenerateAction, thumbIsPressed, type VersionThumb, selectedModelLabel, shouldShowComposerModelMenu, type ComposerModelOption } from './chat';
|
|
10
9
|
export { ColorPicker, type ColorPickerMessages, type ColorPickerProps, normalizeHex, hexToHsv, hsvToHex, type Hsv } from './color-picker';
|
|
11
|
-
export {
|
|
12
|
-
export { default as HintTooltip } from './tooltip/HintTooltip.svelte';
|
|
10
|
+
export { CreatorBar, CanvasBoardStatusChip, type CanvasBoardStatusChipVariant } from './creator';
|
|
13
11
|
export { default as DebugGrid } from './debug-grid/DebugGrid.svelte';
|
|
12
|
+
export { FilterByButton, type FilterByOption, SortDirectionButton, type SortDirection } from './filters';
|
|
14
13
|
export { FontPicker, type FontPickerMessages, type FontPickerProps, filterFonts, fontFamilyCss, type FontPickerFont } from './font-picker';
|
|
15
14
|
export { default as BrowserInputController } from './ic/browser/BrowserInputController.svelte';
|
|
16
15
|
export { default as ActionModal } from './modals/ActionModal.svelte';
|
|
@@ -20,10 +19,11 @@ export { default as Portal } from './modals/Portal.svelte';
|
|
|
20
19
|
export { default as RenameDialog } from './modals/RenameDialog.svelte';
|
|
21
20
|
export { Breadcrumbs, type BreadcrumbsProps } from './navigation';
|
|
22
21
|
export { default as PDFViewer } from './pdf/PDFViewer.svelte';
|
|
23
|
-
export { SearchInput } from './search-input';
|
|
22
|
+
export { SearchInput, readRecentSearches, rememberRecentSearch, clearRecentSearches } from './search-input';
|
|
24
23
|
export { ShadEditor, checkShadEditorMessages, type ShadEditorMessageKey, type TipTapEditor, type TipTapEditorLevel } from './shad-editor';
|
|
25
24
|
export { NavRow, navRowVariants, NavSectionLabel, ProfileRow, profileRowVariants, Sidebar, WidgetRow, widgetRowVariants, PageHeader, TopBar, NavDrawer, AppShell, ErrorState, defaultErrorStateMessages, type ErrorStateMessages, NotificationRow, type NotificationRowProps, NotificationDetail, type NotificationDetailProps, SettingsNav, type SettingsNavProps, SettingsDialog, type SettingsDialogProps, Stat, type StatProps, statVariants, Banner, type BannerProps, type BannerTone, bannerVariants, Link, type LinkProps, type LinkSize, linkVariants, type SettingsNavGroup, type SettingsNavItem, settingsNavItemIsActive, externalLinkAttributes, statHintClass, type StatTone } from './shell';
|
|
26
25
|
export { ToasterModal, showToast } from './toast';
|
|
26
|
+
export { default as HintTooltip } from './tooltip/HintTooltip.svelte';
|
|
27
27
|
export * as Accordion from './ui/accordion';
|
|
28
28
|
export * as Alert from './ui/alert';
|
|
29
29
|
export { avatarInitials, avatarVariants, type AvatarSize, Avatar } from './ui/avatar';
|
|
@@ -45,6 +45,7 @@ export { IconButton, iconButtonVariants, type IconButtonProps, type IconButtonSi
|
|
|
45
45
|
export { Input } from './ui/input';
|
|
46
46
|
export * as InputOtp from './ui/input-otp';
|
|
47
47
|
export { Label } from './ui/label';
|
|
48
|
+
export { NumberControls } from './ui/number-controls';
|
|
48
49
|
export * as Popover from './ui/popover';
|
|
49
50
|
export { Progress } from './ui/progress';
|
|
50
51
|
export * as RadioGroup from './ui/radio-group';
|
|
@@ -56,11 +57,11 @@ export { Skeleton } from './ui/skeleton';
|
|
|
56
57
|
export { Slider, type SliderProps } from './ui/slider';
|
|
57
58
|
export { Toaster, toast } from './ui/sonner';
|
|
58
59
|
export { StepperButton } from './ui/stepper-button';
|
|
59
|
-
export { NumberStepper } from './ui/number-stepper';
|
|
60
60
|
export { Switch } from './ui/switch';
|
|
61
61
|
export * as Table from './ui/table';
|
|
62
62
|
export * as Tabs from './ui/tabs';
|
|
63
63
|
export { Tag } from './ui/tag';
|
|
64
|
+
export { TextFlip } from './ui/text-flip';
|
|
64
65
|
export { Textarea, type TextareaEvents, type FormTextareaEvent } from './ui/textarea';
|
|
65
66
|
export { toggleVariants, type ToggleSize, type ToggleVariant, type ToggleVariants, Toggle } from './ui/toggle';
|
|
66
67
|
export * as ToggleGroup from './ui/toggle-group';
|
package/dist/components/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// Component exports
|
|
2
|
+
export { default as ContentRefreshOverlay } from './ContentRefreshOverlay.svelte';
|
|
2
3
|
export { default as CopyableHeader } from './CopyableHeader.svelte';
|
|
3
4
|
export { default as EmptyState } from './EmptyState.svelte';
|
|
4
5
|
export { default as GenerateLoader } from './GenerateLoader.svelte';
|
|
5
6
|
export { default as PasswordInput } from './PasswordInput.svelte';
|
|
6
7
|
export { default as ThumbHashImage } from './ThumbHashImage.svelte';
|
|
7
8
|
export { default as WScrollArea } from './WScrollArea.svelte';
|
|
8
|
-
export { Composer, Message, ActivityRow, OptionRow, TaskRow, ScrollToBottom, canSendText, clampTextareaHeight, shouldSendOnKeyDown, ChatHeader, PlanCard, QuestionCard, canSubmitQuestion, formatQuestionStep, isFirstQuestion, isLastQuestion, moveFocusedIndex, optionItemRole, primaryQuestionLabel, selectionRole, toggleOption, SuggestionCard } from './chat';
|
|
9
|
-
export { CreatorBar, CanvasBoardStatusChip } from './creator';
|
|
9
|
+
export { Composer, assignReferenceLabel, genericLabelNumber, isValidReferenceLabel, referenceOccurrences, removeTokensOfLabel, unbadgeTokensWithoutFiles, QueueCard, queueRowMode, Message, ChatAlertCard, ActivityRow, OptionRow, TaskRow, ScrollToBottom, canSendText, clampTextareaHeight, composerPrimaryAction, enterKeyAction, isQueueableText, shouldSendOnKeyDown, ChatHeader, PlanCard, QuestionCard, QuestionCardSummary, areAllQuestionsSkipped, canAdvanceQuestion, canStepBack, canStepForward, canSubmitQuestion, collectQuestionSelections, formatQuestionStep, isFirstQuestion, isLastQuestion, isQuestionSkipped, moveFocusedIndex, optionItemRole, primaryQuestionLabel, questionCardTitle, selectionRole, showsQuestionPager, stepQuestionIndex, toggleOption, SuggestionCard, MessageRatingActions, MessageCheckpointRow, shouldShowConsoleButton, shouldShowPinButton, shouldRenderMessageRatingBar, shouldShowCopyAction, shouldShowRatingActions, shouldShowRegenerateAction, thumbIsPressed, selectedModelLabel, shouldShowComposerModelMenu } from './chat';
|
|
10
10
|
export { ColorPicker, normalizeHex, hexToHsv, hsvToHex } from './color-picker';
|
|
11
|
-
export {
|
|
12
|
-
export { default as HintTooltip } from './tooltip/HintTooltip.svelte';
|
|
11
|
+
export { CreatorBar, CanvasBoardStatusChip } from './creator';
|
|
13
12
|
export { default as DebugGrid } from './debug-grid/DebugGrid.svelte';
|
|
13
|
+
export { FilterByButton, SortDirectionButton } from './filters';
|
|
14
14
|
export { FontPicker, filterFonts, fontFamilyCss } from './font-picker';
|
|
15
15
|
export { default as BrowserInputController } from './ic/browser/BrowserInputController.svelte';
|
|
16
16
|
export { default as ActionModal } from './modals/ActionModal.svelte';
|
|
@@ -20,10 +20,11 @@ export { default as Portal } from './modals/Portal.svelte';
|
|
|
20
20
|
export { default as RenameDialog } from './modals/RenameDialog.svelte';
|
|
21
21
|
export { Breadcrumbs } from './navigation';
|
|
22
22
|
export { default as PDFViewer } from './pdf/PDFViewer.svelte';
|
|
23
|
-
export { SearchInput } from './search-input';
|
|
23
|
+
export { SearchInput, readRecentSearches, rememberRecentSearch, clearRecentSearches } from './search-input';
|
|
24
24
|
export { ShadEditor, checkShadEditorMessages } from './shad-editor';
|
|
25
25
|
export { NavRow, navRowVariants, NavSectionLabel, ProfileRow, profileRowVariants, Sidebar, WidgetRow, widgetRowVariants, PageHeader, TopBar, NavDrawer, AppShell, ErrorState, defaultErrorStateMessages, NotificationRow, NotificationDetail, SettingsNav, SettingsDialog, Stat, statVariants, Banner, bannerVariants, Link, linkVariants, settingsNavItemIsActive, externalLinkAttributes, statHintClass } from './shell';
|
|
26
26
|
export { ToasterModal, showToast } from './toast';
|
|
27
|
+
export { default as HintTooltip } from './tooltip/HintTooltip.svelte';
|
|
27
28
|
export * as Accordion from './ui/accordion';
|
|
28
29
|
export * as Alert from './ui/alert';
|
|
29
30
|
export { avatarInitials, avatarVariants, Avatar } from './ui/avatar';
|
|
@@ -45,6 +46,7 @@ export { IconButton, iconButtonVariants } from './ui/icon-button';
|
|
|
45
46
|
export { Input } from './ui/input';
|
|
46
47
|
export * as InputOtp from './ui/input-otp';
|
|
47
48
|
export { Label } from './ui/label';
|
|
49
|
+
export { NumberControls } from './ui/number-controls';
|
|
48
50
|
export * as Popover from './ui/popover';
|
|
49
51
|
export { Progress } from './ui/progress';
|
|
50
52
|
export * as RadioGroup from './ui/radio-group';
|
|
@@ -56,11 +58,11 @@ export { Skeleton } from './ui/skeleton';
|
|
|
56
58
|
export { Slider } from './ui/slider';
|
|
57
59
|
export { Toaster, toast } from './ui/sonner';
|
|
58
60
|
export { StepperButton } from './ui/stepper-button';
|
|
59
|
-
export { NumberStepper } from './ui/number-stepper';
|
|
60
61
|
export { Switch } from './ui/switch';
|
|
61
62
|
export * as Table from './ui/table';
|
|
62
63
|
export * as Tabs from './ui/tabs';
|
|
63
64
|
export { Tag } from './ui/tag';
|
|
65
|
+
export { TextFlip } from './ui/text-flip';
|
|
64
66
|
export { Textarea } from './ui/textarea';
|
|
65
67
|
export { toggleVariants, Toggle } from './ui/toggle';
|
|
66
68
|
export * as ToggleGroup from './ui/toggle-group';
|
|
@@ -33,6 +33,8 @@
|
|
|
33
33
|
} from '../../utils/overlayMotion.js';
|
|
34
34
|
// A scrim drawn over another scrim only dims (the page is blurred once): see overlayStacking.ts.
|
|
35
35
|
import { stackedScrimMark } from '../../utils/overlayStacking.js';
|
|
36
|
+
// Enter inside the card presses the modal's main button (see utils/modalEnterKey.ts).
|
|
37
|
+
import { modalEnterKey } from '../../utils/modalEnterKey.js';
|
|
36
38
|
|
|
37
39
|
/* COMPONENT PROPS */
|
|
38
40
|
// class and style props
|
|
@@ -68,6 +70,12 @@
|
|
|
68
70
|
export let closeOnBackdropClick = true;
|
|
69
71
|
/** When false, Escape does not close. Default: Escape dismisses unless a nested control already handled the key. */
|
|
70
72
|
export let closeOnEscape = true;
|
|
73
|
+
/**
|
|
74
|
+
* When true (default), Enter inside the card presses the modal's main button: the last filled `Button` (or the one marked
|
|
75
|
+
* `data-modal-primary`), unless the control that has the focus keeps Enter for itself. See utils/modalEnterKey.ts.
|
|
76
|
+
* A modal that wants every Enter for its own content passes false.
|
|
77
|
+
*/
|
|
78
|
+
export let enterActivatesPrimary = true;
|
|
71
79
|
/** Spoken name of the dialog when there is no visible title row (a bare modal should pass one, for example the file's name). */
|
|
72
80
|
export let ariaLabel: string | undefined = undefined;
|
|
73
81
|
|
|
@@ -103,15 +111,25 @@
|
|
|
103
111
|
$: cardChromeHeight = 2 * CARD_BORDER + (bare ? 0 : 2 * CARD_PADDING);
|
|
104
112
|
// The title row (a bare modal has none) and the gap under it: 8px for a small title padding, 16px for a large one.
|
|
105
113
|
$: titleRowHeight = bare ? 0 : titleHeight + (titlePadding === 'small' ? 8 : 16);
|
|
106
|
-
|
|
107
|
-
$:
|
|
114
|
+
/** When callers pass an exact pixel height (Figma-sized action modals), use it instead of measured content (+2px from line metrics). */
|
|
115
|
+
$: fixedOuterHeightPx = (() => {
|
|
116
|
+
if (animateSize) return null;
|
|
117
|
+
const match = /^(\d+(?:\.\d+)?)px\s*$/.exec(height.trim());
|
|
118
|
+
return match ? Number(match[1]) : null;
|
|
119
|
+
})();
|
|
120
|
+
// The card is exactly as tall as its content, the title row and what the card draws around them — unless height is fixed.
|
|
121
|
+
$: measuredOuterHeight = cardChromeHeight + titleRowHeight + contentHolderHeight;
|
|
122
|
+
$: allContentHeight = fixedOuterHeightPx ?? measuredOuterHeight;
|
|
108
123
|
|
|
109
124
|
// Title vars
|
|
110
125
|
let titleHeight = 0;
|
|
111
126
|
|
|
112
127
|
// Content only vars
|
|
113
128
|
let contentHolderHeight = 0;
|
|
114
|
-
$: contentAvailableHeight = Math.max(
|
|
129
|
+
$: contentAvailableHeight = Math.max(
|
|
130
|
+
0,
|
|
131
|
+
(fixedOuterHeightPx ?? modalHeight) - cardChromeHeight - titleRowHeight
|
|
132
|
+
);
|
|
115
133
|
let updateContentDimInterval: any;
|
|
116
134
|
|
|
117
135
|
/** Stays true until exit transitions finish or the instance is destroyed. */
|
|
@@ -441,13 +459,14 @@
|
|
|
441
459
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
442
460
|
<div
|
|
443
461
|
bind:this={modalPanelEl}
|
|
462
|
+
use:modalEnterKey={{ enabled: enterActivatesPrimary && open }}
|
|
444
463
|
role="dialog"
|
|
445
464
|
aria-modal="true"
|
|
446
465
|
aria-labelledby={title ? titleElementId : undefined}
|
|
447
466
|
aria-label={title ? undefined : ariaLabel}
|
|
448
467
|
tabindex="-1"
|
|
449
468
|
data-widgetic-overlay="base-modal-panel"
|
|
450
|
-
class="modal-content-inner-container bg-background border-border rounded-panel pointer-events-auto relative max-h-[calc(100vh-3rem)] select-text overflow-hidden border outline-none {bare
|
|
469
|
+
class="modal-content-inner-container box-border bg-background border-border rounded-panel pointer-events-auto relative max-h-[calc(100vh-3rem)] select-text overflow-hidden border outline-none {bare
|
|
451
470
|
? 'p-0'
|
|
452
471
|
: 'p-6'}"
|
|
453
472
|
style="
|
|
@@ -31,6 +31,11 @@ declare const BaseModal: $$__sveltets_2_IsomorphicComponent<{
|
|
|
31
31
|
bare?: boolean;
|
|
32
32
|
/** When false, clicks and taps on the scrim do not close (destructive confirms can set this). Default matches Figma: scrim dismisses. */ closeOnBackdropClick?: boolean;
|
|
33
33
|
/** When false, Escape does not close. Default: Escape dismisses unless a nested control already handled the key. */ closeOnEscape?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* When true (default), Enter inside the card presses the modal's main button: the last filled `Button` (or the one marked
|
|
36
|
+
* `data-modal-primary`), unless the control that has the focus keeps Enter for itself. See utils/modalEnterKey.ts.
|
|
37
|
+
* A modal that wants every Enter for its own content passes false.
|
|
38
|
+
*/ enterActivatesPrimary?: boolean;
|
|
34
39
|
/** Spoken name of the dialog when there is no visible title row (a bare modal should pass one, for example the file's name). */ ariaLabel?: string | undefined;
|
|
35
40
|
children: any;
|
|
36
41
|
}, {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* The crumb that appears when a folder is entered slides in a little, from the side the path starts on,
|
|
3
3
|
* the way a panel slides into a screen. It is the one to click to go back, so it should be noticed.
|
|
4
4
|
*/
|
|
5
|
+
import { prefersReducedMotion } from '../../utils/reducedMotion.ts';
|
|
5
6
|
/** How far the crumb starts from its place, in px. "Just a bit": it is a nudge, not a ride across the header. */
|
|
6
7
|
export declare const CRUMB_SLIDE_DISTANCE_PX = 16;
|
|
7
8
|
/** Long enough to be seen, short enough to stay out of the way (the overlays of the system use 200ms). */
|
|
@@ -13,8 +14,11 @@ export type CrumbSlideParams = {
|
|
|
13
14
|
/** Called once the slide was started, so the page can forget it (a later redraw must not play it again). */
|
|
14
15
|
onPlayed?: () => void;
|
|
15
16
|
};
|
|
16
|
-
/**
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* True when the person asked their system for less motion. The question is answered in one place, `utils/reducedMotion.ts`; it is
|
|
19
|
+
* still exported from here, where it has always been asked from.
|
|
20
|
+
*/
|
|
21
|
+
export { prefersReducedMotion };
|
|
18
22
|
/** The keyframes of the slide: from the start side of the path (left in English, right in Arabic) to the place. */
|
|
19
23
|
export declare function crumbSlideKeyframes(direction: 'ltr' | 'rtl'): Keyframe[];
|
|
20
24
|
/** Svelte action: slide the crumb in when `play` is true and motion is allowed. */
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
* The crumb that appears when a folder is entered slides in a little, from the side the path starts on,
|
|
3
3
|
* the way a panel slides into a screen. It is the one to click to go back, so it should be noticed.
|
|
4
4
|
*/
|
|
5
|
+
import { prefersReducedMotion } from "../../utils/reducedMotion.js";
|
|
5
6
|
/** How far the crumb starts from its place, in px. "Just a bit": it is a nudge, not a ride across the header. */
|
|
6
7
|
export const CRUMB_SLIDE_DISTANCE_PX = 16;
|
|
7
8
|
/** Long enough to be seen, short enough to stay out of the way (the overlays of the system use 200ms). */
|
|
8
9
|
export const CRUMB_SLIDE_DURATION_MS = 280;
|
|
9
10
|
export const CRUMB_SLIDE_EASING = 'cubic-bezier(0.2, 0.7, 0.2, 1)';
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
11
|
+
/**
|
|
12
|
+
* True when the person asked their system for less motion. The question is answered in one place, `utils/reducedMotion.ts`; it is
|
|
13
|
+
* still exported from here, where it has always been asked from.
|
|
14
|
+
*/
|
|
15
|
+
export { prefersReducedMotion };
|
|
16
16
|
/** The keyframes of the slide: from the start side of the path (left in English, right in Arabic) to the place. */
|
|
17
17
|
export function crumbSlideKeyframes(direction) {
|
|
18
18
|
const startOffset = direction === 'rtl' ? CRUMB_SLIDE_DISTANCE_PX : -CRUMB_SLIDE_DISTANCE_PX;
|