srcdev-nuxt-components 4.0.6 → 5.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/README.md +171 -2
- package/assets/styles/extends-layer/srcdev-components/display-prompt-core/index.css +70 -0
- package/assets/styles/extends-layer/srcdev-components/index.css +2 -0
- package/assets/styles/extends-layer/srcdev-components/themes/_error.css +15 -0
- package/assets/styles/extends-layer/srcdev-components/themes/_info.css +15 -0
- package/assets/styles/extends-layer/srcdev-components/themes/_success.css +15 -0
- package/assets/styles/extends-layer/srcdev-components/themes/_warning.css +15 -0
- package/assets/styles/main.css +2 -5
- package/assets/styles/{forms/variables/_theme.css → setup/_head.css} +0 -6
- package/assets/styles/{a11y → setup/a11y}/_variables.css +2 -0
- package/assets/styles/setup/a11y/index.css +2 -0
- package/assets/styles/setup/index.css +5 -0
- package/assets/styles/setup/typography/index.css +2 -0
- package/assets/styles/setup/typography/utility-classes/_generic-font-classes.css +192 -0
- package/assets/styles/setup/typography/utility-classes/_generic-font-variation-settings.css +29 -0
- package/assets/styles/setup/typography/utility-classes/_generic-font-weights.css +41 -0
- package/assets/styles/setup/typography/utility-classes/index.css +3 -0
- package/assets/styles/setup/typography/vars/index.css +1 -0
- package/assets/styles/setup/utility-classes/_page.css +50 -0
- package/assets/styles/setup/utility-classes/index.css +3 -0
- package/assets/styles/setup/variables/index.css +1 -0
- package/components/accordian/AccordianCore.vue +46 -0
- package/components/{presentation/container-glow → container-glow}/ContainerGlowCore.vue +80 -80
- package/components/display-details/DisplayDetailsCore.vue +49 -60
- package/components/{functional/display-dialog → display-dialog}/DisplayDialogCore.vue +49 -38
- package/components/display-prompt/DisplayPromptCore.vue +187 -0
- package/components/expanding-panel/ExpandingPanel.vue +124 -0
- package/components/{presentation/layout-row → layout-row}/LayoutRow.vue +12 -4
- package/components/responsive-header/NavigationItems.vue +23 -18
- package/components/responsive-header/ResponsiveHeader.vue +376 -276
- package/components/skip-links/SkipLinks.vue +85 -0
- package/components/{presentation/tabs → tabs}/TabsCore.vue +27 -58
- package/composables/useDialogControls.ts +22 -1
- package/package.json +1 -1
- package/assets/styles/a11y/index.css +0 -2
- package/assets/styles/forms/index.css +0 -2
- package/assets/styles/forms/themes/_error.css +0 -77
- package/assets/styles/forms/themes/_ghost.css +0 -77
- package/assets/styles/forms/themes/_input-action.css +0 -20
- package/assets/styles/forms/themes/_primary.css +0 -82
- package/assets/styles/forms/themes/_secondary.css +0 -77
- package/assets/styles/forms/themes/_success.css +0 -77
- package/assets/styles/forms/themes/_tertiary.css +0 -77
- package/assets/styles/forms/themes/_warning.css +0 -77
- package/assets/styles/forms/themes/index.css +0 -8
- package/assets/styles/forms/variables/_sizes.css +0 -82
- package/assets/styles/forms/variables/index.css +0 -2
- package/assets/styles/typography/index.css +0 -2
- package/assets/styles/typography/utils/_font-classes.css +0 -160
- package/assets/styles/typography/utils/_weights.css +0 -69
- package/assets/styles/typography/utils/index.css +0 -2
- package/assets/styles/typography/variables/_colors.css +0 -14
- package/assets/styles/typography/variables/index.css +0 -2
- package/assets/styles/utils/_animations.css +0 -42
- package/assets/styles/utils/_canvasWidths.css +0 -18
- package/assets/styles/utils/_display.css +0 -7
- package/assets/styles/utils/_page.css +0 -27
- package/assets/styles/utils/_placement.css +0 -73
- package/assets/styles/utils/index.css +0 -7
- package/assets/styles/variables/components/_accordian.css +0 -7
- package/assets/styles/variables/components/_container-glow-core.css +0 -16
- package/assets/styles/variables/components/_display-dialog-core.css +0 -35
- package/assets/styles/variables/components/_tabs.css +0 -18
- package/assets/styles/variables/components/display-prompt-core/_scaffolding.css +0 -57
- package/assets/styles/variables/components/display-prompt-core/index.css +0 -2
- package/assets/styles/variables/components/display-prompt-core/themes/_error.css +0 -39
- package/assets/styles/variables/components/display-prompt-core/themes/_info.css +0 -39
- package/assets/styles/variables/components/display-prompt-core/themes/_success.css +0 -39
- package/assets/styles/variables/components/display-prompt-core/themes/_warning.css +0 -39
- package/assets/styles/variables/components/index.css +0 -5
- package/assets/styles/variables/index.css +0 -2
- package/components/functional/accordian/AccordianCore.vue +0 -138
- package/components/presentation/display-prompt/DisplayPromptCore.vue +0 -150
- /package/assets/styles/{variables/components/display-prompt-core → extends-layer/srcdev-components}/themes/index.css +0 -0
- /package/assets/styles/{a11y → setup/a11y}/_utils.css +0 -0
- /package/assets/styles/{typography/variables/_reponsive-font-size.css → setup/typography/vars/_reponsive-font-sizes.css} +0 -0
- /package/assets/styles/{utils → setup/utility-classes}/_margin-helpers.css +0 -0
- /package/assets/styles/{utils → setup/utility-classes}/_padding-helpers.css +0 -0
- /package/assets/styles/{variables → setup/variables}/colors/_blue.css +0 -0
- /package/assets/styles/{variables → setup/variables}/colors/_gray.css +0 -0
- /package/assets/styles/{variables → setup/variables}/colors/_green.css +0 -0
- /package/assets/styles/{variables → setup/variables}/colors/_orange.css +0 -0
- /package/assets/styles/{variables → setup/variables}/colors/_red.css +0 -0
- /package/assets/styles/{variables → setup/variables}/colors/_yellow.css +0 -0
- /package/assets/styles/{variables/colors/colors.css → setup/variables/colors/index.css} +0 -0
- /package/components/{functional/display-dialog → display-dialog}/variants/DisplayDialogConfirm.vue +0 -0
- /package/components/{functional/display-dialog → display-dialog}/variants/DisplayDialogScrollableContent.vue +0 -0
- /package/components/{presentation/display-grid → display-grid}/DisplayGridCore.vue +0 -0
- /package/components/{presentation/display-prompt → display-prompt}/variants/DisplayPromptError.vue +0 -0
- /package/components/{presentation/layout-grids → layout-grids}/LayoutGridA.vue +0 -0
- /package/components/{presentation/layout-grids → layout-grids}/LayoutGridB.vue +0 -0
- /package/components/{presentation/masonry-grid → masonry-grid}/MasonryGrid.vue +0 -0
- /package/components/{presentation/masonry-grid-sorted → masonry-grid-sorted}/MasonryGridSorted.vue +0 -0
- /package/components/{functional/pop-over → pop-over}/PopOver.vue +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import './colors/';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="display-accordian" :class="[elementClasses]">
|
|
3
|
+
<ExpandingPanel v-for="(item, key) in itemCount" :key="key" :name :animation-duration="300" icon-size="medium" :style-class-passthrough="['accordian-item']">
|
|
4
|
+
<template #summary>
|
|
5
|
+
<slot :name="`accordian-${key}-summary`"></slot>
|
|
6
|
+
</template>
|
|
7
|
+
<template #icon>
|
|
8
|
+
<slot :name="`accordian-${key}-icon`"></slot>
|
|
9
|
+
</template>
|
|
10
|
+
<template #content>
|
|
11
|
+
<slot :name="`accordian-${key}-content`"></slot>
|
|
12
|
+
</template>
|
|
13
|
+
</ExpandingPanel>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
name: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: null,
|
|
22
|
+
},
|
|
23
|
+
itemCount: {
|
|
24
|
+
type: Number as PropType<number>,
|
|
25
|
+
default: 0,
|
|
26
|
+
},
|
|
27
|
+
animationDuration: {
|
|
28
|
+
type: Number,
|
|
29
|
+
default: 400,
|
|
30
|
+
},
|
|
31
|
+
styleClassPassthrough: {
|
|
32
|
+
type: Array as PropType<string[]>,
|
|
33
|
+
default: () => [],
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
38
|
+
const animationDurationStr = computed(() => `${props.animationDuration}ms`);
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<style lang="css">
|
|
42
|
+
.display-accordian {
|
|
43
|
+
max-width: 600px;
|
|
44
|
+
margin: 0 auto;
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="container-glow-wrapper" ref="containerGlowWrapper">
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
</component>
|
|
8
|
-
</template>
|
|
2
|
+
<div class="container-glow-wrapper" :class="elementClasses" ref="containerGlowWrapper">
|
|
3
|
+
<component :is="tag" v-for="(item, key) in itemCount" :key="key" class="container-glow-core" ref="containerGlowItem">
|
|
4
|
+
<div class="glows"></div>
|
|
5
|
+
<slot :name="`container-glow-${key}`"></slot>
|
|
6
|
+
</component>
|
|
9
7
|
</div>
|
|
10
8
|
</template>
|
|
11
9
|
|
|
12
10
|
<script setup lang="ts">
|
|
13
|
-
interface
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
interface Config {
|
|
12
|
+
proximity: number;
|
|
13
|
+
spread: number;
|
|
14
|
+
blur: number;
|
|
15
|
+
gap: number;
|
|
16
|
+
vertical: boolean;
|
|
17
|
+
opacity: number;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
const props = defineProps({
|
|
19
|
-
|
|
20
|
-
type:
|
|
21
|
-
|
|
21
|
+
itemCount: {
|
|
22
|
+
type: Number,
|
|
23
|
+
required: true,
|
|
22
24
|
},
|
|
23
25
|
tag: {
|
|
24
26
|
type: String as PropType<string>,
|
|
@@ -28,6 +30,17 @@ const props = defineProps({
|
|
|
28
30
|
type: Array as PropType<string[]>,
|
|
29
31
|
default: () => [],
|
|
30
32
|
},
|
|
33
|
+
config: {
|
|
34
|
+
type: Object as PropType<Config>,
|
|
35
|
+
default: () => ({
|
|
36
|
+
proximity: 40,
|
|
37
|
+
spread: 80,
|
|
38
|
+
blur: 20,
|
|
39
|
+
gap: 32,
|
|
40
|
+
vertical: false,
|
|
41
|
+
opacity: 0.15,
|
|
42
|
+
}),
|
|
43
|
+
},
|
|
31
44
|
});
|
|
32
45
|
|
|
33
46
|
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
@@ -37,54 +50,43 @@ const controller = new AbortController();
|
|
|
37
50
|
const containerGlowWrapper = ref<HTMLElement>();
|
|
38
51
|
const containerGlowItem = ref<HTMLElement[]>([]);
|
|
39
52
|
|
|
40
|
-
const
|
|
41
|
-
proximity: 40,
|
|
42
|
-
spread: 80,
|
|
43
|
-
blur: 20,
|
|
44
|
-
gap: 32,
|
|
45
|
-
vertical: false,
|
|
46
|
-
opacity: 0,
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const PROXIMITY = 10;
|
|
50
|
-
|
|
51
|
-
const UPDATE = (event: PointerEvent) => {
|
|
53
|
+
const updateStyles = (event: PointerEvent) => {
|
|
52
54
|
// get the angle based on the center point of the card and pointer position
|
|
53
|
-
for (const
|
|
55
|
+
for (const cardElem of containerGlowItem.value) {
|
|
54
56
|
// Check the card against the proximity and then start updating
|
|
55
|
-
const
|
|
57
|
+
const cardBounds = cardElem.getBoundingClientRect();
|
|
56
58
|
// Get distance between pointer and outerbounds of card
|
|
57
59
|
if (
|
|
58
|
-
event?.x >
|
|
59
|
-
event?.x <
|
|
60
|
-
event?.y >
|
|
61
|
-
event?.y <
|
|
60
|
+
event?.x > cardBounds.left - props.config.proximity &&
|
|
61
|
+
event?.x < cardBounds.left + cardBounds.width + props.config.proximity &&
|
|
62
|
+
event?.y > cardBounds.top - props.config.proximity &&
|
|
63
|
+
event?.y < cardBounds.top + cardBounds.height + props.config.proximity
|
|
62
64
|
) {
|
|
63
65
|
// If within proximity set the active opacity
|
|
64
|
-
|
|
66
|
+
cardElem.style.setProperty('--opacity-active', String(1));
|
|
65
67
|
} else {
|
|
66
|
-
|
|
68
|
+
cardElem.style.setProperty('--opacity-active', String(props.config.opacity));
|
|
67
69
|
}
|
|
68
|
-
const
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
const cardCentre = [cardBounds.left + cardBounds.width * 0.5, cardBounds.top + cardBounds.height * 0.5];
|
|
71
|
+
let angle = (Math.atan2(event?.y - cardCentre[1], event?.x - cardCentre[0]) * 180) / Math.PI;
|
|
72
|
+
angle = angle < 0 ? angle + 360 : angle;
|
|
73
|
+
cardElem.style.setProperty('--start', String(angle + 90));
|
|
72
74
|
}
|
|
73
75
|
};
|
|
74
76
|
|
|
75
|
-
const
|
|
76
|
-
containerGlowWrapper.value?.style.setProperty('--gap', String(
|
|
77
|
-
containerGlowWrapper.value?.style.setProperty('--blur', String(
|
|
78
|
-
containerGlowWrapper.value?.style.setProperty('--spread', String(
|
|
79
|
-
containerGlowWrapper.value?.style.setProperty('--direction',
|
|
77
|
+
const applyStyles = () => {
|
|
78
|
+
containerGlowWrapper.value?.style.setProperty('--gap', String(props.config.gap));
|
|
79
|
+
containerGlowWrapper.value?.style.setProperty('--blur', String(props.config.blur));
|
|
80
|
+
containerGlowWrapper.value?.style.setProperty('--spread', String(props.config.spread));
|
|
81
|
+
containerGlowWrapper.value?.style.setProperty('--direction', props.config.vertical ? 'column' : 'row');
|
|
80
82
|
};
|
|
81
83
|
|
|
82
|
-
// document.body.addEventListener('pointermove',
|
|
84
|
+
// document.body.addEventListener('pointermove', updateStyles);
|
|
83
85
|
|
|
84
86
|
onMounted(() => {
|
|
85
|
-
|
|
87
|
+
applyStyles();
|
|
86
88
|
if (containerGlowWrapper.value) {
|
|
87
|
-
document.body.addEventListener('pointermove',
|
|
89
|
+
document.body.addEventListener('pointermove', updateStyles, {
|
|
88
90
|
signal: controller.signal,
|
|
89
91
|
});
|
|
90
92
|
}
|
|
@@ -97,21 +99,6 @@ onBeforeUnmount(() => {
|
|
|
97
99
|
|
|
98
100
|
<style lang="css">
|
|
99
101
|
.container-glow-wrapper {
|
|
100
|
-
--container-bg-colour: light-dark(hsl(250, 18%, 93%), hsl(246 44% 7%));
|
|
101
|
-
--container-border-colour: hsl(280 10% 50% / 1);
|
|
102
|
-
--card: light-dark(white, hsl(246 44% 7%));
|
|
103
|
-
--container-border-width: 2px;
|
|
104
|
-
--container-border-radius: 12px;
|
|
105
|
-
--gradient: conic-gradient(
|
|
106
|
-
from 180deg at 50% 70%,
|
|
107
|
-
hsla(0, 0%, 98%, 1) 0deg,
|
|
108
|
-
#eec32d 72.0000010728836deg,
|
|
109
|
-
#ec4b4b 144.0000021457672deg,
|
|
110
|
-
#709ab9 216.00000858306885deg,
|
|
111
|
-
#4dffbf 288.0000042915344deg,
|
|
112
|
-
hsla(0, 0%, 98%, 1) 1turn
|
|
113
|
-
);
|
|
114
|
-
|
|
115
102
|
@property --start {
|
|
116
103
|
syntax: '<number>';
|
|
117
104
|
inherits: true;
|
|
@@ -128,55 +115,68 @@ onBeforeUnmount(() => {
|
|
|
128
115
|
box-sizing: border-box;
|
|
129
116
|
}
|
|
130
117
|
|
|
131
|
-
--
|
|
118
|
+
--gradient: conic-gradient(
|
|
119
|
+
from 180deg at 50% 70%,
|
|
120
|
+
hsla(0, 0%, 98%, 1) 0deg,
|
|
121
|
+
#eec32d 72.0000010728836deg,
|
|
122
|
+
#ec4b4b 144.0000021457672deg,
|
|
123
|
+
#709ab9 216.00000858306885deg,
|
|
124
|
+
#4dffbf 288.0000042915344deg,
|
|
125
|
+
hsla(0, 0%, 98%, 1) 1turn
|
|
126
|
+
);
|
|
127
|
+
--opacity-active: 0.15;
|
|
132
128
|
--start: 0;
|
|
129
|
+
|
|
130
|
+
position: relative;
|
|
131
|
+
|
|
133
132
|
height: 100%;
|
|
134
|
-
background:
|
|
133
|
+
background: light-dark(white, hsl(246 44% 7%));
|
|
135
134
|
padding: 2rem;
|
|
136
135
|
aspect-ratio: 330 / 400;
|
|
137
|
-
border-radius:
|
|
136
|
+
border-radius: 12px;
|
|
138
137
|
min-width: 280px;
|
|
139
138
|
max-width: 280px;
|
|
140
139
|
display: flex;
|
|
141
140
|
flex-direction: column;
|
|
142
141
|
gap: 0.25rem;
|
|
143
|
-
position: relative;
|
|
144
142
|
|
|
145
143
|
&:is(:hover, :focus-visible) {
|
|
146
144
|
z-index: 2;
|
|
147
145
|
}
|
|
148
146
|
|
|
149
|
-
&::before
|
|
147
|
+
&::before,
|
|
148
|
+
&::after {
|
|
149
|
+
content: '';
|
|
150
150
|
position: absolute;
|
|
151
151
|
inset: 0;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&::before {
|
|
155
155
|
pointer-events: none;
|
|
156
|
-
|
|
156
|
+
|
|
157
|
+
border: 2px solid transparent;
|
|
158
|
+
border-radius: 12px;
|
|
159
|
+
background: hsl(280 10% 50% / 1);
|
|
157
160
|
background-attachment: fixed;
|
|
158
|
-
border-radius:
|
|
161
|
+
border-radius: 12px;
|
|
159
162
|
mask: linear-gradient(#0000, #0000),
|
|
160
163
|
conic-gradient(from calc(((var(--start) + (var(--spread) * 0.25)) - (var(--spread) * 1.5)) * 1deg), hsl(0 0% 100% / 0.15) 0deg, white, hsl(0 0% 100% / 0.15) calc(var(--spread) * 2.5deg));
|
|
161
164
|
mask-clip: padding-box, border-box;
|
|
162
165
|
mask-composite: intersect;
|
|
163
|
-
opacity: var(--active);
|
|
166
|
+
opacity: var(--opacity-active);
|
|
164
167
|
transition: opacity 1s;
|
|
165
168
|
}
|
|
166
169
|
|
|
167
170
|
&::after {
|
|
168
|
-
/* --container-bg-colour-size: 100%; */
|
|
169
|
-
content: '';
|
|
170
171
|
pointer-events: none;
|
|
171
|
-
|
|
172
|
+
|
|
172
173
|
background: var(--gradient);
|
|
173
174
|
background-attachment: fixed;
|
|
174
|
-
border-radius:
|
|
175
|
-
opacity: var(--active, 0);
|
|
175
|
+
border-radius: 12px;
|
|
176
|
+
opacity: var(--opacity-active, 0);
|
|
176
177
|
transition: opacity 1s;
|
|
177
178
|
--alpha: 0;
|
|
178
|
-
|
|
179
|
-
border: var(--container-border-width) solid transparent;
|
|
179
|
+
border: 2px solid transparent;
|
|
180
180
|
mask: linear-gradient(#0000, #0000), conic-gradient(from calc(((var(--start) + (var(--spread) * 0.25)) - (var(--spread) * 0.5)) * 1deg), #0000 0deg, #fff, #0000 calc(var(--spread) * 0.5deg));
|
|
181
181
|
filter: brightness(1.5);
|
|
182
182
|
mask-clip: padding-box, border-box;
|
|
@@ -198,11 +198,11 @@ onBeforeUnmount(() => {
|
|
|
198
198
|
position: absolute;
|
|
199
199
|
inset: -5px;
|
|
200
200
|
border: 10px solid transparent;
|
|
201
|
-
border-radius:
|
|
201
|
+
border-radius: 12px;
|
|
202
202
|
mask: linear-gradient(#0000, #0000), conic-gradient(from calc((var(--start) - (var(--spread) * 0.5)) * 1deg), #000 0deg, #fff, #0000 calc(var(--spread) * 1deg));
|
|
203
203
|
mask-composite: intersect;
|
|
204
204
|
mask-clip: padding-box, border-box;
|
|
205
|
-
opacity: var(--active);
|
|
205
|
+
opacity: var(--opacity-active);
|
|
206
206
|
transition: opacity 1s;
|
|
207
207
|
}
|
|
208
208
|
}
|
|
@@ -18,7 +18,13 @@
|
|
|
18
18
|
// Create a global store to track open details elements by name
|
|
19
19
|
const openDetailsByName = reactive(new Map<string, HTMLDetailsElement>());
|
|
20
20
|
|
|
21
|
-
export const useDetailsTransition = (
|
|
21
|
+
export const useDetailsTransition = (
|
|
22
|
+
detailsRef: Ref<HTMLDetailsElement | null>,
|
|
23
|
+
summaryRef: Ref<HTMLElement | null>,
|
|
24
|
+
contentRef: Ref<HTMLDivElement | null>,
|
|
25
|
+
name: string,
|
|
26
|
+
animationDuration: number
|
|
27
|
+
) => {
|
|
22
28
|
// State
|
|
23
29
|
const animation = ref<Animation | null>(null);
|
|
24
30
|
const isClosing = ref(false);
|
|
@@ -101,7 +107,7 @@ export const useDetailsTransition = (detailsRef: Ref<HTMLDetailsElement | null>,
|
|
|
101
107
|
},
|
|
102
108
|
{
|
|
103
109
|
duration: animationDuration,
|
|
104
|
-
easing: '
|
|
110
|
+
easing: 'linear',
|
|
105
111
|
}
|
|
106
112
|
);
|
|
107
113
|
|
|
@@ -140,7 +146,7 @@ export const useDetailsTransition = (detailsRef: Ref<HTMLDetailsElement | null>,
|
|
|
140
146
|
},
|
|
141
147
|
{
|
|
142
148
|
duration: animationDuration,
|
|
143
|
-
easing: '
|
|
149
|
+
easing: 'linear',
|
|
144
150
|
}
|
|
145
151
|
);
|
|
146
152
|
|
|
@@ -237,76 +243,59 @@ onMounted(() => {
|
|
|
237
243
|
</script>
|
|
238
244
|
|
|
239
245
|
<style lang="css">
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
246
|
+
.display-details {
|
|
247
|
+
border: none;
|
|
248
|
+
outline: none;
|
|
249
|
+
box-shadow: none;
|
|
250
|
+
border-radius: 0;
|
|
244
251
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
--_display-details-mbe: 1em;
|
|
251
|
-
|
|
252
|
-
--_display-details-summary-gap: 12px;
|
|
253
|
-
--_display-details-summary-flex-direction: row;
|
|
254
|
-
|
|
255
|
-
--_display-details-content-padding: 0;
|
|
256
|
-
|
|
257
|
-
&.medium {
|
|
258
|
-
--_display-details-icon-size: 1.8rem;
|
|
259
|
-
}
|
|
260
|
-
&.large {
|
|
261
|
-
--_display-details-icon-size: 2.4rem;
|
|
252
|
+
&[open] {
|
|
253
|
+
.display-details-summary {
|
|
254
|
+
.icon {
|
|
255
|
+
transform: scaleY(-1);
|
|
256
|
+
}
|
|
262
257
|
}
|
|
258
|
+
}
|
|
263
259
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
260
|
+
.display-details-summary {
|
|
261
|
+
display: flex;
|
|
262
|
+
align-items: center;
|
|
263
|
+
justify-content: space-between;
|
|
264
|
+
flex-direction: row;
|
|
265
|
+
gap: 0;
|
|
267
266
|
|
|
268
|
-
|
|
269
|
-
outline: var(--_display-details-outline);
|
|
270
|
-
box-shadow: var(--_display-details-box-shadow);
|
|
271
|
-
border-radius: var(--_display-details-border-radius);
|
|
272
|
-
margin-block-end: var(--_display-details-mbe);
|
|
267
|
+
list-style: none;
|
|
273
268
|
|
|
274
|
-
|
|
269
|
+
&::-webkit-details-marker,
|
|
270
|
+
&::marker {
|
|
271
|
+
display: none;
|
|
272
|
+
}
|
|
275
273
|
|
|
276
|
-
|
|
277
|
-
align-items: center;
|
|
278
|
-
justify-content: space-between;
|
|
274
|
+
overflow: clip;
|
|
279
275
|
|
|
280
|
-
|
|
276
|
+
.label {
|
|
277
|
+
display: block;
|
|
278
|
+
flex-grow: 1;
|
|
279
|
+
}
|
|
281
280
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
display: none;
|
|
285
|
-
}
|
|
281
|
+
.icon {
|
|
282
|
+
display: block;
|
|
286
283
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
align-items: center;
|
|
290
|
-
gap: var(--_display-details-summary-gap);
|
|
291
|
-
overflow: clip;
|
|
284
|
+
transform: scaleY(1);
|
|
285
|
+
transition: transform 200ms;
|
|
292
286
|
|
|
293
|
-
.
|
|
294
|
-
|
|
295
|
-
|
|
287
|
+
font-size: 1.2rem;
|
|
288
|
+
&.medium {
|
|
289
|
+
font-size: 1.8rem;
|
|
296
290
|
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
display: block;
|
|
300
|
-
|
|
301
|
-
font-size: var(--_display-details-icon-size);
|
|
302
|
-
transform: var(--_display-details-icon-transform);
|
|
303
|
-
transition: transform 200ms;
|
|
291
|
+
&.large {
|
|
292
|
+
font-size: 2.4rem;
|
|
304
293
|
}
|
|
305
294
|
}
|
|
306
|
-
|
|
307
|
-
.display-details-content {
|
|
308
|
-
padding: var(--_display-details-content-padding);
|
|
309
|
-
}
|
|
310
295
|
}
|
|
311
296
|
|
|
297
|
+
.display-details-content {
|
|
298
|
+
/* Use an inner element for styling */
|
|
299
|
+
}
|
|
300
|
+
}
|
|
312
301
|
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<dialog class="display-dialog-core" :class="[
|
|
2
|
+
<dialog class="display-dialog-core" :class="[elementClasses]" role="dialog" :align-dialog :justify-dialog :open :data-dialog-id="dataDialogId" ref="dialogRef">
|
|
3
3
|
<focus-trap v-model:active="open" :clickOutsideDeactivates="true" @deactivate="closeDialog()">
|
|
4
|
-
<div class="inner">
|
|
4
|
+
<div class="inner" :class="[variant]">
|
|
5
5
|
<div class="header">
|
|
6
6
|
<div v-if="hasDialogTitle" class="col-left">
|
|
7
7
|
<slot name="dialogTitle"></slot>
|
|
@@ -40,15 +40,15 @@ const props = defineProps({
|
|
|
40
40
|
default: 'dialog',
|
|
41
41
|
validator: (val) => ['dialog', 'modal', 'confirm'].includes(val as string),
|
|
42
42
|
},
|
|
43
|
-
|
|
43
|
+
justifyDialog: {
|
|
44
44
|
type: String,
|
|
45
45
|
default: 'center',
|
|
46
|
-
validator: (val) => ['
|
|
46
|
+
validator: (val) => ['start', 'center', 'end'].includes(val as string),
|
|
47
47
|
},
|
|
48
|
-
|
|
48
|
+
alignDialog: {
|
|
49
49
|
type: String,
|
|
50
50
|
default: 'center',
|
|
51
|
-
validator: (val) => ['
|
|
51
|
+
validator: (val) => ['start', 'center', 'end'].includes(val as string),
|
|
52
52
|
},
|
|
53
53
|
lockViewport: {
|
|
54
54
|
type: Boolean,
|
|
@@ -83,8 +83,6 @@ const hasDialogTitle = computed(() => slots.dialogTitle !== undefined);
|
|
|
83
83
|
const hasDialogContent = computed(() => slots.dialogContent !== undefined);
|
|
84
84
|
const hasActionButtons = computed(() => slots.actionButtons !== undefined);
|
|
85
85
|
|
|
86
|
-
const alignDialog = computed(() => `${props.positionY}-${props.positionX}`);
|
|
87
|
-
|
|
88
86
|
onMounted(() => {
|
|
89
87
|
bodyTag.value = document.querySelector('body');
|
|
90
88
|
if (lockViewport.value && bodyTag.value !== null) {
|
|
@@ -95,9 +93,6 @@ onMounted(() => {
|
|
|
95
93
|
|
|
96
94
|
<style lang="css">
|
|
97
95
|
.display-dialog-core {
|
|
98
|
-
--_dialog-inner-height: initial;
|
|
99
|
-
--_dialog-inner-width: 100vw;
|
|
100
|
-
|
|
101
96
|
display: flex;
|
|
102
97
|
position: fixed;
|
|
103
98
|
left: 0;
|
|
@@ -106,7 +101,7 @@ onMounted(() => {
|
|
|
106
101
|
height: 100%;
|
|
107
102
|
backdrop-filter: blur(5px);
|
|
108
103
|
background-color: rgba(0, 0, 0, 0.5);
|
|
109
|
-
z-index:
|
|
104
|
+
z-index: 999999;
|
|
110
105
|
opacity: 0;
|
|
111
106
|
border: none;
|
|
112
107
|
padding: 0;
|
|
@@ -125,54 +120,70 @@ onMounted(() => {
|
|
|
125
120
|
}
|
|
126
121
|
}
|
|
127
122
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
&[align-dialog^='center'] {
|
|
132
|
-
align-items: center;
|
|
123
|
+
/* * Positioning the dialog */
|
|
124
|
+
&[justify-dialog='start'] {
|
|
125
|
+
justify-content: flex-start;
|
|
133
126
|
}
|
|
134
127
|
|
|
135
|
-
|
|
136
|
-
|
|
128
|
+
&[justify-dialog='center'] {
|
|
129
|
+
justify-content: center;
|
|
137
130
|
}
|
|
138
131
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
--_dialog-inner-width: min(75%, 720px);
|
|
132
|
+
&[justify-dialog='end'] {
|
|
133
|
+
justify-content: flex-end;
|
|
142
134
|
}
|
|
143
135
|
|
|
144
|
-
|
|
145
|
-
|
|
136
|
+
&[align-dialog='start'] {
|
|
137
|
+
align-items: flex-start;
|
|
146
138
|
}
|
|
147
139
|
|
|
148
|
-
|
|
149
|
-
|
|
140
|
+
&[align-dialog='center'] {
|
|
141
|
+
align-items: center;
|
|
150
142
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
--_dialog-inner-width: initial;
|
|
143
|
+
&[align-dialog='end'] {
|
|
144
|
+
align-items: flex-end;
|
|
154
145
|
}
|
|
155
146
|
|
|
156
147
|
.inner {
|
|
157
148
|
display: grid;
|
|
158
149
|
grid-template-rows: auto 1fr auto;
|
|
159
150
|
|
|
160
|
-
border-radius:
|
|
161
|
-
border: var(--
|
|
162
|
-
outline: var(--
|
|
151
|
+
border-radius: 8px;
|
|
152
|
+
border: 1px solid light-dark(var(--gray-10), var(--gray-2));
|
|
153
|
+
outline: 1px solid light-dark(var(--gray-12), var(--gray-0));
|
|
163
154
|
|
|
164
155
|
background-color: var(--dialog-inner-background);
|
|
165
|
-
height:
|
|
166
|
-
width:
|
|
167
|
-
|
|
156
|
+
height: initial;
|
|
157
|
+
width: 100vw;
|
|
168
158
|
overflow: hidden;
|
|
169
159
|
|
|
160
|
+
&.confirm {
|
|
161
|
+
width: initial;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&.dialog {
|
|
165
|
+
height: 70dvh;
|
|
166
|
+
width: min(75%, 720px);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&.form {
|
|
170
|
+
width: initial;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&.fullscreen {
|
|
174
|
+
width: initial;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&.modal {
|
|
178
|
+
width: initial;
|
|
179
|
+
}
|
|
180
|
+
|
|
170
181
|
.header {
|
|
171
182
|
display: grid;
|
|
172
183
|
grid-template-columns: auto 1fr auto;
|
|
173
184
|
align-items: center;
|
|
174
185
|
|
|
175
|
-
padding:
|
|
186
|
+
padding: 12px;
|
|
176
187
|
|
|
177
188
|
.col-left {
|
|
178
189
|
/* grid-column: 1; */
|
|
@@ -223,7 +234,7 @@ onMounted(() => {
|
|
|
223
234
|
|
|
224
235
|
.dialog-content {
|
|
225
236
|
overflow: hidden;
|
|
226
|
-
padding:
|
|
237
|
+
padding: 12px;
|
|
227
238
|
|
|
228
239
|
&.allow-content-scroll {
|
|
229
240
|
overflow-y: auto;
|
|
@@ -237,7 +248,7 @@ onMounted(() => {
|
|
|
237
248
|
display: flex;
|
|
238
249
|
gap: 1.2rem;
|
|
239
250
|
justify-content: flex-end;
|
|
240
|
-
padding:
|
|
251
|
+
padding: 12px;
|
|
241
252
|
}
|
|
242
253
|
}
|
|
243
254
|
}
|