srcdev-nuxt-components 2.1.6 → 2.1.8

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,122 @@
1
+ <template>
2
+ <details :name class="display-details" :class="[elementClasses]">
3
+ <summary class="display-details-summary" :id="triggerId" :aria-controls="contentId">
4
+ <span class="label">
5
+ <slot name="summary"></slot>
6
+ </span>
7
+ <slot name="summaryIcon">
8
+ <Icon name="bi:caret-down-fill" class="icon mi-12" :class="iconsSize" />
9
+ </slot>
10
+ </summary>
11
+ <div class="display-details-content" :aria-labelledby="triggerId" :id="contentId" role="region">
12
+ <slot name="content"></slot>
13
+ </div>
14
+ </details>
15
+ </template>
16
+
17
+ <script setup lang="ts">
18
+ const props = defineProps({
19
+ name: {
20
+ type: String,
21
+ required: true,
22
+ },
23
+ id: {
24
+ type: String,
25
+ required: true,
26
+ },
27
+ iconSize: {
28
+ type: String,
29
+ default: 'small',
30
+ validator(value: string) {
31
+ return ['small', 'medium', 'large'].includes(value);
32
+ },
33
+ },
34
+ styleClassPassthrough: {
35
+ type: Array as PropType<string[]>,
36
+ default: () => [],
37
+ },
38
+ });
39
+
40
+ const triggerId = computed(() => `${props.id}-trigger`);
41
+ const contentId = computed(() => `${props.id}-content`);
42
+
43
+ const { elementClasses, resetElementClasses, updateElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
44
+
45
+ updateElementClasses([props.iconSize]);
46
+
47
+ watch(
48
+ () => props.styleClassPassthrough,
49
+ () => {
50
+ resetElementClasses(props.styleClassPassthrough);
51
+ }
52
+ );
53
+ </script>
54
+
55
+ <style lang="css">
56
+ .display-details {
57
+ /* Component setup */
58
+ --_display-details-icon-transform: scaleY(1);
59
+ --_display-details-icon-size: 1.2rem;
60
+
61
+ /* Configurable properties */
62
+ --_display-details-border: none;
63
+ --_display-details-outline: none;
64
+ --_display-details-box-shadow: none;
65
+ --_display-details-border-radius: 0;
66
+ --_display-details-mbe: 1em;
67
+
68
+ --_display-details-summary-gap: 12px;
69
+ --_display-details-summary-flex-direction: row;
70
+
71
+ --_display-details-content-padding: 0;
72
+
73
+ &.medium {
74
+ --_display-details-icon-size: 1.8rem;
75
+ }
76
+ &.large {
77
+ --_display-details-icon-size: 2.4rem;
78
+ }
79
+
80
+ &[open] {
81
+ --_display-details-icon-transform: scaleY(-1);
82
+ }
83
+
84
+ border: var(--_display-details-border);
85
+ outline: var(--_display-details-outline);
86
+ box-shadow: var(--_display-details-box-shadow);
87
+ border-radius: var(--_display-details-border-radius);
88
+ margin-block-end: var(--_display-details-mbe);
89
+
90
+ .display-details-summary {
91
+ list-style: none;
92
+
93
+ &::-webkit-details-marker,
94
+ &::marker {
95
+ display: none;
96
+ }
97
+
98
+ display: flex !important;
99
+ flex-direction: var(--_display-details-summary-flex-direction);
100
+ align-items: center;
101
+ gap: var(--_display-details-summary-gap);
102
+ overflow: clip;
103
+
104
+ .label {
105
+ display: block;
106
+ flex-grow: 1;
107
+ }
108
+
109
+ .icon {
110
+ display: block;
111
+
112
+ font-size: var(--_display-details-icon-size);
113
+ transform: var(--_display-details-icon-transform);
114
+ transition: transform 200ms;
115
+ }
116
+ }
117
+
118
+ .display-details-content {
119
+ padding: var(--_display-details-content-padding);
120
+ }
121
+ }
122
+ </style>
@@ -1,13 +1,13 @@
1
1
  <template>
2
2
  <div class="display-accordian" :class="[elementClasses]" ref="accordianRef">
3
- <details v-for="(item, key) in data" :key="key" class="accordion-panel" name="navigation-group">
4
- <summary class="accordion-trigger" :id="`accordian-${key}-trigger`" :aria-controls="`accordian-${key}-content`" ref="triggerRefs">
3
+ <details v-for="(item, key) in data" :key="key" class="accordion-panel" :name="accordianName">
4
+ <summary class="accordion-trigger" :id="`accordian-${key}-trigger`" :aria-controls="`accordian-${key}-content`">
5
5
  <span class="label">
6
6
  <slot :name="`accordian-${key}-trigger`"></slot>
7
7
  </span>
8
8
  <Icon name="bi:caret-down-fill" class="icon mi-12" />
9
9
  </summary>
10
- <div class="accordion-content" :aria-labelledby="`accordian-${key}-trigger`" :id="`accordian-${key}-content`" role="region" ref="contentRefs">
10
+ <div class="accordion-content" :aria-labelledby="`accordian-${key}-trigger`" :id="`accordian-${key}-content`" role="region">
11
11
  <div class="accordion-content-inner">
12
12
  <slot :name="`accordian-${key}-content`"></slot>
13
13
  </div>
@@ -34,6 +34,7 @@ const props = defineProps({
34
34
  });
35
35
 
36
36
  const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
37
+ const accordianName = useId();
37
38
  </script>
38
39
 
39
40
  <style lang="css">
@@ -49,18 +50,20 @@ const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
49
50
  initial-value: 0fr;
50
51
  }
