@simpli-route/apollo-ds 0.0.18 → 0.0.19

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 { ContentSwitchProps } from './types';
2
2
 
3
- export declare const ContentSwitch: ({ label, description, errorMessage, isDisabled, isInvalid, children, }: ContentSwitchProps) => import("react/jsx-runtime").JSX.Element | null;
3
+ export declare const ContentSwitch: ({ label, description, errorMessage, isDisabled, isInvalid, children, renderLabelIcon, }: ContentSwitchProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -4,4 +4,4 @@ import { SwitchProps } from './types';
4
4
  * Switch component **version 0.1** https://www.figma.com/design/h6tZeqNdVEUvrgwOwK4vcY/Design-System---The-Bible?node-id=6065-102190&node-type=frame&t=CNNGulv9I7LJJ6it-0
5
5
  *
6
6
  */
7
- export declare const Switch: ({ children, label, description, errorMessage, validationState, size, isDisabled, isSelected, onChange, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, }: SwitchProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const Switch: ({ children, label, description, errorMessage, validationState, size, isDisabled, isSelected, onChange, renderLabelIcon, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, }: SwitchProps) => import("react/jsx-runtime").JSX.Element;
@@ -33,6 +33,11 @@ export interface SwitchProps extends Omit<SwitchAriaProps, "children"> {
33
33
  */
34
34
  isSelected?: boolean;
35
35
  onChange?: (selected: boolean) => void;
36
+ /**
37
+ * Render icon in label position
38
+ * @default null
39
+ */
40
+ renderLabelIcon?: React.ReactNode;
36
41
  }
37
42
  export interface SwitchIndicatorProps {
38
43
  isSelected: boolean;
@@ -51,4 +56,5 @@ export interface ContentSwitchProps {
51
56
  isDisabled: boolean;
52
57
  isInvalid: boolean;
53
58
  children?: React.ReactNode;
59
+ renderLabelIcon?: React.ReactNode;
54
60
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index.cjs10.js"),r=require("./index.cjs11.js"),l=({label:e,description:n,errorMessage:x,isDisabled:s,isInvalid:c,children:u})=>!e&&!n&&!u?null:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col",children:[e?t.jsxRuntimeExports.jsx("p",{className:r.cn("text-sm font-semibold",s?"text-neutral-600":"text-neutral-900"),children:e}):u,n&&!x&&t.jsxRuntimeExports.jsx("p",{className:r.cn("text-xs",s?"text-neutral-600":"text-neutral-800"),children:n}),c&&x&&t.jsxRuntimeExports.jsx("p",{className:"text-sm text-red-500",children:x})]});exports.ContentSwitch=l;
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 +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 s=require("./index.cjs10.js"),l=require("./index.cjs11.js"),c=o=>{const{isIndeterminate:t,isSelected:e,className:n,isHovered:i}=o,r=i&&!e&&!t?"text-neutral-500":"",a=!!(r||e);return s.jsxRuntimeExports.jsx("svg",{className:l.cn("stroke-current",r,n),viewBox:"-1 1 17 17",children:t?s.jsxRuntimeExports.jsx("line",{x1:1,y1:10,x2:14,y2:10,fill:"none",strokeWidth:2,strokeDasharray:14,strokeDashoffset:e?28:42,style:{transition:"all 400ms"}}):s.jsxRuntimeExports.jsx("polyline",{points:"1 9 7 14 15 4",fill:"none",strokeWidth:2,strokeDasharray:22,strokeDashoffset:a?44:66,style:{transition:"all 400ms"}})})};exports.MarkIcon=c;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index.cjs10.js"),l=require("./index.cjs11.js"),c=o=>{const{isIndeterminate:t,isSelected:e,className:n,isHovered:i}=o,r=i&&!e&&!t?"text-neutral-500":"",a=!!(r||e);return s.jsxRuntimeExports.jsx("svg",{className:l.cn("stroke-current",r,n),viewBox:"-1 1 17 17",children:t?s.jsxRuntimeExports.jsx("line",{x1:1,y1:10,x2:14,y2:10,fill:"none",strokeWidth:2,strokeDasharray:14,strokeDashoffset:e?28:42,style:{transition:"all 400ms"}}):s.jsxRuntimeExports.jsx("polyline",{points:"1 9 7 14 15 4",fill:"none",strokeWidth:2,strokeDasharray:22,strokeDashoffset:a?44:66,style:{transition:"all 400ms"}})})};exports.MarkIcon=c;
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 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 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 e=require("./index.cjs10.js"),l=require("react-aria-components"),x=require("./index.cjs11.js"),p=require("./index.cjs19.js"),b=require("./index.cjs14.js"),h=({isIndeterminate:c=!1,isDisabled:s=!1,className:u,children:r,onChange:i,isSelected:n,id:o,...m})=>{const j=(a,t)=>x.cn(b.checkboxVariants({isDisabled:s,isFocusVisible:a,isHovered:t,isSelected:n,label:!!r}));return e.jsxRuntimeExports.jsx(l.Checkbox,{className:x.cn("group flex items-center",u),isSelected:n,isDisabled:s,id:o,onChange:i,...m,children:({isFocusVisible:a,isHovered:t})=>e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:j(a,t),"aria-hidden":"true",children:e.jsxRuntimeExports.jsx(p.MarkIcon,{isIndeterminate:c,isHovered:t,isSelected:n,className:"size-3"})}),r&&e.jsxRuntimeExports.jsx("span",{className:x.cn("select-none text-base leading-6",s?"text-neutral-500":"text-primary-900"),id:o,children:r})]})})};exports.Checkbox=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.cjs10.js"),l=require("react-aria-components"),x=require("./index.cjs11.js"),p=require("./index.cjs18.js"),b=require("./index.cjs14.js"),h=({isIndeterminate:c=!1,isDisabled:s=!1,className:u,children:r,onChange:i,isSelected:n,id:o,...m})=>{const j=(a,t)=>x.cn(b.checkboxVariants({isDisabled:s,isFocusVisible:a,isHovered:t,isSelected:n,label:!!r}));return e.jsxRuntimeExports.jsx(l.Checkbox,{className:x.cn("group flex items-center",u),isSelected:n,isDisabled:s,id:o,onChange:i,...m,children:({isFocusVisible:a,isHovered:t})=>e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:j(a,t),"aria-hidden":"true",children:e.jsxRuntimeExports.jsx(p.MarkIcon,{isIndeterminate:c,isHovered:t,isSelected:n,className:"size-3"})}),r&&e.jsxRuntimeExports.jsx("span",{className:x.cn("select-none text-base leading-6",s?"text-neutral-500":"text-primary-900"),id:o,children:r})]})})};exports.Checkbox=h;
@@ -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.cjs20.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"),q=require("react"),n=require("react-aria-components"),R=require("./index.cjs11.js"),g=require("./index.cjs17.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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index.cjs10.js"),l=require("react-aria-components"),a=require("./index.cjs11.js"),d=require("./index.cjs17.js"),q=require("./index.cjs18.js"),y=require("./index.cjs15.js"),R=({children:o,label:i,description:c,errorMessage:x,validationState:u,size:e="md",isDisabled:t=!1,isSelected:r=!1,onChange:f,"aria-label":m,"aria-describedby":h})=>{const j=u==="invalid"&&!t,p=e==="sm"?{offLeft:3,onLeft:19}:{offLeft:4,onLeft:28};return n.jsxRuntimeExports.jsxs("label",{className:a.cn("group flex flex-row gap-2",t?"opacity-40":"opacity-100",(i||o)&&c?"items-start":"items-center"),children:[n.jsxRuntimeExports.jsx(l.Switch,{isDisabled:t,isSelected:r,"aria-checked":r,"aria-label":m,"aria-describedby":h,onChange:f,children:({isFocusVisible:w,isHovered:s})=>n.jsxRuntimeExports.jsx("div",{className:a.cn(y.switchVariants({isSelected:r,isDisabled:t,isFocusVisible:w,size:e,isHoveredWhenOff:s&&!r})),children:n.jsxRuntimeExports.jsx(q.SwitchIndicator,{isSelected:r,isDisabled:t,isHovered:s,size:e,dimensions:p})})}),n.jsxRuntimeExports.jsx(d.ContentSwitch,{label:i,description:c,errorMessage:x,isDisabled:t,isInvalid:j,children:o})]})};exports.Switch=R;
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,17 +1,154 @@
1
- import { j as t } from "./index.es10.js";
2
- import { cn as m } from "./index.es11.js";
3
- const u = ({
4
- label: x,
5
- description: e,
6
- errorMessage: n,
7
- isDisabled: s,
8
- isInvalid: r,
9
- children: l
10
- }) => !x && !e && !l ? null : /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col", children: [
11
- x ? /* @__PURE__ */ t.jsx("p", { className: m("text-sm font-semibold", s ? "text-neutral-600" : "text-neutral-900"), children: x }) : l,
12
- e && !n && /* @__PURE__ */ t.jsx("p", { className: m("text-xs", s ? "text-neutral-600" : "text-neutral-800"), children: e }),
13
- r && n && /* @__PURE__ */ t.jsx("p", { className: "text-sm text-red-500", children: n })
14
- ] });
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
+ );
15
152
  export {
16
- u as ContentSwitch
153
+ a as buttonVariants
17
154
  };
