@strategicos/ui 0.4.0 → 0.4.1

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.
@@ -6,7 +6,7 @@ const buttonVariants = cva("group/button inline-flex shrink-0 items-center justi
6
6
  variants: {
7
7
  variant: {
8
8
  default: "bg-primary text-primary-foreground hover:bg-primary-hover aria-expanded:bg-primary-hover",
9
- outline: "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
9
+ outline: "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50 dark:aria-expanded:bg-input/50",
10
10
  secondary: "bg-secondary text-secondary-foreground hover:bg-accent aria-expanded:bg-accent aria-expanded:text-secondary-foreground",
11
11
  ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
12
12
  destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AAEpC,MAAM,cAAc,GAAG,GAAG,CACxB,8lBAA8lB,EAC9lB;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,0FAA0F;YACnG,OAAO,EACL,iLAAiL;YACnL,SAAS,EACP,wHAAwH;YAC1H,KAAK,EACH,kHAAkH;YACpH,WAAW,EACT,yKAAyK;YAC3K,IAAI,EAAE,wDAAwD;SAC/D;QACD,IAAI,EAAE;YACJ,OAAO,EACL,kFAAkF;YACpF,EAAE,EAAE,+MAA+M;YACnN,EAAE,EAAE,2NAA2N;YAC/N,EAAE,EAAE,+FAA+F;YACnG,IAAI,EAAE,QAAQ;YACd,SAAS,EACP,yHAAyH;YAC3H,SAAS,EACP,sFAAsF;YACxF,SAAS,EAAE,WAAW;SACvB;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,SAAS;KAChB;CACF,CACF,CAAA;AAED,SAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,SAAS,EAChB,OAAO,GAAG,KAAK,EACf,GAAG,KAAK,EAIP;IACD,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAA;IAE3C,OAAO,CACL,KAAC,IAAI,iBACO,QAAQ,kBACJ,OAAO,eACV,IAAI,EACf,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,KACvD,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AAEpC,MAAM,cAAc,GAAG,GAAG,CACxB,8lBAA8lB,EAC9lB;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,0FAA0F;YACnG,OAAO,EACL,gNAAgN;YAClN,SAAS,EACP,wHAAwH;YAC1H,KAAK,EACH,kHAAkH;YACpH,WAAW,EACT,yKAAyK;YAC3K,IAAI,EAAE,wDAAwD;SAC/D;QACD,IAAI,EAAE;YACJ,OAAO,EACL,kFAAkF;YACpF,EAAE,EAAE,+MAA+M;YACnN,EAAE,EAAE,2NAA2N;YAC/N,EAAE,EAAE,+FAA+F;YACnG,IAAI,EAAE,QAAQ;YACd,SAAS,EACP,yHAAyH;YAC3H,SAAS,EACP,sFAAsF;YACxF,SAAS,EAAE,WAAW;SACvB;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,SAAS;KAChB;CACF,CACF,CAAA;AAED,SAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,SAAS,EAChB,OAAO,GAAG,KAAK,EACf,GAAG,KAAK,EAIP;IACD,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAA;IAE3C,OAAO,CACL,KAAC,IAAI,iBACO,QAAQ,kBACJ,OAAO,eACV,IAAI,EACf,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,KACvD,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
@@ -7,7 +7,7 @@ import { cn } from "../lib/utils.js";
7
7
  * raio de 4px, marcada na cor primária. Aceita `checked="indeterminate"`.
8
8
  * Para rótulo, associe um <Label htmlFor> ao `id` do Checkbox. */
9
9
  function Checkbox({ className, ...props }) {
10
- return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn("peer group/checkbox inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-input bg-background text-primary-foreground transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive data-checked:border-primary data-checked:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary dark:bg-input/30", className), ...props, children: _jsxs(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "flex items-center justify-center", children: [_jsx(CheckIcon, { className: "size-3.5 stroke-3 group-data-[state=indeterminate]/checkbox:hidden" }), _jsx(MinusIcon, { className: "hidden size-3.5 stroke-3 group-data-[state=indeterminate]/checkbox:block" })] }) }));
10
+ return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn("peer group/checkbox inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-input bg-background text-primary-foreground transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive data-checked:border-primary data-checked:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary dark:data-unchecked:bg-input/30", className), ...props, children: _jsxs(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "flex items-center justify-center", children: [_jsx(CheckIcon, { className: "size-3.5 stroke-3 group-data-[state=indeterminate]/checkbox:hidden" }), _jsx(MinusIcon, { className: "hidden size-3.5 stroke-3 group-data-[state=indeterminate]/checkbox:block" })] }) }));
11
11
  }
12
12
  export { Checkbox };
