@placeholderco/placeholder-ui 1.0.12 → 2.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 (278) 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/ColorPicker.svelte +957 -0
  107. package/dist/form/ColorPicker.svelte.d.ts +78 -0
  108. package/dist/form/ComboBox.svelte +30 -20
  109. package/dist/form/ComboBox.svelte.d.ts +1 -1
  110. package/dist/form/ComboBoxItemBuilder.svelte +161 -188
  111. package/dist/form/ComboBoxItemBuilder.svelte.d.ts +19 -2
  112. package/dist/form/ComboBoxMulti.svelte +38 -24
  113. package/dist/form/ComboBoxMulti.svelte.d.ts +1 -1
  114. package/dist/form/CronBuilder.svelte +84 -67
  115. package/dist/form/CronBuilder.svelte.d.ts +16 -3
  116. package/dist/form/DatePicker.svelte +148 -195
  117. package/dist/form/DateRangePicker.svelte +101 -98
  118. package/dist/form/DateTimePicker.svelte +167 -208
  119. package/dist/form/DateTimePicker.svelte.d.ts +10 -2
  120. package/dist/form/FormGroup.svelte +33 -10
  121. package/dist/form/FormGroup.svelte.d.ts +12 -2
  122. package/dist/form/Number.svelte +70 -47
  123. package/dist/form/Number.svelte.d.ts +36 -6
  124. package/dist/form/Radio.svelte +18 -18
  125. package/dist/form/RadioGroup.svelte +23 -12
  126. package/dist/form/RadioGroup.svelte.d.ts +13 -2
  127. package/dist/form/SegmentedControl.svelte +76 -56
  128. package/dist/form/SegmentedControl.svelte.d.ts +9 -4
  129. package/dist/form/Select.svelte +150 -233
  130. package/dist/form/Select.svelte.d.ts +29 -5
  131. package/dist/form/SelectMulti.svelte +163 -277
  132. package/dist/form/SelectMulti.svelte.d.ts +36 -7
  133. package/dist/form/Slider.svelte +183 -269
  134. package/dist/form/Slider.svelte.d.ts +32 -17
  135. package/dist/form/StringArrayBuilder.svelte +249 -0
  136. package/dist/form/StringArrayBuilder.svelte.d.ts +15 -0
  137. package/dist/form/Switch.svelte +164 -106
  138. package/dist/form/Switch.svelte.d.ts +22 -3
  139. package/dist/form/TextArea.svelte +49 -29
  140. package/dist/form/TextArea.svelte.d.ts +23 -3
  141. package/dist/form/Textbox.svelte +69 -68
  142. package/dist/form/Textbox.svelte.d.ts +32 -4
  143. package/dist/form/TimePicker.svelte +42 -47
  144. package/dist/form/TimePicker.svelte.d.ts +12 -2
  145. package/dist/form/comboBoxCore.svelte.d.ts +99 -0
  146. package/dist/form/comboBoxCore.svelte.js +243 -0
  147. package/dist/icon/Icon.svelte +8 -3
  148. package/dist/icon/Icon.svelte.d.ts +8 -3
  149. package/dist/icon/file-type-bmp.svg +1 -0
  150. package/dist/icon/file-type-csv.svg +1 -0
  151. package/dist/icon/file-type-doc.svg +1 -0
  152. package/dist/icon/file-type-docx.svg +1 -0
  153. package/dist/icon/file-type-jpg.svg +1 -0
  154. package/dist/icon/file-type-pdf.svg +1 -0
  155. package/dist/icon/file-type-png.svg +1 -0
  156. package/dist/icon/file-type-ppt.svg +1 -0
  157. package/dist/icon/file-type-svg.svg +1 -0
  158. package/dist/icon/file-type-txt.svg +1 -0
  159. package/dist/icon/file-type-xls.svg +1 -0
  160. package/dist/icon/file-type-zip.svg +1 -0
  161. package/dist/icon/index.d.ts +166 -151
  162. package/dist/icon/index.js +166 -152
  163. package/dist/icon/logo-placeholder.svg +6 -0
  164. package/dist/icon/source-code.svg +1 -0
  165. package/dist/icon/sun-moon.svg +1 -0
  166. package/dist/icon/table.svg +6 -0
  167. package/dist/index.d.ts +146 -82
  168. package/dist/index.js +77 -78
  169. package/dist/layout/AppShell.svelte +12 -162
  170. package/dist/layout/AppShell.svelte.d.ts +6 -27
  171. package/dist/layout/CustomNavbar.svelte +9 -7
  172. package/dist/layout/CustomNavbar.svelte.d.ts +4 -2
  173. package/dist/layout/Navbar.svelte +161 -129
  174. package/dist/layout/Navbar.svelte.d.ts +29 -15
  175. package/dist/layout/NavbarItemDisplay.svelte +2 -2
  176. package/dist/layout/NavbarItemView.svelte +182 -0
  177. package/dist/layout/NavbarItemView.svelte.d.ts +10 -0
  178. package/dist/layout/Sidenav.svelte +280 -341
  179. package/dist/layout/Sidenav.svelte.d.ts +36 -4
  180. package/dist/models/ComboBoxItem.d.ts +2 -0
  181. package/dist/models/Employee.d.ts +53 -0
  182. package/dist/models/Employee.js +23 -0
  183. package/dist/models/Hyperlink.d.ts +3 -1
  184. package/dist/models/LinkCollectionItem.d.ts +3 -1
  185. package/dist/models/NavbarItem.d.ts +6 -2
  186. package/dist/theme.svelte.d.ts +0 -1
  187. package/dist/theme.svelte.js +46 -58
  188. package/dist/ui/Accordion.svelte +81 -242
  189. package/dist/ui/Accordion.svelte.d.ts +37 -14
  190. package/dist/ui/AccordionItem.svelte +303 -0
  191. package/dist/ui/AccordionItem.svelte.d.ts +21 -0
  192. package/dist/ui/ActionIcon.svelte +25 -21
  193. package/dist/ui/ActionIcon.svelte.d.ts +15 -2
  194. package/dist/ui/Badge.svelte +163 -171
  195. package/dist/ui/Badge.svelte.d.ts +13 -5
  196. package/dist/ui/Button.svelte +178 -205
  197. package/dist/ui/Button.svelte.d.ts +19 -2
  198. package/dist/ui/ButtonVariant.d.ts +15 -1
  199. package/dist/ui/ContextMenu.svelte +146 -0
  200. package/dist/ui/ContextMenu.svelte.d.ts +37 -0
  201. package/dist/ui/ContextMenuList.svelte +188 -0
  202. package/dist/ui/ContextMenuList.svelte.d.ts +12 -0
  203. package/dist/ui/Dialog.svelte +183 -111
  204. package/dist/ui/Dialog.svelte.d.ts +21 -4
  205. package/dist/ui/Drawer.svelte +237 -184
  206. package/dist/ui/Drawer.svelte.d.ts +20 -2
  207. package/dist/ui/Dropdown.svelte +24 -14
  208. package/dist/ui/Dropdown.svelte.d.ts +11 -2
  209. package/dist/ui/Dropzone.svelte +159 -57
  210. package/dist/ui/Dropzone.svelte.d.ts +29 -2
  211. package/dist/ui/Link.svelte +12 -4
  212. package/dist/ui/Link.svelte.d.ts +8 -2
  213. package/dist/ui/Loader.svelte +23 -18
  214. package/dist/ui/Loader.svelte.d.ts +5 -2
  215. package/dist/ui/Logo.svelte +37 -0
  216. package/dist/ui/Logo.svelte.d.ts +16 -0
  217. package/dist/ui/MultiSortable.svelte +287 -0
  218. package/dist/ui/MultiSortable.svelte.d.ts +50 -0
  219. package/dist/ui/Pagination.svelte +15 -9
  220. package/dist/ui/Pagination.svelte.d.ts +6 -2
  221. package/dist/ui/Popover.svelte +43 -65
  222. package/dist/ui/Popover.svelte.d.ts +14 -5
  223. package/dist/ui/ProgressBar.svelte +28 -30
  224. package/dist/ui/ProgressBarVariant.d.ts +7 -1
  225. package/dist/ui/SegmentedControl.svelte +0 -0
  226. package/dist/ui/SegmentedControl.svelte.d.ts +26 -0
  227. package/dist/ui/Sortable.svelte +163 -0
  228. package/dist/ui/Sortable.svelte.d.ts +47 -0
  229. package/dist/ui/Table.svelte +383 -80
  230. package/dist/ui/Table.svelte.d.ts +43 -2
  231. package/dist/ui/Tabs.svelte +22 -18
  232. package/dist/ui/Tabs.svelte.d.ts +6 -2
  233. package/dist/ui/ThemeSwitcher.svelte +26 -7
  234. package/dist/ui/ThemeSwitcher.svelte.d.ts +4 -2
  235. package/dist/ui/Tooltip.svelte +312 -180
  236. package/dist/ui/Tooltip.svelte.d.ts +4 -3
  237. package/dist/uiTheme.svelte.d.ts +86 -0
  238. package/dist/uiTheme.svelte.js +214 -0
  239. package/dist/util/DateFunctions.js +1 -1
  240. package/dist/util/DragDrop.d.ts +50 -0
  241. package/dist/util/DragDrop.js +154 -0
  242. package/dist/util/NavigateTo.js +2 -2
  243. package/dist/util/dayjs.d.ts +4 -0
  244. package/dist/util/dayjs.js +15 -0
  245. package/package.json +66 -26
  246. package/dist/display/Alert.svelte +0 -179
  247. package/dist/display/Alert.svelte.d.ts +0 -13
  248. package/dist/form/FileInput.svelte +0 -235
  249. package/dist/form/FileInput.svelte.d.ts +0 -23
  250. package/dist/form/PasswordInput.svelte +0 -253
  251. package/dist/form/PasswordInput.svelte.d.ts +0 -34
  252. package/dist/form/Rating.svelte +0 -235
  253. package/dist/form/Rating.svelte.d.ts +0 -21
  254. package/dist/styles/components.css +0 -199
  255. package/dist/styles/dark.css +0 -146
  256. package/dist/styles/index.css +0 -116
  257. package/dist/styles/reset.css +0 -110
  258. package/dist/styles/semantic.css +0 -86
  259. package/dist/styles/tokens.css +0 -203
  260. package/dist/styles/utilities.css +0 -523
  261. package/dist/ui/Breadcrumbs.svelte +0 -131
  262. package/dist/ui/Breadcrumbs.svelte.d.ts +0 -16
  263. package/dist/ui/LoadingOverlay.svelte +0 -53
  264. package/dist/ui/LoadingOverlay.svelte.d.ts +0 -11
  265. package/dist/ui/Progress.svelte +0 -191
  266. package/dist/ui/Progress.svelte.d.ts +0 -15
  267. package/dist/ui/RingProgress.svelte +0 -141
  268. package/dist/ui/RingProgress.svelte.d.ts +0 -18
  269. package/dist/ui/Skeleton.svelte +0 -85
  270. package/dist/ui/Skeleton.svelte.d.ts +0 -12
  271. package/dist/ui/Stepper.svelte +0 -355
  272. package/dist/ui/Stepper.svelte.d.ts +0 -24
  273. package/dist/ui/Timeline.svelte +0 -225
  274. package/dist/ui/Timeline.svelte.d.ts +0 -23
  275. /package/dist/{actions → util}/ClickOutside.d.ts +0 -0
  276. /package/dist/{actions → util}/ClickOutside.js +0 -0
  277. /package/dist/{transitions → util}/Transitions.d.ts +0 -0
  278. /package/dist/{transitions → util}/Transitions.js +0 -0