@@ -1,22 +1,32 @@
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`
1
+ import { j as e } from "./index.es10.js";
2
+ import { cn as l } from "./index.es11.js";
3
+ const m = (r) => {
4
+ const { isIndeterminate: t, isSelected: s, className: n, isHovered: a } = r, o = a && !s && !t ? "text-neutral-500" : "", i = !!(o || s);
5
+ return /* @__PURE__ */ e.jsx("svg", { className: l("stroke-current", o, n), viewBox: "-1 1 17 17", children: t ? /* @__PURE__ */ e.jsx(
6
+ "line",
7
+ {
8
+ x1: 1,
9
+ y1: 10,
10
+ x2: 14,
11
+ y2: 10,
12
+ fill: "none",
13
+ strokeWidth: 2,
14
+ strokeDasharray: 14,
15
+ strokeDashoffset: s ? 28 : 42,
16
+ style: { transition: "all 400ms" }
17
17
  }
18
- }
19
- );
18
+ ) : /* @__PURE__ */ e.jsx(
19
+ "polyline",
20
+ {
21
+ points: "1 9 7 14 15 4",
22
+ fill: "none",
23
+ strokeWidth: 2,
24
+ strokeDasharray: 22,
25
+ strokeDashoffset: i ? 44 : 66,
26
+ style: { transition: "all 400ms" }
27
+ }
28
+ ) });
29
+ };
20
30
  export {
21
- c as SwitchIndicator
31
+ m as MarkIcon
22
32
  };
@@ -1,32 +1,21 @@
1
- import { j as e } from "./index.es10.js";
2
- import { cn as l } from "./index.es11.js";
3
- const m = (r) => {
4
- const { isIndeterminate: t, isSelected: s, className: n, isHovered: a } = r, o = a && !s && !t ? "text-neutral-500" : "", i = !!(o || s);
5
- return /* @__PURE__ */ e.jsx("svg", { className: l("stroke-current", o, n), viewBox: "-1 1 17 17", children: t ? /* @__PURE__ */ e.jsx(
6
- "line",
7
- {
8
- x1: 1,
9
- y1: 10,
10
- x2: 14,
11
- y2: 10,
12
- fill: "none",
13
- strokeWidth: 2,
14
- strokeDasharray: 14,
15
- strokeDashoffset: s ? 28 : 42,
16
- style: { transition: "all 400ms" }
17
- }
18
- ) : /* @__PURE__ */ e.jsx(
19
- "polyline",
20
- {
21
- points: "1 9 7 14 15 4",
22
- fill: "none",
23
- strokeWidth: 2,
24
- strokeDasharray: 22,
25
- strokeDashoffset: i ? 44 : 66,
26
- style: { transition: "all 400ms" }
27
- }
28
- ) });
29
- };
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
+ ] });
30
19
  export {
31
- m as MarkIcon
20
+ i as ContentSwitch
32
21
  };
@@ -1,154 +1,22 @@
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]
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
+ }
150
18
  }
151
19
  );
152
20
  export {
153
- a as buttonVariants
21
+ c as SwitchIndicator
154
22
  };
package/dist/index.es4.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { j as e } from "./index.es10.js";
2
2
  import { Checkbox as h } from "react-aria-components";
3
3
  import { cn as m } from "./index.es11.js";
4
- import { MarkIcon as i } from "./index.es19.js";
4
+ import { MarkIcon as i } from "./index.es18.js";
5
5
  import { checkboxVariants as j } from "./index.es14.js";
6
6
  const g = ({
7
7
  isIndeterminate: x = !1,
package/dist/index.es5.js CHANGED
@@ -2,7 +2,7 @@ import { j as s } from "./index.es10.js";
2
2
  import { forwardRef as j } from "react";
3
3
  import { useContextProps as B, ButtonContext as w, Button as C } from "react-aria-components";
4
4
  import { cn as N } from "./index.es11.js";
5
- import { buttonVariants as g } from "./index.es20.js";
5
+ import { buttonVariants as g } from "./index.es17.js";
6
6
  function v(r, i) {
7
7
  const [c, a] = B(r, i, w), {
8
8
  intent: m = "secondary",
package/dist/index.es7.js CHANGED
@@ -1,59 +1,56 @@
1
1
  import { j as o } from "./index.es10.js";
2
- import { Switch as y } from "react-aria-components";
3
- import { cn as i } from "./index.es11.js";
4
- import { ContentSwitch as L } from "./index.es17.js";
5
- import { SwitchIndicator as d } from "./index.es18.js";
6
- import { switchVariants as u } from "./index.es15.js";
7
- const C = ({
2
+ import { Switch as u } from "react-aria-components";
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";
6
+ import { switchVariants as b } from "./index.es15.js";
7
+ const E = ({
8
8
  children: f,
9
9
  label: m,
10
10
  description: n,
11
11
  errorMessage: s,
12
- validationState: p,
12
+ validationState: e,
13
13
  size: a = "md",
14
14
  isDisabled: r = !1,
15
15
  isSelected: t = !1,
16
- onChange: e,
17
- "aria-label": h,
18
- "aria-describedby": x
16
+ onChange: h,
17
+ renderLabelIcon: x = null,
18
+ "aria-label": p,
19
+ "aria-describedby": l
19
20
  }) => {
20
- const j = p === "invalid" && !r, w = a === "sm" ? { offLeft: 3, onLeft: 19 } : { offLeft: 4, onLeft: 28 };
21
+ const j = e === "invalid" && !r, w = a === "sm" ? { offLeft: 3, onLeft: 19 } : { offLeft: 4, onLeft: 28 };
21
22
  return /* @__PURE__ */ o.jsxs(
22
23
  "label",
23
24
  {
24
- className: i(
25
- "group flex flex-row gap-2",
26
- r ? "opacity-40" : "opacity-100",
27
- (m || f) && n ? "items-start" : "items-center"
28
- ),
25
+ className: c("group flex flex-row gap-2", (m || f) && n ? "items-start" : "items-center"),
29
26
  children: [
30
27
  /* @__PURE__ */ o.jsx(
31
- y,
28
+ u,
32
29
  {
33
30
  isDisabled: r,
34
31
  isSelected: t,
35
32
  "aria-checked": t,
36
- "aria-label": h,
37
- "aria-describedby": x,
38
- onChange: e,
39
- children: ({ isFocusVisible: l, isHovered: c }) => /* @__PURE__ */ o.jsx(
33
+ "aria-label": p,
34
+ "aria-describedby": l,
35
+ onChange: h,
36
+ children: ({ isFocusVisible: d, isHovered: i }) => /* @__PURE__ */ o.jsx(
40
37
  "div",
41
38
  {
42
- className: i(
43
- u({
39
+ className: c(
40
+ b({
44
41
  isSelected: t,
45
42
  isDisabled: r,
46
- isFocusVisible: l,
43
+ isFocusVisible: d,
47
44
  size: a,
48
- isHoveredWhenOff: c && !t
45
+ isHoveredWhenOff: i && !t
49
46
  })
50
47
  ),
51
48
  children: /* @__PURE__ */ o.jsx(
52
- d,
49
+ v,
53
50
  {
54
51
  isSelected: t,
55
52
  isDisabled: r,
56
- isHovered: c,
53
+ isHovered: i,
57
54
  size: a,
58
55
  dimensions: w
59
56
  }
@@ -70,6 +67,7 @@ const C = ({
70
67
  errorMessage: s,
71
68
  isDisabled: r,
72
69
  isInvalid: j,
70
+ renderLabelIcon: x,
73
71
  children: f
74
72
  }
75
73
  )
@@ -78,5 +76,5 @@ const C = ({
78
76
  );
79
77
  };
80
78
  export {
81
- C as Switch
79
+ E as Switch
82
80
  };
@@ -2,7 +2,7 @@ import { StoryObj } from '@storybook/react';
2
2
 
3
3
  declare const meta: {
4
4
  title: string;
5
- component: ({ children, label, description, errorMessage, validationState, size, isDisabled, isSelected, onChange, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, }: import('../components').SwitchProps) => import("react/jsx-runtime").JSX.Element;
5
+ component: ({ children, label, description, errorMessage, validationState, size, isDisabled, isSelected, onChange, renderLabelIcon, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, }: import('../components').SwitchProps) => import("react/jsx-runtime").JSX.Element;
6
6
  parameters: {
7
7
  layout: string;
8
8
  };
@@ -27,3 +27,4 @@ type Story = StoryObj<typeof meta>;
27
27
  export declare const Primary: Story;
28
28
  export declare const DisabledSelected: Story;
29
29
  export declare const DisabledUnselected: Story;
30
+ export declare const LabelAndIcon: Story;
package/dist/style.css CHANGED
@@ -783,6 +783,10 @@ select {
783
783
  width: 1rem;
784
784
  height: 1rem;
785
785
  }
786
+ .size-5 {
787
+ width: 1.25rem;
788
+ height: 1.25rem;
789
+ }
786
790
  .size-6 {
787
791
  width: 1.5rem;
788
792
  height: 1.5rem;
@@ -929,6 +933,10 @@ select {
929
933
  .gap-2 {
930
934
  gap: 0.5rem;
931
935
  }
936
+ .gap-x-1 {
937
+ -moz-column-gap: 0.25rem;
938
+ column-gap: 0.25rem;
939
+ }
932
940
  .gap-x-2 {
933
941
  -moz-column-gap: 0.5rem;
934
942
  column-gap: 0.5rem;
@@ -1120,6 +1128,10 @@ select {
1120
1128
  --tw-bg-opacity: 1;
1121
1129
  background-color: rgb(255 229 152 / var(--tw-bg-opacity));
1122
1130
  }
1131
+ .bg-yellow-warning-400 {
1132
+ --tw-bg-opacity: 1;
1133
+ background-color: rgb(255 220 115 / var(--tw-bg-opacity));
1134
+ }
1123
1135
  .bg-yellow-warning-500 {
1124
1136
  --tw-bg-opacity: 1;
1125
1137
  background-color: rgb(255 204 51 / var(--tw-bg-opacity));
@@ -1343,11 +1355,9 @@ select {
1343
1355
  --tw-text-opacity: 1;
1344
1356
  color: rgb(255 255 255 / var(--tw-text-opacity));
1345
1357
  }
1346
- .opacity-100 {
1347
- opacity: 1;
1348
- }
1349
- .opacity-40 {
1350
- opacity: 0.4;
1358
+ .text-yellow-warning-900 {
1359
+ --tw-text-opacity: 1;
1360
+ color: rgb(111 87 17 / var(--tw-text-opacity));
1351
1361
  }
1352
1362
  .opacity-70 {
1353
1363
  opacity: 0.7;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simpli-route/apollo-ds",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"