13
13
  //# sourceMappingURL=checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAGZ,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAEnD,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AAEpC;;mEAEmE;AACnE,SAAS,QAAQ,CAAC,EAChB,SAAS,EACT,GAAG,KAAK,EAC4C;IACpD,OAAO,CACL,KAAC,iBAAiB,CAAC,IAAI,iBACX,UAAU,EACpB,SAAS,EAAE,EAAE,CACX,qdAAqd,EACrd,SAAS,CACV,KACG,KAAK,YAET,MAAC,iBAAiB,CAAC,SAAS,iBAAW,oBAAoB,EAAC,SAAS,EAAC,kCAAkC,aACtG,KAAC,SAAS,IAAC,SAAS,EAAC,oEAAoE,GAAG,EAC5F,KAAC,SAAS,IAAC,SAAS,EAAC,0EAA0E,GAAG,IACtE,GACP,CAC1B,CAAA;AACH,CAAC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
1
+ {"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAGZ,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAEnD,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AAEpC;;mEAEmE;AACnE,SAAS,QAAQ,CAAC,EAChB,SAAS,EACT,GAAG,KAAK,EAC4C;IACpD,OAAO,CACL,KAAC,iBAAiB,CAAC,IAAI,iBACX,UAAU,EACpB,SAAS,EAAE,EAAE,CACX,oeAAoe,EACpe,SAAS,CACV,KACG,KAAK,YAET,MAAC,iBAAiB,CAAC,SAAS,iBAAW,oBAAoB,EAAC,SAAS,EAAC,kCAAkC,aACtG,KAAC,SAAS,IAAC,SAAS,EAAC,oEAAoE,GAAG,EAC5F,KAAC,SAAS,IAAC,SAAS,EAAC,0EAA0E,GAAG,IACtE,GACP,CAC1B,CAAA;AACH,CAAC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
@@ -1,7 +1,12 @@
1
1
  import * as React from "react";
2
2
  import { Switch as SwitchPrimitive } from "radix-ui";
3
3
  /** Interruptor liga/desliga (Radix Switch), no tamanho padrão do Mantine:
4
- * trilho de 38×20px e polegar de 14px. Ligado usa a cor primária.
4
+ * trilho de 38×20px e polegar de 14px, branco nos dois temas. Ligado usa a
5
+ * cor primária.
6
+ *
7
+ * O fundo escuro vai só no estado desligado (`dark:data-unchecked:`): um
8
+ * `dark:bg-*` solto vem depois de `data-checked:bg-*` no CSS e venceria,
9
+ * apagando o "ligado" no tema escuro.
5
10
  * Para rótulo, associe um <Label htmlFor> ao `id` do Switch. */
6
11
  declare function Switch({ className, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root>): React.JSX.Element;
7
12
  export { Switch };
@@ -1 +1 @@
1
- {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/components/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAIpD;;iEAEiE;AACjE,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,qBAgBnD;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/components/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAIpD;;;;;;;iEAOiE;AACjE,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,qBAgBnD;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -3,10 +3,15 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { Switch as SwitchPrimitive } from "radix-ui";
4
4
  import { cn } from "../lib/utils.js";
5
5
  /** Interruptor liga/desliga (Radix Switch), no tamanho padrão do Mantine:
6
- * trilho de 38×20px e polegar de 14px. Ligado usa a cor primária.
6
+ * trilho de 38×20px e polegar de 14px, branco nos dois temas. Ligado usa a
7
+ * cor primária.
8
+ *
9
+ * O fundo escuro vai só no estado desligado (`dark:data-unchecked:`): um
10
+ * `dark:bg-*` solto vem depois de `data-checked:bg-*` no CSS e venceria,
11
+ * apagando o "ligado" no tema escuro.
7
12
  * Para rótulo, associe um <Label htmlFor> ao `id` do Switch. */
8
13
  function Switch({ className, ...props }) {
9
- return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", className: cn("peer inline-flex h-5 w-9.5 shrink-0 cursor-pointer items-center rounded-full border border-input bg-muted p-0.5 transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-checked:border-primary data-checked:bg-primary dark:bg-input/40", className), ...props, children: _jsx(SwitchPrimitive.Thumb, { "data-slot": "switch-thumb", className: "pointer-events-none block size-3.5 rounded-full bg-background shadow-sm ring-1 ring-foreground/10 transition-transform data-checked:translate-x-4.5 data-unchecked:translate-x-0" }) }));
14
+ return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", className: cn("peer inline-flex h-5 w-9.5 shrink-0 cursor-pointer items-center rounded-full border border-input bg-muted p-0.5 transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-checked:border-primary data-checked:bg-primary dark:data-unchecked:bg-input/40", className), ...props, children: _jsx(SwitchPrimitive.Thumb, { "data-slot": "switch-thumb", className: "pointer-events-none block size-3.5 rounded-full bg-white shadow-sm ring-1 ring-foreground/10 transition-transform data-checked:translate-x-4.5 data-unchecked:translate-x-0" }) }));
10
15
  }
11
16
  export { Switch };
12
17
  //# sourceMappingURL=switch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"switch.js","sourceRoot":"","sources":["../../src/components/switch.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAGZ,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAEpD,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AAEpC;;iEAEiE;AACjE,SAAS,MAAM,CAAC,EACd,SAAS,EACT,GAAG,KAAK,EAC0C;IAClD,OAAO,CACL,KAAC,eAAe,CAAC,IAAI,iBACT,QAAQ,EAClB,SAAS,EAAE,EAAE,CACX,qTAAqT,EACrT,SAAS,CACV,KACG,KAAK,YAET,KAAC,eAAe,CAAC,KAAK,iBACV,cAAc,EACxB,SAAS,EAAC,kLAAkL,GAC5L,GACmB,CACxB,CAAA;AACH,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"switch.js","sourceRoot":"","sources":["../../src/components/switch.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAGZ,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAEpD,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AAEpC;;;;;;;iEAOiE;AACjE,SAAS,MAAM,CAAC,EACd,SAAS,EACT,GAAG,KAAK,EAC0C;IAClD,OAAO,CACL,KAAC,eAAe,CAAC,IAAI,iBACT,QAAQ,EAClB,SAAS,EAAE,EAAE,CACX,oUAAoU,EACpU,SAAS,CACV,KACG,KAAK,YAET,KAAC,eAAe,CAAC,KAAK,iBACV,cAAc,EACxB,SAAS,EAAC,6KAA6K,GACvL,GACmB,CACxB,CAAA;AACH,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strategicos/ui",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Componentes React da Strategicos (shadcn + Radix + Tailwind v4).",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -11,7 +11,7 @@ const buttonVariants = cva(
11
11
  variant: {
12
12
  default: "bg-primary text-primary-foreground hover:bg-primary-hover aria-expanded:bg-primary-hover",
13
13
  outline:
14
- "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
14
+ "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50 dark:aria-expanded:bg-input/50",
15
15
  secondary:
16
16
  "bg-secondary text-secondary-foreground hover:bg-accent aria-expanded:bg-accent aria-expanded:text-secondary-foreground",
17
17
  ghost:
@@ -17,7 +17,7 @@ function Checkbox({
17
17
  <CheckboxPrimitive.Root
18
18
  data-slot="checkbox"
19
19
  className={cn(
20
- "peer group/checkbox inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-input bg-background text-primary-foreground transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive data-checked:border-primary data-checked:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary dark:bg-input/30",
20
+ "peer group/checkbox inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-input bg-background text-primary-foreground transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive data-checked:border-primary data-checked:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary dark:data-unchecked:bg-input/30",
21
21
  className
22
22
  )}
23
23
  {...props}
@@ -6,7 +6,12 @@ import { Switch as SwitchPrimitive } from "radix-ui"
6
6
  import { cn } from "../lib/utils.js"
7
7
 
8
8
  /** Interruptor liga/desliga (Radix Switch), no tamanho padrão do Mantine:
9
- * trilho de 38×20px e polegar de 14px. Ligado usa a cor primária.
9
+ * trilho de 38×20px e polegar de 14px, branco nos dois temas. Ligado usa a
10
+ * cor primária.
11
+ *
12
+ * O fundo escuro vai só no estado desligado (`dark:data-unchecked:`): um
13
+ * `dark:bg-*` solto vem depois de `data-checked:bg-*` no CSS e venceria,
14
+ * apagando o "ligado" no tema escuro.
10
15
  * Para rótulo, associe um <Label htmlFor> ao `id` do Switch. */
11
16
  function Switch({
12
17
  className,
@@ -16,14 +21,14 @@ function Switch({
16
21
  <SwitchPrimitive.Root
17
22
  data-slot="switch"
18
23
  className={cn(
19
- "peer inline-flex h-5 w-9.5 shrink-0 cursor-pointer items-center rounded-full border border-input bg-muted p-0.5 transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-checked:border-primary data-checked:bg-primary dark:bg-input/40",
24
+ "peer inline-flex h-5 w-9.5 shrink-0 cursor-pointer items-center rounded-full border border-input bg-muted p-0.5 transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-checked:border-primary data-checked:bg-primary dark:data-unchecked:bg-input/40",
20
25
  className
21
26
  )}
22
27
  {...props}
23
28
  >
24
29
  <SwitchPrimitive.Thumb
25
30
  data-slot="switch-thumb"
26
- className="pointer-events-none block size-3.5 rounded-full bg-background shadow-sm ring-1 ring-foreground/10 transition-transform data-checked:translate-x-4.5 data-unchecked:translate-x-0"
31
+ className="pointer-events-none block size-3.5 rounded-full bg-white shadow-sm ring-1 ring-foreground/10 transition-transform data-checked:translate-x-4.5 data-unchecked:translate-x-0"
27
32
  />
28
33
  </SwitchPrimitive.Root>
29
34
  )