@simpli-route/apollo-ds 0.0.20 → 0.0.22

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.
@@ -1,3 +1,3 @@
1
1
  import { AccordionProps } from './types';
2
2
 
3
- export declare const Accordion: ({ items, accordionClassName, itemClassName, sectionClassName, hasIcon }: AccordionProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const Accordion: ({ items, accordionClassName, itemClassName, sectionClassName, hasIcon, allowMultipleOpen, }: AccordionProps) => import("react/jsx-runtime").JSX.Element;
@@ -13,6 +13,11 @@ type ItemProps = {
13
13
  };
14
14
  export interface AccordionProps {
15
15
  items: ItemProps[];
16
+ /**
17
+ * Define whether the accordion is allowed to be multiple open or not
18
+ * @default false
19
+ */
20
+ allowMultipleOpen?: boolean;
16
21
  /**
17
22
  * Defines the styling for accordion container (optional)
18
23
  */
@@ -27,6 +32,7 @@ export interface AccordionProps {
27
32
  sectionClassName?: string;
28
33
  /**
29
34
  * Defines whether or not to show the plus or minus icon
35
+ * @default true
30
36
  */
31
37
  hasIcon?: boolean;
32
38
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("class-variance-authority"),t=[{intent:"primary",isHovered:!0,isDisabled:!1,isActive:!1,class:"bg-primary-100"},{intent:"primary",isHovered:!0,isDisabled:!1,isActive:!0,class:"bg-primary-700 text-primary-50"},{intent:"secondary",isHovered:!0,isDisabled:!1,isActive:!1,class:"bg-primary-300"},{intent:"secondary",isHovered:!0,isDisabled:!1,isActive:!0,class:"bg-primary-700 text-primary-50"},{intent:"minimal",isHovered:!0,isDisabled:!1,isActive:!1,class:"bg-neutral-200 text-neutral-800"},{intent:"minimal",isHovered:!0,isDisabled:!1,isActive:!0,class:"bg-neutral-200 text-primary-700"}],i=[{intent:"primary",isActive:!0,isDisabled:!1,class:"bg-primary-500 text-primary-50"},{intent:"primary",isActive:!0,isDisabled:!0,class:"bg-primary-300 text-primary-100"},{intent:"secondary",isActive:!0,isDisabled:!1,class:"bg-primary-700 text-primary-50"},{intent:"secondary",isActive:!0,isDisabled:!0,class:"bg-primary-100 text-primary-300"},{intent:"minimal",isActive:!0,isDisabled:!1,class:"text-primary-500"},{intent:"minimal",isActive:!0,isDisabled:!0,class:"text-neutral-700"}],s=[{intent:"primary",isDisabled:!0,isActive:!1,class:"text-neutral-600"},{intent:"primary",isDisabled:!0,isActive:!0,class:"bg-primary-300 text-primary-100"},{intent:"secondary",isDisabled:!0,isActive:!1,class:"bg-neutral-400 text-neutral-600"},{intent:"secondary",isDisabled:!0,isActive:!0,class:"bg-primary-100 text-primary-300"},{intent:"minimal",isDisabled:!0,isActive:!1,class:"text-neutral-600"},{intent:"minimal",isDisabled:!0,isActive:!0,class:"text-neutral-700"}],r=e.cva("inline-flex items-center justify-center border border-transparent transition duration-150 ease-in-out",{variants:{intent:{primary:"bg-transparent text-primary-500",secondary:"bg-primary-200 text-primary-500",minimal:"bg-transparent text-neutral-700"},size:{xxs:"p-1",xs:"p-2",sm:"p-2.5",md:"p-3",lg:"p-4"},isDisabled:{true:"pointer-events-none cursor-not-allowed"},isHovered:{true:""},isActive:{true:""},isFocused:{false:"",true:"focus:outline-none focus:ring-offset-2 outline-none ring-2 ring-sky-400"}},compoundVariants:[...t,...i,...s]});exports.buttonVariants=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index.cjs10.js"),i=require("./index.cjs11.js"),m=({label:e,description:s,errorMessage:x,isDisabled:n,isInvalid:l,children:r,renderLabelIcon:u})=>!e&&!s&&!r?null:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col",children:[e?t.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1",children:[t.jsxRuntimeExports.jsx("p",{className:i.cn("text-sm font-semibold",n?"text-neutral-600":"text-neutral-900"),children:e}),u?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:u}):null]}):r,s&&!x&&t.jsxRuntimeExports.jsx("p",{className:i.cn("text-xs",n?"text-neutral-600":"text-neutral-800"),children:s}),l&&x&&t.jsxRuntimeExports.jsx("p",{className:"text-sm text-red-500",children:x})]});exports.ContentSwitch=m;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index.cjs10.js"),i=require("./index.cjs11.js"),m=({label:e,description:s,errorMessage:x,isDisabled:n,isInvalid:l,children:r,renderLabelIcon:u})=>!e&&!s&&!r?null:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col",children:[e?t.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1",children:[t.jsxRuntimeExports.jsx("p",{className:i.cn("text-sm font-semibold",n?"text-neutral-600":"text-neutral-900"),children:e}),u?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:u}):null]}):r,s&&!x&&t.jsxRuntimeExports.jsx("p",{className:i.cn("text-xs",n?"text-neutral-600":"text-neutral-800"),children:s}),l&&x&&t.jsxRuntimeExports.jsx("p",{className:"text-sm text-red-500",children:x})]});exports.ContentSwitch=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index.cjs10.js"),s=require("./index.cjs11.js"),a=require("./index.cjs15.js"),c=({isSelected:t,isDisabled:e,isHovered:n,size:i,dimensions:r})=>o.jsxRuntimeExports.jsx("div",{className:s.cn(a.indicatorVariants({isSelected:t,isDisabled:e,size:i,isHoveredWhenOff:n&&!t})),style:{left:t?`${r.onLeft}px`:`${r.offLeft}px`}});exports.SwitchIndicator=c;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index.cjs10.js"),m=require("react"),g=require("./index.cjs11.js"),j=require("./index.cjs12.js"),p=({items:c,accordionClassName:s,itemClassName:i,sectionClassName:u,hasIcon:l})=>{const[o,a]=m.useState(null),d=g.cn("flex flex-col gap-y-4",s),x=e=>{a(e===o?null:e)};return r.jsxRuntimeExports.jsx("div",{className:d,children:c.map(({label:e,section:t},n)=>r.jsxRuntimeExports.jsx(j.AccordionItem,{hasIcon:l,label:e,section:t,active:o===n,itemClassName:i,sectionClassName:u,onToggle:()=>x(n)},n))})};exports.Accordion=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index.cjs10.js"),j=require("react"),q=require("./index.cjs11.js"),d=require("./index.cjs12.js"),x=({items:n,accordionClassName:c,itemClassName:i,sectionClassName:u,hasIcon:l,allowMultipleOpen:a=!1})=>{const[m,t]=j.useState([]),g=q.cn("flex flex-col gap-y-4",c),f=e=>{t(a?o=>o.includes(e)?o.filter(s=>s!==e):[...o,e]:o=>o.includes(e)?[]:[e])};return r.jsxRuntimeExports.jsx("div",{className:g,children:n.map(({label:e,section:o},s)=>r.jsxRuntimeExports.jsx(d.AccordionItem,{hasIcon:l,label:e,section:o,active:m.includes(s),itemClassName:i,sectionClassName:u,onToggle:()=>f(s)},s))})};exports.Accordion=x;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index.cjs10.js"),s=require("./index.cjs11.js"),a=require("./index.cjs15.js"),c=({isSelected:t,isDisabled:e,isHovered:n,size:i,dimensions:r})=>o.jsxRuntimeExports.jsx("div",{className:s.cn(a.indicatorVariants({isSelected:t,isDisabled:e,size:i,isHoveredWhenOff:n&&!t})),style:{left:t?`${r.onLeft}px`:`${r.offLeft}px`}});exports.SwitchIndicator=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("class-variance-authority"),t=[{intent:"primary",isHovered:!0,isDisabled:!1,isActive:!1,class:"bg-primary-100"},{intent:"secondary",isHovered:!0,isDisabled:!1,isActive:!1,class:"bg-primary-500 text-primary-50"},{intent:"minimal",isHovered:!0,isDisabled:!1,isActive:!1,class:"bg-neutral-200 text-neutral-800"}],i=[{intent:"primary",isActive:!0,isDisabled:!1,class:"bg-primary-500 text-primary-50"},{intent:"primary",isActive:!0,isDisabled:!0,class:"bg-primary-300 text-primary-100"},{intent:"secondary",isActive:!0,isDisabled:!1,class:"bg-primary-500 text-primary-50"},{intent:"secondary",isActive:!0,isDisabled:!0,class:"bg-primary-100 text-primary-300"},{intent:"minimal",isActive:!0,isDisabled:!1,class:"text-primary-500"},{intent:"minimal",isActive:!0,isDisabled:!0,class:"text-neutral-700"}],s=[{intent:"primary",isDisabled:!0,isActive:!1,class:"text-neutral-600"},{intent:"primary",isDisabled:!0,isActive:!0,class:"bg-primary-300 text-primary-100"},{intent:"secondary",isDisabled:!0,isActive:!1,class:"bg-neutral-400 text-neutral-600"},{intent:"secondary",isDisabled:!0,isActive:!0,class:"bg-primary-100 text-primary-300"},{intent:"minimal",isDisabled:!0,isActive:!1,class:"text-neutral-600"},{intent:"minimal",isDisabled:!0,isActive:!0,class:"text-neutral-700"}],r=e.cva("inline-flex items-center justify-center border border-transparent transition duration-150 ease-in-out focus:outline-none",{variants:{intent:{primary:"bg-transparent text-primary-500",secondary:"bg-primary-200 text-primary-500",minimal:"bg-transparent text-neutral-700"},size:{xxs:"p-1",xs:"p-2",sm:"p-2.5",md:"p-3",lg:"p-4"},isDisabled:{true:"pointer-events-none cursor-not-allowed"},isHovered:{true:""},isActive:{true:""},isFocused:{false:"",true:"focus:outline-none focus:ring-offset-2 outline-none ring-2 ring-sky-400"}},compoundVariants:[...t,...i,...s]});exports.buttonVariants=r;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index.cjs10.js"),q=require("react"),n=require("react-aria-components"),R=require("./index.cjs11.js"),g=require("./index.cjs18.js");function v(i,c){const[a,u]=n.useContextProps(i,c,n.ButtonContext),{intent:l="secondary",size:d="lg",isDisabled:o=!1,isActive:x=!1,children:e,className:f,...m}=a,r="flex h-full items-center overflow-hidden whitespace-nowrap";return s.jsxRuntimeExports.jsx(n.Button,{ref:u,className:({isPressed:t,isHovered:p,isFocusVisible:j,isFocused:h})=>R.cn(g.buttonVariants({intent:l,size:d,isDisabled:o,isActive:x||t,isHovered:p,isFocused:j||h}),f),isDisabled:o,...m,children:typeof e=="function"?t=>s.jsxRuntimeExports.jsx("span",{className:r+"p-2.",children:e(t)}):s.jsxRuntimeExports.jsx("span",{className:r,children:e})})}const B=q.forwardRef(v);exports.IconButton=B;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index.cjs10.js"),h=require("react"),n=require("react-aria-components"),q=require("./index.cjs11.js"),R=require("./index.cjs20.js");function g(i,c){const[a,u]=n.useContextProps(i,c,n.ButtonContext),{intent:l="secondary",size:d="lg",isDisabled:o=!1,isActive:x=!1,children:e,className:f,...m}=a,r="flex h-full items-center overflow-hidden whitespace-nowrap";return s.jsxRuntimeExports.jsx(n.Button,{ref:u,className:({isPressed:t,isHovered:p,isFocusVisible:j})=>q.cn(R.buttonVariants({intent:l,size:d,isDisabled:o,isActive:x||t,isHovered:p,isFocused:j}),f),isDisabled:o,...m,children:typeof e=="function"?t=>s.jsxRuntimeExports.jsx("span",{className:r+"p-2.",children:e(t)}):s.jsxRuntimeExports.jsx("span",{className:r,children:e})})}const v=h.forwardRef(g);exports.IconButton=v;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index.cjs10.js"),p=require("react-aria-components"),c=require("./index.cjs11.js"),q=require("./index.cjs19.js"),R=require("./index.cjs20.js"),v=require("./index.cjs15.js"),E=({children:s,label:i,description:o,errorMessage:x,validationState:u,size:e="md",isDisabled:t=!1,isSelected:n=!1,onChange:f,renderLabelIcon:m=null,"aria-label":h,"aria-describedby":j})=>{const l=u==="invalid"&&!t,w=e==="sm"?{offLeft:3,onLeft:19}:{offLeft:4,onLeft:28};return r.jsxRuntimeExports.jsxs("label",{className:c.cn("group flex flex-row gap-2",(i||s)&&o?"items-start":"items-center"),children:[r.jsxRuntimeExports.jsx(p.Switch,{isDisabled:t,isSelected:n,"aria-checked":n,"aria-label":h,"aria-describedby":j,onChange:f,children:({isFocusVisible:d,isHovered:a})=>r.jsxRuntimeExports.jsx("div",{className:c.cn(v.switchVariants({isSelected:n,isDisabled:t,isFocusVisible:d,size:e,isHoveredWhenOff:a&&!n})),children:r.jsxRuntimeExports.jsx(R.SwitchIndicator,{isSelected:n,isDisabled:t,isHovered:a,size:e,dimensions:w})})}),r.jsxRuntimeExports.jsx(q.ContentSwitch,{label:i,description:o,errorMessage:x,isDisabled:t,isInvalid:l,renderLabelIcon:m,children:s})]})};exports.Switch=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index.cjs10.js"),p=require("react-aria-components"),c=require("./index.cjs11.js"),q=require("./index.cjs18.js"),R=require("./index.cjs19.js"),v=require("./index.cjs15.js"),E=({children:s,label:i,description:o,errorMessage:x,validationState:u,size:e="md",isDisabled:t=!1,isSelected:n=!1,onChange:f,renderLabelIcon:m=null,"aria-label":h,"aria-describedby":j})=>{const l=u==="invalid"&&!t,w=e==="sm"?{offLeft:3,onLeft:19}:{offLeft:4,onLeft:28};return r.jsxRuntimeExports.jsxs("label",{className:c.cn("group flex flex-row gap-2",(i||s)&&o?"items-start":"items-center"),children:[r.jsxRuntimeExports.jsx(p.Switch,{isDisabled:t,isSelected:n,"aria-checked":n,"aria-label":h,"aria-describedby":j,onChange:f,children:({isFocusVisible:d,isHovered:a})=>r.jsxRuntimeExports.jsx("div",{className:c.cn(v.switchVariants({isSelected:n,isDisabled:t,isFocusVisible:d,size:e,isHoveredWhenOff:a&&!n})),children:r.jsxRuntimeExports.jsx(R.SwitchIndicator,{isSelected:n,isDisabled:t,isHovered:a,size:e,dimensions:w})})}),r.jsxRuntimeExports.jsx(q.ContentSwitch,{label:i,description:o,errorMessage:x,isDisabled:t,isInvalid:l,renderLabelIcon:m,children:s})]})};exports.Switch=E;
@@ -1,154 +1,21 @@
1
- import { cva as e } from "class-variance-authority";
2
- const i = [
3
- {
4
- intent: "primary",
5
- isHovered: !0,
6
- isDisabled: !1,
7
- isActive: !1,
8
- class: "bg-primary-100"
9
- },
10
- {
11
- intent: "primary",
12
- isHovered: !0,
13
- isDisabled: !1,
14
- isActive: !0,
15
- class: "bg-primary-700 text-primary-50"
16
- },
17
- {
18
- intent: "secondary",
19
- isHovered: !0,
20
- isDisabled: !1,
21
- isActive: !1,
22
- class: "bg-primary-300"
23
- },
24
- {
25
- intent: "secondary",
26
- isHovered: !0,
27
- isDisabled: !1,
28
- isActive: !0,
29
- class: "bg-primary-700 text-primary-50"
30
- },
31
- {
32
- intent: "minimal",
33
- isHovered: !0,
34
- isDisabled: !1,
35
- isActive: !1,
36
- class: "bg-neutral-200 text-neutral-800"
37
- },
38
- {
39
- intent: "minimal",
40
- isHovered: !0,
41
- isDisabled: !1,
42
- isActive: !0,
43
- class: "bg-neutral-200 text-primary-700"
44
- }
45
- ], t = [
46
- {
47
- intent: "primary",
48
- isActive: !0,
49
- isDisabled: !1,
50
- class: "bg-primary-500 text-primary-50"
51
- },
52
- {
53
- intent: "primary",
54
- isActive: !0,
55
- isDisabled: !0,
56
- class: "bg-primary-300 text-primary-100"
57
- },
58
- {
59
- intent: "secondary",
60
- isActive: !0,
61
- isDisabled: !1,
62
- class: "bg-primary-700 text-primary-50"
63
- },
64
- {
65
- intent: "secondary",
66
- isActive: !0,
67
- isDisabled: !0,
68
- class: "bg-primary-100 text-primary-300"
69
- },
70
- {
71
- intent: "minimal",
72
- isActive: !0,
73
- isDisabled: !1,
74
- class: "text-primary-500"
75
- },
76
- {
77
- intent: "minimal",
78
- isActive: !0,
79
- isDisabled: !0,
80
- class: "text-neutral-700"
81
- }
82
- ], s = [
83
- {
84
- intent: "primary",
85
- isDisabled: !0,
86
- isActive: !1,
87
- class: "text-neutral-600"
88
- },
89
- {
90
- intent: "primary",
91
- isDisabled: !0,
92
- isActive: !0,
93
- class: "bg-primary-300 text-primary-100"
94
- },
95
- {
96
- intent: "secondary",
97
- isDisabled: !0,
98
- isActive: !1,
99
- class: "bg-neutral-400 text-neutral-600"
100
- },
101
- {
102
- intent: "secondary",
103
- isDisabled: !0,
104
- isActive: !0,
105
- class: "bg-primary-100 text-primary-300"
106
- },
107
- {
108
- intent: "minimal",
109
- isDisabled: !0,
110
- isActive: !1,
111
- class: "text-neutral-600"
112
- },
113
- {
114
- intent: "minimal",
115
- isDisabled: !0,
116
- isActive: !0,
117
- class: "text-neutral-700"
118
- }
119
- ], a = e(
120
- "inline-flex items-center justify-center border border-transparent transition duration-150 ease-in-out",
121
- {
122
- variants: {
123
- intent: {
124
- primary: "bg-transparent text-primary-500",
125
- secondary: "bg-primary-200 text-primary-500",
126
- minimal: "bg-transparent text-neutral-700"
127
- },
128
- size: {
129
- xxs: "p-1",
130
- xs: "p-2",
131
- sm: "p-2.5",
132
- md: "p-3",
133
- lg: "p-4"
134
- },
135
- isDisabled: {
136
- true: "pointer-events-none cursor-not-allowed"
137
- },
138
- isHovered: {
139
- true: ""
140
- },
141
- isActive: {
142
- true: ""
143
- },
144
- isFocused: {
145
- false: "",
146
- true: "focus:outline-none focus:ring-offset-2 outline-none ring-2 ring-sky-400"
147
- }
148
- },
149
- compoundVariants: [...i, ...t, ...s]
150
- }
151
- );
1
+ import { j as t } from "./index.es10.js";
2
+ import { cn as c } from "./index.es11.js";
3
+ const i = ({
4
+ label: e,
5
+ description: x,
6
+ errorMessage: s,
7
+ isDisabled: l,
8
+ isInvalid: r,
9
+ children: n,
10
+ renderLabelIcon: m
11
+ }) => !e && !x && !n ? null : /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col", children: [
12
+ e ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-x-1", children: [
13
+ /* @__PURE__ */ t.jsx("p", { className: c("text-sm font-semibold", l ? "text-neutral-600" : "text-neutral-900"), children: e }),
14
+ m ? /* @__PURE__ */ t.jsx(t.Fragment, { children: m }) : null
15
+ ] }) : n,
16
+ x && !s && /* @__PURE__ */ t.jsx("p", { className: c("text-xs", l ? "text-neutral-600" : "text-neutral-800"), children: x }),
17
+ r && s && /* @__PURE__ */ t.jsx("p", { className: "text-sm text-red-500", children: s })
18
+ ] });
152
19
  export {
153
- a as buttonVariants
20
+ i as ContentSwitch
154
21
  };
