@placeholderco/placeholder-ui 1.0.12 → 2.0.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 (276) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +134 -130
  3. package/dist/app.css +178 -0
  4. package/dist/bootstrap.min.css +3600 -0
  5. package/dist/cards/GitCard.svelte +115 -0
  6. package/dist/cards/GitCard.svelte.d.ts +22 -0
  7. package/dist/display/Avatar.svelte +29 -17
  8. package/dist/display/Avatar.svelte.d.ts +12 -2
  9. package/dist/display/LinkCollection.svelte +40 -18
  10. package/dist/display/LinkCollection.svelte.d.ts +9 -2
  11. package/dist/display/Paper.svelte +31 -19
  12. package/dist/display/Paper.svelte.d.ts +12 -3
  13. package/dist/display/alert/Alert.svelte +129 -0
  14. package/dist/display/alert/Alert.svelte.d.ts +15 -0
  15. package/dist/display/alert/AlertVariant.d.ts +1 -0
  16. package/dist/display/alert/AlertVariant.js +1 -0
  17. package/dist/display/filetree/FileTree.svelte +259 -0
  18. package/dist/display/filetree/FileTree.svelte.d.ts +76 -0
  19. package/dist/display/filetree/FileTreeItem.svelte +396 -0
  20. package/dist/display/filetree/FileTreeItem.svelte.d.ts +40 -0
  21. package/dist/display/filetree/FileTreeNode.d.ts +46 -0
  22. package/dist/display/filetree/FileTreeNode.js +115 -0
  23. package/dist/display/filetree/index.d.ts +5 -0
  24. package/dist/display/filetree/index.js +3 -0
  25. package/dist/editors/CodeMirror.svelte +306 -0
  26. package/dist/editors/CodeMirror.svelte.d.ts +31 -0
  27. package/dist/editors/tiptap/LinkActionMenu.svelte +307 -0
  28. package/dist/editors/tiptap/LinkActionMenu.svelte.d.ts +8 -0
  29. package/dist/editors/tiptap/TipTap.svelte +856 -0
  30. package/dist/editors/tiptap/TipTap.svelte.d.ts +54 -0
  31. package/dist/editors/tiptap/TipTapBubble.svelte +790 -0
  32. package/dist/editors/tiptap/TipTapBubble.svelte.d.ts +44 -0
  33. package/dist/editors/tiptap/collaboration.d.ts +55 -0
  34. package/dist/editors/tiptap/collaboration.js +1 -0
  35. package/dist/editors/tiptap/extensions/Alert.d.ts +18 -0
  36. package/dist/editors/tiptap/extensions/Alert.js +72 -0
  37. package/dist/editors/tiptap/extensions/CodeBlockEditor.d.ts +21 -0
  38. package/dist/editors/tiptap/extensions/CodeBlockEditor.js +326 -0
  39. package/dist/editors/tiptap/extensions/Div.d.ts +19 -0
  40. package/dist/editors/tiptap/extensions/Div.js +89 -0
  41. package/dist/editors/tiptap/extensions/Span.d.ts +5 -0
  42. package/dist/editors/tiptap/extensions/Span.js +56 -0
  43. package/dist/editors/tiptap/extensions/codeBlockEditor.css +236 -0
  44. package/dist/editors/tiptap/extensions/codeBlockLanguages.d.ts +17 -0
  45. package/dist/editors/tiptap/extensions/codeBlockLanguages.js +124 -0
  46. package/dist/editors/tiptap/extensions/index.d.ts +7 -0
  47. package/dist/editors/tiptap/extensions/index.js +5 -0
  48. package/dist/editors/tiptap/toolbar/AlertButton.svelte +261 -0
  49. package/dist/editors/tiptap/toolbar/AlertButton.svelte.d.ts +7 -0
  50. package/dist/editors/tiptap/toolbar/AlignCenterButton.svelte +18 -0
  51. package/dist/editors/tiptap/toolbar/AlignCenterButton.svelte.d.ts +7 -0
  52. package/dist/editors/tiptap/toolbar/AlignJustifyButton.svelte +18 -0
  53. package/dist/editors/tiptap/toolbar/AlignJustifyButton.svelte.d.ts +7 -0
  54. package/dist/editors/tiptap/toolbar/AlignLeftButton.svelte +18 -0
  55. package/dist/editors/tiptap/toolbar/AlignLeftButton.svelte.d.ts +7 -0
  56. package/dist/editors/tiptap/toolbar/AlignRightButton.svelte +18 -0
  57. package/dist/editors/tiptap/toolbar/AlignRightButton.svelte.d.ts +7 -0
  58. package/dist/editors/tiptap/toolbar/BoldButton.svelte +18 -0
  59. package/dist/editors/tiptap/toolbar/BoldButton.svelte.d.ts +7 -0
  60. package/dist/editors/tiptap/toolbar/BulletListButton.svelte +18 -0
  61. package/dist/editors/tiptap/toolbar/BulletListButton.svelte.d.ts +7 -0
  62. package/dist/editors/tiptap/toolbar/CodeBlockButton.svelte +18 -0
  63. package/dist/editors/tiptap/toolbar/CodeBlockButton.svelte.d.ts +7 -0
  64. package/dist/editors/tiptap/toolbar/CodeButton.svelte +18 -0
  65. package/dist/editors/tiptap/toolbar/CodeButton.svelte.d.ts +7 -0
  66. package/dist/editors/tiptap/toolbar/ColorButton.svelte +299 -0
  67. package/dist/editors/tiptap/toolbar/ColorButton.svelte.d.ts +20 -0
  68. package/dist/editors/tiptap/toolbar/DocumentButton.svelte +58 -0
  69. package/dist/editors/tiptap/toolbar/DocumentButton.svelte.d.ts +9 -0
  70. package/dist/editors/tiptap/toolbar/HeadingButton.svelte +30 -0
  71. package/dist/editors/tiptap/toolbar/HeadingButton.svelte.d.ts +8 -0
  72. package/dist/editors/tiptap/toolbar/HtmlButton.svelte +68 -0
  73. package/dist/editors/tiptap/toolbar/HtmlButton.svelte.d.ts +7 -0
  74. package/dist/editors/tiptap/toolbar/ImageButton.svelte +54 -0
  75. package/dist/editors/tiptap/toolbar/ImageButton.svelte.d.ts +8 -0
  76. package/dist/editors/tiptap/toolbar/ItalicButton.svelte +18 -0
  77. package/dist/editors/tiptap/toolbar/ItalicButton.svelte.d.ts +7 -0
  78. package/dist/editors/tiptap/toolbar/LinkButton.svelte +257 -0
  79. package/dist/editors/tiptap/toolbar/LinkButton.svelte.d.ts +7 -0
  80. package/dist/editors/tiptap/toolbar/OrderedListButton.svelte +18 -0
  81. package/dist/editors/tiptap/toolbar/OrderedListButton.svelte.d.ts +7 -0
  82. package/dist/editors/tiptap/toolbar/RedoButton.svelte +18 -0
  83. package/dist/editors/tiptap/toolbar/RedoButton.svelte.d.ts +7 -0
  84. package/dist/editors/tiptap/toolbar/StrikethroughButton.svelte +18 -0
  85. package/dist/editors/tiptap/toolbar/StrikethroughButton.svelte.d.ts +7 -0
  86. package/dist/editors/tiptap/toolbar/SubscriptButton.svelte +18 -0
  87. package/dist/editors/tiptap/toolbar/SubscriptButton.svelte.d.ts +7 -0
  88. package/dist/editors/tiptap/toolbar/SuperscriptButton.svelte +18 -0
  89. package/dist/editors/tiptap/toolbar/SuperscriptButton.svelte.d.ts +7 -0
  90. package/dist/editors/tiptap/toolbar/TableButton.svelte +258 -0
  91. package/dist/editors/tiptap/toolbar/TableButton.svelte.d.ts +7 -0
  92. package/dist/editors/tiptap/toolbar/ToolbarButton.svelte +84 -0
  93. package/dist/editors/tiptap/toolbar/ToolbarButton.svelte.d.ts +10 -0
  94. package/dist/editors/tiptap/toolbar/UnderlineButton.svelte +18 -0
  95. package/dist/editors/tiptap/toolbar/UnderlineButton.svelte.d.ts +7 -0
  96. package/dist/editors/tiptap/toolbar/UndoButton.svelte +18 -0
  97. package/dist/editors/tiptap/toolbar/UndoButton.svelte.d.ts +7 -0
  98. package/dist/form/Autocomplete.svelte +86 -135
  99. package/dist/form/Autocomplete.svelte.d.ts +6 -8
  100. package/dist/form/AutocompleteMulti.svelte +385 -227
  101. package/dist/form/AutocompleteMulti.svelte.d.ts +59 -10
  102. package/dist/form/Checkbox.svelte +59 -54
  103. package/dist/form/Checkbox.svelte.d.ts +14 -5
  104. package/dist/form/Chips.svelte +29 -13
  105. package/dist/form/Chips.svelte.d.ts +16 -2
  106. package/dist/form/ComboBox.svelte +30 -20
  107. package/dist/form/ComboBox.svelte.d.ts +1 -1
  108. package/dist/form/ComboBoxItemBuilder.svelte +161 -188
  109. package/dist/form/ComboBoxItemBuilder.svelte.d.ts +19 -2
  110. package/dist/form/ComboBoxMulti.svelte +38 -24
  111. package/dist/form/ComboBoxMulti.svelte.d.ts +1 -1
  112. package/dist/form/CronBuilder.svelte +84 -67
  113. package/dist/form/CronBuilder.svelte.d.ts +16 -3
  114. package/dist/form/DatePicker.svelte +148 -195
  115. package/dist/form/DateRangePicker.svelte +101 -98
  116. package/dist/form/DateTimePicker.svelte +167 -208
  117. package/dist/form/DateTimePicker.svelte.d.ts +10 -2
  118. package/dist/form/FormGroup.svelte +33 -10
  119. package/dist/form/FormGroup.svelte.d.ts +12 -2
  120. package/dist/form/Number.svelte +70 -47
  121. package/dist/form/Number.svelte.d.ts +36 -6
  122. package/dist/form/Radio.svelte +18 -18
  123. package/dist/form/RadioGroup.svelte +23 -12
  124. package/dist/form/RadioGroup.svelte.d.ts +13 -2
  125. package/dist/form/SegmentedControl.svelte +76 -56
  126. package/dist/form/SegmentedControl.svelte.d.ts +9 -4
  127. package/dist/form/Select.svelte +150 -233
  128. package/dist/form/Select.svelte.d.ts +29 -5
  129. package/dist/form/SelectMulti.svelte +163 -277
  130. package/dist/form/SelectMulti.svelte.d.ts +36 -7
  131. package/dist/form/Slider.svelte +183 -269
  132. package/dist/form/Slider.svelte.d.ts +32 -17
  133. package/dist/form/StringArrayBuilder.svelte +249 -0
  134. package/dist/form/StringArrayBuilder.svelte.d.ts +15 -0
  135. package/dist/form/Switch.svelte +164 -106
  136. package/dist/form/Switch.svelte.d.ts +22 -3
  137. package/dist/form/TextArea.svelte +49 -29
  138. package/dist/form/TextArea.svelte.d.ts +23 -3
  139. package/dist/form/Textbox.svelte +69 -68
  140. package/dist/form/Textbox.svelte.d.ts +32 -4
  141. package/dist/form/TimePicker.svelte +42 -47
  142. package/dist/form/TimePicker.svelte.d.ts +12 -2
  143. package/dist/form/comboBoxCore.svelte.d.ts +99 -0
  144. package/dist/form/comboBoxCore.svelte.js +243 -0
  145. package/dist/icon/Icon.svelte +8 -3
  146. package/dist/icon/Icon.svelte.d.ts +8 -3
  147. package/dist/icon/file-type-bmp.svg +1 -0
  148. package/dist/icon/file-type-csv.svg +1 -0
  149. package/dist/icon/file-type-doc.svg +1 -0
  150. package/dist/icon/file-type-docx.svg +1 -0
  151. package/dist/icon/file-type-jpg.svg +1 -0
  152. package/dist/icon/file-type-pdf.svg +1 -0
  153. package/dist/icon/file-type-png.svg +1 -0
  154. package/dist/icon/file-type-ppt.svg +1 -0
  155. package/dist/icon/file-type-svg.svg +1 -0
  156. package/dist/icon/file-type-txt.svg +1 -0
  157. package/dist/icon/file-type-xls.svg +1 -0
  158. package/dist/icon/file-type-zip.svg +1 -0
  159. package/dist/icon/index.d.ts +166 -151
  160. package/dist/icon/index.js +166 -152
  161. package/dist/icon/logo-placeholder.svg +6 -0
  162. package/dist/icon/source-code.svg +1 -0
  163. package/dist/icon/sun-moon.svg +1 -0
  164. package/dist/icon/table.svg +6 -0
  165. package/dist/index.d.ts +87 -26
  166. package/dist/index.js +25 -28
  167. package/dist/layout/AppShell.svelte +12 -162
  168. package/dist/layout/AppShell.svelte.d.ts +6 -27
  169. package/dist/layout/CustomNavbar.svelte +9 -7
  170. package/dist/layout/CustomNavbar.svelte.d.ts +4 -2
  171. package/dist/layout/Navbar.svelte +161 -129
  172. package/dist/layout/Navbar.svelte.d.ts +29 -15
  173. package/dist/layout/NavbarItemDisplay.svelte +2 -2
  174. package/dist/layout/NavbarItemView.svelte +182 -0
  175. package/dist/layout/NavbarItemView.svelte.d.ts +10 -0
  176. package/dist/layout/Sidenav.svelte +280 -341
  177. package/dist/layout/Sidenav.svelte.d.ts +36 -4
  178. package/dist/models/ComboBoxItem.d.ts +2 -0
  179. package/dist/models/Employee.d.ts +53 -0
  180. package/dist/models/Employee.js +23 -0
  181. package/dist/models/Hyperlink.d.ts +3 -1
  182. package/dist/models/LinkCollectionItem.d.ts +3 -1
  183. package/dist/models/NavbarItem.d.ts +6 -2
  184. package/dist/theme.svelte.d.ts +0 -1
  185. package/dist/theme.svelte.js +46 -58
  186. package/dist/ui/Accordion.svelte +81 -242
  187. package/dist/ui/Accordion.svelte.d.ts +37 -14
  188. package/dist/ui/AccordionItem.svelte +303 -0
  189. package/dist/ui/AccordionItem.svelte.d.ts +21 -0
  190. package/dist/ui/ActionIcon.svelte +25 -21
  191. package/dist/ui/ActionIcon.svelte.d.ts +15 -2
  192. package/dist/ui/Badge.svelte +163 -171
  193. package/dist/ui/Badge.svelte.d.ts +13 -5
  194. package/dist/ui/Button.svelte +178 -205
  195. package/dist/ui/Button.svelte.d.ts +19 -2
  196. package/dist/ui/ButtonVariant.d.ts +15 -1
  197. package/dist/ui/ContextMenu.svelte +146 -0
  198. package/dist/ui/ContextMenu.svelte.d.ts +37 -0
  199. package/dist/ui/ContextMenuList.svelte +188 -0
  200. package/dist/ui/ContextMenuList.svelte.d.ts +12 -0
  201. package/dist/ui/Dialog.svelte +183 -111
  202. package/dist/ui/Dialog.svelte.d.ts +21 -4
  203. package/dist/ui/Drawer.svelte +237 -184
  204. package/dist/ui/Drawer.svelte.d.ts +20 -2
  205. package/dist/ui/Dropdown.svelte +24 -14
  206. package/dist/ui/Dropdown.svelte.d.ts +11 -2
  207. package/dist/ui/Dropzone.svelte +159 -57
  208. package/dist/ui/Dropzone.svelte.d.ts +29 -2
  209. package/dist/ui/Link.svelte +12 -4
  210. package/dist/ui/Link.svelte.d.ts +8 -2
  211. package/dist/ui/Loader.svelte +23 -18
  212. package/dist/ui/Loader.svelte.d.ts +5 -2
  213. package/dist/ui/Logo.svelte +37 -0
  214. package/dist/ui/Logo.svelte.d.ts +16 -0
  215. package/dist/ui/MultiSortable.svelte +287 -0
  216. package/dist/ui/MultiSortable.svelte.d.ts +50 -0
  217. package/dist/ui/Pagination.svelte +15 -9
  218. package/dist/ui/Pagination.svelte.d.ts +6 -2
  219. package/dist/ui/Popover.svelte +43 -65
  220. package/dist/ui/Popover.svelte.d.ts +14 -5
  221. package/dist/ui/ProgressBar.svelte +28 -30
  222. package/dist/ui/ProgressBarVariant.d.ts +7 -1
  223. package/dist/ui/SegmentedControl.svelte +0 -0
  224. package/dist/ui/SegmentedControl.svelte.d.ts +26 -0
  225. package/dist/ui/Sortable.svelte +163 -0
  226. package/dist/ui/Sortable.svelte.d.ts +47 -0
  227. package/dist/ui/Table.svelte +383 -80
  228. package/dist/ui/Table.svelte.d.ts +43 -2
  229. package/dist/ui/Tabs.svelte +22 -18
  230. package/dist/ui/Tabs.svelte.d.ts +6 -2
  231. package/dist/ui/ThemeSwitcher.svelte +26 -7
  232. package/dist/ui/ThemeSwitcher.svelte.d.ts +4 -2
  233. package/dist/ui/Tooltip.svelte +312 -180
  234. package/dist/ui/Tooltip.svelte.d.ts +4 -3
  235. package/dist/uiTheme.svelte.d.ts +86 -0
  236. package/dist/uiTheme.svelte.js +214 -0
  237. package/dist/util/DateFunctions.js +1 -1
  238. package/dist/util/DragDrop.d.ts +50 -0
  239. package/dist/util/DragDrop.js +154 -0
  240. package/dist/util/NavigateTo.js +2 -2
  241. package/dist/util/dayjs.d.ts +4 -0
  242. package/dist/util/dayjs.js +15 -0
  243. package/package.json +66 -26
  244. package/dist/display/Alert.svelte +0 -179
  245. package/dist/display/Alert.svelte.d.ts +0 -13
  246. package/dist/form/FileInput.svelte +0 -235
  247. package/dist/form/FileInput.svelte.d.ts +0 -23
  248. package/dist/form/PasswordInput.svelte +0 -253
  249. package/dist/form/PasswordInput.svelte.d.ts +0 -34
  250. package/dist/form/Rating.svelte +0 -235
  251. package/dist/form/Rating.svelte.d.ts +0 -21
  252. package/dist/styles/components.css +0 -199
  253. package/dist/styles/dark.css +0 -146
  254. package/dist/styles/index.css +0 -116
  255. package/dist/styles/reset.css +0 -110
  256. package/dist/styles/semantic.css +0 -86
  257. package/dist/styles/tokens.css +0 -203
  258. package/dist/styles/utilities.css +0 -523
  259. package/dist/ui/Breadcrumbs.svelte +0 -131
  260. package/dist/ui/Breadcrumbs.svelte.d.ts +0 -16
  261. package/dist/ui/LoadingOverlay.svelte +0 -53
  262. package/dist/ui/LoadingOverlay.svelte.d.ts +0 -11
  263. package/dist/ui/Progress.svelte +0 -191
  264. package/dist/ui/Progress.svelte.d.ts +0 -15
  265. package/dist/ui/RingProgress.svelte +0 -141
  266. package/dist/ui/RingProgress.svelte.d.ts +0 -18
  267. package/dist/ui/Skeleton.svelte +0 -85
  268. package/dist/ui/Skeleton.svelte.d.ts +0 -12
  269. package/dist/ui/Stepper.svelte +0 -355
  270. package/dist/ui/Stepper.svelte.d.ts +0 -24
  271. package/dist/ui/Timeline.svelte +0 -225
  272. package/dist/ui/Timeline.svelte.d.ts +0 -23
  273. /package/dist/{actions → util}/ClickOutside.d.ts +0 -0
  274. /package/dist/{actions → util}/ClickOutside.js +0 -0
  275. /package/dist/{transitions → util}/Transitions.d.ts +0 -0
  276. /package/dist/{transitions → util}/Transitions.js +0 -0
