@ptlm-azulejo/tabs 0.0.1-alpha.35 → 1.0.0-alpha.211

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/CHANGELOG.md CHANGED
@@ -1,4 +1,20 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ab67607: Ship a self-contained `AzTabs` aligned with Mozaic and current Azulejo patterns: Nuxt UI–style `defaultTabsUi` + `tabsVariants` + `cn()`, shared theme tokens, `@ptlm-azulejo/divider` + `@ptlm-azulejo/number-badge`, `align` / `rounded` props, icon class strings or components, and keyboard-accessible tablist behavior.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [85ee58d]
12
+ - Updated dependencies [66c7a93]
13
+ - Updated dependencies [2d3e3ab]
14
+ - Updated dependencies [1d5fdb1]
15
+ - @ptlm-azulejo/number-badge@0.1.0
16
+ - @ptlm-azulejo/themes@1.4.0
17
+ - @ptlm-azulejo/divider@1.0.0
18
+
3
19
  All notable changes to this project will be documented in this file.
4
20
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Tabs
2
2
 
3
- The `Tabs` component organizes related content into multiple sections, allowing users to switch between views without leaving the current page. Tabs can display labels, icons, and notification badges, making them ideal for dashboards, settings pages, product management, and other interfaces with grouped content.
3
+ The `AzTabs` component organizes related content into multiple sections, allowing users to switch between views without leaving the current page. Tabs can display labels, icons, and notification badges.
4
4
 
5
5
  ## Installation
6
6
 
@@ -10,11 +10,11 @@ npm install @ptlm-azulejo/tabs @ptlm-azulejo/themes
10
10
  yarn add @ptlm-azulejo/tabs @ptlm-azulejo/themes
11
11
  ```
12
12
 
13
+ `@ptlm-azulejo/tabs` depends on `@ptlm-azulejo/divider` and `@ptlm-azulejo/number-badge` (installed automatically).
14
+ `@ptlm-azulejo/themes` is an optional peer — install it so brand tokens resolve at runtime.
13
15
  ## Styles & theming
14
16
 
15
- The component reads theme CSS variables, so it needs `@ptlm-azulejo/themes`. Import a
16
- brand preset (it bundles the base tokens) and the component styles, then set the
17
- brand class on the root element:
17
+ Import a brand preset and the component styles, then set the brand class on the root element:
18
18
 
19
19
  ```js
20
20
  import '@ptlm-azulejo/themes/presets/leroy-merlin.css' // or /presets/adeo.css
@@ -33,136 +33,101 @@ import '@ptlm-azulejo/tabs/style.css'
33
33
 
34
34
  | Name | Type | Default | Description |
35
35
  | --- | --- | --- | --- |
36
- | `tabs` | `Tab[]` | — | Array of tab definitions. Each tab supports `label`, `id`, `icon`, `badge`, and `disabled`. |
37
- | `modelValue` | `string \| number` | `0` | Controls the currently selected tab. When a string is used, it must match a tab's `id`. |
38
- | `description` | `string` | — | Accessible description for the tab list (`aria-label`). |
39
- | `size` | `'s' \| 'm'` | `'m'` | Controls the size of the tabs. |
40
- | `divider` | `boolean` | `true` | Displays a divider below the tabs. |
41
- | `centered` | `boolean` | `false` | Centers the tabs within the available width. |
36
+ | `tabs` | `TabItem[]` | — | Tab definitions. Each item supports `label`, `id`, `icon`, `badge`, and `disabled`. |
37
+ | `modelValue` | `string \| number` | `0` | Active tab (`v-model`). A string must match a tab `id`; a number is an index. |
38
+ | `description` | `string` | — | Accessible name for the tab list (`aria-label`). |
39
+ | `size` | `'s' \| 'm'` | `'m'` | Tab size. |
40
+ | `align` | `'left' \| 'center' \| 'right'` | `'left'` | Horizontal alignment of the tab list. |
41
+ | `rounded` | `'none' \| 's' \| 'm' \| 'l' \| 'full'` | `'m'` | Border radius of each tab button. |
42
+ | `divider` | `boolean` | `true` | Renders a divider below the tab list. |
43
+ | `ui` | `TabsUi` | `{}` | Tailwind class overrides per structural part. Merged via `cn()` (conflicting utilities win). |
42
44
 
43
- ### Tab object
45
+ ### TabItem
44
46
 
45
47
  | Property | Type | Description |
46
48
  | --- | --- | --- |
47
49
  | `label` | `string` | Text displayed in the tab. |
48
- | `id` | `string` | Unique identifier used when `modelValue` is a string. |
49
- | `icon` | `Component` | Optional icon displayed before the label. |
50
- | `badge` | `number` | Optional numeric badge displayed after the label. |
50
+ | `id` | `string` | Unique id used when `modelValue` is a string. |
51
+ | `icon` | `Component \| string` | Optional icon before the label. Use a Vue component, or an Azulejo icon class string (`'az az-ui-home'`). |
52
+ | `badge` | `number` | Optional numeric badge after the label. |
51
53
  | `disabled` | `boolean` | Disables the tab. |
52
54
 
55
+ ### TabsUi parts
56
+
57
+ `root`, `list`, `item`, `tab`, `tabSelected`, `icon`, `label`, `badge`, `divider`
58
+
53
59
  ## Events
54
60
 
55
61
  | Name | Payload | Description |
56
62
  | --- | --- | --- |
57
63
  | `update:modelValue` | `string \| number` | Emitted when the selected tab changes. |
58
64
 
59
- ## Slots
60
-
61
- This component does not expose any slots.
62
-
63
- ## Basic Usage
65
+ ## Basic usage
64
66
 
65
67
  ```vue
66
68
  <script setup>
67
69
  import { ref } from 'vue'
68
70
  import { AzTabs } from '@ptlm-azulejo/tabs'
69
71
 
70
- const selectedTab = ref(0)
71
-
72
+ const selected = ref('overview')
72
73
  const tabs = [
73
- { label: 'Overview' },
74
- { label: 'Orders' },
75
- { label: 'Settings' },
74
+ { id: 'overview', label: 'Overview' },
75
+ { id: 'orders', label: 'Orders' },
76
+ { id: 'settings', label: 'Settings' },
76
77
  ]
77
78
  </script>
78
79
 
79
80
  <template>
80
- <AzTabs
81
- v-model="selectedTab"
82
- :tabs="tabs"
83
- />
81
+ <AzTabs v-model="selected" :tabs="tabs" description="Product sections" />
84
82
  </template>
85
83
  ```
86
84
 
87
- ## Using string identifiers
85
+ ## Index-based model
88
86
 
89
87
  ```vue
90
88
  <script setup>
91
89
  import { ref } from 'vue'
90
+ import { AzTabs } from '@ptlm-azulejo/tabs'
92
91
 
93
- const selectedTab = ref('orders')
94
-
92
+ const selected = ref(0)
95
93
  const tabs = [
96
- { id: 'overview', label: 'Overview' },
97
- { id: 'orders', label: 'Orders' },
98
- { id: 'settings', label: 'Settings' },
94
+ { label: 'Overview' },
95
+ { label: 'Orders' },
96
+ { label: 'Settings' },
99
97
  ]
100
98
  </script>
101
99
 
102
100
  <template>
103
- <AzTabs
104
- v-model="selectedTab"
105
- :tabs="tabs"
106
- />
101
+ <AzTabs v-model="selected" :tabs="tabs" />
107
102
  </template>
108
103
  ```
109
104
 
110
- ## Tabs with icons and badges
105
+ ## Icons, badges, and alignment
111
106
 
