@fuf-stack/pixels 1.8.0 → 1.9.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/Alert/index.cjs +2 -2
- package/dist/Alert/index.d.cts +2 -2
- package/dist/Alert/index.d.ts +2 -2
- package/dist/Alert/index.js +1 -1
- package/dist/{Alert-BidIEsLA.d.cts → Alert-CWjAMyih.d.cts} +49 -41
- package/dist/{Alert-BidIEsLA.d.ts → Alert-CWjAMyih.d.ts} +49 -41
- package/dist/Avatar/index.d.cts +3 -2
- package/dist/Avatar/index.d.ts +3 -2
- package/dist/{Avatar-DjZ3H25h.d.cts → Avatar-DTg6mH8E.d.cts} +19 -18
- package/dist/{Avatar-DjZ3H25h.d.ts → Avatar-DTg6mH8E.d.ts} +19 -18
- package/dist/AvatarGroup/index.d.cts +4 -3
- package/dist/AvatarGroup/index.d.ts +4 -3
- package/dist/{AvatarGroup-B1Tdw57Q.d.ts → AvatarGroup-9wz1iZH4.d.ts} +1 -1
- package/dist/{AvatarGroup-BujXZ7Vy.d.cts → AvatarGroup-BYAaERBV.d.cts} +1 -1
- package/dist/Badge/index.d.cts +3 -2
- package/dist/Badge/index.d.ts +3 -2
- package/dist/{Badge-L8r9mgSs.d.cts → Badge-DkO-EJif.d.cts} +10 -9
- package/dist/{Badge-L8r9mgSs.d.ts → Badge-DkO-EJif.d.ts} +10 -9
- package/dist/Breadcrumb/index.d.cts +3 -2
- package/dist/Breadcrumb/index.d.ts +3 -2
- package/dist/{Breadcrumb-Cvt5Xa5D.d.cts → Breadcrumb-CW1qsIoL.d.cts} +22 -21
- package/dist/{Breadcrumb-Cvt5Xa5D.d.ts → Breadcrumb-CW1qsIoL.d.ts} +22 -21
- package/dist/Card/index.d.cts +3 -2
- package/dist/Card/index.d.ts +3 -2
- package/dist/{Card-OBRZ-ssX.d.cts → Card-2AwIQqnR.d.cts} +19 -18
- package/dist/{Card-OBRZ-ssX.d.ts → Card-2AwIQqnR.d.ts} +19 -18
- package/dist/Drawer/index.d.cts +3 -2
- package/dist/Drawer/index.d.ts +3 -2
- package/dist/{Drawer-JpihbwKl.d.cts → Drawer-Bd7lsUl9.d.cts} +25 -24
- package/dist/{Drawer-JpihbwKl.d.ts → Drawer-Bd7lsUl9.d.ts} +25 -24
- package/dist/Menu/index.d.cts +3 -2
- package/dist/Menu/index.d.ts +3 -2
- package/dist/{Menu-CS28E7nM.d.cts → Menu-C9M_q1Z6.d.cts} +10 -9
- package/dist/{Menu-CS28E7nM.d.ts → Menu-C9M_q1Z6.d.ts} +10 -9
- package/dist/Popover/index.d.cts +3 -2
- package/dist/Popover/index.d.ts +3 -2
- package/dist/{Popover-Bf192yqn.d.cts → Popover-DKzS6RUP.d.cts} +28 -27
- package/dist/{Popover-Bf192yqn.d.ts → Popover-DKzS6RUP.d.ts} +28 -27
- package/dist/SearchInput/index.d.cts +16 -15
- package/dist/SearchInput/index.d.ts +16 -15
- package/dist/Tabs/index.d.cts +3 -2
- package/dist/Tabs/index.d.ts +3 -2
- package/dist/{Tabs-BjMJs02F.d.cts → Tabs-BM4tl_1j.d.cts} +25 -24
- package/dist/{Tabs-BjMJs02F.d.ts → Tabs-BM4tl_1j.d.ts} +25 -24
- package/dist/Toast/index.cjs +3 -3
- package/dist/Toast/index.d.cts +3 -3
- package/dist/Toast/index.d.ts +3 -3
- package/dist/Toast/index.js +2 -2
- package/dist/{Toaster-DVX4ebm4.d.ts → Toaster-BtcILj3f.d.ts} +7 -3
- package/dist/{Toaster-M8hrHJ-J.d.cts → Toaster-D28PKRWz.d.cts} +7 -3
- package/dist/{chunk-LUAK6GQG.cjs → chunk-I5QMH3J5.cjs} +26 -43
- package/dist/chunk-I5QMH3J5.cjs.map +1 -0
- package/dist/{chunk-PKG3L2TJ.js → chunk-SDZX5VJZ.js} +25 -42
- package/dist/chunk-SDZX5VJZ.js.map +1 -0
- package/dist/{chunk-VEXCTG6K.js → chunk-VD7VRLYO.js} +15 -6
- package/dist/chunk-VD7VRLYO.js.map +1 -0
- package/dist/{chunk-YNA3GBAI.cjs → chunk-YWEUUA52.cjs} +16 -7
- package/dist/chunk-YWEUUA52.cjs.map +1 -0
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +12 -11
- package/dist/index.d.ts +12 -11
- package/dist/index.js +6 -6
- package/package.json +8 -8
- package/dist/chunk-LUAK6GQG.cjs.map +0 -1
- package/dist/chunk-PKG3L2TJ.js.map +0 -1
- package/dist/chunk-VEXCTG6K.js.map +0 -1
- package/dist/chunk-YNA3GBAI.cjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-LUAK6GQG.cjs","../src/Alert/Alert.tsx","../src/Alert/index.ts"],"names":["Alert_default"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACAA,sCAAmC;AACnC,sCAA2C;AAE3C,oDAAyC;AAsHrC,+CAAA;AApHG,IAAM,cAAA,EAAgB,4BAAA;AAAG,EAC9B,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,UAAA;AAAA,IACN,KAAA,EAAO,EAAA;AAAA,IACP,WAAA,EAAa,EAAA;AAAA,IACb,WAAA,EAAa,SAAA;AAAA,IACb,WAAA,EAAa,EAAA;AAAA,IACb,WAAA,EAAa,EAAA;AAAA,IACb,SAAA,EAAW;AAAA,EACb,CAAA;AAAA,EACA,QAAA,EAAU;AAAA;AAAA,IAER,mBAAA,EAAqB;AAAA,MACnB,IAAA,EAAM;AAAA,QACJ,WAAA,EAAa;AAAA,MACf;AAAA,IACF,CAAA;AAAA;AAAA,IAEA,KAAA,EAAO,8CAAA;AAAA,MACL,IAAA,EAAM;AAAA,QACJ,WAAA,EAAa,cAAA;AAAA,QACb,KAAA,EAAO,cAAA;AAAA,QACP,WAAA,EAAa;AAAA,MACf;AAAA,IAAA,CAAA,EACG,YAAA,CAAkB,QAAA,CAAS,KAAA,CAAA;AAAA;AAAA,IAGhC,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ACA;AAAA,EACF,CAAC,CAAA;AACD,EAAA,MAAM,WAAA,EAAa,8CAAA,QAAqB,EAAU,SAAA,EAAW,MAAM,CAAA;AAGnE,EAAA,MAAM,UAAA,EAAY,MAAA,CAAO,IAAA,CAAK,YAAA,CAAkB,QAAA,CAAS,KAAK,CAAA,CAAE,QAAA;AAAA,IAC9D;AAAA,EACF,EAAA,EACK,MAAA,EACD,KAAA,CAAA;AAEJ,EAAA,uBACE,6BAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,UAAA;AAAA,MACA,KAAA,EAAO,SAAA;AAAA,MACP,aAAA,EAAa,MAAA;AAAA,MACb,WAAA,EAAa,MAAA,EAAQ,SAAA,EAAW,KAAA,CAAA;AAAA,MAChC,UAAA;AAAA,MACA,QAAA,EAAU,CAAC,QAAA;AAAA,MACX,IAAA;AAAA,MAEA,UAAA,EAAY,QAAA;AAAA,MACZ,OAAA;AAAA,MACA,KAAA,EAAQ,MAAA,GAAA,KAAA,EAAA,MAAA,EAAS,QAAA;AAAA,MACjB;AAAA,IAAA;AAAA,EACF,CAAA;AAEJ,CAAA;AAEA,IAAO,cAAA,EAAQ,KAAA;ADvCf;AACA;AElGA,IAAOA,eAAAA,EAAQ,aAAA;AFoGf;AACA;AACE;AACA;AACA;AACF,sHAAC","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-LUAK6GQG.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { AlertProps as HeroAlertProps } from '@heroui/alert';\nimport type { ReactNode } from 'react';\n\nimport { Alert as HeroAlert } from '@heroui/alert';\nimport { alert as heroAlertVariants } from '@heroui/theme';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nexport const alertVariants = tv({\n slots: {\n base: 'min-w-72',\n title: '',\n description: '',\n mainWrapper: 'gap-1.5',\n closeButton: '',\n iconWrapper: '',\n alertIcon: '',\n },\n variants: {\n // if HeroUI Alert title and description are set the icon is placed on top (looks better)\n hasTitleAndChildren: {\n true: {\n iconWrapper: 'self-start',\n },\n },\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/alert.ts\n color: {\n info: {\n mainWrapper: 'text-inherit',\n title: 'text-inherit',\n description: 'text-inherit',\n },\n ...heroAlertVariants.variants.color,\n },\n // only 2 variants: solid and bordered (bordered uses HeroUI's faded variant)\n variant: {\n bordered: heroAlertVariants.variants.variant.faded,\n solid: heroAlertVariants.variants.variant.solid,\n },\n },\n compoundVariants: [\n {\n color: 'info',\n variant: 'solid',\n className: {\n base: 'bg-info text-info-foreground',\n alertIcon: 'text-info-foreground',\n closeButton: 'text-inherit',\n },\n },\n {\n color: 'info',\n variant: 'bordered',\n className: {\n alertIcon: 'fill-current',\n base: 'dark:bg-info-50/50 border-small border-info-200 bg-info-50 text-info-600 dark:border-info-100',\n closeButton: 'text-info-500 data-[hover]:bg-info-200',\n iconWrapper: 'border-info-100 bg-info-50 dark:bg-info-100',\n },\n },\n ],\n});\n\nexport type VariantProps = TVProps<typeof alertVariants>;\ntype ClassName = TVClassName<typeof alertVariants>;\n\n// hasTitleAndChildren is omitted because its used for automatic icon position\nexport interface AlertProps extends Omit<VariantProps, 'hasTitleAndChildren'> {\n /** Content displayed inside the Alert if no description is given! */\n children?: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Color scheme of the Alert */\n color?: VariantProps['color'];\n /** Content displayed at the end of the Alert */\n endContent?: ReactNode;\n /** Icon displayed at the start of the Alert */\n icon?: ReactNode;\n /** Whether the Alert can be closed */\n closable?: boolean;\n /** Callback fired when the close button is clicked */\n onClose?: () => void;\n /** Whether to show the icon at the start */\n showIcon?: boolean;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Title displayed in the Alert above the content */\n title?: ReactNode;\n /** Style variant of the Alert */\n variant?: VariantProps['variant'];\n}\n\n/**\n * Alert component based on [HeroUI Alert](https://www.heroui.com//docs/components/alert)\n */\nconst Alert = ({\n children = undefined,\n className = undefined,\n color = 'primary',\n endContent = undefined,\n icon = undefined,\n closable = false,\n onClose = undefined,\n showIcon = true,\n testId = undefined,\n title = undefined,\n variant = 'bordered',\n}: AlertProps) => {\n const hasTitleAndChildren = !!children && !!title;\n const variants = alertVariants({\n hasTitleAndChildren,\n color,\n variant,\n });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // pass color prop for heroui colors\n const heroColor = Object.keys(heroAlertVariants.variants.color).includes(\n color,\n )\n ? (color as HeroAlertProps['color'])\n : undefined;\n\n return (\n <HeroAlert\n classNames={classNames}\n color={heroColor}\n data-testid={testId}\n description={title ? children : undefined}\n endContent={endContent}\n hideIcon={!showIcon}\n icon={icon}\n // map closable to isClosable, because of we do not want \"is\" as prefix\n isClosable={closable}\n onClose={onClose}\n title={(title ?? children) as string}\n variant={variant}\n />\n );\n};\n\nexport default Alert;\n","import Alert, { alertVariants } from './Alert';\n\nexport type { AlertProps } from './Alert';\n\nexport { Alert, alertVariants };\n\nexport default Alert;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Alert/Alert.tsx","../src/Alert/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { AlertProps as HeroAlertProps } from '@heroui/alert';\nimport type { ReactNode } from 'react';\n\nimport { Alert as HeroAlert } from '@heroui/alert';\nimport { alert as heroAlertVariants } from '@heroui/theme';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nexport const alertVariants = tv({\n slots: {\n base: 'min-w-72',\n title: '',\n description: '',\n mainWrapper: 'gap-1.5',\n closeButton: '',\n iconWrapper: '',\n alertIcon: '',\n },\n variants: {\n // if HeroUI Alert title and description are set the icon is placed on top (looks better)\n hasTitleAndChildren: {\n true: {\n iconWrapper: 'self-start',\n },\n },\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/alert.ts\n color: {\n info: {\n mainWrapper: 'text-inherit',\n title: 'text-inherit',\n description: 'text-inherit',\n },\n ...heroAlertVariants.variants.color,\n },\n // only 2 variants: solid and bordered (bordered uses HeroUI's faded variant)\n variant: {\n bordered: heroAlertVariants.variants.variant.faded,\n solid: heroAlertVariants.variants.variant.solid,\n },\n },\n compoundVariants: [\n {\n color: 'info',\n variant: 'solid',\n className: {\n base: 'bg-info text-info-foreground',\n alertIcon: 'text-info-foreground',\n closeButton: 'text-inherit',\n },\n },\n {\n color: 'info',\n variant: 'bordered',\n className: {\n alertIcon: 'fill-current',\n base: 'dark:bg-info-50/50 border-small border-info-200 bg-info-50 text-info-600 dark:border-info-100',\n closeButton: 'text-info-500 data-[hover]:bg-info-200',\n iconWrapper: 'border-info-100 bg-info-50 dark:bg-info-100',\n },\n },\n ],\n});\n\nexport type VariantProps = TVProps<typeof alertVariants>;\ntype ClassName = TVClassName<typeof alertVariants>;\n\n// hasTitleAndChildren is omitted because its used for automatic icon position\nexport interface AlertProps extends Omit<VariantProps, 'hasTitleAndChildren'> {\n /** Content displayed inside the Alert if no description is given! */\n children?: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Color scheme of the Alert */\n color?: VariantProps['color'];\n /** Content displayed at the end of the Alert */\n endContent?: ReactNode;\n /** Icon displayed at the start of the Alert */\n icon?: ReactNode;\n /** Whether the Alert can be closed */\n closable?: boolean;\n /** Callback fired when the close button is clicked */\n onClose?: () => void;\n /** Whether to show the icon at the start */\n showIcon?: boolean;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Title displayed in the Alert above the content */\n title?: ReactNode;\n /** Style variant of the Alert */\n variant?: VariantProps['variant'];\n}\n\n/**\n * Alert component based on [HeroUI Alert](https://www.heroui.com//docs/components/alert)\n */\nconst Alert = ({\n children = undefined,\n className = undefined,\n color = 'primary',\n endContent = undefined,\n icon = undefined,\n closable = false,\n onClose = undefined,\n showIcon = true,\n testId = undefined,\n title = undefined,\n variant = 'bordered',\n}: AlertProps) => {\n const hasTitleAndChildren = !!children && !!title;\n const variants = alertVariants({\n hasTitleAndChildren,\n color,\n variant,\n });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // pass color prop for heroui colors\n const heroColor = Object.keys(heroAlertVariants.variants.color).includes(\n color,\n )\n ? (color as HeroAlertProps['color'])\n : undefined;\n\n return (\n <HeroAlert\n classNames={classNames}\n color={heroColor}\n data-testid={testId}\n description={title ? children : undefined}\n endContent={endContent}\n hideIcon={!showIcon}\n icon={icon}\n // map closable to isClosable, because of we do not want \"is\" as prefix\n isClosable={closable}\n onClose={onClose}\n title={(title ?? children) as string}\n variant={variant}\n />\n );\n};\n\nexport default Alert;\n","import Alert, { alertVariants } from './Alert';\n\nexport type { AlertProps } from './Alert';\n\nexport { Alert, alertVariants };\n\nexport default Alert;\n"],"mappings":";;;;;AAIA,SAAS,SAAS,iBAAiB;AACnC,SAAS,SAAS,yBAAyB;AAE3C,SAAS,IAAI,4BAA4B;AAsHrC;AApHG,IAAM,gBAAgB,GAAG;AAAA,EAC9B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa;AAAA,IACb,WAAW;AAAA,EACb;AAAA,EACA,UAAU;AAAA;AAAA,IAER,qBAAqB;AAAA,MACnB,MAAM;AAAA,QACJ,aAAa;AAAA,MACf;AAAA,IACF;AAAA;AAAA,IAEA,OAAO;AAAA,MACL,MAAM;AAAA,QACJ,aAAa;AAAA,QACb,OAAO;AAAA,QACP,aAAa;AAAA,MACf;AAAA,OACG,kBAAkB,SAAS;AAAA;AAAA,IAGhC,SAAS;AAAA,MACP,UAAU,kBAAkB,SAAS,QAAQ;AAAA,MAC7C,OAAO,kBAAkB,SAAS,QAAQ;AAAA,IAC5C;AAAA,EACF;AAAA,EACA,kBAAkB;AAAA,IAChB;AAAA,MACE,OAAO;AAAA,MACP,SAAS;AAAA,MACT,WAAW;AAAA,QACT,MAAM;AAAA,QACN,WAAW;AAAA,QACX,aAAa;AAAA,MACf;AAAA,IACF;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,SAAS;AAAA,MACT,WAAW;AAAA,QACT,WAAW;AAAA,QACX,MAAM;AAAA,QACN,aAAa;AAAA,QACb,aAAa;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF,CAAC;AAkCD,IAAM,QAAQ,CAAC;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,OAAO;AAAA,EACP,WAAW;AAAA,EACX,UAAU;AAAA,EACV,WAAW;AAAA,EACX,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AACZ,MAAkB;AAChB,QAAM,sBAAsB,CAAC,CAAC,YAAY,CAAC,CAAC;AAC5C,QAAM,WAAW,cAAc;AAAA,IAC7B;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,aAAa,qBAAqB,UAAU,WAAW,MAAM;AAGnE,QAAM,YAAY,OAAO,KAAK,kBAAkB,SAAS,KAAK,EAAE;AAAA,IAC9D;AAAA,EACF,IACK,QACD;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,OAAO;AAAA,MACP,eAAa;AAAA,MACb,aAAa,QAAQ,WAAW;AAAA,MAChC;AAAA,MACA,UAAU,CAAC;AAAA,MACX;AAAA,MAEA,YAAY;AAAA,MACZ;AAAA,MACA,OAAQ,wBAAS;AAAA,MACjB;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,gBAAQ;;;ACxIf,IAAOA,iBAAQ;","names":["Alert_default"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Toast/Toast.tsx","../src/Toast/Toaster.tsx","../src/Toast/index.ts"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport type { ExternalToast } from 'sonner';\nimport type { AlertProps } from '../Alert';\n\nimport { toast as sonnerToast } from 'sonner';\n\nimport AlertComponent from '../Alert';\n\ntype AlertColor = NonNullable<AlertProps['color']>;\n\n/** Props passed to a custom render function */\nexport interface ToastRenderProps {\n /** The toast message */\n message: ReactNode;\n /** The color/severity of the toast */\n color: AlertColor;\n /** Function to close the toast */\n close: () => void;\n /** Whether the toast can be closed by the user */\n closable?: boolean;\n /** Title displayed above the toast message */\n title?: ReactNode;\n /** Content displayed at the end of the toast */\n endContent?: ReactNode;\n}\n\n/** Options passed to each toast method */\nexport interface ToastOptions {\n /** Title displayed above the toast message */\n title?: ReactNode;\n /** Whether the toast can be closed by the user */\n closable?: boolean;\n /** Duration in milliseconds before the toast auto-closes */\n duration?: number;\n /** Position of the toast on the screen */\n position?: ExternalToast['position'];\n /** Callback fired when the toast auto-closes */\n onAutoClose?: ExternalToast['onAutoClose'];\n /** Callback fired when the toast is closed */\n onClose?: ExternalToast['onDismiss'];\n /** Content displayed at the end of the toast */\n endContent?: ReactNode;\n /** Custom render function to override the default AlertComponent */\n render?: (props: ToastRenderProps) => ReactElement;\n}\n\nconst showToast = (\n message: ReactNode,\n color: AlertColor,\n options?: ToastOptions,\n) => {\n // Map custom ToastOptions to Sonner's ExternalToast format:\n // - onClose is mapped to Sonner's onDismiss\n // - closable is handled separately (not a Sonner option)\n // - position defaults to 'top-center'\n const { onClose, closable, title, endContent, render, ...rest } =\n options ?? {};\n const sonnerOptions: ExternalToast = {\n position: 'top-center' as const,\n onDismiss: onClose,\n ...rest,\n };\n return sonnerToast.custom((id) => {\n // Close function passed to custom render or AlertComponent\n const close = () => {\n return sonnerToast.dismiss(id);\n };\n\n // Allow custom rendering via render prop\n if (render) {\n return render({ message, color, close, closable, title, endContent });\n }\n\n // Default: render AlertComponent\n return (\n <AlertComponent\n closable={closable}\n color={color}\n endContent={endContent}\n onClose={closable ? close : undefined}\n title={title}\n >\n {message}\n </AlertComponent>\n );\n }, sonnerOptions);\n};\n\n/** Toast object with convenience methods for different severity levels */\nconst toast = {\n /**\n * Show a default toast.\n * @returns The toast id which can be passed to `toast.close()`\n */\n default: (message: ReactNode, options?: ToastOptions) => {\n return showToast(message, 'default', options);\n },\n /**\n * Show an info toast.\n * @returns The toast id which can be passed to `toast.close()`\n */\n info: (message: ReactNode, options?: ToastOptions) => {\n return showToast(message, 'info', options);\n },\n /**\n * Show a warning toast.\n * @returns The toast id which can be passed to `toast.close()`\n */\n warn: (message: ReactNode, options?: ToastOptions) => {\n return showToast(message, 'warning', {\n duration: 60000,\n closable: true,\n ...options,\n });\n },\n /**\n * Show a success toast.\n * @returns The toast id which can be passed to `toast.close()`\n */\n success: (message: ReactNode, options?: ToastOptions) => {\n return showToast(message, 'success', options);\n },\n /**\n * Show an error toast.\n * @returns The toast id which can be passed to `toast.close()`\n */\n error: (message: ReactNode, options?: ToastOptions) => {\n return showToast(message, 'danger', {\n duration: 60000,\n closable: true,\n ...options,\n });\n },\n /** Close a toast by its id */\n close: (toastId: string | number) => {\n sonnerToast.dismiss(toastId);\n },\n};\n\nexport default toast;\n","import type { ComponentProps } from 'react';\n\nimport { Toaster as SonnerToaster } from 'sonner';\n\nexport type ToasterProps = Pick<\n ComponentProps<typeof SonnerToaster>,\n 'visibleToasts' | 'position'\n>;\n\nconst Toaster = (props: ToasterProps) => {\n return <SonnerToaster {...props} />;\n};\n\nexport default Toaster;\n","import toast from './Toast';\nimport Toaster from './Toaster';\n\nexport type { ToastOptions, ToastRenderProps } from './Toast';\nexport type { ToasterProps } from './Toaster';\n\nexport { Toaster, toast };\nexport default toast;\n"],"mappings":";;;;;;;;;AAIA,SAAS,SAAS,mBAAmB;AAuE/B;AA7BN,IAAM,YAAY,CAChB,SACA,OACA,YACG;AAKH,QACE,iCAAW,CAAC,GADN,WAAS,UAAU,OAAO,YAAY,OAvDhD,IAwDI,IADuD,iBACvD,IADuD,CAAjD,WAAS,YAAU,SAAO,cAAY;AAE9C,QAAM,gBAA+B;AAAA,IACnC,UAAU;AAAA,IACV,WAAW;AAAA,KACR;AAEL,SAAO,YAAY,OAAO,CAAC,OAAO;AAEhC,UAAM,QAAQ,MAAM;A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IAAOC,iBAAQ;","names":["jsx","Toast_default"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-YNA3GBAI.cjs","../src/Toast/Toast.tsx","../src/Toast/Toaster.tsx","../src/Toast/index.ts"],"names":["jsx","Toast_default"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACJA,gCAAqC;AAuE/B,+CAAA;AA7BN,IAAM,UAAA,EAAY,CAChB,OAAA,EACA,KAAA,EACA,OAAA,EAAA,GACG;AAKH,EAAA,MACE,GAAA,EAAA,QAAA,GAAA,KAAA,EAAA,QAAA,EAAW,CAAC,CAAA,EADN,EAAA,OAAA,EAAS,QAAA,EAAU,KAAA,EAAO,UAAA,EAAY,OAvDhD,EAAA,EAwDI,EAAA,EADuD,KAAA,EAAA,yCAAA,EACvD,EADuD,CAAjD,SAAA,EAAS,UAAA,EAAU,OAAA,EAAO,YAAA,EAAY,QAAA,CAAA,CAAA;AAE9C,EAAA,MAAM,cAAA,EAA+B,8CAAA;AAAA,IACnC,QAAA,EAAU,YAAA;AAAA,IACV,SAAA,EAAW;AAAA,EAAA,CAAA,EACR,IAAA,CAAA;AAEL,EAAA,OAAO,aAAA,CAAY,MAAA,CAAO,CAAC,EAAA,EAAA,GAAO;AAEhC,IAAA,MAAM,MAAA,EAAQ,CAAA,EAAA,GAAM;AAClB,MAAA,OAAO,aAAA,CAAY,OAAA,CAAQ,EAAE,CAAA;AAAA,IAC/B,CAAA;AAGA,IAAA,GAAA,CAAI,MAAA,EAAQ;AACV,MAAA,OAAO,MAAA,CAAO,EAAE,OAAA,EAAS,KAAA,EAAO,KAAA,EAAO,QAAA,EAAU,KAAA,EAAO,WAAW,CAAC,CAAA;AAAA,IACtE;AAGA,IAAA,uBACE,6BAAA;AAAA,MAAC,gCAAA;AAAA,MAAA;AAAA,QACC,QAAA;AAAA,QACA,KAAA;AAAA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CAAA;AAAA,EACH,CAAA;AAAA;AAAA,EAEA,KAAA,EAAO,CAAC,OAAA,EAAA,GAA6B;AACnC,IAAA,aAAA,CAAY,OAAA,CAAQ,OAAO,CAAA;AAAA,EAC7B;AACF,CAAA;AAEA,IAAO,cAAA,EAAQ,KAAA;ADtDf;AACA;AEpFA;AAQS;AADT,IAAM,QAAA,EAAU,CAAC,KAAA,EAAA,GAAwB;AACvC,EAAA,uBAAOA,6BAAAA,eAAC,EAAA,8CAAA,CAAA,CAAA,EAAkB,KAAA,CAAO,CAAA;AACnC,CAAA;AAEA,IAAO,gBAAA,EAAQ,OAAA;AFgFf;AACA;AGvFA,IAAOC,eAAAA,EAAQ,aAAA;AHyFf;AACA;AACE;AACA;AACA;AACF,0HAAC","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-YNA3GBAI.cjs","sourcesContent":[null,"import type { ReactElement, ReactNode } from 'react';\nimport type { ExternalToast } from 'sonner';\nimport type { AlertProps } from '../Alert';\n\nimport { toast as sonnerToast } from 'sonner';\n\nimport AlertComponent from '../Alert';\n\ntype AlertColor = NonNullable<AlertProps['color']>;\n\n/** Props passed to a custom render function */\nexport interface ToastRenderProps {\n /** The toast message */\n message: ReactNode;\n /** The color/severity of the toast */\n color: AlertColor;\n /** Function to close the toast */\n close: () => void;\n /** Whether the toast can be closed by the user */\n closable?: boolean;\n /** Title displayed above the toast message */\n title?: ReactNode;\n /** Content displayed at the end of the toast */\n endContent?: ReactNode;\n}\n\n/** Options passed to each toast method */\nexport interface ToastOptions {\n /** Title displayed above the toast message */\n title?: ReactNode;\n /** Whether the toast can be closed by the user */\n closable?: boolean;\n /** Duration in milliseconds before the toast auto-closes */\n duration?: number;\n /** Position of the toast on the screen */\n position?: ExternalToast['position'];\n /** Callback fired when the toast auto-closes */\n onAutoClose?: ExternalToast['onAutoClose'];\n /** Callback fired when the toast is closed */\n onClose?: ExternalToast['onDismiss'];\n /** Content displayed at the end of the toast */\n endContent?: ReactNode;\n /** Custom render function to override the default AlertComponent */\n render?: (props: ToastRenderProps) => ReactElement;\n}\n\nconst showToast = (\n message: ReactNode,\n color: AlertColor,\n options?: ToastOptions,\n) => {\n // Map custom ToastOptions to Sonner's ExternalToast format:\n // - onClose is mapped to Sonner's onDismiss\n // - closable is handled separately (not a Sonner option)\n // - position defaults to 'top-center'\n const { onClose, closable, title, endContent, render, ...rest } =\n options ?? {};\n const sonnerOptions: ExternalToast = {\n position: 'top-center' as const,\n onDismiss: onClose,\n ...rest,\n };\n return sonnerToast.custom((id) => {\n // Close function passed to custom render or AlertComponent\n const close = () => {\n return sonnerToast.dismiss(id);\n };\n\n // Allow custom rendering via render prop\n if (render) {\n return render({ message, color, close, closable, title, endContent });\n }\n\n // Default: render AlertComponent\n return (\n <AlertComponent\n closable={closable}\n color={color}\n endContent={endContent}\n onClose={closable ? close : undefined}\n title={title}\n >\n {message}\n </AlertComponent>\n );\n }, sonnerOptions);\n};\n\n/** Toast object with convenience methods for different severity levels */\nconst toast = {\n /**\n * Show a default toast.\n * @returns The toast id which can be passed to `toast.close()`\n */\n default: (message: ReactNode, options?: ToastOptions) => {\n return showToast(message, 'default', options);\n },\n /**\n * Show an info toast.\n * @returns The toast id which can be passed to `toast.close()`\n */\n info: (message: ReactNode, options?: ToastOptions) => {\n return showToast(message, 'info', options);\n },\n /**\n * Show a warning toast.\n * @returns The toast id which can be passed to `toast.close()`\n */\n warn: (message: ReactNode, options?: ToastOptions) => {\n return showToast(message, 'warning', {\n duration: 60000,\n closable: true,\n ...options,\n });\n },\n /**\n * Show a success toast.\n * @returns The toast id which can be passed to `toast.close()`\n */\n success: (message: ReactNode, options?: ToastOptions) => {\n return showToast(message, 'success', options);\n },\n /**\n * Show an error toast.\n * @returns The toast id which can be passed to `toast.close()`\n */\n error: (message: ReactNode, options?: ToastOptions) => {\n return showToast(message, 'danger', {\n duration: 60000,\n closable: true,\n ...options,\n });\n },\n /** Close a toast by its id */\n close: (toastId: string | number) => {\n sonnerToast.dismiss(toastId);\n },\n};\n\nexport default toast;\n","import type { ComponentProps } from 'react';\n\nimport { Toaster as SonnerToaster } from 'sonner';\n\nexport type ToasterProps = Pick<\n ComponentProps<typeof SonnerToaster>,\n 'visibleToasts' | 'position'\n>;\n\nconst Toaster = (props: ToasterProps) => {\n return <SonnerToaster {...props} />;\n};\n\nexport default Toaster;\n","import toast from './Toast';\nimport Toaster from './Toaster';\n\nexport type { ToastOptions, ToastRenderProps } from './Toast';\nexport type { ToasterProps } from './Toaster';\n\nexport { Toaster, toast };\nexport default toast;\n"]}
|