classcard-ui 0.2.896 → 0.2.898

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.896",
3
+ "version": "0.2.898",
4
4
  "main": "dist/classcard-ui.umd.min.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -0,0 +1,82 @@
1
+ <template>
2
+ <div>
3
+ <nav
4
+ class="group flex rounded-lg bg-gray-100 p-0.5 hover:bg-gray-200"
5
+ aria-label="Tabs"
6
+ >
7
+ <button
8
+ v-for="(tabOption, index) in tabOptions"
9
+ :key="tabOption.label"
10
+ x-ref="dates"
11
+ class="focus:outline-none flex min-w-0 flex-grow rounded-md focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2 focus-visible:ring-offset-gray-100"
12
+ :tabindex="currentTab === tabOption.label ? '0' : '-1'"
13
+ @keydown.arrow-left="
14
+ $emit(
15
+ 'update-tab',
16
+ index === 0 ? tabOption.label : tabOptions[index - 1].label
17
+ )
18
+ "
19
+ @keydown.arrow-right="
20
+ $emit(
21
+ 'update-tab',
22
+ index === 0
23
+ ? tabOptions.find((tab) => tab.label !== tabOption.label).label
24
+ : tabOptions[index - 1].label
25
+ )
26
+ "
27
+ @click="$emit('update-tab', tabOption.label)"
28
+ >
29
+ <span
30
+ x-show="true"
31
+ class="flex min-w-0 flex-grow items-center justify-center space-x-2 rounded-md p-1.5 text-sm font-medium lg:pl-2.5 lg:pr-3.5"
32
+ :class="
33
+ currentTab === tabOption.label
34
+ ? 'ring-black bg-white shadow-sm ring-1 ring-opacity-5'
35
+ : ''
36
+ "
37
+ >
38
+ <c-icon
39
+ :type="tabOption.icon.type"
40
+ :class="
41
+ currentTab === tabOption.label
42
+ ? 'text-indigo-700'
43
+ : 'text-gray-400'
44
+ "
45
+ class="h-5 w-5"
46
+ :name="tabOption.icon.name"
47
+ :viewBox="tabOption.icon.viewBox"
48
+ ></c-icon>
49
+ <span
50
+ :class="`${
51
+ currentTab === tabOption.label
52
+ ? 'text-gray-900'
53
+ : 'text-gray-600 group-hover:text-gray-900'
54
+ } `"
55
+ >{{ tabOption.label }}</span
56
+ >
57
+ </span>
58
+ </button>
59
+ </nav>
60
+ </div>
61
+ </template>
62
+
63
+ <script>
64
+ import CIcon from "../CIcon/CIcon.vue";
65
+
66
+ export default {
67
+ name: "CInsetTabs",
68
+ components: {
69
+ CIcon,
70
+ },
71
+ props: {
72
+ currentTab: {
73
+ type: String,
74
+ },
75
+ tabOptions: {
76
+ type: Array,
77
+ },
78
+ },
79
+ };
80
+ </script>
81
+
82
+ <style></style>
package/src/icons.js CHANGED
@@ -334,4 +334,5 @@ export default {
334
334
  "M18 10c0 3.866-3.582 7-8 7a8.841 8.841 0 01-4.083-.98L2 17l1.338-3.123C2.493 12.767 2 11.434 2 10c0-3.866 3.582-7 8-7s8 3.134 8 7zM7 9H5v2h2V9zm8 0h-2v2h2V9zM9 9h2v2H9V9z",
335
335
  "sparkles-solid":
336
336
  "M5 2a1 1 0 011 1v1h1a1 1 0 010 2H6v1a1 1 0 01-2 0V6H3a1 1 0 010-2h1V3a1 1 0 011-1zm0 10a1 1 0 011 1v1h1a1 1 0 110 2H6v1a1 1 0 11-2 0v-1H3a1 1 0 110-2h1v-1a1 1 0 011-1zM12 2a1 1 0 01.967.744L14.146 7.2 17.5 9.134a1 1 0 010 1.732l-3.354 1.935-1.18 4.455a1 1 0 01-1.933 0L9.854 12.8 6.5 10.866a1 1 0 010-1.732l3.354-1.935 1.18-4.455A1 1 0 0112 2z",
337
+ "view-list-outline": "M4 6h16M4 10h16M4 14h16M4 18h16",
337
338
  };
@@ -0,0 +1,38 @@
1
+ import CInsetTabs from "../components/CInsetTabs/CInsetTabs.vue";
2
+
3
+ export default {
4
+ title: "CInsetTabs",
5
+ components: CInsetTabs,
6
+ argTypes: {
7
+ currentTab: String,
8
+ tabOptions: Array,
9
+ },
10
+ };
11
+ const Template = (args, { argTypes }) => ({
12
+ props: Object.keys(argTypes),
13
+ components: { CInsetTabs },
14
+ template: '<c-inset-tabs v-bind="$props" />',
15
+ });
16
+
17
+ export const Default = Template.bind({});
18
+ Default.args = {
19
+ currentTab: "Dates",
20
+ tabOptions: [
21
+ {
22
+ label: "Dates",
23
+ icon: {
24
+ type: "solid",
25
+ name: "calendar-solid",
26
+ viewBox: "0 0 20 20",
27
+ },
28
+ },
29
+ {
30
+ label: "Days",
31
+ icon: {
32
+ type: "solid",
33
+ name: "calendar-solid",
34
+ viewBox: "0 0 20 20",
35
+ },
36
+ },
37
+ ],
38
+ };