@mekari/pixel3-accordion 0.0.1 → 0.0.2

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.
Files changed (49) hide show
  1. package/dist/accordion.d.mts +44 -0
  2. package/dist/accordion.d.ts +44 -0
  3. package/dist/accordion.js +70 -49
  4. package/dist/accordion.mjs +5 -1
  5. package/dist/chunk-2MFH6MEI.mjs +56 -0
  6. package/dist/chunk-6FLZM2UD.mjs +69 -0
  7. package/dist/chunk-CJKS7PMG.mjs +61 -0
  8. package/dist/chunk-GSM3VVNB.mjs +37 -0
  9. package/dist/chunk-KJJ7ZOJB.mjs +49 -0
  10. package/dist/chunk-PFYTMT2T.mjs +11 -0
  11. package/dist/chunk-QK7KPGDG.mjs +47 -0
  12. package/dist/chunk-QZ7VFGWC.mjs +6 -0
  13. package/dist/chunk-SZIA7VIC.mjs +38 -0
  14. package/dist/header.d.mts +18 -0
  15. package/dist/header.d.ts +18 -0
  16. package/dist/header.js +88 -0
  17. package/dist/header.mjs +9 -0
  18. package/dist/icon.d.mts +45 -0
  19. package/dist/icon.d.ts +45 -0
  20. package/dist/icon.js +81 -0
  21. package/dist/icon.mjs +9 -0
  22. package/dist/index.d.mts +7 -0
  23. package/dist/index.d.ts +7 -0
  24. package/dist/index.js +298 -52
  25. package/dist/index.mjs +22 -2
  26. package/dist/item.d.mts +48 -0
  27. package/dist/item.d.ts +48 -0
  28. package/dist/item.js +132 -0
  29. package/dist/item.mjs +10 -0
  30. package/dist/metafile-cjs.json +1 -1
  31. package/dist/metafile-esm.json +1 -1
  32. package/dist/modules/accordion.context.d.mts +26 -0
  33. package/dist/modules/accordion.context.d.ts +26 -0
  34. package/dist/modules/accordion.context.js +38 -0
  35. package/dist/modules/accordion.context.mjs +13 -0
  36. package/dist/modules/accordion.props.d.mts +67 -0
  37. package/dist/modules/accordion.props.d.ts +67 -0
  38. package/dist/modules/accordion.props.js +96 -0
  39. package/dist/modules/accordion.props.mjs +13 -0
  40. package/dist/modules/useAccordion.d.mts +16 -0
  41. package/dist/modules/useAccordion.d.ts +16 -0
  42. package/dist/modules/useAccordion.js +87 -0
  43. package/dist/modules/useAccordion.mjs +10 -0
  44. package/dist/panel.d.mts +6 -0
  45. package/dist/panel.d.ts +6 -0
  46. package/dist/panel.js +65 -0
  47. package/dist/panel.mjs +8 -0
  48. package/package.json +11 -11
  49. package/dist/chunk-EJFISPTU.mjs +0 -50
