@lattice-php/lattice 0.25.0 → 0.26.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/action/components/action-form.js +1 -1
- package/dist/action/components/action-form.js.map +1 -1
- package/dist/action/components/action-group.js +1 -1
- package/dist/action/components/action-group.js.map +1 -1
- package/dist/action/components/action.js +3 -2
- package/dist/action/components/action.js.map +1 -1
- package/dist/action/hooks/use-action.js +2 -1
- package/dist/action/hooks/use-action.js.map +1 -1
- package/dist/appearance/index.d.ts +1 -1
- package/dist/appearance/index.js +8 -8
- package/dist/appearance/index.js.map +1 -1
- package/dist/chat/components/prompt-input.js +1 -2
- package/dist/chat/components/prompt-input.js.map +1 -1
- package/dist/create-app.js +2 -2
- package/dist/create-app.js.map +1 -1
- package/dist/form/components/base/submit-button.d.ts +4 -3
- package/dist/form/components/base/submit-button.js +2 -1
- package/dist/form/components/base/submit-button.js.map +1 -1
- package/dist/form/components/fields/date-picker-field.js +3 -3
- package/dist/form/components/fields/date-picker-field.js.map +1 -1
- package/dist/form/components/fields/number-input.js +1 -1
- package/dist/form/components/fields/number-input.js.map +1 -1
- package/dist/form/components/fields/rich-editor-field.js +1 -1
- package/dist/form/components/fields/rich-editor-field.js.map +1 -1
- package/dist/form/components/fields/row-action-menu.js +3 -3
- package/dist/form/components/fields/row-action-menu.js.map +1 -1
- package/dist/form/components/fields/row-actions.d.ts +1 -1
- package/dist/form/components/fields/row-actions.js +4 -4
- package/dist/form/components/fields/row-actions.js.map +1 -1
- package/dist/form/components/fields/toggle.js +1 -1
- package/dist/form/components/fields/toggle.js.map +1 -1
- package/dist/form/components/form.js +7 -3
- package/dist/form/components/form.js.map +1 -1
- package/dist/form/components/wizard.js +1 -1
- package/dist/form/components/wizard.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/lattice.css +183 -115
- package/dist/notifications/components/notification-item.js +3 -1
- package/dist/notifications/components/notification-item.js.map +1 -1
- package/dist/notifications/components/notifications.js +2 -4
- package/dist/notifications/components/notifications.js.map +1 -1
- package/dist/table/components/bulk-bar.js +2 -0
- package/dist/table/components/bulk-bar.js.map +1 -1
- package/dist/table/components/cells/badge-cell.js +3 -6
- package/dist/table/components/cells/badge-cell.js.map +1 -1
- package/dist/table/components/cells/text-cell.js +6 -9
- package/dist/table/components/cells/text-cell.js.map +1 -1
- package/dist/table/components/column-filter-control.js +2 -2
- package/dist/table/components/column-filter-control.js.map +1 -1
- package/dist/table/components/filter-bar.js +1 -1
- package/dist/table/components/filter-bar.js.map +1 -1
- package/dist/table/components/pagination.js +6 -6
- package/dist/table/components/pagination.js.map +1 -1
- package/dist/table/lib/bulk.d.ts +3 -2
- package/dist/table/lib/bulk.js +2 -1
- package/dist/table/lib/bulk.js.map +1 -1
- package/dist/toast/toast.js +3 -1
- package/dist/toast/toast.js.map +1 -1
- package/dist/toast/variant-styles.js +15 -1
- package/dist/toast/variant-styles.js.map +1 -1
- package/dist/types/generated.d.ts +14 -9
- package/dist/ui/action-menu-context.d.ts +1 -1
- package/dist/ui/action-menu-context.js +1 -1
- package/dist/ui/action-menu-context.js.map +1 -1
- package/dist/ui/affix-group.js +1 -1
- package/dist/ui/affix-group.js.map +1 -1
- package/dist/ui/badge.d.ts +4 -7
- package/dist/ui/badge.js +11 -17
- package/dist/ui/badge.js.map +1 -1
- package/dist/ui/button.d.ts +6 -5
- package/dist/ui/button.js +154 -15
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/chart-view.js +9 -7
- package/dist/ui/chart-view.js.map +1 -1
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/checkbox.js.map +1 -1
- package/dist/ui/confirm-dialog.d.ts +4 -3
- package/dist/ui/confirm-dialog.js +3 -2
- package/dist/ui/confirm-dialog.js.map +1 -1
- package/dist/ui/control.d.ts +1 -1
- package/dist/ui/control.js +1 -1
- package/dist/ui/control.js.map +1 -1
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/dropdown-menu.d.ts +2 -2
- package/dist/ui/dropdown-menu.js +2 -2
- package/dist/ui/dropdown-menu.js.map +1 -1
- package/dist/ui/icon-button.d.ts +3 -3
- package/dist/ui/icon-button.js +6 -6
- package/dist/ui/icon-button.js.map +1 -1
- package/dist/ui/image-preview.js +1 -1
- package/dist/ui/image-preview.js.map +1 -1
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.js +2 -2
- package/dist/ui/info-tooltip.js +1 -1
- package/dist/ui/info-tooltip.js.map +1 -1
- package/dist/ui/input-otp.js +1 -1
- package/dist/ui/input-otp.js.map +1 -1
- package/dist/ui/label.js +1 -1
- package/dist/ui/label.js.map +1 -1
- package/dist/ui/password-input.js +1 -1
- package/dist/ui/password-input.js.map +1 -1
- package/dist/ui/progress.js +2 -2
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/text.js +1 -1
- package/dist/ui/tooltip.js +1 -1
- package/dist/ui/tooltip.js.map +1 -1
- package/dist-standalone/chunks/{chart-view-DEwGTt9d.js → chart-view-8xEKTUJV.js} +1 -1
- package/dist-standalone/chunks/{date-picker-field-CCQ9nWx0.js → date-picker-field-cdhxtVSG.js} +1 -1
- package/dist-standalone/chunks/{rich-editor-field-B9Nv1qia.js → rich-editor-field-47ov3Bny.js} +1 -1
- package/dist-standalone/lattice.css +1 -1
- package/dist-standalone/lattice.js +6 -6
- package/dist-standalone/manifest.json +5 -5
- package/package.json +1 -1
package/dist/ui/dialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","names":[],"sources":["../../resources/js/ui/dialog.tsx"],"sourcesContent":["import { Icon } from \"@lattice-php/lattice/icons\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport * as React from \"react\";\nimport { cva } from \"class-variance-authority\";\nimport { Button } from \"@lattice-php/lattice/ui/button\";\nimport { cn } from \"@lattice-php/lattice/lib/utils\";\nimport type { ModalWidth, Side } from \"@lattice-php/lattice/types/generated\";\n\nexport type DialogPlacement = \"center\" | Side;\n\nconst dialogContentVariants = cva(\n \"fixed z-lt-modal w-full overflow-y-auto bg-lt-bg p-6 shadow-lt-lg\",\n {\n variants: {\n placement: {\n center:\n \"left-1/2 top-1/2 max-h-[min(680px,calc(100vh-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-lt border border-lt-border data-[state=open]:animate-lt-dialog-in data-[state=closed]:animate-lt-dialog-out\",\n start:\n \"inset-y-0 start-0 border-e border-lt-border data-[state=open]:animate-lt-sheet-in-start data-[state=closed]:animate-lt-sheet-out-start\",\n end: \"inset-y-0 end-0 border-s border-lt-border data-[state=open]:animate-lt-sheet-in-end data-[state=closed]:animate-lt-sheet-out-end\",\n },\n width: {\n sm: \"max-w-sm\",\n md: \"max-w-md\",\n lg: \"max-w-lg\",\n xl: \"max-w-xl\",\n \"2xl\": \"max-w-2xl\",\n \"3xl\": \"max-w-3xl\",\n },\n },\n defaultVariants: { placement: \"center\", width: \"lg\" },\n },\n);\n\nfunction Dialog(props: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogClose(props: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n data-slot=\"dialog-title\"\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n className={cn(\"text-sm text-lt-muted-fg\", className)}\n data-slot=\"dialog-description\"\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n children,\n className,\n placement = \"center\",\n width = \"lg\",\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n placement?: DialogPlacement;\n width?: ModalWidth;\n}) {\n return (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay\n className=\"fixed inset-0 z-lt-overlay bg-lt-overlay data-[state=open]:animate-lt-fade-in data-[state=closed]:animate-lt-fade-out\"\n data-slot=\"dialog-overlay\"\n />\n <DialogPrimitive.Content\n className={cn(dialogContentVariants({ placement, width }), className)}\n data-slot=\"dialog-content\"\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n );\n}\n\n/**\n * The shared dialog header: a title with an optional description and a ghost\n * close button. Pass `description` as `undefined` to suppress the description\n * and the matching `aria-describedby` wiring on the content.\n */\nfunction DialogHeader({\n closeLabel,\n description,\n title,\n}: {\n closeLabel?: string;\n description?: React.ReactNode;\n title: React.ReactNode;\n}) {\n return (\n <div className=\"flex items-start justify-between gap-4\">\n <div className=\"grid gap-2\">\n <DialogTitle>{title}</DialogTitle>\n {description ? <DialogDescription>{description}</DialogDescription> : null}\n </div>\n <DialogClose asChild>\n <Button aria-label={closeLabel} data-test=\"dialog-close\" size=\"icon\"
|
|
1
|
+
{"version":3,"file":"dialog.js","names":[],"sources":["../../resources/js/ui/dialog.tsx"],"sourcesContent":["import { Icon } from \"@lattice-php/lattice/icons\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport * as React from \"react\";\nimport { cva } from \"class-variance-authority\";\nimport { Button } from \"@lattice-php/lattice/ui/button\";\nimport { cn } from \"@lattice-php/lattice/lib/utils\";\nimport type { ModalWidth, Side } from \"@lattice-php/lattice/types/generated\";\n\nexport type DialogPlacement = \"center\" | Side;\n\nconst dialogContentVariants = cva(\n \"fixed z-lt-modal w-full overflow-y-auto bg-lt-bg p-6 shadow-lt-lg\",\n {\n variants: {\n placement: {\n center:\n \"left-1/2 top-1/2 max-h-[min(680px,calc(100vh-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-lt border border-lt-border data-[state=open]:animate-lt-dialog-in data-[state=closed]:animate-lt-dialog-out\",\n start:\n \"inset-y-0 start-0 border-e border-lt-border data-[state=open]:animate-lt-sheet-in-start data-[state=closed]:animate-lt-sheet-out-start\",\n end: \"inset-y-0 end-0 border-s border-lt-border data-[state=open]:animate-lt-sheet-in-end data-[state=closed]:animate-lt-sheet-out-end\",\n },\n width: {\n sm: \"max-w-sm\",\n md: \"max-w-md\",\n lg: \"max-w-lg\",\n xl: \"max-w-xl\",\n \"2xl\": \"max-w-2xl\",\n \"3xl\": \"max-w-3xl\",\n },\n },\n defaultVariants: { placement: \"center\", width: \"lg\" },\n },\n);\n\nfunction Dialog(props: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogClose(props: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n data-slot=\"dialog-title\"\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n className={cn(\"text-sm text-lt-muted-fg\", className)}\n data-slot=\"dialog-description\"\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n children,\n className,\n placement = \"center\",\n width = \"lg\",\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n placement?: DialogPlacement;\n width?: ModalWidth;\n}) {\n return (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay\n className=\"fixed inset-0 z-lt-overlay bg-lt-overlay data-[state=open]:animate-lt-fade-in data-[state=closed]:animate-lt-fade-out\"\n data-slot=\"dialog-overlay\"\n />\n <DialogPrimitive.Content\n className={cn(dialogContentVariants({ placement, width }), className)}\n data-slot=\"dialog-content\"\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n );\n}\n\n/**\n * The shared dialog header: a title with an optional description and a ghost\n * close button. Pass `description` as `undefined` to suppress the description\n * and the matching `aria-describedby` wiring on the content.\n */\nfunction DialogHeader({\n closeLabel,\n description,\n title,\n}: {\n closeLabel?: string;\n description?: React.ReactNode;\n title: React.ReactNode;\n}) {\n return (\n <div className=\"flex items-start justify-between gap-4\">\n <div className=\"grid gap-2\">\n <DialogTitle>{title}</DialogTitle>\n {description ? <DialogDescription>{description}</DialogDescription> : null}\n </div>\n <DialogClose asChild>\n <Button aria-label={closeLabel} data-test=\"dialog-close\" size=\"icon\" emphasis=\"ghost\">\n <Icon name=\"x\" aria-hidden=\"true\" className=\"size-lt-icon-md\" />\n </Button>\n </DialogClose>\n </div>\n );\n}\n\nexport { Dialog, DialogClose, DialogContent, DialogDescription, DialogHeader, DialogTitle };\n"],"mappings":";;;;;;;;AAUA,IAAM,wBAAwB,IAC5B,qEACA;CACE,UAAU;EACR,WAAW;GACT,QACE;GACF,OACE;GACF,KAAK;EACP;EACA,OAAO;GACL,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,OAAO;GACP,OAAO;EACT;CACF;CACA,iBAAiB;EAAE,WAAW;EAAU,OAAO;CAAK;AACtD,CACF;AAEA,SAAS,OAAO,OAA0D;CACxE,OAAO,oBAAC,gBAAgB,MAAjB;EAAsB,aAAU;EAAS,GAAI;CAAQ,CAAA;AAC9D;AAEA,SAAS,YAAY,OAA2D;CAC9E,OAAO,oBAAC,gBAAgB,OAAjB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAA6D;CAChG,OACE,oBAAC,gBAAgB,OAAjB;EACE,WAAW,GAAG,qDAAqD,SAAS;EAC5E,aAAU;EACV,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,kBAAkB,EACzB,WACA,GAAG,SACwD;CAC3D,OACE,oBAAC,gBAAgB,aAAjB;EACE,WAAW,GAAG,4BAA4B,SAAS;EACnD,aAAU;EACV,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,cAAc,EACrB,UACA,WACA,YAAY,UACZ,QAAQ,MACR,GAAG,SAIF;CACD,OACE,qBAAC,gBAAgB,QAAjB,EAAA,UAAA,CACE,oBAAC,gBAAgB,SAAjB;EACE,WAAU;EACV,aAAU;CACX,CAAA,GACD,oBAAC,gBAAgB,SAAjB;EACE,WAAW,GAAG,sBAAsB;GAAE;GAAW;EAAM,CAAC,GAAG,SAAS;EACpE,aAAU;EACV,GAAI;EAEH;CACsB,CAAA,CACH,EAAA,CAAA;AAE5B;;;;;;AAOA,SAAS,aAAa,EACpB,YACA,aACA,SAKC;CACD,OACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,qBAAC,OAAD;GAAK,WAAU;aAAf,CACE,oBAAC,aAAD,EAAA,UAAc,MAAmB,CAAA,GAChC,cAAc,oBAAC,mBAAD,EAAA,UAAoB,YAA+B,CAAA,IAAI,IACnE;MACL,oBAAC,aAAD;GAAa,SAAA;aACX,oBAAC,QAAD;IAAQ,cAAY;IAAY,aAAU;IAAe,MAAK;IAAO,UAAS;cAC5E,oBAAC,MAAD;KAAM,MAAK;KAAI,eAAY;KAAO,WAAU;IAAmB,CAAA;GACzD,CAAA;EACG,CAAA,CACV;;AAET"}
|
|
@@ -7,8 +7,8 @@ declare function DropdownMenuContent({ className, ...props }: React.ComponentPro
|
|
|
7
7
|
* A menu entry that closes the menu when activated. Wrap the click handler in
|
|
8
8
|
* `onClick`; selecting the item dismisses the popover via `PopoverClose`.
|
|
9
9
|
*/
|
|
10
|
-
declare function DropdownMenuItem({ children, className,
|
|
11
|
-
|
|
10
|
+
declare function DropdownMenuItem({ children, className, danger, icon, ...props }: React.ComponentProps<"button"> & {
|
|
11
|
+
danger?: boolean;
|
|
12
12
|
icon?: string;
|
|
13
13
|
}): React.JSX.Element;
|
|
14
14
|
export { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger };
|
package/dist/ui/dropdown-menu.js
CHANGED
|
@@ -21,13 +21,13 @@ function DropdownMenuContent({ className, ...props }) {
|
|
|
21
21
|
* A menu entry that closes the menu when activated. Wrap the click handler in
|
|
22
22
|
* `onClick`; selecting the item dismisses the popover via `PopoverClose`.
|
|
23
23
|
*/
|
|
24
|
-
function DropdownMenuItem({ children, className,
|
|
24
|
+
function DropdownMenuItem({ children, className, danger = false, icon, ...props }) {
|
|
25
25
|
return /* @__PURE__ */ jsx(PopoverClose, {
|
|
26
26
|
asChild: true,
|
|
27
27
|
children: /* @__PURE__ */ jsxs("button", {
|
|
28
28
|
type: "button",
|
|
29
29
|
role: "menuitem",
|
|
30
|
-
className: cn("flex w-full items-center gap-2 rounded-lt-sm px-3 py-1.5 text-left text-sm [&_svg]:size-lt-icon-sm",
|
|
30
|
+
className: cn("flex w-full items-center gap-2 rounded-lt-sm px-3 py-1.5 text-left text-sm [&_svg]:size-lt-icon-sm", danger ? "text-lt-danger hover:bg-lt-danger/10" : "hover:bg-lt-accent hover:text-lt-accent-fg", className),
|
|
31
31
|
...props,
|
|
32
32
|
children: [icon ? /* @__PURE__ */ jsx(Icon, {
|
|
33
33
|
name: icon,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.js","names":[],"sources":["../../resources/js/ui/dropdown-menu.tsx"],"sourcesContent":["import { Icon } from \"@lattice-php/lattice/icons\";\nimport * as React from \"react\";\nimport { cn } from \"@lattice-php/lattice/lib/utils\";\nimport { Popover, PopoverClose, PopoverContent, PopoverTrigger } from \"./popover\";\n\nfunction DropdownMenu(props: React.ComponentProps<typeof Popover>) {\n return <Popover {...props} />;\n}\n\nfunction DropdownMenuTrigger(props: React.ComponentProps<typeof PopoverTrigger>) {\n return <PopoverTrigger {...props} />;\n}\n\nfunction DropdownMenuContent({ className, ...props }: React.ComponentProps<typeof PopoverContent>) {\n return (\n <PopoverContent className={cn(\"grid min-w-40 gap-1 p-1\", className)} role=\"menu\" {...props} />\n );\n}\n\n/**\n * A menu entry that closes the menu when activated. Wrap the click handler in\n * `onClick`; selecting the item dismisses the popover via `PopoverClose`.\n */\nfunction DropdownMenuItem({\n children,\n className,\n
|
|
1
|
+
{"version":3,"file":"dropdown-menu.js","names":[],"sources":["../../resources/js/ui/dropdown-menu.tsx"],"sourcesContent":["import { Icon } from \"@lattice-php/lattice/icons\";\nimport * as React from \"react\";\nimport { cn } from \"@lattice-php/lattice/lib/utils\";\nimport { Popover, PopoverClose, PopoverContent, PopoverTrigger } from \"./popover\";\n\nfunction DropdownMenu(props: React.ComponentProps<typeof Popover>) {\n return <Popover {...props} />;\n}\n\nfunction DropdownMenuTrigger(props: React.ComponentProps<typeof PopoverTrigger>) {\n return <PopoverTrigger {...props} />;\n}\n\nfunction DropdownMenuContent({ className, ...props }: React.ComponentProps<typeof PopoverContent>) {\n return (\n <PopoverContent className={cn(\"grid min-w-40 gap-1 p-1\", className)} role=\"menu\" {...props} />\n );\n}\n\n/**\n * A menu entry that closes the menu when activated. Wrap the click handler in\n * `onClick`; selecting the item dismisses the popover via `PopoverClose`.\n */\nfunction DropdownMenuItem({\n children,\n className,\n danger = false,\n icon,\n ...props\n}: React.ComponentProps<\"button\"> & { danger?: boolean; icon?: string }) {\n return (\n <PopoverClose asChild>\n <button\n type=\"button\"\n role=\"menuitem\"\n className={cn(\n \"flex w-full items-center gap-2 rounded-lt-sm px-3 py-1.5 text-left text-sm [&_svg]:size-lt-icon-sm\",\n danger\n ? \"text-lt-danger hover:bg-lt-danger/10\"\n : \"hover:bg-lt-accent hover:text-lt-accent-fg\",\n className,\n )}\n {...props}\n >\n {icon ? <Icon name={icon} aria-hidden=\"true\" /> : null}\n {children}\n </button>\n </PopoverClose>\n );\n}\n\nexport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger };\n"],"mappings":";;;;;;AAKA,SAAS,aAAa,OAA6C;CACjE,OAAO,oBAAC,SAAD,EAAS,GAAI,MAAQ,CAAA;AAC9B;AAEA,SAAS,oBAAoB,OAAoD;CAC/E,OAAO,oBAAC,gBAAD,EAAgB,GAAI,MAAQ,CAAA;AACrC;AAEA,SAAS,oBAAoB,EAAE,WAAW,GAAG,SAAsD;CACjG,OACE,oBAAC,gBAAD;EAAgB,WAAW,GAAG,2BAA2B,SAAS;EAAG,MAAK;EAAO,GAAI;CAAQ,CAAA;AAEjG;;;;;AAMA,SAAS,iBAAiB,EACxB,UACA,WACA,SAAS,OACT,MACA,GAAG,SACoE;CACvE,OACE,oBAAC,cAAD;EAAc,SAAA;YACZ,qBAAC,UAAD;GACE,MAAK;GACL,MAAK;GACL,WAAW,GACT,sGACA,SACI,yCACA,8CACJ,SACF;GACA,GAAI;aAVN,CAYG,OAAO,oBAAC,MAAD;IAAM,MAAM;IAAM,eAAY;GAAQ,CAAA,IAAI,MACjD,QACK;;CACI,CAAA;AAElB"}
|
package/dist/ui/icon-button.d.ts
CHANGED
|
@@ -3,15 +3,15 @@ import * as React from "react";
|
|
|
3
3
|
/**
|
|
4
4
|
* A compact, resizable icon button — the shared affordance behind toolbar
|
|
5
5
|
* triggers, popover triggers, and inline clear/remove buttons. `ghost` matches
|
|
6
|
-
* `Button
|
|
6
|
+
* `Button emphasis="ghost"` (accent hover) and reacts to `aria-pressed` (toggle)
|
|
7
7
|
* and `data-[state=open]` (a popover trigger). `segmented` joins onto the right
|
|
8
8
|
* of an adjacent input. Size defaults to `sm`; pass `size` to resize.
|
|
9
9
|
*/
|
|
10
10
|
declare const iconButtonVariants: (props?: ({
|
|
11
|
-
|
|
11
|
+
emphasis?: "ghost" | "segmented" | null | undefined;
|
|
12
12
|
size?: "sm" | "md" | "xs" | null | undefined;
|
|
13
13
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
14
|
-
export declare function IconButton({ icon, label, active, size,
|
|
14
|
+
export declare function IconButton({ icon, label, active, size, emphasis, className, children, ref, ...props }: Omit<React.ComponentProps<"button">, "aria-pressed"> & VariantProps<typeof iconButtonVariants> & {
|
|
15
15
|
/** Icon glyph name; omit and pass `children` for custom content. */
|
|
16
16
|
icon?: string;
|
|
17
17
|
/** Accessible name (also used when the button shows only an icon). */
|
package/dist/ui/icon-button.js
CHANGED
|
@@ -7,13 +7,13 @@ import { cva } from "class-variance-authority";
|
|
|
7
7
|
/**
|
|
8
8
|
* A compact, resizable icon button — the shared affordance behind toolbar
|
|
9
9
|
* triggers, popover triggers, and inline clear/remove buttons. `ghost` matches
|
|
10
|
-
* `Button
|
|
10
|
+
* `Button emphasis="ghost"` (accent hover) and reacts to `aria-pressed` (toggle)
|
|
11
11
|
* and `data-[state=open]` (a popover trigger). `segmented` joins onto the right
|
|
12
12
|
* of an adjacent input. Size defaults to `sm`; pass `size` to resize.
|
|
13
13
|
*/
|
|
14
|
-
var iconButtonVariants = cva(cn("relative inline-flex shrink-0 items-center justify-center rounded-lt-sm transition-colors", "outline-none focus-visible:ring-
|
|
14
|
+
var iconButtonVariants = cva(cn("relative inline-flex shrink-0 items-center justify-center rounded-lt-sm transition-colors", "outline-none focus-visible:ring-[length:var(--lt-ring-width)] focus-visible:ring-lt-ring/50", "disabled:pointer-events-none disabled:bg-lt-disabled disabled:text-lt-disabled-fg"), {
|
|
15
15
|
variants: {
|
|
16
|
-
|
|
16
|
+
emphasis: {
|
|
17
17
|
ghost: cn("text-lt-muted-fg hover:bg-lt-accent hover:text-lt-accent-fg", "data-[state=open]:bg-lt-accent data-[state=open]:text-lt-accent-fg", "aria-pressed:bg-lt-accent aria-pressed:text-lt-accent-fg"),
|
|
18
18
|
segmented: cn("-ml-px rounded-l-none border border-lt-input text-lt-muted-fg hover:bg-lt-accent hover:text-lt-accent-fg", "data-[state=open]:z-10 data-[state=open]:border-lt-primary data-[state=open]:text-lt-fg")
|
|
19
19
|
},
|
|
@@ -24,18 +24,18 @@ var iconButtonVariants = cva(cn("relative inline-flex shrink-0 items-center just
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
defaultVariants: {
|
|
27
|
-
|
|
27
|
+
emphasis: "ghost",
|
|
28
28
|
size: "sm"
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
-
function IconButton({ icon, label, active, size,
|
|
31
|
+
function IconButton({ icon, label, active, size, emphasis, className, children, ref, ...props }) {
|
|
32
32
|
return /* @__PURE__ */ jsxs("button", {
|
|
33
33
|
ref,
|
|
34
34
|
type: "button",
|
|
35
35
|
"aria-label": label,
|
|
36
36
|
"aria-pressed": active,
|
|
37
37
|
className: cn(iconButtonVariants({
|
|
38
|
-
|
|
38
|
+
emphasis,
|
|
39
39
|
size
|
|
40
40
|
}), className),
|
|
41
41
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.js","names":[],"sources":["../../resources/js/ui/icon-button.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Icon } from \"@lattice-php/lattice/icons\";\nimport { cn } from \"@lattice-php/lattice/lib/utils\";\n\n/**\n * A compact, resizable icon button — the shared affordance behind toolbar\n * triggers, popover triggers, and inline clear/remove buttons. `ghost` matches\n * `Button
|
|
1
|
+
{"version":3,"file":"icon-button.js","names":[],"sources":["../../resources/js/ui/icon-button.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Icon } from \"@lattice-php/lattice/icons\";\nimport { cn } from \"@lattice-php/lattice/lib/utils\";\n\n/**\n * A compact, resizable icon button — the shared affordance behind toolbar\n * triggers, popover triggers, and inline clear/remove buttons. `ghost` matches\n * `Button emphasis=\"ghost\"` (accent hover) and reacts to `aria-pressed` (toggle)\n * and `data-[state=open]` (a popover trigger). `segmented` joins onto the right\n * of an adjacent input. Size defaults to `sm`; pass `size` to resize.\n */\nconst iconButtonVariants = cva(\n cn(\n \"relative inline-flex shrink-0 items-center justify-center rounded-lt-sm transition-colors\",\n \"outline-none focus-visible:ring-[length:var(--lt-ring-width)] focus-visible:ring-lt-ring/50\",\n \"disabled:pointer-events-none disabled:bg-lt-disabled disabled:text-lt-disabled-fg\",\n ),\n {\n variants: {\n emphasis: {\n ghost: cn(\n \"text-lt-muted-fg hover:bg-lt-accent hover:text-lt-accent-fg\",\n \"data-[state=open]:bg-lt-accent data-[state=open]:text-lt-accent-fg\",\n \"aria-pressed:bg-lt-accent aria-pressed:text-lt-accent-fg\",\n ),\n segmented: cn(\n \"-ml-px rounded-l-none border border-lt-input text-lt-muted-fg hover:bg-lt-accent hover:text-lt-accent-fg\",\n \"data-[state=open]:z-10 data-[state=open]:border-lt-primary data-[state=open]:text-lt-fg\",\n ),\n },\n size: {\n xs: \"size-5 [&_svg]:size-lt-icon-sm\",\n sm: \"size-7 [&_svg]:size-lt-icon-md\",\n md: \"size-lt-control-md [&_svg]:size-lt-icon-md\",\n },\n },\n defaultVariants: { emphasis: \"ghost\", size: \"sm\" },\n },\n);\n\nexport function IconButton({\n icon,\n label,\n active,\n size,\n emphasis,\n className,\n children,\n ref,\n ...props\n}: Omit<React.ComponentProps<\"button\">, \"aria-pressed\"> &\n VariantProps<typeof iconButtonVariants> & {\n /** Icon glyph name; omit and pass `children` for custom content. */\n icon?: string;\n /** Accessible name (also used when the button shows only an icon). */\n label: string;\n /** Toggle state — sets `aria-pressed` and the pressed styling. */\n active?: boolean;\n }) {\n return (\n <button\n ref={ref}\n type=\"button\"\n aria-label={label}\n aria-pressed={active}\n className={cn(iconButtonVariants({ emphasis, size }), className)}\n {...props}\n >\n {icon ? <Icon name={icon} aria-hidden=\"true\" /> : null}\n {children}\n </button>\n );\n}\n\nexport { iconButtonVariants };\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAM,qBAAqB,IACzB,GACE,6FACA,+FACA,mFACF,GACA;CACE,UAAU;EACR,UAAU;GACR,OAAO,GACL,+DACA,sEACA,0DACF;GACA,WAAW,GACT,4GACA,yFACF;EACF;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;CACF;CACA,iBAAiB;EAAE,UAAU;EAAS,MAAM;CAAK;AACnD,CACF;AAEA,SAAgB,WAAW,EACzB,MACA,OACA,QACA,MACA,UACA,WACA,UACA,KACA,GAAG,SASA;CACH,OACE,qBAAC,UAAD;EACO;EACL,MAAK;EACL,cAAY;EACZ,gBAAc;EACd,WAAW,GAAG,mBAAmB;GAAE;GAAU;EAAK,CAAC,GAAG,SAAS;EAC/D,GAAI;YANN,CAQG,OAAO,oBAAC,MAAD;GAAM,MAAM;GAAM,eAAY;EAAQ,CAAA,IAAI,MACjD,QACK;;AAEZ"}
|
package/dist/ui/image-preview.js
CHANGED
|
@@ -51,7 +51,7 @@ function PreviewableImage({ src, alt, previewable, width, height, className, tes
|
|
|
51
51
|
"aria-label": t("common.close", "Close"),
|
|
52
52
|
"data-test": "lightbox-close",
|
|
53
53
|
size: "icon",
|
|
54
|
-
|
|
54
|
+
emphasis: "ghost",
|
|
55
55
|
className: "absolute top-2 right-2 bg-lt-bg/80 hover:bg-lt-bg"
|
|
56
56
|
})
|
|
57
57
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-preview.js","names":[],"sources":["../../resources/js/ui/image-preview.tsx"],"sourcesContent":["import { useT } from \"@lattice-php/lattice/i18n\";\nimport { type ReactNode, useState } from \"react\";\nimport { Button } from \"@lattice-php/lattice/ui/button\";\nimport { Dialog, DialogClose, DialogContent, DialogTitle } from \"./dialog\";\n\ninterface PreviewableImageProps {\n src: string;\n alt: string;\n previewable: boolean;\n width?: number;\n height?: number;\n className?: string;\n testId?: string;\n}\n\nexport function PreviewableImage({\n src,\n alt,\n previewable,\n width,\n height,\n className,\n testId,\n}: PreviewableImageProps): ReactNode {\n const { t } = useT(\"lattice\");\n const [open, setOpen] = useState(false);\n\n const image = (\n <img\n alt={alt}\n src={src}\n width={width}\n height={height}\n className={className}\n style={width ? { width, height } : undefined}\n />\n );\n\n if (!previewable) {\n return image;\n }\n\n const openLabel = t(\"common.image.open-preview\", \"View image\");\n\n return (\n <>\n <button\n type=\"button\"\n data-test={testId}\n className=\"cursor-zoom-in\"\n aria-label={openLabel}\n onClick={() => setOpen(true)}\n >\n {image}\n </button>\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogContent\n aria-describedby={undefined}\n className=\"max-h-[90vh] w-auto max-w-[90vw] border-none bg-transparent p-0 shadow-none\"\n >\n <DialogTitle className=\"sr-only\">{alt || openLabel}</DialogTitle>\n <img\n alt={alt}\n src={src}\n data-slot=\"image-lightbox\"\n className=\"max-h-[90vh] max-w-[90vw] rounded-lt object-contain\"\n />\n <DialogClose asChild>\n <Button\n icon=\"x\"\n aria-label={t(\"common.close\", \"Close\")}\n data-test=\"lightbox-close\"\n size=\"icon\"\n
|
|
1
|
+
{"version":3,"file":"image-preview.js","names":[],"sources":["../../resources/js/ui/image-preview.tsx"],"sourcesContent":["import { useT } from \"@lattice-php/lattice/i18n\";\nimport { type ReactNode, useState } from \"react\";\nimport { Button } from \"@lattice-php/lattice/ui/button\";\nimport { Dialog, DialogClose, DialogContent, DialogTitle } from \"./dialog\";\n\ninterface PreviewableImageProps {\n src: string;\n alt: string;\n previewable: boolean;\n width?: number;\n height?: number;\n className?: string;\n testId?: string;\n}\n\nexport function PreviewableImage({\n src,\n alt,\n previewable,\n width,\n height,\n className,\n testId,\n}: PreviewableImageProps): ReactNode {\n const { t } = useT(\"lattice\");\n const [open, setOpen] = useState(false);\n\n const image = (\n <img\n alt={alt}\n src={src}\n width={width}\n height={height}\n className={className}\n style={width ? { width, height } : undefined}\n />\n );\n\n if (!previewable) {\n return image;\n }\n\n const openLabel = t(\"common.image.open-preview\", \"View image\");\n\n return (\n <>\n <button\n type=\"button\"\n data-test={testId}\n className=\"cursor-zoom-in\"\n aria-label={openLabel}\n onClick={() => setOpen(true)}\n >\n {image}\n </button>\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogContent\n aria-describedby={undefined}\n className=\"max-h-[90vh] w-auto max-w-[90vw] border-none bg-transparent p-0 shadow-none\"\n >\n <DialogTitle className=\"sr-only\">{alt || openLabel}</DialogTitle>\n <img\n alt={alt}\n src={src}\n data-slot=\"image-lightbox\"\n className=\"max-h-[90vh] max-w-[90vw] rounded-lt object-contain\"\n />\n <DialogClose asChild>\n <Button\n icon=\"x\"\n aria-label={t(\"common.close\", \"Close\")}\n data-test=\"lightbox-close\"\n size=\"icon\"\n emphasis=\"ghost\"\n className=\"absolute top-2 right-2 bg-lt-bg/80 hover:bg-lt-bg\"\n />\n </DialogClose>\n </DialogContent>\n </Dialog>\n </>\n );\n}\n"],"mappings":";;;;;;AAeA,SAAgB,iBAAiB,EAC/B,KACA,KACA,aACA,OACA,QACA,WACA,UACmC;CACnC,MAAM,EAAE,MAAM,KAAK,SAAS;CAC5B,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CAEtC,MAAM,QACJ,oBAAC,OAAD;EACO;EACA;EACE;EACC;EACG;EACX,OAAO,QAAQ;GAAE;GAAO;EAAO,IAAI,KAAA;CACpC,CAAA;CAGH,IAAI,CAAC,aACH,OAAO;CAGT,MAAM,YAAY,EAAE,6BAA6B,YAAY;CAE7D,OACE,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,UAAD;EACE,MAAK;EACL,aAAW;EACX,WAAU;EACV,cAAY;EACZ,eAAe,QAAQ,IAAI;YAE1B;CACK,CAAA,GACR,oBAAC,QAAD;EAAc;EAAM,cAAc;YAChC,qBAAC,eAAD;GACE,oBAAkB,KAAA;GAClB,WAAU;aAFZ;IAIE,oBAAC,aAAD;KAAa,WAAU;eAAW,OAAO;IAAuB,CAAA;IAChE,oBAAC,OAAD;KACO;KACA;KACL,aAAU;KACV,WAAU;IACX,CAAA;IACD,oBAAC,aAAD;KAAa,SAAA;eACX,oBAAC,QAAD;MACE,MAAK;MACL,cAAY,EAAE,gBAAgB,OAAO;MACrC,aAAU;MACV,MAAK;MACL,UAAS;MACT,WAAU;KACX,CAAA;IACU,CAAA;GACA;;CACT,CAAA,CACR,EAAA,CAAA;AAEN"}
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { AffixGroup } from './affix-group.js';
|
|
2
2
|
export { ActionMenuProvider, actionMenuItemClassName, useActionMenu } from './action-menu-context.js';
|
|
3
|
-
export { Badge
|
|
3
|
+
export { Badge } from './badge.js';
|
|
4
4
|
export { Button, buttonVariants } from './button.js';
|
|
5
|
-
export type {
|
|
5
|
+
export type { Emphasis, Variant } from './button.js';
|
|
6
6
|
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from './card.js';
|
|
7
7
|
export { Checkbox } from './checkbox.js';
|
|
8
8
|
export { Combobox } from './combobox.js';
|
package/dist/ui/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { ConfirmDialog } from "./confirm-dialog.js";
|
|
|
7
7
|
import { Skeleton } from "./skeleton.js";
|
|
8
8
|
import { ActionMenuProvider, actionMenuItemClassName, useActionMenu } from "./action-menu-context.js";
|
|
9
9
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "./dropdown-menu.js";
|
|
10
|
-
import { Badge
|
|
10
|
+
import { Badge } from "./badge.js";
|
|
11
11
|
import { InfoTooltip } from "./info-tooltip.js";
|
|
12
12
|
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./card.js";
|
|
13
13
|
import { CopyButton, CopyableText, copyToClipboard } from "./copyable-text.js";
|
|
@@ -24,4 +24,4 @@ import { InputOTP } from "./input-otp.js";
|
|
|
24
24
|
import PasswordInput from "./password-input.js";
|
|
25
25
|
import { Combobox } from "./combobox.js";
|
|
26
26
|
import { Textarea } from "./textarea.js";
|
|
27
|
-
export { ActionMenuProvider, ActionTrigger, ActionTriggerProvider, AffixGroup, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Combobox, ConfirmDialog, CopyButton, CopyableText, Dialog, DialogClose, DialogContent, DialogDescription, DialogHeader, DialogTitle, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, InfoTooltip, Input, InputError, InputOTP, Label, PasswordInput, Popover, PopoverClose, PopoverContent, PopoverTrigger, PreviewableImage, SegmentedPills, Skeleton, Spinner, TextLink, Textarea, actionMenuItemClassName,
|
|
27
|
+
export { ActionMenuProvider, ActionTrigger, ActionTriggerProvider, AffixGroup, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Combobox, ConfirmDialog, CopyButton, CopyableText, Dialog, DialogClose, DialogContent, DialogDescription, DialogHeader, DialogTitle, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, InfoTooltip, Input, InputError, InputOTP, Label, PasswordInput, Popover, PopoverClose, PopoverContent, PopoverTrigger, PreviewableImage, SegmentedPills, Skeleton, Spinner, TextLink, Textarea, actionMenuItemClassName, buttonVariants, copyToClipboard, uiComponents, useActionMenu, useActionTrigger, useClickBehavior };
|
package/dist/ui/info-tooltip.js
CHANGED
|
@@ -9,7 +9,7 @@ function InfoTooltip({ content }) {
|
|
|
9
9
|
return /* @__PURE__ */ jsxs(Popover, { children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
10
10
|
type: "button",
|
|
11
11
|
"aria-label": t("common.more-info", "More information"),
|
|
12
|
-
className: "ml-1 inline-flex rounded-lt-sm text-lt-muted-fg outline-none hover:text-lt-fg focus-visible:text-lt-fg focus-visible:ring-lt-ring/50 focus-visible:ring-[
|
|
12
|
+
className: "ml-1 inline-flex rounded-lt-sm text-lt-muted-fg outline-none hover:text-lt-fg focus-visible:text-lt-fg focus-visible:ring-lt-ring/50 focus-visible:ring-[length:var(--lt-ring-width)]",
|
|
13
13
|
children: /* @__PURE__ */ jsx(Icon, {
|
|
14
14
|
name: "info",
|
|
15
15
|
className: "size-lt-icon-sm"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info-tooltip.js","names":[],"sources":["../../resources/js/ui/info-tooltip.tsx"],"sourcesContent":["import { Icon } from \"@lattice-php/lattice/icons\";\nimport { useT } from \"@lattice-php/lattice/i18n\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\n\nexport function InfoTooltip({ content }: { content?: string | null }) {\n const { t } = useT(\"lattice\");\n\n if (!content) {\n return null;\n }\n\n return (\n <Popover>\n <PopoverTrigger\n type=\"button\"\n aria-label={t(\"common.more-info\", \"More information\")}\n className=\"ml-1 inline-flex rounded-lt-sm text-lt-muted-fg outline-none hover:text-lt-fg focus-visible:text-lt-fg focus-visible:ring-lt-ring/50 focus-visible:ring-[
|
|
1
|
+
{"version":3,"file":"info-tooltip.js","names":[],"sources":["../../resources/js/ui/info-tooltip.tsx"],"sourcesContent":["import { Icon } from \"@lattice-php/lattice/icons\";\nimport { useT } from \"@lattice-php/lattice/i18n\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\n\nexport function InfoTooltip({ content }: { content?: string | null }) {\n const { t } = useT(\"lattice\");\n\n if (!content) {\n return null;\n }\n\n return (\n <Popover>\n <PopoverTrigger\n type=\"button\"\n aria-label={t(\"common.more-info\", \"More information\")}\n className=\"ml-1 inline-flex rounded-lt-sm text-lt-muted-fg outline-none hover:text-lt-fg focus-visible:text-lt-fg focus-visible:ring-lt-ring/50 focus-visible:ring-[length:var(--lt-ring-width)]\"\n >\n <Icon name=\"info\" className=\"size-lt-icon-sm\" />\n </PopoverTrigger>\n <PopoverContent\n align=\"start\"\n className=\"max-w-xs p-3 text-sm [&_a]:underline\"\n dangerouslySetInnerHTML={{ __html: content }}\n />\n </Popover>\n );\n}\n"],"mappings":";;;;;AAIA,SAAgB,YAAY,EAAE,WAAwC;CACpE,MAAM,EAAE,MAAM,KAAK,SAAS;CAE5B,IAAI,CAAC,SACH,OAAO;CAGT,OACE,qBAAC,SAAD,EAAA,UAAA,CACE,oBAAC,gBAAD;EACE,MAAK;EACL,cAAY,EAAE,oBAAoB,kBAAkB;EACpD,WAAU;YAEV,oBAAC,MAAD;GAAM,MAAK;GAAO,WAAU;EAAmB,CAAA;CACjC,CAAA,GAChB,oBAAC,gBAAD;EACE,OAAM;EACN,WAAU;EACV,yBAAyB,EAAE,QAAQ,QAAQ;CAC5C,CAAA,CACM,EAAA,CAAA;AAEb"}
|
package/dist/ui/input-otp.js
CHANGED
|
@@ -4,7 +4,7 @@ import { OTPInput, REGEXP_ONLY_DIGITS } from "input-otp";
|
|
|
4
4
|
//#region resources/js/ui/input-otp.tsx
|
|
5
5
|
function Slot({ char, hasFakeCaret, isActive }) {
|
|
6
6
|
return /* @__PURE__ */ jsxs("div", {
|
|
7
|
-
className: cn("relative flex h-lt-control-md w-10 items-center justify-center border-y border-r border-lt-input text-base shadow-lt-xs transition-all first:rounded-l-lt-sm first:border-l last:rounded-r-lt-sm", isActive && "z-10 border-lt-ring ring-lt-ring/50 ring-[
|
|
7
|
+
className: cn("relative flex h-lt-control-md w-10 items-center justify-center border-y border-r border-lt-input text-base shadow-lt-xs transition-all first:rounded-l-lt-sm first:border-l last:rounded-r-lt-sm", isActive && "z-10 border-lt-ring ring-lt-ring/50 ring-[length:var(--lt-ring-width)]"),
|
|
8
8
|
children: [char, hasFakeCaret ? /* @__PURE__ */ jsx("div", {
|
|
9
9
|
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
10
10
|
children: /* @__PURE__ */ jsx("div", { className: "bg-lt-fg h-5 w-px animate-pulse" })
|
package/dist/ui/input-otp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-otp.js","names":[],"sources":["../../resources/js/ui/input-otp.tsx"],"sourcesContent":["import { OTPInput, REGEXP_ONLY_DIGITS, type SlotProps } from \"input-otp\";\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"@lattice-php/lattice/lib/utils\";\n\nfunction Slot({ char, hasFakeCaret, isActive }: SlotProps) {\n return (\n <div\n className={cn(\n \"relative flex h-lt-control-md w-10 items-center justify-center border-y border-r border-lt-input text-base shadow-lt-xs transition-all first:rounded-l-lt-sm first:border-l last:rounded-r-lt-sm\",\n isActive && \"z-10 border-lt-ring ring-lt-ring/50 ring-[
|
|
1
|
+
{"version":3,"file":"input-otp.js","names":[],"sources":["../../resources/js/ui/input-otp.tsx"],"sourcesContent":["import { OTPInput, REGEXP_ONLY_DIGITS, type SlotProps } from \"input-otp\";\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"@lattice-php/lattice/lib/utils\";\n\nfunction Slot({ char, hasFakeCaret, isActive }: SlotProps) {\n return (\n <div\n className={cn(\n \"relative flex h-lt-control-md w-10 items-center justify-center border-y border-r border-lt-input text-base shadow-lt-xs transition-all first:rounded-l-lt-sm first:border-l last:rounded-r-lt-sm\",\n isActive && \"z-10 border-lt-ring ring-lt-ring/50 ring-[length:var(--lt-ring-width)]\",\n )}\n >\n {char}\n {hasFakeCaret ? (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"bg-lt-fg h-5 w-px animate-pulse\" />\n </div>\n ) : null}\n </div>\n );\n}\n\ntype InputOTPProps = Omit<ComponentProps<typeof OTPInput>, \"children\" | \"maxLength\" | \"render\"> & {\n length: number;\n};\n\nexport function InputOTP({\n length,\n containerClassName,\n pattern = REGEXP_ONLY_DIGITS,\n ...props\n}: InputOTPProps) {\n return (\n <OTPInput\n maxLength={length}\n pattern={pattern}\n containerClassName={cn(\n \"flex items-center gap-2 has-[:disabled]:opacity-50\",\n containerClassName,\n )}\n render={({ slots }) => (\n <div className=\"flex items-center\">\n {slots.map((slot, index) => (\n <Slot key={index} {...slot} />\n ))}\n </div>\n )}\n {...props}\n />\n );\n}\n"],"mappings":";;;;AAIA,SAAS,KAAK,EAAE,MAAM,cAAc,YAAuB;CACzD,OACE,qBAAC,OAAD;EACE,WAAW,GACT,oMACA,YAAY,wEACd;YAJF,CAMG,MACA,eACC,oBAAC,OAAD;GAAK,WAAU;aACb,oBAAC,OAAD,EAAK,WAAU,kCAAmC,CAAA;EAC/C,CAAA,IACH,IACD;;AAET;AAMA,SAAgB,SAAS,EACvB,QACA,oBACA,UAAU,oBACV,GAAG,SACa;CAChB,OACE,oBAAC,UAAD;EACE,WAAW;EACF;EACT,oBAAoB,GAClB,sDACA,kBACF;EACA,SAAS,EAAE,YACT,oBAAC,OAAD;GAAK,WAAU;aACZ,MAAM,KAAK,MAAM,UAChB,oBAAC,MAAD,EAAkB,GAAI,KAAO,GAAlB,KAAkB,CAC9B;EACE,CAAA;EAEP,GAAI;CACL,CAAA;AAEL"}
|
package/dist/ui/label.js
CHANGED
|
@@ -6,7 +6,7 @@ import * as LabelPrimitive from "@radix-ui/react-label";
|
|
|
6
6
|
function Label({ className, ...props }) {
|
|
7
7
|
return /* @__PURE__ */ jsx(LabelPrimitive.Root, {
|
|
8
8
|
"data-slot": "label",
|
|
9
|
-
className: cn("text-base leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:
|
|
9
|
+
className: cn("text-base leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:text-lt-disabled-fg peer-disabled:cursor-not-allowed peer-disabled:text-lt-disabled-fg", className),
|
|
10
10
|
...props
|
|
11
11
|
});
|
|
12
12
|
}
|
package/dist/ui/label.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.js","names":[],"sources":["../../resources/js/ui/label.tsx"],"sourcesContent":["import * as LabelPrimitive from \"@radix-ui/react-label\";\nimport * as React from \"react\";\n\nimport { cn } from \"@lattice-php/lattice/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 \"text-base leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:
|
|
1
|
+
{"version":3,"file":"label.js","names":[],"sources":["../../resources/js/ui/label.tsx"],"sourcesContent":["import * as LabelPrimitive from \"@radix-ui/react-label\";\nimport * as React from \"react\";\n\nimport { cn } from \"@lattice-php/lattice/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 \"text-base leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:text-lt-disabled-fg peer-disabled:cursor-not-allowed peer-disabled:text-lt-disabled-fg\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Label };\n"],"mappings":";;;;;AAKA,SAAS,MAAM,EAAE,WAAW,GAAG,SAA2D;CACxF,OACE,oBAAC,eAAe,MAAhB;EACE,aAAU;EACV,WAAW,GACT,mNACA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -17,7 +17,7 @@ function PasswordInput({ className, ref, ...props }) {
|
|
|
17
17
|
type: "button",
|
|
18
18
|
"data-test": typeof props.name === "string" ? `${props.name}-visibility` : "password-visibility",
|
|
19
19
|
onClick: () => setShowPassword((prev) => !prev),
|
|
20
|
-
className: "absolute inset-y-0 right-0 flex items-center rounded-r-lt-sm px-3 text-lt-muted-fg hover:text-lt-fg focus-visible:ring-[
|
|
20
|
+
className: "absolute inset-y-0 right-0 flex items-center rounded-r-lt-sm px-3 text-lt-muted-fg hover:text-lt-fg focus-visible:ring-[length:var(--lt-ring-width)] focus-visible:ring-lt-ring/50 focus-visible:outline-none",
|
|
21
21
|
"aria-label": showPassword ? "Hide password" : "Show password",
|
|
22
22
|
tabIndex: -1,
|
|
23
23
|
children: showPassword ? /* @__PURE__ */ jsx(Icon, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password-input.js","names":[],"sources":["../../resources/js/ui/password-input.tsx"],"sourcesContent":["import { Icon } from \"@lattice-php/lattice/icons\";\nimport type { ComponentProps, Ref } from \"react\";\nimport { useState } from \"react\";\nimport { Input } from \"@lattice-php/lattice/ui/input\";\nimport { cn } from \"@lattice-php/lattice/lib/utils\";\n\ntype PasswordInputProps = Omit<ComponentProps<\"input\">, \"type\"> & {\n passwordrules?: string;\n ref?: Ref<HTMLInputElement>;\n};\n\nexport default function PasswordInput({ className, ref, ...props }: PasswordInputProps) {\n const [showPassword, setShowPassword] = useState(false);\n\n return (\n <div className=\"relative\">\n <Input\n type={showPassword ? \"text\" : \"password\"}\n className={cn(\"pr-10\", className)}\n ref={ref}\n {...props}\n />\n <button\n type=\"button\"\n data-test={\n typeof props.name === \"string\" ? `${props.name}-visibility` : \"password-visibility\"\n }\n onClick={() => setShowPassword((prev) => !prev)}\n className=\"absolute inset-y-0 right-0 flex items-center rounded-r-lt-sm px-3 text-lt-muted-fg hover:text-lt-fg focus-visible:ring-[
|
|
1
|
+
{"version":3,"file":"password-input.js","names":[],"sources":["../../resources/js/ui/password-input.tsx"],"sourcesContent":["import { Icon } from \"@lattice-php/lattice/icons\";\nimport type { ComponentProps, Ref } from \"react\";\nimport { useState } from \"react\";\nimport { Input } from \"@lattice-php/lattice/ui/input\";\nimport { cn } from \"@lattice-php/lattice/lib/utils\";\n\ntype PasswordInputProps = Omit<ComponentProps<\"input\">, \"type\"> & {\n passwordrules?: string;\n ref?: Ref<HTMLInputElement>;\n};\n\nexport default function PasswordInput({ className, ref, ...props }: PasswordInputProps) {\n const [showPassword, setShowPassword] = useState(false);\n\n return (\n <div className=\"relative\">\n <Input\n type={showPassword ? \"text\" : \"password\"}\n className={cn(\"pr-10\", className)}\n ref={ref}\n {...props}\n />\n <button\n type=\"button\"\n data-test={\n typeof props.name === \"string\" ? `${props.name}-visibility` : \"password-visibility\"\n }\n onClick={() => setShowPassword((prev) => !prev)}\n className=\"absolute inset-y-0 right-0 flex items-center rounded-r-lt-sm px-3 text-lt-muted-fg hover:text-lt-fg focus-visible:ring-[length:var(--lt-ring-width)] focus-visible:ring-lt-ring/50 focus-visible:outline-none\"\n aria-label={showPassword ? \"Hide password\" : \"Show password\"}\n tabIndex={-1}\n >\n {showPassword ? (\n <Icon name=\"eye-off\" className=\"size-lt-icon-md\" />\n ) : (\n <Icon name=\"eye\" className=\"size-lt-icon-md\" />\n )}\n </button>\n </div>\n );\n}\n"],"mappings":";;;;;;AAWA,SAAwB,cAAc,EAAE,WAAW,KAAK,GAAG,SAA6B;CACtF,MAAM,CAAC,cAAc,mBAAmB,SAAS,KAAK;CAEtD,OACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,OAAD;GACE,MAAM,eAAe,SAAS;GAC9B,WAAW,GAAG,SAAS,SAAS;GAC3B;GACL,GAAI;EACL,CAAA,GACD,oBAAC,UAAD;GACE,MAAK;GACL,aACE,OAAO,MAAM,SAAS,WAAW,GAAG,MAAM,KAAK,eAAe;GAEhE,eAAe,iBAAiB,SAAS,CAAC,IAAI;GAC9C,WAAU;GACV,cAAY,eAAe,kBAAkB;GAC7C,UAAU;aAET,eACC,oBAAC,MAAD;IAAM,MAAK;IAAU,WAAU;GAAmB,CAAA,IAElD,oBAAC,MAAD;IAAM,MAAK;IAAM,WAAU;GAAmB,CAAA;EAE1C,CAAA,CACL;;AAET"}
|
package/dist/ui/progress.js
CHANGED
|
@@ -34,7 +34,7 @@ var circleReadouts = {
|
|
|
34
34
|
"4xl": "text-2xl"
|
|
35
35
|
};
|
|
36
36
|
var ProgressComponent = ({ node }) => {
|
|
37
|
-
const { value, max,
|
|
37
|
+
const { value, max, shape, showValue, color, size } = node.props;
|
|
38
38
|
const { locale } = useLocale();
|
|
39
39
|
const paint = colorValue(coerceColor(color) ?? namedColor("primary"));
|
|
40
40
|
const clamped = max > 0 ? Math.min(Math.max(value, 0), max) : 0;
|
|
@@ -50,7 +50,7 @@ var ProgressComponent = ({ node }) => {
|
|
|
50
50
|
"aria-valuetext": percent,
|
|
51
51
|
role: "progressbar"
|
|
52
52
|
};
|
|
53
|
-
if (
|
|
53
|
+
if (shape === "circle") {
|
|
54
54
|
const diameter = circleDiameters[size];
|
|
55
55
|
const strokeWidth = Math.max(3, diameter / 10);
|
|
56
56
|
const radius = (diameter - strokeWidth) / 2;
|
package/dist/ui/progress.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.js","names":[],"sources":["../../resources/js/ui/progress.tsx"],"sourcesContent":["import type { RendererComponent } from \"@lattice-php/lattice/core/types\";\nimport { useLocale } from \"@lattice-php/lattice/i18n\";\nimport { coerceColor, colorValue, namedColor } from \"@lattice-php/lattice/lib/color\";\nimport { cn } from \"@lattice-php/lattice/lib/utils\";\nimport type { Size } from \"@lattice-php/lattice/types/generated\";\n\nconst barHeights: Record<Size, string> = {\n xs: \"h-1\",\n sm: \"h-1.5\",\n md: \"h-2.5\",\n lg: \"h-3\",\n xl: \"h-4\",\n \"2xl\": \"h-5\",\n \"3xl\": \"h-6\",\n \"4xl\": \"h-8\",\n};\n\nconst circleDiameters: Record<Size, number> = {\n xs: 24,\n sm: 32,\n md: 40,\n lg: 48,\n xl: 64,\n \"2xl\": 80,\n \"3xl\": 96,\n \"4xl\": 128,\n};\n\nconst circleReadouts: Record<Size, string> = {\n xs: \"text-[0.5rem]\",\n sm: \"text-[0.625rem]\",\n md: \"text-xs\",\n lg: \"text-sm\",\n xl: \"text-base\",\n \"2xl\": \"text-lg\",\n \"3xl\": \"text-xl\",\n \"4xl\": \"text-2xl\",\n};\n\nconst ProgressComponent: RendererComponent<\"progress\"> = ({ node }) => {\n const { value, max,
|
|
1
|
+
{"version":3,"file":"progress.js","names":[],"sources":["../../resources/js/ui/progress.tsx"],"sourcesContent":["import type { RendererComponent } from \"@lattice-php/lattice/core/types\";\nimport { useLocale } from \"@lattice-php/lattice/i18n\";\nimport { coerceColor, colorValue, namedColor } from \"@lattice-php/lattice/lib/color\";\nimport { cn } from \"@lattice-php/lattice/lib/utils\";\nimport type { Size } from \"@lattice-php/lattice/types/generated\";\n\nconst barHeights: Record<Size, string> = {\n xs: \"h-1\",\n sm: \"h-1.5\",\n md: \"h-2.5\",\n lg: \"h-3\",\n xl: \"h-4\",\n \"2xl\": \"h-5\",\n \"3xl\": \"h-6\",\n \"4xl\": \"h-8\",\n};\n\nconst circleDiameters: Record<Size, number> = {\n xs: 24,\n sm: 32,\n md: 40,\n lg: 48,\n xl: 64,\n \"2xl\": 80,\n \"3xl\": 96,\n \"4xl\": 128,\n};\n\nconst circleReadouts: Record<Size, string> = {\n xs: \"text-[0.5rem]\",\n sm: \"text-[0.625rem]\",\n md: \"text-xs\",\n lg: \"text-sm\",\n xl: \"text-base\",\n \"2xl\": \"text-lg\",\n \"3xl\": \"text-xl\",\n \"4xl\": \"text-2xl\",\n};\n\nconst ProgressComponent: RendererComponent<\"progress\"> = ({ node }) => {\n const { value, max, shape, showValue, color, size } = node.props;\n const { locale } = useLocale();\n const paint = colorValue(coerceColor(color) ?? namedColor(\"primary\"));\n\n const clamped = max > 0 ? Math.min(Math.max(value, 0), max) : 0;\n const ratio = max > 0 ? clamped / max : 0;\n const percent = new Intl.NumberFormat(locale, {\n maximumFractionDigits: 0,\n style: \"percent\",\n }).format(ratio);\n\n const aria = {\n \"aria-valuemax\": max,\n \"aria-valuemin\": 0,\n \"aria-valuenow\": clamped,\n \"aria-valuetext\": percent,\n role: \"progressbar\",\n } as const;\n\n if (shape === \"circle\") {\n const diameter = circleDiameters[size];\n const strokeWidth = Math.max(3, diameter / 10);\n const radius = (diameter - strokeWidth) / 2;\n const circumference = 2 * Math.PI * radius;\n\n return (\n <div {...aria} className=\"relative inline-flex\" data-lattice-progress=\"circle\">\n <svg className=\"-rotate-90\" height={diameter} width={diameter}>\n <circle\n className=\"text-lt-muted\"\n cx={diameter / 2}\n cy={diameter / 2}\n fill=\"none\"\n r={radius}\n stroke=\"currentColor\"\n strokeWidth={strokeWidth}\n />\n <circle\n cx={diameter / 2}\n cy={diameter / 2}\n fill=\"none\"\n r={radius}\n stroke=\"currentColor\"\n strokeDasharray={circumference}\n strokeDashoffset={circumference * (1 - ratio)}\n strokeLinecap=\"round\"\n strokeWidth={strokeWidth}\n style={{ color: paint }}\n />\n </svg>\n {showValue && (\n <span\n className={cn(\n \"absolute inset-0 flex items-center justify-center font-medium text-lt-fg tabular-nums\",\n circleReadouts[size],\n )}\n >\n {percent}\n </span>\n )}\n </div>\n );\n }\n\n return (\n <div className=\"flex w-full items-center gap-2\" data-lattice-progress=\"bar\">\n <div\n {...aria}\n className={cn(\"w-full overflow-hidden rounded-full bg-lt-muted\", barHeights[size])}\n >\n <div\n className=\"h-full rounded-full\"\n style={{ background: paint, width: `${ratio * 100}%` }}\n />\n </div>\n {showValue && (\n <span className=\"shrink-0 text-lt-muted-fg text-sm tabular-nums\">{percent}</span>\n )}\n </div>\n );\n};\n\nexport default ProgressComponent;\n"],"mappings":";;;;;AAMA,IAAM,aAAmC;CACvC,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,OAAO;CACP,OAAO;CACP,OAAO;AACT;AAEA,IAAM,kBAAwC;CAC5C,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,OAAO;CACP,OAAO;CACP,OAAO;AACT;AAEA,IAAM,iBAAuC;CAC3C,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,OAAO;CACP,OAAO;CACP,OAAO;AACT;AAEA,IAAM,qBAAoD,EAAE,WAAW;CACrE,MAAM,EAAE,OAAO,KAAK,OAAO,WAAW,OAAO,SAAS,KAAK;CAC3D,MAAM,EAAE,WAAW,UAAU;CAC7B,MAAM,QAAQ,WAAW,YAAY,KAAK,KAAK,WAAW,SAAS,CAAC;CAEpE,MAAM,UAAU,MAAM,IAAI,KAAK,IAAI,KAAK,IAAI,OAAO,CAAC,GAAG,GAAG,IAAI;CAC9D,MAAM,QAAQ,MAAM,IAAI,UAAU,MAAM;CACxC,MAAM,UAAU,IAAI,KAAK,aAAa,QAAQ;EAC5C,uBAAuB;EACvB,OAAO;CACT,CAAC,EAAE,OAAO,KAAK;CAEf,MAAM,OAAO;EACX,iBAAiB;EACjB,iBAAiB;EACjB,iBAAiB;EACjB,kBAAkB;EAClB,MAAM;CACR;CAEA,IAAI,UAAU,UAAU;EACtB,MAAM,WAAW,gBAAgB;EACjC,MAAM,cAAc,KAAK,IAAI,GAAG,WAAW,EAAE;EAC7C,MAAM,UAAU,WAAW,eAAe;EAC1C,MAAM,gBAAgB,IAAI,KAAK,KAAK;EAEpC,OACE,qBAAC,OAAD;GAAK,GAAI;GAAM,WAAU;GAAuB,yBAAsB;aAAtE,CACE,qBAAC,OAAD;IAAK,WAAU;IAAa,QAAQ;IAAU,OAAO;cAArD,CACE,oBAAC,UAAD;KACE,WAAU;KACV,IAAI,WAAW;KACf,IAAI,WAAW;KACf,MAAK;KACL,GAAG;KACH,QAAO;KACM;IACd,CAAA,GACD,oBAAC,UAAD;KACE,IAAI,WAAW;KACf,IAAI,WAAW;KACf,MAAK;KACL,GAAG;KACH,QAAO;KACP,iBAAiB;KACjB,kBAAkB,iBAAiB,IAAI;KACvC,eAAc;KACD;KACb,OAAO,EAAE,OAAO,MAAM;IACvB,CAAA,CACE;OACJ,aACC,oBAAC,QAAD;IACE,WAAW,GACT,yFACA,eAAe,KACjB;cAEC;GACG,CAAA,CAEL;;CAET;CAEA,OACE,qBAAC,OAAD;EAAK,WAAU;EAAiC,yBAAsB;YAAtE,CACE,oBAAC,OAAD;GACE,GAAI;GACJ,WAAW,GAAG,mDAAmD,WAAW,KAAK;aAEjF,oBAAC,OAAD;IACE,WAAU;IACV,OAAO;KAAE,YAAY;KAAO,OAAO,GAAG,QAAQ,IAAI;IAAG;GACtD,CAAA;EACE,CAAA,GACJ,aACC,oBAAC,QAAD;GAAM,WAAU;aAAkD;EAAc,CAAA,CAE/E;;AAET"}
|
package/dist/ui/text.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
|
-
import { CopyableText } from "./copyable-text.js";
|
|
3
2
|
import { coerceColor, colorValue, namedColor } from "../lib/color.js";
|
|
3
|
+
import { CopyableText } from "./copyable-text.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region resources/js/ui/text.tsx
|
|
6
6
|
var textAlignments = {
|
package/dist/ui/tooltip.js
CHANGED
|
@@ -11,7 +11,7 @@ var TooltipComponent = ({ node }) => {
|
|
|
11
11
|
if (trigger.length === 0) return /* @__PURE__ */ jsx(InfoTooltip, { content });
|
|
12
12
|
return /* @__PURE__ */ jsxs(Popover, { children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
13
13
|
type: "button",
|
|
14
|
-
className: "inline-flex items-center rounded-lt-sm outline-none focus-visible:ring-lt-ring/50 focus-visible:ring-[
|
|
14
|
+
className: "inline-flex items-center rounded-lt-sm outline-none focus-visible:ring-lt-ring/50 focus-visible:ring-[length:var(--lt-ring-width)]",
|
|
15
15
|
children: /* @__PURE__ */ jsx(Renderer, { nodes: trigger })
|
|
16
16
|
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
17
17
|
align: "start",
|
package/dist/ui/tooltip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","names":[],"sources":["../../resources/js/ui/tooltip.tsx"],"sourcesContent":["import { Renderer } from \"@lattice-php/lattice/core/renderer\";\nimport { toNodes } from \"@lattice-php/lattice/core/nodes\";\nimport type { RendererComponent } from \"@lattice-php/lattice/core/types\";\nimport { InfoTooltip } from \"./info-tooltip\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\n\nconst TooltipComponent: RendererComponent<\"tooltip\"> = ({ node }) => {\n const content = node.props.content;\n const trigger = toNodes(node.props.trigger);\n\n if (!content) {\n return null;\n }\n\n if (trigger.length === 0) {\n return <InfoTooltip content={content} />;\n }\n\n return (\n <Popover>\n <PopoverTrigger\n type=\"button\"\n className=\"inline-flex items-center rounded-lt-sm outline-none focus-visible:ring-lt-ring/50 focus-visible:ring-[
|
|
1
|
+
{"version":3,"file":"tooltip.js","names":[],"sources":["../../resources/js/ui/tooltip.tsx"],"sourcesContent":["import { Renderer } from \"@lattice-php/lattice/core/renderer\";\nimport { toNodes } from \"@lattice-php/lattice/core/nodes\";\nimport type { RendererComponent } from \"@lattice-php/lattice/core/types\";\nimport { InfoTooltip } from \"./info-tooltip\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\n\nconst TooltipComponent: RendererComponent<\"tooltip\"> = ({ node }) => {\n const content = node.props.content;\n const trigger = toNodes(node.props.trigger);\n\n if (!content) {\n return null;\n }\n\n if (trigger.length === 0) {\n return <InfoTooltip content={content} />;\n }\n\n return (\n <Popover>\n <PopoverTrigger\n type=\"button\"\n className=\"inline-flex items-center rounded-lt-sm outline-none focus-visible:ring-lt-ring/50 focus-visible:ring-[length:var(--lt-ring-width)]\"\n >\n <Renderer nodes={trigger} />\n </PopoverTrigger>\n <PopoverContent\n align=\"start\"\n className=\"max-w-xs p-3 text-sm [&_a]:underline\"\n dangerouslySetInnerHTML={{ __html: content }}\n />\n </Popover>\n );\n};\n\nexport default TooltipComponent;\n"],"mappings":";;;;;;AAMA,IAAM,oBAAkD,EAAE,WAAW;CACnE,MAAM,UAAU,KAAK,MAAM;CAC3B,MAAM,UAAU,QAAQ,KAAK,MAAM,OAAO;CAE1C,IAAI,CAAC,SACH,OAAO;CAGT,IAAI,QAAQ,WAAW,GACrB,OAAO,oBAAC,aAAD,EAAsB,QAAU,CAAA;CAGzC,OACE,qBAAC,SAAD,EAAA,UAAA,CACE,oBAAC,gBAAD;EACE,MAAK;EACL,WAAU;YAEV,oBAAC,UAAD,EAAU,OAAO,QAAU,CAAA;CACb,CAAA,GAChB,oBAAC,gBAAD;EACE,OAAM;EACN,WAAU;EACV,yBAAyB,EAAE,QAAQ,QAAQ;CAC5C,CAAA,CACM,EAAA,CAAA;AAEb"}
|