@@ -1,34 +1,54 @@
1
1
  <script lang="ts">
2
2
  import FormGroup from './FormGroup.svelte';
3
3
 
4
- const autoName = `textarea-${Math.random().toString(36).substring(2, 15)}`;
4
+ const autoName = `textarea-${crypto.randomUUID()}`;
5
5
 
6
- interface Props {
6
+ export interface TextAreaProps {
7
7
  /** HTML name attribute for the textarea (falls back to label, then auto-generated) */
8
8
  name?: string;
9
+ /** Label text displayed above the textarea */
9
10
  label?: string;
11
+ /** Custom ID for the textarea element */
10
12
  inputId?: string;
13
+ /** Placeholder text when textarea is empty */
11
14
  placeholder?: string;
15
+ /** Mark field as required (shows asterisk) */
12
16
  required?: boolean;
17
+ /** Auto-focus the textarea on mount */
13
18
  autofocus?: boolean;
14
- /** HTML autocomplete attribute */
19
+ /** HTML autocomplete attribute for the input */
15
20
  autocomplete?: string;
21
+ /** CSS classes for the FormGroup wrapper */
16
22
  groupClass?: string;
23
+ /** Reference to the textarea DOM element */
17
24
  textboxElement?: HTMLElement;
25
+ /** CSS classes for the textarea element */
18
26
  class?: string;
27
+ /** CSS classes for the container element */
19
28
  containerClass?: string;
29
+ /** Disable the textarea */
20
30
  disabled?: boolean;
31
+ /** Textarea value (bindable) */
21
32
  value?: string;
22
33
  /** Height of the textarea (e.g., '200px', '10rem') */
23
34
  height?: string;
35
+ /** Position of the tooltip */
24
36
  tooltipLocation?: 'top' | 'bottom' | 'left' | 'right';
37
+ /** Tooltip text on hover */
25
38
  tooltipText?: string;
39
+ /** Callback when textarea loses focus */
26
40
  onblur?: (value: string, e: FocusEvent) => void;
41
+ /** Callback when textarea gains focus */
27
42
  onfocus?: (value: string, e: FocusEvent) => void;
43
+ /** Callback when value changes */
28
44
  onchange?: (e: Event) => void;
45
+ /** Callback on input event */
29
46
  oninput?: (e: Event) => void;
47
+ /** Callback on keydown event */
30
48
  onkeydown?: (e: KeyboardEvent) => void;
49
+ /** Callback on keypress event */
31
50
  onkeypress?: (e: KeyboardEvent) => void;
51
+ /** Callback on keyup event */
32
52
  onkeyup?: (e: KeyboardEvent) => void;
33
53
  }
34
54
 
@@ -56,7 +76,7 @@
56
76
  onkeydown = undefined,
57
77
  onkeypress = undefined,
58
78
  onkeyup = undefined
59
- }: Props = $props();
79
+ }: TextAreaProps = $props();
60
80
 
