@placeholderco/placeholder-ui 1.0.11 → 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.
- package/LICENSE +1 -1
- package/README.md +134 -130
- package/dist/app.css +178 -0
- package/dist/bootstrap.min.css +3600 -0
- package/dist/cards/GitCard.svelte +115 -0
- package/dist/cards/GitCard.svelte.d.ts +22 -0
- package/dist/display/Avatar.svelte +29 -17
- package/dist/display/Avatar.svelte.d.ts +12 -2
- package/dist/display/LinkCollection.svelte +40 -18
- package/dist/display/LinkCollection.svelte.d.ts +9 -2
- package/dist/display/Paper.svelte +31 -19
- package/dist/display/Paper.svelte.d.ts +12 -3
- package/dist/display/alert/Alert.svelte +129 -0
- package/dist/display/alert/Alert.svelte.d.ts +15 -0
- package/dist/display/alert/AlertVariant.d.ts +1 -0
- package/dist/display/alert/AlertVariant.js +1 -0
- package/dist/display/filetree/FileTree.svelte +259 -0
- package/dist/display/filetree/FileTree.svelte.d.ts +76 -0
- package/dist/display/filetree/FileTreeItem.svelte +396 -0
- package/dist/display/filetree/FileTreeItem.svelte.d.ts +40 -0
- package/dist/display/filetree/FileTreeNode.d.ts +46 -0
- package/dist/display/filetree/FileTreeNode.js +115 -0
- package/dist/display/filetree/index.d.ts +5 -0
- package/dist/display/filetree/index.js +3 -0
- package/dist/editors/CodeMirror.svelte +306 -0
- package/dist/editors/CodeMirror.svelte.d.ts +31 -0
- package/dist/editors/tiptap/LinkActionMenu.svelte +307 -0
- package/dist/editors/tiptap/LinkActionMenu.svelte.d.ts +8 -0
- package/dist/editors/tiptap/TipTap.svelte +856 -0
- package/dist/editors/tiptap/TipTap.svelte.d.ts +54 -0
- package/dist/editors/tiptap/TipTapBubble.svelte +790 -0
- package/dist/editors/tiptap/TipTapBubble.svelte.d.ts +44 -0
- package/dist/editors/tiptap/collaboration.d.ts +55 -0
- package/dist/editors/tiptap/collaboration.js +1 -0
- package/dist/editors/tiptap/extensions/Alert.d.ts +18 -0
- package/dist/editors/tiptap/extensions/Alert.js +72 -0
- package/dist/editors/tiptap/extensions/CodeBlockEditor.d.ts +21 -0
- package/dist/editors/tiptap/extensions/CodeBlockEditor.js +326 -0
- package/dist/editors/tiptap/extensions/Div.d.ts +19 -0
- package/dist/editors/tiptap/extensions/Div.js +89 -0
- package/dist/editors/tiptap/extensions/Span.d.ts +5 -0
- package/dist/editors/tiptap/extensions/Span.js +56 -0
- package/dist/editors/tiptap/extensions/codeBlockEditor.css +236 -0
- package/dist/editors/tiptap/extensions/codeBlockLanguages.d.ts +17 -0
- package/dist/editors/tiptap/extensions/codeBlockLanguages.js +124 -0
- package/dist/editors/tiptap/extensions/index.d.ts +7 -0
- package/dist/editors/tiptap/extensions/index.js +5 -0
- package/dist/editors/tiptap/toolbar/AlertButton.svelte +261 -0
- package/dist/editors/tiptap/toolbar/AlertButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/AlignCenterButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/AlignCenterButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/AlignJustifyButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/AlignJustifyButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/AlignLeftButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/AlignLeftButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/AlignRightButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/AlignRightButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/BoldButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/BoldButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/BulletListButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/BulletListButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/CodeBlockButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/CodeBlockButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/CodeButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/CodeButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/ColorButton.svelte +299 -0
- package/dist/editors/tiptap/toolbar/ColorButton.svelte.d.ts +20 -0
- package/dist/editors/tiptap/toolbar/DocumentButton.svelte +58 -0
- package/dist/editors/tiptap/toolbar/DocumentButton.svelte.d.ts +9 -0
- package/dist/editors/tiptap/toolbar/HeadingButton.svelte +30 -0
- package/dist/editors/tiptap/toolbar/HeadingButton.svelte.d.ts +8 -0
- package/dist/editors/tiptap/toolbar/HtmlButton.svelte +68 -0
- package/dist/editors/tiptap/toolbar/HtmlButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/ImageButton.svelte +54 -0
- package/dist/editors/tiptap/toolbar/ImageButton.svelte.d.ts +8 -0
- package/dist/editors/tiptap/toolbar/ItalicButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/ItalicButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/LinkButton.svelte +257 -0
- package/dist/editors/tiptap/toolbar/LinkButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/OrderedListButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/OrderedListButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/RedoButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/RedoButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/StrikethroughButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/StrikethroughButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/SubscriptButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/SubscriptButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/SuperscriptButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/SuperscriptButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/TableButton.svelte +258 -0
- package/dist/editors/tiptap/toolbar/TableButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/ToolbarButton.svelte +84 -0
- package/dist/editors/tiptap/toolbar/ToolbarButton.svelte.d.ts +10 -0
- package/dist/editors/tiptap/toolbar/UnderlineButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/UnderlineButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/UndoButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/UndoButton.svelte.d.ts +7 -0
- package/dist/form/Autocomplete.svelte +270 -137
- package/dist/form/Autocomplete.svelte.d.ts +58 -10
- package/dist/form/AutocompleteMulti.svelte +385 -227
- package/dist/form/AutocompleteMulti.svelte.d.ts +59 -10
- package/dist/form/Checkbox.svelte +124 -43
- package/dist/form/Checkbox.svelte.d.ts +26 -2
- package/dist/form/Chips.svelte +47 -17
- package/dist/form/Chips.svelte.d.ts +24 -3
- package/dist/form/ComboBox.svelte +30 -20
- package/dist/form/ComboBox.svelte.d.ts +1 -1
- package/dist/form/ComboBoxItemBuilder.svelte +161 -188
- package/dist/form/ComboBoxItemBuilder.svelte.d.ts +19 -2
- package/dist/form/ComboBoxMulti.svelte +38 -24
- package/dist/form/ComboBoxMulti.svelte.d.ts +1 -1
- package/dist/form/CronBuilder.svelte +84 -67
- package/dist/form/CronBuilder.svelte.d.ts +16 -3
- package/dist/form/DatePicker.svelte +177 -191
- package/dist/form/DatePicker.svelte.d.ts +17 -2
- package/dist/form/DateRangePicker.svelte +775 -0
- package/dist/form/DateRangePicker.svelte.d.ts +23 -0
- package/dist/form/DateTimePicker.svelte +168 -209
- package/dist/form/DateTimePicker.svelte.d.ts +10 -2
- package/dist/form/FormGroup.svelte +33 -10
- package/dist/form/FormGroup.svelte.d.ts +12 -2
- package/dist/form/Number.svelte +71 -29
- package/dist/form/Number.svelte.d.ts +39 -6
- package/dist/form/Radio.svelte +174 -0
- package/dist/form/Radio.svelte.d.ts +21 -0
- package/dist/form/RadioGroup.svelte +52 -138
- package/dist/form/RadioGroup.svelte.d.ts +19 -2
- package/dist/form/SegmentedControl.svelte +103 -57
- package/dist/form/SegmentedControl.svelte.d.ts +12 -2
- package/dist/form/Select.svelte +160 -229
- package/dist/form/Select.svelte.d.ts +35 -6
- package/dist/form/SelectMulti.svelte +166 -277
- package/dist/form/SelectMulti.svelte.d.ts +37 -6
- package/dist/form/Slider.svelte +185 -268
- package/dist/form/Slider.svelte.d.ts +33 -16
- package/dist/form/StringArrayBuilder.svelte +249 -0
- package/dist/form/StringArrayBuilder.svelte.d.ts +15 -0
- package/dist/form/Switch.svelte +164 -106
- package/dist/form/Switch.svelte.d.ts +22 -3
- package/dist/form/TextArea.svelte +80 -45
- package/dist/form/TextArea.svelte.d.ts +35 -10
- package/dist/form/Textbox.svelte +80 -47
- package/dist/form/Textbox.svelte.d.ts +41 -8
- package/dist/form/TimePicker.svelte +42 -47
- package/dist/form/TimePicker.svelte.d.ts +12 -2
- package/dist/form/comboBoxCore.svelte.d.ts +99 -0
- package/dist/form/comboBoxCore.svelte.js +243 -0
- package/dist/icon/Icon.svelte +8 -3
- package/dist/icon/Icon.svelte.d.ts +8 -3
- package/dist/icon/cube-send.svg +1 -0
- package/dist/icon/file-type-bmp.svg +1 -0
- package/dist/icon/file-type-csv.svg +1 -0
- package/dist/icon/file-type-doc.svg +1 -0
- package/dist/icon/file-type-docx.svg +1 -0
- package/dist/icon/file-type-jpg.svg +1 -0
- package/dist/icon/file-type-pdf.svg +1 -0
- package/dist/icon/file-type-png.svg +1 -0
- package/dist/icon/file-type-ppt.svg +1 -0
- package/dist/icon/file-type-svg.svg +1 -0
- package/dist/icon/file-type-txt.svg +1 -0
- package/dist/icon/file-type-xls.svg +1 -0
- package/dist/icon/file-type-zip.svg +1 -0
- package/dist/icon/index.d.ts +166 -145
- package/dist/icon/index.js +166 -146
- package/dist/icon/layout-sidebar-left-collapse.svg +1 -0
- package/dist/icon/layout-sidebar-left-expand.svg +1 -0
- package/dist/icon/logo-placeholder.svg +6 -0
- package/dist/icon/paperclip.svg +1 -0
- package/dist/icon/source-code.svg +1 -0
- package/dist/icon/sun-moon.svg +1 -0
- package/dist/icon/table.svg +6 -0
- package/dist/icon/thumb-down.svg +1 -0
- package/dist/icon/thumb-up.svg +1 -0
- package/dist/index.d.ts +93 -22
- package/dist/index.js +28 -27
- package/dist/layout/AppShell.svelte +12 -162
- package/dist/layout/AppShell.svelte.d.ts +6 -27
- package/dist/layout/CustomNavbar.svelte +9 -7
- package/dist/layout/CustomNavbar.svelte.d.ts +4 -2
- package/dist/layout/Navbar.svelte +158 -110
- package/dist/layout/Navbar.svelte.d.ts +26 -12
- package/dist/layout/NavbarItemDisplay.svelte +2 -2
- package/dist/layout/NavbarItemView.svelte +182 -0
- package/dist/layout/NavbarItemView.svelte.d.ts +10 -0
- package/dist/layout/Sidenav.svelte +280 -341
- package/dist/layout/Sidenav.svelte.d.ts +36 -4
- package/dist/models/ComboBoxItem.d.ts +2 -0
- package/dist/models/Employee.d.ts +53 -0
- package/dist/models/Employee.js +23 -0
- package/dist/models/Hyperlink.d.ts +3 -1
- package/dist/models/LinkCollectionItem.d.ts +3 -1
- package/dist/models/NavbarItem.d.ts +6 -2
- package/dist/theme.svelte.d.ts +0 -1
- package/dist/theme.svelte.js +46 -58
- package/dist/ui/Accordion.svelte +81 -242
- package/dist/ui/Accordion.svelte.d.ts +37 -14
- package/dist/ui/AccordionItem.svelte +303 -0
- package/dist/ui/AccordionItem.svelte.d.ts +21 -0
- package/dist/ui/ActionIcon.svelte +25 -21
- package/dist/ui/ActionIcon.svelte.d.ts +15 -2
- package/dist/ui/Badge.svelte +170 -161
- package/dist/ui/Badge.svelte.d.ts +16 -4
- package/dist/ui/Button.svelte +178 -205
- package/dist/ui/Button.svelte.d.ts +19 -2
- package/dist/ui/ButtonVariant.d.ts +15 -1
- package/dist/ui/ContextMenu.svelte +146 -0
- package/dist/ui/ContextMenu.svelte.d.ts +37 -0
- package/dist/ui/ContextMenuList.svelte +188 -0
- package/dist/ui/ContextMenuList.svelte.d.ts +12 -0
- package/dist/ui/Dialog.svelte +183 -104
- package/dist/ui/Dialog.svelte.d.ts +21 -2
- package/dist/ui/Drawer.svelte +237 -184
- package/dist/ui/Drawer.svelte.d.ts +20 -2
- package/dist/ui/Dropdown.svelte +24 -14
- package/dist/ui/Dropdown.svelte.d.ts +11 -2
- package/dist/ui/Dropzone.svelte +159 -57
- package/dist/ui/Dropzone.svelte.d.ts +29 -2
- package/dist/ui/Link.svelte +12 -4
- package/dist/ui/Link.svelte.d.ts +8 -2
- package/dist/ui/Loader.svelte +23 -18
- package/dist/ui/Loader.svelte.d.ts +5 -2
- package/dist/ui/Logo.svelte +37 -0
- package/dist/ui/Logo.svelte.d.ts +16 -0
- package/dist/ui/MultiSortable.svelte +287 -0
- package/dist/ui/MultiSortable.svelte.d.ts +50 -0
- package/dist/ui/Pagination.svelte +12 -6
- package/dist/ui/Pagination.svelte.d.ts +6 -2
- package/dist/ui/Popover.svelte +43 -65
- package/dist/ui/Popover.svelte.d.ts +14 -5
- package/dist/ui/ProgressBar.svelte +169 -0
- package/dist/ui/ProgressBar.svelte.d.ts +30 -0
- package/dist/ui/ProgressBarVariant.d.ts +7 -0
- package/dist/ui/ProgressBarVariant.js +1 -0
- package/dist/ui/SegmentedControl.svelte +0 -0
- package/dist/ui/SegmentedControl.svelte.d.ts +26 -0
- package/dist/ui/Sortable.svelte +163 -0
- package/dist/ui/Sortable.svelte.d.ts +47 -0
- package/dist/ui/Table.svelte +497 -56
- package/dist/ui/Table.svelte.d.ts +64 -2
- package/dist/ui/Tabs.svelte +22 -18
- package/dist/ui/Tabs.svelte.d.ts +6 -2
- package/dist/ui/ThemeSwitcher.svelte +26 -7
- package/dist/ui/ThemeSwitcher.svelte.d.ts +4 -2
- package/dist/ui/Tooltip.svelte +312 -180
- package/dist/ui/Tooltip.svelte.d.ts +4 -3
- package/dist/uiTheme.svelte.d.ts +86 -0
- package/dist/uiTheme.svelte.js +214 -0
- package/dist/util/DateFunctions.js +1 -1
- package/dist/util/DragDrop.d.ts +50 -0
- package/dist/util/DragDrop.js +154 -0
- package/dist/util/NavigateTo.js +2 -2
- package/dist/util/dayjs.d.ts +4 -0
- package/dist/util/dayjs.js +15 -0
- package/dist/util/interceptLinkClick.d.ts +13 -0
- package/dist/util/interceptLinkClick.js +33 -0
- package/package.json +66 -26
- package/dist/display/Alert.svelte +0 -179
- package/dist/display/Alert.svelte.d.ts +0 -13
- package/dist/form/FileInput.svelte +0 -235
- package/dist/form/FileInput.svelte.d.ts +0 -23
- package/dist/form/PasswordInput.svelte +0 -252
- package/dist/form/PasswordInput.svelte.d.ts +0 -33
- package/dist/form/Rating.svelte +0 -235
- package/dist/form/Rating.svelte.d.ts +0 -21
- package/dist/styles/components.css +0 -199
- package/dist/styles/dark.css +0 -146
- package/dist/styles/index.css +0 -116
- package/dist/styles/reset.css +0 -110
- package/dist/styles/semantic.css +0 -86
- package/dist/styles/tokens.css +0 -203
- package/dist/styles/utilities.css +0 -523
- package/dist/ui/Breadcrumbs.svelte +0 -131
- package/dist/ui/Breadcrumbs.svelte.d.ts +0 -16
- package/dist/ui/LoadingOverlay.svelte +0 -53
- package/dist/ui/LoadingOverlay.svelte.d.ts +0 -11
- package/dist/ui/Progress.svelte +0 -191
- package/dist/ui/Progress.svelte.d.ts +0 -15
- package/dist/ui/RingProgress.svelte +0 -141
- package/dist/ui/RingProgress.svelte.d.ts +0 -18
- package/dist/ui/Skeleton.svelte +0 -85
- package/dist/ui/Skeleton.svelte.d.ts +0 -12
- package/dist/ui/Stepper.svelte +0 -355
- package/dist/ui/Stepper.svelte.d.ts +0 -24
- package/dist/ui/Timeline.svelte +0 -225
- package/dist/ui/Timeline.svelte.d.ts +0 -23
- /package/dist/{actions → util}/ClickOutside.d.ts +0 -0
- /package/dist/{actions → util}/ClickOutside.js +0 -0
- /package/dist/{transitions → util}/Transitions.d.ts +0 -0
- /package/dist/{transitions → util}/Transitions.js +0 -0
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,179 +1,183 @@
|
|
|
1
|
-
#
|
|
1
|
+
# PlaceholderUI
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A Svelte 5 component library that you re-brand with a single config object.
|
|
4
|
+
Forms, overlays, layout, data display, a TipTap rich-text editor and a
|
|
5
|
+
CodeMirror code editor, all styled through one set of `--ui-*` CSS tokens.
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
- Svelte 5 runes, TypeScript, typed props on every component
|
|
8
|
+
- Light / dark / system theme with persistence
|
|
9
|
+
- Neutral default palette; swap in your own colours, font and logo in one call
|
|
10
|
+
- 150+ icons exported as raw SVG strings
|
|
6
11
|
|
|
7
|
-
|
|
8
|
-
- **CSS Variable Theming** - Fully customizable via CSS custom properties
|
|
9
|
-
- **Dark Mode** - Built-in light/dark theme support
|
|
10
|
-
- **Svelte 5** - Built with modern Svelte 5 runes
|
|
11
|
-
- **TypeScript** - Full TypeScript support
|
|
12
|
-
- **Accessible** - Built with accessibility in mind
|
|
13
|
-
- **Lightweight** - Built for simple DX with just enough flexibility
|
|
14
|
-
|
|
15
|
-
## Installation
|
|
12
|
+
## Install
|
|
16
13
|
|
|
17
14
|
```bash
|
|
18
|
-
|
|
15
|
+
pnpm add @placeholderco/placeholder-ui
|
|
19
16
|
```
|
|
20
17
|
|
|
21
|
-
|
|
18
|
+
Peer dependency: `svelte ^5`.
|
|
19
|
+
|
|
20
|
+
## Quick start
|
|
21
|
+
|
|
22
|
+
Wrap your app in `AppShell` (it loads the base stylesheet and, by default,
|
|
23
|
+
Bootstrap 5), then use components:
|
|
22
24
|
|
|
23
25
|
```svelte
|
|
24
|
-
<script>
|
|
25
|
-
|
|
26
|
+
<script lang="ts">
|
|
27
|
+
import { AppShell, Navbar, Button } from '@placeholderco/placeholder-ui';
|
|
26
28
|
</script>
|
|
27
29
|
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</
|
|
30
|
+
<AppShell>
|
|
31
|
+
<Navbar appNav={{ href: '/', text: 'My App' }} />
|
|
32
|
+
<Button variant="primary">Save</Button>
|
|
33
|
+
</AppShell>
|
|
32
34
|
```
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
### UI Components
|
|
37
|
-
- `Button` - Buttons with multiple variants and sizes
|
|
38
|
-
- `ActionIcon` - Icon buttons
|
|
39
|
-
- `Badge` - Status badges
|
|
40
|
-
- `Dialog` - Modal dialogs
|
|
41
|
-
- `Drawer` - Slide-out panels
|
|
42
|
-
- `Dropdown` - Dropdown menus
|
|
43
|
-
- `Loader` - Loading spinners
|
|
44
|
-
- `Pagination` - Page navigation
|
|
45
|
-
- `Popover` - Floating content
|
|
46
|
-
- `Table` - Data tables
|
|
47
|
-
- `Tabs` - Tab navigation
|
|
48
|
-
- `Tooltip` - Hover tooltips
|
|
49
|
-
- `Toaster` - Toast notifications
|
|
50
|
-
|
|
51
|
-
### Form Components
|
|
52
|
-
- `Textbox` - Text input
|
|
53
|
-
- `TextArea` - Multi-line text input
|
|
54
|
-
- `Number` - Numeric input
|
|
55
|
-
- `Select` / `SelectMulti` - Dropdowns
|
|
56
|
-
- `Checkbox` - Checkboxes
|
|
57
|
-
- `RadioGroup` - Radio buttons
|
|
58
|
-
- `Switch` - Toggle switches
|
|
59
|
-
- `DatePicker` / `TimePicker` / `DateTimePicker` - Date/time selection
|
|
60
|
-
- `Autocomplete` - Autocomplete input
|
|
61
|
-
- `Chips` - Tag input
|
|
62
|
-
|
|
63
|
-
### Display Components
|
|
64
|
-
- `Paper` - Card/panel container
|
|
65
|
-
- `Alert` - Alert messages
|
|
66
|
-
- `Avatar` - User avatars
|
|
67
|
-
- `LinkCollection` - Link lists
|
|
68
|
-
|
|
69
|
-
### Layout Components
|
|
70
|
-
- `Navbar` - Navigation bar
|
|
71
|
-
- `Sidenav` - Side navigation
|
|
72
|
-
|
|
73
|
-
### Editors (separate package)
|
|
74
|
-
|
|
75
|
-
For code and rich text editors, install the editors package:
|
|
36
|
+
If you ship your own Bootstrap build or do not want Bootstrap at all, skip
|
|
37
|
+
`AppShell` and import the token stylesheet yourself:
|
|
76
38
|
|
|
77
|
-
```
|
|
78
|
-
|
|
39
|
+
```ts
|
|
40
|
+
import '@placeholderco/placeholder-ui/app.css';
|
|
79
41
|
```
|
|
80
42
|
|
|
81
|
-
|
|
82
|
-
<script>
|
|
83
|
-
import { CodeMirror } from '@placeholderco/placeholder-ui-editors';
|
|
84
|
-
</script>
|
|
43
|
+
The bundled Bootstrap is also available on its own as `@placeholderco/placeholder-ui/bootstrap.css`.
|
|
85
44
|
|
|
86
|
-
|
|
87
|
-
```
|
|
45
|
+
## Branding
|
|
88
46
|
|
|
89
|
-
|
|
47
|
+
Everything colour- and font-related resolves to `--ui-*` custom properties, so
|
|
48
|
+
there are two ways to brand the library.
|
|
90
49
|
|
|
91
|
-
|
|
50
|
+
### 1. A config object (recommended)
|
|
92
51
|
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
--pui-color-secondary: #48bb78;
|
|
98
|
-
--pui-color-accent: #4fd1c5;
|
|
52
|
+
```ts
|
|
53
|
+
// src/routes/+layout.svelte (or any startup code)
|
|
54
|
+
import { applyTheme } from '@placeholderco/placeholder-ui';
|
|
55
|
+
import logo from '$lib/logo.svg?raw';
|
|
99
56
|
|
|
100
|
-
|
|
101
|
-
|
|
57
|
+
applyTheme({
|
|
58
|
+
colors: {
|
|
59
|
+
primary: '#1e3a5f', // dark brand colour: solid buttons, headings
|
|
60
|
+
accent: '#93c5fd', // light brand colour: highlights, dark-mode accent
|
|
61
|
+
tertiary: '#a5f3fc' // supporting colour: links use its dark shade
|
|
62
|
+
},
|
|
63
|
+
fontFamily: "'Inter', system-ui, sans-serif",
|
|
64
|
+
logo // raw SVG, rendered by <Logo />
|
|
65
|
+
});
|
|
66
|
+
```
|
|
102
67
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
68
|
+
Darker and lighter shades are derived automatically. Set `primaryDark`,
|
|
69
|
+
`accentDark`, `tertiaryDark`, `tertiaryLight`, `link`, `linkHover` and the
|
|
70
|
+
`*Contrast` text colours explicitly when you want full control.
|
|
71
|
+
|
|
72
|
+
### Light and dark values
|
|
73
|
+
|
|
74
|
+
Everything in the config is the light-mode value and also applies in dark mode.
|
|
75
|
+
To change any of it while dark mode is active, add a `dark` block with the same
|
|
76
|
+
shape. Only what you name is overridden; shades are derived per colour.
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
applyTheme({
|
|
80
|
+
colors: { primary: '#1e293b', accent: '#fbbf24', tertiary: '#7dd3fc' },
|
|
81
|
+
logo,
|
|
82
|
+
dark: {
|
|
83
|
+
colors: { accent: '#fde68a', link: '#fde68a' },
|
|
84
|
+
fontFamily: "'Inter', system-ui, sans-serif", // optional
|
|
85
|
+
logo: darkLogo // optional
|
|
86
|
+
}
|
|
87
|
+
});
|
|
106
88
|
```
|
|
107
89
|
|
|
108
|
-
|
|
90
|
+
`applyTheme` injects one `<style>` element with a `:root` rule and a
|
|
91
|
+
`:root.dark` rule, so values switch with the existing `.dark` class.
|
|
109
92
|
|
|
110
|
-
|
|
93
|
+
To avoid a flash of the default palette on first paint, render the same config
|
|
94
|
+
as CSS on the server:
|
|
111
95
|
|
|
112
|
-
```
|
|
113
|
-
|
|
96
|
+
```ts
|
|
97
|
+
import { themeToCss } from '@placeholderco/placeholder-ui';
|
|
98
|
+
const css = themeToCss(myTheme); // ":root { ... }\n:root.dark { ... }"
|
|
114
99
|
```
|
|
115
100
|
|
|
116
|
-
|
|
101
|
+
and place it in a `<style>` tag in `app.html` or your root layout head.
|
|
117
102
|
|
|
118
|
-
|
|
119
|
-
import { setTheme } from '@placeholderco/placeholder-ui';
|
|
103
|
+
### 2. Plain CSS
|
|
120
104
|
|
|
121
|
-
|
|
105
|
+
Override the tokens in any stylesheet loaded after the library:
|
|
106
|
+
|
|
107
|
+
```css
|
|
108
|
+
:root {
|
|
109
|
+
--ui-primary-rgb: 30 58 95;
|
|
110
|
+
--ui-primary-rgbc: 30, 58, 95;
|
|
111
|
+
--ui-primary: rgb(var(--ui-primary-rgb));
|
|
112
|
+
--ui-primary-dark: #12253d;
|
|
113
|
+
--ui-accent-rgb: 147 197 253;
|
|
114
|
+
--ui-accent-rgbc: 147, 197, 253;
|
|
115
|
+
--ui-accent: rgb(var(--ui-accent-rgb));
|
|
116
|
+
--ui-accent-dark: #1d4ed8;
|
|
117
|
+
--ui-tertiary: #a5f3fc;
|
|
118
|
+
--ui-tertiary-dark: #0e7490;
|
|
119
|
+
--ui-font-family: 'Inter', system-ui, sans-serif;
|
|
120
|
+
}
|
|
122
121
|
```
|
|
123
122
|
|
|
124
|
-
|
|
123
|
+
The full token list, with comments on each role, is at the top of
|
|
124
|
+
[src/lib/app.css](src/lib/app.css).
|
|
125
125
|
|
|
126
|
-
###
|
|
127
|
-
- `--pui-color-*` - Color palette
|
|
128
|
-
- `--pui-font-size-*` - Typography sizes
|
|
129
|
-
- `--pui-spacing-*` - Spacing scale
|
|
130
|
-
- `--pui-radius-*` - Border radius
|
|
131
|
-
- `--pui-shadow-*` - Box shadows
|
|
126
|
+
### Colour roles
|
|
132
127
|
|
|
133
|
-
|
|
134
|
-
- `--pui-bg-*` - Background colors
|
|
135
|
-
- `--pui-text-*` - Text colors
|
|
136
|
-
- `--pui-border-*` - Border colors
|
|
128
|
+
Keep these relationships when choosing colours, because components assume them:
|
|
137
129
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
-
|
|
130
|
+
| Token | Role |
|
|
131
|
+
| --------------- | ------------------------------------------------------------ |
|
|
132
|
+
| `--ui-primary` | Dark. Solid buttons, active states, headings. White text. |
|
|
133
|
+
| `--ui-accent` | Light. Hovers, highlights, the accent in dark mode. |
|
|
134
|
+
| `--ui-tertiary` | Light. Supporting fills; its `-dark` shade is used for links |
|
|
143
135
|
|
|
144
|
-
|
|
136
|
+
### Fonts
|
|
145
137
|
|
|
146
|
-
The library
|
|
138
|
+
The library never bundles a font. Set `--ui-font-family` (or `fontFamily` in
|
|
139
|
+
the config) and load the font yourself with `@font-face` or a `<link>`.
|
|
147
140
|
|
|
148
|
-
|
|
149
|
-
<script>
|
|
150
|
-
import { Icon, iconCheck, iconX } from '@placeholderco/placeholder-ui';
|
|
151
|
-
</script>
|
|
141
|
+
### Logo
|
|
152
142
|
|
|
153
|
-
|
|
154
|
-
|
|
143
|
+
`<Logo />` renders, in order of preference: its `svg` prop, the logo registered
|
|
144
|
+
via `applyTheme({ logo })` / `setLogo()`, or a generic placeholder. Use
|
|
145
|
+
`fill="currentColor"` in your SVG so it follows the theme, or register a separate
|
|
146
|
+
dark-mode logo with `dark.logo` / `setLogo(light, dark)`.
|
|
155
147
|
|
|
156
|
-
##
|
|
148
|
+
## Variants
|
|
157
149
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
150
|
+
Button, Badge, ActionIcon, Dropdown, Accordion and ProgressBar share colour
|
|
151
|
+
variants named after the tokens: `primary`, `accent`, `tertiary`, plus
|
|
152
|
+
`-outline` and `-subtle` forms, and the neutral `secondary`, `white`, `danger`
|
|
153
|
+
and `auto-*` variants.
|
|
161
154
|
|
|
162
|
-
|
|
163
|
-
npm run dev
|
|
155
|
+
## Theme (light / dark)
|
|
164
156
|
|
|
165
|
-
|
|
166
|
-
|
|
157
|
+
```ts
|
|
158
|
+
import { themeState, setTheme } from '@placeholderco/placeholder-ui';
|
|
167
159
|
|
|
168
|
-
|
|
169
|
-
|
|
160
|
+
setTheme('dark'); // 'light' | 'dark' | 'system'
|
|
161
|
+
themeState.isDarkMode; // reactive boolean
|
|
162
|
+
```
|
|
170
163
|
|
|
171
|
-
|
|
172
|
-
|
|
164
|
+
The `.light` / `.dark` class is applied to `<html>`. In your own components use
|
|
165
|
+
`:global(.dark) .my-class { ... }` or the surface tokens (`--page-bg`,
|
|
166
|
+
`--paper-body-bg`, `--text-color`, `--border-color`, ...).
|
|
167
|
+
|
|
168
|
+
## Development
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
pnpm install
|
|
172
|
+
pnpm run dev # showcase app at http://localhost:5173
|
|
173
|
+
pnpm run check # svelte-check
|
|
174
|
+
pnpm run build # library + showcase
|
|
175
|
+
pnpm run format
|
|
173
176
|
```
|
|
174
177
|
|
|
175
|
-
|
|
178
|
+
`src/lib` is the published library; `src/routes` is the showcase. Every
|
|
179
|
+
component has a demo page under `src/routes/components/<name>`.
|
|
176
180
|
|
|
177
|
-
|
|
181
|
+
## License
|
|
178
182
|
|
|
179
|
-
|
|
183
|
+
[MIT](LICENSE)
|
package/dist/app.css
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* PlaceholderUI design tokens
|
|
3
|
+
* ---------------------------
|
|
4
|
+
* Everything a consumer needs to re-brand the library lives in the `--ui-*`
|
|
5
|
+
* custom properties below. Override them in your own stylesheet, or call
|
|
6
|
+
* `applyTheme()` / `themeToCss()` from the package to generate them from a
|
|
7
|
+
* `ThemeConfig` object.
|
|
8
|
+
*
|
|
9
|
+
* Colour roles (keep these relationships when re-branding):
|
|
10
|
+
* --ui-primary dark brand colour. Used for solid buttons, headings, active
|
|
11
|
+
* states. Text on top of it uses --ui-primary-contrast.
|
|
12
|
+
* --ui-accent light brand colour. Used for highlights, hover states and as
|
|
13
|
+
* the adaptive accent in dark mode. Text on top of it uses
|
|
14
|
+
* --ui-accent-contrast.
|
|
15
|
+
* --ui-tertiary light supporting colour. Its *-dark shade is used for links
|
|
16
|
+
* and subtle text.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
:root {
|
|
20
|
+
/* ---- Typography ---- */
|
|
21
|
+
--ui-font-family:
|
|
22
|
+
ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif, 'Apple Color Emoji',
|
|
23
|
+
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
|
24
|
+
|
|
25
|
+
/* ---- Brand colours (neutral defaults) ---- */
|
|
26
|
+
--ui-primary-rgb: 30 58 95;
|
|
27
|
+
--ui-primary-rgbc: 30, 58, 95;
|
|
28
|
+
--ui-primary: rgb(var(--ui-primary-rgb));
|
|
29
|
+
--ui-primary-dark: #12253d;
|
|
30
|
+
--ui-primary-contrast: #ffffff;
|
|
31
|
+
|
|
32
|
+
--ui-accent-rgb: 147 197 253;
|
|
33
|
+
--ui-accent-rgbc: 147, 197, 253;
|
|
34
|
+
--ui-accent: rgb(var(--ui-accent-rgb));
|
|
35
|
+
--ui-accent-dark: #1d4ed8;
|
|
36
|
+
--ui-accent-contrast: var(--ui-primary);
|
|
37
|
+
|
|
38
|
+
--ui-tertiary-rgb: 165 243 252;
|
|
39
|
+
--ui-tertiary-rgbc: 165, 243, 252;
|
|
40
|
+
--ui-tertiary: rgb(var(--ui-tertiary-rgb));
|
|
41
|
+
--ui-tertiary-dark-rgbc: 14, 116, 144;
|
|
42
|
+
--ui-tertiary-dark: rgb(var(--ui-tertiary-dark-rgbc));
|
|
43
|
+
--ui-tertiary-light: #cffafe;
|
|
44
|
+
|
|
45
|
+
/* ---- Link colours ---- */
|
|
46
|
+
--ui-link-color: var(--ui-tertiary-dark);
|
|
47
|
+
--ui-link-hover-color: var(--ui-accent-dark);
|
|
48
|
+
|
|
49
|
+
/* ---- Legacy aliases (deprecated, kept for backwards compatibility) ---- */
|
|
50
|
+
--midnight-rgb: var(--ui-primary-rgb);
|
|
51
|
+
--midnight-rgbc: var(--ui-primary-rgbc);
|
|
52
|
+
--midnight: var(--ui-primary);
|
|
53
|
+
--pistachio-rgb: var(--ui-accent-rgb);
|
|
54
|
+
--pistachio-rgbc: var(--ui-accent-rgbc);
|
|
55
|
+
--pistachio: var(--ui-accent);
|
|
56
|
+
--pistachio-dark: var(--ui-accent-dark);
|
|
57
|
+
--turquoise: var(--ui-tertiary);
|
|
58
|
+
--turquoise-dark: var(--ui-tertiary-dark);
|
|
59
|
+
|
|
60
|
+
/* ---- Surfaces and text (light mode) ---- */
|
|
61
|
+
--off-white: rgb(221, 221, 221);
|
|
62
|
+
--input-bg: #fff;
|
|
63
|
+
--page-bg: #f1f3f5;
|
|
64
|
+
--text-color: #000;
|
|
65
|
+
--border-color: rgb(226, 232, 240);
|
|
66
|
+
--accent-color-rgb: var(--ui-primary-rgbc);
|
|
67
|
+
--accent-color: rgb(var(--accent-color-rgb));
|
|
68
|
+
--accent-text-color-rgb: 221, 221, 221;
|
|
69
|
+
--accent-text-color: rgb(221, 221, 221);
|
|
70
|
+
--paper-title-bg: rgb(252, 252, 252);
|
|
71
|
+
--paper-title-border: rgb(229, 231, 235);
|
|
72
|
+
--paper-body-bg: rgb(255, 255, 255);
|
|
73
|
+
--danger-bg: #e03131;
|
|
74
|
+
--danger-bg-hover: #c92a2a;
|
|
75
|
+
--danger-text: #ff5e5e;
|
|
76
|
+
--danger-bg-subtle: rgba(250, 82, 82, 0.12);
|
|
77
|
+
|
|
78
|
+
/* inputs */
|
|
79
|
+
--placeholder-color: rgb(161 161 170);
|
|
80
|
+
--input-bg-color: #fff;
|
|
81
|
+
--label-color: #6c757d;
|
|
82
|
+
|
|
83
|
+
/* layout */
|
|
84
|
+
--header-height: 46px;
|
|
85
|
+
--page-content-height: calc(100vh - var(--header-height));
|
|
86
|
+
|
|
87
|
+
--scrollbar-track: #fff;
|
|
88
|
+
--scrollbar-thumb: var(--ui-primary);
|
|
89
|
+
|
|
90
|
+
background-color: var(--page-bg);
|
|
91
|
+
color: var(--text-color);
|
|
92
|
+
font-family: var(--ui-font-family);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.dark {
|
|
96
|
+
--input-bg: rgb(33, 37, 41);
|
|
97
|
+
--page-bg: rgb(36, 37, 40);
|
|
98
|
+
--text-color: rgb(221, 221, 221);
|
|
99
|
+
--accent-color-rgb: var(--ui-accent-rgbc);
|
|
100
|
+
--border-color: rgb(55, 58, 64);
|
|
101
|
+
--accent-text-color-rgb: 221, 221, 221;
|
|
102
|
+
--accent-text-color: #000;
|
|
103
|
+
--paper-title-bg: rgb(18, 18, 18);
|
|
104
|
+
--paper-title-border: rgb(46, 46, 46);
|
|
105
|
+
--paper-body-bg: rgb(25, 26, 28);
|
|
106
|
+
--danger-text: #ffa8a8;
|
|
107
|
+
--danger-bg-subtle: rgba(250, 82, 82, 0.2);
|
|
108
|
+
|
|
109
|
+
/* inputs */
|
|
110
|
+
--placeholder-color: rgb(115 115 115);
|
|
111
|
+
--input-bg-color: rgb(33, 37, 41);
|
|
112
|
+
--label-color: rgb(141, 144, 149);
|
|
113
|
+
|
|
114
|
+
--scrollbar-track: #111;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
body {
|
|
118
|
+
margin: 0;
|
|
119
|
+
font-family: var(--ui-font-family);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* Form controls do not inherit fonts by default; make them follow the UI font
|
|
123
|
+
even when Bootstrap's reboot is not loaded. */
|
|
124
|
+
button,
|
|
125
|
+
input,
|
|
126
|
+
select,
|
|
127
|
+
textarea {
|
|
128
|
+
font-family: inherit;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
header a {
|
|
132
|
+
text-decoration: none;
|
|
133
|
+
color: var(--ui-primary);
|
|
134
|
+
transition: color 200ms;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.dark header a {
|
|
138
|
+
color: white;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.dark header a:hover {
|
|
142
|
+
color: var(--ui-accent);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
header .text-xl {
|
|
146
|
+
font-size: 1.25rem;
|
|
147
|
+
line-height: 1.75rem;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
*::-webkit-scrollbar {
|
|
151
|
+
width: 19px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
*::-webkit-scrollbar-track {
|
|
155
|
+
background: var(--scrollbar-track);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
*::-webkit-scrollbar-thumb {
|
|
159
|
+
background-color: var(--scrollbar-thumb);
|
|
160
|
+
border-radius: 10px;
|
|
161
|
+
border: 5px solid var(--scrollbar-track);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.vstack {
|
|
165
|
+
gap: 1rem;
|
|
166
|
+
display: flex;
|
|
167
|
+
flex-direction: column;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
a {
|
|
171
|
+
color: var(--ui-link-color);
|
|
172
|
+
text-decoration: none;
|
|
173
|
+
transition: 200ms all;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
a:hover {
|
|
177
|
+
color: var(--ui-link-hover-color);
|
|
178
|
+
}
|