@popgrids/ui 0.0.23 → 0.0.24

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.
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ var checkbox = require('@base-ui/react/checkbox');
4
+ var icons = require('@untitledui/icons');
5
+ var clsx = require('clsx');
6
+ var tailwindMerge = require('tailwind-merge');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+
9
+ // src/components/checkbox/checkbox.tsx
10
+ function cn(...inputs) {
11
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
12
+ }
13
+ function Checkbox({ className, ...props }) {
14
+ return /* @__PURE__ */ jsxRuntime.jsx(
15
+ checkbox.Checkbox.Root,
16
+ {
17
+ "data-slot": "checkbox",
18
+ className: cn(
19
+ "border-foreground dark:bg-input/30 dark:data-checked:bg-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 data-disabled:cursor-not-allowed data-disabled:opacity-50 aria-invalid:ring-3 data-checked:border-foreground data-checked:bg-foreground data-checked:text-background",
20
+ className
21
+ ),
22
+ ...props,
23
+ children: /* @__PURE__ */ jsxRuntime.jsx(
24
+ checkbox.Checkbox.Indicator,
25
+ {
26
+ "data-slot": "checkbox-indicator",
27
+ className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
28
+ children: /* @__PURE__ */ jsxRuntime.jsx(icons.Check, {})
29
+ }
30
+ )
31
+ }
32
+ );
33
+ }
34
+
35
+ exports.Checkbox = Checkbox;
36
+ //# sourceMappingURL=checkbox.cjs.map
37
+ //# sourceMappingURL=checkbox.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/utils.ts","../src/components/checkbox/checkbox.tsx"],"names":["twMerge","clsx","jsx","CheckboxPrimitive","Check"],"mappings":";;;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACGA,SAAS,QAAA,CAAS,EAAE,SAAA,EAAW,GAAG,OAAM,EAAkB;AACxD,EAAA,uBACEC,cAAA;AAAA,IAACC,iBAAA,CAAkB,IAAA;AAAA,IAAlB;AAAA,MACC,WAAA,EAAU,UAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,0rBAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAAD,cAAA;AAAA,QAACC,iBAAA,CAAkB,SAAA;AAAA,QAAlB;AAAA,UACC,WAAA,EAAU,oBAAA;AAAA,UACV,SAAA,EAAU,yEAAA;AAAA,UAEV,yCAACC,WAAA,EAAA,EAAM;AAAA;AAAA;AACT;AAAA,GACF;AAEJ","file":"checkbox.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\";\nimport { Check } from \"@untitledui/icons\";\n\nimport { cn } from \"../../lib/utils\";\nimport { CheckboxProps } from \"./types\";\n\nfunction Checkbox({ className, ...props }: CheckboxProps) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"border-foreground dark:bg-input/30 dark:data-checked:bg-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 data-disabled:cursor-not-allowed data-disabled:opacity-50 aria-invalid:ring-3 data-checked:border-foreground data-checked:bg-foreground data-checked:text-background\",\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none [&>svg]:size-3.5\"\n >\n <Check />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n"]}
@@ -0,0 +1,8 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { CheckboxRoot } from '@base-ui/react/checkbox';
3
+
4
+ interface CheckboxProps extends CheckboxRoot.Props {}
5
+
6
+ declare function Checkbox({ className, ...props }: CheckboxProps): react_jsx_runtime.JSX.Element;
7
+
8
+ export { Checkbox, type CheckboxProps };
@@ -0,0 +1,8 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { CheckboxRoot } from '@base-ui/react/checkbox';
3
+
4
+ interface CheckboxProps extends CheckboxRoot.Props {}
5
+
6
+ declare function Checkbox({ className, ...props }: CheckboxProps): react_jsx_runtime.JSX.Element;
7
+
8
+ export { Checkbox, type CheckboxProps };
@@ -0,0 +1,35 @@
1
+ import { Checkbox as Checkbox$1 } from '@base-ui/react/checkbox';
2
+ import { Check } from '@untitledui/icons';
3
+ import { clsx } from 'clsx';
4
+ import { twMerge } from 'tailwind-merge';
5
+ import { jsx } from 'react/jsx-runtime';
6
+
7
+ // src/components/checkbox/checkbox.tsx
8
+ function cn(...inputs) {
9
+ return twMerge(clsx(inputs));
10
+ }
11
+ function Checkbox({ className, ...props }) {
12
+ return /* @__PURE__ */ jsx(
13
+ Checkbox$1.Root,
14
+ {
15
+ "data-slot": "checkbox",
16
+ className: cn(
17
+ "border-foreground dark:bg-input/30 dark:data-checked:bg-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 data-disabled:cursor-not-allowed data-disabled:opacity-50 aria-invalid:ring-3 data-checked:border-foreground data-checked:bg-foreground data-checked:text-background",
18
+ className
19
+ ),
20
+ ...props,
21
+ children: /* @__PURE__ */ jsx(
22
+ Checkbox$1.Indicator,
23
+ {
24
+ "data-slot": "checkbox-indicator",
25
+ className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
26
+ children: /* @__PURE__ */ jsx(Check, {})
27
+ }
28
+ )
29
+ }
30
+ );
31
+ }
32
+
33
+ export { Checkbox };
34
+ //# sourceMappingURL=checkbox.js.map
35
+ //# sourceMappingURL=checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/utils.ts","../src/components/checkbox/checkbox.tsx"],"names":["CheckboxPrimitive"],"mappings":";;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACGA,SAAS,QAAA,CAAS,EAAE,SAAA,EAAW,GAAG,OAAM,EAAkB;AACxD,EAAA,uBACE,GAAA;AAAA,IAACA,UAAA,CAAkB,IAAA;AAAA,IAAlB;AAAA,MACC,WAAA,EAAU,UAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,0rBAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAA,GAAA;AAAA,QAACA,UAAA,CAAkB,SAAA;AAAA,QAAlB;AAAA,UACC,WAAA,EAAU,oBAAA;AAAA,UACV,SAAA,EAAU,yEAAA;AAAA,UAEV,8BAAC,KAAA,EAAA,EAAM;AAAA;AAAA;AACT;AAAA,GACF;AAEJ","file":"checkbox.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\";\nimport { Check } from \"@untitledui/icons\";\n\nimport { cn } from \"../../lib/utils\";\nimport { CheckboxProps } from \"./types\";\n\nfunction Checkbox({ className, ...props }: CheckboxProps) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"border-foreground dark:bg-input/30 dark:data-checked:bg-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 data-disabled:cursor-not-allowed data-disabled:opacity-50 aria-invalid:ring-3 data-checked:border-foreground data-checked:bg-foreground data-checked:text-background\",\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none [&>svg]:size-3.5\"\n >\n <Check />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n"]}
package/dist/index.cjs CHANGED
@@ -5,8 +5,9 @@ var clsx = require('clsx');
5
5
  var tailwindMerge = require('tailwind-merge');
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var button = require('@base-ui/react/button');
8
- var dialog = require('@base-ui/react/dialog');
8
+ var checkbox = require('@base-ui/react/checkbox');
9
9
  var icons = require('@untitledui/icons');
