@placeholderco/placeholder-ui 3.0.5 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) 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 +14 -14
  11. package/dist/editors/tiptap/TipTapBubble.svelte +14 -14
  12. package/dist/editors/tiptap/extensions/codeBlockEditor.css +9 -9
  13. package/dist/editors/tiptap/toolbar/AlertButton.svelte +22 -22
  14. package/dist/editors/tiptap/toolbar/ButtonLinkButton.svelte +26 -26
  15. package/dist/editors/tiptap/toolbar/ColorButton.svelte +19 -19
  16. package/dist/editors/tiptap/toolbar/HtmlButton.svelte +3 -3
  17. package/dist/editors/tiptap/toolbar/LinkButton.svelte +19 -19
  18. package/dist/editors/tiptap/toolbar/TableButton.svelte +18 -18
  19. package/dist/editors/tiptap/toolbar/ToolbarButton.svelte +4 -4
  20. package/dist/form/Checkbox.svelte +10 -10
  21. package/dist/form/Chips.svelte +2 -2
  22. package/dist/form/ColorPicker.svelte +5 -5
  23. package/dist/form/ComboBoxMulti.svelte +2 -4
  24. package/dist/form/CronBuilder.svelte +2 -2
  25. package/dist/form/Radio.svelte +7 -7
  26. package/dist/form/RadioGroup.svelte +1 -1
  27. package/dist/form/SelectMulti.svelte +1 -1
  28. package/dist/form/Slider.svelte +7 -7
  29. package/dist/form/TextArea.svelte +2 -2
  30. package/dist/layout/Navbar.svelte +3 -3
  31. package/dist/layout/Sidenav.svelte +2 -2
  32. package/dist/ui/ActionIcon.svelte +1 -1
  33. package/dist/ui/Badge.svelte +7 -7
  34. package/dist/ui/Button.svelte +2 -2
  35. package/dist/ui/ContextMenu.svelte +1 -1
  36. package/dist/ui/ContextMenuList.svelte +5 -5
  37. package/dist/ui/Drawer.svelte +1 -1
  38. package/dist/ui/Dropdown.svelte +3 -3
  39. package/dist/ui/Dropzone.svelte +2 -2
  40. package/dist/ui/Loader.svelte +5 -1
  41. package/dist/ui/Pagination.svelte +2 -2
  42. package/dist/ui/Popover.svelte +2 -2
  43. package/dist/ui/ProgressBar.svelte +3 -3
  44. package/dist/ui/Table.svelte +11 -11
  45. package/dist/ui/Tooltip.svelte +3 -3
  46. package/dist/uiTheme.svelte.d.ts +6 -0
  47. package/dist/uiTheme.svelte.js +2 -0
  48. package/package.json +1 -1
@@ -105,9 +105,6 @@
105
105
  {:else}
106
106
  <div class="combobox-multi-panel">
107
107
  {#each groupedOptions as group, groupIndex}
108
- {#if group != groupedOptions[0]}
109
- <div class="seperator"></div>
110
- {/if}
111
108
  {#if group.label?.length && group.showGroupName !== false}
112
109
  <div class="group-label">{group.label}</div>
113
110
  {/if}
@@ -226,7 +223,8 @@
226
223
 
227
224
  :global(.dark) {
228
225
  .group-label {
229
- background: black;
226
+ background: var(--ui-primary);
227
+ color: white;
230
228
  }
231
229
  }
232
230
  </style>
@@ -473,7 +473,7 @@
473
473
 
474
474
  .cron-settings {
475
475
  display: grid;
476
- grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
476
+ grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
477
477
  gap: 1rem;
478
478
  }
479
479
 
@@ -524,7 +524,7 @@
524
524
 
525
525
  .custom-inputs {
526
526
  display: grid;
527
- grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
527
+ grid-template-columns: repeat(auto-fit, minmax(8.125rem, 1fr));
528
528
  gap: 1rem;
529
529
  grid-column: 1 / -1;
530
530
  }
@@ -76,7 +76,7 @@
76
76
  -webkit-appearance: none;
77
77
  -moz-appearance: none;
78
78
  appearance: none;
79
- margin: 8px;
79
+ margin: 0.5rem;
80
80
  box-sizing: content-box;
81
81
  overflow: hidden;
82
82
  cursor: pointer;
@@ -86,8 +86,8 @@
86
86
  content: '';
87
87
  display: block;
88
88
  box-sizing: content-box;
89
- width: 16px;
90
- height: 16px;
89
+ width: 1rem;
90
+ height: 1rem;
91
91
  border: 2px solid #ccc;
92
92
  transition: 0.2s border-color ease;
93
93
  }
@@ -121,8 +121,8 @@
121
121
  left: 50%;
122
122
  transform-origin: 50% 50%;
123
123
  background-color: var(--ui-primary);
124
- width: 16px;
125
- height: 16px;
124
+ width: 1rem;
125
+ height: 1rem;
126
126
  border-radius: 100vh;
127
127
  transform: translate(-50%, -50%) scale(0);
128
128
  }
@@ -136,8 +136,8 @@
136
136
  border-radius: 100vh;
137
137
  }
