@geoffcox/sterling-svelte 0.0.20 → 0.0.21
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/Button.constants.d.ts +2 -0
- package/Button.constants.js +2 -0
- package/Button.svelte +11 -0
- package/Button.svelte.d.ts +10 -5
- package/Button.types.d.ts +6 -2
- package/Checkbox.svelte +14 -1
- package/Checkbox.svelte.d.ts +8 -0
- package/Dialog.svelte +2 -3
- package/Dropdown.svelte +9 -0
- package/Dropdown.svelte.d.ts +6 -0
- package/Field.constants.d.ts +1 -0
- package/Field.constants.js +1 -0
- package/Field.svelte +22 -7
- package/Field.svelte.d.ts +9 -3
- package/Field.types.d.ts +4 -1
- package/Input.svelte +25 -1
- package/Input.svelte.d.ts +12 -0
- package/Label.svelte +12 -2
- package/Label.svelte.d.ts +9 -1
- package/Link.constants.d.ts +1 -0
- package/Link.constants.js +1 -0
- package/Link.svelte +11 -0
- package/Link.svelte.d.ts +8 -3
- package/Link.types.d.ts +4 -1
- package/List.constants.d.ts +1 -1
- package/List.constants.js +1 -1
- package/List.svelte +13 -7
- package/List.svelte.d.ts +6 -2
- package/ListItem.svelte +11 -2
- package/ListItem.svelte.d.ts +6 -0
- package/Menu.svelte +46 -12
- package/Menu.svelte.d.ts +26 -0
- package/MenuBar.constants.d.ts +1 -0
- package/MenuBar.constants.js +1 -0
- package/MenuBar.svelte +12 -3
- package/MenuBar.svelte.d.ts +5 -1
- package/MenuBar.types.d.ts +4 -0
- package/MenuButton.svelte +42 -8
- package/MenuButton.svelte.d.ts +12 -4
- package/MenuItem.constants.d.ts +1 -0
- package/MenuItem.constants.js +1 -0
- package/MenuItem.svelte +18 -8
- package/MenuItem.svelte.d.ts +12 -3
- package/{Menus.types.d.ts → MenuItem.types.d.ts} +0 -4
- package/MenuItem.types.js +1 -0
- package/{Menus.utils.d.ts → MenuItem.utils.d.ts} +1 -1
- package/Progress.constants.d.ts +1 -0
- package/Progress.constants.js +1 -0
- package/Progress.svelte +16 -3
- package/Progress.svelte.d.ts +15 -3
- package/Progress.types.d.ts +4 -1
- package/Radio.svelte +14 -1
- package/Radio.svelte.d.ts +8 -0
- package/Select.svelte +15 -1
- package/Select.svelte.d.ts +10 -0
- package/Slider.svelte +9 -0
- package/Slider.svelte.d.ts +6 -0
- package/Switch.svelte +11 -0
- package/Switch.svelte.d.ts +6 -0
- package/Tab.svelte +11 -2
- package/Tab.svelte.d.ts +6 -0
- package/TabList.constants.d.ts +1 -1
- package/TabList.constants.js +1 -1
- package/TabList.svelte +8 -2
- package/TabList.svelte.d.ts +4 -0
- package/TextArea.constants.d.ts +1 -0
- package/TextArea.constants.js +1 -0
- package/TextArea.svelte +22 -0
- package/TextArea.svelte.d.ts +13 -2
- package/TextArea.types.d.ts +4 -1
- package/Tooltip.constants.d.ts +1 -0
- package/Tooltip.constants.js +1 -0
- package/Tooltip.svelte +26 -10
- package/Tooltip.svelte.d.ts +7 -3
- package/Tooltip.types.d.ts +4 -3
- package/Tree.constants.d.ts +2 -2
- package/Tree.constants.js +2 -2
- package/Tree.svelte +41 -7
- package/Tree.svelte.d.ts +34 -1
- package/Tree.types.d.ts +4 -4
- package/TreeChevron.svelte +1 -1
- package/TreeItem.svelte +76 -52
- package/TreeItem.svelte.d.ts +26 -3
- package/TreeItemDisplay.svelte +11 -0
- package/TreeItemDisplay.svelte.d.ts +6 -0
- package/floating-ui.constants.d.ts +1 -0
- package/floating-ui.constants.js +14 -0
- package/floating-ui.types.d.ts +2 -0
- package/floating-ui.types.js +1 -0
- package/index.d.ts +16 -6
- package/index.js +12 -5
- package/package.json +14 -4
- package/Menus.constants.d.ts +0 -2
- package/Menus.constants.js +0 -2
- /package/{Menus.types.js → MenuBar.types.js} +0 -0
- /package/{Menus.utils.js → MenuItem.utils.js} +0 -0
package/TreeItem.svelte
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import { getContext, setContext } from "svelte";
|
|
2
2
|
import { slide } from "svelte/transition";
|
|
3
|
-
import {
|
|
3
|
+
import { TREE_CONTEXT_KEY, TREE_ITEM_CONTEXT_KEY } from "./Tree.constants";
|
|
4
4
|
import TreeItemDisplay from "./TreeItemDisplay.svelte";
|
|
5
5
|
import { writable } from "svelte/store";
|
|
6
6
|
export let disabled = false;
|
|
@@ -9,8 +9,8 @@ const {
|
|
|
9
9
|
expandedValues,
|
|
10
10
|
selectedValue,
|
|
11
11
|
disabled: treeDisabled
|
|
12
|
-
} = getContext(
|
|
13
|
-
const { depth = 0, disabled: parentDisabled } = getContext(
|
|
12
|
+
} = getContext(TREE_CONTEXT_KEY);
|
|
13
|
+
const { depth = 0, disabled: parentDisabled } = getContext(TREE_ITEM_CONTEXT_KEY) || {};
|
|
14
14
|
let treeItemRef;
|
|
15
15
|
$:
|
|
16
16
|
hasChildren = $$slots.default;
|
|
@@ -26,7 +26,7 @@ $: {
|
|
|
26
26
|
}
|
|
27
27
|
const collapseItem = (index) => {
|
|
28
28
|
if (!disabled) {
|
|
29
|
-
index = index ?? $expandedValues.findIndex((
|
|
29
|
+
index = index ?? $expandedValues.findIndex((expandedValue) => expandedValue === value);
|
|
30
30
|
if (index !== -1) {
|
|
31
31
|
expandedValues.set([
|
|
32
32
|
...$expandedValues.slice(0, index),
|
|
@@ -37,9 +37,10 @@ const collapseItem = (index) => {
|
|
|
37
37
|
}
|
|
38
38
|
return false;
|
|
39
39
|
};
|
|
40
|
+
export const collapse = () => collapseItem();
|
|
40
41
|
const expandItem = (index) => {
|
|
41
42
|
if (!disabled) {
|
|
42
|
-
index = index ?? $expandedValues.findIndex((
|
|
43
|
+
index = index ?? $expandedValues.findIndex((expandedValue) => expandedValue === value);
|
|
43
44
|
if (index === -1) {
|
|
44
45
|
expandedValues.set([...$expandedValues, value]);
|
|
45
46
|
return true;
|
|
@@ -47,42 +48,93 @@ const expandItem = (index) => {
|
|
|
47
48
|
}
|
|
48
49
|
return false;
|
|
49
50
|
};
|
|
50
|
-
const
|
|
51
|
+
export const expand = () => expandItem();
|
|
52
|
+
export const toggleExpanded = () => {
|
|
51
53
|
if (!disabled) {
|
|
52
|
-
const index = $expandedValues.findIndex((
|
|
54
|
+
const index = $expandedValues.findIndex((expandedValue) => expandedValue === value);
|
|
53
55
|
return index !== -1 ? collapseItem(index) : expandItem(index);
|
|
54
56
|
}
|
|
55
57
|
return false;
|
|
56
58
|
};
|
|
57
|
-
const
|
|
59
|
+
const blurItem = (treeItemElement) => {
|
|
58
60
|
if (!_disabled) {
|
|
59
|
-
const item = treeItemElement
|
|
60
|
-
item?.
|
|
61
|
+
const item = treeItemElement?.querySelector(".item");
|
|
62
|
+
item?.blur();
|
|
61
63
|
}
|
|
62
64
|
};
|
|
63
|
-
const
|
|
65
|
+
export const blur = () => {
|
|
66
|
+
blurItem(treeItemRef);
|
|
67
|
+
};
|
|
68
|
+
const focusItem = (treeItemElement, options) => {
|
|
69
|
+
if (!_disabled) {
|
|
70
|
+
const item = treeItemElement?.querySelector(".item");
|
|
71
|
+
item?.focus(options);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
export const focus = (options) => {
|
|
75
|
+
focusItem(treeItemRef);
|
|
76
|
+
treeItemRef?.focus(options);
|
|
77
|
+
};
|
|
78
|
+
const clickItem = (treeItemElement) => {
|
|
79
|
+
if (!_disabled) {
|
|
80
|
+
const item = treeItemElement?.querySelector(".item");
|
|
81
|
+
item?.click();
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
export const click = () => {
|
|
85
|
+
clickItem(treeItemRef);
|
|
86
|
+
};
|
|
87
|
+
const selectItemByValue = (value2) => {
|
|
64
88
|
if (!_disabled) {
|
|
65
89
|
selectedValue.set(value2);
|
|
66
90
|
}
|
|
67
91
|
};
|
|
68
|
-
export const
|
|
92
|
+
export const select = () => {
|
|
69
93
|
if (!_disabled) {
|
|
70
|
-
|
|
94
|
+
selectItemByValue(value);
|
|
71
95
|
}
|
|
72
96
|
};
|
|
73
|
-
const
|
|
97
|
+
export const selectParent = () => {
|
|
74
98
|
if (!_disabled) {
|
|
75
99
|
let candidate = treeItemRef.parentElement?.closest('[role="treeitem"][data-value]');
|
|
76
100
|
let candidateValue = candidate?.getAttribute("data-value");
|
|
77
101
|
if (candidateValue && candidate) {
|
|
78
|
-
|
|
102
|
+
selectItemByValue(candidateValue);
|
|
79
103
|
focusItem(candidate);
|
|
80
104
|
return true;
|
|
81
105
|
}
|
|
82
106
|
}
|
|
83
107
|
return false;
|
|
84
108
|
};
|
|
85
|
-
const
|
|
109
|
+
export const selectPrevious = () => {
|
|
110
|
+
if (!_disabled) {
|
|
111
|
+
let candidate = void 0;
|
|
112
|
+
let candidateValue = void 0;
|
|
113
|
+
const previousSibling = treeItemRef?.previousElementSibling;
|
|
114
|
+
if (previousSibling) {
|
|
115
|
+
const decendants = previousSibling.querySelectorAll('[role="treeitem"][data-value]');
|
|
116
|
+
if (decendants) {
|
|
117
|
+
candidate = decendants[decendants.length - 1];
|
|
118
|
+
candidateValue = candidate?.getAttribute("data-value");
|
|
119
|
+
}
|
|
120
|
+
if (!candidateValue) {
|
|
121
|
+
candidate = previousSibling;
|
|
122
|
+
candidateValue = candidate?.getAttribute("data-value");
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (!candidateValue) {
|
|
126
|
+
candidate = treeItemRef.parentElement?.closest('[role="treeitem"][data-value]');
|
|
127
|
+
candidateValue = candidate?.getAttribute("data-value");
|
|
128
|
+
}
|
|
129
|
+
if (candidateValue && candidate) {
|
|
130
|
+
selectItemByValue(candidateValue);
|
|
131
|
+
focusItem(candidate);
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return false;
|
|
136
|
+
};
|
|
137
|
+
export const selectNext = () => {
|
|
86
138
|
if (!_disabled) {
|
|
87
139
|
let candidateValue = void 0;
|
|
88
140
|
let candidate = treeItemRef.querySelector('[role="treeitem"][data-value]');
|
|
@@ -105,35 +157,7 @@ const selectNextItem = () => {
|
|
|
105
157
|
}
|
|
106
158
|
}
|
|
107
159
|
if (candidateValue && candidate) {
|
|
108
|
-
|
|
109
|
-
focusItem(candidate);
|
|
110
|
-
return true;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return false;
|
|
114
|
-
};
|
|
115
|
-
const selectPreviousItem = () => {
|
|
116
|
-
if (!_disabled) {
|
|
117
|
-
let candidate = void 0;
|
|
118
|
-
let candidateValue = void 0;
|
|
119
|
-
const previousSibling = treeItemRef?.previousElementSibling;
|
|
120
|
-
if (previousSibling) {
|
|
121
|
-
const decendants = previousSibling.querySelectorAll('[role="treeitem"][data-value]');
|
|
122
|
-
if (decendants) {
|
|
123
|
-
candidate = decendants[decendants.length - 1];
|
|
124
|
-
candidateValue = candidate?.getAttribute("data-value");
|
|
125
|
-
}
|
|
126
|
-
if (!candidateValue) {
|
|
127
|
-
candidate = previousSibling;
|
|
128
|
-
candidateValue = candidate?.getAttribute("data-value");
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
if (!candidateValue) {
|
|
132
|
-
candidate = treeItemRef.parentElement?.closest('[role="treeitem"][data-value]');
|
|
133
|
-
candidateValue = candidate?.getAttribute("data-value");
|
|
134
|
-
}
|
|
135
|
-
if (candidateValue && candidate) {
|
|
136
|
-
selectItemById(candidateValue);
|
|
160
|
+
selectItemByValue(candidateValue);
|
|
137
161
|
focusItem(candidate);
|
|
138
162
|
return true;
|
|
139
163
|
}
|
|
@@ -143,7 +167,7 @@ const selectPreviousItem = () => {
|
|
|
143
167
|
const onClick = () => {
|
|
144
168
|
if (!_disabled) {
|
|
145
169
|
toggleExpanded();
|
|
146
|
-
|
|
170
|
+
select();
|
|
147
171
|
}
|
|
148
172
|
};
|
|
149
173
|
const onKeydown = (event) => {
|
|
@@ -160,7 +184,7 @@ const onKeydown = (event) => {
|
|
|
160
184
|
case "ArrowRight":
|
|
161
185
|
if (hasChildren) {
|
|
162
186
|
if (expanded) {
|
|
163
|
-
if (
|
|
187
|
+
if (selectNext()) {
|
|
164
188
|
event.preventDefault();
|
|
165
189
|
event.stopPropagation();
|
|
166
190
|
return false;
|
|
@@ -179,21 +203,21 @@ const onKeydown = (event) => {
|
|
|
179
203
|
event.stopPropagation();
|
|
180
204
|
return false;
|
|
181
205
|
}
|
|
182
|
-
} else if (
|
|
206
|
+
} else if (selectParent()) {
|
|
183
207
|
event.preventDefault();
|
|
184
208
|
event.stopPropagation();
|
|
185
209
|
return false;
|
|
186
210
|
}
|
|
187
211
|
break;
|
|
188
212
|
case "ArrowUp":
|
|
189
|
-
if (
|
|
213
|
+
if (selectPrevious()) {
|
|
190
214
|
event.preventDefault();
|
|
191
215
|
event.stopPropagation();
|
|
192
216
|
return false;
|
|
193
217
|
}
|
|
194
218
|
break;
|
|
195
219
|
case "ArrowDown":
|
|
196
|
-
if (
|
|
220
|
+
if (selectNext()) {
|
|
197
221
|
event.preventDefault();
|
|
198
222
|
event.stopPropagation();
|
|
199
223
|
return false;
|
|
@@ -202,7 +226,7 @@ const onKeydown = (event) => {
|
|
|
202
226
|
}
|
|
203
227
|
}
|
|
204
228
|
};
|
|
205
|
-
setContext(
|
|
229
|
+
setContext(TREE_ITEM_CONTEXT_KEY, { depth: depth + 1, disabled: disabledStore });
|
|
206
230
|
</script>
|
|
207
231
|
|
|
208
232
|
<!--
|
|
@@ -264,7 +288,7 @@ A item in a Tree displaying the item and children.
|
|
|
264
288
|
</div>
|
|
265
289
|
{#if expanded && hasChildren}
|
|
266
290
|
<div class="children" transition:slide={{ duration: 200 }} role="group">
|
|
267
|
-
<slot />
|
|
291
|
+
<slot {depth} {disabled} {selected} {value} />
|
|
268
292
|
</div>
|
|
269
293
|
{/if}
|
|
270
294
|
</div>
|
package/TreeItem.svelte.d.ts
CHANGED
|
@@ -4,7 +4,16 @@ declare const __propDef: {
|
|
|
4
4
|
[x: string]: any;
|
|
5
5
|
disabled?: boolean | undefined;
|
|
6
6
|
value: string;
|
|
7
|
-
|
|
7
|
+
collapse?: (() => boolean) | undefined;
|
|
8
|
+
expand?: (() => boolean) | undefined;
|
|
9
|
+
toggleExpanded?: (() => boolean) | undefined;
|
|
10
|
+
blur?: (() => void) | undefined;
|
|
11
|
+
focus?: ((options?: FocusOptions) => void) | undefined;
|
|
12
|
+
click?: (() => void) | undefined;
|
|
13
|
+
select?: (() => void) | undefined;
|
|
14
|
+
selectParent?: (() => boolean) | undefined;
|
|
15
|
+
selectPrevious?: (() => boolean) | undefined;
|
|
16
|
+
selectNext?: (() => boolean) | undefined;
|
|
8
17
|
};
|
|
9
18
|
events: {
|
|
10
19
|
blur: FocusEvent;
|
|
@@ -52,7 +61,12 @@ declare const __propDef: {
|
|
|
52
61
|
selected: boolean;
|
|
53
62
|
value: string;
|
|
54
63
|
};
|
|
55
|
-
default: {
|
|
64
|
+
default: {
|
|
65
|
+
depth: number;
|
|
66
|
+
disabled: boolean;
|
|
67
|
+
selected: boolean;
|
|
68
|
+
value: string;
|
|
69
|
+
};
|
|
56
70
|
};
|
|
57
71
|
};
|
|
58
72
|
export type TreeItemProps = typeof __propDef.props;
|
|
@@ -60,6 +74,15 @@ export type TreeItemEvents = typeof __propDef.events;
|
|
|
60
74
|
export type TreeItemSlots = typeof __propDef.slots;
|
|
61
75
|
/** A item in a Tree displaying the item and children. */
|
|
62
76
|
export default class TreeItem extends SvelteComponentTyped<TreeItemProps, TreeItemEvents, TreeItemSlots> {
|
|
63
|
-
get
|
|
77
|
+
get collapse(): () => boolean;
|
|
78
|
+
get expand(): () => boolean;
|
|
79
|
+
get toggleExpanded(): () => boolean;
|
|
80
|
+
get blur(): () => void;
|
|
81
|
+
get focus(): (options?: FocusOptions | undefined) => void;
|
|
82
|
+
get click(): () => void;
|
|
83
|
+
get select(): () => void;
|
|
84
|
+
get selectParent(): () => boolean;
|
|
85
|
+
get selectPrevious(): () => boolean;
|
|
86
|
+
get selectNext(): () => boolean;
|
|
64
87
|
}
|
|
65
88
|
export {};
|
package/TreeItemDisplay.svelte
CHANGED
|
@@ -5,9 +5,20 @@ export let expanded = false;
|
|
|
5
5
|
export let hasChildren = false;
|
|
6
6
|
export let value;
|
|
7
7
|
export let selected = false;
|
|
8
|
+
let divRef;
|
|
9
|
+
export const click = () => {
|
|
10
|
+
divRef?.click();
|
|
11
|
+
};
|
|
12
|
+
export const blur = () => {
|
|
13
|
+
divRef?.blur();
|
|
14
|
+
};
|
|
15
|
+
export const focus = (options) => {
|
|
16
|
+
divRef?.focus(options);
|
|
17
|
+
};
|
|
8
18
|
</script>
|
|
9
19
|
|
|
10
20
|
<div
|
|
21
|
+
bind:this={divRef}
|
|
11
22
|
class="sterling-tree-item"
|
|
12
23
|
class:disabled
|
|
13
24
|
class:expanded
|
|
@@ -8,6 +8,9 @@ declare const __propDef: {
|
|
|
8
8
|
hasChildren?: boolean | undefined;
|
|
9
9
|
value: string;
|
|
10
10
|
selected?: boolean | undefined;
|
|
11
|
+
click?: (() => void) | undefined;
|
|
12
|
+
blur?: (() => void) | undefined;
|
|
13
|
+
focus?: ((options?: FocusOptions) => void) | undefined;
|
|
11
14
|
};
|
|
12
15
|
events: {
|
|
13
16
|
blur: FocusEvent;
|
|
@@ -53,5 +56,8 @@ export type TreeItemDisplayProps = typeof __propDef.props;
|
|
|
53
56
|
export type TreeItemDisplayEvents = typeof __propDef.events;
|
|
54
57
|
export type TreeItemDisplaySlots = typeof __propDef.slots;
|
|
55
58
|
export default class TreeItemDisplay extends SvelteComponentTyped<TreeItemDisplayProps, TreeItemDisplayEvents, TreeItemDisplaySlots> {
|
|
59
|
+
get click(): () => void;
|
|
60
|
+
get blur(): () => void;
|
|
61
|
+
get focus(): (options?: FocusOptions | undefined) => void;
|
|
56
62
|
}
|
|
57
63
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FLOATING_PLACEMENTS: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/index.d.ts
CHANGED
|
@@ -9,20 +9,30 @@ export { darkTheme } from './theme/darkTheme';
|
|
|
9
9
|
export { lightTheme } from './theme/lightTheme';
|
|
10
10
|
export { neutralColors, lightStatusColors, darkStatusColors } from './theme/colors';
|
|
11
11
|
export { toggleDarkTheme } from './theme/toggleDarkTheme';
|
|
12
|
-
export { menuBarContextKey, menuItemContextKey } from './Menus.constants';
|
|
13
12
|
export type { ButtonVariant, ButtonShape } from './Button.types';
|
|
14
13
|
export type { FieldStatus } from './Field.types';
|
|
14
|
+
export type { FloatingPlacement } from './floating-ui.types';
|
|
15
15
|
export type { LinkVariant } from './Link.types';
|
|
16
16
|
export type { ListContext } from './List.types';
|
|
17
|
-
export type { MenuBarContext
|
|
17
|
+
export type { MenuBarContext } from './MenuBar.types';
|
|
18
|
+
export type { MenuItemContext, MenuItemRegistration } from './MenuItem.types';
|
|
18
19
|
export type { ProgressColorful } from './Progress.types';
|
|
19
20
|
export type { TabListContext } from './TabList.types';
|
|
20
21
|
export type { TextAreaResize } from './TextArea.types';
|
|
21
|
-
export type {
|
|
22
|
+
export type { TooltipShowOn } from './Tooltip.types';
|
|
22
23
|
export type { TreeContext, TreeItemContext } from './Tree.types';
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
24
|
+
export { BUTTON_SHAPES, BUTTON_VARIANTS } from './Button.constants';
|
|
25
|
+
export { FIELD_STATUSES } from './Field.constants';
|
|
26
|
+
export { FLOATING_PLACEMENTS } from './floating-ui.constants';
|
|
27
|
+
export { LINK_VARIANTS } from './Link.constants';
|
|
28
|
+
export { LIST_CONTEXT_KEY } from './List.constants';
|
|
29
|
+
export { MENU_BAR_CONTEXT_KEY } from './MenuBar.constants';
|
|
30
|
+
export { MENU_ITEM_CONTEXT_KEY } from './MenuItem.constants';
|
|
31
|
+
export { PROGRESS_COLORFULS } from './Progress.constants';
|
|
32
|
+
export { TAB_LIST_CONTEXT_KEY } from './TabList.constants';
|
|
33
|
+
export { TEXT_AREA_RESIZES } from './TextArea.constants';
|
|
34
|
+
export { TOOLTIP_SHOW_ONS } from './Tooltip.constants';
|
|
35
|
+
export { TREE_CONTEXT_KEY as treeContextKey, TREE_ITEM_CONTEXT_KEY as treeItemContextKey } from './Tree.constants';
|
|
26
36
|
import Button from './Button.svelte';
|
|
27
37
|
import Checkbox from './Checkbox.svelte';
|
|
28
38
|
import Dialog from './Dialog.svelte';
|
package/index.js
CHANGED
|
@@ -11,12 +11,19 @@ export { darkTheme } from './theme/darkTheme';
|
|
|
11
11
|
export { lightTheme } from './theme/lightTheme';
|
|
12
12
|
export { neutralColors, lightStatusColors, darkStatusColors } from './theme/colors';
|
|
13
13
|
export { toggleDarkTheme } from './theme/toggleDarkTheme';
|
|
14
|
-
// ----- Button ----- //
|
|
15
|
-
export { menuBarContextKey, menuItemContextKey } from './Menus.constants';
|
|
16
14
|
// ----- Component constants ----- //
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
15
|
+
export { BUTTON_SHAPES, BUTTON_VARIANTS } from './Button.constants';
|
|
16
|
+
export { FIELD_STATUSES } from './Field.constants';
|
|
17
|
+
export { FLOATING_PLACEMENTS } from './floating-ui.constants';
|
|
18
|
+
export { LINK_VARIANTS } from './Link.constants';
|
|
19
|
+
export { LIST_CONTEXT_KEY } from './List.constants';
|
|
20
|
+
export { MENU_BAR_CONTEXT_KEY } from './MenuBar.constants';
|
|
21
|
+
export { MENU_ITEM_CONTEXT_KEY } from './MenuItem.constants';
|
|
22
|
+
export { PROGRESS_COLORFULS } from './Progress.constants';
|
|
23
|
+
export { TAB_LIST_CONTEXT_KEY } from './TabList.constants';
|
|
24
|
+
export { TEXT_AREA_RESIZES } from './TextArea.constants';
|
|
25
|
+
export { TOOLTIP_SHOW_ONS } from './Tooltip.constants';
|
|
26
|
+
export { TREE_CONTEXT_KEY as treeContextKey, TREE_ITEM_CONTEXT_KEY as treeItemContextKey } from './Tree.constants';
|
|
20
27
|
// ----- Components ----- //
|
|
21
28
|
import Button from './Button.svelte';
|
|
22
29
|
import Checkbox from './Checkbox.svelte';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geoffcox/sterling-svelte",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"author": "Geoff Cox",
|
|
5
5
|
"description": "A modern, accessible, and lightweight component library for Svelte.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,15 +51,18 @@
|
|
|
51
51
|
},
|
|
52
52
|
"exports": {
|
|
53
53
|
"./package.json": "./package.json",
|
|
54
|
+
"./Button.constants": "./Button.constants.js",
|
|
54
55
|
"./Button.svelte": "./Button.svelte",
|
|
55
56
|
"./Button.types": "./Button.types.js",
|
|
56
57
|
"./Checkbox.svelte": "./Checkbox.svelte",
|
|
57
58
|
"./Dialog.svelte": "./Dialog.svelte",
|
|
58
59
|
"./Dropdown.svelte": "./Dropdown.svelte",
|
|
60
|
+
"./Field.constants": "./Field.constants.js",
|
|
59
61
|
"./Field.svelte": "./Field.svelte",
|
|
60
62
|
"./Field.types": "./Field.types.js",
|
|
61
63
|
"./Input.svelte": "./Input.svelte",
|
|
62
64
|
"./Label.svelte": "./Label.svelte",
|
|
65
|
+
"./Link.constants": "./Link.constants.js",
|
|
63
66
|
"./Link.svelte": "./Link.svelte",
|
|
64
67
|
"./Link.types": "./Link.types.js",
|
|
65
68
|
"./List.constants": "./List.constants.js",
|
|
@@ -67,14 +70,17 @@
|
|
|
67
70
|
"./List.types": "./List.types.js",
|
|
68
71
|
"./ListItem.svelte": "./ListItem.svelte",
|
|
69
72
|
"./Menu.svelte": "./Menu.svelte",
|
|
73
|
+
"./MenuBar.constants": "./MenuBar.constants.js",
|
|
70
74
|
"./MenuBar.svelte": "./MenuBar.svelte",
|
|
75
|
+
"./MenuBar.types": "./MenuBar.types.js",
|
|
71
76
|
"./MenuButton.svelte": "./MenuButton.svelte",
|
|
77
|
+
"./MenuItem.constants": "./MenuItem.constants.js",
|
|
72
78
|
"./MenuItem.svelte": "./MenuItem.svelte",
|
|
79
|
+
"./MenuItem.types": "./MenuItem.types.js",
|
|
80
|
+
"./MenuItem.utils": "./MenuItem.utils.js",
|
|
73
81
|
"./MenuItemDisplay.svelte": "./MenuItemDisplay.svelte",
|
|
74
82
|
"./MenuSeparator.svelte": "./MenuSeparator.svelte",
|
|
75
|
-
"./
|
|
76
|
-
"./Menus.types": "./Menus.types.js",
|
|
77
|
-
"./Menus.utils": "./Menus.utils.js",
|
|
83
|
+
"./Progress.constants": "./Progress.constants.js",
|
|
78
84
|
"./Progress.svelte": "./Progress.svelte",
|
|
79
85
|
"./Progress.types": "./Progress.types.js",
|
|
80
86
|
"./Radio.svelte": "./Radio.svelte",
|
|
@@ -85,8 +91,10 @@
|
|
|
85
91
|
"./TabList.constants": "./TabList.constants.js",
|
|
86
92
|
"./TabList.svelte": "./TabList.svelte",
|
|
87
93
|
"./TabList.types": "./TabList.types.js",
|
|
94
|
+
"./TextArea.constants": "./TextArea.constants.js",
|
|
88
95
|
"./TextArea.svelte": "./TextArea.svelte",
|
|
89
96
|
"./TextArea.types": "./TextArea.types.js",
|
|
97
|
+
"./Tooltip.constants": "./Tooltip.constants.js",
|
|
90
98
|
"./Tooltip.svelte": "./Tooltip.svelte",
|
|
91
99
|
"./Tooltip.types": "./Tooltip.types.js",
|
|
92
100
|
"./Tree.constants": "./Tree.constants.js",
|
|
@@ -98,6 +106,8 @@
|
|
|
98
106
|
"./actions/clickOutside": "./actions/clickOutside.js",
|
|
99
107
|
"./actions/forwardEvents": "./actions/forwardEvents.js",
|
|
100
108
|
"./actions/portal": "./actions/portal.js",
|
|
109
|
+
"./floating-ui.constants": "./floating-ui.constants.js",
|
|
110
|
+
"./floating-ui.types": "./floating-ui.types.js",
|
|
101
111
|
".": "./index.js",
|
|
102
112
|
"./theme/applyDarkTheme": "./theme/applyDarkTheme.js",
|
|
103
113
|
"./theme/applyLightTheme": "./theme/applyLightTheme.js",
|
package/Menus.constants.d.ts
DELETED
package/Menus.constants.js
DELETED
|
File without changes
|
|
File without changes
|