@@ -1,21 +1,22 @@
1
- import { j as t } from "./index.es10.js";
2
- import { cn as c } from "./index.es11.js";
3
- const i = ({
4
- label: e,
5
- description: x,
6
- errorMessage: s,
7
- isDisabled: l,
8
- isInvalid: r,
9
- children: n,
10
- renderLabelIcon: m
11
- }) => !e && !x && !n ? null : /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col", children: [
12
- e ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-x-1", children: [
13
- /* @__PURE__ */ t.jsx("p", { className: c("text-sm font-semibold", l ? "text-neutral-600" : "text-neutral-900"), children: e }),
14
- m ? /* @__PURE__ */ t.jsx(t.Fragment, { children: m }) : null
15
- ] }) : n,
16
- x && !s && /* @__PURE__ */ t.jsx("p", { className: c("text-xs", l ? "text-neutral-600" : "text-neutral-800"), children: x }),
17
- r && s && /* @__PURE__ */ t.jsx("p", { className: "text-sm text-red-500", children: s })
18
- ] });
1
+ import { j as i } from "./index.es10.js";
2
+ import { cn as m } from "./index.es11.js";
3
+ import { indicatorVariants as n } from "./index.es15.js";
4
+ const c = ({ isSelected: r, isDisabled: o, isHovered: f, size: a, dimensions: t }) => /* @__PURE__ */ i.jsx(
5
+ "div",
6
+ {
7
+ className: m(
8
+ n({
9
+ isSelected: r,
10
+ isDisabled: o,
11
+ size: a,
12
+ isHoveredWhenOff: f && !r
13
+ })
14
+ ),
15
+ style: {
16
+ left: r ? `${t.onLeft}px` : `${t.offLeft}px`
17
+ }
18
+ }
19
+ );
19
20
  export {
20
- i as ContentSwitch
21
+ c as SwitchIndicator
21
22
  };
