srcdev-nuxt-components 0.1.1 → 1.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.
@@ -0,0 +1,2 @@
1
+ @import './_variables';
2
+ @import './_utils';
@@ -2,4 +2,4 @@
2
2
  @import './forms';
3
3
  @import './utils';
4
4
  @import './typography';
5
- @import './ally';
5
+ @import './a11y';
@@ -0,0 +1,150 @@
1
+ <template>
2
+ <div class="display-prompt-wrapper" :class="[theme, elementClasses, { dismissed: hide }]" data-test-id="display-prompt">
3
+ <div class="display-prompt-inner">
4
+ <div class="display-prompt-icon" data-test-id="prompt-icon">
5
+ <slot name="icon"></slot>
6
+ </div>
7
+ <div class="display-prompt-content">
8
+ <p class="title" data-test-id="display-prompt-title">
9
+ <slot name="title"></slot>
10
+ </p>
11
+ <p v-if="hasContent" class="text" data-test-id="display-prompt-content">
12
+ <slot name="content"></slot>
13
+ </p>
14
+ </div>
15
+ <button v-if="dismissible" @click.prevent="dismissPrompt()" data-test-id="display-prompt-action" class="display-prompt-action">
16
+ <Icon name="bitcoin-icons:cross-filled" class="icon" />
17
+ <span class="sr-only">Really Close</span>
18
+ </button>
19
+ </div>
20
+ </div>
21
+ </template>
22
+
23
+ <script setup lang="ts">
24
+ const props = defineProps({
25
+ dismissible: {
26
+ type: Boolean,
27
+ default: false,
28
+ },
29
+ theme: {
30
+ type: String,
31
+ default: 'error',
32
+ validator(value: string) {
33
+ return ['error', 'info', 'success', 'warning', 'secondary'].includes(value);
34
+ },
35
+ },
36
+ styleClassPassthrough: {
37
+ type: Array as PropType<string[]>,
38
+ default: () => [],
39
+ },
40
+ iconColor: {
41
+ type: String as PropType<string>,
42
+ default: 'dark-grey',
43
+ validator(value: string) {
44
+ return ['dark-grey', 'white'].includes(value);
45
+ },
46
+ },
47
+ });
48
+
49
+ const slots = useSlots();
50
+ const hasContent = ref(slots.content !== undefined);
51
+ const hide = ref(false);
52
+ const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
53
+
54
+ const dismissPrompt = () => {
55
+ // styleClassPassthrough.value = '';
56
+ hide.value = true;
57
+ };
58
+ </script>
59
+
60
+ <style lang="css">
61
+ .display-prompt-wrapper {
62
+ background-color: var(--display-prompt-wrapper-background-color);
63
+ border-radius: var(--display-prompt-wrapper-border-radius);
64
+ border: var(--display-prompt-wrapper-border);
65
+ outline: var(--display-prompt-wrapper-outline);
66
+ overflow: hidden;
67
+ transition: height 200ms, opacity 200ms, display 200ms;
68
+ transition-behavior: allow-discrete;
69
+
70
+ &.dismissed {
71
+ opacity: 0;
72
+ height: 0;
73
+ display: none;
74
+ }
75
+
76
+ .display-prompt-inner {
77
+ background-color: var(--display-prompt-inner-background-color);
78
+ align-items: center;
79
+ border-radius: var(--display-prompt-inner-border-radius);
80
+ display: flex;
81
+ gap: var(--display-prompt-inner-gap);
82
+ justify-content: space-between;
83
+ padding: var(--display-prompt-inner-padding);
84
+ margin: var(--display-prompt-inner-margin);
85
+
86
+ .display-prompt-icon {
87
+ display: inline-flex;
88
+ .icon {
89
+ color: var(--display-prompt-icon-color);
90
+ display: inline-block;
91
+ font-size: var(--display-prompt-icon-size);
92
+ font-style: normal;
93
+ font-weight: var(--display-prompt-icon-weight);
94
+ overflow: hidden;
95
+ }
96
+ }
97
+
98
+ .display-prompt-content {
99
+ display: block flex;
100
+ flex-direction: column;
101
+ flex-grow: 1;
102
+ gap: var(--display-prompt-inner-content-gap);
103
+ margin: var(--display-prompt-content-margin);
104
+ padding: var(--display-prompt-content-padding);
105
+
106
+ .title {
107
+ font-size: var(--display-prompt-content-title-font-size);
108
+ font-weight: var(--display-prompt-content-title-font-weight);
109
+ line-height: var(--display-prompt-content-title-line-height);
110
+ color: var(--display-prompt-content-title-color);
111
+ margin: var(--display-prompt-content-title-margin);
112
+ padding: var(--display-prompt-content-title-padding);
113
+ }
114
+
115
+ .text {
116
+ font-size: var(--display-prompt-content-text-font-size);
117
+ font-weight: var(--display-prompt-content-text-font-weight);
118
+ line-height: var(--display-prompt-content-text-line-height);
119
+ color: var(--display-prompt-content-text-color);
120
+ margin: var(--display-prompt-content-text-margin);
121
+ padding: var(--display-prompt-content-text-padding);
122
+ }
123
+ }
124
+ .display-prompt-action {
125
+ /* all: unset; */
126
+ background-color: transparent;
127
+ display: block flex;
128
+ align-items: center;
129
+ justify-content: center;
130
+ margin: var(--display-prompt-button-margin);
131
+ padding: var(--display-prompt-button-padding);
132
+ border: var(--display-prompt-button-border);
133
+ border-radius: var(--display-prompt-button-border-radius);
134
+ outline: var(--display-prompt-button-outline);
135
+
136
+ &:hover {
137
+ cursor: pointer;
138
+ }
139
+
140
+ .icon {
141
+ color: var(--display-prompt-button-icon-color);
142
+ display: block;
143
+ font-size: var(--display-prompt-button-icon-font-size);
144
+ border: 1px solid green;
145
+ padding: 1rem;
146
+ }
147
+ }
148
+ }
149
+ }
150
+ </style>
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <DisplayPromptCore variant="error" :dismissible icon-color="white" :style-class-passthrough>
3
+ <template #icon>
4
+ <Icon name="akar-icons:circle-alert" class="icon" />
5
+ </template>
6
+ <template #title>
7
+ <slot name="title"></slot>
8
+ </template>
9
+ <template v-if="hasContent" #content>
10
+ <slot name="content"></slot>
11
+ </template>
12
+ </DisplayPromptCore>
13
+ </template>
14
+
15
+ <script setup lang="ts">
16
+ const props = defineProps({
17
+ dismissible: {
18
+ type: Boolean,
19
+ default: false,
20
+ },
21
+ styleClassPassthrough: {
22
+ type: Array as PropType<string[]>,
23
+ default: () => [],
24
+ },
25
+ });
26
+
27
+ const slots = useSlots();
28
+ const hasContent = ref(slots.content !== undefined);
29
+ const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
30
+ </script>
31
+
32
+ <style lang="css">
33
+ .display-prompt.error {
34
+ --bg-color: var(--red-2);
35
+ --text-color: var(--gray-00);
36
+ }
37
+
38
+ .display-prompt {
39
+ &.error {
40
+ background-color: var(--bg-color);
41
+ }
42
+
43
+ &-icon {
44
+ .icon {
45
+ color: var(--text-color);
46
+ }
47
+ }
48
+
49
+ &-content {
50
+ color: var(--text-color);
51
+ }
52
+ }
53
+ </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "srcdev-nuxt-components",
3
3
  "type": "module",
4
- "version": "0.1.1",
4
+ "version": "1.0.1",
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",
@@ -1,2 +0,0 @@
1
- @import './_variables.css';
2
- @import './_utils.css';
File without changes
File without changes