@lapismd/design-core 0.1.0 → 0.1.2

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.
Files changed (67) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +1 -1
  3. package/package.json +12 -8
  4. package/spec/src/styling-and-themes.md +9 -9
  5. package/src/shared/ai/chat.css +2 -1
  6. package/src/shared/ai/composer-input/ComposerInput.svelte +3 -2
  7. package/src/shared/ai/experimental/reaction-bar/ReactionBar.svelte +1 -1
  8. package/src/shared/ai/tool-calls/ToolCalls.svelte +1 -1
  9. package/src/shared/ai/trigger-menu.ts +2 -3
  10. package/src/shared/diff/file-diff/FileDiff.svelte +5 -8
  11. package/src/shared/diff/file-listing/FileListingViewModeToggle.css +42 -5
  12. package/src/shared/diff/merge-editor/MergeEditor.svelte +2 -7
  13. package/src/shared/filter/filter-query/filters.ts +2 -2
  14. package/src/shared/filter/filter-query/parser.ts +9 -8
  15. package/src/shared/filter/power-search/PowerSearch.svelte +1 -1
  16. package/src/shared/filter/search-filter-bar/SearchFilterBar.svelte +2 -2
  17. package/src/shared/filter/search-filter-bar/SearchFilterInput.svelte +1 -1
  18. package/src/shared/filter/search-filter-bar/SearchFilterPredicateEditor.svelte +1 -1
  19. package/src/shared/filter/search-filter-bar/search-filter-syntax.ts +1 -1
  20. package/src/shared/forms/autocomplete-input/AutocompleteInput.svelte +19 -7
  21. package/src/shared/shadcn/command/command-dialog.svelte +1 -1
  22. package/src/shared/shadcn/command/command-group.svelte +3 -1
  23. package/src/shared/shadcn/command-view/command-view.svelte +1 -6
  24. package/src/shared/shadcn/dropdown-menu/dropdown-menu-checkbox-item.svelte +0 -691
  25. package/src/shared/shadcn/dropdown-menu/dropdown-menu-content.svelte +691 -0
  26. package/src/shared/shadcn/dropdown-menu/dropdown-menu-radio-group.svelte +1 -1
  27. package/src/shared/shadcn/scroll-area/scroll-area.svelte +2 -0
  28. package/src/shared/shadcn/spinner/spinner.svelte +3 -3
  29. package/src/shared/shell/app-shell/AppShell.demo.css +37 -0
  30. package/src/shared/shell/app-shell/AppShellBodyContent.svelte +5 -1
  31. package/src/shared/shell/app-shell/AppShellBodySidebar.svelte +5 -1
  32. package/src/shared/shell/app-shell/AppShellMobilePanelSelector.svelte +1 -1
  33. package/src/shared/shell/app-shell/app-shell-controller.svelte.ts +23 -9
  34. package/src/shared/shell/app-shell/examples/AppShellBodyDemo.svelte +4 -0
  35. package/src/shared/shell/app-shell/examples/AppShellCompleteDemo.svelte +1 -0
  36. package/src/shared/shell/app-shell/examples/AppShellConversationDemo.svelte +1 -0
  37. package/src/shared/shell/app-shell/examples/AppShellExamples.css +521 -0
  38. package/src/shared/shell/app-shell/examples/AppShellFilesSidebarDemo.svelte +1 -0
  39. package/src/shared/shell/app-shell/examples/AppShellMarkdownDocumentDemo.svelte +6 -1
  40. package/src/shared/shell/app-shell/examples/AppShellMarkdownFilesDemo.svelte +1 -0
  41. package/src/shared/shell/app-shell/examples/AppShellModeSwitchDemo.svelte +1 -0
  42. package/src/shared/shell/app-shell/examples/AppShellProjectSidebarDemo.svelte +1 -0
  43. package/src/shared/shell/app-shell/examples/AppShellSidebarDemo.svelte +1 -0
  44. package/src/shared/shell/app-shell/examples/AppShellToolbarDemo.svelte +1 -0
  45. package/src/shared/workspace/menu/WorkspaceContextMenuItems.svelte +2 -1
  46. package/src/shared/workspace/menu/WorkspaceMenuItems.svelte +2 -1
  47. package/src/shared/workspace/problems/ProblemsQuickFix.svelte +1 -4
  48. package/src/shared/workspace/settings/AppSettingsContent.svelte +6 -0
  49. package/src/shared/workspace/settings/AppSettingsNavigation.svelte +7 -0
  50. package/src/shared/workspace/settings/CopyableValue.svelte +81 -0
  51. package/src/shared/workspace/settings/DeclarativeSettingsSection.svelte +20 -0
  52. package/src/shared/workspace/settings/WorkspaceSettingField.svelte +110 -41
  53. package/src/shared/workspace/settings/WorkspaceSettingMultiSelect.svelte +7 -6
  54. package/src/shared/workspace/settings/WorkspaceSettingObjectTable.svelte +187 -23
  55. package/src/shared/workspace/settings/WorkspaceSettingSelect.svelte +29 -29
  56. package/src/shared/workspace/settings/WorkspaceSettings.css +190 -4
  57. package/src/shared/workspace/settings/WorkspaceSettingsStoryCustomField.svelte +2 -2
  58. package/src/shared/workspace/settings/WorkspaceSettingsStoryCustomPage.svelte +13 -0
  59. package/src/shared/workspace/settings/WorkspaceSettingsSurface.svelte +50 -0
  60. package/src/shared/workspace/settings/configuration.ts +5 -0
  61. package/src/shared/workspace/settings/copyable-value.ts +10 -0
  62. package/src/shared/workspace/settings/index.ts +5 -0
  63. package/src/shared/workspace/settings/settings-controller.svelte.ts +349 -15
  64. package/src/shared/workspace/settings/types.ts +90 -8
  65. package/src/storybook/app-shell-reference/AppShellTwoExpandedSidebarsReference.css +25 -0
  66. package/src/storybook/app-shell-reference/AppShellTwoExpandedSidebarsReference.svelte +48 -0
  67. package/src/storybook/app-shell-reference/index.ts +1 -0
