@mijn-ui/react-accordion 0.4.1 → 0.5.0

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/dist/index.d.ts CHANGED
@@ -9,10 +9,11 @@ import * as RadixAccordion from '@radix-ui/react-accordion';
9
9
 
10
10
  declare const accordionStyles: tailwind_variants.TVReturnType<{
11
11
  variant: {
12
- default: {
12
+ outline: {
13
13
  item: string;
14
14
  };
15
- contained: {
15
+ plain: {};
16
+ solid: {
16
17
  base: string;
17
18
  };
18
19
  splitted: {
@@ -26,6 +27,23 @@ declare const accordionStyles: tailwind_variants.TVReturnType<{
26
27
  content: string;
27
28
  };
28
29
  };
30
+ size: {
31
+ sm: {
32
+ trigger: string;
33
+ content: string;
34
+ contentWrapper: string;
35
+ };
36
+ md: {
37
+ trigger: string;
38
+ content: string;
39
+ contentWrapper: string;
40
+ };
41
+ lg: {
42
+ trigger: string;
43
+ content: string;
44
+ contentWrapper: string;
45
+ };
46
+ };
29
47
  }, {
30
48
  base: string;
31
49
  item: string;
@@ -36,10 +54,11 @@ declare const accordionStyles: tailwind_variants.TVReturnType<{
36
54
  content: string;
37
55
  }, undefined, {
38
56
  variant: {
39
- default: {
57
+ outline: {
40
58
  item: string;
41
59
  };
42
- contained: {
60
+ plain: {};
61
+ solid: {
43
62
  base: string;
44
63
  };
45
64
  splitted: {
@@ -53,6 +72,23 @@ declare const accordionStyles: tailwind_variants.TVReturnType<{
53
72
  content: string;
54
73
  };
55
74
  };
75
+ size: {
76
+ sm: {
77
+ trigger: string;
78
+ content: string;
79
+ contentWrapper: string;
80
+ };
81
+ md: {
82
+ trigger: string;
83
+ content: string;
84
+ contentWrapper: string;
85
+ };
86
+ lg: {
87
+ trigger: string;
88
+ content: string;
89
+ contentWrapper: string;
90
+ };
91
+ };
56
92
  }, {
57
93
  base: string;
58
94
  item: string;
@@ -63,10 +99,11 @@ declare const accordionStyles: tailwind_variants.TVReturnType<{
63
99
  content: string;
64
100
  }, tailwind_variants.TVReturnType<{
65
101
  variant: {
66
- default: {
102
+ outline: {
67
103
  item: string;
68
104
  };
69
- contained: {
105
+ plain: {};
106
+ solid: {
70
107
  base: string;
71
108
  };
72
109
  splitted: {
@@ -80,6 +117,23 @@ declare const accordionStyles: tailwind_variants.TVReturnType<{
80
117
  content: string;
81
118
  };
82
119
  };
120
+ size: {
121
+ sm: {
122
+ trigger: string;
123
+ content: string;
124
+ contentWrapper: string;
125
+ };
126
+ md: {
127
+ trigger: string;
128
+ content: string;
129
+ contentWrapper: string;
130
+ };
131
+ lg: {
132
+ trigger: string;
133
+ content: string;
134
+ contentWrapper: string;
135
+ };
136
+ };
83
137
  }, {
84
138
  base: string;
85
139
  item: string;
@@ -97,29 +151,36 @@ declare const useAccordionStyles: (unstyledOverride?: boolean) => {
97
151
  classNames: _mijn_ui_react_core.SlotsToClasses<"base" | "item" | "triggerWrapper" | "trigger" | "icon" | "contentWrapper" | "content"> | undefined;
98
152
  isUnstyled: boolean | undefined;
99
153
  base: (slotProps?: ({
100
- variant?: "default" | "contained" | "splitted" | "subtle" | undefined;
154
+ variant?: "outline" | "plain" | "solid" | "splitted" | "subtle" | undefined;
155
+ size?: "md" | "sm" | "lg" | undefined;
101
156
  } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
102
157
  item: (slotProps?: ({
103
- variant?: "default" | "contained" | "splitted" | "subtle" | undefined;
158
+ variant?: "outline" | "plain" | "solid" | "splitted" | "subtle" | undefined;
159
+ size?: "md" | "sm" | "lg" | undefined;
104
160
  } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
105
161
  triggerWrapper: (slotProps?: ({
106
- variant?: "default" | "contained" | "splitted" | "subtle" | undefined;
162
+ variant?: "outline" | "plain" | "solid" | "splitted" | "subtle" | undefined;
163
+ size?: "md" | "sm" | "lg" | undefined;
107
164
  } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
108
165
  trigger: (slotProps?: ({
109
- variant?: "default" | "contained" | "splitted" | "subtle" | undefined;
166
+ variant?: "outline" | "plain" | "solid" | "splitted" | "subtle" | undefined;
167
+ size?: "md" | "sm" | "lg" | undefined;
110
168
  } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
111
169
  icon: (slotProps?: ({
112
- variant?: "default" | "contained" | "splitted" | "subtle" | undefined;
170
+ variant?: "outline" | "plain" | "solid" | "splitted" | "subtle" | undefined;
171
+ size?: "md" | "sm" | "lg" | undefined;
113
172
  } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
114
173
  contentWrapper: (slotProps?: ({
115
- variant?: "default" | "contained" | "splitted" | "subtle" | undefined;
174
+ variant?: "outline" | "plain" | "solid" | "splitted" | "subtle" | undefined;
175
+ size?: "md" | "sm" | "lg" | undefined;
116
176
  } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
117
177
  content: (slotProps?: ({
118
- variant?: "default" | "contained" | "splitted" | "subtle" | undefined;
178
+ variant?: "outline" | "plain" | "solid" | "splitted" | "subtle" | undefined;
179
+ size?: "md" | "sm" | "lg" | undefined;
119
180
  } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
120
181
  };
121
182
  type AccordionProps = React.ComponentPropsWithRef<typeof RadixAccordion.Root> & AccordionVariantProps & AccordionBaseProps;
122
- declare const Accordion: ({ className, classNames, unstyled, variant, ...props }: AccordionProps) => react_jsx_runtime.JSX.Element;
183
+ declare const Accordion: ({ className, classNames, unstyled, variant, size, ...props }: AccordionProps) => react_jsx_runtime.JSX.Element;
123
184
  type AccordionItemProps = React.ComponentPropsWithRef<typeof RadixAccordion.Item> & {
124
185
  unstyled?: boolean;
125
186
  };
package/dist/index.js CHANGED
@@ -23,12 +23,15 @@ var accordionStyles = tv({
23
23
  },
24
24
  variants: {
25
25
  variant: {
26
- default: {
26
+ // Figma-aligned intents
27
+ outline: {
27
28
  item: "border-b"
28
29
  },
29
- contained: {
30
+ plain: {},
31
+ solid: {
30
32
  base: "py-2 px-4 bg-bg-secondary rounded-lg border divide-y divide-y-outline-default"
31
33
  },
34
+ // Additional variants
32
35
  splitted: {
33
36
  base: "space-y-1.5",
34
37
  item: "bg-bg-secondary px-4 rounded-lg border border-outline-default"
@@ -39,10 +42,28 @@ var accordionStyles = tv({
39
42
  trigger: "bg-bg-secondary px-4",
40
43
  content: "p-4 bg-bg-tertiary"
41
44
  }
45
+ },
46
+ size: {
47
+ sm: {
48
+ trigger: "py-2 text-xs",
49
+ content: "text-xs",
50
+ contentWrapper: "text-xs"
51
+ },
52
+ md: {
53
+ trigger: "py-4 text-sm",
54
+ content: "text-sm",
55
+ contentWrapper: "text-sm"
56
+ },
57
+ lg: {
58
+ trigger: "py-5 text-base",
59
+ content: "text-base",
60
+ contentWrapper: "text-base"
61
+ }
42
62
  }
43
63
  },
44
64
  defaultVariants: {
45
- variant: "default"
65
+ variant: "outline",
66
+ size: "md"
46
67
  }
47
68
  });
48
69
  var [AccordionProvider, useAccordionContext] = createContext({
@@ -60,13 +81,15 @@ var Accordion = ({
60
81
  classNames,
61
82
  unstyled = false,
62
83
  variant,
84
+ size,
63
85
  ...props
64
86
  }) => {
65
- const styles = accordionStyles({ variant });
87
+ const styles = accordionStyles({ variant, size });
66
88
  const { base } = createTVUnstyledSlots({ base: styles.base }, unstyled);
67
89
  return /* @__PURE__ */ jsx(AccordionProvider, { value: { classNames, unstyled, styles }, children: /* @__PURE__ */ jsx(
68
90
  RadixAccordion.Root,
69
91
  {
92
+ "data-slot": "accordion",
70
93
  className: base({ className: cn(classNames?.base, className) }),
71
94
  ...props
72
95
  }
@@ -81,6 +104,7 @@ var AccordionItem = ({
81
104
  return /* @__PURE__ */ jsx(
82
105
  RadixAccordion.Item,
83
106
  {
107
+ "data-slot": "accordion-item",
84
108
  className: item({ className: cn(classNames?.item, className) }),
85
109
  ...props
86
110
  }
@@ -102,10 +126,12 @@ var AccordionTrigger = ({
102
126
  return /* @__PURE__ */ jsx(
103
127
  RadixAccordion.Header,
104
128
  {
129
+ "data-slot": "accordion-header",
105
130
  className: triggerWrapper({ className: classNames?.triggerWrapper }),
106
131
  children: /* @__PURE__ */ jsxs(
107
132
  RadixAccordion.Trigger,
108
133
  {
134
+ "data-slot": "accordion-trigger",
109
135
  className: trigger({
110
136
  className: cn(classNames?.trigger, className)
111
137
  }),
@@ -134,6 +160,7 @@ var AccordionContent = ({
134
160
  return /* @__PURE__ */ jsx(
135
161
  RadixAccordion.Content,
136
162
  {
163
+ "data-slot": "accordion-content",
137
164
  className: contentWrapper({ className: classNames?.contentWrapper }),
138
165
  ...props,
139
166
  children: /* @__PURE__ */ jsx(
@@ -1 +1 @@
1
- {"inputs":{"src/accordion.tsx":{"bytes":6500,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"@radix-ui/react-accordion","kind":"import-statement","external":true},{"path":"tailwind-variants","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":28,"imports":[{"path":"src/accordion.tsx","kind":"import-statement","original":"./accordion"}],"format":"esm"}},"outputs":{"dist/index.js":{"imports":[{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"@radix-ui/react-accordion","kind":"import-statement","external":true},{"path":"tailwind-variants","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Accordion","AccordionContent","AccordionItem","AccordionTrigger","accordionStyles","useAccordionStyles"],"entryPoint":"src/index.ts","inputs":{"src/accordion.tsx":{"bytesInOutput":4040},"src/index.ts":{"bytesInOutput":0}},"bytes":4198}}}
1
+ {"inputs":{"src/accordion.tsx":{"bytes":7151,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"@radix-ui/react-accordion","kind":"import-statement","external":true},{"path":"tailwind-variants","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":28,"imports":[{"path":"src/accordion.tsx","kind":"import-statement","original":"./accordion"}],"format":"esm"}},"outputs":{"dist/index.js":{"imports":[{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"@radix-ui/react-accordion","kind":"import-statement","external":true},{"path":"tailwind-variants","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Accordion","AccordionContent","AccordionItem","AccordionTrigger","accordionStyles","useAccordionStyles"],"entryPoint":"src/index.ts","inputs":{"src/accordion.tsx":{"bytesInOutput":4707},"src/index.ts":{"bytesInOutput":0}},"bytes":4865}}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mijn-ui/react-accordion",
3
3
  "author": "Htet Aung Lin<htetaunglin.coder@gmail.com>",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "homepage": "https://mijn-ui.vercel.app",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -23,8 +23,8 @@
23
23
  "@next/eslint-plugin-next": "^15.0.3",
24
24
  "@types/react": "^19.0.0",
25
25
  "@types/react-dom": "^19.0.0",
26
- "react": "19.0.0",
27
- "react-dom": "19.0.0",
26
+ "react": "19.0.1",
27
+ "react-dom": "19.0.1",
28
28
  "@mijn-ui/react-core": "0.5.0",
29
29
  "eslint-config-custom": "0.0.1",
30
30
  "tsconfig": "0.0.0",