@budibase/bbui 1.58.13 → 2.0.1
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 +375 -0
- package/dist/bbui.es.js +14 -0
- package/dist/bbui.es.js.map +1 -0
- package/package.json +68 -32
- package/src/ActionButton/ActionButton.svelte +102 -0
- package/src/ActionGroup/ActionGroup.svelte +26 -0
- package/src/ActionMenu/ActionMenu.svelte +44 -0
- package/src/Actions/autoresize_textarea.js +9 -9
- package/src/Actions/click_outside.js +5 -5
- package/src/Actions/position_dropdown.js +46 -37
- package/src/Avatar/Avatar.svelte +62 -0
- package/src/Badge/Badge.svelte +29 -0
- package/src/Banner/Banner.svelte +72 -0
- package/src/Banner/BannerDisplay.svelte +41 -0
- package/src/Button/Button.svelte +102 -200
- package/src/ButtonGroup/ButtonGroup.svelte +30 -0
- package/src/ClearButton/ClearButton.svelte +19 -0
- package/src/ColorPicker/ColorPicker.svelte +297 -0
- package/src/DetailSummary/DetailSummary.svelte +83 -0
- package/src/Divider/Divider.svelte +28 -0
- package/src/Drawer/Drawer.svelte +76 -51
- package/src/Drawer/DrawerContent.svelte +46 -0
- package/src/Form/Checkbox.svelte +21 -132
- package/src/Form/Combobox.svelte +45 -0
- package/src/Form/Core/Checkbox.svelte +69 -0
- package/src/Form/Core/CheckboxGroup.svelte +68 -0
- package/src/Form/Core/Combobox.svelte +142 -0
- package/src/Form/Core/DatePicker.svelte +257 -0
- package/src/Form/Core/Dropzone.svelte +453 -0
- package/src/Form/Core/InputDropdown.svelte +228 -0
- package/src/Form/Core/Multiselect.svelte +90 -0
- package/src/Form/Core/Picker.svelte +259 -0
- package/src/Form/Core/PickerDropdown.svelte +415 -0
- package/src/Form/Core/RadioGroup.svelte +48 -0
- package/src/Form/Core/RichTextField.svelte +42 -0
- package/src/Form/Core/Search.svelte +105 -0
- package/src/Form/Core/Select.svelte +75 -0
- package/src/Form/Core/Slider.svelte +86 -0
- package/src/Form/Core/Stepper.svelte +172 -0
- package/src/Form/Core/Switch.svelte +37 -0
- package/src/Form/Core/TextArea.svelte +78 -0
- package/src/Form/Core/TextField.svelte +119 -0
- package/src/Form/Core/index.js +15 -0
- package/src/Form/DatePicker.svelte +39 -0
- package/src/Form/Dropzone.svelte +42 -0
- package/src/Form/Field.svelte +42 -0
- package/src/Form/FieldLabel.svelte +32 -0
- package/src/Form/Input.svelte +41 -187
- package/src/Form/InputDropdown.svelte +55 -0
- package/src/Form/Multiselect.svelte +36 -320
- package/src/Form/PickerDropdown.svelte +132 -0
- package/src/Form/RadioGroup.svelte +42 -0
- package/src/Form/RichTextField.svelte +36 -0
- package/src/Form/Search.svelte +36 -0
- package/src/Form/Select.svelte +48 -88
- package/src/Form/Slider.svelte +16 -91
- package/src/Form/Stepper.svelte +45 -0
- package/src/Form/TextArea.svelte +30 -128
- package/src/Form/Toggle.svelte +20 -110
- package/src/Icon/Icon.svelte +91 -0
- package/src/Icon/IconAvatar.svelte +58 -0
- package/src/IconPicker/IconPicker.svelte +177 -0
- package/src/IconSideNav/IconSideNav.svelte +14 -0
- package/src/IconSideNav/IconSideNavItem.svelte +56 -0
- package/src/InlineAlert/InlineAlert.svelte +60 -0
- package/src/Label/Label.svelte +29 -0
- package/src/Layout/Layout.svelte +94 -0
- package/src/Layout/Page.svelte +32 -0
- package/src/Link/Link.svelte +24 -0
- package/src/List/List.svelte +28 -0
- package/src/List/ListItem.svelte +90 -0
- package/src/Markdown/MarkdownEditor.svelte +60 -0
- package/src/Markdown/MarkdownViewer.svelte +70 -0
- package/src/Markdown/SpectrumMDE.svelte +184 -0
- package/src/Menu/Item.svelte +96 -0
- package/src/Menu/Menu.svelte +7 -0
- package/src/Menu/Menu.svench +19 -0
- package/src/Menu/Section.svelte +10 -0
- package/src/Menu/Separator.svelte +1 -0
- package/src/Modal/Content.svelte +0 -11
- package/src/Modal/CustomContent.svelte +9 -6
- package/src/Modal/Modal.svelte +104 -51
- package/src/Modal/ModalContent.svelte +131 -73
- package/src/Modal/QuizModal.svelte +16 -17
- package/src/Notification/Notification.svelte +70 -0
- package/src/Notification/NotificationDisplay.svelte +43 -0
- package/src/Pagination/Pagination.svelte +57 -0
- package/src/Popover/Popover.svelte +43 -33
- package/src/ProgressBar/ProgressBar.svelte +67 -0
- package/src/ProgressCircle/ProgressCircle.svelte +62 -0
- package/src/SideNavigation/Item.svelte +61 -0
- package/src/SideNavigation/Navigation.svelte +12 -0
- package/src/StatusLight/StatusLight.svelte +80 -0
- package/src/Stores/Notifications.svench.svx +1 -1
- package/src/Stores/banner.js +65 -0
- package/src/Stores/notifications.js +75 -38
- package/src/Table/ArrayRenderer.svelte +17 -0
- package/src/Table/AttachmentRenderer.svelte +73 -0
- package/src/Table/BoldRenderer.svelte +15 -0
- package/src/Table/BooleanRenderer.svelte +42 -0
- package/src/Table/CellRenderer.svelte +69 -0
- package/src/Table/CodeRenderer.svelte +14 -0
- package/src/Table/DateTimeRenderer.svelte +29 -0
- package/src/Table/InternalRenderer.svelte +24 -0
- package/src/Table/RelationshipRenderer.svelte +40 -0
- package/src/Table/SelectEditRenderer.svelte +28 -0
- package/src/Table/StringRenderer.svelte +14 -0
- package/src/Table/Table.svelte +635 -0
- package/src/Table/index.js +1 -0
- package/src/Tabs/Tab.svelte +88 -0
- package/src/Tabs/Tabs.svelte +130 -0
- package/src/Tags/Tag.svelte +43 -0
- package/src/Tags/Tags.svelte +7 -0
- package/src/Tooltip/Tooltip.svelte +34 -0
- package/src/Tooltip/TooltipWrapper.svelte +60 -0
- package/src/TreeView/Item.svelte +41 -0
- package/src/TreeView/Tree.svelte +16 -0
- package/src/Typography/Body.svelte +21 -0
- package/src/Typography/Code.svelte +10 -0
- package/src/Typography/Detail.svelte +19 -0
- package/src/Typography/Heading.svelte +17 -0
- package/{dist → src}/bbui.css +2 -99
- package/src/context.js +1 -1
- package/src/helpers.js +134 -0
- package/src/index.js +95 -40
- package/src/spectrum-icons-rollup.js +31 -0
- package/src/spectrum-icons-vite.js +31 -0
- package/dist/dist/bundle.css +0 -42
- package/dist/dist/bundle.css.map +0 -64
- package/dist/index.js +0 -36193
- package/dist/index.mjs +0 -36147
- package/src/Button/Close.svelte +0 -59
- package/src/Button/Close.svench +0 -36
- package/src/Button/TextButton.svelte +0 -128
- package/src/Button/TextButton.svench +0 -69
- package/src/DatePicker/DatePicker.svelte +0 -45
- package/src/DatePicker/DatePicker.svench +0 -17
- package/src/DropdownMenu/DropdownMenu.svelte +0 -77
- package/src/DropdownMenu/DropdownMenu.svench +0 -161
- package/src/Dropzone/Dropzone.svelte +0 -294
- package/src/Dropzone/Dropzone.svench +0 -17
- package/src/Dropzone/fileTypes.js +0 -5
- package/src/Form/Checkbox.svench.svx +0 -67
- package/src/Form/DataList.svelte +0 -158
- package/src/Form/DataList.svench +0 -57
- package/src/Form/Input.svench +0 -62
- package/src/Form/Multiselect.svench +0 -63
- package/src/Form/Radio.svelte +0 -133
- package/src/Form/Radio.svench.svx +0 -64
- package/src/Form/RichText.svelte +0 -61
- package/src/Form/RichText.svench.svx +0 -40
- package/src/Form/Select.svench +0 -62
- package/src/Form/Slider.svench +0 -26
- package/src/Form/TextArea.svench +0 -30
- package/src/Form/Toggle.svench +0 -21
- package/src/Icons/Contribution.svelte +0 -14
- package/src/Icons/Icon.svelte +0 -36
- package/src/Icons/Icon.svench +0 -109
- package/src/Icons/icon-paths.js +0 -136
- package/src/Links/Home.svelte +0 -51
- package/src/Links/Home.svench +0 -19
- package/src/List/Items/DetailSummary.svelte +0 -85
- package/src/List/Items/DetailSummary.svench +0 -53
- package/src/List/Search.svelte +0 -34
- package/src/List/Search.svench +0 -8
- package/src/Spacer/Spacer.svelte +0 -50
- package/src/Spacer/Spacer.svench +0 -51
- package/src/Styleguide/Body.svelte +0 -72
- package/src/Styleguide/Borders.svench +0 -175
- package/src/Styleguide/Budibase-logo.svelte +0 -68
- package/src/Styleguide/Color.svench +0 -201
- package/src/Styleguide/Heading.svelte +0 -74
- package/src/Styleguide/Label.svelte +0 -70
- package/src/Styleguide/Logo.svelte +0 -16
- package/src/Styleguide/Logo.svench +0 -8
- package/src/Styleguide/Spacing.svench +0 -191
- package/src/Styleguide/Typography.svench +0 -227
- package/src/Switcher/Switcher.svelte +0 -47
- package/src/Switcher/Switcher.svench +0 -27
- package/src/index.svench.svx +0 -35
- package/src/utils/buildStyle.js +0 -14
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { View } from "svench";
|
|
3
|
-
import Multiselect from "./Multiselect.svelte";
|
|
4
|
-
|
|
5
|
-
const options = ["Red", "Blue", "Yellow", "Green", "Pink", "Very long color name to show text wrapping"];
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<View name="default">
|
|
9
|
-
<Multiselect name="Test" label="Colours" placeholder="Choose some colours">
|
|
10
|
-
{#each options as option}
|
|
11
|
-
<option value={option}>{option}</option>
|
|
12
|
-
{/each}
|
|
13
|
-
</Multiselect>
|
|
14
|
-
</View>
|
|
15
|
-
|
|
16
|
-
<View name="right aligned">
|
|
17
|
-
<div class="max-width">
|
|
18
|
-
<Multiselect align="right" name="Test" label="Colours" placeholder="Choose some colours">
|
|
19
|
-
{#each options as option}
|
|
20
|
-
<option value={option}>{option}</option>
|
|
21
|
-
{/each}
|
|
22
|
-
</Multiselect>
|
|
23
|
-
</div>
|
|
24
|
-
</View>
|
|
25
|
-
|
|
26
|
-
<View name="secondary">
|
|
27
|
-
<Multiselect name="Test" label="Colours" secondary placeholder="Choose some colours">
|
|
28
|
-
{#each options as option}
|
|
29
|
-
<option value={option}>{option}</option>
|
|
30
|
-
{/each}
|
|
31
|
-
</Multiselect>
|
|
32
|
-
</View>
|
|
33
|
-
|
|
34
|
-
<View name="outline">
|
|
35
|
-
<Multiselect name="Test" label="Colours" outline placeholder="Choose some colours">
|
|
36
|
-
{#each options as option}
|
|
37
|
-
<option value={option}>{option}</option>
|
|
38
|
-
{/each}
|
|
39
|
-
</Multiselect>
|
|
40
|
-
</View>
|
|
41
|
-
|
|
42
|
-
<View name="disabled">
|
|
43
|
-
<Multiselect name="Test" label="Colours" disabled placeholder="Choose some colours">
|
|
44
|
-
{#each options as option}
|
|
45
|
-
<option value={option}>{option}</option>
|
|
46
|
-
{/each}
|
|
47
|
-
</Multiselect>
|
|
48
|
-
</View>
|
|
49
|
-
|
|
50
|
-
<View name="extraThin">
|
|
51
|
-
<Multiselect name="Test" label="Colours" extraThin placeholder="Choose some colours">
|
|
52
|
-
{#each options as option}
|
|
53
|
-
<option value={option}>{option}</option>
|
|
54
|
-
{/each}
|
|
55
|
-
</Multiselect>
|
|
56
|
-
</View>
|
|
57
|
-
|
|
58
|
-
<style>
|
|
59
|
-
.max-width {
|
|
60
|
-
align-self: flex-end;
|
|
61
|
-
max-width: 150px;
|
|
62
|
-
}
|
|
63
|
-
</style>
|
package/src/Form/Radio.svelte
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { createEventDispatcher } from "svelte"
|
|
3
|
-
|
|
4
|
-
const dispatch = createEventDispatcher()
|
|
5
|
-
|
|
6
|
-
export let value;
|
|
7
|
-
export let group;
|
|
8
|
-
export let name
|
|
9
|
-
export let disabled = false
|
|
10
|
-
|
|
11
|
-
function handleChange() {
|
|
12
|
-
if (disabled) return
|
|
13
|
-
group = value
|
|
14
|
-
dispatch("change", group)
|
|
15
|
-
}
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<div class="container">
|
|
19
|
-
<input {disabled} on:change={handleChange} {value} bind:group type="radio" {name} class="checkbox" id={value} />
|
|
20
|
-
<div class="checkbox-container" on:click={handleChange}>
|
|
21
|
-
<div class:disabled class="check-div" class:checked={group === value}>
|
|
22
|
-
<div class="tick_mark" />
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
<slot />
|
|
26
|
-
</div>
|
|
27
|
-
|
|
28
|
-
<style>
|
|
29
|
-
.container {
|
|
30
|
-
display: flex;
|
|
31
|
-
gap: var(--spacing-s);
|
|
32
|
-
}
|
|
33
|
-
.checkbox-container {
|
|
34
|
-
position: relative;
|
|
35
|
-
z-index: 0;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.checkbox {
|
|
39
|
-
display: none;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.check-div {
|
|
43
|
-
position: relative;
|
|
44
|
-
width: 20px;
|
|
45
|
-
height: 20px;
|
|
46
|
-
background-color: var(--grey-2);
|
|
47
|
-
cursor: pointer;
|
|
48
|
-
transition: 0.2s ease transform, 0.2s ease background-color,
|
|
49
|
-
0.2s ease box-shadow;
|
|
50
|
-
overflow: hidden;
|
|
51
|
-
border-radius: 4px;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.check-div:before {
|
|
55
|
-
content: "";
|
|
56
|
-
position: absolute;
|
|
57
|
-
top: 50%;
|
|
58
|
-
right: 0;
|
|
59
|
-
left: 0;
|
|
60
|
-
width: 12px;
|
|
61
|
-
height: 12px;
|
|
62
|
-
margin: 0 auto;
|
|
63
|
-
background-color: var(--background);
|
|
64
|
-
transform: translateY(-50%);
|
|
65
|
-
transition: 0.2s ease width, 0.2s ease height;
|
|
66
|
-
border-radius: 2px;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.check-div:active {
|
|
70
|
-
transform: translateY(-50%) scale(0.9);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.tick_mark {
|
|
74
|
-
position: absolute;
|
|
75
|
-
top: 50%;
|
|
76
|
-
left: 6px;
|
|
77
|
-
width: 5px;
|
|
78
|
-
height: 4px;
|
|
79
|
-
margin: 0 auto;
|
|
80
|
-
transform: rotateZ(-40deg);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.tick_mark:before,
|
|
84
|
-
.tick_mark:after {
|
|
85
|
-
content: "";
|
|
86
|
-
position: absolute;
|
|
87
|
-
background-color: var(--ink);
|
|
88
|
-
border-radius: 2px;
|
|
89
|
-
opacity: 0;
|
|
90
|
-
transition: 0.2s ease transform, 0.2s ease opacity;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.tick_mark:before {
|
|
94
|
-
left: 0;
|
|
95
|
-
bottom: 0;
|
|
96
|
-
width: 2px;
|
|
97
|
-
height: 6px;
|
|
98
|
-
box-shadow: -2px 0 5px rgba(0, 0, 0, 0.23);
|
|
99
|
-
transform: translateY(-68px);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.tick_mark:after {
|
|
103
|
-
left: 0;
|
|
104
|
-
bottom: 0;
|
|
105
|
-
width: 12px;
|
|
106
|
-
height: 2px;
|
|
107
|
-
box-shadow: 0 3px 5px rgba(0, 0, 0, 0.23);
|
|
108
|
-
transform: translateX(78px);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.check-div.disabled:active {
|
|
112
|
-
transform: none;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.checked {
|
|
116
|
-
background-color: var(--grey-2);
|
|
117
|
-
}
|
|
118
|
-
.checked.disabled {
|
|
119
|
-
background-color: var(--grey-5);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.checked:before {
|
|
123
|
-
width: 0;
|
|
124
|
-
height: 0;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.checked .tick_mark:before,
|
|
128
|
-
.checked .tick_mark:after {
|
|
129
|
-
transform: translate(0);
|
|
130
|
-
opacity: 1;
|
|
131
|
-
}
|
|
132
|
-
</style>
|
|
133
|
-
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { View } from "svench";
|
|
3
|
-
import Radio from "./Radio.svelte";
|
|
4
|
-
|
|
5
|
-
let selected = 'Cookies and cream'
|
|
6
|
-
let selected2 = 'Mint choc chip'
|
|
7
|
-
|
|
8
|
-
let menu = [
|
|
9
|
-
'Cookies and cream',
|
|
10
|
-
'Mint choc chip',
|
|
11
|
-
'Raspberry ripple'
|
|
12
|
-
];
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
## Multiple checkboxes
|
|
16
|
-
Use an array and an each block to use the radio button.
|
|
17
|
-
```svelte
|
|
18
|
-
<script>
|
|
19
|
-
let selected = 'Cookies and cream'
|
|
20
|
-
let selected2 = 'Cookies and cream'
|
|
21
|
-
|
|
22
|
-
let menu = [
|
|
23
|
-
'Cookies and cream',
|
|
24
|
-
'Mint choc chip',
|
|
25
|
-
'Raspberry ripple'
|
|
26
|
-
];
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
{#each menu as flavour}
|
|
30
|
-
<Radio name="Ice Cream Flavour" value={flavour} bind:group={selected} label={flavour} showLabel/>
|
|
31
|
-
{/each}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<View name="Multiple radio buttons">
|
|
36
|
-
<div class="container">
|
|
37
|
-
{#each menu as flavour}
|
|
38
|
-
<Radio name="Ice Cream Flavour" value={flavour} bind:group={selected}>
|
|
39
|
-
<label for={flavour}>{flavour}</label>
|
|
40
|
-
</Radio>
|
|
41
|
-
{/each}
|
|
42
|
-
</div>
|
|
43
|
-
</View>
|
|
44
|
-
|
|
45
|
-
<View name="Disabled Radio inputs">
|
|
46
|
-
<div class="container">
|
|
47
|
-
{#each menu as flavour}
|
|
48
|
-
<Radio disabled name="Ice Cream Flavour" value={flavour} bind:group={selected2}>
|
|
49
|
-
<label for={flavour}>{flavour}</label>
|
|
50
|
-
</Radio>
|
|
51
|
-
{/each}
|
|
52
|
-
</div>
|
|
53
|
-
</View>
|
|
54
|
-
|
|
55
|
-
<style>
|
|
56
|
-
label {
|
|
57
|
-
display: grid;
|
|
58
|
-
place-items: center;
|
|
59
|
-
}
|
|
60
|
-
.container {
|
|
61
|
-
display: grid;
|
|
62
|
-
grid-gap: 10px;
|
|
63
|
-
}
|
|
64
|
-
</style>
|
package/src/Form/RichText.svelte
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import Quill from "quill";
|
|
3
|
-
import MarkdownIt from "markdown-it";
|
|
4
|
-
import TurndownService from "turndown";
|
|
5
|
-
import { onMount } from "svelte";
|
|
6
|
-
import "quill/dist/quill.snow.css";
|
|
7
|
-
|
|
8
|
-
const convertMarkdown = new MarkdownIt();
|
|
9
|
-
convertMarkdown.set({
|
|
10
|
-
html: true,
|
|
11
|
-
});
|
|
12
|
-
const turndownService = new TurndownService();
|
|
13
|
-
|
|
14
|
-
export let value = "";
|
|
15
|
-
export let options = null;
|
|
16
|
-
export let width = 400;
|
|
17
|
-
|
|
18
|
-
let quill;
|
|
19
|
-
let container;
|
|
20
|
-
let defaultOptions = {
|
|
21
|
-
modules: {
|
|
22
|
-
toolbar: [
|
|
23
|
-
[{ header: [1, 2, 3, false] }],
|
|
24
|
-
["bold", "italic", "underline", "strike"],
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
placeholder: "Type something...",
|
|
28
|
-
theme: "snow", // or 'bubble'
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
let mergedOptions = { ...defaultOptions, ...options };
|
|
32
|
-
|
|
33
|
-
const updateContent = () => {
|
|
34
|
-
value = turndownService.turndown(quill.container.firstChild.innerHTML);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
onMount(() => {
|
|
38
|
-
quill = new Quill(container, mergedOptions);
|
|
39
|
-
if (value)
|
|
40
|
-
quill.clipboard.dangerouslyPasteHTML(
|
|
41
|
-
convertMarkdown.render(value + "\n")
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
quill.on("text-change", updateContent);
|
|
45
|
-
return () => {
|
|
46
|
-
quill.off("text-change", updateContent);
|
|
47
|
-
};
|
|
48
|
-
});
|
|
49
|
-
</script>
|
|
50
|
-
|
|
51
|
-
<svelte:head>
|
|
52
|
-
{#if mergedOptions.theme !== 'snow'}
|
|
53
|
-
<link
|
|
54
|
-
rel="stylesheet"
|
|
55
|
-
href="//cdn.quilljs.com/1.3.6/quill.{mergedOptions.theme}.css" />
|
|
56
|
-
{/if}
|
|
57
|
-
</svelte:head>
|
|
58
|
-
|
|
59
|
-
<div style="width: {width}px">
|
|
60
|
-
<div bind:this={container} />
|
|
61
|
-
</div>
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { View } from "svench";
|
|
3
|
-
import RichText from "./RichText.svelte";
|
|
4
|
-
|
|
5
|
-
const options = { placeholder: "this is not the default value!" };
|
|
6
|
-
let value;
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
### Rich Text Component
|
|
10
|
-
|
|
11
|
-
This component uses the QuillJS library to add Rich Text editing functionality.
|
|
12
|
-
|
|
13
|
-
It exposes a <code>content</code> variable that you can bind to in order to get Markdown out of the component.
|
|
14
|
-
|
|
15
|
-
As well as the content you can also pass in an option object that looks like so:
|
|
16
|
-
|
|
17
|
-
```js
|
|
18
|
-
let options = {
|
|
19
|
-
modules: {
|
|
20
|
-
toolbar: [
|
|
21
|
-
[{ header: [1, 2, 3, false] }],
|
|
22
|
-
['bold', 'italic', 'underline', 'strike']
|
|
23
|
-
]
|
|
24
|
-
},
|
|
25
|
-
placeholder: 'Type something...',
|
|
26
|
-
theme: 'snow'
|
|
27
|
-
}
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
<View name="default">
|
|
31
|
-
<RichText bind:value />
|
|
32
|
-
</View>
|
|
33
|
-
|
|
34
|
-
<View name="passing in Markdown">
|
|
35
|
-
<RichText value="# This is an h1 heading!" />
|
|
36
|
-
</View>
|
|
37
|
-
|
|
38
|
-
<View name="passing in custom options">
|
|
39
|
-
<RichText {options} />
|
|
40
|
-
</View>
|
package/src/Form/Select.svench
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { View } from "svench";
|
|
3
|
-
import Select from "./Select.svelte";
|
|
4
|
-
import Spacer from "../Spacer/Spacer.svelte"
|
|
5
|
-
|
|
6
|
-
const options = ["Chocolate", "Vanilla", "Strawberry Cheesecake"];
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<View name="default">
|
|
10
|
-
<Select name="Test" label="Flavour">
|
|
11
|
-
<option value="">Choose an option</option>
|
|
12
|
-
{#each options as option}
|
|
13
|
-
<option value={option}>{option}</option>
|
|
14
|
-
{/each}
|
|
15
|
-
</Select>
|
|
16
|
-
</View>
|
|
17
|
-
|
|
18
|
-
<View name="secondary">
|
|
19
|
-
<Select secondary name="Test" label="Flavour">
|
|
20
|
-
<option value="">Choose an option</option>
|
|
21
|
-
{#each options as option}
|
|
22
|
-
<option value={option}>{option}</option>
|
|
23
|
-
{/each}
|
|
24
|
-
</Select>
|
|
25
|
-
</View>
|
|
26
|
-
|
|
27
|
-
<View name="outline">
|
|
28
|
-
<Select outline name="Test" label="Flavour">
|
|
29
|
-
<option value="">Choose an option</option>
|
|
30
|
-
{#each options as option}
|
|
31
|
-
<option value={option}>{option}</option>
|
|
32
|
-
{/each}
|
|
33
|
-
</Select>
|
|
34
|
-
</View>
|
|
35
|
-
|
|
36
|
-
<View name="disabled">
|
|
37
|
-
<Select disabled name="Test" label="Flavour">
|
|
38
|
-
<option value="">Choose an option</option>
|
|
39
|
-
{#each options as option}
|
|
40
|
-
<option value={option}>{option}</option>
|
|
41
|
-
{/each}
|
|
42
|
-
</Select>
|
|
43
|
-
</View>
|
|
44
|
-
|
|
45
|
-
<View name="thin">
|
|
46
|
-
<Select thin name="Test" label="Flavour">
|
|
47
|
-
<option value="">Choose an option</option>
|
|
48
|
-
{#each options as option}
|
|
49
|
-
<option value={option}>{option}</option>
|
|
50
|
-
{/each}
|
|
51
|
-
</Select>
|
|
52
|
-
</View>
|
|
53
|
-
|
|
54
|
-
<View name="extraThin">
|
|
55
|
-
<Select extraThin name="Test" label="Flavour">
|
|
56
|
-
<option value="">Choose an option</option>
|
|
57
|
-
{#each options as option}
|
|
58
|
-
<option value={option}>{option}</option>
|
|
59
|
-
{/each}
|
|
60
|
-
</Select>
|
|
61
|
-
</View>
|
|
62
|
-
|
package/src/Form/Slider.svench
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { View } from "svench";
|
|
3
|
-
import Slider from "./Slider.svelte";
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<View name="default">
|
|
7
|
-
<Slider label=Quantity value="50" />
|
|
8
|
-
</View>
|
|
9
|
-
|
|
10
|
-
<View name="show value">
|
|
11
|
-
<Slider label="Quantity" value="50" showValue />
|
|
12
|
-
</View>
|
|
13
|
-
|
|
14
|
-
<View name="show range">
|
|
15
|
-
<Slider label="Quantity" value="25" showValue showRange min="0" max="100" />
|
|
16
|
-
</View>
|
|
17
|
-
|
|
18
|
-
<View name="custom min and max">
|
|
19
|
-
<Slider label="Quantity" value="350" showValue showRange min="50" max="500" />
|
|
20
|
-
</View>
|
|
21
|
-
|
|
22
|
-
<View name="custom step">
|
|
23
|
-
<Slider label="Quantity" value="25" step="25" showValue showRange min="0" max="100" />
|
|
24
|
-
</View>
|
|
25
|
-
|
|
26
|
-
|
package/src/Form/TextArea.svench
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { View } from "svench";
|
|
3
|
-
import TextArea from "./TextArea.svelte";
|
|
4
|
-
|
|
5
|
-
import Button from "../Button/Button.svelte";
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<View name="default">
|
|
9
|
-
<TextArea placeholder="Enter your email text" label="Email Body" />
|
|
10
|
-
</View>
|
|
11
|
-
|
|
12
|
-
<View name="disabled">
|
|
13
|
-
<TextArea disabled placeholder="Enter your email text" label="Email Body" />
|
|
14
|
-
</View>
|
|
15
|
-
|
|
16
|
-
<View name="no label">
|
|
17
|
-
<TextArea placeholder="Enter your email text" />
|
|
18
|
-
</View>
|
|
19
|
-
|
|
20
|
-
<View name="thin">
|
|
21
|
-
<TextArea thin placeholder="Enter your email text" label="Email Body" />
|
|
22
|
-
</View>
|
|
23
|
-
|
|
24
|
-
<View name="extraThin">
|
|
25
|
-
<TextArea extraThin placeholder="Enter your email text" label="Email Body" />
|
|
26
|
-
</View>
|
|
27
|
-
|
|
28
|
-
<View name="with buttons">
|
|
29
|
-
<TextArea edit placeholder="Enter your email text" label="Email Body" />
|
|
30
|
-
</View>
|
package/src/Form/Toggle.svench
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { View } from "svench";
|
|
3
|
-
import Toggle from "./Toggle.svelte";
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<View name="default">
|
|
7
|
-
<Toggle />
|
|
8
|
-
</View>
|
|
9
|
-
|
|
10
|
-
<View name="checked with text">
|
|
11
|
-
<Toggle text="Display on mobile?" />
|
|
12
|
-
</View>
|
|
13
|
-
|
|
14
|
-
<View name="thin">
|
|
15
|
-
<Toggle text="Display on mobile?" thin />
|
|
16
|
-
</View>
|
|
17
|
-
|
|
18
|
-
<View name="disabled">
|
|
19
|
-
<Toggle disabled={true} />
|
|
20
|
-
</View>
|
|
21
|
-
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<svg
|
|
2
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
3
|
-
viewBox="0 0 24 24"
|
|
4
|
-
width="24"
|
|
5
|
-
height="24">
|
|
6
|
-
<path fill="none" d="M0 0h24v24H0z" />
|
|
7
|
-
<path
|
|
8
|
-
d="M14.121 10.48a1 1 0 0 0-1.414 0l-.707.706a2 2 0 1
|
|
9
|
-
1-2.828-2.828l5.63-5.632a6.5 6.5 0 0 1 6.377 10.568l-2.108
|
|
10
|
-
2.135-4.95-4.95zM3.161 4.468a6.503 6.503 0 0 1 8.009-.938L7.757 6.944a4 4 0
|
|
11
|
-
0 0 5.513 5.794l.144-.137 4.243 4.242-4.243 4.243a2 2 0 0 1-2.828 0L3.16
|
|
12
|
-
13.66a6.5 6.5 0 0 1 0-9.192z"
|
|
13
|
-
fill="rgba(128,129,146,1)" />
|
|
14
|
-
</svg>
|
package/src/Icons/Icon.svelte
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
<script context="module">
|
|
2
|
-
import pathsByName from "./icon-paths";
|
|
3
|
-
export const iconOptions = Object.keys(pathsByName);
|
|
4
|
-
export const directions = ["n", "ne", "e", "se", "s", "sw", "w", "nw"];
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
export let name = "arrow";
|
|
9
|
-
export let direction = "n";
|
|
10
|
-
|
|
11
|
-
$: paths = pathsByName[name] || [];
|
|
12
|
-
$: rotation = directions.indexOf(direction) * 45;
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<style>
|
|
16
|
-
.c {
|
|
17
|
-
width: 1.25em;
|
|
18
|
-
height: 1.25em;
|
|
19
|
-
fill: currentColor;
|
|
20
|
-
overflow: visible;
|
|
21
|
-
margin-right: var(--spacing-xs);
|
|
22
|
-
}
|
|
23
|
-
</style>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<svg
|
|
27
|
-
class="c"
|
|
28
|
-
viewBox="0 0 24 24"
|
|
29
|
-
fill-rule="evenodd"
|
|
30
|
-
clip-rule="evenodd"
|
|
31
|
-
style={`transform: rotate(${rotation}deg)`}>
|
|
32
|
-
{#each paths as path}
|
|
33
|
-
<path d={path} />
|
|
34
|
-
{/each}
|
|
35
|
-
</svg>
|
|
36
|
-
|
package/src/Icons/Icon.svench
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { View } from "svench";
|
|
3
|
-
import Icon from "./Icon.svelte";
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<View name="add icon">
|
|
7
|
-
<Icon name="add" />
|
|
8
|
-
</View>
|
|
9
|
-
|
|
10
|
-
<View name="Add Row icon">
|
|
11
|
-
<Icon name="addrow" />
|
|
12
|
-
</View>
|
|
13
|
-
|
|
14
|
-
<View name="Add Column icon">
|
|
15
|
-
<Icon name="addcolumn" />
|
|
16
|
-
</View>
|
|
17
|
-
|
|
18
|
-
<View name="View icon">
|
|
19
|
-
<Icon name="view" />
|
|
20
|
-
</View>
|
|
21
|
-
|
|
22
|
-
<View name="Table icon">
|
|
23
|
-
<Icon name="table" />
|
|
24
|
-
</View>
|
|
25
|
-
|
|
26
|
-
<View name="Edit icon">
|
|
27
|
-
<Icon name="edit" />
|
|
28
|
-
</View>
|
|
29
|
-
|
|
30
|
-
<View name="Delete icon">
|
|
31
|
-
<Icon name="delete" />
|
|
32
|
-
</View>
|
|
33
|
-
|
|
34
|
-
<View name="Close icon">
|
|
35
|
-
<Icon name="close" />
|
|
36
|
-
</View>
|
|
37
|
-
|
|
38
|
-
<View name="Arrow Up icon">
|
|
39
|
-
<Icon name="arrowup" />
|
|
40
|
-
</View>
|
|
41
|
-
|
|
42
|
-
<View name="Arrow Right icon">
|
|
43
|
-
<Icon name="arrowright" />
|
|
44
|
-
</View>
|
|
45
|
-
|
|
46
|
-
<View name="Arrow Down icon">
|
|
47
|
-
<Icon name="arrowdown" />
|
|
48
|
-
</View>
|
|
49
|
-
|
|
50
|
-
<View name="Arrow Left icon">
|
|
51
|
-
<Icon name="arrowleft" />
|
|
52
|
-
</View>
|
|
53
|
-
|
|
54
|
-
<View name="Search icon">
|
|
55
|
-
<Icon name="search" />
|
|
56
|
-
</View>
|
|
57
|
-
|
|
58
|
-
<View name="Preview icon">
|
|
59
|
-
<Icon name="preview" />
|
|
60
|
-
</View>
|
|
61
|
-
|
|
62
|
-
<View name="Settings icon">
|
|
63
|
-
<Icon name="settings" />
|
|
64
|
-
</View>
|
|
65
|
-
|
|
66
|
-
<View name="Add User icon">
|
|
67
|
-
<Icon name="adduser" />
|
|
68
|
-
</View>
|
|
69
|
-
|
|
70
|
-
<View name="Plugin icon">
|
|
71
|
-
<Icon name="plugin" />
|
|
72
|
-
</View>
|
|
73
|
-
|
|
74
|
-
<View name="Help icon">
|
|
75
|
-
<Icon name="help" />
|
|
76
|
-
</View>
|
|
77
|
-
|
|
78
|
-
<View name="Sort Ascending icon">
|
|
79
|
-
<Icon name="sortascending" />
|
|
80
|
-
</View>
|
|
81
|
-
|
|
82
|
-
<View name="Sort Descending icon">
|
|
83
|
-
<Icon name="sortdescending" />
|
|
84
|
-
</View>
|
|
85
|
-
|
|
86
|
-
<View name="Calculate icon">
|
|
87
|
-
<Icon name="calculate" />
|
|
88
|
-
</View>
|
|
89
|
-
|
|
90
|
-
<View name="Filter icon">
|
|
91
|
-
<Icon name="filter" />
|
|
92
|
-
</View>
|
|
93
|
-
|
|
94
|
-
<View name="Add Fill">
|
|
95
|
-
<Icon name="addfill" />
|
|
96
|
-
</View>
|
|
97
|
-
|
|
98
|
-
<View name="Group">
|
|
99
|
-
<Icon name="group" />
|
|
100
|
-
</View>
|
|
101
|
-
|
|
102
|
-
<View name="Lightning">
|
|
103
|
-
<Icon name="lightning" />
|
|
104
|
-
</View>
|
|
105
|
-
|
|
106
|
-
<View name="Download">
|
|
107
|
-
<Icon name="download" />
|
|
108
|
-
</View>
|
|
109
|
-
|