@keboola/design 3.1.0 → 3.2.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/dist/index.d.cts CHANGED
@@ -103,7 +103,7 @@ declare const Button: ({ ref, children, disabled, className, type, isLoading, as
103
103
  }) => react_jsx_runtime.JSX.Element;
104
104
 
105
105
  declare const buttonInlineVariants: (props?: ({
106
- color?: "muted" | "link" | "danger" | "dark" | "custom" | null | undefined;
106
+ color?: "dark" | "muted" | "link" | "danger" | "custom" | null | undefined;
107
107
  variant?: "link" | "custom" | "link-reverse" | null | undefined;
108
108
  } & class_variance_authority_types.ClassProp) | undefined) => string;
109
109
  type Props$1O = ComponentProps<'button'> & VariantProps<typeof buttonInlineVariants> & {
@@ -10338,6 +10338,17 @@ type Props$2 = {
10338
10338
  };
10339
10339
  declare const SqlEditor: ({ value, onChange, onSelectionChange, onCreateEditor, onDestroyEditor, onBlurEditor, onFocusEditor, placeholder, searchQuery, searchMatchIndex, readOnly, extraKeys, queryParser, autoFocus, lineNumbers, className, schema, variables, defaultDatabase, defaultSchema, highlightLines, dialect, }: Props$2) => react_jsx_runtime.JSX.Element;
10340
10340
 
10341
+ type ColorScheme = 'light' | 'dark' | 'system';
10342
+ type ResolvedMode = 'light' | 'dark';
10343
+ type ThemeContextValue = {
10344
+ brand: Brand;
10345
+ setBrand?: (brand: Brand) => void;
10346
+ /** The configured color scheme (may be `'system'`). */
10347
+ colorScheme: ColorScheme;
10348
+ /** The effective light/dark mode after resolving `'system'`. */
10349
+ resolvedMode: ResolvedMode;
10350
+ };
10351
+
10341
10352
  type Props$1 = {
10342
10353
  /**
10343
10354
  * Brand whose tokens drive the chrome (`@keboola/design`'s semantic CSS
@@ -10351,29 +10362,36 @@ type Props$1 = {
10351
10362
  * brands at runtime (Storybook toolbar, a customer-impersonation switch).
10352
10363
  */
10353
10364
  setBrand?: (brand: Brand) => void;
10365
+ /**
10366
+ * Light/dark mode. `'system'` follows `prefers-color-scheme` and updates
10367
+ * reactively. Defaults to `'light'` so existing mounts don't drift. Only
10368
+ * the ROOT provider applies this (sets `data-theme`, owns the media
10369
+ * listener); a nested provider inherits the root's resolved mode.
10370
+ */
10371
+ colorScheme?: ColorScheme;
10354
10372
  children: ReactNode;
10355
10373
  };
10356
10374
  /**
10357
10375
  * Responsibilities:
10358
10376
  * - Render hidden SVG gradient definitions (`aigradient-600`, `aigradient-700`).
10359
10377
  * - Set `data-brand="<brand.id>"` on `<html>` and inject the matching `--color-*` /
10360
- * `--radius-*` CSS variables so chrome re-skins for the supplied brand.
10361
- * - Expose `{ brand, setBrand? }` via `useTheme()` (throws outside the provider).
10378
+ * `--radius-*` CSS variables (for the resolved light/dark mode) so chrome
10379
+ * re-skins for the supplied brand.
10380
+ * - ROOT only: set `data-theme` (`light` | `dark`) on `<html>` and own the
10381
+ * `prefers-color-scheme` media listener when `colorScheme === 'system'`.
10382
+ * A nested provider inherits the resolved mode from the parent context and
10383
+ * touches neither `data-theme` nor a media listener.
10384
+ * - Expose `{ brand, setBrand?, colorScheme, resolvedMode }` via `useTheme()`.
10362
10385
  *
10363
- * The slots a brand can override today are a subset of the canonical
10364
- * `:root` block in `styles.css`. Slots the brand doesn't define fall back
10365
- * to the `:root` defaults — we deliberately do not write empty strings.
10386
+ * Brand × mode: the active mode's palette is injected inline on `<html>`. When
10387
+ * the resolved mode is `dark` and the brand has no `colorsDark`, the colour
10388
+ * vars are NOT emitted — the stylesheet `[data-theme='dark']` block supplies
10389
+ * them, so no `!important` override is ever needed.
10366
10390
  *
10367
- * `data-brand` (brand id) is intentionally separate from `data-theme`
10368
- * (light/dark mode, defined by the `[data-theme='dark']` block in
10369
- * `styles.css`) so the two axes compose without clobbering each other.
10391
+ * `data-brand` (brand id) and `data-theme` (light/dark) are separate axes so
10392
+ * they compose without clobbering each other.
10370
10393
  */
10371
- declare const ThemeProvider: ({ brand, setBrand, children }: Props$1) => react_jsx_runtime.JSX.Element;
10372
-
10373
- type ThemeContextValue = {
10374
- brand: Brand;
10375
- setBrand?: (brand: Brand) => void;
10376
- };
10394
+ declare const ThemeProvider: ({ brand, setBrand, colorScheme, children, }: Props$1) => react_jsx_runtime.JSX.Element;
10377
10395
 
10378
10396
  /**
10379
10397
  * Read the active brand (and optional setter) from the nearest `<ThemeProvider>`.
@@ -10384,10 +10402,22 @@ type ThemeContextValue = {
10384
10402
  */
10385
10403
  declare const useTheme: () => ThemeContextValue;
10386
10404
 
10405
+ /**
10406
+ * Read the configured color scheme and the effective light/dark mode from the
10407
+ * nearest `<ThemeProvider>`. Read-only — there is no setter (yet).
10408
+ *
10409
+ * Throws if no provider is mounted (mirrors `useTheme()`).
10410
+ */
10411
+ declare const useColorScheme: () => {
10412
+ colorScheme: ColorScheme;
10413
+ resolvedMode: ResolvedMode;
10414
+ };
10415
+
10387
10416
  declare const useIsLegacyBrand: () => boolean;
10388
10417
 
10389
10418
  type Props = {
10390
10419
  brand: Brand;
10420
+ colorScheme?: ColorScheme;
10391
10421
  children: ReactNode;
10392
10422
  };
10393
10423
  /**
@@ -10397,8 +10427,14 @@ type Props = {
10397
10427
  * `resolveStorybookBrand` + `themeToolbarBrands` from `./storybookBrands` to
10398
10428
  * build the toolbar. This is the empirical brand-swap harness UT-4047
10399
10429
  * promised for the layer-0 contract.
10430
+ *
10431
+ * `colorScheme` (driven by the **Mode** toolbar) is forwarded to the provider
10432
+ * so flipping it sets `data-theme` and emits the active mode's palette — the
10433
+ * empirical light/dark switch. The story is rendered on a `bg-background`
10434
+ * surface so the mode is actually visible (otherwise dark-mode text sits on
10435
+ * the unrelated canvas backdrop).
10400
10436
  */
10401
- declare const ThemeDecorator: ({ brand, children }: Props) => react_jsx_runtime.JSX.Element;
10437
+ declare const ThemeDecorator: ({ brand, colorScheme, children }: Props) => react_jsx_runtime.JSX.Element;
10402
10438
 
10403
10439
  /**
10404
10440
  * Default toolbar items shipped with `ThemeDecorator` — the same brand IDs
@@ -10449,4 +10485,4 @@ declare const themeToolbarBrands: {
10449
10485
  */
10450
10486
  declare const resolveStorybookBrand: (id: unknown) => Brand;
10451
10487
 
10452
- export { Alert, AnswerSummary, type AnswerItem as AnswerSummaryItem, type Props$I as AnswerSummaryProps, type Variant$5 as AnswerSummaryVariant, AppShell, AutoSaveTextarea, Avatar, Badge, Breadcrumb, Button, ButtonGroup, ButtonInline, Calendar, type CalendarProps, Card, type ChangeClassification, Checkbox, Clipboard, ClipboardButton, ClipboardInline, CodeEditor, Collapse, Collapsible, CollapsiblePanel, CollapsibleStepHeader, ColorInput, Combobox, Command, CommandGroup, CommandInput, CommandItem, CommandList, ConflictStatusIndicator, DateInput, DatePicker, type DateRange, DateRangeInput, DateRangePicker, type DateRangePreset, type DiffChunk, type DiffInformation, type DiffRow, DiffType, DiffView, DotsLoader, DropdownMenu, EmptyConfigurationActionCard, EmptySearchContent, EmptyState, type RootProps$3 as EmptyStateProps, type Variant$1 as EmptyStateVariant, ErrorState, type RootProps$2 as ErrorStateProps, type Variant as ErrorStateVariant, FileUpload, FormGroup, FullScreenModal, FullScreenModalBody, FullScreenModalHeader, HelpBlock, HoverCard, InlineStepDetail, type Props$G as InlineStepDetailProps, InlineStepLabel, type Props$F as InlineStepLabelProps, type Variant$3 as InlineStepLabelVariant, InputGroup, InputOtp, type RootProps$4 as InputOtpProps, Kbd, Label, type LineInformation, Link, MarkedText, type MergeConflict, MergeEditor, MessageBubble, Modal, MultiActionButtonGroup, MultiCombobox, Navbar, NumberInput, PageHeader, PageLayout, PageToolbar, Pagination, PaneHeader, PanelWithDetails, PasswordInput, PlanApproval, type PlanApprovalProps, type PlanApprovalStatus, PlanRewritingIndicator, type PlanRewritingIndicatorProps, Popconfirm, Popover, Progress, type PromptCommand, PromptInput, type Props$1k as Props, Question, type QuestionAnswers, QuestionBlock, type Props$z as QuestionBlockProps, type QuestionOption, type Props$A as QuestionProps, type QuestionStep, RadioGroup, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Search, SearchForm, SearchInput, SearchInputWithNavigation, Select, type SelectItem, type SelectItemGroup, Separator, type ServerFieldError, Sheet, type SideInformation, Sidebar, type SidebarMode, SidebarProvider, type SidebarSide, Skeleton, SkeletonList, Slider, SplitButton, SqlEditor, type StepStatus, Stepper, type StepperOrientation, SuggestedPrompt, Switch, Table, Tabs, TabsContent, Tagger, TextInput, Textarea, type ThemeContextValue, ThemeDecorator, ThemeProvider, ThinkingIndicator, type ThumbTooltipFn, TimeInput, TimePicker, Timeline, type ToastOptions, Toaster, Toggle, ToggleGroup, Tooltip, type Props$1I as TooltipProps, TooltipProvider, type Trigger, Truncated, type UseAutosizeInputOptions, type UseAutosizeInputReturn, type ValidityState, type WordInformation, ZoomableSvg, argoVariants, cn, computeDiffRows, computeLineInformation, copyToClipboard, isMac, kbdVariants, keys, mergeRefs, resolveStorybookBrand, setServerFieldErrors, themeToolbarBrands, toast, useAppForm, useAutosizeInput, useInputOtpContext, useIsLegacyBrand, useMergeDiff, useNotification, useScrollbarPosition, useSidebar, useTheme, withForm };
10488
+ export { Alert, AnswerSummary, type AnswerItem as AnswerSummaryItem, type Props$I as AnswerSummaryProps, type Variant$5 as AnswerSummaryVariant, AppShell, AutoSaveTextarea, Avatar, Badge, Breadcrumb, Button, ButtonGroup, ButtonInline, Calendar, type CalendarProps, Card, type ChangeClassification, Checkbox, Clipboard, ClipboardButton, ClipboardInline, CodeEditor, Collapse, Collapsible, CollapsiblePanel, CollapsibleStepHeader, ColorInput, type ColorScheme, Combobox, Command, CommandGroup, CommandInput, CommandItem, CommandList, ConflictStatusIndicator, DateInput, DatePicker, type DateRange, DateRangeInput, DateRangePicker, type DateRangePreset, type DiffChunk, type DiffInformation, type DiffRow, DiffType, DiffView, DotsLoader, DropdownMenu, EmptyConfigurationActionCard, EmptySearchContent, EmptyState, type RootProps$3 as EmptyStateProps, type Variant$1 as EmptyStateVariant, ErrorState, type RootProps$2 as ErrorStateProps, type Variant as ErrorStateVariant, FileUpload, FormGroup, FullScreenModal, FullScreenModalBody, FullScreenModalHeader, HelpBlock, HoverCard, InlineStepDetail, type Props$G as InlineStepDetailProps, InlineStepLabel, type Props$F as InlineStepLabelProps, type Variant$3 as InlineStepLabelVariant, InputGroup, InputOtp, type RootProps$4 as InputOtpProps, Kbd, Label, type LineInformation, Link, MarkedText, type MergeConflict, MergeEditor, MessageBubble, Modal, MultiActionButtonGroup, MultiCombobox, Navbar, NumberInput, PageHeader, PageLayout, PageToolbar, Pagination, PaneHeader, PanelWithDetails, PasswordInput, PlanApproval, type PlanApprovalProps, type PlanApprovalStatus, PlanRewritingIndicator, type PlanRewritingIndicatorProps, Popconfirm, Popover, Progress, type PromptCommand, PromptInput, type Props$1k as Props, Question, type QuestionAnswers, QuestionBlock, type Props$z as QuestionBlockProps, type QuestionOption, type Props$A as QuestionProps, type QuestionStep, RadioGroup, ResizableHandle, ResizablePanel, ResizablePanelGroup, type ResolvedMode, ScrollArea, ScrollBar, Search, SearchForm, SearchInput, SearchInputWithNavigation, Select, type SelectItem, type SelectItemGroup, Separator, type ServerFieldError, Sheet, type SideInformation, Sidebar, type SidebarMode, SidebarProvider, type SidebarSide, Skeleton, SkeletonList, Slider, SplitButton, SqlEditor, type StepStatus, Stepper, type StepperOrientation, SuggestedPrompt, Switch, Table, Tabs, TabsContent, Tagger, TextInput, Textarea, type ThemeContextValue, ThemeDecorator, ThemeProvider, ThinkingIndicator, type ThumbTooltipFn, TimeInput, TimePicker, Timeline, type ToastOptions, Toaster, Toggle, ToggleGroup, Tooltip, type Props$1I as TooltipProps, TooltipProvider, type Trigger, Truncated, type UseAutosizeInputOptions, type UseAutosizeInputReturn, type ValidityState, type WordInformation, ZoomableSvg, argoVariants, cn, computeDiffRows, computeLineInformation, copyToClipboard, isMac, kbdVariants, keys, mergeRefs, resolveStorybookBrand, setServerFieldErrors, themeToolbarBrands, toast, useAppForm, useAutosizeInput, useColorScheme, useInputOtpContext, useIsLegacyBrand, useMergeDiff, useNotification, useScrollbarPosition, useSidebar, useTheme, withForm };
package/dist/index.d.ts CHANGED
@@ -103,7 +103,7 @@ declare const Button: ({ ref, children, disabled, className, type, isLoading, as
103
103
  }) => react_jsx_runtime.JSX.Element;
104
104
 
105
105
  declare const buttonInlineVariants: (props?: ({
106
- color?: "muted" | "link" | "danger" | "dark" | "custom" | null | undefined;
106
+ color?: "dark" | "muted" | "link" | "danger" | "custom" | null | undefined;
107
107
  variant?: "link" | "custom" | "link-reverse" | null | undefined;
108
108
  } & class_variance_authority_types.ClassProp) | undefined) => string;
109
109
  type Props$1O = ComponentProps<'button'> & VariantProps<typeof buttonInlineVariants> & {
@@ -10338,6 +10338,17 @@ type Props$2 = {
10338
10338
  };
10339
10339
  declare const SqlEditor: ({ value, onChange, onSelectionChange, onCreateEditor, onDestroyEditor, onBlurEditor, onFocusEditor, placeholder, searchQuery, searchMatchIndex, readOnly, extraKeys, queryParser, autoFocus, lineNumbers, className, schema, variables, defaultDatabase, defaultSchema, highlightLines, dialect, }: Props$2) => react_jsx_runtime.JSX.Element;
10340
10340
 
10341
+ type ColorScheme = 'light' | 'dark' | 'system';
10342
+ type ResolvedMode = 'light' | 'dark';
10343
+ type ThemeContextValue = {
10344
+ brand: Brand;
10345
+ setBrand?: (brand: Brand) => void;
10346
+ /** The configured color scheme (may be `'system'`). */
10347
+ colorScheme: ColorScheme;
10348
+ /** The effective light/dark mode after resolving `'system'`. */
10349
+ resolvedMode: ResolvedMode;
10350
+ };
10351
+
10341
10352
  type Props$1 = {
10342
10353
  /**
10343
10354
  * Brand whose tokens drive the chrome (`@keboola/design`'s semantic CSS
@@ -10351,29 +10362,36 @@ type Props$1 = {
10351
10362
  * brands at runtime (Storybook toolbar, a customer-impersonation switch).
10352
10363
  */
10353
10364
  setBrand?: (brand: Brand) => void;
10365
+ /**
10366
+ * Light/dark mode. `'system'` follows `prefers-color-scheme` and updates
10367
+ * reactively. Defaults to `'light'` so existing mounts don't drift. Only
10368
+ * the ROOT provider applies this (sets `data-theme`, owns the media
10369
+ * listener); a nested provider inherits the root's resolved mode.
10370
+ */
10371
+ colorScheme?: ColorScheme;
10354
10372
  children: ReactNode;
10355
10373
  };
10356
10374
  /**
10357
10375
  * Responsibilities:
10358
10376
  * - Render hidden SVG gradient definitions (`aigradient-600`, `aigradient-700`).
10359
10377
  * - Set `data-brand="<brand.id>"` on `<html>` and inject the matching `--color-*` /
10360
- * `--radius-*` CSS variables so chrome re-skins for the supplied brand.
10361
- * - Expose `{ brand, setBrand? }` via `useTheme()` (throws outside the provider).
10378
+ * `--radius-*` CSS variables (for the resolved light/dark mode) so chrome
10379
+ * re-skins for the supplied brand.
10380
+ * - ROOT only: set `data-theme` (`light` | `dark`) on `<html>` and own the
10381
+ * `prefers-color-scheme` media listener when `colorScheme === 'system'`.
10382
+ * A nested provider inherits the resolved mode from the parent context and
10383
+ * touches neither `data-theme` nor a media listener.
10384
+ * - Expose `{ brand, setBrand?, colorScheme, resolvedMode }` via `useTheme()`.
10362
10385
  *
10363
- * The slots a brand can override today are a subset of the canonical
10364
- * `:root` block in `styles.css`. Slots the brand doesn't define fall back
10365
- * to the `:root` defaults — we deliberately do not write empty strings.
10386
+ * Brand × mode: the active mode's palette is injected inline on `<html>`. When
10387
+ * the resolved mode is `dark` and the brand has no `colorsDark`, the colour
10388
+ * vars are NOT emitted — the stylesheet `[data-theme='dark']` block supplies
10389
+ * them, so no `!important` override is ever needed.
10366
10390
  *
10367
- * `data-brand` (brand id) is intentionally separate from `data-theme`
10368
- * (light/dark mode, defined by the `[data-theme='dark']` block in
10369
- * `styles.css`) so the two axes compose without clobbering each other.
10391
+ * `data-brand` (brand id) and `data-theme` (light/dark) are separate axes so
10392
+ * they compose without clobbering each other.
10370
10393
  */
10371
- declare const ThemeProvider: ({ brand, setBrand, children }: Props$1) => react_jsx_runtime.JSX.Element;
10372
-
10373
- type ThemeContextValue = {
10374
- brand: Brand;
10375
- setBrand?: (brand: Brand) => void;
10376
- };
10394
+ declare const ThemeProvider: ({ brand, setBrand, colorScheme, children, }: Props$1) => react_jsx_runtime.JSX.Element;
10377
10395
 
10378
10396
  /**
10379
10397
  * Read the active brand (and optional setter) from the nearest `<ThemeProvider>`.
@@ -10384,10 +10402,22 @@ type ThemeContextValue = {
10384
10402
  */
10385
10403
  declare const useTheme: () => ThemeContextValue;
10386
10404
 
10405
+ /**
10406
+ * Read the configured color scheme and the effective light/dark mode from the
10407
+ * nearest `<ThemeProvider>`. Read-only — there is no setter (yet).
10408
+ *
10409
+ * Throws if no provider is mounted (mirrors `useTheme()`).
10410
+ */
10411
+ declare const useColorScheme: () => {
10412
+ colorScheme: ColorScheme;
10413
+ resolvedMode: ResolvedMode;
10414
+ };
10415
+
10387
10416
  declare const useIsLegacyBrand: () => boolean;
10388
10417
 
10389
10418
  type Props = {
10390
10419
  brand: Brand;
10420
+ colorScheme?: ColorScheme;
10391
10421
  children: ReactNode;
10392
10422
  };
10393
10423
  /**
@@ -10397,8 +10427,14 @@ type Props = {
10397
10427
  * `resolveStorybookBrand` + `themeToolbarBrands` from `./storybookBrands` to
10398
10428
  * build the toolbar. This is the empirical brand-swap harness UT-4047
10399
10429
  * promised for the layer-0 contract.
10430
+ *
10431
+ * `colorScheme` (driven by the **Mode** toolbar) is forwarded to the provider
10432
+ * so flipping it sets `data-theme` and emits the active mode's palette — the
10433
+ * empirical light/dark switch. The story is rendered on a `bg-background`
10434
+ * surface so the mode is actually visible (otherwise dark-mode text sits on
10435
+ * the unrelated canvas backdrop).
10400
10436
  */
10401
- declare const ThemeDecorator: ({ brand, children }: Props) => react_jsx_runtime.JSX.Element;
10437
+ declare const ThemeDecorator: ({ brand, colorScheme, children }: Props) => react_jsx_runtime.JSX.Element;
10402
10438
 
10403
10439
  /**
10404
10440
  * Default toolbar items shipped with `ThemeDecorator` — the same brand IDs
@@ -10449,4 +10485,4 @@ declare const themeToolbarBrands: {
10449
10485
  */
10450
10486
  declare const resolveStorybookBrand: (id: unknown) => Brand;
10451
10487
 
10452
- export { Alert, AnswerSummary, type AnswerItem as AnswerSummaryItem, type Props$I as AnswerSummaryProps, type Variant$5 as AnswerSummaryVariant, AppShell, AutoSaveTextarea, Avatar, Badge, Breadcrumb, Button, ButtonGroup, ButtonInline, Calendar, type CalendarProps, Card, type ChangeClassification, Checkbox, Clipboard, ClipboardButton, ClipboardInline, CodeEditor, Collapse, Collapsible, CollapsiblePanel, CollapsibleStepHeader, ColorInput, Combobox, Command, CommandGroup, CommandInput, CommandItem, CommandList, ConflictStatusIndicator, DateInput, DatePicker, type DateRange, DateRangeInput, DateRangePicker, type DateRangePreset, type DiffChunk, type DiffInformation, type DiffRow, DiffType, DiffView, DotsLoader, DropdownMenu, EmptyConfigurationActionCard, EmptySearchContent, EmptyState, type RootProps$3 as EmptyStateProps, type Variant$1 as EmptyStateVariant, ErrorState, type RootProps$2 as ErrorStateProps, type Variant as ErrorStateVariant, FileUpload, FormGroup, FullScreenModal, FullScreenModalBody, FullScreenModalHeader, HelpBlock, HoverCard, InlineStepDetail, type Props$G as InlineStepDetailProps, InlineStepLabel, type Props$F as InlineStepLabelProps, type Variant$3 as InlineStepLabelVariant, InputGroup, InputOtp, type RootProps$4 as InputOtpProps, Kbd, Label, type LineInformation, Link, MarkedText, type MergeConflict, MergeEditor, MessageBubble, Modal, MultiActionButtonGroup, MultiCombobox, Navbar, NumberInput, PageHeader, PageLayout, PageToolbar, Pagination, PaneHeader, PanelWithDetails, PasswordInput, PlanApproval, type PlanApprovalProps, type PlanApprovalStatus, PlanRewritingIndicator, type PlanRewritingIndicatorProps, Popconfirm, Popover, Progress, type PromptCommand, PromptInput, type Props$1k as Props, Question, type QuestionAnswers, QuestionBlock, type Props$z as QuestionBlockProps, type QuestionOption, type Props$A as QuestionProps, type QuestionStep, RadioGroup, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Search, SearchForm, SearchInput, SearchInputWithNavigation, Select, type SelectItem, type SelectItemGroup, Separator, type ServerFieldError, Sheet, type SideInformation, Sidebar, type SidebarMode, SidebarProvider, type SidebarSide, Skeleton, SkeletonList, Slider, SplitButton, SqlEditor, type StepStatus, Stepper, type StepperOrientation, SuggestedPrompt, Switch, Table, Tabs, TabsContent, Tagger, TextInput, Textarea, type ThemeContextValue, ThemeDecorator, ThemeProvider, ThinkingIndicator, type ThumbTooltipFn, TimeInput, TimePicker, Timeline, type ToastOptions, Toaster, Toggle, ToggleGroup, Tooltip, type Props$1I as TooltipProps, TooltipProvider, type Trigger, Truncated, type UseAutosizeInputOptions, type UseAutosizeInputReturn, type ValidityState, type WordInformation, ZoomableSvg, argoVariants, cn, computeDiffRows, computeLineInformation, copyToClipboard, isMac, kbdVariants, keys, mergeRefs, resolveStorybookBrand, setServerFieldErrors, themeToolbarBrands, toast, useAppForm, useAutosizeInput, useInputOtpContext, useIsLegacyBrand, useMergeDiff, useNotification, useScrollbarPosition, useSidebar, useTheme, withForm };
10488
+ export { Alert, AnswerSummary, type AnswerItem as AnswerSummaryItem, type Props$I as AnswerSummaryProps, type Variant$5 as AnswerSummaryVariant, AppShell, AutoSaveTextarea, Avatar, Badge, Breadcrumb, Button, ButtonGroup, ButtonInline, Calendar, type CalendarProps, Card, type ChangeClassification, Checkbox, Clipboard, ClipboardButton, ClipboardInline, CodeEditor, Collapse, Collapsible, CollapsiblePanel, CollapsibleStepHeader, ColorInput, type ColorScheme, Combobox, Command, CommandGroup, CommandInput, CommandItem, CommandList, ConflictStatusIndicator, DateInput, DatePicker, type DateRange, DateRangeInput, DateRangePicker, type DateRangePreset, type DiffChunk, type DiffInformation, type DiffRow, DiffType, DiffView, DotsLoader, DropdownMenu, EmptyConfigurationActionCard, EmptySearchContent, EmptyState, type RootProps$3 as EmptyStateProps, type Variant$1 as EmptyStateVariant, ErrorState, type RootProps$2 as ErrorStateProps, type Variant as ErrorStateVariant, FileUpload, FormGroup, FullScreenModal, FullScreenModalBody, FullScreenModalHeader, HelpBlock, HoverCard, InlineStepDetail, type Props$G as InlineStepDetailProps, InlineStepLabel, type Props$F as InlineStepLabelProps, type Variant$3 as InlineStepLabelVariant, InputGroup, InputOtp, type RootProps$4 as InputOtpProps, Kbd, Label, type LineInformation, Link, MarkedText, type MergeConflict, MergeEditor, MessageBubble, Modal, MultiActionButtonGroup, MultiCombobox, Navbar, NumberInput, PageHeader, PageLayout, PageToolbar, Pagination, PaneHeader, PanelWithDetails, PasswordInput, PlanApproval, type PlanApprovalProps, type PlanApprovalStatus, PlanRewritingIndicator, type PlanRewritingIndicatorProps, Popconfirm, Popover, Progress, type PromptCommand, PromptInput, type Props$1k as Props, Question, type QuestionAnswers, QuestionBlock, type Props$z as QuestionBlockProps, type QuestionOption, type Props$A as QuestionProps, type QuestionStep, RadioGroup, ResizableHandle, ResizablePanel, ResizablePanelGroup, type ResolvedMode, ScrollArea, ScrollBar, Search, SearchForm, SearchInput, SearchInputWithNavigation, Select, type SelectItem, type SelectItemGroup, Separator, type ServerFieldError, Sheet, type SideInformation, Sidebar, type SidebarMode, SidebarProvider, type SidebarSide, Skeleton, SkeletonList, Slider, SplitButton, SqlEditor, type StepStatus, Stepper, type StepperOrientation, SuggestedPrompt, Switch, Table, Tabs, TabsContent, Tagger, TextInput, Textarea, type ThemeContextValue, ThemeDecorator, ThemeProvider, ThinkingIndicator, type ThumbTooltipFn, TimeInput, TimePicker, Timeline, type ToastOptions, Toaster, Toggle, ToggleGroup, Tooltip, type Props$1I as TooltipProps, TooltipProvider, type Trigger, Truncated, type UseAutosizeInputOptions, type UseAutosizeInputReturn, type ValidityState, type WordInformation, ZoomableSvg, argoVariants, cn, computeDiffRows, computeLineInformation, copyToClipboard, isMac, kbdVariants, keys, mergeRefs, resolveStorybookBrand, setServerFieldErrors, themeToolbarBrands, toast, useAppForm, useAutosizeInput, useColorScheme, useInputOtpContext, useIsLegacyBrand, useMergeDiff, useNotification, useScrollbarPosition, useSidebar, useTheme, withForm };
package/dist/index.js CHANGED
@@ -5941,7 +5941,16 @@ var BadgeRoot = ({
5941
5941
  className,
5942
5942
  children,
5943
5943
  ...rest
5944
- }) => /* @__PURE__ */ jsx("div", { ...rest, ref, className: cn(badgeRootVariants({ variant, color, className })), children });
5944
+ }) => /* @__PURE__ */ jsx(
5945
+ "div",
5946
+ {
5947
+ ...rest,
5948
+ ref,
5949
+ "data-slot": "badge",
5950
+ className: cn(badgeRootVariants({ variant, color, className })),
5951
+ children
5952
+ }
5953
+ );
5945
5954
  var BadgeInner = ({
5946
5955
  ref,
5947
5956
  // root props
@@ -10277,18 +10286,20 @@ var AIGradientsSvg = () => /* @__PURE__ */ jsx("svg", { width: "0", height: "0",
10277
10286
  ] }) });
