classcard-ui 0.2.1467 → 0.2.1468

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "classcard-ui",
3
- "version": "0.2.1467",
3
+ "version": "0.2.1468",
4
4
  "main": "dist/classcard-ui.umd.min.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -5,49 +5,66 @@
5
5
  ? `bg-${color}-50 border-l-4 border-${color}-400 p-4`
6
6
  : `rounded-md bg-${color}-50 p-4`
7
7
  "
8
+ :id="id || undefined"
9
+ :role="id ? 'region' : undefined"
10
+ :aria-labelledby="id ? id + '-title' : undefined"
11
+ :aria-describedby="
12
+ id && description && type !== 'withAccentBorder'
13
+ ? id + '-desc'
14
+ : undefined
15
+ "
8
16
  >
9
- <div class="flex">
10
- <div class="flex-shrink-0" v-if="icon">
17
+ <div class="flex gap-2">
18
+ <div class="flex-shrink-0" v-if="icon" aria-hidden="true">
11
19
  <c-icon
12
20
  :type="icon.type"
13
21
  :name="icon.name"
14
- :class="`h-5 w-5 text-${color}-700`"
22
+ :class="`h-5 w-5 text-${color}-500`"
15
23
  ></c-icon>
16
24
  </div>
17
- <div class="ml-3" v-if="type == 'withAccentBorder'">
18
- <p :class="`text-sm text-${color}-700`">
19
- <a
20
- href="#"
21
- :class="`font-medium underline text-${color}-700 hover:text-${color}-600`"
22
- :id="id"
25
+ <div class="flex-1">
26
+ <template v-if="type == 'withAccentBorder'">
27
+ <p
28
+ :id="id ? id + '-title' : undefined"
29
+ :class="`text-sm text-${color}-700`"
23
30
  >
24
- {{ linkLabel }}
25
- </a>
26
- {{ label }}
27
- </p>
28
- </div>
29
- <div v-else class="ml-3">
30
- <h3 :class="`text-sm font-medium text-${color}-800 word-break`">
31
- {{ label }}
32
- </h3>
33
- <div
34
- :class="`mt-2 text-sm text-${color}-700 max-w-full`"
35
- v-if="description"
36
- >
37
- <p class="whitespace-pre-line break-all">
38
- {{ description }}
39
- </p>
40
- </div>
41
- <div class="mt-4" v-if="type == 'withActions'">
42
- <div class="-mx-2 -my-1.5 flex">
43
- <button
44
- :id="id"
45
- :class="`bg-${color}-50 rounded-md px-2 py-1.5 text-sm font-medium text-${color}-800 hover:bg-${color}-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-${color}-50 focus:ring-${color}-600`"
31
+ <a
32
+ href="#"
33
+ :class="`font-medium underline text-${color}-700 hover:text-${color}-600`"
46
34
  >
47
- {{ actions.label }}
48
- </button>
35
+ {{ linkLabel }}
36
+ </a>
37
+ {{ label }}
38
+ </p>
39
+ </template>
40
+ <template v-else>
41
+ <h3
42
+ :id="id ? id + '-title' : undefined"
43
+ :class="`text-sm font-medium text-${color}-700 word-break`"
44
+ >
45
+ {{ label }}
46
+ </h3>
47
+ <div
48
+ :id="id && description ? id + '-desc' : undefined"
49
+ :class="`mt-2 text-sm text-${color}-700 max-w-full`"
50
+ v-if="description"
51
+ >
52
+ <p class="whitespace-pre-line break-all">
53
+ {{ description }}
54
+ </p>
55
+ </div>
56
+ <div class="mt-4" v-if="type == 'withActions'">
57
+ <div class="-mx-2 -my-1.5 flex">
58
+ <button
59
+ type="button"
60
+ :id="id ? id + '-action' : undefined"
61
+ :class="`bg-${color}-50 rounded-md px-2 py-1.5 text-sm font-medium text-${color}-800 hover:bg-${color}-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-${color}-50 focus:ring-${color}-600`"
62
+ >
63
+ {{ actions.label }}
64
+ </button>
65
+ </div>
49
66
  </div>
50
- </div>
67
+ </template>
51
68
  </div>
52
69
  </div>
53
70
  </div>
@@ -11,7 +11,8 @@ export default {
11
11
  linkLabel: String,
12
12
  icon: { control: { type: "object" } },
13
13
  actions: { control: { type: "object" } },
14
- type: {control: { type: 'select', options: ['withActions', 'withAccentBorder']}}
14
+ type: {control: { type: 'select', options: ['withActions', 'withAccentBorder']}},
15
+ id: String,
15
16
  },
16
17
  };
17
18
 
@@ -34,4 +35,5 @@ Default.args = {
34
35
  actions:{
35
36
  label: 'Update'
36
37
  },
38
+ id: 'c-alert',
37
39
  };