srcdev-nuxt-components 1.0.1 → 1.0.3

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.
@@ -22,3 +22,9 @@ a {
22
22
  font-family: var(--font-family);
23
23
  font-size: var(--step-1);
24
24
  }
25
+
26
+ body {
27
+ &.lock {
28
+ overflow: hidden;
29
+ }
30
+ }
@@ -0,0 +1,7 @@
1
+ :root {
2
+ --accordian-panel-border: 0.1rem solid light-dark(var(--gray-3), var(--gray-6));
3
+ --accordian-panel-border-radius: 0.4rem;
4
+ --accordian-panel-mbe: 1.6rem;
5
+
6
+ --accordion-trigger-bg: light-dark(var(--gray-3), var(--gray-6));
7
+ }
@@ -0,0 +1,35 @@
1
+ .display-dialog-core {
2
+ --dialog-border: 0.1rem solid light-dark(var(--gray-8), var(--gray-0));
3
+ --dialog-outline: 0.1rem solid light-dark(var(--gray-8), var(--gray-0));
4
+ --dialog-border-radius: 0.4rem;
5
+
6
+ --dialog-inner-background: light-dark(var(--gray-0), var(--gray-9));
7
+
8
+ /*
9
+ * Header styles
10
+ */
11
+ --dialog-header-padding: 0 1.2rem;
12
+
13
+ --dialog-header-button-margin: 0;
14
+ --dialog-header-button-padding: 0.4rem;
15
+ --dialog-header-button-border-radius: 50%;
16
+
17
+ --dialog-header-button-border: 1px solid transparent;
18
+ --dialog-header-button-outline: 1px solid transparent;
19
+
20
+ --dialog-header-button-border-hover: 1px solid light-dark(var(--gray-8), var(--gray-0));
21
+ --dialog-header-button-outline-hover: 1px solid light-dark(var(--gray-8), var(--gray-0));
22
+
23
+ --dialog-header-button-icon-color: light-dark(var(--gray-8), var(--gray-0));
24
+ --dialog-header-button-icon-font-size: 1.4rem;
25
+
26
+ /*
27
+ * Header styles
28
+ */
29
+ --dialog-content-padding: 1.2rem;
30
+
31
+ /*
32
+ * Footerer styles
33
+ */
34
+ --dialog-footer-padding: 1.2rem;
35
+ }
@@ -0,0 +1,18 @@
1
+ :root {
2
+ --tabs-default-text: light-dark(var(--gray-12), var(--gray-0));
3
+ --tabs-active-bg: light-dark(var(--gray-12), var(--gray-0));
4
+ --tabs-active-text: light-dark(var(--gray-0), var(--gray-12));
5
+ --tabs-active-indicator: var(--green-6);
6
+ --tabs-hovered-bg: light-dark(var(--gray-7), var(--gray-3));
7
+ --tabs-hovered-text: light-dark(var(--gray-0), var(--gray-12));
8
+ --tabs-border-bottom: 0px solid var(--green-6);
9
+
10
+ --tabs-content-border: 0.1rem solid var(--green-6);
11
+ --tabs-content-outline: 0.1rem solid var(--green-12);
12
+ --tabs-content-bg: light-dark(var(--gray-1), var(--gray-8));
13
+
14
+ --tabs-content-start-start-radius: 0;
15
+ --tabs-content-start-end-radius: 0;
16
+ --tabs-content-end-start-radius: 1rem;
17
+ --tabs-content-end-end-radius: 1rem;
18
+ }
@@ -0,0 +1,57 @@
1
+ :root {
2
+ /*
3
+ * Wrapper styles
4
+ */
5
+ --display-prompt-wrapper-border-radius: 0.5rem;
6
+
7
+ /*
8
+ * Inner styles
9
+ */
10
+ --display-prompt-inner-margin: 0 0 0 0.7rem;
11
+ --display-prompt-inner-padding: 1rem 1.5rem;
12
+ --display-prompt-inner-gap: 1.6rem;
13
+ --display-prompt-inner-border-radius: 0.2rem;
14
+
15
+ /*
16
+ * Icon styles
17
+ */
18
+ --display-prompt-icon-size: 3rem;
19
+ --display-prompt-icon-weight: normal;
20
+
21
+ /*
22
+ * Title styles
23
+ */
24
+ --display-prompt-inner-content-gap: 1rem;
25
+ --display-prompt-content-margin: 0;
26
+ --display-prompt-content-padding: 0.2rem;
27
+
28
+ /*
29
+ * Title styles
30
+ */
31
+ --display-prompt-content-title-font-size: var(--step-2);
32
+ --display-prompt-content-title-font-weight: bold;
33
+ --display-prompt-content-title-line-height: 1.3;
34
+ --display-prompt-content-title-margin: 0;
35
+ --display-prompt-content-title-padding: 0;
36
+
37
+ /*
38
+ * Text styles
39
+ */
40
+ --display-prompt-content-text-font-size: var(--step-2);
41
+ --display-prompt-content-text-font-weight: normal;
42
+ --display-prompt-content-text-line-height: 1.3;
43
+ --display-prompt-content-title-margin: 0;
44
+ --display-prompt-content-title-padding: 0;
45
+
46
+ /*
47
+ * Button styles
48
+ */
49
+ --display-prompt-button-border-radius: 50%;
50
+ --display-prompt-button-margin: 1rem;
51
+ --display-prompt-button-padding: 0.5rem;
52
+
53
+ /*
54
+ * Button styles
55
+ */
56
+ --display-prompt-button-icon-font-size: var(--step-2);
57
+ }
@@ -0,0 +1,2 @@
1
+ @import './_scaffolding.css';
2
+ @import './themes';
@@ -0,0 +1,39 @@
1
+ [data-prompt-theme='error'] {
2
+ /*
3
+ * Wrapper styles
4
+ */
5
+ --display-prompt-wrapper-background-color: var(--red-8);
6
+ --display-prompt-wrapper-border: 0.1rem solid var(--red-8);
7
+ --display-prompt-wrapper-outline: 0.1rem solid var(--red-5);
8
+
9
+ /*
10
+ * Inner styles
11
+ */
12
+ --display-prompt-inner-background-color: var(--red-0);
13
+
14
+ /*
15
+ * Icon styles
16
+ */
17
+ --display-prompt-icon-color: var(--red-8);
18
+
19
+ /*
20
+ * Title styles
21
+ */
22
+ --display-prompt-content-title-color: var(--red-8);
23
+
24
+ /*
25
+ * Text styles
26
+ */
27
+ --display-prompt-content-text-color: var(--red-8);
28
+
29
+ /*
30
+ * Button styles
31
+ */
32
+ --display-prompt-button-border: 0.1rem solid var(--red-8);
33
+ --display-prompt-button-outline: 0.1rem solid var(--red-8);
34
+
35
+ /*
36
+ * Button styles
37
+ */
38
+ --display-prompt-button-icon-color: var(--red-8);
39
+ }
@@ -0,0 +1,39 @@
1
+ [data-prompt-theme='info'] {
2
+ /*
3
+ * Wrapper styles
4
+ */
5
+ --display-prompt-wrapper-background-color: var(--blue-8);
6
+ --display-prompt-wrapper-border: 0.1rem solid var(--blue-8);
7
+ --display-prompt-wrapper-outline: 0.1rem solid var(--blue-5);
8
+
9
+ /*
10
+ * Inner styles
11
+ */
12
+ --display-prompt-inner-background-color: var(--blue-0);
13
+
14
+ /*
15
+ * Icon styles
16
+ */
17
+ --display-prompt-icon-color: var(--blue-8);
18
+
19
+ /*
20
+ * Title styles
21
+ */
22
+ --display-prompt-content-title-color: var(--blue-8);
23
+
24
+ /*
25
+ * Text styles
26
+ */
27
+ --display-prompt-content-text-color: var(--blue-8);
28
+
29
+ /*
30
+ * Button styles
31
+ */
32
+ --display-prompt-button-border: 0.1rem solid var(--blue-8);
33
+ --display-prompt-button-outline: 0.1rem solid var(--blue-8);
34
+
35
+ /*
36
+ * Button styles
37
+ */
38
+ --display-prompt-button-icon-color: var(--blue-8);
39
+ }
@@ -0,0 +1,39 @@
1
+ [data-prompt-theme='success'] {
2
+ /*
3
+ * Wrapper styles
4
+ */
5
+ --display-prompt-wrapper-background-color: var(--green-8);
6
+ --display-prompt-wrapper-border: 0.1rem solid var(--green-8);
7
+ --display-prompt-wrapper-outline: 0.1rem solid var(--green-5);
8
+
9
+ /*
10
+ * Inner styles
11
+ */
12
+ --display-prompt-inner-background-color: var(--green-0);
13
+
14
+ /*
15
+ * Icon styles
16
+ */
17
+ --display-prompt-icon-color: var(--green-8);
18
+
19
+ /*
20
+ * Title styles
21
+ */
22
+ --display-prompt-content-title-color: var(--green-8);
23
+
24
+ /*
25
+ * Text styles
26
+ */
27
+ --display-prompt-content-text-color: var(--green-8);
28
+
29
+ /*
30
+ * Button styles
31
+ */
32
+ --display-prompt-button-border: 0.1rem solid var(--green-8);
33
+ --display-prompt-button-outline: 0.1rem solid var(--green-8);
34
+
35
+ /*
36
+ * Button styles
37
+ */
38
+ --display-prompt-button-icon-color: var(--green-8);
39
+ }
@@ -0,0 +1,39 @@
1
+ [data-prompt-theme='warning'] {
2
+ /*
3
+ * Wrapper styles
4
+ */
5
+ --display-prompt-wrapper-background-color: var(--orange-8);
6
+ --display-prompt-wrapper-border: 0.1rem solid var(--orange-8);
7
+ --display-prompt-wrapper-outline: 0.1rem solid var(--orange-5);
8
+
9
+ /*
10
+ * Inner styles
11
+ */
12
+ --display-prompt-inner-background-color: var(--orange-0);
13
+
14
+ /*
15
+ * Icon styles
16
+ */
17
+ --display-prompt-icon-color: var(--orange-8);
18
+
19
+ /*
20
+ * Title styles
21
+ */
22
+ --display-prompt-content-title-color: var(--orange-8);
23
+
24
+ /*
25
+ * Text styles
26
+ */
27
+ --display-prompt-content-text-color: var(--orange-8);
28
+
29
+ /*
30
+ * Button styles
31
+ */
32
+ --display-prompt-button-border: 0.1rem solid var(--orange-8);
33
+ --display-prompt-button-outline: 0.1rem solid var(--orange-8);
34
+
35
+ /*
36
+ * Button styles
37
+ */
38
+ --display-prompt-button-icon-color: var(--orange-8);
39
+ }
@@ -0,0 +1,4 @@
1
+ @import './_error';
2
+ @import './_success';
3
+ @import './_warning';
4
+ @import './_info';
@@ -0,0 +1,4 @@
1
+ @import './_accordian';
2
+ @import './_tabs';
3
+ @import './display-prompt-core';
4
+ @import './_display-dialog-core';
@@ -1 +1,2 @@
1
1
  @import './colors/colors.css';
