@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.
Files changed (78) hide show
  1. package/dist/Avatar/index.d.cts +2 -2
  2. package/dist/Avatar/index.d.ts +2 -2
  3. package/dist/AvatarGroup/index.d.cts +3 -3
  4. package/dist/AvatarGroup/index.d.ts +3 -3
  5. package/dist/{AvatarGroup-BMKOfE_a.d.ts → AvatarGroup-BfOtqfJy.d.ts} +1 -1
  6. package/dist/{AvatarGroup-2Lmu_V2d.d.cts → AvatarGroup-CUyQwK3t.d.cts} +1 -1
  7. package/dist/Button/index.cjs +2 -2
  8. package/dist/Button/index.js +1 -1
  9. package/dist/Drawer/index.d.cts +2 -2
  10. package/dist/Drawer/index.d.ts +2 -2
  11. package/dist/Json/index.cjs +3 -3
  12. package/dist/Json/index.js +2 -2
  13. package/dist/Progress/index.cjs +5 -82
  14. package/dist/Progress/index.cjs.map +1 -1
  15. package/dist/Progress/index.d.cts +9 -222
  16. package/dist/Progress/index.d.ts +9 -222
  17. package/dist/Progress/index.js +5 -82
  18. package/dist/Progress/index.js.map +1 -1
  19. package/dist/Progress-7yXUVioO.d.cts +228 -0
  20. package/dist/Progress-7yXUVioO.d.ts +228 -0
  21. package/dist/ProgressCircular/index.cjs +12 -0
  22. package/dist/ProgressCircular/index.cjs.map +1 -0
  23. package/dist/ProgressCircular/index.d.cts +11 -0
  24. package/dist/ProgressCircular/index.d.ts +11 -0
  25. package/dist/ProgressCircular/index.js +12 -0
  26. package/dist/ProgressCircular-U4kPZ1T1.d.cts +414 -0
  27. package/dist/ProgressCircular-U4kPZ1T1.d.ts +414 -0
  28. package/dist/Toast/index.cjs +14 -0
  29. package/dist/Toast/index.cjs.map +1 -0
  30. package/dist/Toast/index.d.cts +11 -0
  31. package/dist/Toast/index.d.ts +11 -0
  32. package/dist/Toast/index.js +14 -0
  33. package/dist/Toast/index.js.map +1 -0
  34. package/dist/ToastProvider-CL1v-bkE.d.cts +295 -0
  35. package/dist/ToastProvider-CL1v-bkE.d.ts +295 -0
  36. package/dist/chunk-5XFAJUE5.cjs +170 -0
  37. package/dist/chunk-5XFAJUE5.cjs.map +1 -0
  38. package/dist/{chunk-HHCDSQ6N.cjs → chunk-FLPLJTAC.cjs} +2 -2
  39. package/dist/{chunk-HHCDSQ6N.cjs.map → chunk-FLPLJTAC.cjs.map} +1 -1
  40. package/dist/chunk-GJQTAEHH.js +113 -0
  41. package/dist/chunk-GJQTAEHH.js.map +1 -0
  42. package/dist/{chunk-374SO74F.cjs → chunk-J63YGHTG.cjs} +3 -3
  43. package/dist/{chunk-374SO74F.cjs.map → chunk-J63YGHTG.cjs.map} +1 -1
  44. package/dist/chunk-KSAL4SBX.js +170 -0
  45. package/dist/chunk-KSAL4SBX.js.map +1 -0
  46. package/dist/{chunk-Q5DUSUCZ.js → chunk-MAKWBTTW.js} +2 -2
  47. package/dist/{chunk-Q5DUSUCZ.js.map → chunk-MAKWBTTW.js.map} +1 -1
  48. package/dist/chunk-RV7YPQXI.js +95 -0
  49. package/dist/chunk-RV7YPQXI.js.map +1 -0
  50. package/dist/chunk-VGXW3PSF.cjs +95 -0
  51. package/dist/chunk-VGXW3PSF.cjs.map +1 -0
  52. package/dist/{chunk-L3DEBOPG.js → chunk-VRPX6QUG.js} +2 -2
  53. package/dist/chunk-WCRVH4DS.cjs +113 -0
  54. package/dist/chunk-WCRVH4DS.cjs.map +1 -0
  55. package/dist/index.cjs +19 -170
  56. package/dist/index.cjs.map +1 -1
  57. package/dist/index.d.cts +11 -299
  58. package/dist/index.d.ts +11 -299
  59. package/dist/index.js +23 -174
  60. package/dist/index.js.map +1 -1
  61. package/package.json +32 -27
  62. package/dist/CircularProgress/index.cjs +0 -14
  63. package/dist/CircularProgress/index.cjs.map +0 -1
  64. package/dist/CircularProgress/index.d.cts +0 -11
  65. package/dist/CircularProgress/index.d.ts +0 -11
  66. package/dist/CircularProgress/index.js +0 -14
  67. package/dist/CircularProgress-DHrnT6wz.d.cts +0 -182
  68. package/dist/CircularProgress-DHrnT6wz.d.ts +0 -182
  69. package/dist/chunk-37WQ3CBA.cjs +0 -98
  70. package/dist/chunk-37WQ3CBA.cjs.map +0 -1
  71. package/dist/chunk-M3PL6G7W.js +0 -98
  72. package/dist/chunk-M3PL6G7W.js.map +0 -1
  73. package/dist/{Avatar-B8lVnLpp.d.cts → Avatar-ylNJ_-dY.d.cts} +5 -5
  74. package/dist/{Avatar-B8lVnLpp.d.ts → Avatar-ylNJ_-dY.d.ts} +5 -5
  75. package/dist/{Drawer-DmwcvuKe.d.cts → Drawer-BnV9qxPA.d.cts} +5 -5
  76. package/dist/{Drawer-DmwcvuKe.d.ts → Drawer-BnV9qxPA.d.ts} +5 -5
  77. /package/dist/{CircularProgress → ProgressCircular}/index.js.map +0 -0
  78. /package/dist/{chunk-L3DEBOPG.js.map → chunk-VRPX6QUG.js.map} +0 -0
