@fuf-stack/pixels 0.40.0 → 0.41.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Avatar/index.d.cts +2 -2
- package/dist/Avatar/index.d.ts +2 -2
- package/dist/AvatarGroup/index.d.cts +3 -3
- package/dist/AvatarGroup/index.d.ts +3 -3
- package/dist/{AvatarGroup-BMKOfE_a.d.ts → AvatarGroup-BfOtqfJy.d.ts} +1 -1
- package/dist/{AvatarGroup-2Lmu_V2d.d.cts → AvatarGroup-CUyQwK3t.d.cts} +1 -1
- package/dist/Button/index.cjs +2 -2
- package/dist/Button/index.js +1 -1
- package/dist/Drawer/index.d.cts +2 -2
- package/dist/Drawer/index.d.ts +2 -2
- package/dist/Json/index.cjs +3 -3
- package/dist/Json/index.js +2 -2
- package/dist/Progress/index.cjs +5 -82
- package/dist/Progress/index.cjs.map +1 -1
- package/dist/Progress/index.d.cts +9 -222
- package/dist/Progress/index.d.ts +9 -222
- package/dist/Progress/index.js +5 -82
- package/dist/Progress/index.js.map +1 -1
- package/dist/Progress-7yXUVioO.d.cts +228 -0
- package/dist/Progress-7yXUVioO.d.ts +228 -0
- package/dist/ProgressCircular/index.cjs +12 -0
- package/dist/ProgressCircular/index.cjs.map +1 -0
- package/dist/ProgressCircular/index.d.cts +11 -0
- package/dist/ProgressCircular/index.d.ts +11 -0
- package/dist/ProgressCircular/index.js +12 -0
- package/dist/ProgressCircular-U4kPZ1T1.d.cts +414 -0
- package/dist/ProgressCircular-U4kPZ1T1.d.ts +414 -0
- package/dist/Toast/index.cjs +14 -0
- package/dist/Toast/index.cjs.map +1 -0
- package/dist/Toast/index.d.cts +11 -0
- package/dist/Toast/index.d.ts +11 -0
- package/dist/Toast/index.js +14 -0
- package/dist/Toast/index.js.map +1 -0
- package/dist/ToastProvider-CL1v-bkE.d.cts +295 -0
- package/dist/ToastProvider-CL1v-bkE.d.ts +295 -0
- package/dist/chunk-5XFAJUE5.cjs +170 -0
- package/dist/chunk-5XFAJUE5.cjs.map +1 -0
- package/dist/{chunk-HHCDSQ6N.cjs → chunk-FLPLJTAC.cjs} +2 -2
- package/dist/{chunk-HHCDSQ6N.cjs.map → chunk-FLPLJTAC.cjs.map} +1 -1
- package/dist/chunk-GJQTAEHH.js +113 -0
- package/dist/chunk-GJQTAEHH.js.map +1 -0
- package/dist/{chunk-374SO74F.cjs → chunk-J63YGHTG.cjs} +3 -3
- package/dist/{chunk-374SO74F.cjs.map → chunk-J63YGHTG.cjs.map} +1 -1
- package/dist/chunk-KSAL4SBX.js +170 -0
- package/dist/chunk-KSAL4SBX.js.map +1 -0
- package/dist/{chunk-Q5DUSUCZ.js → chunk-MAKWBTTW.js} +2 -2
- package/dist/{chunk-Q5DUSUCZ.js.map → chunk-MAKWBTTW.js.map} +1 -1
- package/dist/chunk-RV7YPQXI.js +95 -0
- package/dist/chunk-RV7YPQXI.js.map +1 -0
- package/dist/chunk-VGXW3PSF.cjs +95 -0
- package/dist/chunk-VGXW3PSF.cjs.map +1 -0
- package/dist/{chunk-L3DEBOPG.js → chunk-VRPX6QUG.js} +2 -2
- package/dist/chunk-WCRVH4DS.cjs +113 -0
- package/dist/chunk-WCRVH4DS.cjs.map +1 -0
- package/dist/index.cjs +19 -170
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -299
- package/dist/index.d.ts +11 -299
- package/dist/index.js +23 -174
- package/dist/index.js.map +1 -1
- package/package.json +32 -27
- package/dist/CircularProgress/index.cjs +0 -14
- package/dist/CircularProgress/index.cjs.map +0 -1
- package/dist/CircularProgress/index.d.cts +0 -11
- package/dist/CircularProgress/index.d.ts +0 -11
- package/dist/CircularProgress/index.js +0 -14
- package/dist/CircularProgress-DHrnT6wz.d.cts +0 -182
- package/dist/CircularProgress-DHrnT6wz.d.ts +0 -182
- package/dist/chunk-37WQ3CBA.cjs +0 -98
- package/dist/chunk-37WQ3CBA.cjs.map +0 -1
- package/dist/chunk-M3PL6G7W.js +0 -98
- package/dist/chunk-M3PL6G7W.js.map +0 -1
- package/dist/{Avatar-B8lVnLpp.d.cts → Avatar-ylNJ_-dY.d.cts} +5 -5
- package/dist/{Avatar-B8lVnLpp.d.ts → Avatar-ylNJ_-dY.d.ts} +5 -5
- package/dist/{Drawer-DmwcvuKe.d.cts → Drawer-BnV9qxPA.d.cts} +5 -5
- package/dist/{Drawer-DmwcvuKe.d.ts → Drawer-BnV9qxPA.d.ts} +5 -5
- /package/dist/{CircularProgress → ProgressCircular}/index.js.map +0 -0
- /package/dist/{chunk-L3DEBOPG.js.map → chunk-VRPX6QUG.js.map} +0 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkD4TLDLEXcjs = require('./chunk-D4TLDLEX.cjs');
|
|
5
|
+
|
|
6
|
+
// src/Toast/addToast.tsx
|
|
7
|
+
var _theme = require('@heroui/theme');
|
|
8
|
+
var _toast = require('@heroui/toast');
|
|
9
|
+
var _pixelutils = require('@fuf-stack/pixel-utils');
|
|
10
|
+
var toastVariants = _pixelutils.tv.call(void 0, {
|
|
11
|
+
slots: {
|
|
12
|
+
base: "",
|
|
13
|
+
title: "",
|
|
14
|
+
description: "",
|
|
15
|
+
icon: "",
|
|
16
|
+
loadingIcon: "",
|
|
17
|
+
content: "",
|
|
18
|
+
motionDiv: "",
|
|
19
|
+
progressTrack: "",
|
|
20
|
+
progressIndicator: "",
|
|
21
|
+
closeButton: "",
|
|
22
|
+
closeIcon: ""
|
|
23
|
+
},
|
|
24
|
+
variants: {
|
|
25
|
+
// see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/toast.ts
|
|
26
|
+
color: _chunkD4TLDLEXcjs.__spreadValues.call(void 0, {
|
|
27
|
+
info: {}
|
|
28
|
+
}, _theme.toast.variants.color),
|
|
29
|
+
variant: _chunkD4TLDLEXcjs.__spreadValues.call(void 0, {}, _theme.toast.variants.variant)
|
|
30
|
+
},
|
|
31
|
+
compoundVariants: [
|
|
32
|
+
..._theme.toast.compoundVariants,
|
|
33
|
+
{
|
|
34
|
+
variant: "solid",
|
|
35
|
+
color: "info",
|
|
36
|
+
className: {
|
|
37
|
+
base: "bg-info text-info-foreground",
|
|
38
|
+
title: "text-info-foreground",
|
|
39
|
+
description: "text-info-foreground",
|
|
40
|
+
icon: "text-info-foreground",
|
|
41
|
+
closeIcon: "border-info-400 bg-info-100",
|
|
42
|
+
closeButton: "text-info-400 hover:text-info-600",
|
|
43
|
+
progressIndicator: "bg-info-400"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
color: "info",
|
|
48
|
+
variant: "flat",
|
|
49
|
+
className: {
|
|
50
|
+
base: "bg-info-50 text-info-600 dark:bg-info-50/50",
|
|
51
|
+
title: "text-info-600",
|
|
52
|
+
description: "text-info-500",
|
|
53
|
+
icon: "text-info-600",
|
|
54
|
+
closeIcon: "border-info-400 bg-info-100",
|
|
55
|
+
closeButton: "text-info-400 hover:text-info-600",
|
|
56
|
+
progressIndicator: "bg-info-400"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
color: "info",
|
|
61
|
+
variant: "bordered",
|
|
62
|
+
className: {
|
|
63
|
+
base: "border-small border-info text-info-600",
|
|
64
|
+
title: "text-info-600",
|
|
65
|
+
description: "text-info-500",
|
|
66
|
+
icon: "text-info-600",
|
|
67
|
+
closeIcon: "border-info-400 bg-info-100",
|
|
68
|
+
closeButton: "text-info-400 hover:text-info-600",
|
|
69
|
+
progressIndicator: "bg-info-400"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
});
|
|
74
|
+
var addToast = ({
|
|
75
|
+
className = void 0,
|
|
76
|
+
closeIcon = void 0,
|
|
77
|
+
color = "default",
|
|
78
|
+
description = void 0,
|
|
79
|
+
endContent = void 0,
|
|
80
|
+
icon = void 0,
|
|
81
|
+
loadingIcon = void 0,
|
|
82
|
+
onClose = void 0,
|
|
83
|
+
promise = void 0,
|
|
84
|
+
shouldShowTimeoutProgress = false,
|
|
85
|
+
showCloseButton = true,
|
|
86
|
+
showIcon = true,
|
|
87
|
+
timeout = 5e3,
|
|
88
|
+
title = void 0,
|
|
89
|
+
variant = "bordered"
|
|
90
|
+
}) => {
|
|
91
|
+
const variants = toastVariants({
|
|
92
|
+
color,
|
|
93
|
+
variant
|
|
94
|
+
});
|
|
95
|
+
const isHeroUIColor = Object.keys(_theme.toast.variants.color).includes(
|
|
96
|
+
color
|
|
97
|
+
);
|
|
98
|
+
const classNames = _pixelutils.variantsToClassNames.call(void 0, variants, className, "base");
|
|
99
|
+
_toast.addToast.call(void 0, {
|
|
100
|
+
classNames,
|
|
101
|
+
closeIcon,
|
|
102
|
+
color: isHeroUIColor ? color : void 0,
|
|
103
|
+
// TODO: 'data-testid': testId,
|
|
104
|
+
description,
|
|
105
|
+
endContent,
|
|
106
|
+
hideCloseButton: !showCloseButton,
|
|
107
|
+
hideIcon: !showIcon,
|
|
108
|
+
icon,
|
|
109
|
+
loadingIcon,
|
|
110
|
+
onClose,
|
|
111
|
+
promise,
|
|
112
|
+
shouldShowTimeoutProgress,
|
|
113
|
+
timeout,
|
|
114
|
+
title,
|
|
115
|
+
variant
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// src/Toast/ToastProvider.tsx
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
124
|
+
var ToastProvider = ({
|
|
125
|
+
disableAnimation = false,
|
|
126
|
+
maxVisibleToasts = 5,
|
|
127
|
+
placement = "top-center",
|
|
128
|
+
toastProps = void 0,
|
|
129
|
+
toastOffset = 26,
|
|
130
|
+
regionProps = void 0
|
|
131
|
+
}) => {
|
|
132
|
+
const variants = toastVariants({
|
|
133
|
+
color: toastProps == null ? void 0 : toastProps.color,
|
|
134
|
+
variant: toastProps == null ? void 0 : toastProps.variant
|
|
135
|
+
});
|
|
136
|
+
const isHeroUIColor = Object.keys(_theme.toast.variants.color).includes(
|
|
137
|
+
(toastProps == null ? void 0 : toastProps.color) || ""
|
|
138
|
+
);
|
|
139
|
+
const classNames = _pixelutils.variantsToClassNames.call(void 0,
|
|
140
|
+
variants,
|
|
141
|
+
toastProps == null ? void 0 : toastProps.className,
|
|
142
|
+
"base"
|
|
143
|
+
);
|
|
144
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
145
|
+
_toast.ToastProvider,
|
|
146
|
+
{
|
|
147
|
+
disableAnimation,
|
|
148
|
+
maxVisibleToasts,
|
|
149
|
+
placement,
|
|
150
|
+
regionProps,
|
|
151
|
+
toastOffset,
|
|
152
|
+
toastProps: _chunkD4TLDLEXcjs.__spreadProps.call(void 0, _chunkD4TLDLEXcjs.__spreadValues.call(void 0, {}, toastProps), {
|
|
153
|
+
classNames,
|
|
154
|
+
color: isHeroUIColor ? toastProps == null ? void 0 : toastProps.color : void 0
|
|
155
|
+
})
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
};
|
|
159
|
+
var ToastProvider_default = ToastProvider;
|
|
160
|
+
|
|
161
|
+
// src/Toast/index.ts
|
|
162
|
+
var Toast_default = ToastProvider_default;
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
exports.toastVariants = toastVariants; exports.addToast = addToast; exports.ToastProvider_default = ToastProvider_default; exports.Toast_default = Toast_default;
|
|
170
|
+
//# sourceMappingURL=chunk-5XFAJUE5.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-5XFAJUE5.cjs","../src/Toast/addToast.tsx","../src/Toast/ToastProvider.tsx","../src/Toast/index.ts"],"names":["heroToastVariants","variantsToClassNames"],"mappings":"AAAA;AACE;AACA;AACF,wDAA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,CAAY,KAAA,EAAA,GAAS;AAAA,EACvB,CAAA;AACA,EAAA,MAAM,WAAA,EAAaC,8CAAAA;AAAA,IACjB,QAAA;AAAA,IACA,WAAA,GAAA,KAAA,EAAA,KAAA,EAAA,EAAA,UAAA,CAAY,SAAA;AAAA,IACZ;AAAA,EACF,CAAA;AACA,EAAA,uBACE,6BAAA;AAAA,IAAC,oBAAA;AAAA,IAAA;AAAA,MACC,gBAAA;AAAA,MACA,gBAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA;AAAA,MACA,WAAA;AAAA,MACA,UAAA,EAAY,6CAAA,8CAAA,CAAA,CAAA,EACP,UAAA,CAAA,EADO;AAAA,QAEV,UAAA;AAAA,QACA,KAAA,EAAO,cAAA,EACF,WAAA,GAAA,KAAA,EAAA,KAAA,EAAA,EAAA,UAAA,CAAY,MAAA,EACb,KAAA;AAAA,MACN,CAAA;AAAA,IAAA;AAAA,EACF,CAAA;AAEJ,CAAA;AAEA,IAAO,sBAAA,EAAQ,aAAA;AFuFf;AACA;AGxJA,IAAO,cAAA,EAAQ,qBAAA;AH0Jf;AACA;AACE;AACA;AACA;AACA;AACF,iKAAC","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-5XFAJUE5.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ToastProps as HeroToastProps } from '@heroui/toast';\nimport type { ReactNode } from 'react';\n\nimport { toast as heroToastVariants } from '@heroui/theme';\nimport { addToast as heroAddToast } from '@heroui/toast';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nexport const toastVariants = tv({\n slots: {\n base: '',\n title: '',\n description: '',\n icon: '',\n loadingIcon: '',\n content: '',\n motionDiv: '',\n progressTrack: '',\n progressIndicator: '',\n closeButton: '',\n closeIcon: '',\n },\n variants: {\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/toast.ts\n color: {\n info: {},\n ...heroToastVariants.variants.color,\n },\n variant: {\n ...heroToastVariants.variants.variant,\n },\n },\n compoundVariants: [\n ...heroToastVariants.compoundVariants,\n {\n variant: 'solid',\n color: 'info',\n className: {\n base: 'bg-info text-info-foreground',\n title: 'text-info-foreground',\n description: 'text-info-foreground',\n icon: 'text-info-foreground',\n closeIcon: 'border-info-400 bg-info-100',\n closeButton: 'text-info-400 hover:text-info-600',\n progressIndicator: 'bg-info-400',\n },\n },\n {\n color: 'info',\n variant: 'flat',\n className: {\n base: 'bg-info-50 text-info-600 dark:bg-info-50/50',\n title: 'text-info-600',\n description: 'text-info-500',\n icon: 'text-info-600',\n closeIcon: 'border-info-400 bg-info-100',\n closeButton: 'text-info-400 hover:text-info-600',\n progressIndicator: 'bg-info-400',\n },\n },\n\n {\n color: 'info',\n variant: 'bordered',\n className: {\n base: 'border-small border-info text-info-600',\n title: 'text-info-600',\n description: 'text-info-500',\n icon: 'text-info-600',\n closeIcon: 'border-info-400 bg-info-100',\n closeButton: 'text-info-400 hover:text-info-600',\n progressIndicator: 'bg-info-400',\n },\n },\n ],\n});\n\nexport type AddToastVariantProps = TVProps<typeof toastVariants>;\ntype ClassName = TVClassName<typeof toastVariants>;\n\nexport interface ToastProps extends AddToastVariantProps {\n /** CSS class name */\n className?: ClassName;\n /** Icon displayed at the end of the Alert */\n closeIcon?: ReactNode;\n /** Color of the alert */\n color?: AddToastVariantProps['color'];\n /** Content displayed inside the Alert */\n description?: ReactNode;\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 /** Icon or animation displayed until promise is resolved */\n loadingIcon?: ReactNode;\n /** Callback function called when the toast is closed */\n onClose?: () => void;\n /** Promise based on which the notification will be styled */\n promise?: Promise<void>;\n /** Whether the toast should show a progress bar */\n shouldShowTimeoutProgress?: boolean;\n /** Whether the toast should show a close button */\n showCloseButton?: boolean;\n /** Whether the toast should show an icon */\n showIcon?: boolean;\n /** Time the toast is displayed */\n timeout?: number;\n /** Content displayed at the top of the toast */\n title?: ReactNode;\n /** Variant of the toast */\n variant?: AddToastVariantProps['variant'];\n}\n\n/**\n * addToast function based on [HeroUI Toast](https://www.heroui.com//docs/components/toast)\n */\nexport const addToast = ({\n className = undefined,\n closeIcon = undefined,\n color = 'default',\n description = undefined,\n endContent = undefined,\n icon = undefined,\n loadingIcon = undefined,\n onClose = undefined,\n promise = undefined,\n shouldShowTimeoutProgress = false,\n showCloseButton = true,\n showIcon = true,\n timeout = 5000,\n title = undefined,\n variant = 'bordered',\n}: ToastProps) => {\n const variants = toastVariants({\n color,\n variant,\n });\n const isHeroUIColor = Object.keys(heroToastVariants.variants.color).includes(\n color,\n );\n const classNames = variantsToClassNames(variants, className, 'base');\n heroAddToast({\n classNames,\n closeIcon,\n color: isHeroUIColor ? (color as HeroToastProps['color']) : undefined,\n // TODO: 'data-testid': testId,\n description,\n endContent,\n hideCloseButton: !showCloseButton,\n hideIcon: !showIcon,\n icon,\n loadingIcon,\n onClose,\n promise,\n shouldShowTimeoutProgress,\n timeout,\n title,\n variant,\n });\n};\n\nexport default addToast;\n","import type { ToastProps as HeroToastProps } from '@heroui/toast';\nimport type { ToastProps } from './addToast';\n\nimport { toast as heroToastVariants } from '@heroui/theme';\nimport { ToastProvider as HeroToastProvider } from '@heroui/toast';\n\nimport { variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { toastVariants } from './addToast';\n\nexport type ToastProviderToastProps = Omit<\n ToastProps,\n 'description' | 'endContent' | 'title'\n>;\n\nexport interface ToastProviderProps {\n disableAnimation?: boolean;\n maxVisibleToasts?: number;\n placement?:\n | 'bottom-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'top-right'\n | 'top-left'\n | 'top-center';\n\n toastProps?: ToastProviderToastProps;\n toastOffset?: number;\n regionProps?: { classNames?: Record<'base', string> };\n}\n\n/**\n * ToastProvider component based on [HeroUI Toast](https://www.heroui.com//docs/components/toast)\n */\nconst ToastProvider = ({\n disableAnimation = false,\n maxVisibleToasts = 5,\n placement = 'top-center',\n toastProps = undefined,\n toastOffset = 26,\n regionProps = undefined,\n}: ToastProviderProps) => {\n const variants = toastVariants({\n color: toastProps?.color,\n variant: toastProps?.variant,\n });\n const isHeroUIColor = Object.keys(heroToastVariants.variants.color).includes(\n toastProps?.color || '',\n );\n const classNames = variantsToClassNames(\n variants,\n toastProps?.className,\n 'base',\n );\n return (\n <HeroToastProvider\n disableAnimation={disableAnimation}\n maxVisibleToasts={maxVisibleToasts}\n placement={placement}\n regionProps={regionProps}\n toastOffset={toastOffset}\n toastProps={{\n ...toastProps,\n classNames,\n color: isHeroUIColor\n ? (toastProps?.color as HeroToastProps['color'])\n : undefined,\n }}\n />\n );\n};\n\nexport default ToastProvider;\n","import { addToast, toastVariants } from './addToast';\nimport ToastProvider from './ToastProvider';\n\nexport type { ToastProps, AddToastVariantProps } from './addToast';\nexport type { ToastProviderProps } from './ToastProvider';\n\nexport { addToast, ToastProvider, toastVariants };\n\nexport default ToastProvider;\n"]}
|
|
@@ -72,7 +72,7 @@ var buttonVariants = _pixelutils.tv.call(void 0, {
|
|
|
72
72
|
{
|
|
73
73
|
color: "info",
|
|
74
74
|
variant: "shadow",
|
|
75
|
-
class: 'shadow-lg shadow-info/40
|
|
75
|
+
class: 'text-info-foreground" bg-info shadow-lg shadow-info/40'
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
color: "info",
|
|
@@ -150,4 +150,4 @@ var Button_default2 = Button_default;
|
|
|
150
150
|
|
|
151
151
|
|
|
152
152
|
exports.buttonVariants = buttonVariants; exports.Button_default = Button_default; exports.Button_default2 = Button_default2;
|
|
153
|
-
//# sourceMappingURL=chunk-
|
|
153
|
+
//# sourceMappingURL=chunk-FLPLJTAC.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-FLPLJTAC.cjs","../src/Button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AA,EAAY,KAAA,CAAA;AAAA,EACZ,MAAA,EAAQ,SAAA;AAAA,EACR,SAAA,EAAW,KAAA;AAAA,EACX,iBAAA,EAAmB,KAAA;AAAA,EACnB,KAAA,EAAO,KAAA,CAAA;AAAA,EACP,QAAA,EAAU,KAAA;AAAA,EACV,QAAA,EAAU,KAAA,CAAA;AAAA,EACV,KAAA,EAAO,KAAA,CAAA;AAAA,EACP,OAAA,EAAS,KAAA,CAAA;AAAA,EACT,KAAA,EAAO,KAAA,CAAA;AAAA,EACP,QAAA,EAAU;AACZ,CAAA,EAAA,GAAmB;AACjB,EAAA,uBACEA,8BAAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,YAAA,EAAY,SAAA;AAAA,MACZ,SAAA,EAAW,cAAA,CAAe,EAAE,KAAA,EAAO,OAAA,EAAS,UAAU,CAAC,CAAA;AAAA,MACvD,KAAA;AAAA,MACA,aAAA,EAAa,MAAA;AAAA,MACb,gBAAA;AAAA,MACA,aAAA,EAAe,gBAAA;AAAA,MACf,UAAA,EAAY,QAAA;AAAA,MACZ,UAAA,EAAY,CAAC,CAAA,CAAE,KAAA,GAAQ,CAAC,QAAA,CAAA;AAAA,MACxB,SAAA,EAAW,OAAA;AAAA,MACX,OAAA,EAAS,OAAA;AAAA,MACT,IAAA;AAAA,MACA,OAAA,kBAASC,6BAAAA,sBAAC,EAAA,CAAA,CAAe,CAAA;AAAA,MACzB,IAAA;AAAA,MACA,OAAA;AAAA,MAEC,QAAA,EAAA;AAAA,QAAA,IAAA;AAAA,QACA;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,CAAA;AAEJ,CAAA;AAEA,IAAO,eAAA,EAAQ,MAAA;ADNf;AACA;AG1IA,IAAOC,gBAAAA,EAAQ,cAAA;AH4If;AACA;AACE;AACA;AACA;AACF,4HAAC","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-FLPLJTAC.cjs","sourcesContent":[null,"import type { TVProps } from '@fuf-stack/pixel-utils';\nimport type { ButtonProps as HeroButtonProps } from '@heroui/button';\nimport type { ReactNode } from 'react';\n\nimport { Button as HeroButton } from '@heroui/button';\nimport { button as heroButtonVariants } from '@heroui/theme';\n\nimport { tv } from '@fuf-stack/pixel-utils';\n\nimport LoadingSpinner from './subcomponents/LoadingSpinner';\n\nexport const buttonVariants = tv({\n base: '',\n variants: {\n color: {\n info: '',\n ...heroButtonVariants.variants.color,\n },\n variant: {\n ...heroButtonVariants.variants.variant,\n },\n size: {\n ...heroButtonVariants.variants.size,\n },\n },\n compoundVariants: [\n // white text on solid / shadow success button\n {\n color: 'success',\n variant: ['solid', 'shadow'],\n class: 'text-white',\n },\n // white text on solid / shadow warning button\n {\n color: 'warning',\n variant: ['solid', 'shadow'],\n class: 'text-white',\n },\n {\n color: 'info',\n variant: 'solid',\n class: 'bg-info text-info-foreground',\n },\n {\n color: 'info',\n variant: 'shadow',\n class: 'text-info-foreground\" bg-info shadow-lg shadow-info/40',\n },\n {\n color: 'info',\n variant: 'bordered',\n class: 'border-medium border-info bg-transparent text-info',\n },\n {\n color: 'info',\n variant: 'flat',\n class: 'bg-info/20 text-info-600',\n },\n {\n color: 'info',\n variant: 'faded',\n class: 'border-default bg-default-100 text-info',\n },\n {\n color: 'info',\n variant: 'light',\n class: 'bg-transparent text-info data-[hover=true]:bg-info-100',\n },\n {\n color: 'info',\n variant: 'ghost',\n class:\n 'border-info text-info data-[hover=true]:!bg-info data-[hover=true]:!text-info-foreground',\n },\n ],\n});\n\nexport type VariantProps = TVProps<typeof buttonVariants>;\n\nexport interface ButtonProps extends VariantProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string;\n /** hero ui button color */\n color?: HeroButtonProps['color'];\n /** disables function of the button. */\n disabled?: boolean;\n /** disables all button animations */\n disableAnimation?: boolean;\n /** If set loading animation is shown */\n loading?: boolean;\n /** optional icon */\n icon?: ReactNode;\n /** on click event */\n onClick?: HeroButtonProps['onPress'];\n /** 3 size options */\n size?: HeroButtonProps['size'];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** sets the button type. */\n type?: 'button' | 'submit' | 'reset' | undefined;\n /** hero ui button variants */\n variant?: HeroButtonProps['variant'];\n}\n\n/**\n * Button component based on [HeroUI Button](https://www.heroui.com//docs/components/button)\n */\nconst Button = ({\n ariaLabel = undefined,\n children = undefined,\n className = undefined,\n color = 'default',\n disabled = false,\n disableAnimation = false,\n icon = undefined,\n loading = false,\n onClick = undefined,\n size = undefined,\n testId = undefined,\n type = undefined,\n variant = 'solid',\n}: ButtonProps) => {\n return (\n <HeroButton\n aria-label={ariaLabel}\n className={buttonVariants({ color, variant, className })}\n color={color}\n data-testid={testId}\n disableAnimation={disableAnimation}\n disableRipple={disableAnimation}\n isDisabled={disabled}\n isIconOnly={!!(icon && !children)}\n isLoading={loading}\n onPress={onClick}\n size={size}\n spinner={<LoadingSpinner />}\n type={type}\n variant={variant}\n >\n {icon}\n {children}\n </HeroButton>\n );\n};\n\nexport default Button;\n","/**\n * svg loading spinner for button\n * @see https://www.heroui.com//docs/components/button#loading\n * */\nexport default () => (\n <svg\n className=\"animate-spin h-5 w-5 text-current\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n","import Button, { buttonVariants } from './Button';\n\nexport type { ButtonProps } from './Button';\n\nexport { Button, buttonVariants };\n\nexport default Button;\n"]}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadValues
|
|
3
|
+
} from "./chunk-J7N2552D.js";
|
|
4
|
+
|
|
5
|
+
// src/ProgressCircular/ProgressCircular.tsx
|
|
6
|
+
import { FaCheck, FaTimes } from "react-icons/fa";
|
|
7
|
+
import { CircularProgress as HeroCircularProgress } from "@heroui/progress";
|
|
8
|
+
import { circularProgress as heroCircularProgressVariants } from "@heroui/theme";
|
|
9
|
+
import { tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
var progressCircularVariants = tv({
|
|
12
|
+
slots: {
|
|
13
|
+
// wrapper around the whole component
|
|
14
|
+
base: "",
|
|
15
|
+
// indicator of the circle (finished part)
|
|
16
|
+
indicator: "",
|
|
17
|
+
// label next to the svgWrapper
|
|
18
|
+
label: "",
|
|
19
|
+
// wrapper for the circle
|
|
20
|
+
svg: "",
|
|
21
|
+
// wrapper around progress svg and value span
|
|
22
|
+
svgWrapper: "",
|
|
23
|
+
// track of the circle (not finished part)
|
|
24
|
+
track: "stroke-default-50",
|
|
25
|
+
// outer span next to the svg
|
|
26
|
+
value: ""
|
|
27
|
+
},
|
|
28
|
+
variants: {
|
|
29
|
+
color: __spreadValues({
|
|
30
|
+
info: {
|
|
31
|
+
svg: "text-info"
|
|
32
|
+
}
|
|
33
|
+
}, heroCircularProgressVariants.variants.color),
|
|
34
|
+
hasError: {
|
|
35
|
+
true: {
|
|
36
|
+
svg: "text-danger"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
size: {
|
|
40
|
+
xs: {
|
|
41
|
+
svg: "h-10 w-10",
|
|
42
|
+
value: "text-xs"
|
|
43
|
+
},
|
|
44
|
+
sm: {
|
|
45
|
+
svg: "h-12 w-12",
|
|
46
|
+
value: "text-sm"
|
|
47
|
+
},
|
|
48
|
+
md: {
|
|
49
|
+
svg: "h-16 w-16",
|
|
50
|
+
value: "text-md"
|
|
51
|
+
},
|
|
52
|
+
lg: {
|
|
53
|
+
svg: "h-20 w-20",
|
|
54
|
+
value: "text-lg"
|
|
55
|
+
},
|
|
56
|
+
xl: {
|
|
57
|
+
svg: "h-24 w-24",
|
|
58
|
+
value: "text-xl"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
var defaultFormat = (percent = 0) => `${percent}%`;
|
|
64
|
+
var ProgressCircular = ({
|
|
65
|
+
ariaLabel = "progress",
|
|
66
|
+
className = void 0,
|
|
67
|
+
format = defaultFormat,
|
|
68
|
+
hasError = false,
|
|
69
|
+
percent,
|
|
70
|
+
disableAnimation = false,
|
|
71
|
+
size = "md",
|
|
72
|
+
color = "info"
|
|
73
|
+
}) => {
|
|
74
|
+
const variants = progressCircularVariants({ color, hasError, size });
|
|
75
|
+
const classNames = variantsToClassNames(variants, className, "base");
|
|
76
|
+
let value = format(percent);
|
|
77
|
+
let progressColor = color;
|
|
78
|
+
if (hasError) {
|
|
79
|
+
progressColor = "danger";
|
|
80
|
+
value = /* @__PURE__ */ jsx(FaTimes, { className: "text-danger" });
|
|
81
|
+
} else if (percent >= 100) {
|
|
82
|
+
progressColor = "success";
|
|
83
|
+
value = /* @__PURE__ */ jsx(FaCheck, { className: "text-success" });
|
|
84
|
+
}
|
|
85
|
+
const heroUiColor = Object.keys(
|
|
86
|
+
heroCircularProgressVariants.variants.color
|
|
87
|
+
).includes(color) ? progressColor : void 0;
|
|
88
|
+
return /* @__PURE__ */ jsx(
|
|
89
|
+
HeroCircularProgress,
|
|
90
|
+
{
|
|
91
|
+
"aria-label": ariaLabel,
|
|
92
|
+
classNames,
|
|
93
|
+
color: heroUiColor,
|
|
94
|
+
disableAnimation,
|
|
95
|
+
formatOptions: void 0,
|
|
96
|
+
showValueLabel: true,
|
|
97
|
+
strokeWidth: 2,
|
|
98
|
+
value: percent || 0,
|
|
99
|
+
valueLabel: value
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
var ProgressCircular_default = ProgressCircular;
|
|
104
|
+
|
|
105
|
+
// src/ProgressCircular/index.ts
|
|
106
|
+
var ProgressCircular_default2 = ProgressCircular_default;
|
|
107
|
+
|
|
108
|
+
export {
|
|
109
|
+
progressCircularVariants,
|
|
110
|
+
ProgressCircular_default,
|
|
111
|
+
ProgressCircular_default2
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=chunk-GJQTAEHH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ProgressCircular/ProgressCircular.tsx","../src/ProgressCircular/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { CircularProgressProps as HeroCircularProgressProps } from '@heroui/progress';\nimport type { ReactNode } from 'react';\n\nimport { FaCheck, FaTimes } from 'react-icons/fa';\n\nimport { CircularProgress as HeroCircularProgress } from '@heroui/progress';\nimport { circularProgress as heroCircularProgressVariants } from '@heroui/theme';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nexport const progressCircularVariants = tv({\n slots: {\n // wrapper around the whole component\n base: '',\n // indicator of the circle (finished part)\n indicator: '',\n // label next to the svgWrapper\n label: '',\n // wrapper for the circle\n svg: '',\n // wrapper around progress svg and value span\n svgWrapper: '',\n // track of the circle (not finished part)\n track: 'stroke-default-50',\n // outer span next to the svg\n value: '',\n },\n variants: {\n color: {\n info: {\n svg: 'text-info',\n },\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/progress.ts\n ...heroCircularProgressVariants.variants.color,\n },\n hasError: {\n true: {\n svg: 'text-danger',\n },\n },\n size: {\n xs: {\n svg: 'h-10 w-10',\n value: 'text-xs',\n },\n sm: {\n svg: 'h-12 w-12',\n value: 'text-sm',\n },\n md: {\n svg: 'h-16 w-16',\n value: 'text-md',\n },\n lg: {\n svg: 'h-20 w-20',\n value: 'text-lg',\n },\n xl: {\n svg: 'h-24 w-24',\n value: 'text-xl',\n },\n },\n },\n});\n\ntype VariantProps = TVProps<typeof progressCircularVariants>;\ntype ClassName = TVClassName<typeof progressCircularVariants>;\n\nexport interface ProgressCircularProps extends VariantProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** color options */\n color?: VariantProps['color'];\n /** disables all animations */\n disableAnimation?: boolean;\n /** formats the display value of the progress in the center */\n format?: (percent?: number) => ReactNode;\n /** enables error version */\n hasError?: boolean;\n /** percentage / progress of the circular progress bar */\n percent: number;\n /** size options */\n size?: VariantProps['size'];\n}\n\n/** formats percent with percent sign */\nconst defaultFormat = (percent = 0) => `${percent}%`;\n\n/**\n * ProgressCircular component based on [HeroUI CircularProgress](https://www.heroui.com/docs/components/circular-progress)\n */\nconst ProgressCircular = ({\n ariaLabel = 'progress',\n className = undefined,\n format = defaultFormat,\n hasError = false,\n percent,\n disableAnimation = false,\n size = 'md',\n color = 'info',\n}: ProgressCircularProps) => {\n const variants = progressCircularVariants({ color, hasError, size });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // format value\n let value = format(percent);\n\n // handle special states\n let progressColor: VariantProps['color'] = color;\n if (hasError) {\n progressColor = 'danger';\n value = <FaTimes className=\"text-danger\" />;\n } else if (percent >= 100) {\n progressColor = 'success';\n value = <FaCheck className=\"text-success\" />;\n }\n\n // pass only HeroUI colors as props\n const heroUiColor = Object.keys(\n heroCircularProgressVariants.variants.color,\n ).includes(color)\n ? (progressColor as HeroCircularProgressProps['color'])\n : undefined;\n\n return (\n <HeroCircularProgress\n aria-label={ariaLabel}\n classNames={classNames}\n color={heroUiColor}\n disableAnimation={disableAnimation}\n formatOptions={undefined}\n showValueLabel\n strokeWidth={2}\n // we do not use spinner animation when no percent provided\n value={percent || 0}\n valueLabel={value}\n />\n );\n};\n\nexport default ProgressCircular;\n","import ProgressCircular, { progressCircularVariants } from './ProgressCircular';\n\nexport type { ProgressCircularProps } from './ProgressCircular';\n\nexport { ProgressCircular, progressCircularVariants };\n\nexport default ProgressCircular;\n"],"mappings":";;;;;AAIA,SAAS,SAAS,eAAe;AAEjC,S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AuC;AAC3C,MAAI,UAAU;AACZ,oBAAgB;AAChB,YAAQ,oBAAC,WAAQ,WAAU,eAAc;AAAA,EAC3C,WAAW,WAAW,KAAK;AACzB,oBAAgB;AAChB,YAAQ,oBAAC,WAAQ,WAAU,gBAAe;AAAA,EAC5C;AAGA,QAAM,cAAc,OAAO;AAAA,IACzB,6BAA6B,SAAS;AAAA,EACxC,EAAE,SAAS,KAAK,IACX,gBACD;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAY;AAAA,MACZ;AAAA,MACA,OAAO;AAAA,MACP;AAAA,MACA,eAAe;AAAA,MACf,gBAAc;AAAA,MACd,aAAa;AAAA,MAEb,OAAO,WAAW;AAAA,MAClB,YAAY;AAAA;AAAA,EACd;AAEJ;AAEA,IAAO,2BAAQ;;;ACzIf,IAAOA,4BAAQ;","names":["ProgressCircular_default"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkFLPLJTACcjs = require('./chunk-FLPLJTAC.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -2590,7 +2590,7 @@ var ErrorRenderer = ({
|
|
|
2590
2590
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "font-medium", children: "Failed to parse JSON data" })
|
|
2591
2591
|
] }),
|
|
2592
2592
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2593
|
-
|
|
2593
|
+
_chunkFLPLJTACcjs.Button_default,
|
|
2594
2594
|
{
|
|
2595
2595
|
color: "danger",
|
|
2596
2596
|
size: "sm",
|
|
@@ -2709,4 +2709,4 @@ var Json_default2 = Json_default;
|
|
|
2709
2709
|
|
|
2710
2710
|
|
|
2711
2711
|
exports.Json_default = Json_default; exports.Json_default2 = Json_default2;
|
|
2712
|
-
//# sourceMappingURL=chunk-
|
|
2712
|
+
//# sourceMappingURL=chunk-J63YGHTG.cjs.map
|