@placeholderco/placeholder-ui 3.0.6 → 3.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 (53) hide show
  1. package/dist/app.css +32 -3
  2. package/dist/cards/GitCard.svelte +4 -4
  3. package/dist/display/Avatar.svelte +1 -1
  4. package/dist/display/LinkCollection.svelte +5 -5
  5. package/dist/display/Paper.svelte +1 -1
  6. package/dist/display/filetree/FileTree.svelte +2 -2
  7. package/dist/display/filetree/FileTreeItem.svelte +6 -6
  8. package/dist/editors/CodeMirror.svelte +6 -6
  9. package/dist/editors/tiptap/LinkActionMenu.svelte +25 -25
  10. package/dist/editors/tiptap/TipTap.svelte +38 -17
  11. package/dist/editors/tiptap/TipTap.svelte.d.ts +7 -2
  12. package/dist/editors/tiptap/TipTapBubble.svelte +38 -17
  13. package/dist/editors/tiptap/TipTapBubble.svelte.d.ts +7 -2
  14. package/dist/editors/tiptap/extensions/codeBlockEditor.css +9 -9
  15. package/dist/editors/tiptap/toolbar/AlertButton.svelte +22 -22
  16. package/dist/editors/tiptap/toolbar/ButtonLinkButton.svelte +26 -26
  17. package/dist/editors/tiptap/toolbar/ColorButton.svelte +19 -19
  18. package/dist/editors/tiptap/toolbar/HtmlButton.svelte +3 -3
  19. package/dist/editors/tiptap/toolbar/LinkButton.svelte +19 -19
  20. package/dist/editors/tiptap/toolbar/TableButton.svelte +18 -18
  21. package/dist/editors/tiptap/toolbar/ToolbarButton.svelte +4 -4
  22. package/dist/form/Checkbox.svelte +10 -10
  23. package/dist/form/Chips.svelte +2 -2
  24. package/dist/form/ColorPicker.svelte +5 -5
  25. package/dist/form/CronBuilder.svelte +2 -2
  26. package/dist/form/Radio.svelte +7 -7
  27. package/dist/form/RadioGroup.svelte +1 -1
  28. package/dist/form/SelectMulti.svelte +1 -1
  29. package/dist/form/Slider.svelte +7 -7
  30. package/dist/form/TextArea.svelte +2 -2
  31. package/dist/layout/Navbar.svelte +3 -3
  32. package/dist/layout/Sidenav.svelte +2 -2
  33. package/dist/ui/ActionIcon.svelte +1 -1
  34. package/dist/ui/Badge.svelte +7 -7
  35. package/dist/ui/Button.svelte +2 -2
  36. package/dist/ui/ContextMenu.svelte +1 -1
  37. package/dist/ui/ContextMenuList.svelte +5 -5
  38. package/dist/ui/DialogEvents.svelte.d.ts +1 -7
  39. package/dist/ui/DialogEvents.svelte.js +3 -3
  40. package/dist/ui/Drawer.svelte +1 -1
  41. package/dist/ui/Dropdown.svelte +3 -3
  42. package/dist/ui/Dropzone.svelte +2 -2
  43. package/dist/ui/Loader.svelte +5 -1
  44. package/dist/ui/Pagination.svelte +2 -2
  45. package/dist/ui/Popover.svelte +2 -2
  46. package/dist/ui/ProgressBar.svelte +3 -3
  47. package/dist/ui/Table.svelte +11 -11
  48. package/dist/ui/Tabs.svelte +57 -15
  49. package/dist/ui/Tabs.svelte.d.ts +4 -1
  50. package/dist/ui/Tooltip.svelte +3 -3
  51. package/dist/uiTheme.svelte.d.ts +6 -0
  52. package/dist/uiTheme.svelte.js +2 -0
  53. package/package.json +20 -20
@@ -405,10 +405,10 @@
405
405
  <thead>
406
406
  <tr>