10
+ var dialog = require('@base-ui/react/dialog');
10
11
  var menu = require('@base-ui/react/menu');
11
12
  var input = require('@base-ui/react/input');
12
13
  var mergeProps = require('@base-ui/react/merge-props');
@@ -527,6 +528,27 @@ function ContentBlock({ className, children, title, subhead, cta }) {
527
528
  children && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "prose prose-base max-w-(--width-xl) pb-3", children })
528
529
  ] });
529
530
  }
531
+ function Checkbox({ className, ...props }) {
532
+ return /* @__PURE__ */ jsxRuntime.jsx(
533
+ checkbox.Checkbox.Root,
534
+ {
535
+ "data-slot": "checkbox",
536
+ className: cn(
537
+ "border-foreground dark:bg-input/30 dark:data-checked:bg-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 data-disabled:cursor-not-allowed data-disabled:opacity-50 aria-invalid:ring-3 data-checked:border-foreground data-checked:bg-foreground data-checked:text-background",
538
+ className
539
+ ),
540
+ ...props,
541
+ children: /* @__PURE__ */ jsxRuntime.jsx(
542
+ checkbox.Checkbox.Indicator,
543
+ {
544
+ "data-slot": "checkbox-indicator",
545
+ className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
546
+ children: /* @__PURE__ */ jsxRuntime.jsx(icons.Check, {})
547
+ }
548
+ )
549
+ }
550
+ );
551
+ }
530
552
  function DialogRoot(props) {
531
553
  return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Root, { "data-slot": "dialog", ...props });
532
554
  }
@@ -1459,6 +1481,7 @@ function Tag({
1459
1481
  exports.BannerNotification = BannerNotification;
1460
1482
  exports.Button = Button;
1461
1483
  exports.ButtonLink = ButtonLink;
1484
+ exports.Checkbox = Checkbox;
1462
1485
  exports.ContentBlock = ContentBlock;
1463
1486
  exports.Dialog = DialogRoot;
1464
1487
  exports.DialogBody = DialogBody;