61
81
  let resolvedName = $derived(
62
82
  (name || label || autoName).replace(/[^a-zA-Z0-9_\-:.]/g, '_')
@@ -79,7 +99,7 @@
79
99
  {disabled}
80
100
  {autofocus}
81
101
  {required}
82
- autocomplete={autocomplete as AutoFill}
102
+ autocomplete={autocomplete as any}
83
103
  style={height ? `height: ${height}` : undefined}
84
104
  bind:value
85
105
  bind:this={textboxElement}
@@ -99,65 +119,65 @@
99
119
  display: block;
100
120
  width: 100%;
101
121
  min-height: calc(2.25rem + 2px);
102
- padding: var(--pui-spacing-2);
103
- font-size: var(--pui-font-size-md);
104
- font-weight: var(--pui-font-weight-normal);
105
- line-height: var(--pui-line-height-normal);
106
- color: var(--pui-input-text);
107
- background-color: var(--pui-input-bg);
122
+ padding: 0.5rem;
123
+ font-size: 1rem;
124
+ font-weight: 400;
125
+ line-height: 1.5;
126
+ color: var(--text-base);
127
+ background-color: var(--input-bg-color);
108
128
  background-image: none;
109
- border: 1px solid var(--pui-input-border);
110
- border-radius: var(--pui-radius-md);
129
+ border: 1px solid var(--border-color);
130
+ border-radius: 0.375rem;
111
131
  appearance: none;
112
- transition: border-color var(--pui-transition-fast) var(--pui-ease-in-out);
132
+ transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
113
133
  resize: vertical;
114
134
 
115
135
  &::placeholder {
116
- color: var(--pui-text-placeholder);
136
+ color: #6c757d;
117
137
  opacity: 1;
118
138
  }
119
139
 
120
140
  &:focus {
121
- border-color: var(--pui-color-primary);
141
+ border-color: var(--ui-primary);
122
142
  outline: 0;
123
143
  box-shadow: none;
124
144
  }
125
145
 
126
146
  &:disabled {
127
- background-color: var(--pui-bg-disabled);
128
- opacity: 1;
147
+ background-color: var(--border-color);
148
+ opacity: 0.5;
129
149
  cursor: not-allowed;
130
150
  }
131
151
  }