package/dist/index.es2.js CHANGED
@@ -1,25 +1,34 @@
1
- import { j as e } from "./index.es10.js";
2
- import { useState as u } from "react";
3
- import { cn as d } from "./index.es11.js";
4
- import { AccordionItem as f } from "./index.es12.js";
5
- const A = ({ items: s, accordionClassName: c, itemClassName: l, sectionClassName: m, hasIcon: a }) => {
6
- const [t, i] = u(null), p = d("flex flex-col gap-y-4", c), x = (o) => {
7
- i(o === t ? null : o);
1
+ import { j as m } from "./index.es10.js";
2
+ import { useState as g } from "react";
3
+ import { cn as j } from "./index.es11.js";
4
+ import { AccordionItem as h } from "./index.es12.js";
5
+ const C = ({
6
+ items: a,
7
+ accordionClassName: e,
8
+ itemClassName: l,
9
+ sectionClassName: c,
10
+ hasIcon: i,
11
+ allowMultipleOpen: n = !1
12
+ }) => {
13
+ const [f, r] = g([]), p = j("flex flex-col gap-y-4", e), u = (o) => {
14
+ r(
15
+ n ? (s) => s.includes(o) ? s.filter((t) => t !== o) : [...s, o] : (s) => s.includes(o) ? [] : [o]
16
+ );
8
17
  };
9
- return /* @__PURE__ */ e.jsx("div", { className: p, children: s.map(({ label: o, section: n }, r) => /* @__PURE__ */ e.jsx(
10
- f,
18
+ return /* @__PURE__ */ m.jsx("div", { className: p, children: a.map(({ label: o, section: s }, t) => /* @__PURE__ */ m.jsx(
19
+ h,
11
20
  {
12
- hasIcon: a,
21
+ hasIcon: i,
13
22
  label: o,
14
- section: n,
15
- active: t === r,
23
+ section: s,
24
+ active: f.includes(t),
16
25
  itemClassName: l,
17
- sectionClassName: m,
18
- onToggle: () => x(r)
26
+ sectionClassName: c,
27
+ onToggle: () => u(t)
19
28
  },
20
- r
29
+ t
21
30
  )) });
22
31
  };
23
32
  export {
24
- A as Accordion
33
+ C as Accordion
25
34
  };
@@ -1,22 +1,133 @@
1
- import { j as i } from "./index.es10.js";
2
- import { cn as m } from "./index.es11.js";
3
- import { indicatorVariants as n } from "./index.es15.js";
4
- const c = ({ isSelected: r, isDisabled: o, isHovered: f, size: a, dimensions: t }) => /* @__PURE__ */ i.jsx(
5
- "div",
6
- {
7
- className: m(
8
- n({
9
- isSelected: r,
10
- isDisabled: o,
11
- size: a,
12
- isHoveredWhenOff: f && !r
13
- })
14
- ),
15
- style: {
16
- left: r ? `${t.onLeft}px` : `${t.offLeft}px`
17
- }
1
+ import { cva as e } from "class-variance-authority";
2
+ const t = [
3
+ {
4
+ intent: "primary",
5
+ isHovered: !0,
6
+ isDisabled: !1,
7
+ isActive: !1,
8
+ class: "bg-primary-100"
9
+ },
10
+ {
11
+ intent: "secondary",
12
+ isHovered: !0,
13
+ isDisabled: !1,
14
+ isActive: !1,
15
+ class: "bg-primary-500 text-primary-50"
16
+ },
17
+ {
18
+ intent: "minimal",
19
+ isHovered: !0,
20
+ isDisabled: !1,
21
+ isActive: !1,
22
+ class: "bg-neutral-200 text-neutral-800"
23
+ }
24
+ ], i = [
25
+ {
26
+ intent: "primary",
27
+ isActive: !0,
28
+ isDisabled: !1,
29
+ class: "bg-primary-500 text-primary-50"
30
+ },
31
+ {
32
+ intent: "primary",
33
+ isActive: !0,
34
+ isDisabled: !0,
35
+ class: "bg-primary-300 text-primary-100"
36
+ },
37
+ {
38
+ intent: "secondary",
39
+ isActive: !0,
40
+ isDisabled: !1,
41
+ class: "bg-primary-500 text-primary-50"
42
+ },
43
+ {
44
+ intent: "secondary",
45
+ isActive: !0,
46
+ isDisabled: !0,
47
+ class: "bg-primary-100 text-primary-300"
48
+ },
49
+ {
50
+ intent: "minimal",
51
+ isActive: !0,
52
+ isDisabled: !1,
53
+ class: "text-primary-500"
54
+ },
55
+ {
56
+ intent: "minimal",
57
+ isActive: !0,
58
+ isDisabled: !0,
59
+ class: "text-neutral-700"
60
+ }
61
+ ], s = [
62
+ {
63
+ intent: "primary",
64
+ isDisabled: !0,
65
+ isActive: !1,
66
+ class: "text-neutral-600"
67
+ },
68
+ {
69
+ intent: "primary",
70
+ isDisabled: !0,
71
+ isActive: !0,
72
+ class: "bg-primary-300 text-primary-100"
73
+ },
74
+ {
75
+ intent: "secondary",
76
+ isDisabled: !0,
77
+ isActive: !1,
78
+ class: "bg-neutral-400 text-neutral-600"
79
+ },
80
+ {
81
+ intent: "secondary",
82
+ isDisabled: !0,
83
+ isActive: !0,
84
+ class: "bg-primary-100 text-primary-300"
85
+ },
86
+ {
87
+ intent: "minimal",
88
+ isDisabled: !0,
89
+ isActive: !1,
90
+ class: "text-neutral-600"
91
+ },
92
+ {
93
+ intent: "minimal",
94
+ isDisabled: !0,
95
+ isActive: !0,
96
+ class: "text-neutral-700"
97
+ }
98
+ ], a = e(
99
+ "inline-flex items-center justify-center border border-transparent transition duration-150 ease-in-out focus:outline-none",
100
+ {
101
+ variants: {
102
+ intent: {
103
+ primary: "bg-transparent text-primary-500",
104
+ secondary: "bg-primary-200 text-primary-500",
105
+ minimal: "bg-transparent text-neutral-700"
106
+ },
107
+ size: {
108
+ xxs: "p-1",
109
+ xs: "p-2",
110
+ sm: "p-2.5",
111
+ md: "p-3",
112
+ lg: "p-4"
113
+ },
114
+ isDisabled: {
115
+ true: "pointer-events-none cursor-not-allowed"
116
+ },
117
+ isHovered: {
118
+ true: ""
119
+ },
120
+ isActive: {
121
+ true: ""
122
+ },
123
+ isFocused: {
124
+ false: "",
125
+ true: "focus:outline-none focus:ring-offset-2 outline-none ring-2 ring-sky-400"
126
+ }
127
+ },
128
+ compoundVariants: [...t, ...i, ...s]
18
129
  }
19
130
  );
20
131
  export {
21
- c as SwitchIndicator
132
+ a as buttonVariants
22
133
  };
package/dist/index.es5.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { j as s } from "./index.es10.js";
2
- import { forwardRef as j } from "react";
3
- import { useContextProps as B, ButtonContext as w, Button as C } from "react-aria-components";
4
- import { cn as N } from "./index.es11.js";
5
- import { buttonVariants as g } from "./index.es18.js";
6
- function v(r, i) {
7
- const [c, a] = B(r, i, w), {
2
+ import { forwardRef as h } from "react";
3
+ import { useContextProps as j, ButtonContext as B, Button as w } from "react-aria-components";
4
+ import { cn as C } from "./index.es11.js";
5
+ import { buttonVariants as N } from "./index.es20.js";
6
+ function g(r, i) {
7
+ const [c, a] = j(r, i, B), {
8
8
  intent: m = "secondary",
9
9
  size: f = "lg",
10
10
  isDisabled: o = !1,
@@ -14,17 +14,17 @@ function v(r, i) {
14
14
  ...u
15
15
  } = c, n = "flex h-full items-center overflow-hidden whitespace-nowrap";
16
16
  return /* @__PURE__ */ s.jsx(
17
- C,
17
+ w,
18
18
  {
19
19
  ref: a,
20
- className: ({ isPressed: e, isHovered: d, isFocusVisible: x, isFocused: h }) => N(
21
- g({
20
+ className: ({ isPressed: e, isHovered: d, isFocusVisible: x }) => C(
21
+ N({
22
22
  intent: m,
23
23
  size: f,
24
24
  isDisabled: o,
25
25
  isActive: l || e,
26
26
  isHovered: d,
27
- isFocused: x || h
27
+ isFocused: x
28
28
  }),
29
29
  p
30
30
  ),
@@ -34,7 +34,7 @@ function v(r, i) {
34
34
  }
35
35
  );
36
36
  }
37
- const P = j(v);
37
+ const A = h(g);
38
38
  export {
39
- P as IconButton
39
+ A as IconButton
40
40
  };
package/dist/index.es7.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { j as o } from "./index.es10.js";
2
2
  import { Switch as u } from "react-aria-components";
3
3
  import { cn as c } from "./index.es11.js";
4
- import { ContentSwitch as L } from "./index.es19.js";
5
- import { SwitchIndicator as v } from "./index.es20.js";
4
+ import { ContentSwitch as L } from "./index.es18.js";
5
+ import { SwitchIndicator as v } from "./index.es19.js";
6
6
  import { switchVariants as b } from "./index.es15.js";
7
7
  const E = ({
8
8
  children: f,
@@ -2,9 +2,10 @@ import { StoryObj } from '@storybook/react';
2
2
 
3
3
  declare const meta: {
4
4
  title: string;
5
- component: ({ items, accordionClassName, itemClassName, sectionClassName, hasIcon }: import('../components').AccordionProps) => import("react/jsx-runtime").JSX.Element;
5
+ component: ({ items, accordionClassName, itemClassName, sectionClassName, hasIcon, allowMultipleOpen, }: import('../components').AccordionProps) => import("react/jsx-runtime").JSX.Element;
6
6
  tags: string[];
7
7
  };
8
8
  export default meta;
9
9
  type Story = StoryObj<typeof meta>;
10
- export declare const Primary: Story;
10
+ export declare const Default: Story;
11
+ export declare const AllowMultipleOpen: Story;
package/dist/style.css CHANGED
@@ -1327,10 +1327,6 @@ select {
1327
1327
  --tw-text-opacity: 1;
1328
1328
  color: rgb(42 22 218 / var(--tw-text-opacity));
1329
1329
  }
1330
- .text-primary-700 {
1331
- --tw-text-opacity: 1;
1332
- color: rgb(29 13 165 / var(--tw-text-opacity));
1333
- }
1334
1330
  .text-primary-800 {
1335
1331
  --tw-text-opacity: 1;
1336
1332
  color: rgb(23 13 108 / var(--tw-text-opacity));
@@ -1385,6 +1381,9 @@ select {
1385
1381
  --tw-blur: blur(8px);
1386
1382
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
1387
1383
  }
1384
+ .filter {
1385
+ filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
1386
+ }
1388
1387
  .transition {
1389
1388
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
1390
1389
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simpli-route/apollo-ds",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"