@@ -3,7 +3,7 @@
3
3
 
4
4
  let {
5
5
  ref = $bindable(null),
6
- value = $bindable(),
6
+ value = $bindable(""),
7
7
  ...restProps
8
8
  }: DropdownMenuPrimitive.RadioGroupProps = $props();
9
9
  </script>
@@ -292,6 +292,7 @@
292
292
  width: 0.25rem;
293
293
  flex: 0 0 0.25rem;
294
294
  margin-inline-start: auto;
295
+ margin-inline-end: 1px;
295
296
  }
296
297
 
297
298
  [data-ui-component="scroll-area"][data-ui-part="scroll-area-scrollbar"][data-orientation="vertical"]
@@ -308,6 +309,7 @@
308
309
  height: 0.25rem;
309
310
  flex: 0 0 0.25rem;
310
311
  margin-block-start: auto;
312
+ margin-block-end: 1px;
311
313
  }
312
314
 
313
315
  [data-ui-component="scroll-area"][data-ui-part="scroll-area-scrollbar"][data-orientation="horizontal"]
@@ -18,9 +18,9 @@
18
18
  <Loader2Icon
19
19
  {...omitDataUiComponent(restProps)}
20
20
  {role}
21
- name={name === null ? undefined : name}
22
- color={color === null ? undefined : color}
23
- stroke={stroke === null ? undefined : stroke}
21
+ {...name == null ? {} : { name }}
22
+ {...color == null ? {} : { color }}
23
+ {...stroke == null ? {} : { stroke }}
24
24
  aria-label={ariaLabel}
25
25
  data-ui-component="spinner"
26
26
  class={className}