112
107
  ```vue
113
108
  <script setup>
114
109
  import { ref } from 'vue'
115
110
  import { AzTabs } from '@ptlm-azulejo/tabs'
116
- import { HomeIcon, BellIcon } from '@mozaic-ds/icons-vue'
117
-
118
- const selectedTab = ref(0)
111
+ import '@ptlm-azulejo/icons/style.css'
119
112
 
113
+ const selected = ref('home')
120
114
  const tabs = [
121
- {
122
- label: 'Home',
123
- icon: HomeIcon,
124
- },
125
- {
126
- label: 'Notifications',
127
- icon: BellIcon,
128
- badge: 8,
129
- },
130
- {
131
- label: 'Disabled',
132
- disabled: true,
133
- },
115
+ { id: 'home', label: 'Home', icon: 'az az-ui-home' },
116
+ { id: 'alerts', label: 'Alerts', icon: 'az az-ui-notification', badge: 8 },
117
+ { id: 'settings', label: 'Settings', icon: 'az az-ui-settings', disabled: true },
134
118
  ]
135
119
  </script>
136
120
 
137
121
  <template>
138
- <AzTabs
139
- v-model="selectedTab"
140
- :tabs="tabs"
141
- />
122
+ <AzTabs v-model="selected" :tabs="tabs" align="center" rounded="m" />
142
123
  </template>
143
124
  ```
144
125
 
145
- ## Centered tabs
146
-
147
- ```vue
148
- <template>
149
- <AzTabs
150
- centered
151
- :tabs="[
152
- { label: 'Products' },
153
- { label: 'Services' },
154
- { label: 'Support' },
155
- ]"
156
- />
157
- </template>
158
- ```
126
+ `align` accepts `left` (default), `center`, or `right`.
127
+ `rounded` accepts `none`, `s`, `m` (default), `l`, or `full`.
159
128
 
160
129
  ## Accessibility
161
130
 