138
138
  input[type='radio']:after {
139
- width: 16px;
140
- height: 16px;
139
+ width: 1rem;
140
+ height: 1rem;
141
141
  border-radius: 100vh;
142
142
  transform: translate(-50%, -50%) scale(0);
143
143
  }
@@ -96,7 +96,7 @@
96
96
  .radio-options {
97
97
  display: flex;
98
98
  gap: 0.5rem;
99
- border-radius: 6px;
99
+ border-radius: 0.375rem;
100
100
  }
101
101
 
102
102
  .radio-vertical.radio-options {
@@ -480,7 +480,7 @@
480
480
  position: absolute;
481
481
  right: 0.65rem;
482
482
  width: 1rem;
483
- top: 6px;
483
+ top: 0.375rem;
484
484
  }
485
485
 
486
486
  .show-error {
@@ -166,15 +166,15 @@
166
166
  display: flex;
167
167
  align-items: center;
168
168
  gap: 0.75rem;
169
- padding: 4px 0 4px 0;
169
+ padding: 0.25rem 0 0.25rem 0;
170
170
  }
171
171
 
172
172
  .slider {
173
173
  -webkit-appearance: none;
174
174
  appearance: none;
175
175
  width: 100%;
176
- height: 6px;
177
- border-radius: 3px;
176
+ height: 0.375rem;
177
+ border-radius: 0.1875rem;
178
178
  background: linear-gradient(
179
179
  to right,
180
180
  var(--accent-color) 0%,
@@ -189,8 +189,8 @@
189
189
  .slider::-webkit-slider-thumb {
190
190
  -webkit-appearance: none;
191
191
  appearance: none;
192
- width: 16px;
193
- height: 16px;
192
+ width: 1rem;
193
+ height: 1rem;
194
194
  border-radius: 50%;
195
195
  background: var(--accent-color);
196
196
  cursor: pointer;
@@ -202,8 +202,8 @@
202
202
  }
203
203
 
204
204
  .slider::-moz-range-thumb {
205
- width: 16px;
206
- height: 16px;
205
+ width: 1rem;
206
+ height: 1rem;
207
207
  border-radius: 50%;
208
208
  background: var(--accent-color);
209
209
  cursor: pointer;
@@ -176,7 +176,7 @@
176
176
 
177
177
  .loader {
178
178
  position: absolute;
179
- right: 8px;
180
- top: 8px;
179
+ right: 0.5rem;
180
+ top: 0.5rem;
181
181
  }
182
182
  </style>
@@ -283,7 +283,7 @@
283
283
  }
284
284
 
285
285
  header.site .site-logo :global(.pui-icon svg) {
286
- height: 40px;
286
+ height: 2.5rem;
287
287
  width: auto;
288
288
  display: block;
289
289
  }
@@ -306,7 +306,7 @@
306
306
  }
307
307
 
308
308
  header.site .site-logo :global(.pui-icon svg) {
309
- height: 34px;
309
+ height: 2.125rem;
310
310
  }
311
311
 
312
312
  /* The hidden links containers still count as siblings, so re-apply the auto margin
@@ -333,7 +333,7 @@
333
333
  gap: 1rem;
334
334
 
335
335
  margin: 0 auto;
336
- padding: 0 1em;
336
+ padding: 0 1rem;
337
337
  height: 100%;
338
338
  width: 100%;
339
339
  color: var(--ui-primary-text-color);
@@ -82,8 +82,8 @@
82
82
  sections = [],
83
83
  bottomSections = [],
84
84
  collapsed = false,
85
- width = '260px',
86
- collapsedWidth = '60px',
85
+ width = '16.25rem',
86
+ collapsedWidth = '3.75rem',
87
87
  class: className = '',
88
88
  header,
89
89
  footer,
@@ -37,7 +37,7 @@
37
37
  loading = false,
38
38
  disabled = false,
39
39
  inputButton = false,
40
- size = '20px',
40
+ size = '1.25rem',
41
41
  svg,
42
42
  target = undefined,
43
43
  class: buttonClass = '',
@@ -62,7 +62,7 @@
62
62
  {/if}
63
63
  {#if onDelete}
64
64
  <button type="button" class="badge-button {variant}" disabled={isDisabled} onclick={onDelete}>
65
- <Icon size={size === 'sm' ? '12px' : size === 'lg' ? '16px' : '14px'} svg={iconX} />
65
+ <Icon size={size === 'sm' ? '0.75rem' : size === 'lg' ? '1rem' : '0.875rem'} svg={iconX} />
66
66
  </button>
67
67
  {/if}
68
68
  </div>
@@ -70,7 +70,7 @@
70
70
  <style>
71
71
  .badge-container {
72
72
  display: flex;
73
- border-radius: 6px;
73
+ border-radius: 0.375rem;
74
74
  border: var(--badge-border, 0);
75
75
  }
76
76
 
@@ -83,7 +83,7 @@
83
83
  align-items: center;
84
84
  text-decoration: none;
85
85
  padding: 0.25rem;
86
- border-radius: 6px;
86
+ border-radius: 0.375rem;
87
87
  }
88
88
 
89
89
  button.badge,
@@ -92,13 +92,13 @@
92
92
  }
93
93
 
94
94
  .badge-with-button .badge {
95
- padding-right: 6px;
95
+ padding-right: 0.375rem;
96
96
  border-top-right-radius: 0;
97
97
  border-bottom-right-radius: 0;
98
98
  }
99
99
 
100
100
  .badge-button {
101
- border-radius: 6px;
101
+ border-radius: 0.375rem;
102
102
  border-top-left-radius: 0;
103
103
  border-bottom-left-radius: 0;
104
104
  border-left: 1px solid var(--badge-border-color, black);
@@ -107,7 +107,7 @@
107
107
  justify-content: center;
108
108
  cursor: pointer;
109
109
  border-right: var(--badge-border, 0);
110
- padding: 4px;
110
+ padding: 0.25rem;
111
111
  }
112
112
 
113
113
  button {
@@ -355,6 +355,6 @@
355
355
  }
356
356
 
357
357
  .size-lg .badge-button {
358
- padding: 6px;
358
+ padding: 0.375rem;
359
359
  }
360
360
  </style>
@@ -53,7 +53,7 @@
53
53
  effectsDisabled = false,
54
54
  svg = undefined,
55
55
  rightSvg = undefined,
56
- iconSize = '18px',
56
+ iconSize = '1.125rem',
57
57
  target = undefined,
58
58
  rel = undefined,
59
59
  download = undefined,
@@ -113,7 +113,7 @@
113
113
  <style>
114
114
  .pui-button {
115
115
  padding: 0.5rem 1rem;
116
- border-radius: 6px;
116
+ border-radius: 0.375rem;
117
117
  cursor: pointer;
118
118
  transition: all 0.2s ease-in-out;
119
119
  }
@@ -45,7 +45,7 @@
45
45
  x = 0,
46
46
  y = 0,
47
47
  items = [],
48
- minWidth = '180px',
48
+ minWidth = '11.25rem',
49
49
  class: classes = '',
50
50
  onClose
51
51
  }: ContextMenuProps = $props();
@@ -64,14 +64,14 @@
64
64
  onclick={() => handleClick(item)}
65
65
  >
66
66
  <span class="pui-ctxmenu-ico">
67
- {#if item.icon}<Icon svg={item.icon} size="16px" />{/if}
67
+ {#if item.icon}<Icon svg={item.icon} size="1rem" />{/if}
68
68
  </span>
69
69
  <span class="pui-ctxmenu-label">{item.label}</span>
70
70
  {#if item.shortcut}
71
71
  <span class="pui-ctxmenu-shortcut">{item.shortcut}</span>
72
72
  {/if}
73
73
  {#if item.children?.length}
74
- <span class="pui-ctxmenu-caret"><Icon svg={iconChevronRight} size="14px" /></span>
74
+ <span class="pui-ctxmenu-caret"><Icon svg={iconChevronRight} size="0.875rem" /></span>
75
75
  {/if}
76
76
  </button>
77
77
 
@@ -92,7 +92,7 @@
92
92
  padding: 0.25rem;
93
93
  background: var(--paper-body-bg, #fff);
94
94
  border: 1px solid var(--border-color);
95
- border-radius: 6px;
95
+ border-radius: 0.375rem;
96
96
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
97
97
  color: var(--text-color);
98
98
  font-size: 0.875rem;
@@ -111,7 +111,7 @@
111
111
  padding: 0.375rem 0.6rem;
112
112
  background: none;
113
113
  border: 0;
114
- border-radius: 4px;
114
+ border-radius: 0.25rem;
115
115
  color: inherit;
116
116
  font: inherit;
117
117
  text-align: left;
@@ -145,7 +145,7 @@
145
145
 
146
146
  .pui-ctxmenu-ico {
147
147
  display: inline-flex;
148
- width: 16px;
148
+ width: 1rem;
149
149
  flex-shrink: 0;
150
150
  }
151
151
 
@@ -48,7 +48,7 @@
48
48
  let {
49
49
  open = $bindable(false),
50
50
  position = 'left',
51
- width = '320px',
51
+ width = '20rem',
52
52
  closeOnClickOutside = true,
53
53
  closeOnEscape = true,
54
54
  closeForLargeScreens = false,
@@ -81,10 +81,10 @@
81
81
  /* Position and top-layer promotion come from use:floating */
82
82
  .dropdown-content {
83
83
  background-color: var(--paper-body-bg);
84
- min-width: 160px;
84
+ min-width: 10rem;
85
85
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
86
86
  z-index: 1000;
87
- border-radius: 4px;
87
+ border-radius: 0.25rem;
88
88
  overflow: hidden;
89
89
  border: 1px solid var(--border-color);
90
90
  }
@@ -100,7 +100,7 @@
100
100
 
101
101
  .dropdown-content :global(a) {
102
102
  display: block;
103
- padding: 8px 12px;
103
+ padding: 0.5rem 0.75rem;
104
104
  text-decoration: none;
105
105
  color: var(--ui-primary-text-color);
106
106
  transition: background-color 0.2s ease;
@@ -162,7 +162,7 @@
162
162
  {@render children()}
163
163
  {:else}
164
164
  <span class="dropzone-content">
165
- <Icon svg={iconSvg} size="32px" class="dropzone-icon" />
165
+ <Icon svg={iconSvg} size="2rem" class="dropzone-icon" />
166
166
  <span class="dropzone-label">{labelText}</span>
167
167
  {#if sublabelText}
168
168
  <span class="dropzone-sublabel">{sublabelText}</span>
@@ -179,7 +179,7 @@
179
179
  text-align: center;
180
180
  cursor: pointer;
181
181
  transition: all 0.2s ease-in-out;
182
- border-radius: 6px;
182
+ border-radius: 0.375rem;
183
183
  flex-grow: 1;
184
184
  background: var(--paper-body-bg);
185
185
  color: var(--text-color);
@@ -11,7 +11,11 @@
11
11
  class?: string;
12
12
  }
13
13
 
14
- let { fullScreen = false, sizeOverride = '50px', class: classes = '' }: LoaderProps = $props();
14
+ let {
15
+ fullScreen = false,
16
+ sizeOverride = '3.125rem',
17
+ class: classes = ''
18
+ }: LoaderProps = $props();
15
19
 
16
20
  // export let fullScreen: boolean = false;
17
21
  // export let sizeOverride: string = '50px';
@@ -129,8 +129,8 @@
129
129
  }
130
130
 
131
131
  .pagination-container :global(.paginate-button) {
132
- width: 33.6px;
133
- height: 29.6px;
132
+ width: 2.1rem;
133
+ height: 1.85rem;
134
134
  display: flex;
135
135
  justify-content: center;
136
136
  }
@@ -154,10 +154,10 @@
154
154
  display: block;
155
155
  background-color: var(--paper-body-bg);
156
156
  border: 1px solid var(--border-color);
157
- min-width: 160px;
157
+ min-width: 10rem;
158
158
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
159
159
  z-index: 1000;
160
- border-radius: 4px;
160
+ border-radius: 0.25rem;
161
161
  }
162
162
 
163
163
  /* Arrow indicators for each resolved placement */
@@ -84,15 +84,15 @@
84
84
  }
85
85
 
86
86
  .size-sm {
87
- height: 8px;
87
+ height: 0.5rem;
88
88
  }
89
89
 
90
90
  .size-md {
91
- height: 20px;
91
+ height: 1.25rem;
92
92
  }
93
93
 
94
94
  .size-lg {
95
- height: 28px;
95
+ height: 1.75rem;
96
96
  }
97
97
 
98
98
  .fill,
@@ -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) {
@@ -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.5",
3
+ "version": "3.1.0",
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",