@simpli-route/apollo-ds 0.0.2 → 0.0.4

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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index.cjs3.js"),E=require("react-aria-components"),b=require("./index.cjs4.js"),q=require("./index.cjs5.js"),N=require("./index.cjs6.js"),j=({renderPosition:e,leftIcon:o,rightIcon:l,isLoading:n,loaderPosition:r,loaderProps:t})=>{const i=e==="left"?o:e==="right"?l:null;return i||n&&r===e?s.jsxRuntimeExports.jsx("span",{className:e==="left"?"mr-1":"ml-1",children:n&&r===e?s.jsxRuntimeExports.jsx(N.Loader,{size:"sm",...t}):i}):null},y=e=>{const{intent:o="primary",size:l="md",leftIcon:n,rightIcon:r,isDisabled:t,children:i,className:p,isLoading:a,loaderPosition:m="left",loaderProps:x,fullWidth:h=!1,unstyled:f=!1,focus:R=!0,...g}=e,v=(u,c,d)=>b.cn(f?"":q.buttonVariants({intent:o,size:l,isHovered:c,isActive:u,isDisabled:t,isFocused:R||!f?d:!1,fullWidth:h,isLoading:a}),p);return s.jsxRuntimeExports.jsxs(E.Button,{"data-disabled":t||void 0,"data-loading":a||void 0,isDisabled:t,className:({isPressed:u,isHovered:c,isFocused:d})=>v(u,c,d),...g,children:[s.jsxRuntimeExports.jsx(j,{renderPosition:"left",loaderPosition:m,loaderProps:x,isLoading:a,leftIcon:n}),s.jsxRuntimeExports.jsx("span",{className:"flex h-full items-center overflow-hidden whitespace-nowrap",children:i}),s.jsxRuntimeExports.jsx(j,{renderPosition:"right",loaderPosition:m,loaderProps:x,isLoading:a,rightIcon:r})]})};exports.Button=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index.cjs3.js"),E=require("react-aria-components"),b=require("./index.cjs4.js"),q=require("./index.cjs5.js"),N=require("./index.cjs6.js"),p=({renderPosition:e,leftIcon:u,rightIcon:c,isLoading:n,loaderPosition:r,loaderProps:s})=>{const a=e==="left"?u:e==="right"?c:null;return a||n&&r===e?t.jsxRuntimeExports.jsx("span",{className:e==="left"?"mr-1":"ml-1",children:n&&r===e?t.jsxRuntimeExports.jsx(N.Loader,{size:"sm",...s}):a}):null},y=e=>{const{intent:u="primary",size:c="md",leftIcon:n,rightIcon:r,isDisabled:s,children:a,className:h,isLoading:i,loaderPosition:x="left",loaderProps:f,fullWidth:R=!1,unstyled:d=!1,focus:j=!0,...g}=e,v=(m,l,o)=>b.cn(d?"":q.buttonVariants({intent:u,size:c,isHovered:l||(j||!d?o:!1),isActive:m,isDisabled:s,isFocused:j||!d?o:!1,fullWidth:R,isLoading:i}),h);return t.jsxRuntimeExports.jsxs(E.Button,{"data-disabled":s||void 0,"data-loading":i||void 0,isDisabled:s,className:({isPressed:m,isHovered:l,isFocusVisible:o})=>v(m,l,o),...g,children:[t.jsxRuntimeExports.jsx(p,{renderPosition:"left",loaderPosition:x,loaderProps:f,isLoading:i,leftIcon:n}),t.jsxRuntimeExports.jsx("span",{className:"flex h-full items-center overflow-hidden whitespace-nowrap",children:a}),t.jsxRuntimeExports.jsx(p,{renderPosition:"right",loaderPosition:x,loaderProps:f,isLoading:i,rightIcon:r})]})};exports.Button=y;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("class-variance-authority"),e=r.cva("inline-flex select-none items-center justify-center text-center text-base font-semibold leading-6 transition duration-150 ease-in-out focus:outline-none",{variants:{intent:{primary:"bg-primary-500 text-primary-50",secondary:"border border-primary-500 bg-primary-50 text-primary-500",tertiary:"text-primary-500",outline:"border border-primary-500 text-primary-500",success:"border border-success-800 text-success-800",error:"border border-error-800 text-error-800",orangeWarning:"border border-orange-warning-800 text-orange-warning-800",yellowWarning:"border border-yellow-warning-800 text-yellow-warning-800",info:"border border-primary-800 text-primary-800"},size:{sm:"rounded px-3 py-2",md:"rounded-lg px-4 py-3",lg:"rounded-lg px-6 py-4"},isDisabled:{true:"pointer-events-none cursor-not-allowed border-none bg-neutral-400 text-neutral-600"},isHovered:{true:""},isActive:{true:""},fullWidth:{true:"w-full",false:"w-fit"},isLoading:{true:"pointer-events-none cursor-not-allowed opacity-70"},isFocused:{true:"focus:outline-none focus:ring-2 focus:ring-sky-400 focus:ring-offset-2",false:""}},defaultVariants:{intent:"primary",size:"md"},compoundVariants:[{intent:"primary",isHovered:!0,class:"bg-primary-700"},{intent:"secondary",isHovered:!0,class:"bg-primary-200"},{intent:"tertiary",isHovered:!0,class:"bg-primary-300 text-primary-800"},{intent:"outline",isHovered:!0,class:"bg-primary-500 text-primary-50"},{intent:"success",isHovered:!0,class:"bg-success-600 text-neutral-50"},{intent:"error",isHovered:!0,class:"bg-error-600 text-neutral-50"},{intent:"orangeWarning",isHovered:!0,class:"bg-orange-warning-600 text-neutral-50"},{intent:"yellowWarning",isHovered:!0,class:"bg-yellow-warning-600 text-neutral-50"},{intent:"info",isHovered:!0,class:"bg-primary-600 text-neutral-50"},{intent:"primary",isActive:!0,class:"bg-primary-900"},{intent:"secondary",isActive:!0,class:"bg-primary-300"},{intent:"tertiary",isActive:!0,class:"bg-primary-500 text-white"},{intent:"outline",isActive:!0,class:"border border-primary-500 bg-primary-300 text-primary-500"},{intent:"success",isActive:!0,class:"border border-transparent bg-success-300 text-success-600"},{intent:"error",isActive:!0,class:"border border-transparent bg-error-300 text-error-600"},{intent:"orangeWarning",isActive:!0,class:"border border-transparent bg-orange-warning-300 text-orange-warning-600"},{intent:"yellowWarning",isActive:!0,class:"border border-transparent bg-yellow-warning-300 text-yellow-warning-600"},{intent:"info",isActive:!0,class:"border border-transparent bg-primary-300 text-primary-600"}]});exports.buttonVariants=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("class-variance-authority"),e=r.cva("inline-flex select-none items-center justify-center text-center text-base font-semibold leading-6 transition duration-150 ease-in-out focus:outline-none",{variants:{intent:{primary:"bg-primary-500 text-primary-50",secondary:"border border-primary-500 bg-primary-50 text-primary-500",tertiary:"text-primary-500",outline:"border border-primary-500 text-primary-500",success:"border border-success-800 text-success-800",error:"border border-error-800 text-error-800",orangeWarning:"border border-orange-warning-800 text-orange-warning-800",yellowWarning:"border border-yellow-warning-800 text-yellow-warning-800",info:"border border-primary-800 text-primary-800"},size:{sm:"rounded px-3 py-2",md:"rounded-lg px-4 py-3",lg:"rounded-lg px-6 py-4"},isDisabled:{true:"pointer-events-none cursor-not-allowed border-none bg-neutral-400 text-neutral-600"},isHovered:{true:""},isActive:{true:""},fullWidth:{true:"w-full",false:"w-fit"},isLoading:{true:"pointer-events-none cursor-not-allowed opacity-70"},isFocused:{true:"focus:outline-none focus:ring-2 focus:ring-sky-400 focus:ring-offset-[0.4px] border-none",false:""}},defaultVariants:{intent:"primary",size:"md"},compoundVariants:[{intent:"primary",isHovered:!0,class:"bg-primary-700"},{intent:"secondary",isHovered:!0,class:"bg-primary-200"},{intent:"tertiary",isHovered:!0,class:"bg-primary-300 text-primary-800"},{intent:"outline",isHovered:!0,class:"bg-primary-500 text-primary-50"},{intent:"success",isHovered:!0,class:"bg-success-600 text-neutral-50"},{intent:"error",isHovered:!0,class:"bg-error-600 text-neutral-50"},{intent:"orangeWarning",isHovered:!0,class:"bg-orange-warning-600 text-neutral-50"},{intent:"yellowWarning",isHovered:!0,class:"bg-yellow-warning-600 text-neutral-50"},{intent:"info",isHovered:!0,class:"bg-primary-600 text-neutral-50"},{intent:"success",isFocused:!0,class:"border-[1.5px] focus:ring-success-800"},{intent:"error",isFocused:!0,class:"border-[1.5px] focus:ring-error-800"},{intent:"orangeWarning",isFocused:!0,class:"border-[1.5px] focus:ring-orange-800"},{intent:"yellowWarning",isFocused:!0,class:"border-[1.5px] focus:ring-yellow-800"},{intent:"info",isFocused:!0,class:"border-[1.5px] focus:ring-primary-800"},{intent:"primary",isActive:!0,class:"bg-primary-900"},{intent:"secondary",isActive:!0,class:"bg-primary-300"},{intent:"tertiary",isActive:!0,class:"bg-primary-500 text-white"},{intent:"outline",isActive:!0,class:"border border-primary-500 bg-primary-300 text-primary-500"},{intent:"success",isActive:!0,class:"border border-transparent bg-success-300 text-success-600"},{intent:"error",isActive:!0,class:"border border-transparent bg-error-300 text-error-600"},{intent:"orangeWarning",isActive:!0,class:"border border-transparent bg-orange-warning-300 text-orange-warning-600"},{intent:"yellowWarning",isActive:!0,class:"border border-transparent bg-yellow-warning-300 text-yellow-warning-600"},{intent:"info",isActive:!0,class:"border border-transparent bg-primary-300 text-primary-600"}]});exports.buttonVariants=e;
package/dist/index.es2.js CHANGED
@@ -3,44 +3,44 @@ import { Button as I } from "react-aria-components";
3
3
  import { cn as b } from "./index.es4.js";
