@fuf-stack/pixels 1.3.0 → 1.3.2

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.
@@ -2,12 +2,12 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkIY2NXW6Xcjs = require('../chunk-IY2NXW6X.cjs');
6
- require('../chunk-OLI32URU.cjs');
5
+ var _chunkKM3PZ3GHcjs = require('../chunk-KM3PZ3GH.cjs');
6
+ require('../chunk-7ZIK4LWC.cjs');
7
7
  require('../chunk-AHEA4IJV.cjs');
8
8
 
9
9
 
10
10
 
11
11
 
12
- exports.Progress = _chunkIY2NXW6Xcjs.Progress_default; exports.default = _chunkIY2NXW6Xcjs.Progress_default2; exports.progressVariants = _chunkIY2NXW6Xcjs.progressVariants;
12
+ exports.Progress = _chunkKM3PZ3GHcjs.Progress_default; exports.default = _chunkKM3PZ3GHcjs.Progress_default2; exports.progressVariants = _chunkKM3PZ3GHcjs.progressVariants;
13
13
  //# sourceMappingURL=index.cjs.map
@@ -2,8 +2,8 @@ import {
2
2
  Progress_default,
3
3
  Progress_default2,
4
4
  progressVariants
5
- } from "../chunk-TYY3HIYL.js";
6
- import "../chunk-B3XKBNXD.js";
5
+ } from "../chunk-EYUII2LV.js";
6
+ import "../chunk-VTSVKRA7.js";
7
7
  import "../chunk-OAIRL2FN.js";
8
8
  export {
9
9
  Progress_default as Progress,
@@ -2,12 +2,12 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkAZ7VMRHXcjs = require('../chunk-AZ7VMRHX.cjs');
6
- require('../chunk-OLI32URU.cjs');
5
+ var _chunkRZGLEDWNcjs = require('../chunk-RZGLEDWN.cjs');
6
+ require('../chunk-7ZIK4LWC.cjs');
7
7
  require('../chunk-AHEA4IJV.cjs');
8
8
 
9
9
 
10
10
 
11
11
 
12
- exports.ProgressCircular = _chunkAZ7VMRHXcjs.ProgressCircular_default; exports.default = _chunkAZ7VMRHXcjs.ProgressCircular_default2; exports.progressCircularVariants = _chunkAZ7VMRHXcjs.progressCircularVariants;
12
+ exports.ProgressCircular = _chunkRZGLEDWNcjs.ProgressCircular_default; exports.default = _chunkRZGLEDWNcjs.ProgressCircular_default2; exports.progressCircularVariants = _chunkRZGLEDWNcjs.progressCircularVariants;
13
13
  //# sourceMappingURL=index.cjs.map
@@ -2,8 +2,8 @@ import {
2
2
  ProgressCircular_default,
3
3
  ProgressCircular_default2,
4
4
  progressCircularVariants
5
- } from "../chunk-2O3IUQR4.js";
6
- import "../chunk-B3XKBNXD.js";
5
+ } from "../chunk-FFNMGR72.js";
6
+ import "../chunk-VTSVKRA7.js";
7
7
  import "../chunk-OAIRL2FN.js";