10278
10287
 
10279
10288
  // src/components/ThemeProvider/brandToCssVars.ts
10280
- var brandToCssVars = (brand) => {
10281
- const vars = {
10282
- "--color-background": brand.colors.background,
10283
- "--color-foreground": brand.colors.foreground,
10284
- "--color-muted": brand.colors.muted,
10285
- "--color-muted-foreground": brand.colors.mutedForeground,
10286
- "--color-border": brand.colors.border,
10287
- "--color-primary": brand.colors.primary,
10288
- "--color-primary-foreground": brand.colors.primaryForeground,
10289
- "--color-destructive": brand.colors.destructive,
10290
- "--color-destructive-foreground": brand.colors.destructiveForeground
10291
- };
10289
+ var brandToCssVars = (brand, resolvedMode) => {
10290
+ const vars = {};
10291
+ const colors8 = resolvedMode === "dark" ? brand.colorsDark : brand.colors;
10292
+ if (colors8) {
10293
+ vars["--color-background"] = colors8.background;
10294
+ vars["--color-foreground"] = colors8.foreground;
10295
+ vars["--color-muted"] = colors8.muted;
10296
+ vars["--color-muted-foreground"] = colors8.mutedForeground;
10297
+ vars["--color-border"] = colors8.border;
10298
+ vars["--color-primary"] = colors8.primary;
10299
+ vars["--color-primary-foreground"] = colors8.primaryForeground;
10300
+ vars["--color-destructive"] = colors8.destructive;
10301
+ vars["--color-destructive-foreground"] = colors8.destructiveForeground;
10302
+ }
10292
10303
  if (brand.radii) {
10293
10304
  vars["--radius-sm"] = brand.radii.sm;
10294
10305
  vars["--radius-md"] = brand.radii.md;
@@ -10296,12 +10307,50 @@ var brandToCssVars = (brand) => {
10296
10307
  }
10297
10308
  return vars;
10298
10309
  };
10299
- var ThemeProvider = ({ brand = keboola, setBrand, children }) => {
10310
+ var DARK_QUERY = "(prefers-color-scheme: dark)";
10311
+ var systemMode = () => {
10312
+ if (typeof window === "undefined" || typeof window.matchMedia !== "function") return "light";
10313
+ return window.matchMedia(DARK_QUERY).matches ? "dark" : "light";
10314
+ };
10315
+ var ThemeProvider = ({
10316
+ brand = keboola,
10317
+ setBrand,
10318
+ colorScheme = "light",
10319
+ children
10320
+ }) => {
10321
+ const parent = use(ThemeContext);
10322
+ const isRoot = parent === null;
10323
+ const [systemResolved, setSystemResolved] = useState(systemMode);
10324
+ useEffect(() => {
10325
+ if (!isRoot || colorScheme !== "system") return;
10326
+ if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
10327
+ const mql = window.matchMedia(DARK_QUERY);
10328
+ const onChange = (event) => setSystemResolved(event.matches ? "dark" : "light");
10329
+ setSystemResolved(mql.matches ? "dark" : "light");
10330
+ mql.addEventListener("change", onChange);
10331
+ return () => mql.removeEventListener("change", onChange);
10332
+ }, [isRoot, colorScheme]);
10333
+ const ownMode = colorScheme === "system" ? systemResolved : colorScheme;
10334
+ const resolvedMode = isRoot ? ownMode : parent.resolvedMode;
10335
+ useEffect(() => {
10336
+ if (!isRoot || typeof document === "undefined") return;
10337
+ const root = document.documentElement;
10338
+ const previous = root.getAttribute("data-theme");
10339
+ root.setAttribute("data-theme", resolvedMode);
10340
+ return () => {
10341
+ if (root.getAttribute("data-theme") !== resolvedMode) return;
10342
+ if (previous === null) {
10343
+ root.removeAttribute("data-theme");
10344
+ } else {
10345
+ root.setAttribute("data-theme", previous);
10346
+ }
10347
+ };
10348
+ }, [isRoot, resolvedMode]);
10300
10349
  useEffect(() => {
10301
10350
  if (typeof document === "undefined") return;
10302
10351
  const root = document.documentElement;
10303
10352
  const previousBrand = root.getAttribute("data-brand");
10304
- const vars = brandToCssVars(brand);
10353
+ const vars = brandToCssVars(brand, resolvedMode);
10305
10354
  const previousValues = {};
10306
10355
  for (const name of Object.keys(vars)) {
10307
10356
  previousValues[name] = root.style.getPropertyValue(name);
@@ -10327,8 +10376,8 @@ var ThemeProvider = ({ brand = keboola, setBrand, children }) => {
10327
10376
  }
10328
10377
  }
10329
10378
  };
10330
- }, [brand]);
10331
- return /* @__PURE__ */ jsxs(ThemeContext, { value: { brand, setBrand }, children: [
10379
+ }, [brand, resolvedMode]);
10380
+ return /* @__PURE__ */ jsxs(ThemeContext, { value: { brand, setBrand, colorScheme, resolvedMode }, children: [
10332
10381
  /* @__PURE__ */ jsx(AIGradientsSvg, {}),
10333
10382
  children
10334
10383
  ] });
@@ -10342,7 +10391,16 @@ var useTheme = () => {
10342
10391
  }
10343
10392
  return context;
10344
10393
  };
10345
- var ThemeDecorator = ({ brand, children }) => /* @__PURE__ */ jsx(ThemeProvider, { brand, children });
10394
+ var useColorScheme = () => {
10395
+ const context = use(ThemeContext);
10396
+ if (context === null) {
10397
+ throw new Error(
10398
+ "useColorScheme must be used within a <ThemeProvider>. Wrap your app root with <ThemeProvider colorScheme={...}> from @keboola/design."
10399
+ );
10400
+ }
10401
+ return { colorScheme: context.colorScheme, resolvedMode: context.resolvedMode };
10402
+ };
10403
+ var ThemeDecorator = ({ brand, colorScheme = "light", children }) => /* @__PURE__ */ jsx(ThemeProvider, { brand, colorScheme, children: /* @__PURE__ */ jsx("div", { className: "tw-bg-background tw-text-foreground", children }) });
10346
10404
  var themeToolbarBrands = [keboola, keboolaLegacy, exampleCustomer];
10347
10405
  var resolveStorybookBrand = (id) => {
10348
10406
  if (typeof id !== "string") return keboola;
@@ -10598,7 +10656,7 @@ var PageLayout = Object.assign(Root25, {
10598
10656
  // src/blocks/PageHeader/styles.ts
10599
10657
  var titleRowClass = "tw-flex tw-flex-wrap tw-items-center tw-gap-x-3 tw-gap-y-2";
10600
10658
  var titleClass = "tw-m-0 tw-text-3xl tw-font-semibold tw-leading-9 tw-text-foreground tw-break-words";
10601
- var badgesClass = "tw-flex tw-flex-wrap tw-items-center tw-gap-2";
10659
+ var badgesClass = "tw-flex tw-flex-wrap tw-items-center tw-gap-2 [&_[data-slot=badge]]:tw-rounded-full [&_[data-slot=badge]]:tw-normal-case [&_[data-slot=badge]]:tw-tracking-normal [&_[data-slot=badge]]:tw-py-0";
10602
10660
  var descriptionClass = "tw-m-0 tw-max-w-[800px] tw-break-words tw-text-sm tw-leading-5 tw-text-muted-foreground";
10603
10661
  var PageHeaderDetail = ({
10604
10662
  ref,
@@ -13086,7 +13144,7 @@ var TableHead = ({ className, ...props }) => {
13086
13144
  "th",
13087
13145
  {
13088
13146
  className: cn(
13089
- "tw-px-3 tw-py-2 tw-text-left tw-font-medium tw-whitespace-nowrap [&:has([role=checkbox])]:tw-pr-0 [&>[role=checkbox]]:tw-translate-y-[2px]",
13147
+ "tw-px-3 tw-py-2 tw-text-left tw-font-medium tw-whitespace-nowrap [&:has([role=checkbox])]:tw-pr-0 [&>[role=checkbox]]:tw-translate-y-[2px] focus-within:tw-ring-2 focus-within:tw-ring-primary/50",
13090
13148
  className
13091
13149
  ),
13092
13150
  ...props
@@ -13114,7 +13172,17 @@ var TableRow = ({
13114
13172
  ref,
13115
13173
  className,
13116
13174
  ...props
13117
- }) => /* @__PURE__ */ jsx("tr", { ref, className: cn("hover:tw-bg-muted/50", className), ...props });
13175
+ }) => /* @__PURE__ */ jsx(
13176
+ "tr",
13177
+ {
13178
+ ref,
13179
+ className: cn(
13180
+ "hover:tw-bg-muted/50 aria-selected:tw-bg-accent aria-selected:hover:tw-bg-accent",
13181
+ className
13182
+ ),
13183
+ ...props
13184
+ }
13185
+ );
13118
13186
  var Table = ({
13119
13187
  borderCollapsed = true,
13120
13188
  bordered = false,
@@ -16059,6 +16127,6 @@ var SqlEditor = ({
16059
16127
  );
16060
16128
  };
16061
16129
 
16062
- export { Alert, AnswerSummary, AppShell, AutoSaveTextarea, Avatar, Badge, Breadcrumb, Button, ButtonGroup, ButtonInline, Calendar, Card, Checkbox, Clipboard, ClipboardButton, ClipboardInline, CodeEditor, Collapse, Collapsible, CollapsiblePanel, CollapsibleStepHeader, ColorInput, Combobox, Command, CommandGroup, CommandInput, CommandItem, CommandList, ConflictStatusIndicator, DateInput, DatePicker, DateRangeInput, DateRangePicker, DiffType, DiffView, DotsLoader, DropdownMenu, EmptyConfigurationActionCard, EmptySearchContent, EmptyState, ErrorState, FileUpload, FormGroup, FullScreenModal, FullScreenModalBody, FullScreenModalHeader, HelpBlock, HoverCard, InlineStepDetail, InlineStepLabel, InputGroup, InputOtp, Kbd, Label2 as Label, Link, MarkedText, MergeEditor, MessageBubble, Modal, MultiActionButtonGroup, MultiCombobox, Navbar, NumberInput, PageHeader, PageLayout, PageToolbar, Pagination, PaneHeader, PanelWithDetails, PasswordInput, PlanApproval, PlanRewritingIndicator, Popconfirm, Popover, Progress, PromptInput, Question, QuestionBlock, RadioGroup2 as RadioGroup, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Search, SearchForm, SearchInput, SearchInputWithNavigation, Select, Separator2 as Separator, Sheet, Sidebar, SidebarProvider, Skeleton, SkeletonList, Slider, SplitButton, SqlEditor, Stepper, SuggestedPrompt, Switch, Table, Tabs2 as Tabs, TabsContent, Tagger, TextInput, Textarea, ThemeDecorator, ThemeProvider, ThinkingIndicator, TimeInput, TimePicker, Timeline, Toaster, Toggle, ToggleGroup, Tooltip, TooltipProvider, Truncated, ZoomableSvg, argoVariants, cn, computeDiffRows, computeLineInformation, copyToClipboard, isMac, kbdVariants, keys, mergeRefs, resolveStorybookBrand, setServerFieldErrors, themeToolbarBrands, toast, useAppForm, useAutosizeInput, useInputOtpContext, useIsLegacyBrand, useMergeDiff, useNotification, useScrollbarPosition, useSidebar, useTheme, withForm };
16130
+ export { Alert, AnswerSummary, AppShell, AutoSaveTextarea, Avatar, Badge, Breadcrumb, Button, ButtonGroup, ButtonInline, Calendar, Card, Checkbox, Clipboard, ClipboardButton, ClipboardInline, CodeEditor, Collapse, Collapsible, CollapsiblePanel, CollapsibleStepHeader, ColorInput, Combobox, Command, CommandGroup, CommandInput, CommandItem, CommandList, ConflictStatusIndicator, DateInput, DatePicker, DateRangeInput, DateRangePicker, DiffType, DiffView, DotsLoader, DropdownMenu, EmptyConfigurationActionCard, EmptySearchContent, EmptyState, ErrorState, FileUpload, FormGroup, FullScreenModal, FullScreenModalBody, FullScreenModalHeader, HelpBlock, HoverCard, InlineStepDetail, InlineStepLabel, InputGroup, InputOtp, Kbd, Label2 as Label, Link, MarkedText, MergeEditor, MessageBubble, Modal, MultiActionButtonGroup, MultiCombobox, Navbar, NumberInput, PageHeader, PageLayout, PageToolbar, Pagination, PaneHeader, PanelWithDetails, PasswordInput, PlanApproval, PlanRewritingIndicator, Popconfirm, Popover, Progress, PromptInput, Question, QuestionBlock, RadioGroup2 as RadioGroup, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Search, SearchForm, SearchInput, SearchInputWithNavigation, Select, Separator2 as Separator, Sheet, Sidebar, SidebarProvider, Skeleton, SkeletonList, Slider, SplitButton, SqlEditor, Stepper, SuggestedPrompt, Switch, Table, Tabs2 as Tabs, TabsContent, Tagger, TextInput, Textarea, ThemeDecorator, ThemeProvider, ThinkingIndicator, TimeInput, TimePicker, Timeline, Toaster, Toggle, ToggleGroup, Tooltip, TooltipProvider, Truncated, ZoomableSvg, argoVariants, cn, computeDiffRows, computeLineInformation, copyToClipboard, isMac, kbdVariants, keys, mergeRefs, resolveStorybookBrand, setServerFieldErrors, themeToolbarBrands, toast, useAppForm, useAutosizeInput, useColorScheme, useInputOtpContext, useIsLegacyBrand, useMergeDiff, useNotification, useScrollbarPosition, useSidebar, useTheme, withForm };
16063
16131
  //# sourceMappingURL=index.js.map
16064
16132
  //# sourceMappingURL=index.js.map