@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,28 +1,77 @@
1
- import type { ComboBoxItem, FetchFunctionType, SearchFunctionType } from "../models/ComboBoxItem.js";
2
- import { type Snippet } from "svelte";
3
- interface Props {
1
+ import type { ComboBoxGroup, ComboBoxItem, FetchFunctionType, RetrieveLabelFunctionType, SearchFunctionType } from '../models/ComboBoxItem.js';
2
+ import type { Snippet } from 'svelte';
3
+ export interface AutocompleteMultiProps {
4
+ /** HTML name attribute for the input */
5
+ name?: string;
6
+ /** Label text displayed above the input */
4
7
  label?: string;
8
+ /** Array of selected values (bindable) */
5
9
  values?: string[];
10
+ /**
11
+ * Array of full selected item objects (bindable). Can be passed initially to preset
12
+ * the selection with known labels — no `values` or retrieveLabelFunction needed.
13
+ */
6
14
  rawValues?: ComboBoxItem[];
15
+ /** Placeholder text when nothing is selected */
7
16
  placeholder?: string;
17
+ /** Mark field as required (shows asterisk) */
18
+ required?: boolean;
19
+ /** CSS classes for the control element */
8
20
  class?: string;
21
+ /** CSS classes for the container element */
22
+ containerClass?: string;
23
+ /** CSS classes for the FormGroup wrapper */
24
+ groupClass?: string;
25
+ /** Disable the input */
9
26
  disabled?: boolean;
10
- required?: boolean;
27
+ /** Show error state styling */
11
28
  showError?: boolean;
29
+ /** Error message to display */
12
30
  errorText?: string;
31
+ /** Auto-focus the input on mount */
13
32
  autofocus?: boolean;
14
- showNoResultsMessage?: boolean;
33
+ /** Auto-focus on every dialog open */
34
+ autofocusDialog?: boolean;
35
+ /** Hide "no results" message when search finds nothing */
36
+ hideNoResults?: boolean;
37
+ /** Close the dropdown after selecting an option */
38
+ closeOnSelection?: boolean;
39
+ /**
40
+ * Offer to add the typed text as a new chip when it doesn't match an existing option.
41
+ * On by default — set to `false` to restrict selection to the provided options.
42
+ */
43
+ allowAdd?: boolean;
44
+ /** Builds the label shown for the "add new value" suggestion (default: `Add "<value>"`) */
45
+ addItemLabel?: (value: string) => string;
46
+ /** Text shown while loading options */
15
47
  loadingText?: string;
48
+ /** SVG icon displayed on the left side */
49
+ leftIconSvg?: string;
50
+ /** Static list of autocomplete options */
16
51
  options?: ComboBoxItem[];
17
- fetchFunction?: FetchFunctionType;
18
- searchFunction?: SearchFunctionType;
19
- tooltipLocation?: "top" | "bottom" | "left" | "right";
52
+ /** Options organized into groups */
53
+ groupedOptions?: ComboBoxGroup[];
54
+ /** Position of the tooltip */
55
+ tooltipLocation?: 'top' | 'bottom' | 'left' | 'right';
56
+ /** Async function to fetch all options */
57
+ fetchFunction?: FetchFunctionType | null;
58
+ /** Async function to search/filter options based on input */
59
+ searchFunction?: SearchFunctionType | null;
60
+ /** Async function to retrieve labels for values */
61
+ retrieveLabelFunction?: RetrieveLabelFunctionType | null;
62
+ /** Rich tooltip content using a Svelte snippet */
20
63
  tooltipContent?: Snippet;
64
+ /** Simple tooltip text */
21
65
  tooltipText?: string;
66
+ /** Callback when Enter is pressed with the current filter text */
67
+ enterPressed?: (e: string) => void;
68
+ /** Callback when selection changes (returns value strings) */
22
69
  onchange?: (e: string[]) => void;
70
+ /** Callback when selection changes (returns full item objects) */
23
71
  onchangeRaw?: (e: ComboBoxItem[]) => void;
24
- onCreate?: (value: string) => void;
72
+ /** Callback when the user chooses to add the typed value as a new item */
73
+ onItemAdded?: (value: string) => void;
25
74
  }
26
- declare const AutocompleteMulti: import("svelte").Component<Props, {}, "values" | "rawValues">;
75
+ declare const AutocompleteMulti: import("svelte").Component<AutocompleteMultiProps, {}, "values" | "rawValues">;
27
76
  type AutocompleteMulti = ReturnType<typeof AutocompleteMulti>;
28
77
  export default AutocompleteMulti;
@@ -1,33 +1,45 @@
1
- <script lang="ts">
2
- import { Icon, iconInfoCircle } from '../icon/index.js';
3
- import Tooltip from '../ui/Tooltip.svelte';
1
+ <script module lang="ts">
4
2
  import type { Snippet } from 'svelte';
5
3
 
6
- interface Props {
7
- /** HTML name attribute for the checkbox */
4
+ export interface CheckboxProps {
5
+ /** HTML name attribute for the checkbox (falls back to label, then auto-generated) */
8
6
  name?: string;
7
+ /** Label text displayed next to the checkbox */
9
8
  label?: string;
9
+ /** Mark field as required (shows asterisk) */
10
10
  required?: boolean;
11
+ /** Additional CSS classes */
11
12
  class?: string;
13
+ /** Custom ID for the input element */
12
14
  inputId?: string;
15
+ /** Disable the checkbox */
13
16
  disabled?: boolean;
17
+ /** Show error state styling */
14
18
  showError?: boolean;
19
+ /** Error message to display */
15
20
  errorText?: string;
21
+ /** Whether the checkbox is checked (bindable) */
16
22
  checked?: boolean;
17
23
  /** When true, the checkbox state is controlled externally only. Clicking will call onchange but won't toggle the checkbox. */
18
24
  controlled?: boolean;
19
25
  /** Whether the checkbox is in an indeterminate state */
20
26
  indeterminate?: boolean;
27
+ /** Callback when checked state changes */
21
28
  onchange?: (e: boolean) => void;
22
29
  /** Accessible label for screen readers (use when no visible label) */
23
30
  ariaLabel?: string;
24
- /** Rich tooltip content using a Svelte snippet */
25
- tooltipContent?: Snippet;
26
31
  /** Simple tooltip text */
27
32
  tooltipText?: string;
28
33
  /** Position of the tooltip */
29
34
  tooltipLocation?: 'top' | 'bottom' | 'left' | 'right';
35
+ /** Rich tooltip content using a Svelte snippet */
36
+ tooltipContent?: Snippet;
30
37
  }
38
+ </script>
39
+
40
+ <script lang="ts">
41
+ import { Icon, iconInfoCircle } from '../icon/index.js';
42
+ import Tooltip from '../ui/Tooltip.svelte';
31
43
 
32
44
  let {
33
45
  name,
@@ -43,14 +55,16 @@
43
55
  indeterminate = false,
44
56
  onchange = undefined,
45
57
  ariaLabel = undefined,
46
- tooltipContent,
47
- tooltipText,
48
- tooltipLocation = 'top'
49
- }: Props = $props();
58
+ tooltipText = undefined,
59
+ tooltipLocation = 'top',
60
+ tooltipContent = undefined
61
+ }: CheckboxProps = $props();
50
62
 
63
+ const autoName = `checkbox-${crypto.randomUUID()}`;
51
64
  const nonce = Math.random().toString(36).substring(2, 15);
52
- const resolvedName = $derived(
53
- (name || label || `checkbox-${nonce}`).replace(/[^a-zA-Z0-9_\-:.]/g, '_')
65
+
66
+ let resolvedName = $derived(
67
+ (name || label || autoName).replace(/[^a-zA-Z0-9_\-:.]/g, '_')
54
68
  );
55
69
 
56
70
  const id = $derived(inputId ? inputId : label ? `input-${label}` : `input-${nonce}`);
@@ -64,7 +78,7 @@
64
78
  {#if controlled}
65
79
  <input
66
80
  bind:this={inputEl}
67
- class="checkbox {showError && 'error'} {classes}"
81
+ class="checkbox text-base accent-accent mr-1 {showError && 'error'} {classes}"
68
82
  type="checkbox"
69
83
  {id}
70
84
  name={resolvedName}
@@ -79,7 +93,7 @@
79
93
  {:else}
80
94
  <input
81
95
  bind:this={inputEl}
82
- class="checkbox {showError && 'error'} {classes}"
96
+ class="checkbox text-base accent-accent mr-1 {showError && 'error'} {classes}"
83
97
  type="checkbox"
84
98
  {id}
85
99
  name={resolvedName}
@@ -96,7 +110,7 @@
96
110
  {/if}
97
111
  {#if tooltipContent || tooltipText}
98
112
  <Tooltip {tooltipContent} location={tooltipLocation} text={tooltipText}>
99
- <Icon svg={iconInfoCircle} size="1em" />
113
+ <Icon svg={iconInfoCircle} size="1em" stroke="var(--accent-color)" />
100
114
  </Tooltip>
101
115
  {/if}</span
102
116
  >
@@ -107,12 +121,6 @@
107
121
  </div>
108
122
 
109
123
  <style>
110
- .checkbox-container {
111
- display: flex;
112
- align-items: center;
113
- gap: var(--pui-spacing-1_5);
114
- }
115
-
116
124
  label {
117
125
  display: flex;
118
126
  flex-direction: row;
@@ -143,28 +151,28 @@
143
151
  box-sizing: content-box;
144
152
  width: 16px;
145
153
  height: 16px;
146
- border: 2px solid var(--pui-border-disabled);
147
- transition: border-color var(--pui-transition-fast) var(--pui-ease-out);
154
+ border: 2px solid #ccc;
155
+ transition: 0.2s border-color ease;
148
156
  }
149
157
  :global(.dark) input:before {
150
- border-color: var(--pui-color-gray-600);
158
+ border-color: #666;
151
159
  }
152
160
  input:checked:before {
153
- border-color: var(--pui-color-primary);
154
- transition: border-color var(--pui-transition-slower) var(--pui-ease-out);
161
+ border-color: var(--ui-primary);
162
+ transition: 0.5s border-color ease;
155
163
  }
156
164
  :global(.dark) input:checked:before {
157
- border-color: var(--pui-color-primary);
165
+ border-color: var(--ui-accent);
158
166
  }
159
167
 
160
168
  input:disabled:before {
161
- border-color: var(--pui-border-disabled);
162
- background-color: var(--pui-bg-disabled);
169
+ border-color: #ccc;
170
+ background-color: #ccc;
163
171
  opacity: 0.5;
164
172
  }
165
173
  :global(.dark) input:disabled:before {
166
- border-color: var(--pui-color-gray-600);
167
- background-color: var(--pui-color-gray-600);
174
+ border-color: #666;
175
+ background-color: #666;
168
176
  }
169
177
  input:after {
170
178
  content: '';
@@ -174,7 +182,7 @@
174
182
  top: 50%;
175
183
  left: 50%;
176
184
  transform-origin: 50% 50%;
177
- background-color: var(--pui-color-primary);
185
+ background-color: var(--ui-primary);
178
186
  width: 16px;
179
187
  height: 16px;
180
188
  border-radius: 100vh;
@@ -184,11 +192,11 @@
184
192
  opacity: 0.5;
185
193
  }
186
194
  :global(.dark) input:after {
187
- background-color: var(--pui-color-primary);
195
+ background-color: var(--ui-accent);
188
196
  }
189
197
 
190
198
  input[type='checkbox']:before {
191
- border-radius: var(--pui-radius-sm);
199
+ border-radius: 4px;
192
200
  }
193
201
  input[type='checkbox']:after {
194
202
  width: 7px;
@@ -196,49 +204,46 @@
196
204
  border-radius: 0;
197
205
  transform: translate(-50%, -85%) scale(0) rotate(45deg);
198
206
  background-color: transparent;
199
- box-shadow: 4px 4px 0px 0px var(--pui-color-primary);
207
+ box-shadow: 4px 4px 0px 0px var(--ui-primary);
200
208
  }
201
209
  :global(.dark) input[type='checkbox']:after {
202
- box-shadow: 4px 4px 0px 0px var(--pui-color-primary);
210
+ box-shadow: 4px 4px 0px 0px var(--ui-accent);
203
211
  }
204
212
  input[type='checkbox']:checked:after {
205
- -webkit-animation: toggleOnCheckbox var(--pui-transition-fast) var(--pui-ease-out) forwards;
206
- animation: toggleOnCheckbox var(--pui-transition-fast) var(--pui-ease-out) forwards;
213
+ -webkit-animation: toggleOnCheckbox 0.2s ease forwards;
214
+ animation: toggleOnCheckbox 0.2s ease forwards;
207
215
  }
208
-
209
- /* Indeterminate state */
210
216
  input[type='checkbox']:indeterminate:before {
211
- border-color: var(--pui-color-primary);
217
+ border-color: var(--ui-primary);
212
218
  }
213
219
  :global(.dark) input[type='checkbox']:indeterminate:before {
214
- border-color: var(--pui-color-secondary);
220
+ border-color: var(--ui-accent);
215
221
  }
216
222
  input[type='checkbox']:indeterminate:after {
217
223
  width: 10px;
218
224
  height: 2px;
219
225
  border-radius: 1px;
220
- background-color: var(--pui-color-primary);
226
+ background-color: var(--ui-primary);
221
227
  box-shadow: none;
222
228
  transform: translate(-50%, -50%) scale(1);
223
229
  }
224
230
  :global(.dark) input[type='checkbox']:indeterminate:after {
225
- background-color: var(--pui-color-secondary);
231
+ background-color: var(--ui-accent);
226
232
  }
227
-
228
233
  input[type='checkbox'].filled:before {
229
- border-radius: var(--pui-radius-sm);
234
+ border-radius: 4px;
230
235
  transition:
231
- border-color var(--pui-transition-fast) var(--pui-ease-out),
232
- background-color var(--pui-transition-fast) var(--pui-ease-out);
236
+ 0.2s border-color ease,
237
+ 0.2s background-color ease;
233
238
  }
234
239
  input[type='checkbox'].filled:checked:not(:disabled):before {
235
- background-color: var(--pui-color-primary);
240
+ background-color: var(--ui-primary);
236
241
  }
237
242
  :global(.dark) input[type='checkbox'].filled:checked:not(:disabled):before {
238
- background-color: var(--pui-color-primary);
243
+ background-color: var(--ui-accent);
239
244
  }
240
245
  input[type='checkbox'].filled:not(:disabled):after {
241
- box-shadow: 4px 4px 0px 0px var(--pui-color-white);
246
+ box-shadow: 4px 4px 0px 0px white;
242
247
  }
243
248
  @-webkit-keyframes toggleOnCheckbox {
244
249
  0% {
@@ -268,10 +273,10 @@
268
273
  }
269
274
 
270
275
  input.error:before {
271
- border-color: var(--pui-text-danger) !important;
276
+ border-color: var(--danger-text) !important;
272
277
  }
273
278
 
274
279
  .error-text {
275
- color: var(--pui-text-danger);
280
+ color: var(--danger-text);
276
281
  }
277
282
  </style>
@@ -1,29 +1,38 @@
1
1
  import type { Snippet } from 'svelte';
2
- interface Props {
3
- /** HTML name attribute for the checkbox */
2
+ export interface CheckboxProps {
3
+ /** HTML name attribute for the checkbox (falls back to label, then auto-generated) */
4
4
  name?: string;
5
+ /** Label text displayed next to the checkbox */
5
6
  label?: string;
7
+ /** Mark field as required (shows asterisk) */
6
8
  required?: boolean;
9
+ /** Additional CSS classes */
7
10
  class?: string;
11
+ /** Custom ID for the input element */
8
12
  inputId?: string;
13
+ /** Disable the checkbox */
9
14
  disabled?: boolean;
15
+ /** Show error state styling */
10
16
  showError?: boolean;
17
+ /** Error message to display */
11
18
  errorText?: string;
19
+ /** Whether the checkbox is checked (bindable) */
12
20
  checked?: boolean;
13
21
  /** When true, the checkbox state is controlled externally only. Clicking will call onchange but won't toggle the checkbox. */
14
22
  controlled?: boolean;
15
23
  /** Whether the checkbox is in an indeterminate state */
16
24
  indeterminate?: boolean;
25
+ /** Callback when checked state changes */
17
26
  onchange?: (e: boolean) => void;
18
27
  /** Accessible label for screen readers (use when no visible label) */
19
28
  ariaLabel?: string;
20
- /** Rich tooltip content using a Svelte snippet */
21
- tooltipContent?: Snippet;
22
29
  /** Simple tooltip text */
23
30
  tooltipText?: string;
24
31
  /** Position of the tooltip */
25
32
  tooltipLocation?: 'top' | 'bottom' | 'left' | 'right';
33
+ /** Rich tooltip content using a Svelte snippet */
34
+ tooltipContent?: Snippet;
26
35
  }
27
- declare const Checkbox: import("svelte").Component<Props, {}, "checked">;
36
+ declare const Checkbox: import("svelte").Component<CheckboxProps, {}, "checked">;
28
37
  type Checkbox = ReturnType<typeof Checkbox>;
29
38
  export default Checkbox;
@@ -5,7 +5,8 @@
5
5
  import { iconCheck } from '../icon/index.js';
6
6
  import Button from '../ui/Button.svelte';
7
7
 
8
- interface Props {
8
+ export interface ChipsProps {
9
+ /** Label text displayed above the chips */
9
10
  label?: string;
10
11
  /** Visual style variant for chips */
11
12
  variant?: ButtonVariant;
@@ -13,18 +14,31 @@
13
14
  selectedVariant?: ButtonVariant;
14
15
  /** Visual style variant for deselected chips (overrides variant for unselected state) */
15
16
  deselectedVariant?: ButtonVariant;
17
+ /** Available chip options */
16
18
  options: ComboBoxItem[];
19
+ /** Mark field as required (shows asterisk) */
17
20
  required?: boolean;
21
+ /** Show error state styling */
18
22
  showError?: boolean;
23
+ /** Error message to display */
19
24
  errorText?: string;
25
+ /** Additional CSS classes */
20
26
  class?: string;
27
+ /** CSS classes for the container element */
21
28
  containerClass?: string;
29
+ /** Disable all chips */
22
30
  disabled?: boolean;
31
+ /** Selected value for single selection mode (bindable) */
23
32
  value?: string;
33
+ /** Selected values for multiple selection mode (bindable) */
24
34
  values?: string[];
35
+ /** Allow selecting multiple chips */
25
36
  multiple?: boolean;
37
+ /** Allow deselecting the current selection */
26
38
  deselectable?: boolean;
39
+ /** Position of the tooltip */
27
40
  tooltipLocation?: 'top' | 'bottom' | 'left' | 'right';
41
+ /** Callback when selection changes */
28
42
  onchange?: (e: string | string[] | undefined) => void;
29
43
  }
30
44
 
@@ -46,7 +60,7 @@
46
60
  multiple = false,
47
61
  deselectable = true,
48
62
  onchange = undefined
49
- }: Props = $props();
63
+ }: ChipsProps = $props();
50
64
 
51
65
  const nonce = Math.random().toString(36).substring(2, 15);
52
66
  const randomName = $derived(label + nonce);
@@ -70,6 +84,8 @@
70
84
  onchange?.(values.length > 0 ? values : undefined);
71
85
  }
72
86
  }
87
+
88
+
73
89
  </script>
74
90
 
75
91
  <div class="radio-container {containerClass}">
@@ -109,34 +125,34 @@
109
125
  <style>
110
126
  .radio-options {
111
127
  display: flex;
112
- gap: var(--pui-spacing-2);
113
- border-radius: var(--pui-radius-lg);
128
+ gap: 0.5rem;
129
+ border-radius: 6px;
114
130
  }
115
131
 
116
132
  .radio-required {
117
- padding: var(--pui-spacing-1);
133
+ padding: 0.25rem;
118
134
  }
119
135
 
120
136
  .error {
121
- border: 1px solid var(--pui-text-danger);
137
+ border: 1px solid var(--danger-text);
122
138
  }
123
139
 
124
140
  .error-text {
125
- margin-top: var(--pui-spacing-1);
126
- color: var(--pui-text-danger);
141
+ margin-top: 0.25rem;
142
+ color: var(--danger-text);
127
143
  }
128
144
 
129
145
  :global(.chip) {
130
- padding: var(--pui-spacing-1) var(--pui-spacing-4) !important;
131
- border-radius: var(--pui-radius-full) !important;
146
+ padding: 0.25rem 1rem !important;
147
+ border-radius: 5rem !important;
132
148
  }
133
149
 
134
150
  :global(.chip.checked) {
135
- padding-left: var(--pui-spacing-1) !important;
136
- padding-right: var(--pui-spacing-2) !important;
151
+ padding-left: 0.3rem !important;
152
+ padding-right: 0.5rem !important;
137
153
  }
138
154
 
139
155
  :global(.chip .button) {
140
- gap: var(--pui-spacing-1);
156
+ gap: 0.25rem;
141
157
  }
142
158
  </style>
@@ -1,6 +1,7 @@
1
1
  import type { ComboBoxItem } from '../models/ComboBoxItem.js';
2
2
  import type { ButtonVariant } from '../ui/ButtonVariant.js';
3
- interface Props {
3
+ export interface ChipsProps {
4
+ /** Label text displayed above the chips */
4
5
  label?: string;
5
6
  /** Visual style variant for chips */
6
7
  variant?: ButtonVariant;
@@ -8,20 +9,33 @@ interface Props {
8
9
  selectedVariant?: ButtonVariant;
9
10
  /** Visual style variant for deselected chips (overrides variant for unselected state) */
10
11
  deselectedVariant?: ButtonVariant;
12
+ /** Available chip options */
11
13
  options: ComboBoxItem[];
14
+ /** Mark field as required (shows asterisk) */
12
15
  required?: boolean;
16
+ /** Show error state styling */
13
17
  showError?: boolean;
18
+ /** Error message to display */
14
19
  errorText?: string;
20
+ /** Additional CSS classes */
15
21
  class?: string;
22
+ /** CSS classes for the container element */
16
23
  containerClass?: string;
24
+ /** Disable all chips */
17
25
  disabled?: boolean;
26
+ /** Selected value for single selection mode (bindable) */
18
27
  value?: string;
28
+ /** Selected values for multiple selection mode (bindable) */
19
29
  values?: string[];
30
+ /** Allow selecting multiple chips */
20
31
  multiple?: boolean;
32
+ /** Allow deselecting the current selection */
21
33
  deselectable?: boolean;
34
+ /** Position of the tooltip */
22
35
  tooltipLocation?: 'top' | 'bottom' | 'left' | 'right';
36
+ /** Callback when selection changes */
23
37
  onchange?: (e: string | string[] | undefined) => void;
24
38
  }
25
- declare const Chips: import("svelte").Component<Props, {}, "value" | "values">;
39
+ declare const Chips: import("svelte").Component<ChipsProps, {}, "value" | "values">;
26
40
  type Chips = ReturnType<typeof Chips>;
27
41
  export default Chips;
@@ -8,7 +8,7 @@
8
8
  loading: boolean;
9
9
  open: boolean;
10
10
  htmlElement?: HTMLElement | undefined;
11
- showNoResultsMessage: boolean;
11
+ hideNoResults: boolean;
12
12
  loadingText: string;
13
13
  onselection: (value: ComboBoxItem) => void;
14
14
  onkeydown?: (e: KeyboardEvent) => boolean;
@@ -20,7 +20,7 @@
20
20
  loading,
21
21
  open,
22
22
  htmlElement,
23
- showNoResultsMessage,
23
+ hideNoResults,
24
24
  loadingText,
25
25
  onselection: onSelection,
26
26
  onkeydown
@@ -72,7 +72,7 @@
72
72
  {:else if error}
73
73
  <div class="error">{error}</div>
74
74
  {:else if value && options?.length === 0}
75
- {#if showNoResultsMessage}
75
+ {#if !hideNoResults}
76
76
  <div class="no-results">No results found</div>
77
77
  {/if}
78
78
  {:else}
@@ -104,21 +104,32 @@
104
104
  {/if}
105
105
 
106
106
  <style>
107
+ /* .item {
108
+ &:hover,
109
+ &.selected {
110
+ @apply bg-main-border;
111
+ @apply text-accent;
112
+ }
113
+ } */
114
+
107
115
  .combobox {
108
116
  position: absolute;
109
117
  width: 100%;
110
- z-index: var(--pui-z-dropdown);
111
- border-radius: var(--pui-radius-base);
118
+ z-index: 50;
119
+ border-radius: 0.25rem;
112
120
  overflow: hidden;
113
- border: 1px solid var(--pui-border-default);
114
- background-color: var(--pui-input-bg);
121
+ border: 1px solid var(--main-border-color);
122
+ background-color: var(--input-bg-color);
123
+ /* absolute w-full z-50 rounded overflow-hidden
124
+ border border-main-border bg-input */
115
125
  }
116
126
 
117
127
  .combobox-panel {
118
128
  overflow: auto;
119
129
  max-height: 20rem;
120
- border: 1px solid var(--pui-border-default);
130
+ border: 1px solid var(--border-color);
121
131
  border-top: none;
132
+ /* max-h-80 overflow-auto */
122
133
  }
123
134
 
124
135
  .combobox-item {
@@ -127,32 +138,31 @@
127
138
  align-items: center;
128
139
  text-align: left;
129
140
  background-color: transparent;
130
- color: var(--pui-text-primary);
141
+ color: var(--text-color);
131
142
  border: none;
132
- font-size: var(--pui-font-size-md);
143
+ font-size: 1rem;
133
144
  cursor: pointer;
134
- gap: var(--pui-spacing-2);
145
+ gap: 0.5rem;
146
+ /* item w-full flex items-center text-left */
135
147
  }
136
148
 
137
149
  .p-2 {
138
- padding: var(--pui-spacing-2);
150
+ padding: 0.5rem;
139
151
  }
140
152
 
141
- .error,
142
- .loading,
143
- .no-results {
144
- padding: var(--pui-spacing-2);
153
+ .error, .loading, .no-results {
154
+ padding: 0.5rem;
145
155
  }
146
156
 
147
157
  .no-results {
148
- color: var(--pui-text-primary);
149
- border: 1px solid var(--pui-border-default);
158
+ color: var(--text-color);
159
+ border: 1px solid var(--border-color);
150
160
  border-top: none;
151
161
  }
152
162
 
153
163
  .combobox-item.selected,
154
164
  .combobox-item:hover {
155
- background-color: var(--pui-bg-hover);
156
- color: var(--pui-accent-color);
165
+ background-color: var(--border-color);
166
+ color: rgb(var(--accent-color-rgb));
157
167
  }
158
168
  </style>
@@ -5,7 +5,7 @@ interface Props {
5
5
  loading: boolean;
6
6
  open: boolean;
7
7
  htmlElement?: HTMLElement | undefined;
8
- showNoResultsMessage: boolean;
8
+ hideNoResults: boolean;
9
9
  loadingText: string;
10
10
  onselection: (value: ComboBoxItem) => void;
11
11
  onkeydown?: (e: KeyboardEvent) => boolean;