2
+ @import './components';
@@ -1,27 +1,28 @@
1
1
  <template>
2
- <dialog class="display-dialog wrapper" :class="[elementClasses]" :align-dialog :open ref="dialogRef">
2
+ <dialog class="display-dialog-core" :class="[variant, elementClasses]" :align-dialog :open ref="dialogRef">
3
3
  <focus-trap v-model:active="open" :clickOutsideDeactivates="true" @deactivate="closeDialog()">
4
4
  <div class="inner">
5
- <div class="top-bar">
6
- <template v-if="hasDialogTitle">
7
- <div class="col-left">
8
- <slot name="dialogTitle"></slot>
9
- </div>
10
- </template>
5
+ <div class="header">
6
+ <div v-if="hasDialogTitle" class="col-left">
7
+ <slot name="dialogTitle"></slot>
8
+ </div>
11
9
 
12
10
  <div class="col-center">
13
11
  <p class="text-normal wght-700">Center col</p>
14
12
  </div>
15
13
  <div class="col-right">
16
- <button @click.prevent="closeDialog()">x</button>
14
+ <button @click.prevent="closeDialog()" data-test-id="display-dialog-header-close" class="display-prompt-action">
15
+ <Icon name="bitcoin-icons:cross-filled" class="icon" />
16
+ <span class="sr-only">Really Close</span>
17
+ </button>
17
18
  </div>