4
4
  import { buttonVariants as w } from "./index.es5.js";
5
5
  import { Loader as B } from "./index.es6.js";
6
- const h = ({
6
+ const x = ({
7
7
  renderPosition: s,
8
- leftIcon: o,
9
- rightIcon: i,
8
+ leftIcon: m,
9
+ rightIcon: c,
10
10
  isLoading: r,
11
11
  loaderPosition: l,
12
12
  loaderProps: e
13
13
  }) => {
14
- const a = s === "left" ? o : s === "right" ? i : null;
14
+ const a = s === "left" ? m : s === "right" ? c : null;
15
15
  return a || r && l === s ? /* @__PURE__ */ t.jsx("span", { className: s === "left" ? "mr-1" : "ml-1", children: r && l === s ? /* @__PURE__ */ t.jsx(B, { size: "sm", ...e }) : a }) : null;
16
16
  }, D = (s) => {
17
17
  const {
18
- intent: o = "primary",
19
- size: i = "md",
18
+ intent: m = "primary",
19
+ size: c = "md",
20
20
  leftIcon: r,
21
21
  rightIcon: l,
22
22
  isDisabled: e,
23
23
  children: a,
24
- className: x,
24
+ className: j,
25
25
  isLoading: n,
26
- loaderPosition: f = "left",
27
- loaderProps: u,
28
- fullWidth: j = !1,
29
- unstyled: p = !1,
30
- focus: N = !0,
26
+ loaderPosition: u = "left",
27
+ loaderProps: p,
28
+ fullWidth: N = !1,
29
+ unstyled: f = !1,
30
+ focus: h = !0,
31
31
  ...g
32
- } = s, v = (m, c, d) => b(
33
- p ? "" : w({
34
- intent: o,
35
- size: i,
36
- isHovered: c,
37
- isActive: m,
32
+ } = s, v = (d, o, i) => b(
33
+ f ? "" : w({
34
+ intent: m,
35
+ size: c,
36
+ isHovered: o || (h || !f ? i : !1),
37
+ isActive: d,
38
38
  isDisabled: e,
39
- isFocused: N || !p ? d : !1,
40
- fullWidth: j,
39
+ isFocused: h || !f ? i : !1,
40
+ fullWidth: N,
41
41
  isLoading: n
42
42
  }),
43
- x
43
+ j
44
44
  );
45
45
  return /* @__PURE__ */ t.jsxs(
46
46
  I,
@@ -48,26 +48,26 @@ const h = ({
48
48
  "data-disabled": e || void 0,
49
49
  "data-loading": n || void 0,
50
50
  isDisabled: e,
51
- className: ({ isPressed: m, isHovered: c, isFocused: d }) => v(m, c, d),
51
+ className: ({ isPressed: d, isHovered: o, isFocusVisible: i }) => v(d, o, i),
52
52
  ...g,
53
53
  children: [
54
54
  /* @__PURE__ */ t.jsx(
55
- h,
55
+ x,
56
56
  {
57
57
  renderPosition: "left",
58
- loaderPosition: f,
59
- loaderProps: u,
58
+ loaderPosition: u,
59
+ loaderProps: p,
60
60
  isLoading: n,
61
61
  leftIcon: r
62
62
  }
63
63
  ),
64
64
  /* @__PURE__ */ t.jsx("span", { className: "flex h-full items-center overflow-hidden whitespace-nowrap", children: a }),
65
65
  /* @__PURE__ */ t.jsx(
66
- h,
66
+ x,
67
67
  {
68
68
  renderPosition: "right",
69
- loaderPosition: f,
70
- loaderProps: u,
69
+ loaderPosition: u,
70
+ loaderProps: p,
71
71
  isLoading: n,
72
72
  rightIcon: l
73
73
  }
package/dist/index.es5.js CHANGED
@@ -36,7 +36,7 @@ const t = r(
36
36
  true: "pointer-events-none cursor-not-allowed opacity-70"
37
37
  },
38
38
  isFocused: {
39
- true: "focus:outline-none focus:ring-2 focus:ring-sky-400 focus:ring-offset-2",
39
+ true: "focus:outline-none focus:ring-2 focus:ring-sky-400 focus:ring-offset-[0.4px] border-none",
40
40
  false: ""
41
41
  }
42
42
  },
@@ -91,7 +91,32 @@ const t = r(
91
91
  isHovered: !0,
92
92
  class: "bg-primary-600 text-neutral-50"
93
93
  },
94
- /* /Hover State */
94
+ /* /Focus State */
95
+ {
96
+ intent: "success",
97
+ isFocused: !0,
98
+ class: "border-[1.5px] focus:ring-success-800"
99
+ },
100
+ {
101
+ intent: "error",
102
+ isFocused: !0,
103
+ class: "border-[1.5px] focus:ring-error-800"
104
+ },
105
+ {
106
+ intent: "orangeWarning",
107
+ isFocused: !0,
108
+ class: "border-[1.5px] focus:ring-orange-800"
109
+ },
110
+ {
111
+ intent: "yellowWarning",
112
+ isFocused: !0,
113
+ class: "border-[1.5px] focus:ring-yellow-800"
114
+ },
115
+ {
116
+ intent: "info",
117
+ isFocused: !0,
118
+ class: "border-[1.5px] focus:ring-primary-800"
119
+ },
95
120
  /* Active State */
96
121
  {
97
122
  intent: "primary",
package/dist/style.css CHANGED
@@ -847,6 +847,9 @@ select {
847
847
  .border {
848
848
  border-width: 1px;
849
849
  }
850
+ .border-\[1\.5px\] {
851
+ border-width: 1.5px;
852
+ }
850
853
  .border-none {
851
854
  border-style: none;
852
855
  }
@@ -1101,10 +1104,30 @@ select {
1101
1104
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
1102
1105
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
1103
1106
  }
1107
+ .focus\:ring-error-800:focus {
1108
+ --tw-ring-opacity: 1;
1109
+ --tw-ring-color: rgb(94 27 20 / var(--tw-ring-opacity));
1110
+ }
1111
+ .focus\:ring-orange-800:focus {
1112
+ --tw-ring-opacity: 1;
1113
+ --tw-ring-color: rgb(154 52 18 / var(--tw-ring-opacity));
1114
+ }
1115
+ .focus\:ring-primary-800:focus {
1116
+ --tw-ring-opacity: 1;
1117
+ --tw-ring-color: rgb(23 13 108 / var(--tw-ring-opacity));
1118
+ }
1104
1119
  .focus\:ring-sky-400:focus {
1105
1120
  --tw-ring-opacity: 1;
1106
1121
  --tw-ring-color: rgb(38 157 217 / var(--tw-ring-opacity));
1107
1122
  }
1108
- .focus\:ring-offset-2:focus {
1109
- --tw-ring-offset-width: 2px;
1123
+ .focus\:ring-success-800:focus {
1124
+ --tw-ring-opacity: 1;
1125
+ --tw-ring-color: rgb(2 96 56 / var(--tw-ring-opacity));
1126
+ }
1127
+ .focus\:ring-yellow-800:focus {
1128
+ --tw-ring-opacity: 1;
1129
+ --tw-ring-color: rgb(113 96 12 / var(--tw-ring-opacity));
1130
+ }
1131
+ .focus\:ring-offset-\[0\.4px\]:focus {
1132
+ --tw-ring-offset-width: 0.4px;
1110
1133
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simpli-route/apollo-ds",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"