@simpli-route/apollo-ds 0.0.14 → 0.0.15

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.
@@ -21,4 +21,5 @@ export interface MarkIconProps {
21
21
  className?: string;
22
22
  isIndeterminate?: boolean;
23
23
  isSelected?: boolean;
24
+ isHovered?: boolean;
24
25
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.cjs10.js"),o=require("./index.cjs11.js"),i=t=>{const{isIndeterminate:r,isSelected:s,className:n}=t;return e.jsxRuntimeExports.jsx("svg",{className:o.cn("stroke-current",n),viewBox:"-1 1 17 17",children:r?e.jsxRuntimeExports.jsx("line",{x1:1,y1:10,x2:14,y2:10,fill:"none",strokeWidth:2,strokeDasharray:14,strokeDashoffset:s?28:42,style:{transition:"all 400ms"}}):e.jsxRuntimeExports.jsx("polyline",{points:"1 9 7 14 15 4",fill:"none",strokeWidth:2,strokeDasharray:22,strokeDashoffset:s?44:66,style:{transition:"all 400ms"}})})};exports.MarkIcon=i;
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 r=require("class-variance-authority"),e=r.cva("flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded border-2 border-primary-200 text-white transition duration-150 ease-in-out",{variants:{isHovered:{true:""},isSelected:{true:"border-primary-500 bg-primary-500",false:"bg-white"},isFocusVisible:{true:"border-primary-500 group-active:border-primary-500"},isDisabled:{true:"border-neutral-500 bg-neutral-500"},label:{true:"mr-2"}},compoundVariants:[{isHovered:!0,isSelected:!0,class:"border-none bg-primary-600 group-active:bg-primary-600"},{isHovered:!0,isSelected:!1,isDisabled:!1,class:"border-primary-700 group-active:bg-primary-600"}]});exports.checkboxVariants=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("class-variance-authority"),r=e.cva("flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded border-2 border-primary-200 text-white transition duration-150 ease-in-out",{variants:{isHovered:{true:""},isSelected:{true:"border-primary-500 bg-primary-500",false:"bg-white"},isFocusVisible:{true:"border-primary-500 group-active:border-primary-500"},isDisabled:{true:"border-neutral-500"},label:{true:"mr-2"}},compoundVariants:[{isHovered:!0,isSelected:!0,class:"border-none bg-primary-600 group-active:bg-primary-600"},{isHovered:!0,isSelected:!1,isDisabled:!1,class:"border-primary-700 group-active:bg-primary-600"},{isDisabled:!0,isSelected:!0,class:"bg-neutral-500"}]});exports.checkboxVariants=r;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.cjs10.js"),l=require("react-aria-components"),o=require("./index.cjs11.js"),p=require("./index.cjs13.js"),b=require("./index.cjs14.js"),h=({isIndeterminate:c=!1,isDisabled:t=!1,className:i,children:s,onChange:u,isSelected:r,id:x,...m})=>{const j=(n,a)=>o.cn(b.checkboxVariants({isDisabled:t,isFocusVisible:n,isHovered:a,isSelected:r,label:!!s}));return e.jsxRuntimeExports.jsx(l.Checkbox,{className:o.cn("group flex items-center",i),isSelected:r,isDisabled:t,id:x,onChange:u,...m,children:({isFocusVisible:n,isHovered:a})=>e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:j(n,a),"aria-hidden":"true",children:e.jsxRuntimeExports.jsx(p.MarkIcon,{isIndeterminate:c,isSelected:r,className:"size-3"})}),s&&e.jsxRuntimeExports.jsx("span",{className:o.cn("select-none text-base leading-6",t?"text-neutral-500":"text-primary-900"),id:x,children:s})]})})};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.cjs13.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 r=require("./index.cjs10.js"),d=require("react-aria-components"),o=require("./index.cjs11.js"),w=require("./index.cjs15.js"),q=require("./index.cjs16.js"),y=require("./index.cjs17.js"),R=({children:c,label:a,description:s,errorMessage:x,validationState:u,size:e="md",isDisabled:t=!1,isSelected:n=!1,onChange:f,"aria-label":m,"aria-describedby":h})=>{const j=u==="invalid"&&!t,l=e==="sm"?{offLeft:3,onLeft:19}:{offLeft:4,onLeft:28};return r.jsxRuntimeExports.jsxs("label",{className:o.cn("group flex flex-row items-center gap-2",t?"opacity-40":"opacity-100"),children:[r.jsxRuntimeExports.jsx(d.Switch,{isDisabled:t,isSelected:n,"aria-checked":n,"aria-label":m,"aria-describedby":h,onChange:f,children:({isFocusVisible:p,isHovered:i})=>r.jsxRuntimeExports.jsx("div",{className:o.cn(y.switchVariants({isSelected:n,isDisabled:t,isFocusVisible:p,size:e,isHoveredWhenOff:i&&!n})),children:r.jsxRuntimeExports.jsx(q.SwitchIndicator,{isSelected:n,isDisabled:t,isHovered:i,size:e,dimensions:l})})}),r.jsxRuntimeExports.jsx(w.ContentSwitch,{label:a,description:s,errorMessage:x,isDisabled:t,isInvalid:j,children:c})]})};exports.Switch=R;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index.cjs10.js"),w=require("react-aria-components"),s=require("./index.cjs11.js"),d=require("./index.cjs15.js"),q=require("./index.cjs16.js"),y=require("./index.cjs17.js"),R=({children:a,label:i,description:o,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:s.cn("group flex flex-row gap-2",t?"opacity-40":"opacity-100",i&&o?"items-start":"items-center"),children:[n.jsxRuntimeExports.jsx(w.Switch,{isDisabled:t,isSelected:r,"aria-checked":r,"aria-label":m,"aria-describedby":h,onChange:f,children:({isFocusVisible:l,isHovered:c})=>n.jsxRuntimeExports.jsx("div",{className:s.cn(y.switchVariants({isSelected:r,isDisabled:t,isFocusVisible:l,size:e,isHoveredWhenOff:c&&!r})),children:n.jsxRuntimeExports.jsx(q.SwitchIndicator,{isSelected:r,isDisabled:t,isHovered:c,size:e,dimensions:p})})}),n.jsxRuntimeExports.jsx(d.ContentSwitch,{label:i,description:o,errorMessage:x,isDisabled:t,isInvalid:j,children:a})]})};exports.Switch=R;
@@ -1,8 +1,8 @@
1
- import { j as s } from "./index.es10.js";
2
- import { cn as n } from "./index.es11.js";
3
- const l = (e) => {
4
- const { isIndeterminate: r, isSelected: t, className: o } = e;
5
- return /* @__PURE__ */ s.jsx("svg", { className: n("stroke-current", o), viewBox: "-1 1 17 17", children: r ? /* @__PURE__ */ s.jsx(
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
6
  "line",
7
7
  {
8
8
  x1: 1,
@@ -12,21 +12,21 @@ const l = (e) => {
12
12
  fill: "none",
13
13
  strokeWidth: 2,
14
14
  strokeDasharray: 14,
15
- strokeDashoffset: t ? 28 : 42,
15
+ strokeDashoffset: s ? 28 : 42,
16
16
  style: { transition: "all 400ms" }
17
17
  }
18
- ) : /* @__PURE__ */ s.jsx(
18
+ ) : /* @__PURE__ */ e.jsx(
19
19
  "polyline",
20
20
  {
21
21
  points: "1 9 7 14 15 4",
22
22
  fill: "none",
23
23
  strokeWidth: 2,
24
24
  strokeDasharray: 22,
25
- strokeDashoffset: t ? 44 : 66,
25
+ strokeDashoffset: i ? 44 : 66,
26
26
  style: { transition: "all 400ms" }
27
27
  }
28
28
  ) });
29
29
  };
30
30
  export {
31
- l as MarkIcon
31
+ m as MarkIcon
32
32
  };
@@ -14,7 +14,7 @@ const i = r(
14
14
  true: "border-primary-500 group-active:border-primary-500"
15
15
  },
16
16
  isDisabled: {
17
- true: "border-neutral-500 bg-neutral-500"
17
+ true: "border-neutral-500"
18
18
  },
19
19
  label: {
20
20
  true: "mr-2"
@@ -31,6 +31,11 @@ const i = r(
31
31
  isSelected: !1,
32
32
  isDisabled: !1,
33
33
  class: "border-primary-700 group-active:bg-primary-600"
34
+ },
35
+ {
36
+ isDisabled: !0,
37
+ isSelected: !0,
38
+ class: "bg-neutral-500"
34
39
  }
35
40
  ]
36
41
  }