18
19
  </div>
19
- <slot v-if="hasDialogContent" name="dialogContent"></slot>
20
- <template v-if="hasActionButtons">
21
- <div class="button-row">
22
- <slot name="actionButtons"></slot>
23
- </div>
24
- </template>
20
+ <div v-if="hasDialogContent" class="dialog-content" :class="[{ 'allow-content-scroll': allowContentScroll }]">
21
+ <slot name="dialogContent"></slot>
22
+ </div>
23
+ <div v-if="hasActionButtons" class="footer">
24
+ <slot name="actionButtons"></slot>
25
+ </div>
25
26
  </div>
26
27
  </focus-trap>
27
28
  </dialog>
@@ -37,7 +38,7 @@ const props = defineProps({
37
38
  variant: {
38
39
  type: String,
39
40
  default: 'dialog',
40
- validator: (val) => ['dialog', 'modal'].includes(val as string),
41
+ validator: (val) => ['dialog', 'modal', 'confirm'].includes(val as string),
41
42
  },
42
43
  positionX: {
43
44
  type: String,
@@ -53,6 +54,10 @@ const props = defineProps({
53
54
  type: Boolean,
54
55
  default: true,
55
56
  },
57
+ allowContentScroll: {
58
+ type: Boolean,
59
+ default: false,
60
+ },
56
61
  });
57
62
 
58
63
  const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
@@ -85,8 +90,36 @@ onMounted(() => {
85
90
  </script>
86
91
 
87
92
  <style lang="css">
88
- .display-dialog {
93
+ .display-dialog-core {
94
+ --_dialog-inner-height: initial;
95
+ --_dialog-inner-width: 100vw;
96
+
89
97
  display: flex;
98
+ position: fixed;
99
+ left: 0;
100
+ top: 0;
101
+ width: 100%;
102
+ height: 100%;
103
+ backdrop-filter: blur(5px);
104
+ background-color: rgba(0, 0, 0, 0.5);
105
+ z-index: 13;
106
+ opacity: 0;
107
+ border: none;
108
+ padding: 0;
109
+
110
+ display: none;
111
+ transition: opacity 200ms, display 200ms, overlay 200ms;
112
+ transition-behavior: allow-discrete;
113
+
114
+ &[open] {
115
+ display: flex;
116
+ opacity: 1;
117
+
118
+ @starting-style {
119
+ display: flex;
120
+ opacity: 0;
121
+ }
122
+ }
90
123
 
91
124
  &[align-dialog$='center'] {
92
125
  justify-content: center;
@@ -95,76 +128,113 @@ onMounted(() => {
95
128
  align-items: center;
96
129
  }
97
130
 
98
- &.wrapper {
99
- position: fixed;
100
- left: 0;
101
- top: 0;
102
- width: 100%;
103
- height: 100%;
104
- backdrop-filter: blur(5px);
105
- background-color: rgba(0, 0, 0, 0.5);
106
- border: 0.1rem solid var(--color-grey-1);
107
- z-index: 13;
108
- opacity: 0;
109
-
110
- display: none;
111
- transition: opacity 200ms, display 200ms, overlay 200ms;
112
- transition-behavior: allow-discrete;
113
-
114
- &[open] {
115
- display: flex;
116
- opacity: 1;
131
+ &.confirm {
132
+ --_dialog-inner-width: initial;
133
+ }
117
134
 
118
- @starting-style {
119
- display: flex;
120
- opacity: 0;
121
- }
122
- }
135
+ &.dialog {
136
+ --_dialog-inner-height: 70dvh;
137
+ --_dialog-inner-width: min(75%, 720px);
123
138
  }
124
139
 
125
- .inner {
126
- background-color: var(--page-bg);
127
- width: 100vw;
128
- margin: 1.2rem;
129
- padding: 1.2rem;
140
+ &.form {
141
+ --_dialog-inner-width: initial;
142
+ }
130
143
 
131
- @media only screen and (min-width: 768px) {
132
- width: 720px;
133
- }
144
+ &.fullscreen {
145
+ --_dialog-inner-width: initial;
146
+ }
134
147
 
135
- /* @media only screen and (min-width: 1024px) {
136
- height: 100dvh;
137
- width: 100vw;
138
- } */
148
+ &.modal {
149
+ --_dialog-inner-width: initial;
139
150
  }
140
151
 
141
- .top-bar {
152
+ .inner {
142
153
  display: grid;
143
- grid-template-columns: auto 1fr auto;
144
- align-items: center;
154
+ grid-template-rows: auto 1fr auto;
155
+
156
+ border-radius: var(--dialog-border-radius);
157
+ border: var(--dialog-border);
158
+ outline: var(--dialog-outline);
159
+
160
+ background-color: var(--dialog-inner-background);
161
+ height: var(--_dialog-inner-height);
162
+ width: var(--_dialog-inner-width);
145
163
 
146
- .col-left {
147
- /* grid-column: 1; */
148
- /* display: none; */
164
+ overflow: hidden;
165
+
166
+ .header {
167
+ display: grid;
168
+ grid-template-columns: auto 1fr auto;
169
+ align-items: center;
170
+
171
+ padding: var(--dialog-header-padding);
172
+
173
+ .col-left {
174
+ /* grid-column: 1; */
175
+ /* display: none; */
176
+ }
177
+
178
+ .col-center {
179
+ /* grid-column: 2; */
180
+ text-align: center;
181
+
182
+ color: var(--color-red-1);
183
+ display: none;
184
+ }
185
+
186
+ .col-right {
187
+ grid-column: 3;
188
+
189
+ .display-prompt-action {
190
+ background-color: transparent;
191
+ display: block flex;
192
+ align-items: center;
193
+ justify-content: center;
194
+ margin: var(--dialog-header-button-margin);
195
+ padding: var(--dialog-header-button-padding);
196
+ border: var(--dialog-header-button-border);
197
+ border-radius: var(--dialog-header-button-border-radius);
198
+ outline: var(--dialog-header-button-outline);
199
+
200
+ transition: border-color 0.2s, outline-color 0.2s;
201
+
202
+ &:hover,
203
+ &:focus-visible {
204
+ cursor: pointer;
205
+ border: var(--dialog-header-button-border-hover);
206
+ outline: var(--dialog-header-button-outline-hover);
207
+ }
208
+
209
+ .icon {
210
+ color: var(--dialog-header-button-icon-color);
211
+ display: block;
212
+ font-size: var(--dialog-header-button-icon-font-size);
213
+ border: 1px solid green;
214
+ padding: 1rem;
215
+ }
216
+ }
217
+ }
149
218
  }
150
219
 
151
- .col-center {
152
- /* grid-column: 2; */
153
- text-align: center;
220
+ .dialog-content {
221
+ overflow: hidden;
222
+ padding: var(--dialog-content-padding);
154
223
 
155
- color: var(--color-red-1);
156
- display: none;
224
+ &.allow-content-scroll {
225
+ overflow-y: auto;
226
+ &::-webkit-scrollbar {
227
+ display: none;
228
+ }
229
+ }
157
230
  }
158
231
 
159
- .col-right {
160
- grid-column: 3;
232
+ .footer {
233
+ display: flex;
234
+ gap: 1.2rem;
235
+ justify-content: flex-end;
236
+ padding: var(--dialog-footer-padding);
161
237
  }
162
238
  }
163
-
164
- /* .button-row {
165
- display: flex;
166
- gap: 1.2rem;
167
- justify-content: flex-end;
168
- } */
169
239
  }
170
240
  </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <DisplayDialogCore :styleClassPassthrough :lockViewport="true">
2
+ <DisplayDialogCore variant="confirm" :styleClassPassthrough :lockViewport="true">
3
3
  <template #dialogTitle>
4
4
  <slot name="dialogTitle">
5
5
  <p class="text-normal wght-700">Confirm</p>
@@ -25,16 +25,16 @@ const props = defineProps({
25
25
  </script>
26
26
 
27
27
  <style lang="css">
28
- .display-dialog {
29
- &.content-width {
30
- .inner {
31
- width: initial;
32
-
33
- .button-row {
34
- display: grid;
35
- gap: 1.2rem;
36
- grid-template-columns: 1fr 1fr;
37
- }
28
+ .display-dialog-core {
29
+ .inner {
30
+ .header {
31
+ /* background-color: aquamarine; */
32
+ }
33
+ .dialog-content {
34
+ /* background-color: bisque; */
35
+ }
36
+ .footer {
37
+ /* background-color: blueviolet; */
38
38
  }
39
39
  }
40
40
  }
@@ -0,0 +1,45 @@
1
+ <template>
2
+ <DisplayDialogCore variant="dialog" :styleClassPassthrough :lockViewport="true" :allowContentScroll>
3
+ <template #dialogTitle>
4
+ <slot name="dialogTitle">
5
+ <p class="text-normal wght-700">Confirm</p>
6
+ </slot>
7
+ </template>
8
+ <template #dialogContent>
9
+ <slot name="dialogContent"></slot>
10
+ </template>
11
+ <template #actionButtons>
12
+ <slot name="actionButtonLeft"></slot>
13
+ <slot name="actionButtonRight"></slot>
14
+ </template>
15
+ </DisplayDialogCore>
16
+ </template>
17
+
18
+ <script setup lang="ts">
19
+ const props = defineProps({
20
+ styleClassPassthrough: {
21
+ type: Array as PropType<string[]>,
22
+ default: () => [],
23
+ },
24
+ allowContentScroll: {
25
+ type: Boolean,
26
+ default: false,
27
+ },
28
+ });
29
+ </script>
30
+
31
+ <style lang="css">
32
+ .display-dialog-core {
33
+ .inner {
34
+ .header {
35
+ /* background-color: aquamarine; */
36
+ }
37
+ .dialog-content {
38
+ /* background-color: bisque; */
39
+ }
40
+ .footer {
41
+ /* background-color: blueviolet; */
42
+ }
43
+ }
44
+ }
45
+ </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="display-prompt-wrapper" :class="[theme, elementClasses, { dismissed: hide }]" data-test-id="display-prompt">
2
+ <div class="display-prompt-wrapper" :data-prompt-theme="theme" :class="[elementClasses, { dismissed: hide }]" data-test-id="display-prompt">
3
3
  <div class="display-prompt-inner">
4
4
  <div class="display-prompt-icon" data-test-id="prompt-icon">
5
5
  <slot name="icon"></slot>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "srcdev-nuxt-components",
3
3
  "type": "module",
4
- "version": "1.0.1",
4
+ "version": "1.0.3",
5
5
  "main": "nuxt.config.ts",
6
6
  "scripts": {
7
7
  "clean": "rm -rf .nuxt && rm -rf .output && rm -rf .playground/.nuxt && rm -rf .playground/.output",
@@ -25,18 +25,19 @@
25
25
  "types/"
26
26
  ],
27
27
  "devDependencies": {
28
- "@nuxt/eslint-config": "0.7.3",
29
- "@nuxt/icon": "1.10.2",
28
+ "@iconify-json/akar-icons": "^1.2.2",
29
+ "@iconify-json/bitcoin-icons": "^1.2.2",
30
+ "@nuxt/eslint-config": "0.7.5",
31
+ "@nuxt/icon": "1.10.3",
30
32
  "@oddbird/css-anchor-positioning": "0.4.0",
31
- "eslint": "9.17.0",
32
- "happy-dom": "15.11.7",
33
- "nuxt": "3.14.1592",
34
- "release-it": "17.10.0",
35
- "typescript": "5.7.2",
36
- "vue": "3.5.13"
33
+ "eslint": "9.19.0",
34
+ "happy-dom": "16.7.2",
35
+ "nuxt": "3.15.3",
36
+ "release-it": "18.1.2",
37
+ "typescript": "5.7.3"
37
38
  },
38
39
  "dependencies": {
39
- "@vueuse/core": "12.0.0",
40
+ "@vueuse/core": "12.5.0",
40
41
  "focus-trap-vue": "4.0.3",
41
42
  "modern-normalize": "3.0.1"
42
43
  },