@mijn-ui/react-accordion 0.4.2 → 0.5.1

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,26 +23,47 @@ var accordionStyles = tv({
23
23
  },
24
24
  variants: {
25
25
  variant: {
26
- default: {
27
- item: "border-b"
26
+ // Figma-aligned intents
27
+ outline: {
28
+ item: "border-b border-outline-default"
28
29
  },
29
- contained: {
30
- base: "py-2 px-4 bg-bg-secondary rounded-lg border divide-y divide-y-outline-default"
30
+ plain: {},
31
+ solid: {
32
+ base: "py-2 px-4 bg-bg-secondary rounded-(--mijn-radius-lg) border border-outline-default divide-y divide-outline-default"
31
33
  },
34
+ // Additional variants
32
35
  splitted: {
33
36
  base: "space-y-1.5",
34
- item: "bg-bg-secondary px-4 rounded-lg border border-outline-default"
37
+ item: "bg-bg-secondary px-4 rounded-(--mijn-radius-lg) border border-outline-default"
35
38
  },
36
39
  subtle: {
37
- base: "rounded-lg overflow-hidden divide-y",
40
+ base: "rounded-(--mijn-radius-lg) overflow-hidden divide-y",
38
41
  item: "border-outline-secondary",
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,9 +81,10 @@ 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,
@@ -1 +1 @@
1
- {"inputs":{"src/accordion.tsx":{"bytes":6672,"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":4232},"src/index.ts":{"bytesInOutput":0}},"bytes":4390}}}
1
+ {"inputs":{"src/accordion.tsx":{"bytes":7243,"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":4799},"src/index.ts":{"bytesInOutput":0}},"bytes":4957}}}
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.2",
4
+ "version": "0.5.1",
5
5
  "homepage": "https://mijn-ui.vercel.app",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -25,17 +25,17 @@
25
25
  "@types/react-dom": "^19.0.0",
26
26
  "react": "19.0.1",
27
27
  "react-dom": "19.0.1",
28
- "@mijn-ui/react-core": "0.5.0",
28
+ "@mijn-ui/react-core": "0.6.0",
29
29
  "eslint-config-custom": "0.0.1",
30
30
  "tsconfig": "0.0.0",
31
31
  "tsup-config": "0.0.0"
32
32
  },
33
33
  "dependencies": {
34
- "@radix-ui/react-accordion": "^1.2.2",
35
- "@mijn-ui/shared-icons": "0.1.0"
34
+ "@radix-ui/react-accordion": "^1.3.1",
35
+ "@mijn-ui/shared-icons": "0.2.0"
36
36
  },
37
37
  "peerDependencies": {
38
- "@mijn-ui/react-core": "^0.5.0",
38
+ "@mijn-ui/react-core": "^0.6.0",
39
39
  "tailwind-merge": "^3.0.0",
40
40
  "tailwind-variants": "^3.0.0",
41
41
  "react": "^19.0",