@@ -1,17 +1,26 @@
1
- import type { Snippet } from "svelte";
2
- type PopoverPosition = "top" | "bottom" | "bottom-left" | "bottom-right" | "left" | "right";
3
- type PopoverTrigger = "click" | "hover";
4
- interface Props {
1
+ import type { Snippet } from 'svelte';
2
+ type PopoverPosition = 'top' | 'bottom' | 'left' | 'right';
3
+ type PopoverTrigger = 'click' | 'hover';
4
+ export interface PopoverProps {
5
+ /** Whether the popover is visible (bindable) */
5
6
  show?: boolean;
7
+ /** Text label for the default trigger button */
6
8
  label?: string | undefined;
9
+ /** Position of the popover relative to trigger */
7
10
  position?: PopoverPosition;
11
+ /** Additional CSS classes */
8
12
  class?: string;
13
+ /** Custom width for the popover content */
9
14
  cssWidth?: string;
15
+ /** Custom trigger button content */
10
16
  button?: Snippet;
17
+ /** Popover content */
11
18
  children?: Snippet;
19
+ /** How to trigger the popover */
12
20
  trigger?: PopoverTrigger;
21
+ /** Delay before showing on hover (ms) */
13
22
  hoverDelay?: number;
14
23
  }
15
- declare const Popover: import("svelte").Component<Props, {}, "show">;
24
+ declare const Popover: import("svelte").Component<PopoverProps, {}, "show">;
16
25
  type Popover = ReturnType<typeof Popover>;
17
26
  export default Popover;
@@ -77,17 +77,13 @@
77
77
  <style>
78
78
  .progress-bar {
79
79
  width: 100%;
80
- background-color: var(--pui-color-gray-200);
80
+ background-color: var(--border-color);
81
81
  overflow: hidden;
82
82
  display: flex;
83
83
  }
84
84
 
85
- :global(.dark) .progress-bar {
86
- background-color: var(--pui-color-dark-border);
87
- }
88
-
89
85
  .rounded {
90
- border-radius: var(--pui-radius-full);
86
+ border-radius: 9999px;
91
87
  }
92
88
 
93
89
  .size-sm {
@@ -117,55 +113,57 @@
117
113
  }
118
114
 
119
115
  .label {
120
- font-weight: var(--pui-font-weight-semibold);
116
+ font-weight: 600;
121
117
  line-height: 1;
122
118
  text-overflow: ellipsis;
123
119
  overflow: hidden;
124
120
  }
125
121
 
126
122
  .size-sm .label {
127
- font-size: var(--pui-font-size-xs);
128
- padding: 0 var(--pui-spacing-half);
123
+ font-size: 0.5rem;
124
+ padding: 0 0.125rem;
129
125
  }
130
126
 
131
127
  .size-md .label {
132
- font-size: var(--pui-font-size-xs);
133
- padding: 0 var(--pui-spacing-2);
128
+ font-size: 0.75rem;
129
+ padding: 0 0.5rem;
134
130
  }
135
131
 
136
132
  .size-lg .label {
137
- font-size: var(--pui-font-size-sm);
138
- padding: 0 var(--pui-spacing-2);
133
+ font-size: 0.875rem;
134
+ padding: 0 0.625rem;
139
135
  }
140
136
 
141
137
  /* Variant colors */
142
- .primary {
143
- background-color: var(--pui-color-primary);
144
- color: var(--pui-color-white);
138
+ .primary,
139
+ .midnight {
140
+ background-color: var(--ui-primary);
141
+ color: #fff;
145
142
  }
146
143
 
147
- .secondary {
148
- background-color: var(--pui-color-secondary);
149
- color: var(--pui-color-primary);
144
+ .accent,
145
+ .pistachio {
146
+ background-color: var(--ui-accent);
147
+ color: var(--ui-primary);
150
148
  }
151
149
 
152
- .accent {
153
- background-color: var(--pui-color-accent);
154
- color: var(--pui-color-white);
150
+ .tertiary,
151
+ .turquoise {
152
+ background-color: var(--ui-tertiary);
153
+ color: var(--ui-primary);
155
154
  }
156
155
 
157
156
  .danger {
158
- background-color: var(--pui-color-danger);
159
- color: var(--pui-color-white);
157
+ background-color: var(--danger-bg);
158
+ color: #fff;
160
159
  }
161
160
 
162
- .success {
163
- background-color: var(--pui-color-success);
164
- color: var(--pui-color-white);
161
+ .secondary {
162
+ background-color: var(--accent-color);
163
+ color: #fff;
165
164
  }
166
165
 
167
- .warning {
168
- background-color: var(--pui-color-warning);
169
- color: var(--pui-color-primary);
166
+ :global(.dark) .secondary {
167
+ color: var(--ui-primary);
170
168
  }
171
169
  </style>
@@ -1 +1,7 @@
1
- export type ProgressBarVariant = 'primary' | 'secondary' | 'accent' | 'danger' | 'success' | 'warning';
1
+ /**
2
+ * Colour variants for ProgressBar. `midnight`, `pistachio` and `turquoise` are
3
+ * legacy aliases for `primary`, `accent` and `tertiary`.
4
+ */
5
+ export type ProgressBarVariant = 'primary' | 'accent' | 'tertiary' | 'danger' | 'secondary' | LegacyProgressBarVariant;
6
+ /** @deprecated Use `primary`, `accent` and `tertiary` instead. */
7
+ export type LegacyProgressBarVariant = 'midnight' | 'pistachio' | 'turquoise';
File without changes
@@ -0,0 +1,26 @@
1
+ export default SegmentedControl;
2
+ type SegmentedControl = SvelteComponent<{
3
+ [x: string]: never;
4
+ }, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> & {
7
+ $$bindings?: string | undefined;
8
+ };
9
+ declare const SegmentedControl: $$__sveltets_2_IsomorphicComponent<{
10
+ [x: string]: never;
11
+ }, {
12
+ [evt: string]: CustomEvent<any>;
13
+ }, {}, {}, string>;
14
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
15
+ new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
16
+ $$bindings?: Bindings;
17
+ } & Exports;
18
+ (internal: unknown, props: {
19
+ $$events?: Events;
20
+ $$slots?: Slots;
21
+ }): Exports & {
22
+ $set?: any;
23
+ $on?: any;
24
+ };
25
+ z_$$bindings?: Bindings;
26
+ }
@@ -0,0 +1,163 @@
1
+ <script lang="ts" module>
2
+ export interface SortableProps<T> {
3
+ /** Items to render — bindable so reorders write back */
4
+ items: T[];
5
+ /** Renders each item. Receives (item, index, dragging). */
6
+ children: import('svelte').Snippet<[T, number, boolean]>;
7
+ /** Stable key per item — defaults to index (not safe for reordered lists with snippets that need identity) */
8
+ getKey?: (item: T, index: number) => string | number;
9
+ /** Layout direction */
10
+ direction?: 'vertical' | 'horizontal';
11
+ /** When true, dragging is disabled */
12
+ disabled?: boolean;
13
+ /** CSS selector for drag handle within each item. When set, drag starts only from this element. */
14
+ handle?: string;
15
+ /** Group name — scopes this list's drag type. Note: Sortable is single-list reorder only; to move
16
+ * items between containers use MultiSortable, whose grouped lists exchange items. */
17
+ group?: string;
18
+ /** FLIP animation duration in ms as items shift during a drag. 0 disables. Requires a stable
19
+ * getKey — with the default index key, reordering swaps content in place and nothing moves. */
20
+ animation?: number;
21
+ /** Fires when the order changes */
22
+ onChange?: (items: T[]) => void;
23
+ class?: string;
24
+ }
25
+ </script>
26
+
27
+ <script lang="ts" generics="T">
28
+ import { flip } from 'svelte/animate';
29
+ import { draggable, droppable, type DragContext } from '../util/DragDrop.js';
30
+
31
+ let {
32
+ items = $bindable(),
33
+ children,
34
+ getKey = (_: T, i: number) => i,
35
+ direction = 'vertical',
36
+ disabled = false,
37
+ handle,
38
+ group = 'default',
39
+ animation = 150,
40
+ onChange,
41
+ class: classes = ''
42
+ }: SortableProps<T> = $props();
43
+
44
+ const SORTABLE_ID = Math.random().toString(36).slice(2);
45
+ const TYPE = $derived(`pui-sortable:${group}`);
46
+
47
+ const reducedMotion =
48
+ typeof window !== 'undefined' && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
49
+ const flipDuration = $derived(reducedMotion ? 0 : animation);
50
+
51
+ interface SortablePayload {
52
+ sortableId: string;
53
+ index: number;
54
+ }
55
+
56
+ let draggingIndex = $state<number | null>(null);
57
+ let container = $state<HTMLElement>();
58
+ /** Order at drag start — restored if the drag is cancelled (Esc or dropped outside the list). */
59
+ let dragSnapshot: T[] | null = null;
60
+ let dropped = false;
61
+
62
+ function isOwnDrag(ctx: DragContext<SortablePayload>) {
63
+ return ctx.payload.sortableId === SORTABLE_ID;
64
+ }
65
+
66
+ /**
67
+ * Live reorder: instead of showing a drop marker, the dragged item moves in the array
68
+ * as the pointer crosses item midpoints and FLIP animates everything into place. The
69
+ * target slot is the number of midpoints (dragged item excluded) the pointer has
70
+ * passed — comparing that against the current index is what keeps this stable while
71
+ * displaced items are still animating under the pointer.
72
+ */
73
+ function handleDragOver(e: DragEvent, ctx: DragContext<SortablePayload>) {
74
+ if (!isOwnDrag(ctx) || draggingIndex === null || !container) return;
75
+ const els = container.querySelectorAll<HTMLElement>(':scope > .pui-sortable-item');
76
+ const pointer = direction === 'vertical' ? e.clientY : e.clientX;
77
+ let target = 0;
78
+ for (let idx = 0; idx < els.length; idx++) {
79
+ if (idx === draggingIndex) continue;
80
+ const rect = els[idx].getBoundingClientRect();
81
+ const mid =
82
+ direction === 'vertical' ? rect.top + rect.height / 2 : rect.left + rect.width / 2;
83
+ if (pointer > mid) target++;
84
+ }
85
+ if (target === draggingIndex) return;
86
+ const next = items.slice();
87
+ const [moved] = next.splice(draggingIndex, 1);
88
+ next.splice(target, 0, moved);
89
+ items = next;
90
+ draggingIndex = target;
91
+ }
92
+
93
+ function handleDrop(ctx: DragContext<SortablePayload>) {
94
+ if (!isOwnDrag(ctx)) return;
95
+ dropped = true;
96
+ const snapshot = dragSnapshot;
97
+ if (snapshot && items.some((item, idx) => item !== snapshot[idx])) {
98
+ onChange?.(items);
99
+ }
100
+ }
101
+ </script>
102
+
103
+ <div
104
+ bind:this={container}
105
+ class="pui-sortable {direction} {classes}"
106
+ use:droppable={{
107
+ accepts: TYPE,
108
+ canDrop: (ctx) => isOwnDrag(ctx as DragContext<SortablePayload>),
109
+ onDragOver: (ctx, e) => handleDragOver(e, ctx as DragContext<SortablePayload>),
110
+ onDrop: (ctx) => handleDrop(ctx as DragContext<SortablePayload>)
111
+ }}
112
+ >
113
+ {#each items as item, i (getKey(item, i))}
114
+ <div
115
+ class="pui-sortable-item"
116
+ class:is-dragging={draggingIndex === i}
117
+ animate:flip={{ duration: flipDuration }}
118
+ use:draggable={{
119
+ payload: { sortableId: SORTABLE_ID, index: i } satisfies SortablePayload,
120
+ type: TYPE,
121
+ source: SORTABLE_ID,
122
+ disabled,
123
+ handle,
124
+ onDragStart: () => {
125
+ draggingIndex = i;
126
+ dragSnapshot = items.slice();
127
+ dropped = false;
128
+ },
129
+ onDragEnd: () => {
130
+ if (!dropped && dragSnapshot) items = dragSnapshot;
131
+ draggingIndex = null;
132
+ dragSnapshot = null;
133
+ }
134
+ }}
135
+ >
136
+ {@render children(item, i, draggingIndex === i)}
137
+ </div>
138
+ {/each}
139
+ </div>
140
+
141
+ <style>
142
+ .pui-sortable {
143
+ display: flex;
144
+ gap: 0.25rem;
145
+ }
146
+
147
+ .pui-sortable.vertical {
148
+ flex-direction: column;
149
+ }
150
+
151
+ .pui-sortable.horizontal {
152
+ flex-direction: row;
153
+ }
154
+
155
+ .pui-sortable-item {
156
+ position: relative;
157
+ transition: opacity 0.15s ease;
158
+ }
159
+
160
+ .pui-sortable-item.is-dragging {
161
+ opacity: 0.35;
162
+ }
163
+ </style>
@@ -0,0 +1,47 @@
1
+ export interface SortableProps<T> {
2
+ /** Items to render — bindable so reorders write back */
3
+ items: T[];
4
+ /** Renders each item. Receives (item, index, dragging). */
5
+ children: import('svelte').Snippet<[T, number, boolean]>;
6
+ /** Stable key per item — defaults to index (not safe for reordered lists with snippets that need identity) */
7
+ getKey?: (item: T, index: number) => string | number;
8
+ /** Layout direction */
9
+ direction?: 'vertical' | 'horizontal';
10
+ /** When true, dragging is disabled */
11
+ disabled?: boolean;
12
+ /** CSS selector for drag handle within each item. When set, drag starts only from this element. */
13
+ handle?: string;
14
+ /** Group name — scopes this list's drag type. Note: Sortable is single-list reorder only; to move
15
+ * items between containers use MultiSortable, whose grouped lists exchange items. */
16
+ group?: string;
17
+ /** FLIP animation duration in ms as items shift during a drag. 0 disables. Requires a stable
18
+ * getKey — with the default index key, reordering swaps content in place and nothing moves. */
19
+ animation?: number;
20
+ /** Fires when the order changes */
21
+ onChange?: (items: T[]) => void;
22
+ class?: string;
23
+ }
24
+ declare function $$render<T>(): {
25
+ props: SortableProps<T>;
26
+ exports: {};
27
+ bindings: "items";
28
+ slots: {};
29
+ events: {};
30
+ };
31
+ declare class __sveltets_Render<T> {
32
+ props(): ReturnType<typeof $$render<T>>['props'];
33
+ events(): ReturnType<typeof $$render<T>>['events'];
34
+ slots(): ReturnType<typeof $$render<T>>['slots'];
35
+ bindings(): "items";
36
+ exports(): {};
37
+ }
38
+ interface $$IsomorphicComponent {
39
+ new <T>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
40
+ $$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
41
+ } & ReturnType<__sveltets_Render<T>['exports']>;
42
+ <T>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
43
+ z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
44
+ }
45
+ declare const Sortable: $$IsomorphicComponent;
46
+ type Sortable<T> = InstanceType<typeof Sortable<T>>;
47
+ export default Sortable;