8
8
  export {
9
9
  ProgressCircular_default as ProgressCircular,
@@ -1,6 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-AHEA4IJV.cjs');
2
2
 
3
3
  // src/SearchInput/SearchInput.tsx
4
+ var _react = require('react');
4
5
  var _fa = require('react-icons/fa');
5
6
  var _input = require('@heroui/input');
6
7
  var _pixelutils = require('@fuf-stack/pixel-utils');
@@ -19,26 +20,32 @@ var inputVariants = _pixelutils.tv.call(void 0, {
19
20
  });
20
21
  var SearchInput = ({
21
22
  className: _className = void 0,
22
- clearable = false,
23
23
  disabled = false,
24
24
  endContent = void 0,
25
25
  onChange,
26
- onClear = void 0,
27
26
  placeholder = void 0,
28
27
  size = void 0,
29
28
  startContent = void 0,
30
29
  testId = void 0,
31
- value = void 0
30
+ initialValue = void 0
32
31
  }) => {
32
+ const [value, setValue] = _react.useState.call(void 0, initialValue != null ? initialValue : "");
33
+ const handleChange = (e) => {
34
+ var _a, _b, _c, _d;
35
+ setValue((_b = (_a = e == null ? void 0 : e.target) == null ? void 0 : _a.value) != null ? _b : "");
36
+ onChange((_d = (_c = e == null ? void 0 : e.target) == null ? void 0 : _c.value) != null ? _d : null);
37
+ };
33
38
  const variants = inputVariants();
34
39
  const classNames = _pixelutils.variantsToClassNames.call(void 0, variants, _className, "base");
35
40
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
36
41
  _input.Input,
37
42
  {
43
+ isClearable: true,
38
44
  "data-testid": testId ? _pixelutils.slugify.call(void 0, testId) : void 0,
39
45
  endContent,
40
- isClearable: clearable,
41
46
  isDisabled: disabled,
47
+ onChange: handleChange,
48
+ onClear: handleChange,
42
49
  placeholder,
43
50
  radius: "sm",
44
51
  size,
@@ -50,13 +57,7 @@ var SearchInput = ({
50
57
  clearButton: classNames.clearButton,
51
58
  input: classNames.input,
52
59
  inputWrapper: classNames.inputWrapper
53
- },
54
- onChange: (e) => {
55
- onChange(e.target.value);
56
- },
57
- onClear: onClear ? () => {
58
- onClear();
59
- } : void 0
60
+ }
60
61
  }
61
62
  );
62
63
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/SearchInput/index.cjs","../../src/SearchInput/SearchInput.tsx","../../src/SearchInput/index.ts"],"names":["SearchInput_default"],"mappings":"AAAA,0GAA8B;AAC9B;AACA;ACCA,oCAAyB;AAEzB,sCAAmC;AAEnC,oDAAkD;AAyEd,+CAAA;AAtE7B,IAAM,cAAA,EAAgB,4BAAA;AAAG,EAC9B,KAAA,EAAO;AAAA;AAAA,IAEL,IAAA,EAAM,EAAA;AAAA;AAAA,IAEN,WAAA,EAAa,EAAA;AAAA;AAAA,IAEb,KAAA,EAAO,EAAA;AAAA;AAAA,IAEP,YAAA,EAAc;AAAA,EAChB;AACF,CAAC,CAAA;AAiCD,IAAM,YAAA,EAAc,CAAC;AAAA,EACnB,SAAA,EAAW,WAAA,EAAa,KAAA,CAAA;AAAA,EACxB,UAAA,EAAY,KAAA;AAAA,EACZ,SAAA,EAAW,KAAA;AAAA,EACX,WAAA,EAAa,KAAA,CAAA;AAAA,EACb,QAAA;AAAA,EACA,QAAA,EAAU,KAAA,CAAA;AAAA,EACV,YAAA,EAAc,KAAA,CAAA;AAAA,EACd,KAAA,EAAO,KAAA,CAAA;AAAA,EACP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A;AF4Df;AACE;AACA;AACF,kFAAC","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/SearchInput/index.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { FaSearch } from 'react-icons/fa';\n\nimport { Input as HeroInput } from '@heroui/input';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\n// input variants\nexport const inputVariants = tv({\n slots: {\n /** wrapper around the whole input */\n base: '',\n /** clear button */\n clearButton: '',\n /** actual input element */\n input: '',\n /** inner wrapper (HeroUI inputWrapper slot) */\n inputWrapper: 'bg-content1 group-data-[focus=true]:border-focus',\n },\n});\n\ntype VariantProps = TVProps<typeof inputVariants>;\ntype ClassName = TVClassName<typeof inputVariants>;\n\nexport interface SearchInputProps extends VariantProps {\n /** CSS class name */\n className?: ClassName;\n /** shows clear button when input has value */\n clearable?: boolean;\n /** input field is disabled */\n disabled?: boolean;\n /** added content to the end of the input Field. */\n endContent?: ReactNode;\n /** callback that is fired when the value is cleared */\n onClear?: () => void;\n /** callback that is fired when the value is changed */\n onChange: (value?: string) => void;\n /** form field placeholder */\n placeholder?: string;\n /** size of the input */\n size?: 'sm' | 'md' | 'lg';\n /** content added to the start of the input field */\n startContent?: ReactNode;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** value of the input */\n value?: string;\n}\n\n/**\n * SearchInput component based on [HeroUI Input](https://www.heroui.com//docs/components/input)\n */\nconst SearchInput = ({\n className: _className = undefined,\n clearable = false,\n disabled = false,\n endContent = undefined,\n onChange,\n onClear = undefined,\n placeholder = undefined,\n size = undefined,\n startContent = undefined,\n testId = undefined,\n value = undefined,\n}: SearchInputProps) => {\n // classNames from slots\n const variants = inputVariants();\n const classNames = variantsToClassNames(variants, _className, 'base');\n\n return (\n <HeroInput\n data-testid={testId ? slugify(testId) : undefined}\n endContent={endContent}\n isClearable={clearable}\n isDisabled={disabled}\n placeholder={placeholder}\n radius=\"sm\"\n size={size}\n startContent={startContent ?? <FaSearch className=\"opacity-50\" />}\n value={value}\n variant=\"bordered\"\n classNames={{\n base: classNames.base,\n clearButton: classNames.clearButton,\n input: classNames.input,\n inputWrapper: classNames.inputWrapper,\n }}\n onChange={(e) => {\n onChange(e.target.value);\n }}\n onClear={\n onClear\n ? () => {\n onClear();\n }\n : undefined\n }\n />\n );\n};\n\nexport default SearchInput;\n","import SearchInput from './SearchInput';\n\nexport type { SearchInputProps } from './SearchInput';\n\nexport { SearchInput };\n\nexport default SearchInput;\n"]}
1
+ {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/SearchInput/index.cjs","../../src/SearchInput/SearchInput.tsx","../../src/SearchInput/index.ts"],"names":["SearchInput_default"],"mappings":"AAAA,0GAA8B;AAC9B;AACA;ACCA,8BAAyB;AACzB,oCAAyB;AAEzB,sCAAmC;AAEnC,oDAAkD;AA6Ed,+CAAA;AA1E7B,IAAM,cAAA,EAAgB,4BAAA;AAAG,EAC9B,KAAA,EAAO;AAAA;AAAA,IAEL,IAAA,EAAM,EAAA;AAAA;AAAA,IAEN,WAAA,EAAa,EAAA;AAAA;AAAA,IAEb,KAAA,EAAO,EAAA;AAAA;AAAA,IAEP,YAAA,EAAc;AAAA,EAChB;AACF,CAAC,CAAA;AA6BD,IAAM,YAAA,EAAc,CAAC;AAAA,EACnB,SAAA,EAAW,WAAA,EAAa,KAAA,CAAA;AAAA,EACxB,SAAA,EAAW,KAAA;AAAA,EACX,WAAA,EAAa,KAAA,CAAA;AAAA,EACb,QAAA;AAAA,EACA,YAAA,EAAc,KAAA,CAAA;AAAA,EACd,KAAA,EAAO,KAAA,CAAA;AAAA,EACP,aAAA,EAAe,KAAA,CAAA;AAAA,EACf,OAAA,EAAS,KAAA,CAAA;AAAA,EACT,aAAA,EAAe,KAAA;AACjB,CAAA,EAAA,GAAwB;AAEtB,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,EAAA,EAAI,6BAAA,aAAS,GAA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A,OAAA,EAAQ,UAAA;AAAA,MACR,UAAA,EAAY;AAAA,QACV,IAAA,EAAM,UAAA,CAAW,IAAA;AAAA,QACjB,WAAA,EAAa,UAAA,CAAW,WAAA;AAAA,QACxB,KAAA,EAAO,UAAA,CAAW,KAAA;AAAA,QAClB,YAAA,EAAc,UAAA,CAAW;AAAA,MAC3B;AAAA,IAAA;AAAA,EACF,CAAA;AAEJ,CAAA;AAEA,IAAO,oBAAA,EAAQ,WAAA;ADlCf;AACA;AE3DA,IAAOA,qBAAAA,EAAQ,mBAAA;AF6Df;AACE;AACA;AACF,kFAAC","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/SearchInput/index.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ChangeEvent, ReactNode } from 'react';\n\nimport { useState } from 'react';\nimport { FaSearch } from 'react-icons/fa';\n\nimport { Input as HeroInput } from '@heroui/input';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\n// input variants\nexport const inputVariants = tv({\n slots: {\n /** wrapper around the whole input */\n base: '',\n /** clear button */\n clearButton: '',\n /** actual input element */\n input: '',\n /** inner wrapper (HeroUI inputWrapper slot) */\n inputWrapper: 'bg-content1 group-data-[focus=true]:border-focus',\n },\n});\n\ntype VariantProps = TVProps<typeof inputVariants>;\ntype ClassName = TVClassName<typeof inputVariants>;\n\nexport interface SearchInputProps extends VariantProps {\n /** CSS class name */\n className?: ClassName;\n /** input field is disabled */\n disabled?: boolean;\n /** added content to the end of the input Field. */\n endContent?: ReactNode;\n /** optional initial value of the input */\n initialValue?: string;\n /** callback that is fired when the value is changed or cleared */\n onChange: (value: string | null) => void;\n /** form field placeholder */\n placeholder?: string;\n /** size of the input */\n size?: 'sm' | 'md' | 'lg';\n /** content added to the start of the input field */\n startContent?: ReactNode;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * SearchInput component based on [HeroUI Input](https://www.heroui.com//docs/components/input)\n */\nconst SearchInput = ({\n className: _className = undefined,\n disabled = false,\n endContent = undefined,\n onChange,\n placeholder = undefined,\n size = undefined,\n startContent = undefined,\n testId = undefined,\n initialValue = undefined,\n}: SearchInputProps) => {\n // handle controlled value with initial value\n const [value, setValue] = useState(initialValue ?? '');\n\n const handleChange = (e?: ChangeEvent<HTMLInputElement>) => {\n setValue(e?.target?.value ?? '');\n onChange(e?.target?.value ?? null);\n };\n\n // classNames from slots\n const variants = inputVariants();\n const classNames = variantsToClassNames(variants, _className, 'base');\n\n return (\n <HeroInput\n isClearable\n data-testid={testId ? slugify(testId) : undefined}\n endContent={endContent}\n isDisabled={disabled}\n onChange={handleChange}\n onClear={handleChange}\n placeholder={placeholder}\n radius=\"sm\"\n size={size}\n startContent={startContent ?? <FaSearch className=\"opacity-50\" />}\n value={value}\n variant=\"bordered\"\n classNames={{\n base: classNames.base,\n clearButton: classNames.clearButton,\n input: classNames.input,\n inputWrapper: classNames.inputWrapper,\n }}\n />\n );\n};\n\nexport default SearchInput;\n","import SearchInput from './SearchInput';\n\nexport type { SearchInputProps } from './SearchInput';\n\nexport { SearchInput };\n\nexport default SearchInput;\n"]}
@@ -63,16 +63,14 @@ type ClassName = TVClassName<typeof inputVariants>;
63
63
  interface SearchInputProps extends VariantProps {
64
64
  /** CSS class name */
65
65
  className?: ClassName;
66
- /** shows clear button when input has value */
67
- clearable?: boolean;
68
66
  /** input field is disabled */
69
67
  disabled?: boolean;
70
68
  /** added content to the end of the input Field. */
71
69
  endContent?: ReactNode;
72
- /** callback that is fired when the value is cleared */
73
- onClear?: () => void;
74
- /** callback that is fired when the value is changed */
75
- onChange: (value?: string) => void;
70
+ /** optional initial value of the input */
71
+ initialValue?: string;
72
+ /** callback that is fired when the value is changed or cleared */
73
+ onChange: (value: string | null) => void;
76
74
  /** form field placeholder */
77
75
  placeholder?: string;
78
76
  /** size of the input */
@@ -81,12 +79,10 @@ interface SearchInputProps extends VariantProps {
81
79
  startContent?: ReactNode;
82
80
  /** HTML data-testid attribute used in e2e tests */
83
81
  testId?: string;
84
- /** value of the input */
85
- value?: string;
86
82
  }
87
83
  /**
88
84
  * SearchInput component based on [HeroUI Input](https://www.heroui.com//docs/components/input)
89
85
  */
90
- declare const SearchInput: ({ className: _className, clearable, disabled, endContent, onChange, onClear, placeholder, size, startContent, testId, value, }: SearchInputProps) => react_jsx_runtime.JSX.Element;
86
+ declare const SearchInput: ({ className: _className, disabled, endContent, onChange, placeholder, size, startContent, testId, initialValue, }: SearchInputProps) => react_jsx_runtime.JSX.Element;
91
87
 
92
88
  export { SearchInput, type SearchInputProps, SearchInput as default };
@@ -63,16 +63,14 @@ type ClassName = TVClassName<typeof inputVariants>;
63
63
  interface SearchInputProps extends VariantProps {
64
64
  /** CSS class name */
65
65
  className?: ClassName;
66
- /** shows clear button when input has value */
67
- clearable?: boolean;
68
66
  /** input field is disabled */
69
67
  disabled?: boolean;
70
68
  /** added content to the end of the input Field. */
71
69
  endContent?: ReactNode;
72
- /** callback that is fired when the value is cleared */
73
- onClear?: () => void;
74
- /** callback that is fired when the value is changed */
75
- onChange: (value?: string) => void;
70
+ /** optional initial value of the input */
71
+ initialValue?: string;
72
+ /** callback that is fired when the value is changed or cleared */
73
+ onChange: (value: string | null) => void;
76
74
  /** form field placeholder */
77
75
  placeholder?: string;
78
76
  /** size of the input */
@@ -81,12 +79,10 @@ interface SearchInputProps extends VariantProps {
81
79
  startContent?: ReactNode;
82
80
  /** HTML data-testid attribute used in e2e tests */
83
81
  testId?: string;
84
- /** value of the input */
85
- value?: string;
86
82
  }
87
83
  /**
88
84
  * SearchInput component based on [HeroUI Input](https://www.heroui.com//docs/components/input)
89
85
  */
90
- declare const SearchInput: ({ className: _className, clearable, disabled, endContent, onChange, onClear, placeholder, size, startContent, testId, value, }: SearchInputProps) => react_jsx_runtime.JSX.Element;
86
+ declare const SearchInput: ({ className: _className, disabled, endContent, onChange, placeholder, size, startContent, testId, initialValue, }: SearchInputProps) => react_jsx_runtime.JSX.Element;
91
87
 
92
88
  export { SearchInput, type SearchInputProps, SearchInput as default };
@@ -1,6 +1,7 @@
1
1
  import "../chunk-OAIRL2FN.js";
2
2
 
3
3
  // src/SearchInput/SearchInput.tsx
4
+ import { useState } from "react";
4
5
  import { FaSearch } from "react-icons/fa";
5
6
  import { Input as HeroInput } from "@heroui/input";
6
7
  import { slugify, tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
@@ -19,26 +20,32 @@ var inputVariants = tv({
19
20
  });
20
21
  var SearchInput = ({
21
22
  className: _className = void 0,
22
- clearable = false,
23
23
  disabled = false,
24
24
  endContent = void 0,
25
25
  onChange,
26
- onClear = void 0,
27
26
  placeholder = void 0,
28
27
  size = void 0,
29
28
  startContent = void 0,
30
29
  testId = void 0,
31
- value = void 0
30
+ initialValue = void 0
32
31
  }) => {
32
+ const [value, setValue] = useState(initialValue != null ? initialValue : "");
33
+ const handleChange = (e) => {
34
+ var _a, _b, _c, _d;
35
+ setValue((_b = (_a = e == null ? void 0 : e.target) == null ? void 0 : _a.value) != null ? _b : "");
36
+ onChange((_d = (_c = e == null ? void 0 : e.target) == null ? void 0 : _c.value) != null ? _d : null);
37
+ };
33
38
  const variants = inputVariants();
34
39
  const classNames = variantsToClassNames(variants, _className, "base");
35
40
  return /* @__PURE__ */ jsx(
36
41
  HeroInput,
37
42
  {
43
+ isClearable: true,
38
44
  "data-testid": testId ? slugify(testId) : void 0,
39
45
  endContent,
40
- isClearable: clearable,
41
46
  isDisabled: disabled,
47
+ onChange: handleChange,
48
+ onClear: handleChange,
42
49
  placeholder,
43
50
  radius: "sm",
44
51
  size,
@@ -50,13 +57,7 @@ var SearchInput = ({
50
57
  clearButton: classNames.clearButton,
51
58
  input: classNames.input,
52
59
  inputWrapper: classNames.inputWrapper
53
- },
54
- onChange: (e) => {
55
- onChange(e.target.value);
56
- },
57
- onClear: onClear ? () => {
58
- onClear();
59
- } : void 0
60
+ }
60
61
  }
61
62
  );
62
63
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/SearchInput/SearchInput.tsx","../../src/SearchInput/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { FaSearch } from 'react-icons/fa';\n\nimport { Input as HeroInput } from '@heroui/input';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\n// input variants\nexport const inputVariants = tv({\n slots: {\n /** wrapper around the whole input */\n base: '',\n /** clear button */\n clearButton: '',\n /** actual input element */\n input: '',\n /** inner wrapper (HeroUI inputWrapper slot) */\n inputWrapper: 'bg-content1 group-data-[focus=true]:border-focus',\n },\n});\n\ntype VariantProps = TVProps<typeof inputVariants>;\ntype ClassName = TVClassName<typeof inputVariants>;\n\nexport interface SearchInputProps extends VariantProps {\n /** CSS class name */\n className?: ClassName;\n /** shows clear button when input has value */\n clearable?: boolean;\n /** input field is disabled */\n disabled?: boolean;\n /** added content to the end of the input Field. */\n endContent?: ReactNode;\n /** callback that is fired when the value is cleared */\n onClear?: () => void;\n /** callback that is fired when the value is changed */\n onChange: (value?: string) => void;\n /** form field placeholder */\n placeholder?: string;\n /** size of the input */\n size?: 'sm' | 'md' | 'lg';\n /** content added to the start of the input field */\n startContent?: ReactNode;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** value of the input */\n value?: string;\n}\n\n/**\n * SearchInput component based on [HeroUI Input](https://www.heroui.com//docs/components/input)\n */\nconst SearchInput = ({\n className: _className = undefined,\n clearable = false,\n disabled = false,\n endContent = undefined,\n onChange,\n onClear = undefined,\n placeholder = undefined,\n size = undefined,\n startContent = undefined,\n testId = undefined,\n value = undefined,\n}: SearchInputProps) => {\n // classNames from slots\n const variants = inputVariants();\n const classNames = variantsToClassNames(variants, _className, 'base');\n\n return (\n <HeroInput\n data-testid={testId ? slugify(testId) : undefined}\n endContent={endContent}\n isClearable={clearable}\n isDisabled={disabled}\n placeholder={placeholder}\n radius=\"sm\"\n size={size}\n startContent={startContent ?? <FaSearch className=\"opacity-50\" />}\n value={value}\n variant=\"bordered\"\n classNames={{\n base: classNames.base,\n clearButton: classNames.clearButton,\n input: classNames.input,\n inputWrapper: classNames.inputWrapper,\n }}\n onChange={(e) => {\n onChange(e.target.value);\n }}\n onClear={\n onClear\n ? () => {\n onClear();\n }\n : undefined\n }\n />\n );\n};\n\nexport default SearchInput;\n","import SearchInput from './SearchInput';\n\nexport type { SearchInputProps } from './SearchInput';\n\nexport { SearchInput };\n\nexport default SearchInput;\n"],"mappings":";;;AAGA,SAAS,gBAAgB;AAEzB,SAAS,SAAS,iBAAiB;AAEnC,SAAS,SAAS,IAAI,4BAA4B;AAyEd;AAtE7B,IAAM,gBAAgB,GAAG;AAAA,EAC9B,OAAO;AAAA;AAAA,IAEL,MAAM;AAAA;AAAA,IAEN,aAAa;AAAA;AAAA,IAEb,OAAO;AAAA;AAAA,IAEP,cAAc;AAAA,EAChB;AACF,CAAC;AAiCD,IAAM,cAAc,CAAC;AAAA,EACnB,WAAW,aAAa;AAAA,EACxB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,aAAa;AAAA,EACb;AAAA,EACA,UAAU;AAAA,EACV,cAAc;AAAA,EACd,OAAO;AAAA,EACP,eAAe;AAAA,EACf,SAAS;AAAA,EACT,QAAQ;AACV,MAAwB;AAEtB,QAAM,WAAW,cAAc;AAC/B,QAAM,aAAa,qBAAqB,UAAU,YAAY,MAAM;AAEpE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,SAAS,QAAQ,MAAM,IAAI;AAAA,MACxC;AAAA,MACA,aAAa;AAAA,MACb,YAAY;AAAA,MACZ;AAAA,MACA,QAAO;AAAA,MACP;AAAA,MACA,cAAc,sCAAgB,oBAAC,YAAS,WAAU,cAAa;AAAA,MAC/D;AAAA,MACA,SAAQ;AAAA,MACR,YAAY;AAAA,QACV,MAAM,WAAW;AAAA,QACjB,aAAa,WAAW;AAAA,QACxB,OAAO,WAAW;AAAA,QAClB,cAAc,WAAW;AAAA,MAC3B;AAAA,MACA,UAAU,CAAC,MAAM;AACf,iBAAS,EAAE,OAAO,KAAK;AAAA,MACzB;AAAA,MACA,SACE,UACI,MAAM;AACJ,gBAAQ;AAAA,MACV,IACA;AAAA;AAAA,EAER;AAEJ;AAEA,IAAO,sBAAQ;;;ACjGf,IAAOA,uBAAQ;","names":["SearchInput_default"]}
1
+ {"version":3,"sources":["../../src/SearchInput/SearchInput.tsx","../../src/SearchInput/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ChangeEvent, ReactNode } from 'react';\n\nimport { useState } from 'react';\nimport { FaSearch } from 'react-icons/fa';\n\nimport { Input as HeroInput } from '@heroui/input';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\n// input variants\nexport const inputVariants = tv({\n slots: {\n /** wrapper around the whole input */\n base: '',\n /** clear button */\n clearButton: '',\n /** actual input element */\n input: '',\n /** inner wrapper (HeroUI inputWrapper slot) */\n inputWrapper: 'bg-content1 group-data-[focus=true]:border-focus',\n },\n});\n\ntype VariantProps = TVProps<typeof inputVariants>;\ntype ClassName = TVClassName<typeof inputVariants>;\n\nexport interface SearchInputProps extends VariantProps {\n /** CSS class name */\n className?: ClassName;\n /** input field is disabled */\n disabled?: boolean;\n /** added content to the end of the input Field. */\n endContent?: ReactNode;\n /** optional initial value of the input */\n initialValue?: string;\n /** callback that is fired when the value is changed or cleared */\n onChange: (value: string | null) => void;\n /** form field placeholder */\n placeholder?: string;\n /** size of the input */\n size?: 'sm' | 'md' | 'lg';\n /** content added to the start of the input field */\n startContent?: ReactNode;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * SearchInput component based on [HeroUI Input](https://www.heroui.com//docs/components/input)\n */\nconst SearchInput = ({\n className: _className = undefined,\n disabled = false,\n endContent = undefined,\n onChange,\n placeholder = undefined,\n size = undefined,\n startContent = undefined,\n testId = undefined,\n initialValue = undefined,\n}: SearchInputProps) => {\n // handle controlled value with initial value\n const [value, setValue] = useState(initialValue ?? '');\n\n const handleChange = (e?: ChangeEvent<HTMLInputElement>) => {\n setValue(e?.target?.value ?? '');\n onChange(e?.target?.value ?? null);\n };\n\n // classNames from slots\n const variants = inputVariants();\n const classNames = variantsToClassNames(variants, _className, 'base');\n\n return (\n <HeroInput\n isClearable\n data-testid={testId ? slugify(testId) : undefined}\n endContent={endContent}\n isDisabled={disabled}\n onChange={handleChange}\n onClear={handleChange}\n placeholder={placeholder}\n radius=\"sm\"\n size={size}\n startContent={startContent ?? <FaSearch className=\"opacity-50\" />}\n value={value}\n variant=\"bordered\"\n classNames={{\n base: classNames.base,\n clearButton: classNames.clearButton,\n input: classNames.input,\n inputWrapper: classNames.inputWrapper,\n }}\n />\n );\n};\n\nexport default SearchInput;\n","import SearchInput from './SearchInput';\n\nexport type { SearchInputProps } from './SearchInput';\n\nexport { SearchInput };\n\nexport default SearchInput;\n"],"mappings":";;;AAGA,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AAEzB,SAAS,SAAS,iBAAiB;AAEnC,SAAS,SAAS,IAAI,4BAA4B;AA6Ed;AA1E7B,IAAM,gBAAgB,GAAG;AAAA,EAC9B,OAAO;AAAA;AAAA,IAEL,MAAM;AAAA;AAAA,IAEN,aAAa;AAAA;AAAA,IAEb,OAAO;AAAA;AAAA,IAEP,cAAc;AAAA,EAChB;AACF,CAAC;AA6BD,IAAM,cAAc,CAAC;AAAA,EACnB,WAAW,aAAa;AAAA,EACxB,WAAW;AAAA,EACX,aAAa;AAAA,EACb;AAAA,EACA,cAAc;AAAA,EACd,OAAO;AAAA,EACP,eAAe;AAAA,EACf,SAAS;AAAA,EACT,eAAe;AACjB,MAAwB;AAEtB,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,sCAAgB,EAAE;AAErD,QAAM,eAAe,CAAC,MAAsC;AAjE9D;AAkEI,cAAS,kCAAG,WAAH,mBAAW,UAAX,YAAoB,EAAE;AAC/B,cAAS,kCAAG,WAAH,mBAAW,UAAX,YAAoB,IAAI;AAAA,EACnC;AAGA,QAAM,WAAW,cAAc;AAC/B,QAAM,aAAa,qBAAqB,UAAU,YAAY,MAAM;AAEpE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAW;AAAA,MACX,eAAa,SAAS,QAAQ,MAAM,IAAI;AAAA,MACxC;AAAA,MACA,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,SAAS;AAAA,MACT;AAAA,MACA,QAAO;AAAA,MACP;AAAA,MACA,cAAc,sCAAgB,oBAAC,YAAS,WAAU,cAAa;AAAA,MAC/D;AAAA,MACA,SAAQ;AAAA,MACR,YAAY;AAAA,QACV,MAAM,WAAW;AAAA,QACjB,aAAa,WAAW;AAAA,QACxB,OAAO,WAAW;AAAA,QAClB,cAAc,WAAW;AAAA,MAC3B;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,sBAAQ;;;AC5Ff,IAAOA,uBAAQ;","names":["SearchInput_default"]}
@@ -80,4 +80,4 @@ var useLocalStorage = (key, initialValue) => {
80
80
 
81
81
 
82
82
  exports.useDebounce = useDebounce; exports.useIsInitialRenderCycle = useIsInitialRenderCycle; exports.useLocalStorage = useLocalStorage;
83
- //# sourceMappingURL=chunk-OLI32URU.cjs.map
83
+ //# sourceMappingURL=chunk-7ZIK4LWC.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-7ZIK4LWC.cjs","../src/hooks/useDebounce.ts","../src/hooks/useIsInitialRenderCycle.ts","../src/hooks/useLocalStorage.ts"],"names":["useEffect","useState"],"mappings":"AAAA;ACEA,8BAAoC;AAE7B,IAAM,YAAA,EAAc,CAAQ,KAAA,EAAc,KAAA,EAAA,GAAkB;AAEjE,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,EAAA,EAAI,6BAAA,KAAc,CAAA;AAC1D,EAAA,8BAAA;AAAA,IACE,CAAA,EAAA,GAAM;AAEJ,MAAA,MAAM,QA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CAAO,mBAAA,CAAoB,SAAA,EAAW,mBAAmB,CAAA;AACzD,MAAA,MAAA,CAAO,mBAAA,CAAoB,eAAA,EAAiB,mBAAmB,CAAA;AAAA,IACjE,CAAA;AAAA,EAEF,CAAA,EAAG,CAAC,CAAC,CAAA;AAEL,EAAA,OAAO,CAAC,WAAA,EAAa,QAAQ,CAAA;AAC/B,CAAA;AHNA;AACA;AACE;AACA;AACA;AACF,wIAAC","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-7ZIK4LWC.cjs","sourcesContent":[null,"/* eslint-disable import-x/prefer-default-export */\n\nimport { useEffect, useState } from 'react';\n\nexport const useDebounce = <Value>(value: Value, delay: number) => {\n // State and setters for debounced value\n const [debouncedValue, setDebouncedValue] = useState(value);\n useEffect(\n () => {\n // Update debounced value after delay\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n // Cancel the timeout if value changes (also on delay change or unmount)\n // This is how we prevent debounced value from updating if value is changed ...\n // .. within the delay period. Timeout gets cleared and restarted.\n return () => {\n clearTimeout(handler);\n };\n },\n [value, delay], // Only re-call effect if value or delay changes\n );\n return debouncedValue;\n};\n","/* eslint-disable import/prefer-default-export */\n\nimport { useEffect, useRef } from 'react';\n\n/**\n * A hook that returns true on initial render and false afterward.\n *\n * @returns {boolean} - True on initial render, false afterward\n */\nexport const useIsInitialRenderCycle = (): boolean => {\n // Use ref to avoid re-renders\n const isInitialRender = useRef(true);\n\n // Update ref after first render\n useEffect(() => {\n // Set to false after component mounts\n isInitialRender.current = false;\n\n // No cleanup needed for this effect\n }, []);\n\n return isInitialRender.current;\n};\n","/* eslint-disable import/prefer-default-export */\n\nimport type { Dispatch, SetStateAction } from 'react';\n\nimport { useEffect, useState } from 'react';\n\nexport const useLocalStorage = <T>(\n key: string,\n initialValue: T | (() => T),\n): [T, Dispatch<SetStateAction<T>>] => {\n // Get from local storage then\n // parse stored json or return initialValue\n const readValue = () => {\n // Prevent build error \"window is undefined\" but keep keep working\n if (typeof window === 'undefined') {\n return initialValue;\n }\n\n try {\n const item = window.localStorage.getItem(key);\n return item ? JSON.parse(item) : initialValue;\n } catch (error) {\n console.warn(`Error reading localStorage key “${key}”:`, error);\n return initialValue;\n }\n };\n\n // State to store our value\n // Pass initial state function to useState so logic is only executed once\n const [storedValue, setStoredValue] = useState<T>(readValue);\n\n // Return a wrapped version of useState's setter function that ...\n // ... persists the new value to localStorage.\n const setValue: Dispatch<SetStateAction<T>> = (value) => {\n // Prevent build error \"window is undefined\" but keeps working\n if (typeof window === 'undefined') {\n console.warn(\n `Tried setting localStorage key “${key}” even though environment is not a client`,\n );\n }\n\n try {\n // Allow value to be a function so we have the same API as useState\n const newValue = value instanceof Function ? value(storedValue) : value;\n\n // Save to local storage\n window.localStorage.setItem(key, JSON.stringify(newValue));\n\n // Save state\n setStoredValue(newValue);\n\n // We dispatch a custom event so every useLocalStorage hook are notified\n window.dispatchEvent(new Event('local-storage'));\n } catch (error) {\n console.warn(`Error setting localStorage key “${key}”:`, error);\n }\n };\n\n useEffect(() => {\n setStoredValue(readValue());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const handleStorageChange = () => {\n setStoredValue(readValue());\n };\n\n // this only works for other documents, not the current one\n window.addEventListener('storage', handleStorageChange);\n\n // this is a custom event, triggered in writeValueToLocalStorage\n window.addEventListener('local-storage', handleStorageChange);\n\n return () => {\n window.removeEventListener('storage', handleStorageChange);\n window.removeEventListener('local-storage', handleStorageChange);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return [storedValue, setValue];\n};\n"]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useIsInitialRenderCycle
3
- } from "./chunk-B3XKBNXD.js";
3
+ } from "./chunk-VTSVKRA7.js";
4
4
 
5
5
  // src/Progress/Progress.tsx
6
6
  import { Progress as HeroProgress } from "@heroui/progress";
@@ -100,4 +100,4 @@ export {
100
100
  Progress_default,
101
101
  Progress_default2
102
102
  };
103
- //# sourceMappingURL=chunk-TYY3HIYL.js.map
103
+ //# sourceMappingURL=chunk-EYUII2LV.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useIsInitialRenderCycle
3
- } from "./chunk-B3XKBNXD.js";
3
+ } from "./chunk-VTSVKRA7.js";
4
4
  import {
5
5
  __spreadValues
6
6
  } from "./chunk-OAIRL2FN.js";
@@ -142,4 +142,4 @@ export {
142
142
  ProgressCircular_default,
143
143
  ProgressCircular_default2
144
144
  };
145
- //# sourceMappingURL=chunk-2O3IUQR4.js.map
145
+ //# sourceMappingURL=chunk-FFNMGR72.js.map
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkOLI32URUcjs = require('./chunk-OLI32URU.cjs');
3
+ var _chunk7ZIK4LWCcjs = require('./chunk-7ZIK4LWC.cjs');
4
4
 
5
5
  // src/Progress/Progress.tsx
6
6
  var _progress = require('@heroui/progress');
@@ -65,7 +65,7 @@ var Progress = ({
65
65
  size = "md",
66
66
  testId = void 0
67
67
  }) => {
68
- const isInitialRenderCycle = _chunkOLI32URUcjs.useIsInitialRenderCycle.call(void 0, );
68
+ const isInitialRenderCycle = _chunk7ZIK4LWCcjs.useIsInitialRenderCycle.call(void 0, );
69
69
  const isFinished = percent >= 100 && !disableFinishedState;
70
70
  let progressColor = color;
71
71
  if (isFinished) {
@@ -100,4 +100,4 @@ var Progress_default2 = Progress_default;
100
100
 
101
101
 
102
102
  exports.progressVariants = progressVariants; exports.Progress_default = Progress_default; exports.Progress_default2 = Progress_default2;
103
- //# sourceMappingURL=chunk-IY2NXW6X.cjs.map
103
+ //# sourceMappingURL=chunk-KM3PZ3GH.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-IY2NXW6X.cjs","../src/Progress/Progress.tsx","../src/Progress/index.ts"],"names":["Progress_default"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;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A,IAAA;AACC,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AAAyB,IAAA;AAC3B,EAAA;AAEJ;AAEO;AD7CG;AACA;AExFHA;AF0FG;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-IY2NXW6X.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\nimport { useIsInitialRenderCycle } from '../hooks';\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 /** disables special finished state (checkmark icon and success color) */\n disableFinishedState?: 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) => {\n return `${percent}%`;\n};\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 disableFinishedState = false,\n format = defaultFormat,\n indeterminate = false,\n label = undefined,\n percent,\n showValueLabel = false,\n size = 'md',\n testId = undefined,\n}: ProgressProps) => {\n // used to disable animation on initial render cycle\n const isInitialRenderCycle = useIsInitialRenderCycle();\n\n // Apply finished state if percent is 100 or more and not disabled by disableFinishedState\n const isFinished = percent >= 100 && !disableFinishedState;\n\n // handle special states\n let progressColor: VariantProps['color'] = color;\n if (isFinished) {\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={isInitialRenderCycle || disableAnimation}\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
+ {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-KM3PZ3GH.cjs","../src/Progress/Progress.tsx","../src/Progress/index.ts"],"names":["Progress_default"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACDA,4CAAyC;AAEzC,oDAAyC;AAsHrC,+CAAA;AAjHG,IAAM,iBAAA,EAAmB,4BAAA;AAA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AACA,MAAA;AACA,MAAA;AACA,MAAA;AAAyB,IAAA;AAC3B,EAAA;AAEJ;AAEO;AD7CG;AACA;AExFHA;AF0FG;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-KM3PZ3GH.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\nimport { useIsInitialRenderCycle } from '../hooks';\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 /** disables special finished state (checkmark icon and success color) */\n disableFinishedState?: 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) => {\n return `${percent}%`;\n};\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 disableFinishedState = false,\n format = defaultFormat,\n indeterminate = false,\n label = undefined,\n percent,\n showValueLabel = false,\n size = 'md',\n testId = undefined,\n}: ProgressProps) => {\n // used to disable animation on initial render cycle\n const isInitialRenderCycle = useIsInitialRenderCycle();\n\n // Apply finished state if percent is 100 or more and not disabled by disableFinishedState\n const isFinished = percent >= 100 && !disableFinishedState;\n\n // handle special states\n let progressColor: VariantProps['color'] = color;\n if (isFinished) {\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={isInitialRenderCycle || disableAnimation}\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
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkOLI32URUcjs = require('./chunk-OLI32URU.cjs');
3
+ var _chunk7ZIK4LWCcjs = require('./chunk-7ZIK4LWC.cjs');
4
4
 
5
5
 
6
6
  var _chunkAHEA4IJVcjs = require('./chunk-AHEA4IJV.cjs');
@@ -83,7 +83,7 @@ var ProgressCircular = ({
83
83
  color = "info",
84
84
  strokeWidth: strokeWidthProp = void 0
85
85
  }) => {
86
- const isInitialRenderCycle = _chunkOLI32URUcjs.useIsInitialRenderCycle.call(void 0, );
86
+ const isInitialRenderCycle = _chunk7ZIK4LWCcjs.useIsInitialRenderCycle.call(void 0, );
87
87
  const isFinished = !hasError && percent >= 100 && !disableFinishedState;
88
88
  const variants = progressCircularVariants({
89
89
  color,
@@ -142,4 +142,4 @@ var ProgressCircular_default2 = ProgressCircular_default;
142
142
 
143
143
 
144
144
  exports.progressCircularVariants = progressCircularVariants; exports.ProgressCircular_default = ProgressCircular_default; exports.ProgressCircular_default2 = ProgressCircular_default2;
145
- //# sourceMappingURL=chunk-AZ7VMRHX.cjs.map
145
+ //# sourceMappingURL=chunk-RZGLEDWN.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-AZ7VMRHX.cjs","../src/ProgressCircular/ProgressCircular.tsx","../src/ProgressCircular/index.ts"],"names":["ProgressCircular_default"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACHA,oCAAiC;AAEjC,4CAAyD;AACzD,sCAAiE;AAEjE,oDAAyC;AAmJ7B,+CAAA;AA/IL,IAAM,yBAAA,EAA2B,4BAAA;AAAG,EACzC,KAAA,EAAO;AAAA;AAAA,IAEL,IAAA,EAAM,EAAA;AAAA;AAAA,IAEN,SAAA,EAAW,EAAA;AAAA;AAAA,IAEX,KAAA,EAAO,EAAA;AAAA;AAAA,IAEP,GAAA,EAAK,EAAA;AAAA;AAAA,IAEL,UAAA,EAAY,EAAA;AAAA;AAAA,IAEZ,KAAA,EAAO,oBAAA;AAAA;AAAA,IAEP,KAAA,EAAO;AAAA,EACT,CAAA;AAAA,EACA,QAAA,EAAU;AAAA,IACR,KAAA,EAAO,8CAAA;AAAA,MACL,IAAA,EAAM;AAAA,QACJ,GAAA,EAAK;AAAA,MACP;AAAA,IAAA,CAAA,EAEG,uBAAA,CAA6B,QAAA,CAAS,KAAA,CAAA;AAAA,IAE3C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;AACF,EAAA;AACE,IAAA;AACA,IAAA;AACF,EAAA;AAGM,EAAA;AACJ,IAAA;AACA,EAAA;AAKA,EAAA;AAAC,IAAA;AAAA,IAAA;AACC,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AAEA,MAAA;AACA,MAAA;AAAY,IAAA;AACd,EAAA;AAEJ;AAEO;ADjDG;AACA;AElIHA;AFoIG;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-AZ7VMRHX.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\nimport { useIsInitialRenderCycle } from '../hooks';\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-300',\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 isFinished: {\n true: {\n svg: 'text-success',\n },\n },\n size: {\n xs: {\n svg: 'h-10 w-10',\n value: 'text-[0.6rem]',\n },\n sm: {\n svg: 'h-12 w-12',\n value: 'text-xs',\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 /** disables special finished state (checkmark icon and success color) */\n disableFinishedState?: 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 /** stroke width of the circular progress bar */\n strokeWidth?: number;\n}\n\n/** formats percent with percent sign */\nconst defaultFormat = (percent = 0) => {\n return `${percent}%`;\n};\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 disableFinishedState = false,\n size = 'md',\n color = 'info',\n strokeWidth: strokeWidthProp = undefined,\n}: ProgressCircularProps) => {\n // used to disable animation on initial render cycle\n const isInitialRenderCycle = useIsInitialRenderCycle();\n\n // Apply finished state if percent is 100 or more and not disabled by disableFinishedState\n const isFinished = !hasError && percent >= 100 && !disableFinishedState;\n\n const variants = progressCircularVariants({\n color,\n hasError,\n isFinished,\n size,\n });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // format value\n let value = format(percent);\n\n let strokeWidth = strokeWidthProp;\n // set strokeWidth based on size prop when no strokeWidth provided\n if (!strokeWidth) {\n switch (size) {\n case 'xs':\n strokeWidth = 2;\n break;\n case 'sm':\n strokeWidth = 1.8;\n break;\n default:\n strokeWidth = 1.6;\n break;\n }\n }\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 (isFinished) {\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 showValueLabel\n aria-label={ariaLabel}\n classNames={classNames}\n color={heroUiColor}\n disableAnimation={isInitialRenderCycle || disableAnimation}\n strokeWidth={strokeWidth}\n // INFO: 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"]}
1
+ {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-RZGLEDWN.cjs","../src/ProgressCircular/ProgressCircular.tsx","../src/ProgressCircular/index.ts"],"names":["ProgressCircular_default"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACHA,oCAAiC;AAEjC,4CAAyD;AACzD,sCAAiE;AAEjE,oDAAyC;AAmJ7B,+CAAA;AA/IL,IAAM,yBAAA,EAA2B,4BAAA;AAAG,EACzC,KAAA,EAAO;AAAA;AAAA,IAEL,IAAA,EAAM,EAAA;AAAA;AAAA,IAEN,SAAA,EAAW,EAAA;AAAA;AAAA,IAEX,KAAA,EAAO,EAAA;AAAA;AAAA,IAEP,GAAA,EAAK,EAAA;AAAA;AAAA,IAEL,UAAA,EAAY,EAAA;AAAA;AAAA,IAEZ,KAAA,EAAO,oBAAA;AAAA;AAAA,IAEP,KAAA,EAAO;AAAA,EACT,CAAA;AAAA,EACA,QAAA,EAAU;AAAA,IACR,KAAA,EAAO,8CAAA;AAAA,MACL,IAAA,EAAM;AAAA,QACJ,GAAA,EAA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AACE,QAAA;AACA,QAAA;AACJ,IAAA;AACF,EAAA;AAGI,EAAA;AACA,EAAA;AACF,IAAA;AACA,IAAA;AACF,EAAA;AACE,IAAA;AACA,IAAA;AACF,EAAA;AAGM,EAAA;AACJ,IAAA;AACA,EAAA;AAKA,EAAA;AAAC,IAAA;AAAA,IAAA;AACC,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AAEA,MAAA;AACA,MAAA;AAAY,IAAA;AACd,EAAA;AAEJ;AAEO;ADjDG;AACA;AElIHA;AFoIG;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-RZGLEDWN.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\nimport { useIsInitialRenderCycle } from '../hooks';\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-300',\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 isFinished: {\n true: {\n svg: 'text-success',\n },\n },\n size: {\n xs: {\n svg: 'h-10 w-10',\n value: 'text-[0.6rem]',\n },\n sm: {\n svg: 'h-12 w-12',\n value: 'text-xs',\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 /** disables special finished state (checkmark icon and success color) */\n disableFinishedState?: 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 /** stroke width of the circular progress bar */\n strokeWidth?: number;\n}\n\n/** formats percent with percent sign */\nconst defaultFormat = (percent = 0) => {\n return `${percent}%`;\n};\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 disableFinishedState = false,\n size = 'md',\n color = 'info',\n strokeWidth: strokeWidthProp = undefined,\n}: ProgressCircularProps) => {\n // used to disable animation on initial render cycle\n const isInitialRenderCycle = useIsInitialRenderCycle();\n\n // Apply finished state if percent is 100 or more and not disabled by disableFinishedState\n const isFinished = !hasError && percent >= 100 && !disableFinishedState;\n\n const variants = progressCircularVariants({\n color,\n hasError,\n isFinished,\n size,\n });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // format value\n let value = format(percent);\n\n let strokeWidth = strokeWidthProp;\n // set strokeWidth based on size prop when no strokeWidth provided\n if (!strokeWidth) {\n switch (size) {\n case 'xs':\n strokeWidth = 2;\n break;\n case 'sm':\n strokeWidth = 1.8;\n break;\n default:\n strokeWidth = 1.6;\n break;\n }\n }\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 (isFinished) {\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 showValueLabel\n aria-label={ariaLabel}\n classNames={classNames}\n color={heroUiColor}\n disableAnimation={isInitialRenderCycle || disableAnimation}\n strokeWidth={strokeWidth}\n // INFO: 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"]}
@@ -80,4 +80,4 @@ export {
80
80
  useIsInitialRenderCycle,
81
81
  useLocalStorage
82
82
  };
83
- //# sourceMappingURL=chunk-B3XKBNXD.js.map
83
+ //# sourceMappingURL=chunk-VTSVKRA7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hooks/useDebounce.ts","../src/hooks/useIsInitialRenderCycle.ts","../src/hooks/useLocalStorage.ts"],"sourcesContent":["/* eslint-disable import-x/prefer-default-export */\n\nimport { useEffect, useState } from 'react';\n\nexport const useDebounce = <Value>(value: Value, delay: number) => {\n // State and setters for debounced value\n const [debouncedValue, setDebouncedValue] = useState(value);\n useEffect(\n () => {\n // Update debounced value after delay\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n // Cancel the timeout if value changes (also on delay change or unmount)\n // This is how we prevent debounced value from updating if value is changed ...\n // .. within the delay period. Timeout gets cleared and restarted.\n return () => {\n clearTimeout(handler);\n };\n },\n [value, delay], // Only re-call effect if value or delay changes\n );\n return debouncedValue;\n};\n","/* eslint-disable import/prefer-default-export */\n\nimport { useEffect, useRef } from 'react';\n\n/**\n * A hook that returns true on initial render and false afterward.\n *\n * @returns {boolean} - True on initial render, false afterward\n */\nexport const useIsInitialRenderCycle = (): boolean => {\n // Use ref to avoid re-renders\n const isInitialRender = useRef(true);\n\n // Update ref after first render\n useEffect(() => {\n // Set to false after component mounts\n isInitialRender.current = false;\n\n // No cleanup needed for this effect\n }, []);\n\n return isInitialRender.current;\n};\n","/* eslint-disable import/prefer-default-export */\n\nimport type { Dispatch, SetStateAction } from 'react';\n\nimport { useEffect, useState } from 'react';\n\nexport const useLocalStorage = <T>(\n key: string,\n initialValue: T | (() => T),\n): [T, Dispatch<SetStateAction<T>>] => {\n // Get from local storage then\n // parse stored json or return initialValue\n const readValue = () => {\n // Prevent build error \"window is undefined\" but keep keep working\n if (typeof window === 'undefined') {\n return initialValue;\n }\n\n try {\n const item = window.localStorage.getItem(key);\n return item ? JSON.parse(item) : initialValue;\n } catch (error) {\n console.warn(`Error reading localStorage key “${key}”:`, error);\n return initialValue;\n }\n };\n\n // State to store our value\n // Pass initial state function to useState so logic is only executed once\n const [storedValue, setStoredValue] = useState<T>(readValue);\n\n // Return a wrapped version of useState's setter function that ...\n // ... persists the new value to localStorage.\n const setValue: Dispatch<SetStateAction<T>> = (value) => {\n // Prevent build error \"window is undefined\" but keeps working\n if (typeof window === 'undefined') {\n console.warn(\n `Tried setting localStorage key “${key}” even though environment is not a client`,\n );\n }\n\n try {\n // Allow value to be a function so we have the same API as useState\n const newValue = value instanceof Function ? value(storedValue) : value;\n\n // Save to local storage\n window.localStorage.setItem(key, JSON.stringify(newValue));\n\n // Save state\n setStoredValue(newValue);\n\n // We dispatch a custom event so every useLocalStorage hook are notified\n window.dispatchEvent(new Event('local-storage'));\n } catch (error) {\n console.warn(`Error setting localStorage key “${key}”:`, error);\n }\n };\n\n useEffect(() => {\n setStoredValue(readValue());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const handleStorageChange = () => {\n setStoredValue(readValue());\n };\n\n // this only works for other documents, not the current one\n window.addEventListener('storage', handleStorageChange);\n\n // this is a custom event, triggered in writeValueToLocalStorage\n window.addEventListener('local-storage', handleStorageChange);\n\n return () => {\n window.removeEventListener('storage', handleStorageChange);\n window.removeEventListener('local-storage', handleStorageChange);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return [storedValue, setValue];\n};\n"],"mappings":";AAEA,SAAS,WAAW,gBAAgB;AAE7B,IAAM,cAAc,CAAQ,OAAc,UAAkB;AAEjE,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAS,KAAK;AAC1D;AAAA,IACE,MAAM;AAEJ,YAAM,UAAU,WAAW,MAAM;AAC/B,0BAAkB,KAAK;AAAA,MACzB,GAAG,KAAK;AAIR,aAAO,MAAM;AACX,qBAAa,OAAO;AAAA,MACtB;AAAA,IACF;AAAA,IACA,CAAC,OAAO,KAAK;AAAA;AAAA,EACf;AACA,SAAO;AACT;;;ACrBA,SAAS,aAAAA,YAAW,cAAc;AAO3B,IAAM,0BAA0B,MAAe;AAEpD,QAAM,kBAAkB,OAAO,IAAI;AAGnC,EAAAA,WAAU,MAAM;AAEd,oBAAgB,UAAU;AAAA,EAG5B,GAAG,CAAC,CAAC;AAEL,SAAO,gBAAgB;AACzB;;;AClBA,SAAS,aAAAC,YAAW,YAAAC,iBAAgB;AAE7B,IAAM,kBAAkB,CAC7B,KACA,iBACqC;AAGrC,QAAM,YAAY,MAAM;AAEtB,QAAI,OAAO,WAAW,aAAa;AACjC,aAAO;AAAA,IACT;AAEA,QAAI;AACF,YAAM,OAAO,OAAO,aAAa,QAAQ,GAAG;AAC5C,aAAO,OAAO,KAAK,MAAM,IAAI,IAAI;AAAA,IACnC,SAAS,OAAO;AACd,cAAQ,KAAK,wCAAmC,GAAG,WAAM,KAAK;AAC9D,aAAO;AAAA,IACT;AAAA,EACF;AAIA,QAAM,CAAC,aAAa,cAAc,IAAIA,UAAY,SAAS;AAI3D,QAAM,WAAwC,CAAC,UAAU;AAEvD,QAAI,OAAO,WAAW,aAAa;AACjC,cAAQ;AAAA,QACN,wCAAmC,GAAG;AAAA,MACxC;AAAA,IACF;AAEA,QAAI;AAEF,YAAM,WAAW,iBAAiB,WAAW,MAAM,WAAW,IAAI;AAGlE,aAAO,aAAa,QAAQ,KAAK,KAAK,UAAU,QAAQ,CAAC;AAGzD,qBAAe,QAAQ;AAGvB,aAAO,cAAc,IAAI,MAAM,eAAe,CAAC;AAAA,IACjD,SAAS,OAAO;AACd,cAAQ,KAAK,wCAAmC,GAAG,WAAM,KAAK;AAAA,IAChE;AAAA,EACF;AAEA,EAAAD,WAAU,MAAM;AACd,mBAAe,UAAU,CAAC;AAAA,EAE5B,GAAG,CAAC,CAAC;AAEL,EAAAA,WAAU,MAAM;AACd,UAAM,sBAAsB,MAAM;AAChC,qBAAe,UAAU,CAAC;AAAA,IAC5B;AAGA,WAAO,iBAAiB,WAAW,mBAAmB;AAGtD,WAAO,iBAAiB,iBAAiB,mBAAmB;AAE5D,WAAO,MAAM;AACX,aAAO,oBAAoB,WAAW,mBAAmB;AACzD,aAAO,oBAAoB,iBAAiB,mBAAmB;AAAA,IACjE;AAAA,EAEF,GAAG,CAAC,CAAC;AAEL,SAAO,CAAC,aAAa,QAAQ;AAC/B;","names":["useEffect","useEffect","useState"]}
@@ -2,11 +2,11 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkOLI32URUcjs = require('../chunk-OLI32URU.cjs');
5
+ var _chunk7ZIK4LWCcjs = require('../chunk-7ZIK4LWC.cjs');
6
6
  require('../chunk-AHEA4IJV.cjs');
7
7
 
8
8
 
9
9
 
10
10
 
11
- exports.useDebounce = _chunkOLI32URUcjs.useDebounce; exports.useIsInitialRenderCycle = _chunkOLI32URUcjs.useIsInitialRenderCycle; exports.useLocalStorage = _chunkOLI32URUcjs.useLocalStorage;
11
+ exports.useDebounce = _chunk7ZIK4LWCcjs.useDebounce; exports.useIsInitialRenderCycle = _chunk7ZIK4LWCcjs.useIsInitialRenderCycle; exports.useLocalStorage = _chunk7ZIK4LWCcjs.useLocalStorage;
12
12
  //# sourceMappingURL=index.cjs.map
@@ -2,7 +2,7 @@ import {
2
2
  useDebounce,
3
3
  useIsInitialRenderCycle,
4
4
  useLocalStorage
5
- } from "../chunk-B3XKBNXD.js";
5
+ } from "../chunk-VTSVKRA7.js";
6
6
  import "../chunk-OAIRL2FN.js";
7
7
  export {
8
8
  useDebounce,
package/dist/index.cjs CHANGED
@@ -1,16 +1,16 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkIY2NXW6Xcjs = require('./chunk-IY2NXW6X.cjs');
4
+ var _chunkKM3PZ3GHcjs = require('./chunk-KM3PZ3GH.cjs');
5
5
 
6
6
 
7
7
 
8
- var _chunkAZ7VMRHXcjs = require('./chunk-AZ7VMRHX.cjs');
8
+ var _chunkRZGLEDWNcjs = require('./chunk-RZGLEDWN.cjs');
9
9
 
10
10
 
11
11
 
12
12
 
13
- var _chunkOLI32URUcjs = require('./chunk-OLI32URU.cjs');
13
+ var _chunk7ZIK4LWCcjs = require('./chunk-7ZIK4LWC.cjs');
14
14
 
15
15
 
16
16
 
@@ -131,5 +131,5 @@ require('./chunk-AHEA4IJV.cjs');
131
131
 
132
132
 
133
133
 
134
- exports.Accordion = _chunkPF4VI6L7cjs.Accordion_default; exports.Alert = _chunkUECUQP2Bcjs.Alert_default; exports.Avatar = _chunk77J7NZYBcjs.Avatar_default; exports.AvatarGroup = _chunkS4O4KDC3cjs.AvatarGroup_default; exports.Badge = _chunkHG7AE6Q2cjs.Badge_default; exports.Breadcrumb = _chunkIBX6A72Pcjs.Breadcrumb_default; exports.Button = _chunkKB6PZSJ5cjs.Button_default; exports.ButtonGroup = _chunkY3RSI2KVcjs.ButtonGroup_default; exports.Card = _chunkZ363QVXWcjs.Card_default; exports.Drawer = _chunkOLU26V56cjs.Drawer_default; exports.Json = _chunkERSNLQGGcjs.Json_default; exports.Label = _chunkBPBEZCSPcjs.Label_default; exports.Menu = _chunkC43BKEAScjs.Menu_default; exports.Modal = _chunkHPZBCSP3cjs.Modal_default; exports.Popover = _chunkYW4S32XVcjs.Popover_default; exports.Progress = _chunkIY2NXW6Xcjs.Progress_default; exports.ProgressCircular = _chunkAZ7VMRHXcjs.ProgressCircular_default; exports.Table = _chunkTFRAQ6OQcjs.Table_default; exports.Tabs = _chunkG3YTOGEGcjs.Tabs_default; exports.Toast = _chunkLX5LJN3Icjs.Toast; exports.ToastProvider = _chunkLX5LJN3Icjs.ToastProvider_default; exports.Tooltip = _chunkJ2LI4ONScjs.Tooltip_default; exports.accordionVariants = _chunkPF4VI6L7cjs.accordionVariants; exports.addToast = _chunkLX5LJN3Icjs.addToast; exports.alertVariants = _chunkUECUQP2Bcjs.alertVariants; exports.breadcrumbVariants = _chunkIBX6A72Pcjs.breadcrumbVariants; exports.buttonVariants = _chunkKB6PZSJ5cjs.buttonVariants; exports.cardVariants = _chunkZ363QVXWcjs.cardVariants; exports.drawerBackdrops = _chunkOLU26V56cjs.drawerBackdrops; exports.drawerPlacements = _chunkOLU26V56cjs.drawerPlacements; exports.drawerRadii = _chunkOLU26V56cjs.drawerRadii; exports.drawerSizes = _chunkOLU26V56cjs.drawerSizes; exports.drawerVariants = _chunkOLU26V56cjs.drawerVariants; exports.labelVariants = _chunkBPBEZCSPcjs.labelVariants; exports.modalVariants = _chunkHPZBCSP3cjs.modalVariants; exports.progressCircularVariants = _chunkAZ7VMRHXcjs.progressCircularVariants; exports.progressVariants = _chunkIY2NXW6Xcjs.progressVariants; exports.tableVariants = _chunkTFRAQ6OQcjs.tableVariants; exports.tabsVariants = _chunkG3YTOGEGcjs.tabsVariants; exports.toastVariants = _chunkLX5LJN3Icjs.toastVariants; exports.useDebounce = _chunkOLI32URUcjs.useDebounce; exports.useIsInitialRenderCycle = _chunkOLI32URUcjs.useIsInitialRenderCycle; exports.useLocalStorage = _chunkOLI32URUcjs.useLocalStorage;
134
+ exports.Accordion = _chunkPF4VI6L7cjs.Accordion_default; exports.Alert = _chunkUECUQP2Bcjs.Alert_default; exports.Avatar = _chunk77J7NZYBcjs.Avatar_default; exports.AvatarGroup = _chunkS4O4KDC3cjs.AvatarGroup_default; exports.Badge = _chunkHG7AE6Q2cjs.Badge_default; exports.Breadcrumb = _chunkIBX6A72Pcjs.Breadcrumb_default; exports.Button = _chunkKB6PZSJ5cjs.Button_default; exports.ButtonGroup = _chunkY3RSI2KVcjs.ButtonGroup_default; exports.Card = _chunkZ363QVXWcjs.Card_default; exports.Drawer = _chunkOLU26V56cjs.Drawer_default; exports.Json = _chunkERSNLQGGcjs.Json_default; exports.Label = _chunkBPBEZCSPcjs.Label_default; exports.Menu = _chunkC43BKEAScjs.Menu_default; exports.Modal = _chunkHPZBCSP3cjs.Modal_default; exports.Popover = _chunkYW4S32XVcjs.Popover_default; exports.Progress = _chunkKM3PZ3GHcjs.Progress_default; exports.ProgressCircular = _chunkRZGLEDWNcjs.ProgressCircular_default; exports.Table = _chunkTFRAQ6OQcjs.Table_default; exports.Tabs = _chunkG3YTOGEGcjs.Tabs_default; exports.Toast = _chunkLX5LJN3Icjs.Toast; exports.ToastProvider = _chunkLX5LJN3Icjs.ToastProvider_default; exports.Tooltip = _chunkJ2LI4ONScjs.Tooltip_default; exports.accordionVariants = _chunkPF4VI6L7cjs.accordionVariants; exports.addToast = _chunkLX5LJN3Icjs.addToast; exports.alertVariants = _chunkUECUQP2Bcjs.alertVariants; exports.breadcrumbVariants = _chunkIBX6A72Pcjs.breadcrumbVariants; exports.buttonVariants = _chunkKB6PZSJ5cjs.buttonVariants; exports.cardVariants = _chunkZ363QVXWcjs.cardVariants; exports.drawerBackdrops = _chunkOLU26V56cjs.drawerBackdrops; exports.drawerPlacements = _chunkOLU26V56cjs.drawerPlacements; exports.drawerRadii = _chunkOLU26V56cjs.drawerRadii; exports.drawerSizes = _chunkOLU26V56cjs.drawerSizes; exports.drawerVariants = _chunkOLU26V56cjs.drawerVariants; exports.labelVariants = _chunkBPBEZCSPcjs.labelVariants; exports.modalVariants = _chunkHPZBCSP3cjs.modalVariants; exports.progressCircularVariants = _chunkRZGLEDWNcjs.progressCircularVariants; exports.progressVariants = _chunkKM3PZ3GHcjs.progressVariants; exports.tableVariants = _chunkTFRAQ6OQcjs.tableVariants; exports.tabsVariants = _chunkG3YTOGEGcjs.tabsVariants; exports.toastVariants = _chunkLX5LJN3Icjs.toastVariants; exports.useDebounce = _chunk7ZIK4LWCcjs.useDebounce; exports.useIsInitialRenderCycle = _chunk7ZIK4LWCcjs.useIsInitialRenderCycle; exports.useLocalStorage = _chunk7ZIK4LWCcjs.useLocalStorage;
135
135
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  Progress_default,
3
3
  progressVariants
4
- } from "./chunk-TYY3HIYL.js";
4
+ } from "./chunk-EYUII2LV.js";
5
5
  import {
6
6
  ProgressCircular_default,
7
7
  progressCircularVariants
8
- } from "./chunk-2O3IUQR4.js";
8
+ } from "./chunk-FFNMGR72.js";
9
9
  import {
10
10
  useDebounce,
11
11
  useIsInitialRenderCycle,
12
12
  useLocalStorage
13
- } from "./chunk-B3XKBNXD.js";
13
+ } from "./chunk-VTSVKRA7.js";
14
14
  import {
15
15
  Table_default,
16
16
  tableVariants
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fuf-stack/pixels",
3
3
  "description": "fuf core react component library",
4
4
  "author": "Fröhlich ∧ Frei",
5
- "version": "1.3.0",
5
+ "version": "1.3.2",
6
6
  "type": "module",
7
7
  "main": "./dist/index.cjs",
8
8
  "module": "./dist/index.js",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/hooks/useDebounce.ts","../src/hooks/useIsInitialRenderCycle.ts","../src/hooks/useLocalStorage.ts"],"sourcesContent":["/* eslint-disable import/prefer-default-export */\n\nimport { useEffect, useState } from 'react';\n\nexport const useDebounce = <Value>(value: Value, delay: number) => {\n // State and setters for debounced value\n const [debouncedValue, setDebouncedValue] = useState(value);\n useEffect(\n () => {\n // Update debounced value after delay\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n // Cancel the timeout if value changes (also on delay change or unmount)\n // This is how we prevent debounced value from updating if value is changed ...\n // .. within the delay period. Timeout gets cleared and restarted.\n return () => {\n clearTimeout(handler);\n };\n },\n [value, delay], // Only re-call effect if value or delay changes\n );\n return debouncedValue;\n};\n","/* eslint-disable import/prefer-default-export */\n\nimport { useEffect, useRef } from 'react';\n\n/**\n * A hook that returns true on initial render and false afterward.\n *\n * @returns {boolean} - True on initial render, false afterward\n */\nexport const useIsInitialRenderCycle = (): boolean => {\n // Use ref to avoid re-renders\n const isInitialRender = useRef(true);\n\n // Update ref after first render\n useEffect(() => {\n // Set to false after component mounts\n isInitialRender.current = false;\n\n // No cleanup needed for this effect\n }, []);\n\n return isInitialRender.current;\n};\n","/* eslint-disable import/prefer-default-export */\n\nimport type { Dispatch, SetStateAction } from 'react';\n\nimport { useEffect, useState } from 'react';\n\nexport const useLocalStorage = <T>(\n key: string,\n initialValue: T | (() => T),\n): [T, Dispatch<SetStateAction<T>>] => {\n // Get from local storage then\n // parse stored json or return initialValue\n const readValue = () => {\n // Prevent build error \"window is undefined\" but keep keep working\n if (typeof window === 'undefined') {\n return initialValue;\n }\n\n try {\n const item = window.localStorage.getItem(key);\n return item ? JSON.parse(item) : initialValue;\n } catch (error) {\n console.warn(`Error reading localStorage key “${key}”:`, error);\n return initialValue;\n }\n };\n\n // State to store our value\n // Pass initial state function to useState so logic is only executed once\n const [storedValue, setStoredValue] = useState<T>(readValue);\n\n // Return a wrapped version of useState's setter function that ...\n // ... persists the new value to localStorage.\n const setValue: Dispatch<SetStateAction<T>> = (value) => {\n // Prevent build error \"window is undefined\" but keeps working\n if (typeof window === 'undefined') {\n console.warn(\n `Tried setting localStorage key “${key}” even though environment is not a client`,\n );\n }\n\n try {\n // Allow value to be a function so we have the same API as useState\n const newValue = value instanceof Function ? value(storedValue) : value;\n\n // Save to local storage\n window.localStorage.setItem(key, JSON.stringify(newValue));\n\n // Save state\n setStoredValue(newValue);\n\n // We dispatch a custom event so every useLocalStorage hook are notified\n window.dispatchEvent(new Event('local-storage'));\n } catch (error) {\n console.warn(`Error setting localStorage key “${key}”:`, error);\n }\n };\n\n useEffect(() => {\n setStoredValue(readValue());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const handleStorageChange = () => {\n setStoredValue(readValue());\n };\n\n // this only works for other documents, not the current one\n window.addEventListener('storage', handleStorageChange);\n\n // this is a custom event, triggered in writeValueToLocalStorage\n window.addEventListener('local-storage', handleStorageChange);\n\n return () => {\n window.removeEventListener('storage', handleStorageChange);\n window.removeEventListener('local-storage', handleStorageChange);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return [storedValue, setValue];\n};\n"],"mappings":";AAEA,SAAS,WAAW,gBAAgB;AAE7B,IAAM,cAAc,CAAQ,OAAc,UAAkB;AAEjE,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAS,KAAK;AAC1D;AAAA,IACE,MAAM;AAEJ,YAAM,UAAU,WAAW,MAAM;AAC/B,0BAAkB,KAAK;AAAA,MACzB,GAAG,KAAK;AAIR,aAAO,MAAM;AACX,qBAAa,OAAO;AAAA,MACtB;AAAA,IACF;AAAA,IACA,CAAC,OAAO,KAAK;AAAA;AAAA,EACf;AACA,SAAO;AACT;;;ACrBA,SAAS,aAAAA,YAAW,cAAc;AAO3B,IAAM,0BAA0B,MAAe;AAEpD,QAAM,kBAAkB,OAAO,IAAI;AAGnC,EAAAA,WAAU,MAAM;AAEd,oBAAgB,UAAU;AAAA,EAG5B,GAAG,CAAC,CAAC;AAEL,SAAO,gBAAgB;AACzB;;;AClBA,SAAS,aAAAC,YAAW,YAAAC,iBAAgB;AAE7B,IAAM,kBAAkB,CAC7B,KACA,iBACqC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AAA;AAEL,EAAAA,8BAAAA,CAAU,EAAA,GAAM;AACd,IAAA,MAAM,oBAAA,EAAsB,CAAA,EAAA,GAAM;AAChC,MAAA,cAAA,CAAe,SAAA,CAAU,CAAC,CAAA;AAAA,IAC5B,CAAA;AAGA,IAAA,MAAA,CAAO,gBAAA,CAAiB,SAAA,EAAW,mBAAmB,CAAA;AAGtD,IAAA,MAAA,CAAO,gBAAA,CAAiB,eAAA,EAAiB,mBAAmB,CAAA;AAE5D,IAAA,OAAO,CAAA,EAAA,GAAM;AACX,MAAA,MAAA,CAAO,mBAAA,CAAoB,SAAA,EAAW,mBAAmB,CAAA;AACzD,MAAA,MAAA,CAAO,mBAAA,CAAoB,eAAA,EAAiB,mBAAmB,CAAA;AAAA,IACjE,CAAA;AAAA,EAEF,CAAA,EAAG,CAAC,CAAC,CAAA;AAEL,EAAA,OAAO,CAAC,WAAA,EAAa,QAAQ,CAAA;AAC/B,CAAA;AHNA;AACA;AACE;AACA;AACA;AACF,wIAAC","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-OLI32URU.cjs","sourcesContent":[null,"/* eslint-disable import/prefer-default-export */\n\nimport { useEffect, useState } from 'react';\n\nexport const useDebounce = <Value>(value: Value, delay: number) => {\n // State and setters for debounced value\n const [debouncedValue, setDebouncedValue] = useState(value);\n useEffect(\n () => {\n // Update debounced value after delay\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n // Cancel the timeout if value changes (also on delay change or unmount)\n // This is how we prevent debounced value from updating if value is changed ...\n // .. within the delay period. Timeout gets cleared and restarted.\n return () => {\n clearTimeout(handler);\n };\n },\n [value, delay], // Only re-call effect if value or delay changes\n );\n return debouncedValue;\n};\n","/* eslint-disable import/prefer-default-export */\n\nimport { useEffect, useRef } from 'react';\n\n/**\n * A hook that returns true on initial render and false afterward.\n *\n * @returns {boolean} - True on initial render, false afterward\n */\nexport const useIsInitialRenderCycle = (): boolean => {\n // Use ref to avoid re-renders\n const isInitialRender = useRef(true);\n\n // Update ref after first render\n useEffect(() => {\n // Set to false after component mounts\n isInitialRender.current = false;\n\n // No cleanup needed for this effect\n }, []);\n\n return isInitialRender.current;\n};\n","/* eslint-disable import/prefer-default-export */\n\nimport type { Dispatch, SetStateAction } from 'react';\n\nimport { useEffect, useState } from 'react';\n\nexport const useLocalStorage = <T>(\n key: string,\n initialValue: T | (() => T),\n): [T, Dispatch<SetStateAction<T>>] => {\n // Get from local storage then\n // parse stored json or return initialValue\n const readValue = () => {\n // Prevent build error \"window is undefined\" but keep keep working\n if (typeof window === 'undefined') {\n return initialValue;\n }\n\n try {\n const item = window.localStorage.getItem(key);\n return item ? JSON.parse(item) : initialValue;\n } catch (error) {\n console.warn(`Error reading localStorage key “${key}”:`, error);\n return initialValue;\n }\n };\n\n // State to store our value\n // Pass initial state function to useState so logic is only executed once\n const [storedValue, setStoredValue] = useState<T>(readValue);\n\n // Return a wrapped version of useState's setter function that ...\n // ... persists the new value to localStorage.\n const setValue: Dispatch<SetStateAction<T>> = (value) => {\n // Prevent build error \"window is undefined\" but keeps working\n if (typeof window === 'undefined') {\n console.warn(\n `Tried setting localStorage key “${key}” even though environment is not a client`,\n );\n }\n\n try {\n // Allow value to be a function so we have the same API as useState\n const newValue = value instanceof Function ? value(storedValue) : value;\n\n // Save to local storage\n window.localStorage.setItem(key, JSON.stringify(newValue));\n\n // Save state\n setStoredValue(newValue);\n\n // We dispatch a custom event so every useLocalStorage hook are notified\n window.dispatchEvent(new Event('local-storage'));\n } catch (error) {\n console.warn(`Error setting localStorage key “${key}”:`, error);\n }\n };\n\n useEffect(() => {\n setStoredValue(readValue());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const handleStorageChange = () => {\n setStoredValue(readValue());\n };\n\n // this only works for other documents, not the current one\n window.addEventListener('storage', handleStorageChange);\n\n // this is a custom event, triggered in writeValueToLocalStorage\n window.addEventListener('local-storage', handleStorageChange);\n\n return () => {\n window.removeEventListener('storage', handleStorageChange);\n window.removeEventListener('local-storage', handleStorageChange);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return [storedValue, setValue];\n};\n"]}