@@ -0,0 +1,37 @@
1
+ /* Story-only viewport variants. Shell and example presentation styles live
2
+ with the components that own them. */
3
+ .ui-shell-story-frame-fluid {
4
+ box-sizing: border-box;
5
+ width: 100%;
6
+ min-width: 0;
7
+ max-width: none;
8
+ }
9
+
10
+ .ui-shell-story-frame-fluid:has([data-display-mode="mobile"]) {
11
+ padding-block: 0;
12
+ }
13
+
14
+ .ui-shell-story-frame-tablet,
15
+ .ui-shell-story-frame-mobile {
16
+ width: 100%;
17
+ min-width: 0;
18
+ margin-inline: auto;
19
+ padding-block: 0;
20
+ }
21
+
22
+ .ui-shell-story-frame-tablet {
23
+ max-width: 56rem;
24
+ }
25
+
26
+ .ui-shell-story-frame-mobile {
27
+ max-width: 30rem;
28
+ padding-inline: 0.5rem;
29
+ }
30
+
31
+ .ui-shell-story-frame-constrained-desktop {
32
+ box-sizing: border-box;
33
+ width: 100%;
34
+ min-width: 0;
35
+ max-width: 56rem;
36
+ margin-inline: auto;
37
+ }
@@ -2,18 +2,22 @@
2
2
  import type { HTMLAttributes } from "svelte/elements";
3
3
  import type { WithElementRef } from "../../../lib/utils.js";
4
4
  import { ScrollArea } from "../../shadcn/scroll-area/index.js";
5
+ import type { ScrollAreaVisibility } from "../../shadcn/scroll-area/scroll-area-model.js";
5
6
  import { useAppShell } from "./app-shell-context.svelte.js";
6
7
  import { useAppShellBody } from "./app-shell-body-context.svelte.js";
7
8
 
8
9
  let {
9
10
  ref = $bindable(null),
10
11
  label,
12
+ scrollbarVisibility,
11
13
  class: className,
12
14
  children,
13
15
  ...restProps
14
16
  }: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
15
17
  /** Optional accessible name for this independently scrolling region. */
16
18
  label?: string;
19
+ /** When its scrollbar is painted: while scrolling, on hover, or always. */
20
+ scrollbarVisibility?: ScrollAreaVisibility;
17
21
  } = $props();
18
22
 
19
23
  useAppShell();
@@ -38,7 +42,7 @@
38
42
  aria-label={label}
39
43
  >
40
44
  <ScrollArea
41
- type="auto"
45
+ type={scrollbarVisibility ?? "auto"}
42
46
  class="ui-minimal-app-shell__body-content-scroll-area"
43
47
  >
44
48
  {@render children?.()}
@@ -7,6 +7,7 @@
7
7
  import type { HTMLAttributes } from "svelte/elements";
8
8
  import type { WithElementRef } from "../../../lib/utils.js";
9
9
  import { ScrollArea } from "../../shadcn/scroll-area/index.js";
10
+ import type { ScrollAreaVisibility } from "../../shadcn/scroll-area/scroll-area-model.js";
10
11
  import { useAppShell } from "./app-shell-context.svelte.js";
11
12
  import { useAppShellBody } from "./app-shell-body-context.svelte.js";
12
13
  import type { AppShellSide } from "./app-shell-controller.svelte.js";
@@ -19,6 +20,7 @@
19
20
  panelId,
20
21
  label,
21
22
  mobileLabel,
23
+ scrollbarVisibility,
22
24
  tabindex: _tabindex,
23
25
  class: className,
24
26
  children,
@@ -34,6 +36,8 @@
34
36
  label?: string;
35
37
  /** Mobile edge selector label. Defaults to the accessible landmark label. */
36
38
  mobileLabel?: string;
39
+ /** When its scrollbar is painted: while scrolling, on hover, or always. */
40
+ scrollbarVisibility?: ScrollAreaVisibility;
37
41
  } = $props();
38
42
 
39
43
  const controller = useAppShell();
@@ -108,7 +112,7 @@
108
112
  inert={(mobileMode && !mobileActive) || (!mobileMode && !open)}
109
113
  >
110
114
  <ScrollArea
111
- type="auto"
115
+ type={scrollbarVisibility ?? "auto"}
112
116
  class="ui-minimal-app-shell__body-sidebar-scroll-area"
