@scaleflex/ui-tw 0.0.134 → 0.0.135

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.
@@ -0,0 +1,7 @@
1
+ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
2
+ import * as React from 'react';
3
+ import type { ComponentProps } from 'react';
4
+ declare function Collapsible({ ...props }: ComponentProps<typeof CollapsiblePrimitive.Root>): React.JSX.Element;
5
+ declare function CollapsibleTrigger({ className, ...props }: ComponentProps<typeof CollapsiblePrimitive.Trigger>): React.JSX.Element;
6
+ declare function CollapsibleContent({ className, ...props }: ComponentProps<typeof CollapsiblePrimitive.Content>): React.JSX.Element;
7
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent };
@@ -0,0 +1,31 @@
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
+ import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
3
+ import _extends from "@babel/runtime/helpers/extends";
4
+ var _excluded = ["className"],
5
+ _excluded2 = ["className"];
6
+ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
7
+ import { cn } from '@scaleflex/ui-tw/utils/cn';
8
+ import * as React from 'react';
9
+ function Collapsible(_ref) {
10
+ var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
11
+ return /*#__PURE__*/React.createElement(CollapsiblePrimitive.Root, _extends({
12
+ "data-slot": "collapsible"
13
+ }, props));
14
+ }
15
+ function CollapsibleTrigger(_ref2) {
16
+ var className = _ref2.className,
17
+ props = _objectWithoutProperties(_ref2, _excluded);
18
+ return /*#__PURE__*/React.createElement(CollapsiblePrimitive.Trigger, _extends({
19
+ "data-slot": "collapsible-trigger",
20
+ className: cn('flex w-full items-center justify-between rounded-md text-sm font-medium transition-all outline-none', 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]', 'disabled:pointer-events-none disabled:opacity-50', '[&[data-state=open]>svg]:rotate-180', className)
21
+ }, props));
22
+ }
23
+ function CollapsibleContent(_ref3) {
24
+ var className = _ref3.className,
25
+ props = _objectWithoutProperties(_ref3, _excluded2);
26
+ return /*#__PURE__*/React.createElement(CollapsiblePrimitive.Content, _extends({
27
+ "data-slot": "collapsible-content",
28
+ className: cn('data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down overflow-hidden', className)
29
+ }, props));
30
+ }
31
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent };
@@ -0,0 +1 @@
1
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent } from './collapsible.component';
@@ -0,0 +1 @@
1
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent } from './collapsible.component';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleflex/ui-tw",
3
- "version": "0.0.134",
3
+ "version": "0.0.135",
4
4
  "author": "scaleflex",
5
5
  "repository": "github:scaleflex/ui",
6
6
  "homepage": "https://github.com/scaleflex/ui/blob/master/README.md",
@@ -16,6 +16,7 @@
16
16
  "@radix-ui/react-accordion": "^1.2.12",
17
17
  "@radix-ui/react-avatar": "^1.1.1",
18
18
  "@radix-ui/react-checkbox": "^1.3.2",
19
+ "@radix-ui/react-collapsible": "^1.1.12",
19
20
  "@radix-ui/react-context-menu": "^2.2.16",
20
21
  "@radix-ui/react-dropdown-menu": "^2.1.15",
21
22
  "@radix-ui/react-label": "^2.1.6",
@@ -28,7 +29,7 @@
28
29
  "@radix-ui/react-switch": "^1.0.1",
29
30
  "@radix-ui/react-tabs": "^1.1.13",
30
31
  "@radix-ui/react-tooltip": "^1.2.6",
31
- "@scaleflex/icons-tw": "^0.0.134",
32
+ "@scaleflex/icons-tw": "^0.0.135",
32
33
  "@tanstack/react-table": "^8.21.3",
33
34
  "@types/lodash.merge": "^4.6.9",
34
35
  "class-variance-authority": "^0.7.1",
@@ -51,4 +51,45 @@
51
51
  --color-panel-border: var(--panel-border);
52
52
  --color-panel-input: var(--panel-input);
53
53
  --color-panel-ring: var(--panel-ring);
54
+
55
+ --animate-collapsible-down: collapsible-down 0.2s ease-out;
56
+ --animate-collapsible-up: collapsible-up 0.2s ease-out;
57
+ --animate-accordion-down: accordion-down 0.2s ease-out;
58
+ --animate-accordion-up: accordion-up 0.2s ease-out;
59
+ }
60
+
61
+ @keyframes collapsible-down {
62
+ from {
63
+ height: 0;
64
+ }
65
+ to {
66
+ height: var(--radix-collapsible-content-height);
67
+ }
68
+ }
69
+
70
+ @keyframes collapsible-up {
71
+ from {
72
+ height: var(--radix-collapsible-content-height);
73
+ }
74
+ to {
75
+ height: 0;
76
+ }
77
+ }
78
+
79
+ @keyframes accordion-down {
80
+ from {
81
+ height: 0;
82
+ }
83
+ to {
84
+ height: var(--radix-accordion-content-height);
85
+ }
86
+ }
87
+
88
+ @keyframes accordion-up {
89
+ from {
90
+ height: var(--radix-accordion-content-height);
91
+ }
92
+ to {
93
+ height: 0;
94
+ }
54
95
  }