132
152
 
133
153
  :global(.dark) textarea {
134
- background-color: var(--pui-input-bg);
135
- color: var(--pui-input-text);
136
- border-color: var(--pui-input-border);
154
+ background-color: var(--input-bg-color);
155
+ color: var(--text-base);
156
+ border-color: var(--border-color);
137
157
 
138
158
  &::placeholder {
139
- color: var(--pui-text-placeholder);
159
+ color: #9ca3af;
140
160
  }
141
161
 
142
162
  &:focus {
143
- border-color: var(--pui-color-secondary);
163
+ border-color: var(--ui-accent);
144
164
  }
145
165
 
146
166
  &:disabled {
147
- background-color: var(--pui-bg-disabled);
148
- color: var(--pui-input-text);
167
+ background-color: var(--border-color);
168
+ opacity: 0.5;
149
169
  }
150
170
  }
151
171
 
152
172
  /* Fix for resize handle in dark mode */
153
173
  :global(.dark) textarea::-webkit-resizer {
154
- background-color: var(--pui-color-gray-700);
155
- border-color: var(--pui-border-default);
174
+ background-color: #2f353b;
175
+ border-color: var(--border-color);
156
176
  }
157
177
 
158
178
  .loader {
159
179
  position: absolute;
160
- right: var(--pui-spacing-2);
161
- top: var(--pui-spacing-2);
180
+ right: 8px;
181
+ top: 8px;
162
182
  }