162
- - Uses the WAI-ARIA `tablist` and `tab` roles.
163
- - Supports keyboard navigation using:
164
- - `ArrowLeft` / `ArrowRight` to move between enabled tabs.
165
- - `Home` to focus the first enabled tab.
166
- - `End` to focus the last enabled tab.
167
- - Disabled tabs are skipped during keyboard navigation.
168
- - Use the `description` prop to provide an accessible label for the tab list.
131
+ - Uses WAI-ARIA `tablist` / `tab` roles.
132
+ - Keyboard: `ArrowLeft` / `ArrowRight`, `Home`, `End` (skips disabled tabs).
133
+ - Use `description` to label the tab list for assistive tech.
package/dist/index.js CHANGED
@@ -1,113 +1,245 @@
1
- import { defineComponent as C, computed as d, useTemplateRef as D, openBlock as u, createElementBlock as c, normalizeClass as z, createElementVNode as b, Fragment as B, renderList as I, createBlock as h, resolveDynamicComponent as E, createCommentVNode as p, toDisplayString as N, createVNode as R, unref as V, nextTick as K } from "vue";
2
- import { AzDivider as L } from "@ptlm-azulejo/divider";
3
- import { AzNumberBadge as O } from "@ptlm-azulejo/number-badge";
4
- const $ = ["aria-label"], H = ["aria-selected", "aria-disabled", "disabled", "tabindex", "onClick", "onKeydown"], S = { class: "az-tabs__label" }, j = {
5
- key: 1,
6
- class: "az-tabs__badge"
7
- }, F = /* @__PURE__ */ C({
1
+ import { Fragment as M, computed as p, createBlock as R, createCommentVNode as j, createElementBlock as x, createElementVNode as C, createVNode as F, defineComponent as O, normalizeClass as u, openBlock as g, ref as P, renderList as U, resolveDynamicComponent as q, toDisplayString as G, toRef as A, unref as h } from "vue";
2
+ import { AzDivider as J } from "@ptlm-azulejo/divider";
3
+ import { AzNumberBadge as Q } from "@ptlm-azulejo/number-badge";
4
+ import "@ptlm-azulejo/divider/style.css";
5
+ import "@ptlm-azulejo/number-badge/style.css";
6
+ import { clsx as W } from "clsx";
7
+ import { extendTailwindMerge as X } from "tailwind-merge";
8
+ var Y = X({ extend: { theme: {
9
+ color: [
10
+ "accent",
11
+ "on-accent",
12
+ "accent-hover",
13
+ "accent-subtle",
14
+ "accent-subtle-hover",
15
+ "accent-strong",
16
+ "accent-strong-hover",
17
+ "fg",
18
+ "fg-accent",
19
+ "surface",
20
+ "surface-muted",
21
+ "edge",
22
+ "danger",
23
+ "danger-hover"
24
+ ],
25
+ radius: ["btn"]
26
+ } } });
27
+ function f(...a) {
28
+ return Y(W(a));
29
+ }
30
+ function B(a, y, r) {
31
+ var i;
32
+ return typeof r == "string" ? (i = y.id) !== null && i !== void 0 ? i : String(a) : a;
33
+ }
34
+ function Z(a) {
35
+ function y(e, t) {
36
+ const o = B(e, t, a.modelValue.value);
37
+ return a.modelValue.value === o;
38
+ }
39
+ function r() {
40
+ const e = a.modelValue.value, t = a.tabs.value;
41
+ return typeof e == "string" ? t.findIndex((o) => o.id === e) : typeof e == "number" && e >= 0 && e < t.length ? e : -1;
42
+ }
43
+ function i() {
44
+ return a.tabs.value.map((e, t) => t).filter((e) => {
45
+ var t;
46
+ return !(!((t = a.tabs.value[e]) === null || t === void 0) && t.disabled);
47
+ });
48
+ }
49
+ function n() {
50
+ const e = i();
51
+ if (e.length === 0)
52
+ return -1;
53
+ const t = r();
54
+ return e.includes(t) ? t : e[0];
55
+ }
56
+ function z(e) {
57
+ const t = n();
58
+ return t < 0 ? -1 : e === t ? 0 : -1;
59
+ }
60
+ function k(e) {
61
+ const t = a.tabs.value[e];
62
+ if (!t || t.disabled)
63
+ return;
64
+ const o = B(e, t, a.modelValue.value);
65
+ o !== a.modelValue.value && a.onSelect(o);
66
+ }
67
+ function I(e, t) {
68
+ var o;
69
+ if (e.key !== "ArrowRight" && e.key !== "ArrowLeft" && e.key !== "Home" && e.key !== "End")
70
+ return;
71
+ const d = i();
72
+ if (d.length === 0)
73
+ return;
74
+ const m = d.indexOf(t);
75
+ let b = null;
76
+ if (e.key === "ArrowRight") {
77
+ if (e.preventDefault(), m < 0)
78
+ return;
79
+ b = (m + 1) % d.length;
80
+ } else if (e.key === "ArrowLeft") {
81
+ if (e.preventDefault(), m < 0)
82
+ return;
83
+ b = (m - 1 + d.length) % d.length;
84
+ } else
85
+ e.key === "Home" ? (e.preventDefault(), b = 0) : e.key === "End" && (e.preventDefault(), b = d.length - 1);
86
+ if (b === null)
87
+ return;
88
+ const w = d[b];
89
+ k(w), (o = a.focusIndex) === null || o === void 0 || o.call(a, w);
90
+ }
91
+ function _(e) {
92
+ return String(e);
93
+ }
94
+ return {
95
+ isSelected: y,
96
+ getTabIndex: z,
97
+ select: k,
98
+ onKeydown: I,
99
+ formatBadge: _
100
+ };
101
+ }
102
+ var ee = ["aria-label"], te = [
103
+ "aria-selected",
104
+ "aria-disabled",
105
+ "disabled",
106
+ "tabindex",
107
+ "onClick",
108
+ "onKeydown"
109
+ ], ae = /* @__PURE__ */ O({
8
110
  __name: "index",
9
111
  props: {
10
112
  description: {},
11
113
  size: { default: "m" },
12
- divider: { type: Boolean, default: !0 },
13
- centered: { type: Boolean },
114
+ divider: {
115
+ type: Boolean,
116
+ default: !0
117
+ },
118
+ align: { default: "left" },
119
+ rounded: { default: "m" },
14
120
  modelValue: { default: 0 },
15
- tabs: {}
121
+ tabs: {},
122
+ ui: { default: () => ({}) }
16
123
  },
17
124
  emits: ["update:modelValue"],
18
- setup(i, { emit: f }) {
19
- const a = i, m = d(() => ({
20
- "az-tabs--centered": a.centered,
21
- [`az-tabs--${a.size}`]: a.size !== "m"
22
- })), s = d({
23
- get() {
24
- return a.modelValue;
125
+ setup(a, { emit: y }) {
126
+ const r = {
127
+ root: "relative w-full bg-[color:var(--color-background-primary)] font-sans",
128
+ list: [
129
+ "relative z-[1] m-0 flex list-none overflow-x-auto p-0",
130
+ "gap-[length:var(--spacing-100)]",
131
+ "px-[calc(var(--spacing)*0.5)]",
132
+ "overflow-y-hidden [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
133
+ "md:overflow-hidden"
134
+ ].join(" "),
135
+ item: "",
136
+ tab: [
137
+ "group relative flex cursor-pointer items-center justify-center border-none bg-transparent no-underline outline-none font-sans",
138
+ "text-[color:var(--color-text-tertiary)] gap-[calc(var(--spacing)*0.5)]",
139
+ "hover:not-disabled:bg-[color-mix(in_srgb,var(--color-text-primary)_5%,transparent)]",
140
+ "focus-visible:outline focus-visible:outline-[length:var(--border-m)] focus-visible:outline-[color:var(--color-text-accent)] focus-visible:outline-offset-[length:var(--border-m)]",
141
+ "disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent"
142
+ ].join(" "),
143
+ tabSelected: [
144
+ "font-semibold text-[color:var(--color-text-accent)]",
145
+ "bg-[color:var(--color-background-accent)]",
146
+ "hover:not-disabled:bg-[color-mix(in_srgb,var(--color-background-accent)_88%,#000)]"
147
+ ].join(" "),
148
+ icon: ["inline-flex size-[1em] shrink-0 items-center justify-center leading-none text-current", "[&_svg]:block [&_svg]:size-full"].join(" "),
149
+ label: "pointer-events-none whitespace-nowrap",
150
+ badge: "inline-flex shrink-0 items-center",
151
+ divider: "mt-[length:var(--spacing-100)] w-full leading-none"
152
+ }, i = {
153
+ size: {
154
+ s: {
155
+ tab: "text-sm h-8 px-3",
156
+ icon: "text-[length:calc(var(--spacing)*1.25)]"
157
+ },
158
+ m: {
159
+ tab: "text-base h-10 px-4",
160
+ icon: "text-[length:var(--spacing-300)]"
161
+ }
162
+ },
163
+ align: {
164
+ left: { list: "justify-start" },
165
+ center: { list: "justify-center" },
166
+ right: { list: "justify-end" }
25
167
  },
26
- set(e) {
27
- A("update:modelValue", e);
168
+ rounded: {
169
+ none: { tab: "rounded-none" },
170
+ s: { tab: "rounded-[length:var(--border-radius-s)]" },
171
+ m: { tab: "rounded-[length:var(--border-radius-m)]" },
172
+ l: { tab: "rounded-[length:var(--border-radius-l)]" },
173
+ full: { tab: "rounded-full" }
28
174
  }
29
- }), n = d(() => a.tabs.map((e, r) => r).filter((e) => !a.tabs[e].disabled)), _ = d(() => typeof s.value == "string" ? a.tabs.findIndex((e) => e.id === s.value) : typeof s.value == "number" && s.value >= 0 && s.value < a.tabs.length ? s.value : -1), x = d(() => n.value.length === 0 ? -1 : n.value.includes(_.value) ? _.value : n.value[0]), T = D("tab"), v = (e, r) => {
30
- const t = typeof a.modelValue == "string" ? a.tabs.find((o) => o.id === r) : a.tabs[e], l = typeof a.modelValue == "string" ? r : e;
31
- t != null && t.disabled || l !== s.value && (s.value = l);
32
- }, y = (e, r) => {
33
- const t = typeof a.modelValue == "string" ? r : e;
34
- return s.value === t;
35
- };
36
- function w(e, r) {
37
- if (e.key !== "ArrowRight" && e.key !== "ArrowLeft" && e.key !== "Home" && e.key !== "End" || n.value.length === 0)
38
- return;
39
- const t = n.value.indexOf(r);
40
- let l = null;
41
- if (e.key === "ArrowRight") {
42
- if (e.preventDefault(), t < 0) return;
43
- l = (t + 1) % n.value.length;
44
- } else if (e.key === "ArrowLeft") {
45
- if (e.preventDefault(), t < 0) return;
46
- l = (t - 1 + n.value.length) % n.value.length;
47
- } else e.key === "Home" ? (e.preventDefault(), l = 0) : e.key === "End" && (e.preventDefault(), l = n.value.length - 1);
48
- if (l !== null) {
49
- const o = n.value[l];
50
- v(o, a.tabs[o].id), K(() => {
51
- var g, k;
52
- (k = (g = T.value) == null ? void 0 : g[o]) == null || k.focus();
53
- });
175
+ }, n = a, z = y, k = A(n, "tabs"), I = A(n, "modelValue"), _ = P([]), e = (l, c) => {
176
+ _.value[c] = l;
177
+ }, { isSelected: t, getTabIndex: o, select: d, onKeydown: m } = Z({
178
+ tabs: k,
179
+ modelValue: I,
180
+ onSelect: (l) => z("update:modelValue", l),
181
+ focusIndex: (l) => {
182
+ var c;
183
+ return (c = _.value[l]) === null || c === void 0 ? void 0 : c.focus();
54
184
  }
55
- }
56
- const A = f;
57
- return (e, r) => (u(), c("nav", {
58
- class: z(["az-tabs", m.value])
59
- }, [
60
- b("ul", {
61
- role: "tablist",
62
- class: "az-tabs__list",
63
- "aria-label": i.description
185
+ }), b = p(() => f(r.root, n.ui.root)), w = p(() => f(r.list, i.align[n.align].list, n.ui.list)), D = (l, c) => f(r.tab, i.size[n.size].tab, i.rounded[n.rounded].tab, n.ui.tab, t(l, c) && r.tabSelected, t(l, c) && n.ui.tabSelected), $ = (l) => f(r.icon, i.size[n.size].icon, l, n.ui.icon), T = p(() => f(r.label, n.ui.label)), E = p(() => f(r.badge, n.ui.badge)), K = p(() => f(r.divider, n.ui.divider)), N = p(() => f(r.item, n.ui.item)), L = (l) => typeof l == "number", H = (l) => typeof l == "string";
186
+ return (l, c) => (g(), x("nav", {
187
+ "data-testid": "tabs",
188
+ class: u(b.value)
189
+ }, [C("ul", {
190
+ role: "tablist",
191
+ "data-testid": "tabs-list",
192
+ class: u(w.value),
193
+ "aria-label": a.description
194
+ }, [(g(!0), x(M, null, U(a.tabs, (s, v) => {
195
+ var S;
196
+ return g(), x("li", {
197
+ key: (S = s.id) !== null && S !== void 0 ? S : v,
198
+ role: "presentation",
199
+ "data-testid": "tabs-item",
200
+ class: u(N.value)
201
+ }, [C("button", {
202
+ ref_for: !0,
203
+ ref: (V) => e(V, v),
204
+ type: "button",
205
+ role: "tab",
206
+ "data-testid": "tabs-tab",
207
+ class: u(D(v, s)),
208
+ "aria-selected": h(t)(v, s),
209
+ "aria-disabled": s.disabled || void 0,
210
+ disabled: s.disabled,
211
+ tabindex: h(o)(v),
212
+ onClick: (V) => h(d)(v),
213
+ onKeydown: (V) => h(m)(V, v)
64
214
  }, [
65
- (u(!0), c(B, null, I(i.tabs, (t, l) => (u(), c("li", {
66
- key: `tab-${l}`,
67
- role: "presentation",
68
- class: "az-tabs__item"
69
- }, [
70
- b("button", {
71
- ref_for: !0,
72
- ref: "tab",
73
- role: "tab",
74
- class: z(["az-tabs__tab", {
75
- "az-tabs__tab--selected": y(l, t.id),
76
- "az-tabs__tab--disabled": t.disabled
77
- }]),
78
- "aria-selected": y(l, t.id),
79
- "aria-disabled": t.disabled || void 0,
80
- disabled: t.disabled,
81
- tabindex: l === x.value ? 0 : -1,
82
- type: "button",
83
- onClick: (o) => v(l, t.id),
84
- onKeydown: (o) => w(o, l)
85
- }, [
86
- t.icon ? (u(), h(E(t.icon), {
87
- key: 0,
88
- class: "az-tabs__icon",
89
- "aria-hidden": "true"
90
- })) : p("", !0),
91
- b("div", S, [
92
- b("span", null, N(t.label), 1)
93
- ]),
94
- t.badge ? (u(), c("span", j, [
95
- R(V(O), {
96
- label: t.badge
97
- }, null, 8, ["label"])
98
- ])) : p("", !0)
99
- ], 42, H)
100
- ]))), 128))
101
- ], 8, $),
102
- i.divider ? (u(), h(V(L), { key: 0 })) : p("", !0)
103
- ], 2));
215
+ H(s.icon) ? (g(), x("i", {
216
+ key: 0,
217
+ "data-testid": "tabs-icon",
218
+ class: u($(s.icon)),
219
+ "aria-hidden": "true"
220
+ }, null, 2)) : s.icon ? (g(), R(q(s.icon), {
221
+ key: 1,
222
+ "data-testid": "tabs-icon",
223
+ class: u($()),
224
+ "aria-hidden": "true"
225
+ }, null, 8, ["class"])) : j("", !0),
226
+ C("div", {
227
+ "data-testid": "tabs-label",
228
+ class: u(T.value)
229
+ }, [C("span", null, G(s.label), 1)], 2),
230
+ L(s.badge) ? (g(), x("span", {
231
+ key: 2,
232
+ "data-testid": "tabs-badge",
233
+ class: u(E.value)
234
+ }, [F(h(Q), { label: s.badge }, null, 8, ["label"])], 2)) : j("", !0)
235
+ ], 42, te)], 2);
236
+ }), 128))], 10, ee), a.divider ? (g(), R(h(J), {
237
+ key: 0,
238
+ "data-testid": "tabs-divider",
239
+ class: u(K.value)
240
+ }, null, 8, ["class"])) : j("", !0)], 2));
104
241
  }
105
- }), P = (i, f) => {
106
- const a = i.__vccOpts || i;
107
- for (const [m, s] of f)
108
- a[m] = s;
109
- return a;
110
- }, M = /* @__PURE__ */ P(F, [["__scopeId", "data-v-91787911"]]);
242
+ }), ce = ae;
111
243
  export {
112
- M as AzTabs
244
+ ce as AzTabs
113
245
  };
@@ -1 +1 @@
1
- (function(s,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("@ptlm-azulejo/divider"),require("@ptlm-azulejo/number-badge")):typeof define=="function"&&define.amd?define(["exports","vue","@ptlm-azulejo/divider","@ptlm-azulejo/number-badge"],e):(s=typeof globalThis!="undefined"?globalThis:s||self,e(s.tabs={},s.Vue,s.divider,s["number-badge"]))})(this,function(s,e,k,g){"use strict";const z=["aria-label"],h=["aria-selected","aria-disabled","disabled","tabindex","onClick","onKeydown"],V={class:"az-tabs__label"},B={key:1,class:"az-tabs__badge"},x=((c,u)=>{const l=c.__vccOpts||c;for(const[f,o]of u)l[f]=o;return l})(e.defineComponent({__name:"index",props:{description:{},size:{default:"m"},divider:{type:Boolean,default:!0},centered:{type:Boolean},modelValue:{default:0},tabs:{}},emits:["update:modelValue"],setup(c,{emit:u}){const l=c,f=e.computed(()=>({"az-tabs--centered":l.centered,[`az-tabs--${l.size}`]:l.size!=="m"})),o=e.computed({get(){return l.modelValue},set(t){N("update:modelValue",t)}}),r=e.computed(()=>l.tabs.map((t,i)=>i).filter(t=>!l.tabs[t].disabled)),b=e.computed(()=>typeof o.value=="string"?l.tabs.findIndex(t=>t.id===o.value):typeof o.value=="number"&&o.value>=0&&o.value<l.tabs.length?o.value:-1),T=e.computed(()=>r.value.length===0?-1:r.value.includes(b.value)?b.value:r.value[0]),C=e.useTemplateRef("tab"),m=(t,i)=>{const a=typeof l.modelValue=="string"?l.tabs.find(d=>d.id===i):l.tabs[t],n=typeof l.modelValue=="string"?i:t;a!=null&&a.disabled||n!==o.value&&(o.value=n)},p=(t,i)=>{const a=typeof l.modelValue=="string"?i:t;return o.value===a};function E(t,i){if(t.key!=="ArrowRight"&&t.key!=="ArrowLeft"&&t.key!=="Home"&&t.key!=="End"||r.value.length===0)return;const a=r.value.indexOf(i);let n=null;if(t.key==="ArrowRight"){if(t.preventDefault(),a<0)return;n=(a+1)%r.value.length}else if(t.key==="ArrowLeft"){if(t.preventDefault(),a<0)return;n=(a-1+r.value.length)%r.value.length}else t.key==="Home"?(t.preventDefault(),n=0):t.key==="End"&&(t.preventDefault(),n=r.value.length-1);if(n!==null){const d=r.value[n];m(d,l.tabs[d].id),e.nextTick(()=>{var _,y;(y=(_=C.value)==null?void 0:_[d])==null||y.focus()})}}const N=u;return(t,i)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(["az-tabs",f.value])},[e.createElementVNode("ul",{role:"tablist",class:"az-tabs__list","aria-label":c.description},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.tabs,(a,n)=>(e.openBlock(),e.createElementBlock("li",{key:`tab-${n}`,role:"presentation",class:"az-tabs__item"},[e.createElementVNode("button",{ref_for:!0,ref:"tab",role:"tab",class:e.normalizeClass(["az-tabs__tab",{"az-tabs__tab--selected":p(n,a.id),"az-tabs__tab--disabled":a.disabled}]),"aria-selected":p(n,a.id),"aria-disabled":a.disabled||void 0,disabled:a.disabled,tabindex:n===T.value?0:-1,type:"button",onClick:d=>m(n,a.id),onKeydown:d=>E(d,n)},[a.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.icon),{key:0,class:"az-tabs__icon","aria-hidden":"true"})):e.createCommentVNode("",!0),e.createElementVNode("div",V,[e.createElementVNode("span",null,e.toDisplayString(a.label),1)]),a.badge?(e.openBlock(),e.createElementBlock("span",B,[e.createVNode(e.unref(g.AzNumberBadge),{label:a.badge},null,8,["label"])])):e.createCommentVNode("",!0)],42,h)]))),128))],8,z),c.divider?(e.openBlock(),e.createBlock(e.unref(k.AzDivider),{key:0})):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-91787911"]]);s.AzTabs=x,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
1
+ (function(o,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("@ptlm-azulejo/divider"),require("@ptlm-azulejo/number-badge"),require("@ptlm-azulejo/divider/style.css"),require("@ptlm-azulejo/number-badge/style.css"),require("clsx"),require("tailwind-merge")):typeof define=="function"&&define.amd?define(["exports","vue","@ptlm-azulejo/divider","@ptlm-azulejo/number-badge","@ptlm-azulejo/divider/style.css","@ptlm-azulejo/number-badge/style.css","clsx","tailwind-merge"],e):(o=typeof globalThis!="undefined"?globalThis:o||self,e(o.tabs={},o.Vue,o.divider,o["number-badge"],o.divider,o["number-badge"],o.clsx,o["tailwind-merge"]))})(this,function(o,e,j,B,P,F,I,S){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});var E=(0,S.extendTailwindMerge)({extend:{theme:{color:["accent","on-accent","accent-hover","accent-subtle","accent-subtle-hover","accent-strong","accent-strong-hover","fg","fg-accent","surface","surface-muted","edge","danger","danger-hover"],radius:["btn"]}}});function f(...l){return E((0,I.clsx)(l))}function w(l,y,s){var c;return typeof s=="string"?(c=y.id)!==null&&c!==void 0?c:String(l):l}function T(l){function y(t,n){const i=w(t,n,l.modelValue.value);return l.modelValue.value===i}function s(){const t=l.modelValue.value,n=l.tabs.value;return typeof t=="string"?n.findIndex(i=>i.id===t):typeof t=="number"&&t>=0&&t<n.length?t:-1}function c(){return l.tabs.value.map((t,n)=>n).filter(t=>{var n;return!(!((n=l.tabs.value[t])===null||n===void 0)&&n.disabled)})}function a(){const t=c();if(t.length===0)return-1;const n=s();return t.includes(n)?n:t[0]}function _(t){const n=a();return n<0?-1:t===n?0:-1}function v(t){const n=l.tabs.value[t];if(!n||n.disabled)return;const i=w(t,n,l.modelValue.value);i!==l.modelValue.value&&l.onSelect(i)}function z(t,n){var i;if(t.key!=="ArrowRight"&&t.key!=="ArrowLeft"&&t.key!=="Home"&&t.key!=="End")return;const u=c();if(u.length===0)return;const p=u.indexOf(n);let m=null;if(t.key==="ArrowRight"){if(t.preventDefault(),p<0)return;m=(p+1)%u.length}else if(t.key==="ArrowLeft"){if(t.preventDefault(),p<0)return;m=(p-1+u.length)%u.length}else t.key==="Home"?(t.preventDefault(),m=0):t.key==="End"&&(t.preventDefault(),m=u.length-1);if(m===null)return;const x=u[m];v(x),(i=l.focusIndex)===null||i===void 0||i.call(l,x)}function h(t){return String(t)}return{isSelected:y,getTabIndex:_,select:v,onKeydown:z,formatBadge:h}}var N=["aria-label"],R=["aria-selected","aria-disabled","disabled","tabindex","onClick","onKeydown"],$=(0,e.defineComponent)({__name:"index",props:{description:{},size:{default:"m"},divider:{type:Boolean,default:!0},align:{default:"left"},rounded:{default:"m"},modelValue:{default:0},tabs:{},ui:{default:()=>({})}},emits:["update:modelValue"],setup(l,{emit:y}){const s={root:"relative w-full bg-[color:var(--color-background-primary)] font-sans",list:["relative z-[1] m-0 flex list-none overflow-x-auto p-0","gap-[length:var(--spacing-100)]","px-[calc(var(--spacing)*0.5)]","overflow-y-hidden [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden","md:overflow-hidden"].join(" "),item:"",tab:["group relative flex cursor-pointer items-center justify-center border-none bg-transparent no-underline outline-none font-sans","text-[color:var(--color-text-tertiary)] gap-[calc(var(--spacing)*0.5)]","hover:not-disabled:bg-[color-mix(in_srgb,var(--color-text-primary)_5%,transparent)]","focus-visible:outline focus-visible:outline-[length:var(--border-m)] focus-visible:outline-[color:var(--color-text-accent)] focus-visible:outline-offset-[length:var(--border-m)]","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent"].join(" "),tabSelected:["font-semibold text-[color:var(--color-text-accent)]","bg-[color:var(--color-background-accent)]","hover:not-disabled:bg-[color-mix(in_srgb,var(--color-background-accent)_88%,#000)]"].join(" "),icon:["inline-flex size-[1em] shrink-0 items-center justify-center leading-none text-current","[&_svg]:block [&_svg]:size-full"].join(" "),label:"pointer-events-none whitespace-nowrap",badge:"inline-flex shrink-0 items-center",divider:"mt-[length:var(--spacing-100)] w-full leading-none"},c={size:{s:{tab:"text-sm h-8 px-3",icon:"text-[length:calc(var(--spacing)*1.25)]"},m:{tab:"text-base h-10 px-4",icon:"text-[length:var(--spacing-300)]"}},align:{left:{list:"justify-start"},center:{list:"justify-center"},right:{list:"justify-end"}},rounded:{none:{tab:"rounded-none"},s:{tab:"rounded-[length:var(--border-radius-s)]"},m:{tab:"rounded-[length:var(--border-radius-m)]"},l:{tab:"rounded-[length:var(--border-radius-l)]"},full:{tab:"rounded-full"}}},a=l,_=y,v=(0,e.toRef)(a,"tabs"),z=(0,e.toRef)(a,"modelValue"),h=(0,e.ref)([]),t=(r,b)=>{h.value[b]=r},{isSelected:n,getTabIndex:i,select:u,onKeydown:p}=T({tabs:v,modelValue:z,onSelect:r=>_("update:modelValue",r),focusIndex:r=>{var b;return(b=h.value[r])===null||b===void 0?void 0:b.focus()}}),m=(0,e.computed)(()=>f(s.root,a.ui.root)),x=(0,e.computed)(()=>f(s.list,c.align[a.align].list,a.ui.list)),A=(r,b)=>f(s.tab,c.size[a.size].tab,c.rounded[a.rounded].tab,a.ui.tab,n(r,b)&&s.tabSelected,n(r,b)&&a.ui.tabSelected),V=r=>f(s.icon,c.size[a.size].icon,r,a.ui.icon),D=(0,e.computed)(()=>f(s.label,a.ui.label)),K=(0,e.computed)(()=>f(s.badge,a.ui.badge)),L=(0,e.computed)(()=>f(s.divider,a.ui.divider)),M=(0,e.computed)(()=>f(s.item,a.ui.item)),H=r=>typeof r=="number",O=r=>typeof r=="string";return(r,b)=>((0,e.openBlock)(),(0,e.createElementBlock)("nav",{"data-testid":"tabs",class:(0,e.normalizeClass)(m.value)},[(0,e.createElementVNode)("ul",{role:"tablist","data-testid":"tabs-list",class:(0,e.normalizeClass)(x.value),"aria-label":l.description},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(l.tabs,(d,g)=>{var C;return(0,e.openBlock)(),(0,e.createElementBlock)("li",{key:(C=d.id)!==null&&C!==void 0?C:g,role:"presentation","data-testid":"tabs-item",class:(0,e.normalizeClass)(M.value)},[(0,e.createElementVNode)("button",{ref_for:!0,ref:k=>t(k,g),type:"button",role:"tab","data-testid":"tabs-tab",class:(0,e.normalizeClass)(A(g,d)),"aria-selected":(0,e.unref)(n)(g,d),"aria-disabled":d.disabled||void 0,disabled:d.disabled,tabindex:(0,e.unref)(i)(g),onClick:k=>(0,e.unref)(u)(g),onKeydown:k=>(0,e.unref)(p)(k,g)},[O(d.icon)?((0,e.openBlock)(),(0,e.createElementBlock)("i",{key:0,"data-testid":"tabs-icon",class:(0,e.normalizeClass)(V(d.icon)),"aria-hidden":"true"},null,2)):d.icon?((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(d.icon),{key:1,"data-testid":"tabs-icon",class:(0,e.normalizeClass)(V()),"aria-hidden":"true"},null,8,["class"])):(0,e.createCommentVNode)("",!0),(0,e.createElementVNode)("div",{"data-testid":"tabs-label",class:(0,e.normalizeClass)(D.value)},[(0,e.createElementVNode)("span",null,(0,e.toDisplayString)(d.label),1)],2),H(d.badge)?((0,e.openBlock)(),(0,e.createElementBlock)("span",{key:2,"data-testid":"tabs-badge",class:(0,e.normalizeClass)(K.value)},[(0,e.createVNode)((0,e.unref)(B.AzNumberBadge),{label:d.badge},null,8,["label"])],2)):(0,e.createCommentVNode)("",!0)],42,R)],2)}),128))],10,N),l.divider?((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(j.AzDivider),{key:0,"data-testid":"tabs-divider",class:(0,e.normalizeClass)(L.value)},null,8,["class"])):(0,e.createCommentVNode)("",!0)],2))}}),q=$;o.AzTabs=q});
@@ -0,0 +1,3 @@
1
+ export { default as AzTabs } from './src/index.vue';
2
+ export type { TabItem, TabsSize, TabsAlign, TabsRounded, TabsModelValue, TabsUi, } from './src/types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACnD,YAAY,EACV,OAAO,EACP,QAAQ,EACR,SAAS,EACT,WAAW,EACX,cAAc,EACd,MAAM,GACP,MAAM,aAAa,CAAA"}
@@ -0,0 +1,54 @@
1
+ import { TabItem, TabsAlign, TabsModelValue, TabsRounded, TabsSize, TabsUi } from './types';
2
+ type __VLS_Props = {
3
+ /**
4
+ * Accessible name for the tab list (`aria-label`).
5
+ */
6
+ description?: string;
7
+ /**
8
+ * Size of the tabs. `m` is the default Mozaic medium size.
9
+ */
10
+ size?: TabsSize;
11
+ /**
12
+ * When true, a divider is rendered below the tab list.
13
+ */
14
+ divider?: boolean;
15
+ /**
16
+ * Horizontal alignment of the tab list: `left`, `center`, or `right`.
17
+ */
18
+ align?: TabsAlign;
19
+ /**
20
+ * Border radius of each tab button.
21
+ * Maps to theme tokens: `s` / `m` / `l`, plus `none` and `full`. Defaults to `m`.
22
+ */
23
+ rounded?: TabsRounded;
24
+ /**
25
+ * Currently active tab (`v-model`).
26
+ * - `number` — index of the tab
27
+ * - `string` — must match a tab `id`
28
+ */
29
+ modelValue?: TabsModelValue;
30
+ /**
31
+ * Tab definitions used to render the tab list.
32
+ */
33
+ tabs: TabItem[];
34
+ /**
35
+ * Tailwind class overrides per structural part.
36
+ * Merged with `defaultTabsUi` via `cn()` — conflicting utilities win.
37
+ */
38
+ ui?: TabsUi;
39
+ };
40
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
41
+ "update:modelValue": (value?: TabsModelValue | undefined) => any;
42
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
43
+ "onUpdate:modelValue"?: ((value?: TabsModelValue | undefined) => any) | undefined;
44
+ }>, {
45
+ rounded: TabsRounded;
46
+ size: TabsSize;
47
+ divider: boolean;
48
+ align: TabsAlign;
49
+ modelValue: TabsModelValue;
50
+ ui: TabsUi;
51
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
52
+ declare const _default: typeof __VLS_export;
53
+ export default _default;
54
+ //# sourceMappingURL=index.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../src/index.vue"],"names":[],"mappings":"AAiQA,OAAO,iCAAiC,CAAA;AACxC,OAAO,sCAAsC,CAAA;AAG7C,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAkEhG,KAAK,WAAW,GAAG;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,cAAc,CAAA;IAC3B;;OAEG;IACH,IAAI,EAAE,OAAO,EAAE,CAAA;IACf;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ,CAAC;AA4NJ,QAAA,MAAM,YAAY;;;;;aA5OJ,WAAW;UAbd,QAAQ;aAIL,OAAO;WAIT,SAAS;gBAWJ,cAAc;QAStB,MAAM;6EAiOb,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,46 @@
1
+ import { Component } from 'vue';
2
+ export interface TabItem {
3
+ /**
4
+ * Unique identifier for the tab. Required when `modelValue` is a string.
5
+ */
6
+ id?: string;
7
+ /**
8
+ * Icon rendered before the label.
9
+ * Pass a Vue component, or an Azulejo icon class string (e.g. `'az az-ui-home'`).
10
+ */
11
+ icon?: Component | string;
12
+ /**
13
+ * Numeric notification badge shown after the label.
14
+ */
15
+ badge?: number;
16
+ /**
17
+ * Visible tab label.
18
+ */
19
+ label: string;
20
+ /**
21
+ * When true, the tab cannot be selected.
22
+ */
23
+ disabled?: boolean;
24
+ }
25
+ export type TabsSize = 's' | 'm';
26
+ /**
27
+ * Horizontal alignment of the tab list within the available width.
28
+ */
29
+ export type TabsAlign = 'left' | 'center' | 'right';
30
+ /**
31
+ * Border radius of each tab button, mapped to theme `--border-radius-*` tokens.
32
+ */
33
+ export type TabsRounded = 'none' | 's' | 'm' | 'l' | 'full';
34
+ export type TabsModelValue = string | number;
35
+ export interface TabsUi {
36
+ root?: string;
37
+ list?: string;
38
+ item?: string;
39
+ tab?: string;
40
+ tabSelected?: string;
41
+ icon?: string;
42
+ label?: string;
43
+ badge?: string;
44
+ divider?: string;
45
+ }
46
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;IACzB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,MAAM,QAAQ,GAAG,GAAG,GAAG,GAAG,CAAA;AAEhC;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;AAEnD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM,CAAA;AAE3D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,CAAA;AAE5C,MAAM,WAAW,MAAM;IACrB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB"}
@@ -0,0 +1,15 @@
1
+ import { Ref } from 'vue';
2
+ import { TabItem, TabsModelValue } from './types';
3
+ export declare function useTabs(options: {
4
+ tabs: Ref<TabItem[]>;
5
+ modelValue: Ref<TabsModelValue | undefined>;
6
+ onSelect: (value: TabsModelValue) => void;
7
+ focusIndex?: (index: number) => void;
8
+ }): {
9
+ isSelected: (index: number, tab: TabItem) => boolean;
10
+ getTabIndex: (index: number) => number;
11
+ select: (index: number) => void;
12
+ onKeydown: (event: KeyboardEvent, index: number) => void;
13
+ formatBadge: (badge: number) => string;
14
+ };
15
+ //# sourceMappingURL=useTabs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTabs.d.ts","sourceRoot":"","sources":["../../../../src/useTabs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC9B,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAMtD,wBAAgB,OAAO,CAAC,OAAO,EAAE;IAC/B,IAAI,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAA;IACpB,UAAU,EAAE,GAAG,CAAC,cAAc,GAAG,SAAS,CAAC,CAAA;IAC3C,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAA;IACzC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACrC;wBAC4B,MAAM,OAAO,OAAO,KAAG,OAAO;yBAoC7B,MAAM,KAAG,MAAM;oBAMpB,MAAM,KAAG,IAAI;uBAUV,aAAa,SAAS,MAAM,KAAG,IAAI;yBAuCjC,MAAM,KAAG,MAAM;EAW5C"}
package/dist/style.css CHANGED
@@ -1 +1,3 @@
1
- /*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){[data-v-91787911],[data-v-91787911]:before,[data-v-91787911]:after,[data-v-91787911]::backdrop{--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-font-weight:initial}}}.az-tabs[data-v-91787911]{background-color:var(--tabs-color-background-default);width:100%;position:relative}.az-tabs__list[data-v-91787911]{margin:calc(var(--spacing,.25rem) * 0);padding:calc(var(--spacing,.25rem) * 0);gap:var(--spacing-100);padding:var(--tabs-list-padding,var(--spacing-100) var(--spacing-050));list-style-type:none;display:flex;overflow-x:auto}.az-tabs--centered .az-tabs__list[data-v-91787911]{justify-content:center}@media screen and (min-width:769px){.az-tabs__list[data-v-91787911]{overflow:hidden}}.az-tabs__tab[data-v-91787911]{cursor:pointer;--tw-border-style:none;--tw-outline-style:none;border-radius:var(--border-radius-s);color:var(--tabs-color-text-default);justify-content:center;align-items:center;gap:var(--spacing-050);background-color:#0000;border-style:none;outline-style:none;text-decoration-line:none;display:flex}.az-tabs__tab[data-v-91787911]:hover{background-color:var(--tabs-color-background-hover)}.az-tabs__tab[data-v-91787911]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--color-blue-500,oklch(62.3% .214 259.815));--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.az-tabs__tab--selected[data-v-91787911]{background-color:var(--tabs-color-background-selected);--tw-font-weight:var(--font-weight-semibold,600);font-weight:var(--font-weight-semibold,600);color:var(--tabs-color-text-selected)}.az-tabs__tab--selected[data-v-91787911]:hover{background-color:var(--tabs-color-background-selected-hover)}.az-tabs__tab--disabled[data-v-91787911]{cursor:not-allowed;color:var(--tabs-color-text-disabled)}.az-tabs__tab--disabled[data-v-91787911]:hover{background-color:#0000}.az-tabs__label[data-v-91787911]{pointer-events:none;white-space:nowrap}.az-tabs__icon[data-v-91787911]{fill:currentColor}.az-tabs--s[data-v-91787911]{height:var(--spacing-500)}.az-tabs--m[data-v-91787911]{height:var(--spacing-700)}.az-tabs--s .az-tabs__tab[data-v-91787911],.az-tabs__tab--s[data-v-91787911]{font-size:var(--font-size-04);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)));height:var(--spacing-300);padding-left:var(--spacing-100);padding-right:var(--spacing-100)}.az-tabs--s .az-tabs__icon[data-v-91787911],.az-tabs__tab--s .az-tabs__icon[data-v-91787911]{width:var(--spacing-250);height:var(--spacing-250)}.az-tabs--m .az-tabs__tab[data-v-91787911],.az-tabs__tab--m[data-v-91787911]{font-size:var(--font-size-05);line-height:var(--tw-leading,var(--text-base--line-height, 1.5 ));height:var(--spacing-500);padding-left:var(--spacing-150);padding-right:var(--spacing-150)}.az-tabs--m .az-tabs__icon[data-v-91787911],.az-tabs__tab--m .az-tabs__icon[data-v-91787911]{width:var(--spacing-300);height:var(--spacing-300)}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-font-weight{syntax:"*";inherits:false}
1
+ /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
2
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after{--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 transparent;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 transparent;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 transparent;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 transparent;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 transparent;--tw-outline-style:solid}::-ms-backdrop{--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 transparent;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 transparent;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 transparent;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 transparent;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 transparent;--tw-outline-style:solid}::backdrop{--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 transparent;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 transparent;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 transparent;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 transparent;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 transparent;--tw-outline-style:solid}}}.pointer-events-none{pointer-events:none}.relative{position:relative}.z-\[1\]{z-index:1}.m-0{margin:0}.mt-\[length\:var\(--spacing-100\)\]{margin-top:var(--spacing-100)}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.size-\[1em\]{width:1em;height:1em}.h-8{height:calc(var(--spacing,.25rem) * 8)}.h-10{height:calc(var(--spacing,.25rem) * 10)}.w-full{width:100%}.shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.\[scrollbar-width\:none\]{scrollbar-width:none}.list-none{list-style-type:none}.items-center{align-items:center}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-\[calc\(var\(--spacing\)\*0\.5\)\]{gap:calc(var(--spacing) * .5)}.gap-\[length\:var\(--spacing-100\)\]{gap:var(--spacing-100)}.overflow-x-auto{overflow-x:auto}.overflow-y-hidden{overflow-y:hidden}.rounded{border-radius:.25rem}.rounded-\[length\:var\(--border-radius-l\)\]{border-radius:var(--border-radius-l)}.rounded-\[length\:var\(--border-radius-m\)\]{border-radius:var(--border-radius-m)}.rounded-\[length\:var\(--border-radius-s\)\]{border-radius:var(--border-radius-s)}.rounded-full{border-radius:2147483647px}.rounded-none{border-radius:0}.border-none{--tw-border-style:none;border-style:none}.bg-\[color\:var\(--color-background-accent\)\]{background-color:var(--color-background-accent)}.bg-\[color\:var\(--color-background-primary\)\]{background-color:var(--color-background-primary)}.bg-transparent{background-color:transparent}.p-0{padding:0}.px-3{padding-inline:calc(var(--spacing,.25rem) * 3)}.px-4{padding-inline:calc(var(--spacing,.25rem) * 4)}.px-\[calc\(var\(--spacing\)\*0\.5\)\]{padding-inline:calc(var(--spacing) * .5)}.font-sans{font-family:var(--font-family,ui-sans-serif, system-ui, sans-serif)}.text-base{font-size:var(--font-size-05);line-height:var(--tw-leading,var(--text-base--line-height,calc(1.5 / 1)))}.text-sm{font-size:var(--font-size-04);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.text-\[length\:calc\(var\(--spacing\)\*1\.25\)\]{font-size:calc(var(--spacing) * 1.25)}.text-\[length\:var\(--spacing-300\)\]{font-size:var(--spacing-300)}.leading-none{--tw-leading:1;line-height:1}.font-semibold{--tw-font-weight:var(--font-weight-semi-bold);font-weight:var(--font-weight-semi-bold)}.whitespace-nowrap{white-space:nowrap}.text-\[color\:var\(--color-text-accent\)\]{color:var(--color-text-accent)}.text-\[color\:var\(--color-text-tertiary\)\]{color:var(--color-text-tertiary)}.text-current{color:currentColor}.no-underline{-webkit-text-decoration-line:none;text-decoration-line:none}.underline{-webkit-text-decoration-line:underline;text-decoration-line:underline}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-edge{--tw-ring-color:var(--color-border-primary)}.outline,.outline-1{outline-style:var(--tw-outline-style);outline-width:1px}.outline-edge{outline-color:var(--color-border-primary)}.outline-none{--tw-outline-style:none;outline-style:none}.\[-ms-overflow-style\:none\]{-ms-overflow-style:none}@media (hover:hover){.hover\:not-disabled\:bg-\[color-mix\(in_srgb\,var\(--color-background-accent\)_88\%\,\#000\)\]:hover:not(:disabled){background-color:var(--color-background-accent)}@supports (color:color-mix(in lab, red, red)){.hover\:not-disabled\:bg-\[color-mix\(in_srgb\,var\(--color-background-accent\)_88\%\,\#000\)\]:hover:not(:disabled){background-color:color-mix(in srgb,var(--color-background-accent) 88%,#000)}}.hover\:not-disabled\:bg-\[color-mix\(in_srgb\,var\(--color-text-primary\)_5\%\,transparent\)\]:hover:not(:disabled){background-color:var(--color-text-primary)}@supports (color:color-mix(in lab, red, red)){.hover\:not-disabled\:bg-\[color-mix\(in_srgb\,var\(--color-text-primary\)_5\%\,transparent\)\]:hover:not(:disabled){background-color:color-mix(in srgb,var(--color-text-primary) 5%,transparent)}}}.focus-visible\:outline:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-\[length\:var\(--border-m\)\]:focus-visible{outline-style:var(--tw-outline-style);outline-width:var(--border-m)}.focus-visible\:outline-offset-\[length\:var\(--border-m\)\]:focus-visible{outline-offset:var(--border-m)}.focus-visible\:outline-\[color\:var\(--color-text-accent\)\]:focus-visible{outline-color:var(--color-text-accent)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media (hover:hover){.disabled\:hover\:bg-transparent:disabled:hover{background-color:transparent}}@media (min-width:48rem){.md\:overflow-hidden{overflow:hidden}}.\[\&_svg\]\:block svg{display:block}.\[\&_svg\]\:size-full svg{width:100%;height:100%}.\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 transparent}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 transparent}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 transparent}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 transparent}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 transparent}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}
3
+ /*$vite$:1*/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ptlm-azulejo/tabs",
3
- "version": "0.0.1-alpha.35",
3
+ "version": "1.0.0-alpha.211",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",
@@ -26,23 +26,28 @@
26
26
  "files": [
27
27
  "dist/*"
28
28
  ],
29
+ "dependencies": {
30
+ "@ptlm-azulejo/divider": "^1.0.0",
31
+ "@ptlm-azulejo/number-badge": "^0.1.0"
32
+ },
29
33
  "devDependencies": {
34
+ "@ptlm-azulejo/fonts-adeo": "*",
35
+ "@ptlm-azulejo/fonts-leroy-merlin": "*",
36
+ "@ptlm-azulejo/icons": "^1.0.0-alpha.6",
30
37
  "@ptlm-azulejo/themes": "*",
31
- "@storybook/addon-essentials": "^7.0.0",
32
- "@storybook/addon-interactions": "^7.0.0",
33
- "@storybook/vue3": "^7.0.0",
34
- "@storybook/vue3-vite": "^7.0.0",
35
- "@tailwindcss/vite": "^4.0.0",
36
- "storybook": "^7.0.0",
37
- "tailwindcss": "^4.0.0",
38
+ "@storybook/vue3-vite": "^10.5.8",
39
+ "@tailwindcss/vite": "^4.3.3",
40
+ "storybook": "^10.5.8",
41
+ "tailwindcss": "^4.3.3",
38
42
  "vue": "^3.3.4"
39
43
  },
40
44
  "peerDependencies": {
45
+ "@ptlm-azulejo/themes": ">=1.4.0",
41
46
  "vue": ">=3.0.0"
42
47
  },
43
- "dependencies": {
44
- "@ptlm-azulejo/divider": "^0.0.1-alpha.32",
45
- "@ptlm-azulejo/number-badge": "^0.0.1-alpha.33",
46
- "@ptlm-azulejo/themes": "^1.1.0"
48
+ "peerDependenciesMeta": {
49
+ "@ptlm-azulejo/themes": {
50
+ "optional": true
51
+ }
47
52
  }
48
53
  }
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { default as AzTabs } from './src/index.vue';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAA"}
@@ -1,14 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/vue3';
2
- import { default as Tabs } from './index.vue';
3
-
4
- declare const meta: Meta<typeof Tabs>;
5
- export default meta;
6
- type Story = StoryObj<typeof Tabs>;
7
- export declare const Default: Story;
8
- export declare const Small: Story;
9
- export declare const Icons: Story;
10
- export declare const Centered: Story;
11
- export declare const NoDivider: Story;
12
- export declare const Disabled: Story;
13
- export declare const WithBadges: Story;
14
- //# sourceMappingURL=index.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.stories.d.ts","sourceRoot":"","sources":["../../src/index.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAErD,OAAO,+BAA+B,CAAA;AACtC,OAAO,IAAI,MAAM,aAAa,CAAA;AAE9B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,CA8C3B,CAAC;AACF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,KAAK,EAAE,KA0BnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAyBnB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAEvB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAuBtB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAwBxB,CAAC"}
@@ -1,136 +0,0 @@
1
- import { Component } from 'vue';
2
-
3
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
4
- /**
5
- * A description indicating the purpose of the set of tabs. Useful for improving the accessibility of the component.
6
- */
7
- description?: string;
8
- /**
9
- * Defines the size of the tab.
10
- */
11
- size?: "s" | "m";
12
- /**
13
- * If `true`, the divider will appear.
14
- */
15
- divider?: boolean;
16
- /**
17
- * If `true`, the tabs of the component will be centered.
18
- */
19
- centered?: boolean;
20
- /**
21
- * Defines the currently active tab.
22
- *
23
- * - If a `number` is provided, it represents the index of the tab.
24
- * - If a `string` is provided, it must match the `id` of one of the tabs.
25
- */
26
- modelValue?: string | number;
27
- /**
28
- * An array of objects that allows you to provide all the data needed to generate the content for each tab.
29
- */
30
- tabs: Array<{
31
- /**
32
- * Unique identifier for the tab.
33
- */
34
- id?: string;
35
- /**
36
- * The icon displayed for the tab from Mozaic-icon-vue.
37
- */
38
- icon?: Component;
39
- /**
40
- * The number badge displayed for the tab.
41
- */
42
- badge?: number;
43
- /**
44
- * The label displayed for the tab.
45
- */
46
- label: string;
47
- /**
48
- * If `true`, the tab will be disabled.
49
- */
50
- disabled?: boolean;
51
- }>;
52
- }>, {
53
- modelValue: number;
54
- size: string;
55
- divider: boolean;
56
- }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
57
- "update:modelValue": (value?: string | number | undefined) => void;
58
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
59
- /**
60
- * A description indicating the purpose of the set of tabs. Useful for improving the accessibility of the component.
61
- */
62
- description?: string;
63
- /**
64
- * Defines the size of the tab.
65
- */
66
- size?: "s" | "m";
67
- /**
68
- * If `true`, the divider will appear.
69
- */
70
- divider?: boolean;
71
- /**
72
- * If `true`, the tabs of the component will be centered.
73
- */
74
- centered?: boolean;
75
- /**
76
- * Defines the currently active tab.
77
- *
78
- * - If a `number` is provided, it represents the index of the tab.
79
- * - If a `string` is provided, it must match the `id` of one of the tabs.
80
- */
81
- modelValue?: string | number;
82
- /**
83
- * An array of objects that allows you to provide all the data needed to generate the content for each tab.
84
- */
85
- tabs: Array<{
86
- /**
87
- * Unique identifier for the tab.
88
- */
89
- id?: string;
90
- /**
91
- * The icon displayed for the tab from Mozaic-icon-vue.
92
- */
93
- icon?: Component;
94
- /**
95
- * The number badge displayed for the tab.
96
- */
97
- badge?: number;
98
- /**
99
- * The label displayed for the tab.
100
- */
101
- label: string;
102
- /**
103
- * If `true`, the tab will be disabled.
104
- */
105
- disabled?: boolean;
106
- }>;
107
- }>, {
108
- modelValue: number;
109
- size: string;
110
- divider: boolean;
111
- }>>> & Readonly<{
112
- "onUpdate:modelValue"?: ((value?: string | number | undefined) => any) | undefined;
113
- }>, {
114
- size: "s" | "m";
115
- divider: boolean;
116
- modelValue: string | number;
117
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
118
- export default _default;
119
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
120
- type __VLS_TypePropsToRuntimeProps<T> = {
121
- [K in keyof T]-?: {} extends Pick<T, K> ? {
122
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
123
- } : {
124
- type: import('vue').PropType<T[K]>;
125
- required: true;
126
- };
127
- };
128
- type __VLS_WithDefaults<P, D> = {
129
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
130
- default: D[K];
131
- }> : P[K];
132
- };
133
- type __VLS_Prettify<T> = {
134
- [K in keyof T]: T[K];
135
- } & {};
136
- //# sourceMappingURL=index.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../src/index.vue"],"names":[],"mappings":"AAEA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,KAAK,CAAC;;IA0crE;;OAEG;kBACW,MAAM;IACpB;;OAEG;WACI,GAAG,GAAG,GAAG;IAChB;;OAEG;cACO,OAAO;IACjB;;OAEG;eACQ,OAAO;IAClB;;;;;OAKG;iBACU,MAAM,GAAG,MAAM;IAC5B;;OAEG;UACG,KAAK,CAAC;QACV;;WAEG;QACH,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ;;WAEG;QACH,IAAI,CAAC,EAAE,SAAS,CAAC;QACjB;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QACf;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QACd;;WAEG;QACH,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;;;;;;;;IA/CF;;OAEG;kBACW,MAAM;IACpB;;OAEG;WACI,GAAG,GAAG,GAAG;IAChB;;OAEG;cACO,OAAO;IACjB;;OAEG;eACQ,OAAO;IAClB;;;;;OAKG;iBACU,MAAM,GAAG,MAAM;IAC5B;;OAEG;UACG,KAAK,CAAC;QACV;;WAEG;QACH,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ;;WAEG;QACH,IAAI,CAAC,EAAE,SAAS,CAAC;QACjB;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QACf;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QACd;;WAEG;QACH,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;;;;;;;;UAxCK,GAAG,GAAG,GAAG;aAIN,OAAO;gBAWJ,MAAM,GAAG,MAAM;;AA5BhC,wBAwDG;AACH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}