package/dist/header.js ADDED
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/header.tsx
21
+ var header_exports = {};
22
+ __export(header_exports, {
23
+ MpAccordionHeader: () => MpAccordionHeader
24
+ });
25
+ module.exports = __toCommonJS(header_exports);
26
+ var import_vue = require("vue");
27
+ var import_vue2 = require("vue");
28
+ var import_css = require("@mekari/pixel3-styled-system/css");
29
+
30
+ // src/modules/accordion.context.ts
31
+ var import_pixel3_utils = require("@mekari/pixel3-utils");
32
+ var [AccordionProvider, useAccordionContext] = (0, import_pixel3_utils.usePixelCreateContext)("AccordionContext");
33
+ var [AccordionItemProvider, useAccordionItemContext] = (0, import_pixel3_utils.usePixelCreateContext)("AccordionItemContext");
34
+
35
+ // src/modules/accordion.props.ts
36
+ var accordionHeaderProps = {
37
+ isClickable: {
38
+ type: Boolean,
39
+ default: true
40
+ }
41
+ };
42
+
43
+ // src/header.tsx
44
+ var MpAccordionHeader = (0, import_vue2.defineComponent)({
45
+ name: "MpAccordionHeader",
46
+ props: accordionHeaderProps,
47
+ setup(props, {
48
+ slots
49
+ }) {
50
+ const {
51
+ isExpanded,
52
+ onToggle,
53
+ id
54
+ } = useAccordionItemContext();
55
+ return () => {
56
+ const headerClass = (0, import_css.css)({
57
+ display: "flex",
58
+ alignItems: "center",
59
+ width: "100%",
60
+ outline: 0,
61
+ gap: 4,
62
+ transition: "all 0.2s",
63
+ py: 3,
64
+ fontWeight: "semiBold",
65
+ fontSize: "md",
66
+ color: "dark",
67
+ _disabled: {
68
+ opacity: "0.4",
69
+ cursor: "not-allowed"
70
+ },
71
+ cursor: props.isClickable ? "pointer" : "default"
72
+ });
73
+ return (0, import_vue.createVNode)("button", {
74
+ "data-pixel-component": "MpAccordionHeader",
75
+ "type": "button",
76
+ "id": `accordion-header-${id}`,
77
+ "aria-expanded": isExpanded.value,
78
+ "aria-controls": `accordion-panel-${id}`,
79
+ "class": headerClass,
80
+ "onClick": onToggle
81
+ }, [slots.default()]);
82
+ };
83
+ }
84
+ });
85
+ // Annotate the CommonJS export names for ESM import in node:
86
+ 0 && (module.exports = {
87
+ MpAccordionHeader
88
+ });
@@ -0,0 +1,9 @@
1
+ import {
2
+ MpAccordionHeader
3
+ } from "./chunk-2MFH6MEI.mjs";
4
+ import "./chunk-PFYTMT2T.mjs";
5
+ import "./chunk-6FLZM2UD.mjs";
6
+ import "./chunk-QZ7VFGWC.mjs";
7
+ export {
8
+ MpAccordionHeader
9
+ };
@@ -0,0 +1,45 @@
1
+ import * as vue_jsx_runtime from 'vue/jsx-runtime';
2
+ import * as vue from 'vue';
3
+
4
+ declare const MpAccordionIcon: vue.DefineComponent<{
5
+ name: {
6
+ type: vue.PropType<string>;
7
+ default: string;
8
+ };
9
+ size: {
10
+ type: vue.PropType<"sm" | "md">;
11
+ default: string;
12
+ };
13
+ color: {
14
+ type: StringConstructor;
15
+ default: string;
16
+ };
17
+ variant: {
18
+ type: vue.PropType<"fill" | "outline" | "duotone">;
19
+ default: string;
20
+ };
21
+ }, () => vue_jsx_runtime.JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
22
+ name: {
23
+ type: vue.PropType<string>;
24
+ default: string;
25
+ };
26
+ size: {
27
+ type: vue.PropType<"sm" | "md">;
28
+ default: string;
29
+ };
30
+ color: {
31
+ type: StringConstructor;
32
+ default: string;
33
+ };
34
+ variant: {
35
+ type: vue.PropType<"fill" | "outline" | "duotone">;
36
+ default: string;
37
+ };
38
+ }>>, {
39
+ name: string;
40
+ color: string;
41
+ size: "sm" | "md";
42
+ variant: "fill" | "outline" | "duotone";
43
+ }, {}>;
44
+
45
+ export { MpAccordionIcon };
package/dist/icon.d.ts ADDED
@@ -0,0 +1,45 @@
1
+ import * as vue_jsx_runtime from 'vue/jsx-runtime';
2
+ import * as vue from 'vue';
3
+
4
+ declare const MpAccordionIcon: vue.DefineComponent<{
5
+ name: {
6
+ type: vue.PropType<string>;
7
+ default: string;
8
+ };
9
+ size: {
10
+ type: vue.PropType<"sm" | "md">;
11
+ default: string;
12
+ };
13
+ color: {
14
+ type: StringConstructor;
15
+ default: string;
16
+ };
17
+ variant: {
18
+ type: vue.PropType<"fill" | "outline" | "duotone">;
19
+ default: string;
20
+ };
21
+ }, () => vue_jsx_runtime.JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
22
+ name: {
23
+ type: vue.PropType<string>;
24
+ default: string;
25
+ };
26
+ size: {
27
+ type: vue.PropType<"sm" | "md">;
28
+ default: string;
29
+ };
30
+ color: {
31
+ type: StringConstructor;
32
+ default: string;
33
+ };
34
+ variant: {
35
+ type: vue.PropType<"fill" | "outline" | "duotone">;
36
+ default: string;
37
+ };
38
+ }>>, {
39
+ name: string;
40
+ color: string;
41
+ size: "sm" | "md";
42
+ variant: "fill" | "outline" | "duotone";
43
+ }, {}>;
44
+
45
+ export { MpAccordionIcon };
package/dist/icon.js ADDED
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/icon.tsx
21
+ var icon_exports = {};
22
+ __export(icon_exports, {
23
+ MpAccordionIcon: () => MpAccordionIcon
24
+ });
25
+ module.exports = __toCommonJS(icon_exports);
26
+ var import_vue = require("vue");
27
+ var import_vue2 = require("vue");
28
+ var import_pixel3_icon = require("@mekari/pixel3-icon");
29
+
30
+ // src/modules/accordion.context.ts
31
+ var import_pixel3_utils = require("@mekari/pixel3-utils");
32
+ var [AccordionProvider, useAccordionContext] = (0, import_pixel3_utils.usePixelCreateContext)("AccordionContext");
33
+ var [AccordionItemProvider, useAccordionItemContext] = (0, import_pixel3_utils.usePixelCreateContext)("AccordionItemContext");
34
+
35
+ // src/modules/accordion.props.ts
36
+ var accordionIconProps = {
37
+ name: {
38
+ type: String,
39
+ default: "caret-down"
40
+ },
41
+ size: {
42
+ type: String,
43
+ default: "md"
44
+ },
45
+ color: {
46
+ type: String,
47
+ default: "gray.600"
48
+ },
49
+ variant: {
50
+ type: String,
51
+ default: "outline"
52
+ }
53
+ };
54
+
55
+ // src/icon.tsx
56
+ var MpAccordionIcon = (0, import_vue2.defineComponent)({
57
+ name: "MpAccordionIcon",
58
+ props: accordionIconProps,
59
+ setup(props) {
60
+ const {
61
+ isExpanded
62
+ } = useAccordionItemContext();
63
+ return () => {
64
+ return (0, import_vue.createVNode)(import_pixel3_icon.MpIcon, {
65
+ "name": props.name,
66
+ "size": props.size,
67
+ "color": props.color,
68
+ "variant": props.variant,
69
+ "style": {
70
+ transform: isExpanded.value ? "rotate(-180deg)" : "rotate(0)",
71
+ transition: "transform 0.2s",
72
+ transformOrigin: "center"
73
+ }
74
+ }, null);
75
+ };
76
+ }
77
+ });
78
+ // Annotate the CommonJS export names for ESM import in node:
79
+ 0 && (module.exports = {
80
+ MpAccordionIcon
81
+ });
package/dist/icon.mjs ADDED
@@ -0,0 +1,9 @@
1
+ import {
2
+ MpAccordionIcon
3
+ } from "./chunk-GSM3VVNB.mjs";
4
+ import "./chunk-PFYTMT2T.mjs";
5
+ import "./chunk-6FLZM2UD.mjs";
6
+ import "./chunk-QZ7VFGWC.mjs";
7
+ export {
8
+ MpAccordionIcon
9
+ };
@@ -0,0 +1,7 @@
1
+ export { MpAccordion } from './accordion.mjs';
2
+ export { MpAccordionItem } from './item.mjs';
3
+ export { MpAccordionHeader } from './header.mjs';
4
+ export { MpAccordionPanel } from './panel.mjs';
5
+ export { MpAccordionIcon } from './icon.mjs';
6
+ import 'vue/jsx-runtime';
7
+ import 'vue';
@@ -0,0 +1,7 @@
1
+ export { MpAccordion } from './accordion.js';
2
+ export { MpAccordionItem } from './item.js';
3
+ export { MpAccordionHeader } from './header.js';
4
+ export { MpAccordionPanel } from './panel.js';
5
+ export { MpAccordionIcon } from './icon.js';
6
+ import 'vue/jsx-runtime';
7
+ import 'vue';
package/dist/index.js CHANGED
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
7
  var __export = (target, all) => {
9
8
  for (var name in all)
10
9
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -17,70 +16,317 @@ var __copyProps = (to, from, except, desc) => {
17
16
  }
18
17
  return to;
19
18
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
20
 
30
- // src/index.tsx
21
+ // src/index.ts
31
22
  var src_exports = {};
32
23
  __export(src_exports, {
33
- MpAccordion: () => MpAccordion
24
+ MpAccordion: () => MpAccordion,
25
+ MpAccordionHeader: () => MpAccordionHeader,
26
+ MpAccordionIcon: () => MpAccordionIcon,
27
+ MpAccordionItem: () => MpAccordionItem,
28
+ MpAccordionPanel: () => MpAccordionPanel
34
29
  });
35
30
  module.exports = __toCommonJS(src_exports);
36
31
 
37
32
  // src/accordion.tsx
38
- var import_vue = require("vue");
39
- var accordion = __toESM(require("@zag-js/accordion"));
40
- var import_vue2 = require("@zag-js/vue");
33
+ var import_vue2 = require("vue");
41
34
  var import_vue3 = require("vue");
42
- var import_recipes = require("@mekari/pixel3-styled-system/recipes");
43
- var data = [{
44
- title: "Watercraft",
45
- content: "Sample accordion content"
46
- }, {
47
- title: "Automobiles",
48
- content: "Sample accordion content"
49
- }, {
50
- title: "Aircrafts",
51
- content: "Sample accordion content"
52
- }];
53
- var classNames = (0, import_recipes.accordion)();
35
+
36
+ // src/modules/accordion.context.ts
37
+ var import_pixel3_utils = require("@mekari/pixel3-utils");
38
+ var [AccordionProvider, useAccordionContext] = (0, import_pixel3_utils.usePixelCreateContext)("AccordionContext");
39
+ var [AccordionItemProvider, useAccordionItemContext] = (0, import_pixel3_utils.usePixelCreateContext)("AccordionItemContext");
40
+
41
+ // src/modules/accordion.props.ts
42
+ var accordionProps = {
43
+ defaultIndexOpen: {
44
+ type: Number
45
+ },
46
+ isAllowMultiple: {
47
+ type: Boolean,
48
+ default: false
49
+ },
50
+ isAllowToggle: {
51
+ type: Boolean,
52
+ default: false
53
+ },
54
+ isControlled: {
55
+ type: Boolean,
56
+ default: false
57
+ }
58
+ };
59
+ var accordionItemProps = {
60
+ id: {
61
+ type: String
62
+ },
63
+ index: {
64
+ type: Number
65
+ },
66
+ isOpen: {
67
+ type: Boolean,
68
+ default: false
69
+ },
70
+ isDefaultIsOpen: {
71
+ type: Boolean,
72
+ default: false
73
+ },
74
+ isDisabled: {
75
+ type: Boolean,
76
+ default: false
77
+ }
78
+ };
79
+ var accordionHeaderProps = {
80
+ isClickable: {
81
+ type: Boolean,
82
+ default: true
83
+ }
84
+ };
85
+ var accordionIconProps = {
86
+ name: {
87
+ type: String,
88
+ default: "caret-down"
89
+ },
90
+ size: {
91
+ type: String,
92
+ default: "md"
93
+ },
94
+ color: {
95
+ type: String,
96
+ default: "gray.600"
97
+ },
98
+ variant: {
99
+ type: String,
100
+ default: "outline"
101
+ }
102
+ };
103
+
104
+ // src/modules/useAccordion.ts
105
+ var import_vue = require("vue");
106
+ var import_pixel3_utils2 = require("@mekari/pixel3-utils");
107
+ function useAccordion(props, emit) {
108
+ const expandedIndex = (0, import_vue.ref)(props.defaultIndexOpen);
109
+ function onAccordionChange(index, isExpanded) {
110
+ emit("change", index, isExpanded);
111
+ expandedIndex.value = index;
112
+ }
113
+ __name(onAccordionChange, "onAccordionChange");
114
+ return {
115
+ expandedIndex,
116
+ onAccordionChange
117
+ };
118
+ }
119
+ __name(useAccordion, "useAccordion");
120
+ function useAccordionItem(props) {
121
+ const {
122
+ props: rootProps,
123
+ expandedIndex,
124
+ onAccordionChange
125
+ } = useAccordionContext();
126
+ const {
127
+ isAllowMultiple,
128
+ isControlled
129
+ } = rootProps;
130
+ const id = props.id || (0, import_pixel3_utils2.useId)(4);
131
+ const _isExpanded = (0, import_vue.ref)(props.isDefaultIsOpen);
132
+ const isExpanded = (0, import_vue.computed)(() => {
133
+ if (isControlled.value)
134
+ return props.isOpen;
135
+ if (!isAllowMultiple.value)
136
+ return props.index === expandedIndex.value;
137
+ return _isExpanded.value;
138
+ });
139
+ function onToggle() {
140
+ if (isAllowMultiple.value) {
141
+ _isExpanded.value = !_isExpanded.value;
142
+ }
143
+ onAccordionChange(props.index, _isExpanded.value);
144
+ }
145
+ __name(onToggle, "onToggle");
146
+ return {
147
+ isExpanded,
148
+ onToggle,
149
+ id
150
+ };
151
+ }
152
+ __name(useAccordionItem, "useAccordionItem");
153
+
154
+ // src/accordion.tsx
54
155
  var MpAccordion = (0, import_vue3.defineComponent)({
55
- // eslint-disable-next-line vue/multi-word-component-names
56
- name: "Accordion",
57
- setup() {
58
- const [state, send] = (0, import_vue2.useMachine)(accordion.machine({
59
- id: "1",
60
- multiple: true
61
- }));
62
- const apiRef = (0, import_vue3.computed)(() => accordion.connect(state.value, send, import_vue2.normalizeProps));
63
- console.log(apiRef.value);
156
+ name: "MpAccordion",
157
+ props: accordionProps,
158
+ emits: ["change"],
159
+ setup(props, {
160
+ slots,
161
+ emit
162
+ }) {
163
+ const {
164
+ expandedIndex,
165
+ onAccordionChange
166
+ } = useAccordion(props, emit);
167
+ AccordionProvider({
168
+ props: (0, import_vue3.toRefs)(props),
169
+ expandedIndex,
170
+ onAccordionChange
171
+ });
172
+ return () => {
173
+ const children = slots.default ? slots.default() : [];
174
+ const clone = children.map((node, index) => {
175
+ return (0, import_vue3.cloneVNode)(node, {
176
+ index
177
+ });
178
+ });
179
+ return (0, import_vue2.createVNode)("div", {
180
+ "data-pixel-component": "MpAccordion"
181
+ }, [clone]);
182
+ };
183
+ }
184
+ });
185
+
186
+ // src/item.tsx
187
+ var import_vue4 = require("vue");
188
+ var import_vue5 = require("vue");
189
+ var import_css = require("@mekari/pixel3-styled-system/css");
190
+ var MpAccordionItem = (0, import_vue5.defineComponent)({
191
+ name: "MpAccordionItem",
192
+ props: accordionItemProps,
193
+ setup(props, {
194
+ slots
195
+ }) {
196
+ const {
197
+ isExpanded,
198
+ onToggle,
199
+ id
200
+ } = useAccordionItem(props);
201
+ AccordionItemProvider({
202
+ isExpanded,
203
+ onToggle,
204
+ id
205
+ });
206
+ return () => {
207
+ return (0, import_vue4.createVNode)("div", {
208
+ "data-pixel-component": "MpAccordionItem",
209
+ "class": (0, import_css.css)({
210
+ borderBottomWidth: "1px",
211
+ borderColor: "gray.100",
212
+ _last: {
213
+ borderBottomWidth: "1px",
214
+ borderColor: "gray.100"
215
+ }
216
+ })
217
+ }, [slots.default()]);
218
+ };
219
+ }
220
+ });
221
+
222
+ // src/header.tsx
223
+ var import_vue6 = require("vue");
224
+ var import_vue7 = require("vue");
225
+ var import_css2 = require("@mekari/pixel3-styled-system/css");
226
+ var MpAccordionHeader = (0, import_vue7.defineComponent)({
227
+ name: "MpAccordionHeader",
228
+ props: accordionHeaderProps,
229
+ setup(props, {
230
+ slots
231
+ }) {
232
+ const {
233
+ isExpanded,
234
+ onToggle,
235
+ id
236
+ } = useAccordionItemContext();
237
+ return () => {
238
+ const headerClass = (0, import_css2.css)({
239
+ display: "flex",
240
+ alignItems: "center",
241
+ width: "100%",
242
+ outline: 0,
243
+ gap: 4,
244
+ transition: "all 0.2s",
245
+ py: 3,
246
+ fontWeight: "semiBold",
247
+ fontSize: "md",
248
+ color: "dark",
249
+ _disabled: {
250
+ opacity: "0.4",
251
+ cursor: "not-allowed"
252
+ },
253
+ cursor: props.isClickable ? "pointer" : "default"
254
+ });
255
+ return (0, import_vue6.createVNode)("button", {
256
+ "data-pixel-component": "MpAccordionHeader",
257
+ "type": "button",
258
+ "id": `accordion-header-${id}`,
259
+ "aria-expanded": isExpanded.value,
260
+ "aria-controls": `accordion-panel-${id}`,
261
+ "class": headerClass,
262
+ "onClick": onToggle
263
+ }, [slots.default()]);
264
+ };
265
+ }
266
+ });
267
+
268
+ // src/panel.tsx
269
+ var import_vue8 = require("vue");
270
+ var import_vue9 = require("vue");
271
+ var import_pixel3_collapse = require("@mekari/pixel3-collapse");
272
+ var import_css3 = require("@mekari/pixel3-styled-system/css");
273
+ var MpAccordionPanel = (0, import_vue9.defineComponent)({
274
+ name: "MpAccordionPanel",
275
+ setup(_props, {
276
+ slots
277
+ }) {
278
+ const {
279
+ isExpanded,
280
+ id
281
+ } = useAccordionItemContext();
282
+ return () => {
283
+ return (0, import_vue8.createVNode)(import_pixel3_collapse.MpCollapse, {
284
+ "isOpen": isExpanded.value
285
+ }, {
286
+ default: () => [(0, import_vue8.createVNode)("div", {
287
+ "data-pixel-component": "MpAccordionPanel",
288
+ "id": `accordin-panel-${id}`,
289
+ "aria-labelledby": `accordion-header-${id}`,
290
+ "class": (0, import_css3.css)({
291
+ py: 3
292
+ })
293
+ }, [slots.default()])]
294
+ });
295
+ };
296
+ }
297
+ });
298
+
299
+ // src/icon.tsx
300
+ var import_vue10 = require("vue");
301
+ var import_vue11 = require("vue");
302
+ var import_pixel3_icon = require("@mekari/pixel3-icon");
303
+ var MpAccordionIcon = (0, import_vue11.defineComponent)({
304
+ name: "MpAccordionIcon",
305
+ props: accordionIconProps,
306
+ setup(props) {
307
+ const {
308
+ isExpanded
309
+ } = useAccordionItemContext();
64
310
  return () => {
65
- return (0, import_vue.createVNode)("div", (0, import_vue.mergeProps)(api.rootProps, {
66
- "class": classNames.root
67
- }), [data.map((item) => (0, import_vue.createVNode)("div", (0, import_vue.mergeProps)(api.getItemProps({
68
- value: item.title
69
- }), {
70
- "class": classNames.item
71
- }), [(0, import_vue.createVNode)("button", (0, import_vue.mergeProps)(api.getItemTriggerProps({
72
- value: item.title
73
- }), {
74
- "class": classNames.trigger
75
- }), [item.title, (0, import_vue.createVNode)("div", null, [(0, import_vue.createTextVNode)("Item Indicator")])]), (0, import_vue.createVNode)("div", (0, import_vue.mergeProps)(api.getItemContentProps({
76
- value: item.title
77
- }), {
78
- "class": classNames.content
79
- }), [(0, import_vue.createVNode)("div", null, [item.content])])]))]);
311
+ return (0, import_vue10.createVNode)(import_pixel3_icon.MpIcon, {
312
+ "name": props.name,
313
+ "size": props.size,
314
+ "color": props.color,
315
+ "variant": props.variant,
316
+ "style": {
317
+ transform: isExpanded.value ? "rotate(-180deg)" : "rotate(0)",
318
+ transition: "transform 0.2s",
319
+ transformOrigin: "center"
320
+ }
321
+ }, null);
80
322
  };
81
323
  }
82
324
  });
83
325
  // Annotate the CommonJS export names for ESM import in node:
84
326
  0 && (module.exports = {
85
- MpAccordion
327
+ MpAccordion,
328
+ MpAccordionHeader,
329
+ MpAccordionIcon,
330
+ MpAccordionItem,
331
+ MpAccordionPanel
86
332
  });