163
183
  </style>
@@ -1,31 +1,51 @@
1
- interface Props {
1
+ export interface TextAreaProps {
2
2
  /** HTML name attribute for the textarea (falls back to label, then auto-generated) */
3
3
  name?: string;
4
+ /** Label text displayed above the textarea */
4
5
  label?: string;
6
+ /** Custom ID for the textarea element */
5
7
  inputId?: string;
8
+ /** Placeholder text when textarea is empty */
6
9
  placeholder?: string;
10
+ /** Mark field as required (shows asterisk) */
7
11
  required?: boolean;
12
+ /** Auto-focus the textarea on mount */
8
13
  autofocus?: boolean;
9
- /** HTML autocomplete attribute */
14
+ /** HTML autocomplete attribute for the input */
10
15
  autocomplete?: string;
16
+ /** CSS classes for the FormGroup wrapper */
11
17
  groupClass?: string;
18
+ /** Reference to the textarea DOM element */
12
19
  textboxElement?: HTMLElement;
20
+ /** CSS classes for the textarea element */
13
21
  class?: string;
22
+ /** CSS classes for the container element */
14
23
  containerClass?: string;
24
+ /** Disable the textarea */
15
25
  disabled?: boolean;
26
+ /** Textarea value (bindable) */
16
27
  value?: string;
17
28
  /** Height of the textarea (e.g., '200px', '10rem') */
18
29
  height?: string;
30
+ /** Position of the tooltip */
19
31
  tooltipLocation?: 'top' | 'bottom' | 'left' | 'right';
32
+ /** Tooltip text on hover */
20
33
  tooltipText?: string;
34
+ /** Callback when textarea loses focus */
21
35
  onblur?: (value: string, e: FocusEvent) => void;
36
+ /** Callback when textarea gains focus */
22
37
  onfocus?: (value: string, e: FocusEvent) => void;
38
+ /** Callback when value changes */
23
39
  onchange?: (e: Event) => void;
40
+ /** Callback on input event */
24
41
  oninput?: (e: Event) => void;
42
+ /** Callback on keydown event */
25
43
  onkeydown?: (e: KeyboardEvent) => void;
44
+ /** Callback on keypress event */
26
45
  onkeypress?: (e: KeyboardEvent) => void;
46
+ /** Callback on keyup event */
27
47
  onkeyup?: (e: KeyboardEvent) => void;
28
48
  }
29
- declare const TextArea: import("svelte").Component<Props, {}, "value">;
49
+ declare const TextArea: import("svelte").Component<TextAreaProps, {}, "value">;
30
50
  type TextArea = ReturnType<typeof TextArea>;
31
51
  export default TextArea;
@@ -4,44 +4,72 @@
4
4
  import Loader from '../ui/Loader.svelte';
5
5
  import Icon from '../icon/Icon.svelte';
6
6
 
7
- const autoName = `textbox-${Math.random().toString(36).substring(2, 15)}`;
7
+ const autoName = `textbox-${crypto.randomUUID()}`;
8
8
 
9
- interface Props {
9
+ export interface TextboxProps {
10
10
  /** HTML name attribute for the input (falls back to label, then auto-generated) */
11
11
  name?: string;
12
+ /** Label text displayed above the input */
12
13
  label?: string;
14
+ /** Custom ID for the input element */
13
15
  inputId?: string;
16
+ /** Placeholder text when input is empty */
14
17
  placeholder?: string;
18
+ /** Mark field as required (shows asterisk) */
15
19
  required?: boolean;
20
+ /** Auto-focus the input on mount */
16
21
  autofocus?: boolean;
17
22
  /** HTML autocomplete attribute for the input */
18
23
  autocomplete?: string;
19
- preventPasswordSave?: boolean;
24
+ /** Show loading spinner inside the input */
20
25
  loading?: boolean;
26
+ /** CSS classes for the FormGroup wrapper */
21
27
  groupClass?: string;
28
+ /** Reference to the input DOM element (bindable) */
22
29
  textboxElement?: HTMLElement;
30
+ /** SVG icon displayed on the left side */
23
31
  leftIconSvg?: string;
32
+ /** CSS classes for the input element */
24
33
  class?: string;
34
+ /** CSS classes for the container element */
25
35
  containerClass?: string;
36
+ /** Disable the input */
26
37
  disabled?: boolean;
38
+ /** Input value (bindable) */
27
39
  value?: string;
40
+ /** Whether the input is currently focused */
28
41
  isFocused?: boolean;
42
+ /** Show error state styling */
29
43
  showError?: boolean;
44
+ /** Error message to display */
30
45
  errorText?: string;
46
+ /** Position of the tooltip */
31
47
  tooltipLocation?: 'top' | 'bottom' | 'left' | 'right';
32
48
  /** Rich tooltip content using a Svelte snippet */
33
49
  tooltipContent?: Snippet;
50
+ /** Tooltip text on hover */
34
51
  tooltipText?: string;
35
- onenter?: (v: string) => void;
52
+ /** Callback when Enter key is pressed */
53
+ onenter?: (value: string) => void;
54
+ /** Callback when value changes */
36
55
  onchange?: (e: Event) => void;
56
+ /** Callback on input event */
37
57
  oninput?: (e: Event) => void;
58
+ /** Callback on keydown event */
38
59
  onkeydown?: (e: KeyboardEvent) => void;
60
+ /** Callback on keypress event */
39
61
  onkeypress?: (e: KeyboardEvent) => void;
62
+ /** Callback on keyup event */
40
63
  onkeyup?: (e: KeyboardEvent) => void;
64
+ /** Callback when input gains focus */
41
65
  onfocus?: (value: string, e: FocusEvent) => void;
66
+ /** Callback when input loses focus */
42
67
  onblur?: (value: string, e: FocusEvent) => void;
68
+ /** Content to render on the right side of the input */
43
69
  right?: Snippet;
70
+ /** Additional content below the input */
44
71
  children?: Snippet;
72
+ /** Input type */
45
73
  type?: 'text' | 'password' | 'email' | 'number' | 'search' | 'tel' | 'url';
46
74
  }
47
75
 
@@ -53,7 +81,6 @@
53
81
  required = false,
54
82
  autofocus = false,
55
83
  autocomplete = undefined,
56
- preventPasswordSave = false,
57
84
  loading = false,
58
85
  class: classes = '',
59
86
  containerClass = '',
@@ -79,22 +106,18 @@
79
106
  right,
80
107
  children,
81
108
  type = 'text'
82
- }: Props = $props();
109
+ }: TextboxProps = $props();
83
110
 