407
407
  {#if expandable}
408
- <th class="table-header expand-cell" style="width: 40px"></th>
408
+ <th class="table-header expand-cell" style="width: 2.5rem"></th>
409
409
  {/if}
410
410
  {#if selectable && rowKey}
411
- <th class="table-header checkbox-cell" style="width: 40px">
411
+ <th class="table-header checkbox-cell" style="width: 2.5rem">
412
412
  <Checkbox
413
413
  controlled
414
414
  checked={isAllSelected}
@@ -428,7 +428,7 @@
428
428
  <span>{column.label}</span>
429
429
  {#if column.sortable}
430
430
  <div class="sort-icon">
431
- <Icon svg={getSortIcon(column)} size="14px" />
431
+ <Icon svg={getSortIcon(column)} size="0.875rem" />
432
432
  </div>
433
433
  {/if}
434
434
  </div>
@@ -489,7 +489,7 @@
489
489
  aria-label={expanded ? 'Collapse row' : 'Expand row'}
490
490
  onclick={() => toggleExpand(row, index)}
491
491
  >
492
- <Icon svg={iconChevronRight} size="16px" />
492
+ <Icon svg={iconChevronRight} size="1rem" />
493
493
  </button>
494
494
  {/if}
495
495
  </td>
@@ -565,7 +565,7 @@
565
565
 
566
566
  .table-search {
567
567
  margin-bottom: 1rem;
568
- max-width: 400px;
568
+ max-width: 25rem;
569
569
  }
570
570
 
571
571
  .table-wrapper {
@@ -647,7 +647,7 @@
647
647
  }
648
648
 
649
649
  .checkbox-cell {
650
- width: 40px;
650
+ width: 2.5rem;
651
651
  text-align: center;
652
652
  padding: 0.25rem;
653
653
  }
@@ -662,7 +662,7 @@
662
662
  }
663
663
 
664
664
  .expand-cell {
665
- width: 40px;
665
+ width: 2.5rem;
666
666
  text-align: center;
667
667
  padding: 0.25rem;
668
668
  }
@@ -671,8 +671,8 @@
671
671
  display: inline-flex;
672
672
  align-items: center;
673
673
  justify-content: center;
674
- width: 24px;
675
- height: 24px;
674
+ width: 1.5rem;
675
+ height: 1.5rem;
676
676
  padding: 0;
677
677
  border: none;
678
678
  background: transparent;
@@ -783,8 +783,8 @@
783
783
  }
784
784
 
785
785
  :global(.pui-table .sort-icon svg) {
786
- width: 14px;
787
- height: 14px;
786
+ width: 0.875rem;
787
+ height: 0.875rem;
788
788
  }
789
789
 
790
790
  @media (max-width: 640px) {
@@ -3,7 +3,10 @@
3
3
  import { onMount } from 'svelte';
4
4
 
5
5
  export interface TabsProps {
6
- /** Available tab options */
6
+ /**
7
+ * Available tab options. `class` is added to the tab button (style it with `:global()`),
8
+ * and a divider is drawn between neighbouring tabs whose `groupName` differs
9
+ */
7
10
  tabOptions: ComboBoxItem[];
8
11
  /** Currently active tab value (bindable) */
9
12
  activeTab?: string;
@@ -15,6 +18,7 @@
15
18
 
16
19
  let { tabOptions, activeTab = $bindable(''), solidBg = false, onchange }: TabsProps = $props();
17
20
  let containerRef: HTMLDivElement;
21
+ let scrollRef: HTMLDivElement;
18
22
  let buttonElements = $state<HTMLButtonElement[]>([]);
19
23
  let underlineStyle = $state('');
20
24
 
@@ -45,6 +49,7 @@
45
49
  $effect(() => {
46
50
  if (selectedIndex >= 0 && buttonElements[selectedIndex] && containerRef) {
47
51
  recalculateUnderline();
52
+ scrollSelectedIntoView();
48
53
  }
49
54
  });
50
55
 
@@ -59,29 +64,56 @@
59
64
  underlineStyle = `left: ${offsetLeft}px; width: ${width}px;`;
60
65
  }
61
66
 
67
+ // Scroll the bar (not the page) so the selected tab is fully visible
68
+ function scrollSelectedIntoView() {
69
+ const selectedButton = buttonElements[selectedIndex];
70
+ const scrollRect = scrollRef.getBoundingClientRect();
71
+ const buttonRect = selectedButton.getBoundingClientRect();
72
+
73
+ if (buttonRect.left < scrollRect.left) {
74
+ scrollRef.scrollLeft -= scrollRect.left - buttonRect.left;
75
+ } else if (buttonRect.right > scrollRect.right) {
76
+ scrollRef.scrollLeft += buttonRect.right - scrollRect.right;
77
+ }
78
+ }
79
+
62
80
  function setValue(newValue: any) {
63
81
  activeTab = newValue;
64
82
  onchange?.(newValue);
65
83
  }
66
84
  </script>
67
85
 
68
- <div class="tabs" bind:this={containerRef}>
69
- {#each tabOptions as option, index}
70
- {@const isSelected = option.value === activeTab}
71
-
72
- <button
73
- type="button"
74
- bind:this={buttonElements[index]}
75
- class="tab-item {isSelected ? 'selected' : ''} {solidBg ? 'solid' : ''}"
76
- onclick={() => setValue(option.value)}
77
- >
78
- {option.label}
79
- </button>
80
- {/each}
81
- <div class="tab-underline" style={underlineStyle}></div>
86
+ <div class="tabs-scroll" bind:this={scrollRef}>
87
+ <div class="tabs" bind:this={containerRef}>
88
+ {#each tabOptions as option, index}
89
+ {@const isSelected = option.value === activeTab}
90
+
91
+ {#if index > 0 && (option.groupName ?? '') !== (tabOptions[index - 1].groupName ?? '')}
92
+ <span class="tab-divider" aria-hidden="true"></span>
93
+ {/if}
94
+ <button
95
+ type="button"
96
+ bind:this={buttonElements[index]}
97
+ class="tab-item {isSelected ? 'selected' : ''} {solidBg ? 'solid' : ''} {option.class ??
98
+ ''}"
99
+ onclick={() => setValue(option.value)}
100
+ >
101
+ {option.label}
102
+ </button>
103
+ {/each}
104
+ <div class="tab-underline" style={underlineStyle}></div>
105
+ </div>
82
106
  </div>
83
107
 
84
108
  <style>
109
+ .tabs-scroll {
110
+ display: inline-block;
111
+ max-width: 100%;
112
+ vertical-align: bottom;
113
+ overflow-x: auto;
114
+ overflow-y: hidden;
115
+ }
116
+
85
117
  .tabs {
86
118
  position: relative;
87
119
  display: inline-flex;
@@ -105,6 +137,16 @@
105
137
  transition: color 0.2s ease-in-out;
106
138
  z-index: 1;
107
139
  border-bottom: 2px solid transparent;
140
+ flex-shrink: 0;
141
+ white-space: nowrap;
142
+ }
143
+
144
+ .tab-divider {
145
+ flex-shrink: 0;
146
+ align-self: center;
147
+ width: 1px;
148
+ height: 1.25rem;
149
+ background-color: var(--border-color);
108
150
  }
109
151
 
110
152
  .tab-item:hover {
@@ -1,6 +1,9 @@
1
1
  import type { ComboBoxItem } from '../models/ComboBoxItem.js';
2
2
  export interface TabsProps {
3
- /** Available tab options */
3
+ /**
4
+ * Available tab options. `class` is added to the tab button (style it with `:global()`),
5
+ * and a divider is drawn between neighbouring tabs whose `groupName` differs
6
+ */
4
7
  tabOptions: ComboBoxItem[];
5
8
  /** Currently active tab value (bindable) */
6
9
  activeTab?: string;
@@ -50,7 +50,7 @@
50
50
  text,
51
51
  html,
52
52
  location = 'top',
53
- maxWidth = '300px',
53
+ maxWidth = '18.75rem',
54
54
  offsetDistance = 4,
55
55
  showArrow = true,
56
56
  delay = 0,
@@ -486,7 +486,7 @@
486
486
  background: var(--tooltip-bg);
487
487
  color: var(--tooltip-text);
488
488
  padding: 0.5rem 0.75rem;
489
- border-radius: 6px;
489
+ border-radius: 0.375rem;
490
490
  font-size: 0.875rem;
491
491
  line-height: 1.4;
492
492
  overflow-wrap: break-word;
@@ -521,7 +521,7 @@
521
521
  .tooltip-v2-content :global(code) {
522
522
  background: rgba(255, 255, 255, 0.1);
523
523
  padding: 0.125rem 0.25rem;
524
- border-radius: 3px;
524
+ border-radius: 0.1875rem;
525
525
  font-size: 0.85em;
526
526
  }
527
527
 
@@ -49,6 +49,12 @@ export interface ThemeModeConfig {
49
49
  * Loading the font itself (`@font-face` or a `<link>`) is up to the consuming app.
50
50
  */
51
51
  fontFamily?: string;
52
+ /**
53
+ * Root (`html`) font size, e.g. `'0.9375rem'`. Defaults to `0.875rem` (14px). This is the
54
+ * value of `1rem`, and every component is sized in `rem`/`em`, so the whole UI scales in
55
+ * proportion. Use `rem` so the browser's text-size setting is still respected.
56
+ */
57
+ fontSize?: string;
52
58
  /** Raw SVG markup for the `Logo` component. Use `fill="currentColor"` so it follows the theme. */
53
59
  logo?: string;
54
60
  /**
@@ -137,6 +137,8 @@ export function themeToVariables(config) {
137
137
  }
138
138
  if (config.fontFamily)
139
139
  vars['--ui-font-family'] = config.fontFamily;
140
+ if (config.fontSize)
141
+ vars['--ui-font-size'] = config.fontSize;
140
142
  if (config.variables)
141
143
  Object.assign(vars, config.variables);
142
144
  return vars;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@placeholderco/placeholder-ui",
3
- "version": "3.0.6",
3
+ "version": "3.1.2",
4
4
  "description": "A modern, customizable Svelte 5 UI component library with comprehensive theming support. Re-brand it with a single config object.",
5
5
  "license": "MIT",
6
6
  "author": "Placeholderco",
@@ -56,7 +56,7 @@
56
56
  "@sveltejs/kit": "^3.1.0",
57
57
  "@sveltejs/package": "^3.0.1",
58
58
  "@sveltejs/vite-plugin-svelte": "^7.3.1",
59
- "@types/node": "^26.6.5",
59
+ "@types/node": "^26.6.6",
60
60
  "globals": "^17.13.0",
61
61
  "prettier": "^3.9.10",
62
62
  "prettier-plugin-svelte": "^4.1.1",
@@ -84,25 +84,25 @@
84
84
  "@codemirror/theme-one-dark": "^6.1.3",
85
85
  "@codemirror/view": "^6.43.15",
86
86
  "@lezer/highlight": "^1.2.5",
87
- "@tiptap/core": "^3.32.0",
88
- "@tiptap/extension-bubble-menu": "^3.32.0",
89
- "@tiptap/extension-code-block": "^3.32.0",
90
- "@tiptap/extension-collaboration": "^3.32.0",
91
- "@tiptap/extension-collaboration-caret": "^3.32.0",
92
- "@tiptap/extension-color": "^3.32.0",
93
- "@tiptap/extension-image": "^3.32.0",
94
- "@tiptap/extension-link": "^3.32.0",
95
- "@tiptap/extension-placeholder": "^3.32.0",
96
- "@tiptap/extension-subscript": "^3.32.0",
97
- "@tiptap/extension-superscript": "^3.32.0",
98
- "@tiptap/extension-table": "^3.32.0",
99
- "@tiptap/extension-text-align": "^3.32.0",
100
- "@tiptap/extension-text-style": "^3.32.0",
101
- "@tiptap/extension-underline": "^3.32.0",
102
- "@tiptap/pm": "^3.32.0",
103
- "@tiptap/starter-kit": "^3.32.0",
87
+ "@tiptap/core": "^3.32.1",
88
+ "@tiptap/extension-bubble-menu": "^3.32.1",
89
+ "@tiptap/extension-code-block": "^3.32.1",
90
+ "@tiptap/extension-collaboration": "^3.32.1",
91
+ "@tiptap/extension-collaboration-caret": "^3.32.1",
92
+ "@tiptap/extension-color": "^3.32.1",
93
+ "@tiptap/extension-image": "^3.32.1",
94
+ "@tiptap/extension-link": "^3.32.1",
95
+ "@tiptap/extension-placeholder": "^3.32.1",
96
+ "@tiptap/extension-subscript": "^3.32.1",
97
+ "@tiptap/extension-superscript": "^3.32.1",
98
+ "@tiptap/extension-table": "^3.32.1",
99
+ "@tiptap/extension-text-align": "^3.32.1",
100
+ "@tiptap/extension-text-style": "^3.32.1",
101
+ "@tiptap/extension-underline": "^3.32.1",
102
+ "@tiptap/pm": "^3.32.1",
103
+ "@tiptap/starter-kit": "^3.32.1",
104
104
  "dayjs": "^1.11.23",
105
- "svelte-sonner": "^1.2.1",
105
+ "svelte-sonner": "^1.2.2",
106
106
  "yjs": "^13.6.33"
107
107
  },
108
108
  "publishConfig": {