@@ -0,0 +1,170 @@
1
+ import {
2
+ __spreadProps,
3
+ __spreadValues
4
+ } from "./chunk-J7N2552D.js";
5
+
6
+ // src/Toast/addToast.tsx
7
+ import { toast as heroToastVariants } from "@heroui/theme";
8
+ import { addToast as heroAddToast } from "@heroui/toast";
9
+ import { tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
10
+ var toastVariants = tv({
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: __spreadValues({
27
+ info: {}
28
+ }, heroToastVariants.variants.color),
29
+ variant: __spreadValues({}, heroToastVariants.variants.variant)
30
+ },
31
+ compoundVariants: [
32
+ ...heroToastVariants.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(heroToastVariants.variants.color).includes(
96
+ color
97
+ );
98
+ const classNames = variantsToClassNames(variants, className, "base");
99
+ heroAddToast({
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
+ import { toast as heroToastVariants2 } from "@heroui/theme";
121
+ import { ToastProvider as HeroToastProvider } from "@heroui/toast";
122
+ import { variantsToClassNames as variantsToClassNames2 } from "@fuf-stack/pixel-utils";
123
+ import { jsx } from "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(heroToastVariants2.variants.color).includes(
137
+ (toastProps == null ? void 0 : toastProps.color) || ""
138
+ );
139
+ const classNames = variantsToClassNames2(
140
+ variants,
141
+ toastProps == null ? void 0 : toastProps.className,
142
+ "base"
143
+ );
144
+ return /* @__PURE__ */ jsx(
145
+ HeroToastProvider,
146
+ {
147
+ disableAnimation,
148
+ maxVisibleToasts,
149
+ placement,
150
+ regionProps,
151
+ toastOffset,
152
+ toastProps: __spreadProps(__spreadValues({}, 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
+ export {
165
+ toastVariants,
166
+ addToast,
167
+ ToastProvider_default,
168
+ Toast_default
169
+ };
170
+ //# sourceMappingURL=chunk-KSAL4SBX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/Toast/addToast.tsx","../src/Toast/ToastProvider.tsx","../src/Toast/index.ts"],"sourcesContent":["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"],"mappings":";;;;;;AAIA,SAAS,SAAS,yBAAyB;AAC3C,SAAS,YAAY,oBAAoB;AAEzC,SAAS,IAAI,4BAA4B;AAElC,IAAM,gBAAgB,GAAG;AAAA,EAC9B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAA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antsToClassNames","heroToastVariants","variantsToClassNames"]}
@@ -72,7 +72,7 @@ var buttonVariants = tv({
72
72
  {
73
73
  color: "info",
74
74
  variant: "shadow",
75
- class: 'shadow-lg shadow-info/40 bg-info text-info-foreground"'
75
+ class: 'text-info-foreground" bg-info shadow-lg shadow-info/40'
76
76
  },
77
77
  {
78
78
  color: "info",
@@ -150,4 +150,4 @@ export {
150
150
  Button_default,
151
151
  Button_default2
152
152
  };
153
- //# sourceMappingURL=chunk-Q5DUSUCZ.js.map
153
+ //# sourceMappingURL=chunk-MAKWBTTW.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Button/Button.tsx","../src/Button/subcomponents/LoadingSpinner.tsx","../src/Button/index.ts"],"sourcesContent":["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: 'shadow-lg shadow-info/40 bg-info text-info-foreground\"',\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"],"mappings":";;;;;AAIA,SAAS,UAAU,kBAAkB;AACrC,SAAS,UAAU,0BAA0B;AAE7C,SAAS,UAAU;;;ACFjB,SAME,KANF;AADF,IAAO,yBAAQ,MACb;AAAA,EAAC;AAAA;AAAA,IACC,WAAU;AAAA,IACV,MAAK;AAAA,IACL,SAAQ;AAAA,IACR,OAAM;AAAA,IAEN;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,IAAG;AAAA,UACH,IAAG;AAAA,UACH,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA;AAAA,MACd;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,GAAE;AAAA,UACF,MAAK;AAAA;AAAA,MACP;AAAA;AAAA;AACF;;;ADuGE,SAYW,OAAAA,MAZX,QAAAC,aAAA;AApHG,IAAM,iBAAiB,GAAG;AAAA,EAC/B,MAAM;AAAA,EACN,UAAU;AAAA,IACR,OAAO;AAAA,MACL,MAAM;AAAA,OACH,mBAAmB,SAAS;AAAA,IAEjC,SAAS,mBACJ,mBAAmB,SAAS;AAAA,IAEjC,MAAM,mBACD,mBAAmB,SAAS;AAAA,EAEnC;AAAA,EACA,kBAAkB;AAAA;AAAA,IAEhB;AAAA,MACE,OAAO;AAAA,MACP,SAAS,CAAC,SAAS,Q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BAAe;AAAA,MACzB;AAAA,MACA;AAAA,MAEC;AAAA;AAAA,QACA;AAAA;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,iBAAQ;;;AE/If,IAAOE,kBAAQ;","names":["jsx","jsxs","Button_default"]}
1
+ {"version":3,"sources":["../src/Button/Button.tsx","../src/Button/subcomponents/LoadingSpinner.tsx","../src/Button/index.ts"],"sourcesContent":["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"],"mappings":";;;;;AAIA,SAAS,UAAU,kBAAkB;AACrC,SAAS,UAAU,0BAA0B;AAE7C,SAAS,UAAU;;;ACFjB,SAME,KANF;AADF,IAAO,yBAAQ,MACb;AAAA,EAAC;AAAA;AAAA,IACC,WAAU;AAAA,IACV,MAAK;AAAA,IACL,SAAQ;AAAA,IACR,OAAM;AAAA,IAEN;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,IAAG;AAAA,UACH,IAAG;AAAA,UACH,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA;AAAA,MACd;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,GAAE;AAAA,UACF,MAAK;AAAA;AAAA,MACP;AAAA;AAAA;AACF;;;ADuGE,SAYW,OAAAA,MAZX,QAAAC,aAAA;AApHG,IAAM,iBAAiB,GAAG;AAAA,EAC/B,MAAM;AAAA,EACN,UAAU;AAAA,IACR,OAAO;AAAA,MACL,MAAM;AAAA,OACH,mBAAmB,SAAS;AAAA,IAEjC,SAAS,mBACJ,mBAAmB,SAAS;AAAA,IAEjC,MAAM,mBACD,mBAAmB,SAAS;AAAA,EAEnC;AAAA,EACA,kBAAkB;AAAA;AAAA,IAEhB;AAAA,MACE,OAAO;AAAA,MACP,SAAS,CAAC,SAAS,QAAQ;AAAA,MAC3B,OAAO;AAAA,IACT;AAAA;AAAA,IAEA;AAAA,MACE,OAAO;AAAA,MACP,SAAS,CAAC,SAAS,QAAQ;AAAA,MAC3B,OAAO;AAAA,IACT;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,SAAS;AAAA,MACT,OAAO;AAAA,IACT;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,SAAS;AAAA,MACT,OAAO;AAAA,IACT;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,SAAS;AAAA,MACT,OAAO;AAAA,IACT;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,SAAS;AAAA,MACT,OAAO;AAAA,IACT;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,SAAS;AAAA,MACT,OAAO;AAAA,IACT;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,SAAS;AAAA,MACT,OAAO;AAAA,IACT;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,SAAS;AAAA,MACT,OACE;AAAA,IACJ;AAAA,EACF;AACF,CAAC;AAoCD,IAAM,SAAS,CAAC;AAAA,EACd,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,mBAAmB;AAAA,EACnB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AACZ,MAAmB;AACjB,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,cAAY;AAAA,MACZ,WAAW,eAAe,EAAE,OAAO,SAAS,UAAU,CAAC;AAAA,MACvD;AAAA,MACA,eAAa;AAAA,MACb;AAAA,MACA,eAAe;AAAA,MACf,YAAY;AAAA,MACZ,YAAY,CAAC,EAAE,QAAQ,CAAC;AAAA,MACxB,WAAW;AAAA,MACX,SAAS;AAAA,MACT;AAAA,MACA,SAAS,gBAAAD,KAAC,0BAAe;AAAA,MACzB;AAAA,MACA;AAAA,MAEC;AAAA;AAAA,QACA;AAAA;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,iBAAQ;;;AE/If,IAAOE,kBAAQ;","names":["jsx","jsxs","Button_default"]}
@@ -0,0 +1,95 @@
1
+ // src/Progress/Progress.tsx
2
+ import { Progress as HeroProgress } from "@heroui/progress";
3
+ import { tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
4
+ import { jsx } from "react/jsx-runtime";
5
+ var progressVariants = tv({
6
+ slots: {
7
+ // wrapper around the whole component
8
+ base: "",
9
+ // indicator of the progress (finished part)
10
+ indicator: "",
11
+ // label at the top left of the progress bar
12
+ label: "",
13
+ // wrapper around progress label and label span
14
+ labelWrapper: "",
15
+ // track of the progress (not finished part)
16
+ track: "",
17
+ // span around the progress value
18
+ value: ""
19
+ },
20
+ variants: {
21
+ // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/progress.ts
22
+ color: {
23
+ danger: {
24
+ indicator: "bg-danger"
25
+ },
26
+ default: {
27
+ indicator: "bg-default-400"
28
+ },
29
+ info: {
30
+ indicator: "bg-info"
31
+ },
32
+ primary: {
33
+ indicator: "bg-primary"
34
+ },
35
+ secondary: {
36
+ indicator: "bg-secondary"
37
+ },
38
+ success: {
39
+ indicator: "bg-success"
40
+ },
41
+ warning: {
42
+ indicator: "bg-warning"
43
+ }
44
+ }
45
+ }
46
+ });
47
+ var defaultFormat = (percent = 0) => `${percent}%`;
48
+ var Progress = ({
49
+ ariaLabel = "progress",
50
+ className = void 0,
51
+ color = "info",
52
+ disableAnimation = false,
53
+ format = defaultFormat,
54
+ indeterminate = false,
55
+ label = void 0,
56
+ percent,
57
+ showValueLabel = false,
58
+ size = "md",
59
+ testId = void 0
60
+ }) => {
61
+ let progressColor = color;
62
+ if (percent >= 100) {
63
+ progressColor = "success";
64
+ }
65
+ const variants = progressVariants({ color: progressColor });
66
+ const classNames = variantsToClassNames(variants, className, "base");
67
+ const value = format(percent);
68
+ return /* @__PURE__ */ jsx(
69
+ HeroProgress,
70
+ {
71
+ "aria-label": ariaLabel,
72
+ classNames,
73
+ "data-testid": testId,
74
+ disableAnimation,
75
+ formatOptions: void 0,
76
+ isIndeterminate: indeterminate,
77
+ label,
78
+ showValueLabel,
79
+ size,
80
+ value: percent || 0,
81
+ valueLabel: !!percent && value
82
+ }
83
+ );
84
+ };
85
+ var Progress_default = Progress;
86
+
87
+ // src/Progress/index.ts
88
+ var Progress_default2 = Progress_default;
89
+
90
+ export {
91
+ progressVariants,
92
+ Progress_default,
93
+ Progress_default2
94
+ };
95
+ //# sourceMappingURL=chunk-RV7YPQXI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/Progress/Progress.tsx","../src/Progress/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { Progress as HeroProgress } from '@heroui/progress';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\n// progress styling variants\nexport const progressVariants = tv({\n slots: {\n // wrapper around the whole component\n base: '',\n // indicator of the progress (finished part)\n indicator: '',\n // label at the top left of the progress bar\n label: '',\n // wrapper around progress label and label span\n labelWrapper: '',\n // track of the progress (not finished part)\n track: '',\n // span around the progress value\n value: '',\n },\n variants: {\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/progress.ts\n color: {\n danger: {\n indicator: 'bg-danger',\n },\n default: {\n indicator: 'bg-default-400',\n },\n info: {\n indicator: 'bg-info',\n },\n primary: {\n indicator: 'bg-primary',\n },\n secondary: {\n indicator: 'bg-secondary',\n },\n success: {\n indicator: 'bg-success',\n },\n warning: {\n indicator: 'bg-warning',\n },\n },\n },\n});\n\nexport type VariantProps = TVProps<typeof progressVariants>;\ntype ClassName = TVClassName<typeof progressVariants>;\n\nexport interface ProgressProps extends VariantProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** color of the progress bar */\n color?: VariantProps['color'];\n /** disables all animations */\n disableAnimation?: boolean;\n /** function to format the progress value */\n format?: (percent: number) => ReactNode;\n /** shows indeterminate progress animation */\n indeterminate?: boolean;\n /** label of the progress bar */\n label?: ReactNode;\n /** percentage / progress of the progress bar */\n percent: number;\n /** whether to show the value label */\n showValueLabel?: boolean;\n /** size of the progress bar */\n size?: 'sm' | 'md' | 'lg';\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/** formats percent with percent sign */\nconst defaultFormat = (percent = 0) => `${percent}%`;\n\n/**\n * Progress component based on [HeroUI Progress](https://www.heroui.com//docs/components/progress)\n */\nconst Progress = ({\n ariaLabel = 'progress',\n className = undefined,\n color = 'info',\n disableAnimation = false,\n format = defaultFormat,\n indeterminate = false,\n label = undefined,\n percent,\n showValueLabel = false,\n size = 'md',\n testId = undefined,\n}: ProgressProps) => {\n // handle special states\n let progressColor: VariantProps['color'] = color;\n if (percent >= 100) {\n progressColor = 'success';\n }\n\n const variants = progressVariants({ color: progressColor });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n const value = format(percent);\n\n return (\n <HeroProgress\n aria-label={ariaLabel}\n classNames={classNames}\n data-testid={testId}\n disableAnimation={disableAnimation}\n formatOptions={undefined}\n isIndeterminate={indeterminate}\n label={label}\n showValueLabel={showValueLabel}\n size={size}\n value={percent || 0}\n valueLabel={!!percent && value}\n />\n );\n};\n\nexport default Progress;\n","import Progress, { progressVariants } from './Progress';\n\nexport type { ProgressProps } from './Progress';\n\nexport { Progress, progressVariants };\n\nexport default Progress;\n"],"mappings":";AAGA,SAAS,YAAY,oBAAoB;AAEzC,SAAS,IAAI,4BAA4B;AAyGrC;AAtGG,IAAM,mBAAmB,GAAG;AAAA,EACjC,OAAO;AAAA;AAAA,IAEL,MAAM;AAAA;AAAA,IAEN,WAAW;AAAA;AAAA,IAEX,OAAO;AAAA;AAAA,IAEP,cAAc;AAAA;AAAA,IAEd,OAAO;AAAA;AAAA,IAEP,OAAO;AAAA,EACT;AAAA,EACA,UAAU;AAAA;AAAA,IAER,OAAO;AAAA,MACL,QAAQ;AAAA,QACN,WAAW;AAAA,MACb;AAAA,MACA,SAAS;AAAA,QACP,WAAW;AAAA,MACb;AAAA,MACA,MAAM;AAAA,QACJ,WAAW;AAAA,MACb;AAAA,MACA,SAAS;AAAA,QACP,WAAW;AAAA,MACb;AAAA,MACA,WAAW;AAAA,QACT,WAAW;AAAA,MACb;AAAA,MACA,SAAS;AAAA,QACP,WAAW;AAAA,MACb;AAAA,MACA,SAAS;AAAA,QACP,WAAW;AAAA,MACb;AAAA,IACF;AAAA,EACF;AACF,CAAC;AA+BD,IAAM,gBAAgB,CAAC,UAAU,MAAM,GAAG,OAAO;AAKjD,IAAM,WAAW,CAAC;AAAA,EAChB,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,mBAAmB;AAAA,EACnB,SAAS;AAAA,EACT,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR;AAAA,EACA,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,SAAS;AACX,MAAqB;AAEnB,MAAI,gBAAuC;AAC3C,MAAI,WAAW,KAAK;AAClB,oBAAgB;AAAA,EAClB;AAEA,QAAM,WAAW,iBAAiB,EAAE,OAAO,cAAc,CAAC;AAC1D,QAAM,aAAa,qBAAqB,UAAU,WAAW,MAAM;AAEnE,QAAM,QAAQ,OAAO,OAAO;AAE5B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAY;AAAA,MACZ;AAAA,MACA,eAAa;AAAA,MACb;AAAA,MACA,eAAe;AAAA,MACf,iBAAiB;AAAA,MACjB;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO,WAAW;AAAA,MAClB,YAAY,CAAC,CAAC,WAAW;AAAA;AAAA,EAC3B;AAEJ;AAEA,IAAO,mBAAQ;;;ACxHf,IAAOA,oBAAQ;","names":["Progress_default"]}
@@ -0,0 +1,95 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/Progress/Progress.tsx
2
+ var _progress = require('@heroui/progress');
3
+ var _pixelutils = require('@fuf-stack/pixel-utils');
4
+ var _jsxruntime = require('react/jsx-runtime');
5
+ var progressVariants = _pixelutils.tv.call(void 0, {
6
+ slots: {
7
+ // wrapper around the whole component
8
+ base: "",
9
+ // indicator of the progress (finished part)
10
+ indicator: "",
11
+ // label at the top left of the progress bar
12
+ label: "",
13
+ // wrapper around progress label and label span
14
+ labelWrapper: "",
15
+ // track of the progress (not finished part)
16
+ track: "",
17
+ // span around the progress value
18
+ value: ""
19
+ },
20
+ variants: {
21
+ // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/progress.ts
22
+ color: {
23
+ danger: {
24
+ indicator: "bg-danger"
25
+ },
26
+ default: {
27
+ indicator: "bg-default-400"
28
+ },
29
+ info: {
30
+ indicator: "bg-info"
31
+ },
32
+ primary: {
33
+ indicator: "bg-primary"
34
+ },
35
+ secondary: {
36
+ indicator: "bg-secondary"
37
+ },
38
+ success: {
39
+ indicator: "bg-success"
40
+ },
41
+ warning: {
42
+ indicator: "bg-warning"
43
+ }
44
+ }
45
+ }
46
+ });
47
+ var defaultFormat = (percent = 0) => `${percent}%`;
48
+ var Progress = ({
49
+ ariaLabel = "progress",
50
+ className = void 0,
51
+ color = "info",
52
+ disableAnimation = false,
53
+ format = defaultFormat,
54
+ indeterminate = false,
55
+ label = void 0,
56
+ percent,
57
+ showValueLabel = false,
58
+ size = "md",
59
+ testId = void 0
60
+ }) => {
61
+ let progressColor = color;
62
+ if (percent >= 100) {
63
+ progressColor = "success";
64
+ }
65
+ const variants = progressVariants({ color: progressColor });
66
+ const classNames = _pixelutils.variantsToClassNames.call(void 0, variants, className, "base");
67
+ const value = format(percent);
68
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
69
+ _progress.Progress,
70
+ {
71
+ "aria-label": ariaLabel,
72
+ classNames,
73
+ "data-testid": testId,
74
+ disableAnimation,
75
+ formatOptions: void 0,
76
+ isIndeterminate: indeterminate,
77
+ label,
78
+ showValueLabel,
79
+ size,
80
+ value: percent || 0,
81
+ valueLabel: !!percent && value
82
+ }
83
+ );
84
+ };
85
+ var Progress_default = Progress;
86
+
87
+ // src/Progress/index.ts
88
+ var Progress_default2 = Progress_default;
89
+
90
+
91
+
92
+
93
+
94
+ exports.progressVariants = progressVariants; exports.Progress_default = Progress_default; exports.Progress_default2 = Progress_default2;
95
+ //# sourceMappingURL=chunk-VGXW3PSF.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-VGXW3PSF.cjs","../src/Progress/Progress.tsx","../src/Progress/index.ts"],"names":[],"mappings":"AAAA;ACGA,4CAAyC;AAEzC,oDAAyC;AAyGrC,+CAAA;AAtGG,IAAM,iBAAA,EAAmB,4BAAA;AAAG,EACjC,KAAA,EAAO;AAAA;AAAA,IAEL,IAAA,EAAM,EAAA;AAAA;AAAA,IAEN,SAAA,EAAW,EAAA;AAAA;AAAA,IAEX,KAAA,EAAO,EAAA;AAAA;AAAA,IAEP,YAAA,EAAc,EAAA;AAAA;AAAA,IAEd,KAAA,EAAO,EAAA;AAAA;AAAA,IAEP,KAAA,EAAO;AAAA,EACT,CAAA;AAAA,EACA,QAAA,EAAU;AAAA;AAAA,IAER,KAAA,EAAO;AAAA,MACL,MAAA,EAAQ;AAAA,QACN,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,OAAA,EAAS;AAAA,QACP,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,OAAA,EAAS;AAAA,QACP,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,SAAA,EAAW;AAAA,QACT,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,OAAA,EAAS;AAAA,QACP,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,OAAA,EAAS;AAAA,QACP,SAAA,EAAW;AAAA,MACb;AAAA,IACF;AAAA,EACF;AACF,CAAC,CAAA;AA+BD,IAAM,cAAA,EAAgB,CAAC,QAAA,EAAU,CAAA,EAAA,GAAM,CAAA,EAAA;AAKrB;AACJ,EAAA;AACA,EAAA;AACJ,EAAA;AACW,EAAA;AACV,EAAA;AACO,EAAA;AACR,EAAA;AACR,EAAA;AACiB,EAAA;AACV,EAAA;AACE,EAAA;AACU;AAEwB,EAAA;AACvB,EAAA;AACF,IAAA;AAClB,EAAA;AAEoC,EAAA;AACjB,EAAA;AAES,EAAA;AAG1B,EAAA;AAAC,IAAA;AAAA,IAAA;AACa,MAAA;AACZ,MAAA;AACa,MAAA;AACb,MAAA;AACe,MAAA;AACE,MAAA;AACjB,MAAA;AACA,MAAA;AACA,MAAA;AACkB,MAAA;AACO,MAAA;AAAA,IAAA;AAC3B,EAAA;AAEJ;AAEe;ADzCuB;AACA;AEhFvB;AFkFuB;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-VGXW3PSF.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { Progress as HeroProgress } from '@heroui/progress';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\n// progress styling variants\nexport const progressVariants = tv({\n slots: {\n // wrapper around the whole component\n base: '',\n // indicator of the progress (finished part)\n indicator: '',\n // label at the top left of the progress bar\n label: '',\n // wrapper around progress label and label span\n labelWrapper: '',\n // track of the progress (not finished part)\n track: '',\n // span around the progress value\n value: '',\n },\n variants: {\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/progress.ts\n color: {\n danger: {\n indicator: 'bg-danger',\n },\n default: {\n indicator: 'bg-default-400',\n },\n info: {\n indicator: 'bg-info',\n },\n primary: {\n indicator: 'bg-primary',\n },\n secondary: {\n indicator: 'bg-secondary',\n },\n success: {\n indicator: 'bg-success',\n },\n warning: {\n indicator: 'bg-warning',\n },\n },\n },\n});\n\nexport type VariantProps = TVProps<typeof progressVariants>;\ntype ClassName = TVClassName<typeof progressVariants>;\n\nexport interface ProgressProps extends VariantProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** color of the progress bar */\n color?: VariantProps['color'];\n /** disables all animations */\n disableAnimation?: boolean;\n /** function to format the progress value */\n format?: (percent: number) => ReactNode;\n /** shows indeterminate progress animation */\n indeterminate?: boolean;\n /** label of the progress bar */\n label?: ReactNode;\n /** percentage / progress of the progress bar */\n percent: number;\n /** whether to show the value label */\n showValueLabel?: boolean;\n /** size of the progress bar */\n size?: 'sm' | 'md' | 'lg';\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/** formats percent with percent sign */\nconst defaultFormat = (percent = 0) => `${percent}%`;\n\n/**\n * Progress component based on [HeroUI Progress](https://www.heroui.com//docs/components/progress)\n */\nconst Progress = ({\n ariaLabel = 'progress',\n className = undefined,\n color = 'info',\n disableAnimation = false,\n format = defaultFormat,\n indeterminate = false,\n label = undefined,\n percent,\n showValueLabel = false,\n size = 'md',\n testId = undefined,\n}: ProgressProps) => {\n // handle special states\n let progressColor: VariantProps['color'] = color;\n if (percent >= 100) {\n progressColor = 'success';\n }\n\n const variants = progressVariants({ color: progressColor });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n const value = format(percent);\n\n return (\n <HeroProgress\n aria-label={ariaLabel}\n classNames={classNames}\n data-testid={testId}\n disableAnimation={disableAnimation}\n formatOptions={undefined}\n isIndeterminate={indeterminate}\n label={label}\n showValueLabel={showValueLabel}\n size={size}\n value={percent || 0}\n valueLabel={!!percent && value}\n />\n );\n};\n\nexport default Progress;\n","import Progress, { progressVariants } from './Progress';\n\nexport type { ProgressProps } from './Progress';\n\nexport { Progress, progressVariants };\n\nexport default Progress;\n"]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Button_default
3
- } from "./chunk-Q5DUSUCZ.js";
3
+ } from "./chunk-MAKWBTTW.js";
4
4
  import {
5
5
  __commonJS,
6
6
  __toESM
@@ -2709,4 +2709,4 @@ export {
2709
2709
  Json_default,
2710
2710
  Json_default2
2711
2711
  };
2712
- //# sourceMappingURL=chunk-L3DEBOPG.js.map
2712
+ //# sourceMappingURL=chunk-VRPX6QUG.js.map
@@ -0,0 +1,113 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkD4TLDLEXcjs = require('./chunk-D4TLDLEX.cjs');
4
+
5
+ // src/ProgressCircular/ProgressCircular.tsx
6
+ var _fa = require('react-icons/fa');
7
+ var _progress = require('@heroui/progress');
8
+ var _theme = require('@heroui/theme');
9
+ var _pixelutils = require('@fuf-stack/pixel-utils');
10
+ var _jsxruntime = require('react/jsx-runtime');
11
+ var progressCircularVariants = _pixelutils.tv.call(void 0, {
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: _chunkD4TLDLEXcjs.__spreadValues.call(void 0, {
30
+ info: {
31
+ svg: "text-info"
32
+ }
33
+ }, _theme.circularProgress.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 = _pixelutils.variantsToClassNames.call(void 0, variants, className, "base");
76
+ let value = format(percent);
77
+ let progressColor = color;
78
+ if (hasError) {
79
+ progressColor = "danger";
80
+ value = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _fa.FaTimes, { className: "text-danger" });
81
+ } else if (percent >= 100) {
82
+ progressColor = "success";
83
+ value = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _fa.FaCheck, { className: "text-success" });
84
+ }
85
+ const heroUiColor = Object.keys(
86
+ _theme.circularProgress.variants.color
87
+ ).includes(color) ? progressColor : void 0;
88
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
89
+ _progress.CircularProgress,
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
+
109
+
110
+
111
+
112
+ exports.progressCircularVariants = progressCircularVariants; exports.ProgressCircular_default = ProgressCircular_default; exports.ProgressCircular_default2 = ProgressCircular_default2;
113
+ //# sourceMappingURL=chunk-WCRVH4DS.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-WCRVH4DS.cjs","../src/ProgressCircular/ProgressCircular.tsx","../src/ProgressCircular/index.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACAA,oCAAiC;AAEjC,4CAAyD;AACzD,sCAAiE;AAEjE,oDAAyC;AAyG7B,+CAAA;AAvGL,IAAM,yBAAA,EAA2B,4BAAA;AAAG,EACzC,KAAA,EAAO;AAAA;AAAA,IAEL,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;AAGO,EAAA;AAGiB,EAAA;AAC7B,EAAA;AACI,IAAA;AACP,IAAA;AACgB,EAAA;AACT,IAAA;AACP,IAAA;AACX,EAAA;AAG2B,EAAA;AACI,IAAA;AAG3B,EAAA;AAGF,EAAA;AAAC,IAAA;AAAA,IAAA;AACa,MAAA;AACZ,MAAA;AACO,MAAA;AACP,MAAA;AACe,MAAA;AACD,MAAA;AACD,MAAA;AAEK,MAAA;AACN,MAAA;AAAA,IAAA;AACd,EAAA;AAEJ;AAEe;ADxCuB;AACA;AElGvB;AFoGuB;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-WCRVH4DS.cjs","sourcesContent":[null,"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"]}