113
117
  >
114
118
  {@render children?.()}
@@ -37,7 +37,7 @@
37
37
  <Select.Root
38
38
  type="single"
39
39
  bind:open
40
- value={activePanelId}
40
+ value={activePanelId ?? panels[0]?.id ?? ""}
41
41
  onValueChange={(value) => {
42
42
  if (value) controller.mobile.selectPanel(side, value);
43
43
  }}
@@ -450,9 +450,11 @@ export class AppShellController {
450
450
  readonly mobile = new AppShellMobileController();
451
451
  layoutReady = $state(false);
452
452
 
453
- readonly #persistence?: AppShellLayoutPersistence;
453
+ readonly #persistence: AppShellLayoutPersistence | undefined;
454
454
  readonly #saveDebounceMs: number;
455
- readonly #onPersistenceError?: (event: AppShellPersistenceErrorEvent) => void;
455
+ readonly #onPersistenceError:
456
+ | ((event: AppShellPersistenceErrorEvent) => void)
457
+ | undefined;
456
458
  readonly #panels = new Map<string, AppShellSidebarController>();
457
459
  readonly #panelIds = new Map<AppShellSidebarController, string>();
458
460
  readonly #panelDisposers = new Map<string, () => void>();
@@ -467,17 +469,25 @@ export class AppShellController {
467
469
  this.#persistence = options.persistence;
468
470
  this.#saveDebounceMs = Math.max(0, options.saveDebounceMs ?? 200);
469
471
  this.#onPersistenceError = options.onPersistenceError;
470
- const sidebarOptions = {
471
- minWidth: options.sidebarMinWidth,
472
- maxWidth: options.sidebarMaxWidth,
472
+ const sidebarOptions: AppShellSidebarControllerOptions = {
473
+ ...(options.sidebarMinWidth === undefined
474
+ ? {}
475
+ : { minWidth: options.sidebarMinWidth }),
476
+ ...(options.sidebarMaxWidth === undefined
477
+ ? {}
478
+ : { maxWidth: options.sidebarMaxWidth }),
473
479
  };
474
480
  this.left = new AppShellSidebarController(
475
481
  "left",
476
482
  options.leftCollapsed ?? false,
477
483
  {
478
484
  ...sidebarOptions,
479
- width: options.leftWidth,
480
- closed: options.leftClosed,
485
+ ...(options.leftWidth === undefined
486
+ ? {}
487
+ : { width: options.leftWidth }),
488
+ ...(options.leftClosed === undefined
489
+ ? {}
490
+ : { closed: options.leftClosed }),
481
491
  },
482
492
  );
483
493
  this.right = new AppShellSidebarController(
@@ -485,8 +495,12 @@ export class AppShellController {
485
495
  options.rightCollapsed ?? false,
486
496
  {
487
497
  ...sidebarOptions,
488
- width: options.rightWidth,
489
- closed: options.rightClosed,
498
+ ...(options.rightWidth === undefined
499
+ ? {}
500
+ : { width: options.rightWidth }),
501
+ ...(options.rightClosed === undefined
502
+ ? {}
503
+ : { closed: options.rightClosed }),
490
504
  },
491
505
  );
492
506
  this.#attachPanel("left", this.left);
@@ -1,3 +1,7 @@
1
+ <script lang="ts">
2
+ import "./AppShellExamples.css";
3
+ </script>
4
+
1
5
  <div class="ui-shell-story-body-demo">
2
6
  <header>
3
7
  <p>Composable layout</p>
@@ -1,4 +1,5 @@
1
1
  <script lang="ts">
2
+ import "./AppShellExamples.css";
2
3
  import { untrack } from "svelte";
3
4
  import type {
4
5
  AppShellController,
@@ -1,4 +1,5 @@
1
1
  <script lang="ts">
2
+ import "./AppShellExamples.css";
2
3
  import SparklesIcon from "@lucide/svelte/icons/sparkles";
3
4
  import {
4
5
  Composer,