@xy-planning-network/trees 0.9.9 → 0.10.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/README.md +5 -13
- package/config/tailwind.config.js +8 -4
- package/config/theme/colors.ts +10 -1
- package/config/theme/index.ts +4 -1
- package/config/theme/layout.ts +11 -0
- package/config/theme/typography.ts +25 -0
- package/dist/trees.es.js +2338 -2164
- package/dist/trees.umd.js +8 -8
- package/package.json +5 -3
- package/src/index.css +106 -11
- package/src/lib-components/forms/FieldsetLegend.vue +1 -1
- package/src/lib-components/forms/InputHelp.vue +1 -1
- package/src/lib-components/forms/MultiCheckboxes.vue +11 -6
- package/src/lib-components/forms/Radio.vue +11 -6
- package/src/lib-components/forms/RadioCards.vue +6 -6
- package/src/lib-components/forms/YesOrNoRadio.vue +9 -4
- package/src/lib-components/indicators/InlineAlert.vue +3 -3
- package/src/lib-components/indicators/ProgressCircles.vue +87 -0
- package/src/lib-components/indicators/ProgressCirclesLabeled.vue +104 -0
- package/src/lib-components/layout/SidebarLayout.vue +61 -53
- package/src/lib-components/layout/StackedLayout.vue +1 -1
- package/src/lib-components/lists/Cards.vue +1 -1
- package/src/lib-components/navigation/Steps.vue +1 -1
- package/src/lib-components/overlays/ContentModal.vue +1 -1
- package/src/lib-components/overlays/Modal.vue +5 -5
- package/src/lib-components/overlays/Popover/PopoverContent.vue +1 -1
- package/src/lib-components/overlays/Tooltip.vue +2 -2
- package/types/components.d.ts +1 -1
- package/types/lib-components/index.d.ts +5 -1
- package/types/lib-components/indicators/ProgressCircles.vue.d.ts +31 -0
- package/types/lib-components/indicators/ProgressCirclesLabeled.vue.d.ts +31 -0
- package/types/lib-components/layout/SidebarLayout.vue.d.ts +2 -0
- package/config/theme/fontFamily.ts +0 -5
|
@@ -35,7 +35,7 @@ const isActive = (url: string): boolean => {
|
|
|
35
35
|
}
|
|
36
36
|
</script>
|
|
37
37
|
<template>
|
|
38
|
-
<div class="h-screen flex overflow-hidden bg-gray-
|
|
38
|
+
<div class="h-screen flex overflow-hidden bg-gray-50">
|
|
39
39
|
<TransitionRoot as="template" :show="sidebarOpen">
|
|
40
40
|
<Dialog
|
|
41
41
|
as="div"
|
|
@@ -90,32 +90,36 @@ const isActive = (url: string): boolean => {
|
|
|
90
90
|
<img class="w-auto h-12" :src="iconUrl" alt="Logo" />
|
|
91
91
|
</div>
|
|
92
92
|
<div class="mt-5 flex flex-col flex-1 h-0 overflow-y-auto">
|
|
93
|
-
<
|
|
94
|
-
<
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
93
|
+
<div class="flex-1 px-2">
|
|
94
|
+
<slot name="sidebar-nav">
|
|
95
|
+
<nav class="space-y-1">
|
|
96
|
+
<a
|
|
97
|
+
v-for="item in navigation"
|
|
98
|
+
:key="item.name"
|
|
99
|
+
:href="item.url"
|
|
100
|
+
:class="[
|
|
101
|
+
isActive(item.url)
|
|
102
|
+
? 'bg-gray-100 text-gray-900'
|
|
103
|
+
: 'text-gray-700 hover:bg-gray-50 hover:text-gray-900',
|
|
104
|
+
'group flex items-center px-2 py-2 text-base font-semibold rounded-md',
|
|
105
|
+
]"
|
|
106
|
+
:target="item.openInTab ? '_blank' : '_self'"
|
|
107
|
+
>
|
|
108
|
+
<component
|
|
109
|
+
:is="item.icon"
|
|
110
|
+
:class="[
|
|
111
|
+
isActive(item.url)
|
|
112
|
+
? 'text-gray-600'
|
|
113
|
+
: 'text-gray-500 group-hover:text-gray-600',
|
|
114
|
+
'mr-4 h-6 w-6',
|
|
115
|
+
]"
|
|
116
|
+
aria-hidden="true"
|
|
117
|
+
/>
|
|
118
|
+
{{ item.name }}
|
|
119
|
+
</a>
|
|
120
|
+
</nav>
|
|
121
|
+
</slot>
|
|
122
|
+
</div>
|
|
119
123
|
<div v-if="$slots['sidebar-bottom']" class="mt-auto">
|
|
120
124
|
<div class="mt-6 px-2">
|
|
121
125
|
<slot name="sidebar-bottom" />
|
|
@@ -141,32 +145,36 @@ const isActive = (url: string): boolean => {
|
|
|
141
145
|
<img class="w-auto h-12" :src="iconUrl" alt="Logo" />
|
|
142
146
|
</div>
|
|
143
147
|
<div class="mt-5 grow flex flex-col">
|
|
144
|
-
<
|
|
145
|
-
<
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
148
|
+
<div class="flex-1 px-2 bg-white">
|
|
149
|
+
<slot name="sidebar-nav">
|
|
150
|
+
<nav class="space-y-1">
|
|
151
|
+
<a
|
|
152
|
+
v-for="item in navigation"
|
|
153
|
+
:key="item.name"
|
|
154
|
+
:href="item.url"
|
|
155
|
+
:class="[
|
|
156
|
+
isActive(item.url)
|
|
157
|
+
? 'bg-gray-100 text-gray-900'
|
|
158
|
+
: 'text-gray-800 hover:bg-gray-100 hover:text-gray-900',
|
|
159
|
+
'group flex items-center px-2 py-2 text-sm font-semibold rounded-md',
|
|
160
|
+
]"
|
|
161
|
+
:target="item.openInTab ? '_blank' : '_self'"
|
|
162
|
+
>
|
|
163
|
+
<component
|
|
164
|
+
:is="item.icon"
|
|
165
|
+
:class="[
|
|
166
|
+
isActive(item.url)
|
|
167
|
+
? 'text-gray-600'
|
|
168
|
+
: 'text-gray-400 group-hover:text-gray-600',
|
|
169
|
+
'mr-3 h-6 w-6',
|
|
170
|
+
]"
|
|
171
|
+
aria-hidden="true"
|
|
172
|
+
/>
|
|
173
|
+
{{ item.name }}
|
|
174
|
+
</a>
|
|
175
|
+
</nav>
|
|
176
|
+
</slot>
|
|
177
|
+
</div>
|
|
170
178
|
|
|
171
179
|
<div v-if="$slots['sidebar-bottom']" class="mt-atuo">
|
|
172
180
|
<div class="mt-6 px-2">
|
|
@@ -31,7 +31,7 @@ const isActive = (url: string): boolean => {
|
|
|
31
31
|
}
|
|
32
32
|
</script>
|
|
33
33
|
<template>
|
|
34
|
-
<div class="min-h-screen bg-gray-
|
|
34
|
+
<div class="min-h-screen bg-gray-50">
|
|
35
35
|
<Disclosure v-slot="{ open }" as="nav" class="bg-white shadow-sm">
|
|
36
36
|
<div class="mx-auto px-4 sm:px-6 lg:px-8">
|
|
37
37
|
<div class="flex justify-between h-16">
|
|
@@ -67,7 +67,7 @@ const updateModelValue = (value: boolean) => {
|
|
|
67
67
|
leave-to="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
|
68
68
|
>
|
|
69
69
|
<div
|
|
70
|
-
class="inline-block align-bottom bg-white rounded-
|
|
70
|
+
class="inline-block align-bottom bg-white rounded-xy px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-md sm:w-full sm:p-8 sm:rounded-xy-lg"
|
|
71
71
|
>
|
|
72
72
|
<div>
|
|
73
73
|
<slot name="icon"></slot>
|
|
@@ -81,10 +81,10 @@ const updateModelValue = (value: boolean) => {
|
|
|
81
81
|
leave-to="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
|
82
82
|
>
|
|
83
83
|
<div
|
|
84
|
-
class="inline-block align-bottom bg-white rounded-
|
|
84
|
+
class="inline-block align-bottom bg-white rounded-xy text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:rounded-xy-lg w-full"
|
|
85
85
|
:class="wide ? 'sm:max-w-6xl' : 'sm:max-w-2xl'"
|
|
86
86
|
>
|
|
87
|
-
<div class="block absolute top-0 right-0 pt-4 pr-4">
|
|
87
|
+
<div class="block absolute top-0 right-0 pt-4 pr-4 sm:pt-6 sm:pr-8">
|
|
88
88
|
<button
|
|
89
89
|
type="button"
|
|
90
90
|
class="bg-white rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
|
|
@@ -94,7 +94,7 @@ const updateModelValue = (value: boolean) => {
|
|
|
94
94
|
<XIcon class="h-6 w-6" aria-hidden="true" />
|
|
95
95
|
</button>
|
|
96
96
|
</div>
|
|
97
|
-
<div class="bg-white px-4 pt-5 pb-4 sm:p-
|
|
97
|
+
<div class="bg-white px-4 pt-5 pb-4 sm:p-8 sm:pb-6">
|
|
98
98
|
<div class="mt-3 sm:mt-0 sm:text-left">
|
|
99
99
|
<DialogTitle
|
|
100
100
|
as="h3"
|
|
@@ -108,7 +108,7 @@ const updateModelValue = (value: boolean) => {
|
|
|
108
108
|
</div>
|
|
109
109
|
<div
|
|
110
110
|
v-if="submitText"
|
|
111
|
-
class="bg-gray-50 px-4 py-3 sm:px-
|
|
111
|
+
class="bg-gray-50 px-4 py-3 sm:py-4 sm:px-8 sm:flex sm:flex-row-reverse"
|
|
112
112
|
>
|
|
113
113
|
<button
|
|
114
114
|
type="button"
|
|
@@ -121,7 +121,7 @@ const updateModelValue = (value: boolean) => {
|
|
|
121
121
|
<button
|
|
122
122
|
ref="cancelButtonRef"
|
|
123
123
|
type="button"
|
|
124
|
-
class="xy-btn-
|
|
124
|
+
class="xy-btn-neutral mt-3 w-full sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
|
|
125
125
|
@click="updateModelValue(false)"
|
|
126
126
|
>
|
|
127
127
|
Cancel
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!--styling wrapper - top level element will merge attrs for class overrides -->
|
|
3
3
|
<div
|
|
4
|
-
class="w-full max-w-xs bg-white rounded-
|
|
4
|
+
class="w-full max-w-xs bg-white rounded-xy p-2 border border-gray-100 shadow-md"
|
|
5
5
|
>
|
|
6
6
|
<slot></slot>
|
|
7
7
|
</div>
|
|
@@ -36,7 +36,7 @@ const hoverPopover = (e: MouseEvent, open: boolean): void => {
|
|
|
36
36
|
|
|
37
37
|
<template>
|
|
38
38
|
<Popover :position="position" :as="as">
|
|
39
|
-
<template #button="{ open, close }: { open: boolean
|
|
39
|
+
<template #button="{ open, close }: { open: boolean; close: () => void }">
|
|
40
40
|
<div
|
|
41
41
|
class="leading-none relative w-4 h-4"
|
|
42
42
|
@mouseover="hoverPopover($event, open)"
|
|
@@ -51,7 +51,7 @@ const hoverPopover = (e: MouseEvent, open: boolean): void => {
|
|
|
51
51
|
</template>
|
|
52
52
|
<template #default="{ close }: { close: () => void }">
|
|
53
53
|
<div
|
|
54
|
-
class="sm:min-w-max bg-white rounded-
|
|
54
|
+
class="sm:min-w-max bg-white rounded-xy px-3.5 py-2.5 border border-gray-100 drop-shadow-md text-xs text-gray-900 leading-snug font-medium"
|
|
55
55
|
@mouseover.prevent="popoverHover = true"
|
|
56
56
|
@mouseleave.prevent="closePopover(close)"
|
|
57
57
|
>
|
package/types/components.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { TreesComponents } from "./lib-components"
|
|
|
6
6
|
* import GlobalComponents from "@xy-planning-network/trees/types/components"
|
|
7
7
|
* in the project.
|
|
8
8
|
*/
|
|
9
|
-
declare module "
|
|
9
|
+
declare module "vue" {
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
11
11
|
interface GlobalComponents extends TreesComponents {}
|
|
12
12
|
}
|
|
@@ -22,6 +22,8 @@ import { default as DynamicTable } from "./lists/DynamicTable.vue";
|
|
|
22
22
|
import { default as Tabs } from "./navigation/Tabs.vue";
|
|
23
23
|
import { default as Toggle } from "./forms/Toggle.vue";
|
|
24
24
|
import { default as XYSpinner } from "./indicators/XYSpinner.vue";
|
|
25
|
+
import { default as ProgressCircles } from "./indicators/ProgressCircles.vue";
|
|
26
|
+
import { default as ProgressCirclesLabeled } from "./indicators/ProgressCirclesLabeled.vue";
|
|
25
27
|
import { default as BaseInput } from "./forms/BaseInput.vue";
|
|
26
28
|
import { default as Checkbox } from "./forms/Checkbox.vue";
|
|
27
29
|
import { default as DateRangePicker } from "./forms/DateRangePicker.vue";
|
|
@@ -37,7 +39,7 @@ import { default as Select } from "./forms/Select.vue";
|
|
|
37
39
|
import { default as TextArea } from "./forms/TextArea.vue";
|
|
38
40
|
import { default as YesOrNoRadio } from "./forms/YesOrNoRadio.vue";
|
|
39
41
|
export { ActionsDropdown, Cards, ContentModal, DateFilter, DetailList, DownloadCell, Flash, InlineAlert, Modal, SidebarLayout, Slideover, StackedLayout, Popover, PopoverContent, PopoverPosition, // Type export
|
|
40
|
-
Paginator, Spinner, DataTable, Steps, DynamicTable, Tabs, Toggle, Tooltip, BaseInput, Checkbox, DateRangePicker, DateTime, InputError, InputHelp, InputLabel, FieldsetLegend, MultiCheckboxes, Radio, RadioCards, Select, TextArea, YesOrNoRadio, XYSpinner, };
|
|
42
|
+
Paginator, Spinner, DataTable, Steps, DynamicTable, Tabs, Toggle, Tooltip, BaseInput, Checkbox, DateRangePicker, DateTime, InputError, InputHelp, InputLabel, FieldsetLegend, MultiCheckboxes, Radio, RadioCards, Select, TextArea, YesOrNoRadio, XYSpinner, ProgressCircles, ProgressCirclesLabeled, };
|
|
41
43
|
/**
|
|
42
44
|
* declare global component types for App.use(Trees)
|
|
43
45
|
*/
|
|
@@ -78,4 +80,6 @@ export interface TreesComponents {
|
|
|
78
80
|
TextArea: typeof TextArea;
|
|
79
81
|
YesOrNoRadio: typeof YesOrNoRadio;
|
|
80
82
|
XYSpinner: typeof XYSpinner;
|
|
83
|
+
ProgressCircles: typeof ProgressCircles;
|
|
84
|
+
ProgressCirclesLabeled: typeof ProgressCirclesLabeled;
|
|
81
85
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
interface Step {
|
|
2
|
+
name: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
6
|
+
/**
|
|
7
|
+
* current sets the "current" step using an index of the steps prop
|
|
8
|
+
* to show all steps in an "incomplete" state set step to -1
|
|
9
|
+
* to show all steps in an "complete" state set step to a value >= steps.length
|
|
10
|
+
*/
|
|
11
|
+
current: number;
|
|
12
|
+
steps: Step[];
|
|
13
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
14
|
+
/**
|
|
15
|
+
* current sets the "current" step using an index of the steps prop
|
|
16
|
+
* to show all steps in an "incomplete" state set step to -1
|
|
17
|
+
* to show all steps in an "complete" state set step to a value >= steps.length
|
|
18
|
+
*/
|
|
19
|
+
current: number;
|
|
20
|
+
steps: Step[];
|
|
21
|
+
}>>>, {}, {}>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
24
|
+
type __VLS_TypePropsToOption<T> = {
|
|
25
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
26
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
27
|
+
} : {
|
|
28
|
+
type: import('vue').PropType<T[K]>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
interface Step {
|
|
2
|
+
name: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
6
|
+
/**
|
|
7
|
+
* current sets the "current" step using an index of the steps prop
|
|
8
|
+
* to show all steps in an "incomplete" state set step to -1
|
|
9
|
+
* to show all steps in an "complete" state set step to a value >= steps.length
|
|
10
|
+
*/
|
|
11
|
+
current: number;
|
|
12
|
+
steps: Step[];
|
|
13
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
14
|
+
/**
|
|
15
|
+
* current sets the "current" step using an index of the steps prop
|
|
16
|
+
* to show all steps in an "incomplete" state set step to -1
|
|
17
|
+
* to show all steps in an "complete" state set step to a value >= steps.length
|
|
18
|
+
*/
|
|
19
|
+
current: number;
|
|
20
|
+
steps: Step[];
|
|
21
|
+
}>>>, {}, {}>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
24
|
+
type __VLS_TypePropsToOption<T> = {
|
|
25
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
26
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
27
|
+
} : {
|
|
28
|
+
type: import('vue').PropType<T[K]>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -16,6 +16,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
16
16
|
}>>>, {
|
|
17
17
|
activeUrl: string;
|
|
18
18
|
}, {}>, {
|
|
19
|
+
"sidebar-nav"?(_: {}): any;
|
|
20
|
+
"sidebar-nav"?(_: {}): any;
|
|
19
21
|
"sidebar-bottom"?(_: {}): any;
|
|
20
22
|
"sidebar-bottom"?(_: {}): any;
|
|
21
23
|
header?(_: {}): any;
|