84
- // Generate ID on client-side only to avoid hydration mismatches
85
- let autoId = $state('');
86
-
87
- $effect(() => {
88
- if (!inputId && !label) {
89
- autoId = Math.random().toString(36).substring(2, 8);
90
- }
91
- });
111
+ let resolvedName = $derived(
112
+ (name || label || autoName).replace(/[^a-zA-Z0-9_\-:.]/g, '_')
113
+ );
92
114
 
93
115
  let id = $derived.by(() => {
94
116
  if (inputId) return inputId;
95
117
  // convert label to lowercase, replace spaces with hyphens
96
118
  if (label) return `input-${label.toLowerCase().replace(/ /g, '-')}`;
97
- return autoId;
119
+ // generate 6 character random string
120
+ return Math.random().toString(36).substring(2, 8);
98
121
  });
99
122
 
100
123
  const extraClasses: string[] = $derived.by(() => {
@@ -106,20 +129,10 @@
106
129
 
107
130
  return classes;
108
131
  });
109
-
110
- const resolvedName = $derived(
111
- (name || label || autoName).replace(/[^a-zA-Z0-9_\-:.]/g, '_')
112
- );
113
-
114
- const autocompleteValue = $derived.by(() => {
115
- if (autocomplete) return autocomplete;
116
- if (type === 'password' && preventPasswordSave) return 'one-time-code';
117
- return 'on';
118
- });
119
132
  </script>