51
52
 
53
+ @property --_accordian-content-transform {
54
+ syntax: '<transform-list>';
55
+ inherits: true;
56
+ initial-value: scaleY(0);
57
+ }
58
+
52
59
  --_grid-template-rows: 0fr;
53
60
  --_icon-transform: scaleY(1);
61
+ --_accordian-content-transform: scaleY(0);
54
62
 
55
63
  border: var(--accordian-panel-border);
56
64
  border-radius: var(--accordian-panel-border-radius);
57
65
  margin-block-end: var(--accordian-panel-mbe);
58
66
 
59
- &[open] {
60
- --_grid-template-rows: 1fr;
61
- --_icon-transform: scaleY(-1);
62
- }
63
-
64
67
  summary::-webkit-details-marker,
65
68
  summary::marker {
66
69
  display: none;
@@ -88,12 +91,41 @@ const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
88
91
  }
89
92
 
90
93
  .accordion-content {
94
+ /* display: block; */
91
95
  display: grid;
92
- grid-template-rows: var(--_grid-template-rows);
96
+ grid-template-rows: 0fr;
97
+ /* grid-template-rows: var(--_grid-template-rows); */
98
+
99
+ /* transform: var(--_accordian-content-transform); */
100
+ /* transform: scaleY(0); */
101
+ /* transform-origin: top; */
93
102
  transition: all 2000ms;
94
103
 
95
104
  .accordion-content-inner {
96
- overflow: hidden;
105
+ /* display: grid; */
106
+ /* grid-template-rows: 0fr; */
107
+
108
+ /* transform: scaleY(0); */
109
+ /* transform-origin: top; */
110
+
111
+ /* transition: all 2000ms; */
112
+ }
113
+ }
114
+
115
+ &[open] {
116
+ --_grid-template-rows: 1fr;
117
+ --_icon-transform: scaleY(-1);
118
+ --_accordian-content-transform: scaleY(1);
119
+
120
+ .accordion-content {
121
+ /* transform: scaleY(1); */
122
+ /* grid-template-rows: unset; */
123
+ grid-template-rows: 1fr;
124
+
125
+ .accordion-content-inner {
126
+ /* grid-template-rows: 1fr; */
127
+ /* transform: scaleY(1); */
128
+ }
97
129
  }
98
130
  }
99
131
  }
@@ -1,7 +1,9 @@
1
1
  <template>
2
2
  <div class="layout-row" :class="elementClasses">
3
3
  <component :is="tag" :data-testid="dataTestid" class="layout-row-inner" :class="variant">
4
- <slot name="default"></slot>
4
+ <div>
5
+ <slot name="default"></slot>
6
+ </div>
5
7
  </component>
6
8
  </div>
7
9
  </template>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "srcdev-nuxt-components",
3
3
  "type": "module",
4
- "version": "2.1.6",
4
+ "version": "2.1.8",
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",