@kubetail/ui 2.1.2 → 2.2.0
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.
- package/dist/elements/button.cjs +1 -1
- package/dist/elements/button.cjs.map +1 -1
- package/dist/elements/button.js +12 -10
- package/dist/elements/button.js.map +1 -1
- package/dist/elements/calendar.cjs +1 -1
- package/dist/elements/calendar.cjs.map +1 -1
- package/dist/elements/calendar.js +10 -8
- package/dist/elements/calendar.js.map +1 -1
- package/dist/elements/card.cjs +1 -1
- package/dist/elements/card.cjs.map +1 -1
- package/dist/elements/card.js +33 -31
- package/dist/elements/card.js.map +1 -1
- package/dist/elements/checkbox.cjs +1 -1
- package/dist/elements/checkbox.cjs.map +1 -1
- package/dist/elements/checkbox.js +12 -10
- package/dist/elements/checkbox.js.map +1 -1
- package/dist/elements/dialog.cjs +1 -1
- package/dist/elements/dialog.cjs.map +1 -1
- package/dist/elements/dialog.js +42 -40
- package/dist/elements/dialog.js.map +1 -1
- package/dist/elements/dropdown-menu.cjs +1 -1
- package/dist/elements/dropdown-menu.cjs.map +1 -1
- package/dist/elements/dropdown-menu.js +74 -72
- package/dist/elements/dropdown-menu.js.map +1 -1
- package/dist/elements/form.cjs +1 -1
- package/dist/elements/form.cjs.map +1 -1
- package/dist/elements/form.js +55 -53
- package/dist/elements/form.js.map +1 -1
- package/dist/elements/input.cjs +1 -1
- package/dist/elements/input.cjs.map +1 -1
- package/dist/elements/input.js +8 -6
- package/dist/elements/input.js.map +1 -1
- package/dist/elements/label.cjs +1 -1
- package/dist/elements/label.cjs.map +1 -1
- package/dist/elements/label.js +9 -7
- package/dist/elements/label.js.map +1 -1
- package/dist/elements/link.cjs +1 -1
- package/dist/elements/link.cjs.map +1 -1
- package/dist/elements/link.js +28 -26
- package/dist/elements/link.js.map +1 -1
- package/dist/elements/pagination.cjs +1 -1
- package/dist/elements/pagination.cjs.map +1 -1
- package/dist/elements/pagination.js +43 -41
- package/dist/elements/pagination.js.map +1 -1
- package/dist/elements/popover.cjs +1 -1
- package/dist/elements/popover.cjs.map +1 -1
- package/dist/elements/popover.js +19 -17
- package/dist/elements/popover.js.map +1 -1
- package/dist/elements/search-box.cjs +1 -1
- package/dist/elements/search-box.cjs.map +1 -1
- package/dist/elements/search-box.js +16 -14
- package/dist/elements/search-box.js.map +1 -1
- package/dist/elements/select.cjs +1 -1
- package/dist/elements/select.cjs.map +1 -1
- package/dist/elements/select.js +58 -56
- package/dist/elements/select.js.map +1 -1
- package/dist/elements/separator.cjs +1 -1
- package/dist/elements/separator.cjs.map +1 -1
- package/dist/elements/separator.js +9 -7
- package/dist/elements/separator.js.map +1 -1
- package/dist/elements/sheet.cjs +1 -1
- package/dist/elements/sheet.cjs.map +1 -1
- package/dist/elements/sheet.js +41 -39
- package/dist/elements/sheet.js.map +1 -1
- package/dist/elements/sidebar.cjs +1 -1
- package/dist/elements/sidebar.cjs.map +1 -1
- package/dist/elements/sidebar.js +196 -194
- package/dist/elements/sidebar.js.map +1 -1
- package/dist/elements/skeleton.cjs +1 -1
- package/dist/elements/skeleton.cjs.map +1 -1
- package/dist/elements/skeleton.js +8 -6
- package/dist/elements/skeleton.js.map +1 -1
- package/dist/elements/spinner.cjs +1 -1
- package/dist/elements/spinner.cjs.map +1 -1
- package/dist/elements/spinner.js +12 -11
- package/dist/elements/spinner.js.map +1 -1
- package/dist/elements/switch.cjs +2 -0
- package/dist/elements/switch.cjs.map +1 -0
- package/dist/elements/switch.d.ts +3 -0
- package/dist/elements/switch.js +20 -0
- package/dist/elements/switch.js.map +1 -0
- package/dist/elements/switch.stories.d.ts +15 -0
- package/dist/elements/switch.test.d.ts +0 -0
- package/dist/elements/table.cjs +1 -1
- package/dist/elements/table.cjs.map +1 -1
- package/dist/elements/table.js +39 -37
- package/dist/elements/table.js.map +1 -1
- package/dist/elements/tabs.cjs +1 -1
- package/dist/elements/tabs.cjs.map +1 -1
- package/dist/elements/tabs.js +22 -20
- package/dist/elements/tabs.js.map +1 -1
- package/dist/elements/tooltip.cjs +1 -1
- package/dist/elements/tooltip.cjs.map +1 -1
- package/dist/elements/tooltip.js +16 -14
- package/dist/elements/tooltip.js.map +1 -1
- package/dist/hooks/use-mobile.cjs +1 -1
- package/dist/hooks/use-mobile.cjs.map +1 -1
- package/dist/hooks/use-mobile.js +11 -9
- package/dist/hooks/use-mobile.js.map +1 -1
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.cjs.map +1 -1
- package/dist/lib/utils.js +7 -5
- package/dist/lib/utils.js.map +1 -1
- package/package.json +34 -29
- /package/dist/_virtual/{rolldown:runtime.cjs → _rolldown/runtime.cjs} +0 -0
package/dist/elements/input.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { cn } from "../lib/utils.js";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { cn as e } from "../lib/utils.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/elements/input.tsx
|
|
4
|
+
function n({ className: n, type: r, ...i }) {
|
|
5
|
+
return /* @__PURE__ */ t("input", {
|
|
5
6
|
type: r,
|
|
6
7
|
"data-slot": "input",
|
|
7
|
-
className:
|
|
8
|
+
className: e("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", n),
|
|
8
9
|
...i
|
|
9
10
|
});
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
+
//#endregion
|
|
13
|
+
export { n as Input };
|
|
12
14
|
|
|
13
15
|
//# sourceMappingURL=input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","names":[],"sources":["../../src/elements/input.tsx"],"sourcesContent":["import { cn } from '@/lib/utils';\n\nfunction Input({ className, type, ...props }: React.ComponentProps<'input'>) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n 'file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',\n 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',\n 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Input };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"input.js","names":[],"sources":["../../src/elements/input.tsx"],"sourcesContent":["import { cn } from '@/lib/utils';\n\nfunction Input({ className, type, ...props }: React.ComponentProps<'input'>) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n 'file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',\n 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',\n 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Input };\n"],"mappings":";;;AAEA,SAAS,EAAM,EAAE,cAAW,SAAM,GAAG,KAAwC;AAC3E,QACE,kBAAC,SAAD;EACQ;EACN,aAAU;EACV,WAAW,EACT,mcACA,iFACA,0GACA,EACD;EACD,GAAI;EACJ,CAAA"}
|
package/dist/elements/label.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../lib/utils.cjs`);let n=require(`react/jsx-runtime`),r=require(`@radix-ui/react-label`);r=e.__toESM(r);function i({className:e,...i}){return(0,n.jsx)(r.Root,{"data-slot":`label`,className:t.cn(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...i})}exports.Label=i;
|
|
2
2
|
//# sourceMappingURL=label.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.cjs","names":[],"sources":["../../src/elements/label.tsx"],"sourcesContent":["'use client';\n\nimport * as LabelPrimitive from '@radix-ui/react-label';\n\nimport { cn } from '@/lib/utils';\n\nfunction Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n 'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Label };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"label.cjs","names":[],"sources":["../../src/elements/label.tsx"],"sourcesContent":["'use client';\n\nimport * as LabelPrimitive from '@radix-ui/react-label';\n\nimport { cn } from '@/lib/utils';\n\nfunction Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n 'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Label };\n"],"mappings":"wPAMA,SAAS,EAAM,CAAE,YAAW,GAAG,GAA2D,CACxF,OAAA,EAAA,EAAA,KACG,EAAe,KAAhB,CACE,YAAU,QACV,UAAW,EAAA,GACT,sNACA,EACD,CACD,GAAI,EACJ,CAAA"}
|
package/dist/elements/label.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { cn } from "../lib/utils.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import * as
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { cn as e } from "../lib/utils.js";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
import * as n from "@radix-ui/react-label";
|
|
5
|
+
//#region src/elements/label.tsx
|
|
6
|
+
function r({ className: r, ...i }) {
|
|
7
|
+
return /* @__PURE__ */ t(n.Root, {
|
|
7
8
|
"data-slot": "label",
|
|
8
|
-
className:
|
|
9
|
+
className: e("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", r),
|
|
9
10
|
...i
|
|
10
11
|
});
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
+
//#endregion
|
|
14
|
+
export { r as Label };
|
|
13
15
|
|
|
14
16
|
//# sourceMappingURL=label.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.js","names":[],"sources":["../../src/elements/label.tsx"],"sourcesContent":["'use client';\n\nimport * as LabelPrimitive from '@radix-ui/react-label';\n\nimport { cn } from '@/lib/utils';\n\nfunction Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n 'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Label };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"label.js","names":[],"sources":["../../src/elements/label.tsx"],"sourcesContent":["'use client';\n\nimport * as LabelPrimitive from '@radix-ui/react-label';\n\nimport { cn } from '@/lib/utils';\n\nfunction Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n 'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Label };\n"],"mappings":";;;;;AAMA,SAAS,EAAM,EAAE,cAAW,GAAG,KAA2D;AACxF,QACE,kBAAC,EAAe,MAAhB;EACE,aAAU;EACV,WAAW,EACT,uNACA,EACD;EACD,GAAI;EACJ,CAAA"}
|
package/dist/elements/link.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`})
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../lib/utils.cjs`);let t=require(`react/jsx-runtime`),n=require(`@radix-ui/react-slot`);var r=(0,require(`class-variance-authority`).cva)(`inline-flex items-center gap-1 text-primary underline-offset-4 hover:underline transition-colors outline-none focus-visible:ring-ring/50 focus-visible:ring-[3px] rounded-sm cursor-pointer`,{variants:{variant:{default:``,external:``}},defaultVariants:{variant:`default`}}),i=null;function a(e){i=e}function o(){return i}function s({className:i,variant:a,asChild:o=!1,...s}){return(0,t.jsx)(o?n.Slot:`a`,{"data-slot":`link`,className:e.cn(r({variant:a,className:i})),...a===`external`&&!o?{target:`_blank`,rel:`noopener noreferrer`}:{},...s})}function c({className:n,variant:a,...o}){let s=i||`a`;return(0,t.jsx)(s,{"data-slot":`link`,className:e.cn(r({variant:a,className:n})),...a===`external`&&s===`a`?{target:`_blank`,rel:`noopener noreferrer`}:{},...o})}exports.Link=s,exports.RouterLink=c,exports.getLinkComponent=o,exports.linkStyles=r,exports.setLinkComponent=a;
|
|
2
2
|
//# sourceMappingURL=link.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.cjs","names":[
|
|
1
|
+
{"version":3,"file":"link.cjs","names":[],"sources":["../../src/elements/link.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\nconst linkStyles = cva(\n 'inline-flex items-center gap-1 text-primary underline-offset-4 hover:underline transition-colors outline-none focus-visible:ring-ring/50 focus-visible:ring-[3px] rounded-sm cursor-pointer',\n {\n variants: {\n variant: {\n default: '',\n external: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\nexport type LinkVariantProps = VariantProps<typeof linkStyles>;\n\ntype LinkComponent = React.ElementType;\n\nlet configuredLinkComponent: LinkComponent | null = null;\n\n/**\n * Set a custom component to be used by `RouterLink` (e.g. your router's Link component).\n *\n * @example\n * import { setLinkComponent } from '@kubetail/ui/elements/link';\n * import { Link } from 'react-router-dom';\n * setLinkComponent(Link);\n */\nfunction setLinkComponent(component: LinkComponent) {\n configuredLinkComponent = component;\n}\n\n/**\n * Get the currently configured link component.\n */\nfunction getLinkComponent(): LinkComponent | null {\n return configuredLinkComponent;\n}\n\ntype LinkProps = React.ComponentProps<'a'> &\n LinkVariantProps & {\n asChild?: boolean;\n };\n\n/**\n * `Link` renders a styled anchor element.\n *\n * Supports `asChild` via Radix UI Slot for composition with custom components.\n *\n * @param props.variant - \"default\" | \"external\" (adds target=\"_blank\" and rel=\"noopener noreferrer\")\n * @param props.asChild - render as child element via Radix Slot\n */\nfunction Link({ className, variant, asChild = false, ...props }: LinkProps) {\n const Comp = asChild ? Slot : 'a';\n\n return (\n <Comp\n data-slot=\"link\"\n className={cn(linkStyles({ variant, className }))}\n {...(variant === 'external' && !asChild ? { target: '_blank', rel: 'noopener noreferrer' } : {})}\n {...props}\n />\n );\n}\n\ntype RouterLinkProps = Omit<LinkProps, 'asChild'> & Record<string, unknown>;\n\n/**\n * `RouterLink` renders using the component set via `setLinkComponent()`,\n * falling back to a plain `<a>` tag if none has been configured.\n *\n * @example\n * // In your app entry:\n * import { setLinkComponent } from '@kubetail/ui/elements/link';\n * import { Link as RRLink } from 'react-router-dom';\n * setLinkComponent(RRLink);\n *\n * // Then use RouterLink anywhere:\n * <RouterLink to=\"/dashboard\">Dashboard</RouterLink>\n */\nfunction RouterLink({ className, variant, ...props }: RouterLinkProps) {\n const Comp = configuredLinkComponent || 'a';\n\n return (\n <Comp\n data-slot=\"link\"\n className={cn(linkStyles({ variant, className }))}\n {...(variant === 'external' && Comp === 'a' ? { target: '_blank', rel: 'noopener noreferrer' } : {})}\n {...props}\n />\n );\n}\n\nexport { Link, RouterLink, linkStyles, setLinkComponent, getLinkComponent };\n"],"mappings":"yNAKA,IAAM,GAAA,sCAAA,KACJ,8LACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,GACT,SAAU,GACX,CACF,CACD,gBAAiB,CACf,QAAS,UACV,CACF,CACF,CAMG,EAAgD,KAUpD,SAAS,EAAiB,EAA0B,CAClD,EAA0B,EAM5B,SAAS,GAAyC,CAChD,OAAO,EAgBT,SAAS,EAAK,CAAE,YAAW,UAAS,UAAU,GAAO,GAAG,GAAoB,CAG1E,OAAA,EAAA,EAAA,KAFa,EAAU,EAAA,KAAO,IAG5B,CACE,YAAU,OACV,UAAW,EAAA,GAAG,EAAW,CAAE,UAAS,YAAW,CAAC,CAAC,CACjD,GAAK,IAAY,YAAc,CAAC,EAAU,CAAE,OAAQ,SAAU,IAAK,sBAAuB,CAAG,EAAE,CAC/F,GAAI,EACJ,CAAA,CAmBN,SAAS,EAAW,CAAE,YAAW,UAAS,GAAG,GAA0B,CACrE,IAAM,EAAO,GAA2B,IAExC,OAAA,EAAA,EAAA,KACG,EAAD,CACE,YAAU,OACV,UAAW,EAAA,GAAG,EAAW,CAAE,UAAS,YAAW,CAAC,CAAC,CACjD,GAAK,IAAY,YAAc,IAAS,IAAM,CAAE,OAAQ,SAAU,IAAK,sBAAuB,CAAG,EAAE,CACnG,GAAI,EACJ,CAAA"}
|
package/dist/elements/link.js
CHANGED
|
@@ -1,49 +1,51 @@
|
|
|
1
|
-
import { cn } from "../lib/utils.js";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
-
import { cva } from "class-variance-authority";
|
|
5
|
-
|
|
1
|
+
import { cn as e } from "../lib/utils.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { Slot as n } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as r } from "class-variance-authority";
|
|
5
|
+
//#region src/elements/link.tsx
|
|
6
|
+
var i = r("inline-flex items-center gap-1 text-primary underline-offset-4 hover:underline transition-colors outline-none focus-visible:ring-ring/50 focus-visible:ring-[3px] rounded-sm cursor-pointer", {
|
|
6
7
|
variants: { variant: {
|
|
7
8
|
default: "",
|
|
8
9
|
external: ""
|
|
9
10
|
} },
|
|
10
11
|
defaultVariants: { variant: "default" }
|
|
11
|
-
}),
|
|
12
|
-
function
|
|
13
|
-
|
|
12
|
+
}), a = null;
|
|
13
|
+
function o(e) {
|
|
14
|
+
a = e;
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
-
return
|
|
16
|
+
function s() {
|
|
17
|
+
return a;
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
function c({ className: r, variant: a, asChild: o = !1, ...s }) {
|
|
20
|
+
return /* @__PURE__ */ t(o ? n : "a", {
|
|
20
21
|
"data-slot": "link",
|
|
21
|
-
className:
|
|
22
|
-
variant:
|
|
23
|
-
className:
|
|
22
|
+
className: e(i({
|
|
23
|
+
variant: a,
|
|
24
|
+
className: r
|
|
24
25
|
})),
|
|
25
|
-
...
|
|
26
|
+
...a === "external" && !o ? {
|
|
26
27
|
target: "_blank",
|
|
27
28
|
rel: "noopener noreferrer"
|
|
28
29
|
} : {},
|
|
29
|
-
...
|
|
30
|
+
...s
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
-
let
|
|
34
|
-
return /* @__PURE__ */
|
|
33
|
+
function l({ className: n, variant: r, ...o }) {
|
|
34
|
+
let s = a || "a";
|
|
35
|
+
return /* @__PURE__ */ t(s, {
|
|
35
36
|
"data-slot": "link",
|
|
36
|
-
className:
|
|
37
|
-
variant:
|
|
38
|
-
className:
|
|
37
|
+
className: e(i({
|
|
38
|
+
variant: r,
|
|
39
|
+
className: n
|
|
39
40
|
})),
|
|
40
|
-
...
|
|
41
|
+
...r === "external" && s === "a" ? {
|
|
41
42
|
target: "_blank",
|
|
42
43
|
rel: "noopener noreferrer"
|
|
43
44
|
} : {},
|
|
44
|
-
...
|
|
45
|
+
...o
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
+
//#endregion
|
|
49
|
+
export { c as Link, l as RouterLink, s as getLinkComponent, i as linkStyles, o as setLinkComponent };
|
|
48
50
|
|
|
49
51
|
//# sourceMappingURL=link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","names":[
|
|
1
|
+
{"version":3,"file":"link.js","names":[],"sources":["../../src/elements/link.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\nconst linkStyles = cva(\n 'inline-flex items-center gap-1 text-primary underline-offset-4 hover:underline transition-colors outline-none focus-visible:ring-ring/50 focus-visible:ring-[3px] rounded-sm cursor-pointer',\n {\n variants: {\n variant: {\n default: '',\n external: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\nexport type LinkVariantProps = VariantProps<typeof linkStyles>;\n\ntype LinkComponent = React.ElementType;\n\nlet configuredLinkComponent: LinkComponent | null = null;\n\n/**\n * Set a custom component to be used by `RouterLink` (e.g. your router's Link component).\n *\n * @example\n * import { setLinkComponent } from '@kubetail/ui/elements/link';\n * import { Link } from 'react-router-dom';\n * setLinkComponent(Link);\n */\nfunction setLinkComponent(component: LinkComponent) {\n configuredLinkComponent = component;\n}\n\n/**\n * Get the currently configured link component.\n */\nfunction getLinkComponent(): LinkComponent | null {\n return configuredLinkComponent;\n}\n\ntype LinkProps = React.ComponentProps<'a'> &\n LinkVariantProps & {\n asChild?: boolean;\n };\n\n/**\n * `Link` renders a styled anchor element.\n *\n * Supports `asChild` via Radix UI Slot for composition with custom components.\n *\n * @param props.variant - \"default\" | \"external\" (adds target=\"_blank\" and rel=\"noopener noreferrer\")\n * @param props.asChild - render as child element via Radix Slot\n */\nfunction Link({ className, variant, asChild = false, ...props }: LinkProps) {\n const Comp = asChild ? Slot : 'a';\n\n return (\n <Comp\n data-slot=\"link\"\n className={cn(linkStyles({ variant, className }))}\n {...(variant === 'external' && !asChild ? { target: '_blank', rel: 'noopener noreferrer' } : {})}\n {...props}\n />\n );\n}\n\ntype RouterLinkProps = Omit<LinkProps, 'asChild'> & Record<string, unknown>;\n\n/**\n * `RouterLink` renders using the component set via `setLinkComponent()`,\n * falling back to a plain `<a>` tag if none has been configured.\n *\n * @example\n * // In your app entry:\n * import { setLinkComponent } from '@kubetail/ui/elements/link';\n * import { Link as RRLink } from 'react-router-dom';\n * setLinkComponent(RRLink);\n *\n * // Then use RouterLink anywhere:\n * <RouterLink to=\"/dashboard\">Dashboard</RouterLink>\n */\nfunction RouterLink({ className, variant, ...props }: RouterLinkProps) {\n const Comp = configuredLinkComponent || 'a';\n\n return (\n <Comp\n data-slot=\"link\"\n className={cn(linkStyles({ variant, className }))}\n {...(variant === 'external' && Comp === 'a' ? { target: '_blank', rel: 'noopener noreferrer' } : {})}\n {...props}\n />\n );\n}\n\nexport { Link, RouterLink, linkStyles, setLinkComponent, getLinkComponent };\n"],"mappings":";;;;;AAKA,IAAM,IAAa,EACjB,+LACA;CACE,UAAU,EACR,SAAS;EACP,SAAS;EACT,UAAU;EACX,EACF;CACD,iBAAiB,EACf,SAAS,WACV;CACF,CACF,EAMG,IAAgD;AAUpD,SAAS,EAAiB,GAA0B;AAClD,KAA0B;;AAM5B,SAAS,IAAyC;AAChD,QAAO;;AAgBT,SAAS,EAAK,EAAE,cAAW,YAAS,aAAU,IAAO,GAAG,KAAoB;AAG1E,QACE,kBAHW,IAAU,IAAO,KAG5B;EACE,aAAU;EACV,WAAW,EAAG,EAAW;GAAE;GAAS;GAAW,CAAC,CAAC;EACjD,GAAK,MAAY,cAAc,CAAC,IAAU;GAAE,QAAQ;GAAU,KAAK;GAAuB,GAAG,EAAE;EAC/F,GAAI;EACJ,CAAA;;AAmBN,SAAS,EAAW,EAAE,cAAW,YAAS,GAAG,KAA0B;CACrE,IAAM,IAAO,KAA2B;AAExC,QACE,kBAAC,GAAD;EACE,aAAU;EACV,WAAW,EAAG,EAAW;GAAE;GAAS;GAAW,CAAC,CAAC;EACjD,GAAK,MAAY,cAAc,MAAS,MAAM;GAAE,QAAQ;GAAU,KAAK;GAAuB,GAAG,EAAE;EACnG,GAAI;EACJ,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../lib/utils.cjs`),n=require(`./button.cjs`);let r=require(`react/jsx-runtime`),i=require(`lucide-react`),a=require(`react`);a=e.__toESM(a);function o({className:e,...n}){return(0,r.jsx)(`nav`,{role:`navigation`,"aria-label":`pagination`,"data-slot":`pagination`,className:t.cn(`mx-auto flex w-full justify-center`,e),...n})}function s({className:e,...n}){return(0,r.jsx)(`ul`,{"data-slot":`pagination-content`,className:t.cn(`flex flex-row items-center gap-1`,e),...n})}function c({...e}){return(0,r.jsx)(`li`,{"data-slot":`pagination-item`,...e})}function l({className:e,isActive:i,size:a=`icon`,children:o,...s}){return(0,r.jsx)(`a`,{"aria-current":i?`page`:void 0,"data-slot":`pagination-link`,"data-active":i,className:t.cn(n.buttonVariants({variant:i?`outline`:`ghost`,size:a}),e),...s,children:o})}function u({className:e,...n}){return(0,r.jsxs)(l,{"aria-label":`Go to previous page`,size:`default`,className:t.cn(`gap-1 px-2.5 sm:pl-2.5`,e),...n,children:[(0,r.jsx)(i.ChevronLeftIcon,{}),(0,r.jsx)(`span`,{className:`hidden sm:block`,children:`Previous`})]})}function d({className:e,...n}){return(0,r.jsxs)(l,{"aria-label":`Go to next page`,size:`default`,className:t.cn(`gap-1 px-2.5 sm:pr-2.5`,e),...n,children:[(0,r.jsx)(`span`,{className:`hidden sm:block`,children:`Next`}),(0,r.jsx)(i.ChevronRightIcon,{})]})}function f({className:e,...n}){return(0,r.jsxs)(`span`,{"aria-hidden":!0,"data-slot":`pagination-ellipsis`,className:t.cn(`flex size-9 items-center justify-center`,e),...n,children:[(0,r.jsx)(i.MoreHorizontalIcon,{className:`size-4`}),(0,r.jsx)(`span`,{className:`sr-only`,children:`More pages`})]})}exports.Pagination=o,exports.PaginationContent=s,exports.PaginationEllipsis=f,exports.PaginationItem=c,exports.PaginationLink=l,exports.PaginationNext=d,exports.PaginationPrevious=u;
|
|
2
2
|
//# sourceMappingURL=pagination.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.cjs","names":[],"sources":["../../src/elements/pagination.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { Button, buttonVariants } from '@/elements/button';\n\nfunction Pagination({ className, ...props }: React.ComponentProps<'nav'>) {\n return (\n <nav\n role=\"navigation\"\n aria-label=\"pagination\"\n data-slot=\"pagination\"\n className={cn('mx-auto flex w-full justify-center', className)}\n {...props}\n />\n );\n}\n\nfunction PaginationContent({ className, ...props }: React.ComponentProps<'ul'>) {\n return <ul data-slot=\"pagination-content\" className={cn('flex flex-row items-center gap-1', className)} {...props} />;\n}\n\nfunction PaginationItem({ ...props }: React.ComponentProps<'li'>) {\n return <li data-slot=\"pagination-item\" {...props} />;\n}\n\ntype PaginationLinkProps = {\n isActive?: boolean;\n} & Pick<React.ComponentProps<typeof Button>, 'size'> &\n React.ComponentProps<'a'>;\n\nfunction PaginationLink({ className, isActive, size = 'icon', children, ...props }: PaginationLinkProps) {\n return (\n <a\n aria-current={isActive ? 'page' : undefined}\n data-slot=\"pagination-link\"\n data-active={isActive}\n className={cn(\n buttonVariants({\n variant: isActive ? 'outline' : 'ghost',\n size,\n }),\n className,\n )}\n {...props}\n >\n {children}\n </a>\n );\n}\n\nfunction PaginationPrevious({ className, ...props }: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to previous page\"\n size=\"default\"\n className={cn('gap-1 px-2.5 sm:pl-2.5', className)}\n {...props}\n >\n <ChevronLeftIcon />\n <span className=\"hidden sm:block\">Previous</span>\n </PaginationLink>\n );\n}\n\nfunction PaginationNext({ className, ...props }: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to next page\"\n size=\"default\"\n className={cn('gap-1 px-2.5 sm:pr-2.5', className)}\n {...props}\n >\n <span className=\"hidden sm:block\">Next</span>\n <ChevronRightIcon />\n </PaginationLink>\n );\n}\n\nfunction PaginationEllipsis({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n aria-hidden\n data-slot=\"pagination-ellipsis\"\n className={cn('flex size-9 items-center justify-center', className)}\n {...props}\n >\n <MoreHorizontalIcon className=\"size-4\" />\n <span className=\"sr-only\">More pages</span>\n </span>\n );\n}\n\nexport {\n Pagination,\n PaginationContent,\n PaginationLink,\n PaginationItem,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"pagination.cjs","names":[],"sources":["../../src/elements/pagination.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { Button, buttonVariants } from '@/elements/button';\n\nfunction Pagination({ className, ...props }: React.ComponentProps<'nav'>) {\n return (\n <nav\n role=\"navigation\"\n aria-label=\"pagination\"\n data-slot=\"pagination\"\n className={cn('mx-auto flex w-full justify-center', className)}\n {...props}\n />\n );\n}\n\nfunction PaginationContent({ className, ...props }: React.ComponentProps<'ul'>) {\n return <ul data-slot=\"pagination-content\" className={cn('flex flex-row items-center gap-1', className)} {...props} />;\n}\n\nfunction PaginationItem({ ...props }: React.ComponentProps<'li'>) {\n return <li data-slot=\"pagination-item\" {...props} />;\n}\n\ntype PaginationLinkProps = {\n isActive?: boolean;\n} & Pick<React.ComponentProps<typeof Button>, 'size'> &\n React.ComponentProps<'a'>;\n\nfunction PaginationLink({ className, isActive, size = 'icon', children, ...props }: PaginationLinkProps) {\n return (\n <a\n aria-current={isActive ? 'page' : undefined}\n data-slot=\"pagination-link\"\n data-active={isActive}\n className={cn(\n buttonVariants({\n variant: isActive ? 'outline' : 'ghost',\n size,\n }),\n className,\n )}\n {...props}\n >\n {children}\n </a>\n );\n}\n\nfunction PaginationPrevious({ className, ...props }: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to previous page\"\n size=\"default\"\n className={cn('gap-1 px-2.5 sm:pl-2.5', className)}\n {...props}\n >\n <ChevronLeftIcon />\n <span className=\"hidden sm:block\">Previous</span>\n </PaginationLink>\n );\n}\n\nfunction PaginationNext({ className, ...props }: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to next page\"\n size=\"default\"\n className={cn('gap-1 px-2.5 sm:pr-2.5', className)}\n {...props}\n >\n <span className=\"hidden sm:block\">Next</span>\n <ChevronRightIcon />\n </PaginationLink>\n );\n}\n\nfunction PaginationEllipsis({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n aria-hidden\n data-slot=\"pagination-ellipsis\"\n className={cn('flex size-9 items-center justify-center', className)}\n {...props}\n >\n <MoreHorizontalIcon className=\"size-4\" />\n <span className=\"sr-only\">More pages</span>\n </span>\n );\n}\n\nexport {\n Pagination,\n PaginationContent,\n PaginationLink,\n PaginationItem,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n};\n"],"mappings":"+QAMA,SAAS,EAAW,CAAE,YAAW,GAAG,GAAsC,CACxE,OAAA,EAAA,EAAA,KACG,MAAD,CACE,KAAK,aACL,aAAW,aACX,YAAU,aACV,UAAW,EAAA,GAAG,qCAAsC,EAAU,CAC9D,GAAI,EACJ,CAAA,CAIN,SAAS,EAAkB,CAAE,YAAW,GAAG,GAAqC,CAC9E,OAAA,EAAA,EAAA,KAAQ,KAAD,CAAI,YAAU,qBAAqB,UAAW,EAAA,GAAG,mCAAoC,EAAU,CAAE,GAAI,EAAS,CAAA,CAGvH,SAAS,EAAe,CAAE,GAAG,GAAqC,CAChE,OAAA,EAAA,EAAA,KAAQ,KAAD,CAAI,YAAU,kBAAkB,GAAI,EAAS,CAAA,CAQtD,SAAS,EAAe,CAAE,YAAW,WAAU,OAAO,OAAQ,WAAU,GAAG,GAA8B,CACvG,OAAA,EAAA,EAAA,KACG,IAAD,CACE,eAAc,EAAW,OAAS,IAAA,GAClC,YAAU,kBACV,cAAa,EACb,UAAW,EAAA,GACT,EAAA,eAAe,CACb,QAAS,EAAW,UAAY,QAChC,OACD,CAAC,CACF,EACD,CACD,GAAI,EAEH,WACC,CAAA,CAIR,SAAS,EAAmB,CAAE,YAAW,GAAG,GAAsD,CAChG,OAAA,EAAA,EAAA,MACG,EAAD,CACE,aAAW,sBACX,KAAK,UACL,UAAW,EAAA,GAAG,yBAA0B,EAAU,CAClD,GAAI,WAJN,EAAA,EAAA,EAAA,KAMG,EAAA,gBAAD,EAAmB,CAAA,EAAA,EAAA,EAAA,KAClB,OAAD,CAAM,UAAU,2BAAkB,WAAe,CAAA,CAClC,GAIrB,SAAS,EAAe,CAAE,YAAW,GAAG,GAAsD,CAC5F,OAAA,EAAA,EAAA,MACG,EAAD,CACE,aAAW,kBACX,KAAK,UACL,UAAW,EAAA,GAAG,yBAA0B,EAAU,CAClD,GAAI,WAJN,EAAA,EAAA,EAAA,KAMG,OAAD,CAAM,UAAU,2BAAkB,OAAW,CAAA,EAAA,EAAA,EAAA,KAC5C,EAAA,iBAAD,EAAoB,CAAA,CACL,GAIrB,SAAS,EAAmB,CAAE,YAAW,GAAG,GAAuC,CACjF,OAAA,EAAA,EAAA,MACG,OAAD,CACE,cAAA,GACA,YAAU,sBACV,UAAW,EAAA,GAAG,0CAA2C,EAAU,CACnE,GAAI,WAJN,EAAA,EAAA,EAAA,KAMG,EAAA,mBAAD,CAAoB,UAAU,SAAW,CAAA,EAAA,EAAA,EAAA,KACxC,OAAD,CAAM,UAAU,mBAAU,aAAiB,CAAA,CACtC"}
|
|
@@ -1,79 +1,81 @@
|
|
|
1
|
-
import { cn } from "../lib/utils.js";
|
|
2
|
-
import { buttonVariants } from "./button.js";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
|
|
1
|
+
import { cn as e } from "../lib/utils.js";
|
|
2
|
+
import { buttonVariants as t } from "./button.js";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { ChevronLeftIcon as i, ChevronRightIcon as a, MoreHorizontalIcon as o } from "lucide-react";
|
|
5
5
|
import "react";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
//#region src/elements/pagination.tsx
|
|
7
|
+
function s({ className: t, ...r }) {
|
|
8
|
+
return /* @__PURE__ */ n("nav", {
|
|
8
9
|
role: "navigation",
|
|
9
10
|
"aria-label": "pagination",
|
|
10
11
|
"data-slot": "pagination",
|
|
11
|
-
className:
|
|
12
|
-
...
|
|
12
|
+
className: e("mx-auto flex w-full justify-center", t),
|
|
13
|
+
...r
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
-
return /* @__PURE__ */
|
|
16
|
+
function c({ className: t, ...r }) {
|
|
17
|
+
return /* @__PURE__ */ n("ul", {
|
|
17
18
|
"data-slot": "pagination-content",
|
|
18
|
-
className:
|
|
19
|
-
...
|
|
19
|
+
className: e("flex flex-row items-center gap-1", t),
|
|
20
|
+
...r
|
|
20
21
|
});
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
-
return /* @__PURE__ */
|
|
23
|
+
function l({ ...e }) {
|
|
24
|
+
return /* @__PURE__ */ n("li", {
|
|
24
25
|
"data-slot": "pagination-item",
|
|
25
26
|
...e
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
"aria-current":
|
|
29
|
+
function u({ className: r, isActive: i, size: a = "icon", children: o, ...s }) {
|
|
30
|
+
return /* @__PURE__ */ n("a", {
|
|
31
|
+
"aria-current": i ? "page" : void 0,
|
|
31
32
|
"data-slot": "pagination-link",
|
|
32
|
-
"data-active":
|
|
33
|
-
className:
|
|
34
|
-
variant:
|
|
35
|
-
size:
|
|
36
|
-
}),
|
|
37
|
-
...
|
|
38
|
-
children:
|
|
33
|
+
"data-active": i,
|
|
34
|
+
className: e(t({
|
|
35
|
+
variant: i ? "outline" : "ghost",
|
|
36
|
+
size: a
|
|
37
|
+
}), r),
|
|
38
|
+
...s,
|
|
39
|
+
children: o
|
|
39
40
|
});
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
-
return /* @__PURE__ */
|
|
42
|
+
function d({ className: t, ...a }) {
|
|
43
|
+
return /* @__PURE__ */ r(u, {
|
|
43
44
|
"aria-label": "Go to previous page",
|
|
44
45
|
size: "default",
|
|
45
|
-
className:
|
|
46
|
-
...
|
|
47
|
-
children: [/* @__PURE__ */
|
|
46
|
+
className: e("gap-1 px-2.5 sm:pl-2.5", t),
|
|
47
|
+
...a,
|
|
48
|
+
children: [/* @__PURE__ */ n(i, {}), /* @__PURE__ */ n("span", {
|
|
48
49
|
className: "hidden sm:block",
|
|
49
50
|
children: "Previous"
|
|
50
51
|
})]
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
|
-
function
|
|
54
|
-
return /* @__PURE__ */
|
|
54
|
+
function f({ className: t, ...i }) {
|
|
55
|
+
return /* @__PURE__ */ r(u, {
|
|
55
56
|
"aria-label": "Go to next page",
|
|
56
57
|
size: "default",
|
|
57
|
-
className:
|
|
58
|
-
...
|
|
59
|
-
children: [/* @__PURE__ */
|
|
58
|
+
className: e("gap-1 px-2.5 sm:pr-2.5", t),
|
|
59
|
+
...i,
|
|
60
|
+
children: [/* @__PURE__ */ n("span", {
|
|
60
61
|
className: "hidden sm:block",
|
|
61
62
|
children: "Next"
|
|
62
|
-
}), /* @__PURE__ */
|
|
63
|
+
}), /* @__PURE__ */ n(a, {})]
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
|
-
function
|
|
66
|
-
return /* @__PURE__ */
|
|
66
|
+
function p({ className: t, ...i }) {
|
|
67
|
+
return /* @__PURE__ */ r("span", {
|
|
67
68
|
"aria-hidden": !0,
|
|
68
69
|
"data-slot": "pagination-ellipsis",
|
|
69
|
-
className:
|
|
70
|
-
...
|
|
71
|
-
children: [/* @__PURE__ */
|
|
70
|
+
className: e("flex size-9 items-center justify-center", t),
|
|
71
|
+
...i,
|
|
72
|
+
children: [/* @__PURE__ */ n(o, { className: "size-4" }), /* @__PURE__ */ n("span", {
|
|
72
73
|
className: "sr-only",
|
|
73
74
|
children: "More pages"
|
|
74
75
|
})]
|
|
75
76
|
});
|
|
76
77
|
}
|
|
77
|
-
|
|
78
|
+
//#endregion
|
|
79
|
+
export { s as Pagination, c as PaginationContent, p as PaginationEllipsis, l as PaginationItem, u as PaginationLink, f as PaginationNext, d as PaginationPrevious };
|
|
78
80
|
|
|
79
81
|
//# sourceMappingURL=pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","names":[],"sources":["../../src/elements/pagination.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { Button, buttonVariants } from '@/elements/button';\n\nfunction Pagination({ className, ...props }: React.ComponentProps<'nav'>) {\n return (\n <nav\n role=\"navigation\"\n aria-label=\"pagination\"\n data-slot=\"pagination\"\n className={cn('mx-auto flex w-full justify-center', className)}\n {...props}\n />\n );\n}\n\nfunction PaginationContent({ className, ...props }: React.ComponentProps<'ul'>) {\n return <ul data-slot=\"pagination-content\" className={cn('flex flex-row items-center gap-1', className)} {...props} />;\n}\n\nfunction PaginationItem({ ...props }: React.ComponentProps<'li'>) {\n return <li data-slot=\"pagination-item\" {...props} />;\n}\n\ntype PaginationLinkProps = {\n isActive?: boolean;\n} & Pick<React.ComponentProps<typeof Button>, 'size'> &\n React.ComponentProps<'a'>;\n\nfunction PaginationLink({ className, isActive, size = 'icon', children, ...props }: PaginationLinkProps) {\n return (\n <a\n aria-current={isActive ? 'page' : undefined}\n data-slot=\"pagination-link\"\n data-active={isActive}\n className={cn(\n buttonVariants({\n variant: isActive ? 'outline' : 'ghost',\n size,\n }),\n className,\n )}\n {...props}\n >\n {children}\n </a>\n );\n}\n\nfunction PaginationPrevious({ className, ...props }: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to previous page\"\n size=\"default\"\n className={cn('gap-1 px-2.5 sm:pl-2.5', className)}\n {...props}\n >\n <ChevronLeftIcon />\n <span className=\"hidden sm:block\">Previous</span>\n </PaginationLink>\n );\n}\n\nfunction PaginationNext({ className, ...props }: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to next page\"\n size=\"default\"\n className={cn('gap-1 px-2.5 sm:pr-2.5', className)}\n {...props}\n >\n <span className=\"hidden sm:block\">Next</span>\n <ChevronRightIcon />\n </PaginationLink>\n );\n}\n\nfunction PaginationEllipsis({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n aria-hidden\n data-slot=\"pagination-ellipsis\"\n className={cn('flex size-9 items-center justify-center', className)}\n {...props}\n >\n <MoreHorizontalIcon className=\"size-4\" />\n <span className=\"sr-only\">More pages</span>\n </span>\n );\n}\n\nexport {\n Pagination,\n PaginationContent,\n PaginationLink,\n PaginationItem,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"pagination.js","names":[],"sources":["../../src/elements/pagination.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { Button, buttonVariants } from '@/elements/button';\n\nfunction Pagination({ className, ...props }: React.ComponentProps<'nav'>) {\n return (\n <nav\n role=\"navigation\"\n aria-label=\"pagination\"\n data-slot=\"pagination\"\n className={cn('mx-auto flex w-full justify-center', className)}\n {...props}\n />\n );\n}\n\nfunction PaginationContent({ className, ...props }: React.ComponentProps<'ul'>) {\n return <ul data-slot=\"pagination-content\" className={cn('flex flex-row items-center gap-1', className)} {...props} />;\n}\n\nfunction PaginationItem({ ...props }: React.ComponentProps<'li'>) {\n return <li data-slot=\"pagination-item\" {...props} />;\n}\n\ntype PaginationLinkProps = {\n isActive?: boolean;\n} & Pick<React.ComponentProps<typeof Button>, 'size'> &\n React.ComponentProps<'a'>;\n\nfunction PaginationLink({ className, isActive, size = 'icon', children, ...props }: PaginationLinkProps) {\n return (\n <a\n aria-current={isActive ? 'page' : undefined}\n data-slot=\"pagination-link\"\n data-active={isActive}\n className={cn(\n buttonVariants({\n variant: isActive ? 'outline' : 'ghost',\n size,\n }),\n className,\n )}\n {...props}\n >\n {children}\n </a>\n );\n}\n\nfunction PaginationPrevious({ className, ...props }: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to previous page\"\n size=\"default\"\n className={cn('gap-1 px-2.5 sm:pl-2.5', className)}\n {...props}\n >\n <ChevronLeftIcon />\n <span className=\"hidden sm:block\">Previous</span>\n </PaginationLink>\n );\n}\n\nfunction PaginationNext({ className, ...props }: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to next page\"\n size=\"default\"\n className={cn('gap-1 px-2.5 sm:pr-2.5', className)}\n {...props}\n >\n <span className=\"hidden sm:block\">Next</span>\n <ChevronRightIcon />\n </PaginationLink>\n );\n}\n\nfunction PaginationEllipsis({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n aria-hidden\n data-slot=\"pagination-ellipsis\"\n className={cn('flex size-9 items-center justify-center', className)}\n {...props}\n >\n <MoreHorizontalIcon className=\"size-4\" />\n <span className=\"sr-only\">More pages</span>\n </span>\n );\n}\n\nexport {\n Pagination,\n PaginationContent,\n PaginationLink,\n PaginationItem,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n};\n"],"mappings":";;;;;;AAMA,SAAS,EAAW,EAAE,cAAW,GAAG,KAAsC;AACxE,QACE,kBAAC,OAAD;EACE,MAAK;EACL,cAAW;EACX,aAAU;EACV,WAAW,EAAG,sCAAsC,EAAU;EAC9D,GAAI;EACJ,CAAA;;AAIN,SAAS,EAAkB,EAAE,cAAW,GAAG,KAAqC;AAC9E,QAAO,kBAAC,MAAD;EAAI,aAAU;EAAqB,WAAW,EAAG,oCAAoC,EAAU;EAAE,GAAI;EAAS,CAAA;;AAGvH,SAAS,EAAe,EAAE,GAAG,KAAqC;AAChE,QAAO,kBAAC,MAAD;EAAI,aAAU;EAAkB,GAAI;EAAS,CAAA;;AAQtD,SAAS,EAAe,EAAE,cAAW,aAAU,UAAO,QAAQ,aAAU,GAAG,KAA8B;AACvG,QACE,kBAAC,KAAD;EACE,gBAAc,IAAW,SAAS,KAAA;EAClC,aAAU;EACV,eAAa;EACb,WAAW,EACT,EAAe;GACb,SAAS,IAAW,YAAY;GAChC;GACD,CAAC,EACF,EACD;EACD,GAAI;EAEH;EACC,CAAA;;AAIR,SAAS,EAAmB,EAAE,cAAW,GAAG,KAAsD;AAChG,QACE,kBAAC,GAAD;EACE,cAAW;EACX,MAAK;EACL,WAAW,EAAG,0BAA0B,EAAU;EAClD,GAAI;YAJN,CAME,kBAAC,GAAD,EAAmB,CAAA,EACnB,kBAAC,QAAD;GAAM,WAAU;aAAkB;GAAe,CAAA,CAClC;;;AAIrB,SAAS,EAAe,EAAE,cAAW,GAAG,KAAsD;AAC5F,QACE,kBAAC,GAAD;EACE,cAAW;EACX,MAAK;EACL,WAAW,EAAG,0BAA0B,EAAU;EAClD,GAAI;YAJN,CAME,kBAAC,QAAD;GAAM,WAAU;aAAkB;GAAW,CAAA,EAC7C,kBAAC,GAAD,EAAoB,CAAA,CACL;;;AAIrB,SAAS,EAAmB,EAAE,cAAW,GAAG,KAAuC;AACjF,QACE,kBAAC,QAAD;EACE,eAAA;EACA,aAAU;EACV,WAAW,EAAG,2CAA2C,EAAU;EACnE,GAAI;YAJN,CAME,kBAAC,GAAD,EAAoB,WAAU,UAAW,CAAA,EACzC,kBAAC,QAAD;GAAM,WAAU;aAAU;GAAiB,CAAA,CACtC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../lib/utils.cjs`);let n=require(`react/jsx-runtime`),r=require(`@radix-ui/react-popover`);r=e.__toESM(r);function i({...e}){return(0,n.jsx)(r.Root,{"data-slot":`popover`,...e})}function a({...e}){return(0,n.jsx)(r.Trigger,{"data-slot":`popover-trigger`,...e})}function o({className:e,align:i=`center`,sideOffset:a=4,...o}){return(0,n.jsx)(r.Portal,{children:(0,n.jsx)(r.Content,{"data-slot":`popover-content`,align:i,sideOffset:a,className:t.cn(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden`,e),...o})})}function s({...e}){return(0,n.jsx)(r.Anchor,{"data-slot":`popover-anchor`,...e})}var c=r.Close;exports.Popover=i,exports.PopoverAnchor=s,exports.PopoverClose=c,exports.PopoverContent=o,exports.PopoverTrigger=a;
|
|
2
2
|
//# sourceMappingURL=popover.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.cjs","names":[],"sources":["../../src/elements/popover.tsx"],"sourcesContent":["'use client';\n\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\n\nimport { cn } from '@/lib/utils';\n\nfunction Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\nfunction PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n}\n\nfunction PopoverContent({\n className,\n align = 'center',\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden',\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\nfunction PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />;\n}\n\nconst PopoverClose = PopoverPrimitive.Close;\n\nexport { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"popover.cjs","names":[],"sources":["../../src/elements/popover.tsx"],"sourcesContent":["'use client';\n\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\n\nimport { cn } from '@/lib/utils';\n\nfunction Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\nfunction PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n}\n\nfunction PopoverContent({\n className,\n align = 'center',\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden',\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\nfunction PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />;\n}\n\nconst PopoverClose = PopoverPrimitive.Close;\n\nexport { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger };\n"],"mappings":"0PAMA,SAAS,EAAQ,CAAE,GAAG,GAA6D,CACjF,OAAA,EAAA,EAAA,KAAQ,EAAiB,KAAlB,CAAuB,YAAU,UAAU,GAAI,EAAS,CAAA,CAGjE,SAAS,EAAe,CAAE,GAAG,GAAgE,CAC3F,OAAA,EAAA,EAAA,KAAQ,EAAiB,QAAlB,CAA0B,YAAU,kBAAkB,GAAI,EAAS,CAAA,CAG5E,SAAS,EAAe,CACtB,YACA,QAAQ,SACR,aAAa,EACb,GAAG,GACqD,CACxD,OAAA,EAAA,EAAA,KACG,EAAiB,OAAlB,CAAA,UAAA,EAAA,EAAA,KACG,EAAiB,QAAlB,CACE,YAAU,kBACH,QACK,aACZ,UAAW,EAAA,GACT,ieACA,EACD,CACD,GAAI,EACJ,CAAA,CACsB,CAAA,CAI9B,SAAS,EAAc,CAAE,GAAG,GAA+D,CACzF,OAAA,EAAA,EAAA,KAAQ,EAAiB,OAAlB,CAAyB,YAAU,iBAAiB,GAAI,EAAS,CAAA,CAG1E,IAAM,EAAe,EAAiB"}
|
package/dist/elements/popover.js
CHANGED
|
@@ -1,35 +1,37 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { cn } from "../lib/utils.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import * as
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { cn as e } from "../lib/utils.js";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
import * as n from "@radix-ui/react-popover";
|
|
5
|
+
//#region src/elements/popover.tsx
|
|
6
|
+
function r({ ...e }) {
|
|
7
|
+
return /* @__PURE__ */ t(n.Root, {
|
|
7
8
|
"data-slot": "popover",
|
|
8
9
|
...e
|
|
9
10
|
});
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
-
return /* @__PURE__ */
|
|
12
|
+
function i({ ...e }) {
|
|
13
|
+
return /* @__PURE__ */ t(n.Trigger, {
|
|
13
14
|
"data-slot": "popover-trigger",
|
|
14
15
|
...e
|
|
15
16
|
});
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
-
return /* @__PURE__ */
|
|
18
|
+
function a({ className: r, align: i = "center", sideOffset: a = 4, ...o }) {
|
|
19
|
+
return /* @__PURE__ */ t(n.Portal, { children: /* @__PURE__ */ t(n.Content, {
|
|
19
20
|
"data-slot": "popover-content",
|
|
20
|
-
align:
|
|
21
|
-
sideOffset:
|
|
22
|
-
className:
|
|
23
|
-
...
|
|
21
|
+
align: i,
|
|
22
|
+
sideOffset: a,
|
|
23
|
+
className: e("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", r),
|
|
24
|
+
...o
|
|
24
25
|
}) });
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
function o({ ...e }) {
|
|
28
|
+
return /* @__PURE__ */ t(n.Anchor, {
|
|
28
29
|
"data-slot": "popover-anchor",
|
|
29
30
|
...e
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
|
-
var
|
|
33
|
-
|
|
33
|
+
var s = n.Close;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { r as Popover, o as PopoverAnchor, s as PopoverClose, a as PopoverContent, i as PopoverTrigger };
|
|
34
36
|
|
|
35
37
|
//# sourceMappingURL=popover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","names":[],"sources":["../../src/elements/popover.tsx"],"sourcesContent":["'use client';\n\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\n\nimport { cn } from '@/lib/utils';\n\nfunction Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\nfunction PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n}\n\nfunction PopoverContent({\n className,\n align = 'center',\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden',\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\nfunction PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />;\n}\n\nconst PopoverClose = PopoverPrimitive.Close;\n\nexport { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"popover.js","names":[],"sources":["../../src/elements/popover.tsx"],"sourcesContent":["'use client';\n\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\n\nimport { cn } from '@/lib/utils';\n\nfunction Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\nfunction PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n}\n\nfunction PopoverContent({\n className,\n align = 'center',\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden',\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\nfunction PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />;\n}\n\nconst PopoverClose = PopoverPrimitive.Close;\n\nexport { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger };\n"],"mappings":";;;;;AAMA,SAAS,EAAQ,EAAE,GAAG,KAA6D;AACjF,QAAO,kBAAC,EAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAI;EAAS,CAAA;;AAGjE,SAAS,EAAe,EAAE,GAAG,KAAgE;AAC3F,QAAO,kBAAC,EAAiB,SAAlB;EAA0B,aAAU;EAAkB,GAAI;EAAS,CAAA;;AAG5E,SAAS,EAAe,EACtB,cACA,WAAQ,UACR,gBAAa,GACb,GAAG,KACqD;AACxD,QACE,kBAAC,EAAiB,QAAlB,EAAA,UACE,kBAAC,EAAiB,SAAlB;EACE,aAAU;EACH;EACK;EACZ,WAAW,EACT,keACA,EACD;EACD,GAAI;EACJ,CAAA,EACsB,CAAA;;AAI9B,SAAS,EAAc,EAAE,GAAG,KAA+D;AACzF,QAAO,kBAAC,EAAiB,QAAlB;EAAyB,aAAU;EAAiB,GAAI;EAAS,CAAA;;AAG1E,IAAM,IAAe,EAAiB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`})
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../lib/utils.cjs`),t=require(`./input.cjs`);let n=require(`react/jsx-runtime`),r=require(`lucide-react`);var i=(0,require(`react`).forwardRef)(({className:i,containerClassName:a,placeholder:o=``,...s},c)=>{let{disabled:l}=s;return(0,n.jsxs)(`div`,{className:e.cn(`relative w-full max-w-sm`,a),children:[(0,n.jsx)(r.Search,{"aria-hidden":!0,className:e.cn(`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`,l&&`opacity-50`)}),(0,n.jsx)(t.Input,{ref:c,type:`search`,placeholder:o,className:e.cn(`pl-9`,i),...s})]})});i.displayName=`SearchBox`,exports.SearchBox=i;
|
|
2
2
|
//# sourceMappingURL=search-box.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-box.cjs","names":[],"sources":["../../src/elements/search-box.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { Search } from 'lucide-react';\n\nimport { Input } from '@/elements/input';\nimport { cn } from '@/lib/utils';\n\nexport type SearchBoxProps = React.ComponentProps<typeof Input> & {\n containerClassName?: string;\n};\n\n/**\n * A compact search box.\n * - Uses shadcn <Input/>\n * - Leading search icon\n */\nconst SearchBox = forwardRef<HTMLInputElement, SearchBoxProps>(\n ({ className, containerClassName, placeholder = '', ...props }, ref) => {\n const { disabled } = props;\n\n return (\n <div className={cn('relative w-full max-w-sm', containerClassName)}>\n <Search\n aria-hidden\n className={cn(\n 'pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground',\n disabled && 'opacity-50',\n )}\n />\n <Input ref={ref} type=\"search\" placeholder={placeholder} className={cn('pl-9', className)} {...props} />\n </div>\n );\n },\n);\n\nSearchBox.displayName = 'SearchBox';\n\nexport { SearchBox };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"search-box.cjs","names":[],"sources":["../../src/elements/search-box.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { Search } from 'lucide-react';\n\nimport { Input } from '@/elements/input';\nimport { cn } from '@/lib/utils';\n\nexport type SearchBoxProps = React.ComponentProps<typeof Input> & {\n containerClassName?: string;\n};\n\n/**\n * A compact search box.\n * - Uses shadcn <Input/>\n * - Leading search icon\n */\nconst SearchBox = forwardRef<HTMLInputElement, SearchBoxProps>(\n ({ className, containerClassName, placeholder = '', ...props }, ref) => {\n const { disabled } = props;\n\n return (\n <div className={cn('relative w-full max-w-sm', containerClassName)}>\n <Search\n aria-hidden\n className={cn(\n 'pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground',\n disabled && 'opacity-50',\n )}\n />\n <Input ref={ref} type=\"search\" placeholder={placeholder} className={cn('pl-9', className)} {...props} />\n </div>\n );\n },\n);\n\nSearchBox.displayName = 'SearchBox';\n\nexport { SearchBox };\n"],"mappings":"0OAeA,IAAM,GAAA,mBAAA,aACH,CAAE,YAAW,qBAAoB,cAAc,GAAI,GAAG,GAAS,IAAQ,CACtE,GAAM,CAAE,YAAa,EAErB,OAAA,EAAA,EAAA,MACG,MAAD,CAAK,UAAW,EAAA,GAAG,2BAA4B,EAAmB,UAAlE,EAAA,EAAA,EAAA,KACG,EAAA,OAAD,CACE,cAAA,GACA,UAAW,EAAA,GACT,6FACA,GAAY,aACb,CACD,CAAA,EAAA,EAAA,EAAA,KACD,EAAA,MAAD,CAAY,MAAK,KAAK,SAAsB,cAAa,UAAW,EAAA,GAAG,OAAQ,EAAU,CAAE,GAAI,EAAS,CAAA,CACpG,IAGX,CAED,EAAU,YAAc"}
|
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import { cn } from "../lib/utils.js";
|
|
2
|
-
import { Input } from "./input.js";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { Search } from "lucide-react";
|
|
5
|
-
import { forwardRef } from "react";
|
|
6
|
-
|
|
1
|
+
import { cn as e } from "../lib/utils.js";
|
|
2
|
+
import { Input as t } from "./input.js";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { Search as i } from "lucide-react";
|
|
5
|
+
import { forwardRef as a } from "react";
|
|
6
|
+
//#region src/elements/search-box.tsx
|
|
7
|
+
var o = a(({ className: a, containerClassName: o, placeholder: s = "", ...c }, l) => {
|
|
7
8
|
let { disabled: u } = c;
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
className:
|
|
10
|
-
children: [/* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ r("div", {
|
|
10
|
+
className: e("relative w-full max-w-sm", o),
|
|
11
|
+
children: [/* @__PURE__ */ n(i, {
|
|
11
12
|
"aria-hidden": !0,
|
|
12
|
-
className:
|
|
13
|
-
}), /* @__PURE__ */
|
|
13
|
+
className: e("pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground", u && "opacity-50")
|
|
14
|
+
}), /* @__PURE__ */ n(t, {
|
|
14
15
|
ref: l,
|
|
15
16
|
type: "search",
|
|
16
17
|
placeholder: s,
|
|
17
|
-
className:
|
|
18
|
+
className: e("pl-9", a),
|
|
18
19
|
...c
|
|
19
20
|
})]
|
|
20
21
|
});
|
|
21
22
|
});
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
o.displayName = "SearchBox";
|
|
24
|
+
//#endregion
|
|
25
|
+
export { o as SearchBox };
|
|
24
26
|
|
|
25
27
|
//# sourceMappingURL=search-box.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-box.js","names":[],"sources":["../../src/elements/search-box.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { Search } from 'lucide-react';\n\nimport { Input } from '@/elements/input';\nimport { cn } from '@/lib/utils';\n\nexport type SearchBoxProps = React.ComponentProps<typeof Input> & {\n containerClassName?: string;\n};\n\n/**\n * A compact search box.\n * - Uses shadcn <Input/>\n * - Leading search icon\n */\nconst SearchBox = forwardRef<HTMLInputElement, SearchBoxProps>(\n ({ className, containerClassName, placeholder = '', ...props }, ref) => {\n const { disabled } = props;\n\n return (\n <div className={cn('relative w-full max-w-sm', containerClassName)}>\n <Search\n aria-hidden\n className={cn(\n 'pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground',\n disabled && 'opacity-50',\n )}\n />\n <Input ref={ref} type=\"search\" placeholder={placeholder} className={cn('pl-9', className)} {...props} />\n </div>\n );\n },\n);\n\nSearchBox.displayName = 'SearchBox';\n\nexport { SearchBox };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"search-box.js","names":[],"sources":["../../src/elements/search-box.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { Search } from 'lucide-react';\n\nimport { Input } from '@/elements/input';\nimport { cn } from '@/lib/utils';\n\nexport type SearchBoxProps = React.ComponentProps<typeof Input> & {\n containerClassName?: string;\n};\n\n/**\n * A compact search box.\n * - Uses shadcn <Input/>\n * - Leading search icon\n */\nconst SearchBox = forwardRef<HTMLInputElement, SearchBoxProps>(\n ({ className, containerClassName, placeholder = '', ...props }, ref) => {\n const { disabled } = props;\n\n return (\n <div className={cn('relative w-full max-w-sm', containerClassName)}>\n <Search\n aria-hidden\n className={cn(\n 'pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground',\n disabled && 'opacity-50',\n )}\n />\n <Input ref={ref} type=\"search\" placeholder={placeholder} className={cn('pl-9', className)} {...props} />\n </div>\n );\n },\n);\n\nSearchBox.displayName = 'SearchBox';\n\nexport { SearchBox };\n"],"mappings":";;;;;;AAeA,IAAM,IAAY,GACf,EAAE,cAAW,uBAAoB,iBAAc,IAAI,GAAG,KAAS,MAAQ;CACtE,IAAM,EAAE,gBAAa;AAErB,QACE,kBAAC,OAAD;EAAK,WAAW,EAAG,4BAA4B,EAAmB;YAAlE,CACE,kBAAC,GAAD;GACE,eAAA;GACA,WAAW,EACT,8FACA,KAAY,aACb;GACD,CAAA,EACF,kBAAC,GAAD;GAAY;GAAK,MAAK;GAAsB;GAAa,WAAW,EAAG,QAAQ,EAAU;GAAE,GAAI;GAAS,CAAA,CACpG;;EAGX;AAED,EAAU,cAAc"}
|