120
133
 
121
134
  <div class="textbox-container {containerClass}">
122
- <FormGroup {label} {required} {id} class={groupClass} {tooltipLocation} {tooltipText} {tooltipContent}>
135
+ <FormGroup {label} {required} {id} class={groupClass} {tooltipLocation} {tooltipContent} {tooltipText}>
123
136
  <div class="textbox-input">
124
137
  <!-- svelte-ignore a11y_autofocus -->
125
138
  <input
@@ -131,7 +144,7 @@
131
144
  {disabled}
132
145
  {autofocus}
133
146
  {required}
134
- autocomplete={autocompleteValue as AutoFill}
147
+ autocomplete={autocomplete as any}
135
148
  bind:value
136
149
  bind:this={textboxElement}
137
150
  onblur={(e) => {
@@ -159,11 +172,16 @@
159
172
  </div>
160
173
  {/if}
161
174
  {#if loading}
162
- <div class="loader" class:loader-left={!!leftIconSvg}>
175
+ <div
176
+ class="absolute
177
+ top-1/2 -translate-y-1/2
178
+ -translate-x-1/2
179
+ {leftIconSvg ? 'left-4' : 'right-0'}"
180
+ >
163
181
  <Loader sizeOverride="1.1rem" />
164
182
  </div>
165
183
  {:else}
166
- <div class="right-slot">
184
+ <div class="contents">
167
185
  {@render right?.()}
168
186
  </div>
169
187
  {/if}
@@ -183,29 +201,30 @@
183
201
 
184
202
  .textbox {
185
203
  width: 100%;
186
- font-size: var(--pui-font-size-md);
187
- line-height: var(--pui-line-height-normal);
188
- padding: var(--pui-spacing-1) var(--pui-spacing-2);
189
- border: 1px solid var(--pui-input-border);
190
- background-color: var(--pui-input-bg);
191
- color: var(--pui-input-text);
192
- border-radius: var(--pui-radius-base);
204
+ font-size: 1rem;
205
+ line-height: 1.5rem;
206
+ padding: 0.25rem;
207
+ border: 1px solid var(--border-color);
208
+ background-color: var(--input-bg-color);
209
+ color: var(--text-color);
210
+ border-radius: 0.25rem;
211
+ padding: 0.25rem 0.5rem;
193
212
  box-sizing: border-box;
194
213
  }
195
214
 
196
215
  .textbox.disabled {
197
216
  opacity: 0.5;
198
217
  cursor: not-allowed;
199
- background: var(--pui-input-bg-disabled);
218
+ background: var(--border-color);
200
219
  }
201
220
 
202
221
  .textbox:focus {
203
- border-color: var(--pui-input-border-focus);
222
+ border-color: var(--accent-color);
204
223
  outline: 2px solid transparent;
205
- outline-offset: var(--pui-focus-ring-offset);
224
+ outline-offset: 2px;
206
225
 
207
226
  & ~ .left-icon {
208
- color: var(--pui-input-border-focus);
227
+ color: var(--accent-color);
209
228
  }
210
229
  }
211
230
 
@@ -214,47 +233,29 @@
214
233
  border-bottom-right-radius: 0;
215
234
  }
216
235
 
217
- .right-slot {
218
- display: flex;
219
- }
220
-
221
- .right-slot :global(> *) {
222
- border-top-left-radius: 0;
223
- border-bottom-left-radius: 0;
224
- border-left: none;
225
- }
226
-
227
236
  .with-left-icon {
228
- padding-left: var(--pui-spacing-8);
237
+ padding-left: 2rem;
229
238
  }
230
239
 
231
240
  .left-icon {
241
+ /* absolute {isFocused ? 'text-accent' : 'text-neutral-500'}
242
+ pointer-events-none
243
+ top-1/2 -translate-y-1/2
244
+ left-4 -translate-x-1/2 */
245
+
232
246
  position: absolute;
233
247
  pointer-events: none;
234
248
  top: 50%;
235
249
  transform: translateY(-40%);
236
- left: var(--pui-spacing-2);
237
- color: var(--pui-text-muted);
238
- }
239
-
240
- .loader {
241
- position: absolute;
242
- right: var(--pui-spacing-2);
243
- top: 50%;
244
- transform: translateY(-50%);
245
- pointer-events: none;
246
- }
247
-
248
- .loader.loader-left {
249
- right: auto;
250
- left: var(--pui-spacing-2);
250
+ left: 0.5rem;
251
+ color: rgb(115 115 115);
251
252
  }
252
253
 
253
254
  .show-error {
254
- border-color: var(--pui-text-danger);
255
+ border-color: var(--danger-text);
255
256
  }
256
257
 
257
258
  .text-error {
258
- color: var(--pui-text-danger);
259
+ color: var(--danger-text);
259
260
  }
260
261
  </style>
@@ -1,42 +1,70 @@
1
1
  import { type Snippet } from 'svelte';
2
- interface Props {
2
+ export interface TextboxProps {
3
3
  /** HTML name attribute for the input (falls back to label, then auto-generated) */
4
4
  name?: string;
5
+ /** Label text displayed above the input */
5
6
  label?: string;
7
+ /** Custom ID for the input element */
6
8
  inputId?: string;
9
+ /** Placeholder text when input is empty */
7
10
  placeholder?: string;
11
+ /** Mark field as required (shows asterisk) */
8
12
  required?: boolean;
13
+ /** Auto-focus the input on mount */
9
14
  autofocus?: boolean;
10
15
  /** HTML autocomplete attribute for the input */
11
16
  autocomplete?: string;
12
- preventPasswordSave?: boolean;
17
+ /** Show loading spinner inside the input */
13
18
  loading?: boolean;
19
+ /** CSS classes for the FormGroup wrapper */
14
20
  groupClass?: string;
21
+ /** Reference to the input DOM element (bindable) */
15
22
  textboxElement?: HTMLElement;
23
+ /** SVG icon displayed on the left side */
16
24
  leftIconSvg?: string;
25
+ /** CSS classes for the input element */
17
26
  class?: string;
27
+ /** CSS classes for the container element */
18
28
  containerClass?: string;
29
+ /** Disable the input */
19
30
  disabled?: boolean;
31
+ /** Input value (bindable) */
20
32
  value?: string;
33
+ /** Whether the input is currently focused */
21
34
  isFocused?: boolean;
35
+ /** Show error state styling */
22
36
  showError?: boolean;
37
+ /** Error message to display */
23
38
  errorText?: string;
39
+ /** Position of the tooltip */
24
40
  tooltipLocation?: 'top' | 'bottom' | 'left' | 'right';
25
41
  /** Rich tooltip content using a Svelte snippet */
26
42
  tooltipContent?: Snippet;
43
+ /** Tooltip text on hover */
27
44
  tooltipText?: string;
28
- onenter?: (v: string) => void;
45
+ /** Callback when Enter key is pressed */
46
+ onenter?: (value: string) => void;
47
+ /** Callback when value changes */
29
48
  onchange?: (e: Event) => void;
49
+ /** Callback on input event */
30
50
  oninput?: (e: Event) => void;
51
+ /** Callback on keydown event */
31
52
  onkeydown?: (e: KeyboardEvent) => void;
53
+ /** Callback on keypress event */
32
54
  onkeypress?: (e: KeyboardEvent) => void;
55
+ /** Callback on keyup event */
33
56
  onkeyup?: (e: KeyboardEvent) => void;
57
+ /** Callback when input gains focus */
34
58
  onfocus?: (value: string, e: FocusEvent) => void;
59
+ /** Callback when input loses focus */
35
60
  onblur?: (value: string, e: FocusEvent) => void;
61
+ /** Content to render on the right side of the input */
36
62
  right?: Snippet;
63
+ /** Additional content below the input */
37
64
  children?: Snippet;
65
+ /** Input type */
38
66
  type?: 'text' | 'password' | 'email' | 'number' | 'search' | 'tel' | 'url';
39
67
  }
40
- declare const Textbox: import("svelte").Component<Props, {}, "value" | "textboxElement">;
68
+ declare const Textbox: import("svelte").Component<TextboxProps, {}, "value" | "textboxElement">;
41
69
  type Textbox = ReturnType<typeof Textbox>;
42
70
  export default Textbox;