package/dist/index.es4.js CHANGED
@@ -1,44 +1,52 @@
1
1
  import { j as e } from "./index.es10.js";
2
- import { Checkbox as i } from "react-aria-components";
2
+ import { Checkbox as h } from "react-aria-components";
3
3
  import { cn as m } from "./index.es11.js";
4
- import { MarkIcon as h } from "./index.es13.js";
4
+ import { MarkIcon as i } from "./index.es13.js";
5
5
  import { checkboxVariants as j } from "./index.es14.js";
6
6
  const g = ({
7
7
  isIndeterminate: x = !1,
8
- isDisabled: r = !1,
8
+ isDisabled: a = !1,
9
9
  className: c,
10
- children: a,
10
+ children: t,
11
11
  onChange: l,
12
12
  isSelected: s,
13
13
  id: n,
14
14
  ...p
15
15
  }) => {
16
- const f = (t, o) => m(
16
+ const f = (o, r) => m(
17
17
  j({
18
- isDisabled: r,
19
- isFocusVisible: t,
20
- isHovered: o,
18
+ isDisabled: a,
19
+ isFocusVisible: o,
20
+ isHovered: r,
21
21
  isSelected: s,
22
- label: !!a
22
+ label: !!t
23
23
  })
24
24
  );
25
25
  return /* @__PURE__ */ e.jsx(
26
- i,
26
+ h,
27
27
  {
28
28
  className: m("group flex items-center", c),
29
29
  isSelected: s,
30
- isDisabled: r,
30
+ isDisabled: a,
31
31
  id: n,
32
32
  onChange: l,
33
33
  ...p,
34
- children: ({ isFocusVisible: t, isHovered: o }) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
35
- /* @__PURE__ */ e.jsx("div", { className: f(t, o), "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(h, { isIndeterminate: x, isSelected: s, className: "size-3" }) }),
36
- a && /* @__PURE__ */ e.jsx(
34
+ children: ({ isFocusVisible: o, isHovered: r }) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
35
+ /* @__PURE__ */ e.jsx("div", { className: f(o, r), "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(
36
+ i,
37
+ {
38
+ isIndeterminate: x,
39
+ isHovered: r,
40
+ isSelected: s,
41
+ className: "size-3"
42
+ }
43
+ ) }),
44
+ t && /* @__PURE__ */ e.jsx(
37
45
  "span",
38
46
  {
39
- className: m("select-none text-base leading-6", r ? "text-neutral-500" : "text-primary-900"),
47
+ className: m("select-none text-base leading-6", a ? "text-neutral-500" : "text-primary-900"),
40
48
  id: n,
41
- children: a
49
+ children: t
42
50
  }
43
51
  )
44
52
  ] })
package/dist/index.es6.js CHANGED
@@ -1,71 +1,81 @@
1
- import { j as t } from "./index.es10.js";
1
+ import { j as o } from "./index.es10.js";
2
2
  import { Switch as d } from "react-aria-components";
3
- import { cn as f } from "./index.es11.js";
3
+ import { cn as c } from "./index.es11.js";
4
4
  import { ContentSwitch as y } from "./index.es15.js";
5
5
  import { SwitchIndicator as L } from "./index.es16.js";
6
6
  import { switchVariants as u } from "./index.es17.js";
7
7
  const C = ({
8
- children: c,
9
- label: i,
8
+ children: i,
9
+ label: f,
10
10
  description: m,
11
- errorMessage: e,
12
- validationState: p,
11
+ errorMessage: s,
12
+ validationState: e,
13
13
  size: a = "md",
14
14
  isDisabled: r = !1,
15
- isSelected: o = !1,
16
- onChange: s,
17
- "aria-label": h,
15
+ isSelected: t = !1,
16
+ onChange: h,
17
+ "aria-label": p,
18
18
  "aria-describedby": x
19
19
  }) => {
20
- const l = p === "invalid" && !r, j = a === "sm" ? { offLeft: 3, onLeft: 19 } : { offLeft: 4, onLeft: 28 };
21
- return /* @__PURE__ */ t.jsxs("label", { className: f("group flex flex-row items-center gap-2", r ? "opacity-40" : "opacity-100"), children: [
22
- /* @__PURE__ */ t.jsx(
23
- d,
24
- {
25
- isDisabled: r,
26
- isSelected: o,
27
- "aria-checked": o,
28
- "aria-label": h,
29
- "aria-describedby": x,
30
- onChange: s,
31
- children: ({ isFocusVisible: w, isHovered: n }) => /* @__PURE__ */ t.jsx(
32
- "div",
20
+ const j = e === "invalid" && !r, w = a === "sm" ? { offLeft: 3, onLeft: 19 } : { offLeft: 4, onLeft: 28 };
21
+ return /* @__PURE__ */ o.jsxs(
22
+ "label",
23
+ {
24
+ className: c(
25
+ "group flex flex-row gap-2",
26
+ r ? "opacity-40" : "opacity-100",
27
+ f && m ? "items-start" : "items-center"
28
+ ),
29
+ children: [
30
+ /* @__PURE__ */ o.jsx(
31
+ d,
33
32
  {
34
- className: f(
35
- u({
36
- isSelected: o,
37
- isDisabled: r,
38
- isFocusVisible: w,
39
- size: a,
40
- isHoveredWhenOff: n && !o
41
- })
42
- ),
43
- children: /* @__PURE__ */ t.jsx(
44
- L,
33
+ isDisabled: r,
34
+ isSelected: t,
35
+ "aria-checked": t,
36
+ "aria-label": p,
37
+ "aria-describedby": x,
38
+ onChange: h,
39
+ children: ({ isFocusVisible: l, isHovered: n }) => /* @__PURE__ */ o.jsx(
40
+ "div",
45
41
  {
46
- isSelected: o,
47
- isDisabled: r,
48
- isHovered: n,
49
- size: a,
50
- dimensions: j
42
+ className: c(
43
+ u({
44
+ isSelected: t,
45
+ isDisabled: r,
46
+ isFocusVisible: l,
47
+ size: a,
48
+ isHoveredWhenOff: n && !t
49
+ })
50
+ ),
51
+ children: /* @__PURE__ */ o.jsx(
52
+ L,
53
+ {
54
+ isSelected: t,
55
+ isDisabled: r,
56
+ isHovered: n,
57
+ size: a,
58
+ dimensions: w
59
+ }
60
+ )
51
61
  }
52
62
  )
53
63
  }
64
+ ),
65
+ /* @__PURE__ */ o.jsx(
66
+ y,
67
+ {
68
+ label: f,
69
+ description: m,
70
+ errorMessage: s,
71
+ isDisabled: r,
72
+ isInvalid: j,
73
+ children: i
74
+ }
54
75
  )
55
- }
56
- ),
57
- /* @__PURE__ */ t.jsx(
58
- y,
59
- {
60
- label: i,
61
- description: m,
62
- errorMessage: e,
63
- isDisabled: r,
64
- isInvalid: l,
65
- children: c
66
- }
67
- )
68
- ] });
76
+ ]
77
+ }
78
+ );
69
79
  };
70
80
  export {
71
81
  C as Switch
@@ -7,6 +7,11 @@ declare const meta: {
7
7
  layout: string;
8
8
  };
9
9
  tags: string[];
10
+ argTypes: {
11
+ children: {
12
+ control: string;
13
+ };
14
+ };
10
15
  };
11
16
  export default meta;
12
17
  type Story = StoryObj<typeof meta>;
package/dist/style.css CHANGED
@@ -899,6 +899,9 @@ select {
899
899
  .flex-wrap {
900
900
  flex-wrap: wrap;
901
901
  }
902
+ .items-start {
903
+ align-items: flex-start;
904
+ }
902
905
  .items-end {
903
906
  align-items: flex-end;
904
907
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simpli-route/apollo-ds",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"