@fuf-stack/uniform 0.22.1 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/RadioTabs/index.cjs +2 -2
- package/dist/RadioTabs/index.js +1 -1
- package/dist/Switch/index.cjs +2 -2
- package/dist/Switch/index.d.cts +4 -2
- package/dist/Switch/index.d.ts +4 -2
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch-CLs964dL.d.cts → Switch-BaMtW2HN.d.cts} +12 -3
- package/dist/{Switch-CLs964dL.d.ts → Switch-BaMtW2HN.d.ts} +12 -3
- package/dist/{chunk-NR5MV234.js → chunk-3PTHYFAU.js} +10 -2
- package/dist/chunk-3PTHYFAU.js.map +1 -0
- package/dist/{chunk-QTROOQ53.cjs → chunk-DOBUPJPN.cjs} +10 -2
- package/dist/chunk-DOBUPJPN.cjs.map +1 -0
- package/dist/{chunk-IZFO7YMQ.js → chunk-GHO2VFUQ.js} +2 -2
- package/dist/{chunk-IZFO7YMQ.js.map → chunk-GHO2VFUQ.js.map} +1 -1
- package/dist/{chunk-IAMV2JNU.cjs → chunk-I4OVSJFQ.cjs} +2 -2
- package/dist/chunk-I4OVSJFQ.cjs.map +1 -0
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -2
- package/package.json +4 -4
- package/dist/chunk-IAMV2JNU.cjs.map +0 -1
- package/dist/chunk-NR5MV234.js.map +0 -1
- package/dist/chunk-QTROOQ53.cjs.map +0 -1
package/dist/RadioTabs/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkI4OVSJFQcjs = require('../chunk-I4OVSJFQ.cjs');
|
|
5
5
|
require('../chunk-PA2DQCBY.cjs');
|
|
6
6
|
require('../chunk-GNYQC5IJ.cjs');
|
|
7
7
|
require('../chunk-Y6EAPURV.cjs');
|
|
@@ -12,5 +12,5 @@ require('../chunk-555JRYCS.cjs');
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
exports.RadioTabs =
|
|
15
|
+
exports.RadioTabs = _chunkI4OVSJFQcjs.RadioTabs_default; exports.default = _chunkI4OVSJFQcjs.RadioTabs_default2;
|
|
16
16
|
//# sourceMappingURL=index.cjs.map
|
package/dist/RadioTabs/index.js
CHANGED
package/dist/Switch/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkDOBUPJPNcjs = require('../chunk-DOBUPJPN.cjs');
|
|
5
5
|
require('../chunk-PA2DQCBY.cjs');
|
|
6
6
|
require('../chunk-GNYQC5IJ.cjs');
|
|
7
7
|
require('../chunk-Y6EAPURV.cjs');
|
|
@@ -12,5 +12,5 @@ require('../chunk-555JRYCS.cjs');
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
exports.Switch =
|
|
15
|
+
exports.Switch = _chunkDOBUPJPNcjs.Switch_default; exports.default = _chunkDOBUPJPNcjs.Switch_default2;
|
|
16
16
|
//# sourceMappingURL=index.cjs.map
|
package/dist/Switch/index.d.cts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { S as Switch } from '../Switch-
|
|
2
|
-
export { a as SwitchProps } from '../Switch-
|
|
1
|
+
import { S as Switch } from '../Switch-BaMtW2HN.cjs';
|
|
2
|
+
export { a as SwitchProps } from '../Switch-BaMtW2HN.cjs';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'tailwind-variants/dist/config.js';
|
|
5
5
|
import 'tailwind-variants';
|
|
6
6
|
import '@fuf-stack/pixel-utils';
|
|
7
|
+
import '@heroui/switch';
|
|
8
|
+
import 'react';
|
|
7
9
|
|
|
8
10
|
|
|
9
11
|
|
package/dist/Switch/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { S as Switch } from '../Switch-
|
|
2
|
-
export { a as SwitchProps } from '../Switch-
|
|
1
|
+
import { S as Switch } from '../Switch-BaMtW2HN.js';
|
|
2
|
+
export { a as SwitchProps } from '../Switch-BaMtW2HN.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'tailwind-variants/dist/config.js';
|
|
5
5
|
import 'tailwind-variants';
|
|
6
6
|
import '@fuf-stack/pixel-utils';
|
|
7
|
+
import '@heroui/switch';
|
|
8
|
+
import 'react';
|
|
7
9
|
|
|
8
10
|
|
|
9
11
|
|
package/dist/Switch/index.js
CHANGED
|
@@ -2,6 +2,8 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
3
3
|
import * as tailwind_variants from 'tailwind-variants';
|
|
4
4
|
import { TVProps, TVClassName } from '@fuf-stack/pixel-utils';
|
|
5
|
+
import { SwitchProps as SwitchProps$1 } from '@heroui/switch';
|
|
6
|
+
import { ReactNode } from 'react';
|
|
5
7
|
|
|
6
8
|
declare const switchVariants: tailwind_variants.TVReturnType<{
|
|
7
9
|
[key: string]: {
|
|
@@ -111,16 +113,23 @@ interface SwitchProps extends VariantProps {
|
|
|
111
113
|
className?: ClassName;
|
|
112
114
|
/** whether the select should be disabled */
|
|
113
115
|
disabled?: boolean;
|
|
114
|
-
/**
|
|
115
|
-
|
|
116
|
+
/** Icon to be displayed at the end of the switch (when enabled) */
|
|
117
|
+
endContent?: ReactNode;
|
|
118
|
+
/** component displayed next to the switch */
|
|
119
|
+
label?: ReactNode;
|
|
116
120
|
/** name the field is registered under */
|
|
117
121
|
name: string;
|
|
122
|
+
size?: 'sm' | 'md' | 'lg';
|
|
123
|
+
/** Icon to be displayed at the start of the switch (when disabled) */
|
|
124
|
+
startContent?: ReactNode;
|
|
118
125
|
/** HTML data-testid attribute used in e2e tests */
|
|
119
126
|
testId?: string;
|
|
127
|
+
/** Icon to be displayed inside the thumb */
|
|
128
|
+
thumbIcon?: SwitchProps$1['thumbIcon'];
|
|
120
129
|
}
|
|
121
130
|
/**
|
|
122
131
|
* Switch component based on [HeroUI Switch](https://www.heroui.com//docs/components/switch)
|
|
123
132
|
*/
|
|
124
|
-
declare const Switch: ({ className, disabled, label: _label, name, testId: _testId, }: SwitchProps) => react_jsx_runtime.JSX.Element;
|
|
133
|
+
declare const Switch: ({ className, disabled, endContent, label: _label, name, size, startContent, testId: _testId, thumbIcon, }: SwitchProps) => react_jsx_runtime.JSX.Element;
|
|
125
134
|
|
|
126
135
|
export { Switch as S, type SwitchProps as a };
|
|
@@ -2,6 +2,8 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
3
3
|
import * as tailwind_variants from 'tailwind-variants';
|
|
4
4
|
import { TVProps, TVClassName } from '@fuf-stack/pixel-utils';
|
|
5
|
+
import { SwitchProps as SwitchProps$1 } from '@heroui/switch';
|
|
6
|
+
import { ReactNode } from 'react';
|
|
5
7
|
|
|
6
8
|
declare const switchVariants: tailwind_variants.TVReturnType<{
|
|
7
9
|
[key: string]: {
|
|
@@ -111,16 +113,23 @@ interface SwitchProps extends VariantProps {
|
|
|
111
113
|
className?: ClassName;
|
|
112
114
|
/** whether the select should be disabled */
|
|
113
115
|
disabled?: boolean;
|
|
114
|
-
/**
|
|
115
|
-
|
|
116
|
+
/** Icon to be displayed at the end of the switch (when enabled) */
|
|
117
|
+
endContent?: ReactNode;
|
|
118
|
+
/** component displayed next to the switch */
|
|
119
|
+
label?: ReactNode;
|
|
116
120
|
/** name the field is registered under */
|
|
117
121
|
name: string;
|
|
122
|
+
size?: 'sm' | 'md' | 'lg';
|
|
123
|
+
/** Icon to be displayed at the start of the switch (when disabled) */
|
|
124
|
+
startContent?: ReactNode;
|
|
118
125
|
/** HTML data-testid attribute used in e2e tests */
|
|
119
126
|
testId?: string;
|
|
127
|
+
/** Icon to be displayed inside the thumb */
|
|
128
|
+
thumbIcon?: SwitchProps$1['thumbIcon'];
|
|
120
129
|
}
|
|
121
130
|
/**
|
|
122
131
|
* Switch component based on [HeroUI Switch](https://www.heroui.com//docs/components/switch)
|
|
123
132
|
*/
|
|
124
|
-
declare const Switch: ({ className, disabled, label: _label, name, testId: _testId, }: SwitchProps) => react_jsx_runtime.JSX.Element;
|
|
133
|
+
declare const Switch: ({ className, disabled, endContent, label: _label, name, size, startContent, testId: _testId, thumbIcon, }: SwitchProps) => react_jsx_runtime.JSX.Element;
|
|
125
134
|
|
|
126
135
|
export { Switch as S, type SwitchProps as a };
|
|
@@ -36,9 +36,13 @@ var switchVariants = tv({
|
|
|
36
36
|
var Switch = ({
|
|
37
37
|
className = void 0,
|
|
38
38
|
disabled = false,
|
|
39
|
+
endContent = void 0,
|
|
39
40
|
label: _label = void 0,
|
|
40
41
|
name,
|
|
41
|
-
|
|
42
|
+
size = void 0,
|
|
43
|
+
startContent = void 0,
|
|
44
|
+
testId: _testId = void 0,
|
|
45
|
+
thumbIcon = void 0
|
|
42
46
|
}) => {
|
|
43
47
|
const { control, debugMode, getFieldState } = useFormContext();
|
|
44
48
|
const { error, required, testId, invalid } = getFieldState(name, _testId);
|
|
@@ -64,6 +68,7 @@ var Switch = ({
|
|
|
64
68
|
"data-invalid": invalid,
|
|
65
69
|
"data-required": required,
|
|
66
70
|
"data-testid": testId,
|
|
71
|
+
endContent,
|
|
67
72
|
isDisabled,
|
|
68
73
|
isSelected: !!value,
|
|
69
74
|
name,
|
|
@@ -71,6 +76,9 @@ var Switch = ({
|
|
|
71
76
|
onValueChange: onChange,
|
|
72
77
|
ref,
|
|
73
78
|
required,
|
|
79
|
+
size,
|
|
80
|
+
startContent,
|
|
81
|
+
thumbIcon,
|
|
74
82
|
value,
|
|
75
83
|
children: [
|
|
76
84
|
label,
|
|
@@ -95,4 +103,4 @@ export {
|
|
|
95
103
|
Switch_default,
|
|
96
104
|
Switch_default2
|
|
97
105
|
};
|
|
98
|
-
//# sourceMappingURL=chunk-
|
|
106
|
+
//# sourceMappingURL=chunk-3PTHYFAU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Switch/Switch.tsx","../src/Switch/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { Switch as HeroSwitch } from '@heroui/switch';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useController, useFormContext, useInput } from '../hooks';\nimport { FieldCopyTestIdButton } from '../partials/FieldCopyTestIdButton';\nimport { FieldValidationError } from '../partials/FieldValidationError';\n\nexport const switchVariants = tv({\n slots: {\n base: '',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n outerWrapper: 'place-content-center',\n startContent: '',\n thumb: '',\n thumbIcon: '',\n wrapper: '',\n },\n});\n\ntype VariantProps = TVProps<typeof switchVariants>;\ntype ClassName = TVClassName<typeof switchVariants>;\n\nexport interface SwitchProps extends VariantProps {\n /** CSS class name */\n className?: ClassName;\n /** whether the select should be disabled */\n disabled?: boolean;\n /** Icon to be displayed at the end of the switch (when enabled) */\n endContent?: ReactNode;\n /** component displayed next to the switch */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** Icon to be displayed at the start of the switch (when disabled) */\n startContent?: ReactNode;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * Switch component based on [HeroUI Switch](https://www.heroui.com//docs/components/switch)\n */\nconst Switch = ({\n className = undefined,\n disabled = false,\n endContent = undefined,\n label: _label = undefined,\n name,\n size = undefined,\n startContent = undefined,\n testId: _testId = undefined,\n thumbIcon = undefined,\n}: SwitchProps) => {\n const { control, debugMode, getFieldState } = useFormContext();\n const { error, required, testId, invalid } = getFieldState(name, _testId);\n\n const { field } = useController({ name, control, disabled });\n const { disabled: isDisabled, value, ref, onBlur, onChange } = field;\n\n const { label, getInputProps, getErrorMessageProps } = useInput({\n errorMessage: JSON.stringify(error),\n isInvalid: invalid,\n isRequired: required,\n label: _label,\n labelPlacement: 'outside',\n placeholder: ' ',\n });\n\n const variants = switchVariants();\n const classNames = variantsToClassNames(variants, className, 'outerWrapper');\n\n const showTestIdCopyButton = debugMode === 'debug-testids';\n\n return (\n <div className={classNames.outerWrapper}>\n <HeroSwitch\n aria-describedby={getInputProps()['aria-describedby']}\n classNames={classNames}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n endContent={endContent}\n isDisabled={isDisabled}\n isSelected={!!value}\n name={name}\n onBlur={onBlur}\n onValueChange={onChange}\n ref={ref}\n required={required}\n size={size}\n startContent={startContent}\n thumbIcon={thumbIcon}\n value={value}\n >\n {label}\n {showTestIdCopyButton && <FieldCopyTestIdButton testId={testId} />}\n </HeroSwitch>\n {error && (\n <div className={classNames.errorMessage}>\n <div\n /* eslint-disable-next-line react/jsx-props-no-spreading */\n {...getErrorMessageProps()}\n >\n <FieldValidationError error={error} testId={testId} />\n </div>\n </div>\n )}\n </div>\n );\n};\n\nexport default Switch;\n","import Switch from './Switch';\n\nexport type { SwitchProps } from './Switch';\n\nexport { Switch };\n\nexport default Switch;\n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e;AAAA,QACf,eAAa;AAAA,QACb;AAAA,QACA;AAAA,QACA,YAAY,CAAC,CAAC;AAAA,QACd;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QAEC;AAAA;AAAA,UACA,wBAAwB,oBAAC,iCAAsB,QAAgB;AAAA;AAAA;AAAA,IAClE;AAAA,IACC,SACC,oBAAC,SAAI,WAAW,WAAW,cACzB;AAAA,MAAC;AAAA,uCAEK,qBAAqB,IAF1B;AAAA,QAIC,8BAAC,gCAAqB,OAAc,QAAgB;AAAA;AAAA,IACtD,GACF;AAAA,KAEJ;AAEJ;AAEA,IAAO,iBAAQ;;;ACzHf,IAAOA,kBAAQ;","names":["Switch_default"]}
|
|
@@ -36,9 +36,13 @@ var switchVariants = _pixelutils.tv.call(void 0, {
|
|
|
36
36
|
var Switch = ({
|
|
37
37
|
className = void 0,
|
|
38
38
|
disabled = false,
|
|
39
|
+
endContent = void 0,
|
|
39
40
|
label: _label = void 0,
|
|
40
41
|
name,
|
|
41
|
-
|
|
42
|
+
size = void 0,
|
|
43
|
+
startContent = void 0,
|
|
44
|
+
testId: _testId = void 0,
|
|
45
|
+
thumbIcon = void 0
|
|
42
46
|
}) => {
|
|
43
47
|
const { control, debugMode, getFieldState } = _chunkY6EAPURVcjs.useFormContext.call(void 0, );
|
|
44
48
|
const { error, required, testId, invalid } = getFieldState(name, _testId);
|
|
@@ -64,6 +68,7 @@ var Switch = ({
|
|
|
64
68
|
"data-invalid": invalid,
|
|
65
69
|
"data-required": required,
|
|
66
70
|
"data-testid": testId,
|
|
71
|
+
endContent,
|
|
67
72
|
isDisabled,
|
|
68
73
|
isSelected: !!value,
|
|
69
74
|
name,
|
|
@@ -71,6 +76,9 @@ var Switch = ({
|
|
|
71
76
|
onValueChange: onChange,
|
|
72
77
|
ref,
|
|
73
78
|
required,
|
|
79
|
+
size,
|
|
80
|
+
startContent,
|
|
81
|
+
thumbIcon,
|
|
74
82
|
value,
|
|
75
83
|
children: [
|
|
76
84
|
label,
|
|
@@ -95,4 +103,4 @@ var Switch_default2 = Switch_default;
|
|
|
95
103
|
|
|
96
104
|
|
|
97
105
|
exports.Switch_default = Switch_default; exports.Switch_default2 = Switch_default2;
|
|
98
|
-
//# sourceMappingURL=chunk-
|
|
106
|
+
//# sourceMappingURL=chunk-DOBUPJPN.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-DOBUPJPN.cjs","../src/Switch/Switch.tsx","../src/Switch/index.ts"],"names":["Switch_default"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACZA,wCAAqC;AAErC,oDAAyC;AAmFnC,+CAAA;AA7EC,IAAM,eAAA,EAAiB,4BAAA;AAAG,EAC/B,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,EAAA;AAAA,IACN,UAAA,EAAY,EAAA;AAAA,IACZ,YAAA,EAAc,WAAA;AAAA;AAAA;AAAA,IAGd,KAAA,EACE,yNAAA;AAAA,IACF,YAAA,EAAc,sBAAA;AAAA,IACd,YAAA,EAAc,EAAA;AAAA,IACd,KAAA,EAAO,EAAA;AAAA,IACP,SAAA,EAAW,EAAA;AAAA,IACX,OAAA,EAAS;AAAA,EACX;AACF,CAAC,CAAA;AA6BD,IAAM,OAAA,EAAS,CAAC;AAAA,EACd,UAAA,EAAY,KAAA,CAAA;AAAA,EACZ,SAAA,EAAW,KAAA;AAAA,EACX,WAAA,EAAa,KAAA,CAAA;AAAA,EACb,KAAA,EAAO,OAAA,EAAS,KAAA,CAAA;AAAA,EAChB,IAAA;AAAA,EACA,KAAA,EAAO,KAAA,CAAA;AAAA,EACP,aAAA,EAAe,KAAA,CAAA;AAAA,EACf,MAAA,EAAQ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AAA,EAAe,QAAA;AAAA,QACf,aAAA,EAAa,MAAA;AAAA,QACb,UAAA;AAAA,QACA,UAAA;AAAA,QACA,UAAA,EAAY,CAAC,CAAC,KAAA;AAAA,QACd,IAAA;AAAA,QACA,MAAA;AAAA,QACA,aAAA,EAAe,QAAA;AAAA,QACf,GAAA;AAAA,QACA,QAAA;AAAA,QACA,IAAA;AAAA,QACA,YAAA;AAAA,QACA,SAAA;AAAA,QACA,KAAA;AAAA,QAEC,QAAA,EAAA;AAAA,UAAA,KAAA;AAAA,UACA,qBAAA,mBAAwB,6BAAA,+CAAC,EAAA,EAAsB,OAAA,CAAgB;AAAA,QAAA;AAAA,MAAA;AAAA,IAClE,CAAA;AAAA,IACC,MAAA,mBACC,6BAAA,KAAC,EAAA,EAAI,SAAA,EAAW,UAAA,CAAW,YAAA,EACzB,QAAA,kBAAA,6BAAA;AAAA,MAAC,KAAA;AAAA,MAAA,6CAAA,8CAAA,CAAA,CAAA,EAEK,oBAAA,CAAqB,CAAA,CAAA,EAF1B;AAAA,QAIC,QAAA,kBAAA,6BAAA,8CAAC,EAAA,EAAqB,KAAA,EAAc,OAAA,CAAgB;AAAA,MAAA,CAAA;AAAA,IACtD,EAAA,CACF;AAAA,EAAA,EAAA,CAEJ,CAAA;AAEJ,CAAA;AAEA,IAAO,eAAA,EAAQ,MAAA;AD9Bf;AACA;AE5FA,IAAOA,gBAAAA,EAAQ,cAAA;AF8Ff;AACA;AACE;AACA;AACF,mFAAC","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-DOBUPJPN.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { Switch as HeroSwitch } from '@heroui/switch';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useController, useFormContext, useInput } from '../hooks';\nimport { FieldCopyTestIdButton } from '../partials/FieldCopyTestIdButton';\nimport { FieldValidationError } from '../partials/FieldValidationError';\n\nexport const switchVariants = tv({\n slots: {\n base: '',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n outerWrapper: 'place-content-center',\n startContent: '',\n thumb: '',\n thumbIcon: '',\n wrapper: '',\n },\n});\n\ntype VariantProps = TVProps<typeof switchVariants>;\ntype ClassName = TVClassName<typeof switchVariants>;\n\nexport interface SwitchProps extends VariantProps {\n /** CSS class name */\n className?: ClassName;\n /** whether the select should be disabled */\n disabled?: boolean;\n /** Icon to be displayed at the end of the switch (when enabled) */\n endContent?: ReactNode;\n /** component displayed next to the switch */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** Icon to be displayed at the start of the switch (when disabled) */\n startContent?: ReactNode;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * Switch component based on [HeroUI Switch](https://www.heroui.com//docs/components/switch)\n */\nconst Switch = ({\n className = undefined,\n disabled = false,\n endContent = undefined,\n label: _label = undefined,\n name,\n size = undefined,\n startContent = undefined,\n testId: _testId = undefined,\n thumbIcon = undefined,\n}: SwitchProps) => {\n const { control, debugMode, getFieldState } = useFormContext();\n const { error, required, testId, invalid } = getFieldState(name, _testId);\n\n const { field } = useController({ name, control, disabled });\n const { disabled: isDisabled, value, ref, onBlur, onChange } = field;\n\n const { label, getInputProps, getErrorMessageProps } = useInput({\n errorMessage: JSON.stringify(error),\n isInvalid: invalid,\n isRequired: required,\n label: _label,\n labelPlacement: 'outside',\n placeholder: ' ',\n });\n\n const variants = switchVariants();\n const classNames = variantsToClassNames(variants, className, 'outerWrapper');\n\n const showTestIdCopyButton = debugMode === 'debug-testids';\n\n return (\n <div className={classNames.outerWrapper}>\n <HeroSwitch\n aria-describedby={getInputProps()['aria-describedby']}\n classNames={classNames}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n endContent={endContent}\n isDisabled={isDisabled}\n isSelected={!!value}\n name={name}\n onBlur={onBlur}\n onValueChange={onChange}\n ref={ref}\n required={required}\n size={size}\n startContent={startContent}\n thumbIcon={thumbIcon}\n value={value}\n >\n {label}\n {showTestIdCopyButton && <FieldCopyTestIdButton testId={testId} />}\n </HeroSwitch>\n {error && (\n <div className={classNames.errorMessage}>\n <div\n /* eslint-disable-next-line react/jsx-props-no-spreading */\n {...getErrorMessageProps()}\n >\n <FieldValidationError error={error} testId={testId} />\n </div>\n </div>\n )}\n </div>\n );\n};\n\nexport default Switch;\n","import Switch from './Switch';\n\nexport type { SwitchProps } from './Switch';\n\nexport { Switch };\n\nexport default Switch;\n"]}
|
|
@@ -83,7 +83,7 @@ var RadioTabs = ({
|
|
|
83
83
|
disabledKeys: disabled ? disabledAllKeys : void 0,
|
|
84
84
|
fullWidth: false,
|
|
85
85
|
onSelectionChange: onChange,
|
|
86
|
-
selectedKey: value,
|
|
86
|
+
selectedKey: value != null ? value : "",
|
|
87
87
|
tabs: tabOptions,
|
|
88
88
|
testId,
|
|
89
89
|
variant
|
|
@@ -101,4 +101,4 @@ export {
|
|
|
101
101
|
RadioTabs_default,
|
|
102
102
|
RadioTabs_default2
|
|
103
103
|
};
|
|
104
|
-
//# sourceMappingURL=chunk-
|
|
104
|
+
//# sourceMappingURL=chunk-GHO2VFUQ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/RadioTabs/RadioTabs.tsx","../src/RadioTabs/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { TabsProps } from '@fuf-stack/pixels';\nimport type { TabProps } from '@fuf-stack/pixels/Tabs';\nimport type { ReactElement, ReactNode } from 'react';\n\nimport { RadioGroup as HeroRadioGroup } from '@heroui/radio';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\nimport Tabs from '@fuf-stack/pixels/Tabs';\n\nimport { useController, useFormContext } from '../hooks';\nimport { FieldCopyTestIdButton } from '../partials/FieldCopyTestIdButton';\nimport { FieldValidationError } from '../partials/FieldValidationError';\n\nexport const radioTabsVariants = tv({\n slots: {\n base: 'group', // Needs group for group-data condition\n label:\n 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:text-danger',\n wrapper: '',\n tabList: '',\n tab: '',\n tabContent: '',\n cursor: '',\n panel: '',\n },\n});\n\ntype VariantProps = TVProps<typeof radioTabsVariants>;\ntype ClassName = TVClassName<typeof radioTabsVariants>;\n\nexport interface RadioTabsOption {\n /** Optional content inside of the tab */\n content?: ReactNode;\n /** disables the option */\n disabled?: boolean;\n /** option label */\n label?: React.ReactNode;\n /** option icon */\n icon?: ReactNode;\n /** HTML data-testid attribute of the option */\n testId?: string;\n /** option value */\n value: string;\n}\n\nexport interface RadioTabsProps extends VariantProps {\n /** CSS class name */\n className?: ClassName;\n /** Determines if the Buttons are disabled or not. */\n disabled?: boolean;\n /** determines orientation of the Buttons. */\n inline?: boolean;\n /** Label displayed next to the RadioButton. */\n label?: ReactNode;\n /** Name the RadioButtons are registered at in HTML forms (react-hook-form). */\n name: string;\n /** Radio button configuration. */\n options: RadioTabsOption[];\n /** Id to grab element in internal tests. */\n testId?: string;\n /** How the RadioTabs should look like. */\n variant?: TabsProps['variant'];\n}\n\n/**\n * RadioTabs component based on [HeroUI RadioGroup](https://www.heroui.com//docs/components/radio-group)\n * and [HeroUI Tabs](https://www.heroui.com//docs/components/tabs)\n */\nconst RadioTabs = ({\n className = undefined,\n disabled = false,\n inline = false,\n label = undefined,\n name,\n options,\n testId: _testId = undefined,\n variant = undefined,\n}: RadioTabsProps): ReactElement => {\n const { control, debugMode, getFieldState } = useFormContext();\n const { error, invalid, required, testId } = getFieldState(name, _testId);\n\n const { field } = useController({ control, disabled, name });\n const { disabled: isDisabled, onBlur, onChange, ref, value } = field;\n\n const showTestIdCopyButton = debugMode === 'debug-testids';\n const showLabel = label || showTestIdCopyButton;\n\n const variants = radioTabsVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n const tabOptions = options.map<TabProps>((option) => ({\n content: option?.content,\n disabled: option?.disabled,\n key: option.value,\n label: option?.label || option?.value,\n testId: slugify(`option_${option?.testId || option?.value}`, {\n replaceDots: true,\n }),\n }));\n\n const disabledAllKeys: string[] | undefined = tabOptions?.map(\n (option) => option.key as string,\n );\n\n return (\n <HeroRadioGroup\n classNames={classNames}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n errorMessage={\n error && <FieldValidationError error={error} testId={testId} />\n }\n isDisabled={isDisabled}\n isInvalid={invalid}\n isRequired={required}\n label={\n showLabel && (\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n <label>\n {label}\n {showTestIdCopyButton && <FieldCopyTestIdButton testId={testId} />}\n </label>\n )\n }\n name={name}\n orientation={inline ? 'horizontal' : 'vertical'}\n onBlur={onBlur}\n ref={ref}\n >\n <Tabs\n disabledKeys={disabled ? disabledAllKeys : undefined}\n fullWidth={false}\n onSelectionChange={onChange}\n selectedKey={value}\n tabs={tabOptions as TabProps[]}\n testId={testId}\n variant={variant}\n />\n </HeroRadioGroup>\n );\n};\n\nexport default RadioTabs;\n","import RadioTabs from './RadioTabs';\n\nexport type { RadioTabsProps } from './RadioTabs';\n\nexport { RadioTabs };\n\nexport default RadioTabs;\n"],"mappings":";;;;;;;;;;;;AAKA,SAAS,cAAc,sBAA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AAA,MACd,iBAAe;AAAA,MACf,eAAa;AAAA,MACb,cACE,SAAS,oBAAC,gCAAqB,OAAc,QAAgB;AAAA,MAE/D;AAAA,MACA,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,OACE;AAAA,MAEE,qBAAC,WACE;AAAA;AAAA,QACA,wBAAwB,oBAAC,iCAAsB,QAAgB;AAAA,SAClE;AAAA,MAGJ;AAAA,MACA,aAAa,SAAS,eAAe;AAAA,MACrC;AAAA,MACA;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,cAAc,WAAW,kBAAkB;AAAA,UAC3C,WAAW;AAAA,UACX,mBAAmB;AAAA,
|
|
1
|
+
{"version":3,"sources":["../src/RadioTabs/RadioTabs.tsx","../src/RadioTabs/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { TabsProps } from '@fuf-stack/pixels';\nimport type { TabProps } from '@fuf-stack/pixels/Tabs';\nimport type { ReactElement, ReactNode } from 'react';\n\nimport { RadioGroup as HeroRadioGroup } from '@heroui/radio';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\nimport Tabs from '@fuf-stack/pixels/Tabs';\n\nimport { useController, useFormContext } from '../hooks';\nimport { FieldCopyTestIdButton } from '../partials/FieldCopyTestIdButton';\nimport { FieldValidationError } from '../partials/FieldValidationError';\n\nexport const radioTabsVariants = tv({\n slots: {\n base: 'group', // Needs group for group-data condition\n label:\n 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:text-danger',\n wrapper: '',\n tabList: '',\n tab: '',\n tabContent: '',\n cursor: '',\n panel: '',\n },\n});\n\ntype VariantProps = TVProps<typeof radioTabsVariants>;\ntype ClassName = TVClassName<typeof radioTabsVariants>;\n\nexport interface RadioTabsOption {\n /** Optional content inside of the tab */\n content?: ReactNode;\n /** disables the option */\n disabled?: boolean;\n /** option label */\n label?: React.ReactNode;\n /** option icon */\n icon?: ReactNode;\n /** HTML data-testid attribute of the option */\n testId?: string;\n /** option value */\n value: string;\n}\n\nexport interface RadioTabsProps extends VariantProps {\n /** CSS class name */\n className?: ClassName;\n /** Determines if the Buttons are disabled or not. */\n disabled?: boolean;\n /** determines orientation of the Buttons. */\n inline?: boolean;\n /** Label displayed next to the RadioButton. */\n label?: ReactNode;\n /** Name the RadioButtons are registered at in HTML forms (react-hook-form). */\n name: string;\n /** Radio button configuration. */\n options: RadioTabsOption[];\n /** Id to grab element in internal tests. */\n testId?: string;\n /** How the RadioTabs should look like. */\n variant?: TabsProps['variant'];\n}\n\n/**\n * RadioTabs component based on [HeroUI RadioGroup](https://www.heroui.com//docs/components/radio-group)\n * and [HeroUI Tabs](https://www.heroui.com//docs/components/tabs)\n */\nconst RadioTabs = ({\n className = undefined,\n disabled = false,\n inline = false,\n label = undefined,\n name,\n options,\n testId: _testId = undefined,\n variant = undefined,\n}: RadioTabsProps): ReactElement => {\n const { control, debugMode, getFieldState } = useFormContext();\n const { error, invalid, required, testId } = getFieldState(name, _testId);\n\n const { field } = useController({ control, disabled, name });\n const { disabled: isDisabled, onBlur, onChange, ref, value } = field;\n\n const showTestIdCopyButton = debugMode === 'debug-testids';\n const showLabel = label || showTestIdCopyButton;\n\n const variants = radioTabsVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n const tabOptions = options.map<TabProps>((option) => ({\n content: option?.content,\n disabled: option?.disabled,\n key: option.value,\n label: option?.label || option?.value,\n testId: slugify(`option_${option?.testId || option?.value}`, {\n replaceDots: true,\n }),\n }));\n\n const disabledAllKeys: string[] | undefined = tabOptions?.map(\n (option) => option.key as string,\n );\n\n return (\n <HeroRadioGroup\n classNames={classNames}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n errorMessage={\n error && <FieldValidationError error={error} testId={testId} />\n }\n isDisabled={isDisabled}\n isInvalid={invalid}\n isRequired={required}\n label={\n showLabel && (\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n <label>\n {label}\n {showTestIdCopyButton && <FieldCopyTestIdButton testId={testId} />}\n </label>\n )\n }\n name={name}\n orientation={inline ? 'horizontal' : 'vertical'}\n onBlur={onBlur}\n ref={ref}\n >\n <Tabs\n disabledKeys={disabled ? disabledAllKeys : undefined}\n fullWidth={false}\n onSelectionChange={onChange}\n // make sure component is controlled\n selectedKey={value ?? ''}\n tabs={tabOptions as TabProps[]}\n testId={testId}\n variant={variant}\n />\n </HeroRadioGroup>\n );\n};\n\nexport default RadioTabs;\n","import RadioTabs from './RadioTabs';\n\nexport type { RadioTabsProps } from './RadioTabs';\n\nexport { RadioTabs };\n\nexport default RadioTabs;\n"],"mappings":";;;;;;;;;;;;AAKA,SAAS,cAAc,sBAAsB;AAE7C,SAAS,SAAS,IAAI,4BAA4B;AAClD,OAAO,UAAU;AA0GA,cAQP,YARO;AApGV,IAAM,oBAAoB,GAAG;AAAA,EAClC,OAAO;AAAA,IACL,MAAM;AAAA;AAAA,IACN,OACE;AAAA,IACF,SAAS;AAAA,IACT,SAAS;AAAA,IACT,KAAK;AAAA,IACL,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AACF,CAAC;AA2CD,IAAM,YAAY,CAAC;AAAA,EACjB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,SAAS;AAAA,EACT,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,QAAQ,UAAU;AAAA,EAClB,UAAU;AACZ,MAAoC;AAClC,QAAM,EAAE,SAAS,WAAW,cAAc,IAAI,eAAe;AAC7D,QAAM,EAAE,OAAO,SAAS,UAAU,OAAO,IAAI,cAAc,MAAM,OAAO;AAExE,QAAM,EAAE,MAAM,IAAI,cAAc,EAAE,SAAS,UAAU,KAAK,CAAC;AAC3D,QAAM,EAAE,UAAU,YAAY,QAAQ,UAAU,KAAK,MAAM,IAAI;AAE/D,QAAM,uBAAuB,cAAc;AAC3C,QAAM,YAAY,SAAS;AAE3B,QAAM,WAAW,kBAAkB;AACnC,QAAM,aAAa,qBAAqB,UAAU,WAAW,MAAM;AAEnE,QAAM,aAAa,QAAQ,IAAc,CAAC,YAAY;AAAA,IACpD,SAAS,iCAAQ;AAAA,IACjB,UAAU,iCAAQ;AAAA,IAClB,KAAK,OAAO;AAAA,IACZ,QAAO,iCAAQ,WAAS,iCAAQ;AAAA,IAChC,QAAQ,QAAQ,WAAU,iCAAQ,YAAU,iCAAQ,MAAK,IAAI;AAAA,MAC3D,aAAa;AAAA,IACf,CAAC;AAAA,EACH,EAAE;AAEF,QAAM,kBAAwC,yCAAY;AAAA,IACxD,CAAC,WAAW,OAAO;AAAA;AAGrB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MAGA,gBAAc;AAAA,MACd,iBAAe;AAAA,MACf,eAAa;AAAA,MACb,cACE,SAAS,oBAAC,gCAAqB,OAAc,QAAgB;AAAA,MAE/D;AAAA,MACA,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,OACE;AAAA,MAEE,qBAAC,WACE;AAAA;AAAA,QACA,wBAAwB,oBAAC,iCAAsB,QAAgB;AAAA,SAClE;AAAA,MAGJ;AAAA,MACA,aAAa,SAAS,eAAe;AAAA,MACrC;AAAA,MACA;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,cAAc,WAAW,kBAAkB;AAAA,UAC3C,WAAW;AAAA,UACX,mBAAmB;AAAA,UAEnB,aAAa,wBAAS;AAAA,UACtB,MAAM;AAAA,UACN;AAAA,UACA;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,oBAAQ;;;AC7If,IAAOA,qBAAQ;","names":["RadioTabs_default"]}
|
|
@@ -83,7 +83,7 @@ var RadioTabs = ({
|
|
|
83
83
|
disabledKeys: disabled ? disabledAllKeys : void 0,
|
|
84
84
|
fullWidth: false,
|
|
85
85
|
onSelectionChange: onChange,
|
|
86
|
-
selectedKey: value,
|
|
86
|
+
selectedKey: value != null ? value : "",
|
|
87
87
|
tabs: tabOptions,
|
|
88
88
|
testId,
|
|
89
89
|
variant
|
|
@@ -101,4 +101,4 @@ var RadioTabs_default2 = RadioTabs_default;
|
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
exports.RadioTabs_default = RadioTabs_default; exports.RadioTabs_default2 = RadioTabs_default2;
|
|
104
|
-
//# sourceMappingURL=chunk-
|
|
104
|
+
//# sourceMappingURL=chunk-I4OVSJFQ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-I4OVSJFQ.cjs","../src/RadioTabs/RadioTabs.tsx","../src/RadioTabs/index.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACNA,sCAA6C;AAE7C,oDAAkD;AAClD,0FAAiB;AA0GA,+CAAA;AApGV,IAAM,kBAAA,EAAoB,4BAAA;AAAG,EAClC,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,OAAA;AAAA;AAAA,IACN,KAAA,EACE,oFAAA;AAAA,IACF,OAAA,EAAS,EAAA;AAAA,IACT,OAAA,EAAS,EAAA;AAAA,IACT,GAAA,EAAK,EAAA;AAAA,IACL,UAAA,EAAY,EAAA;AAAA,IACZ,MAAA,EAAQ,EAAA;AAAA,IACR,KAAA,EAAO;AAAA,EACT;AACF,CAAC,CAAA;AA2CD,IAAM,UAAA,EAAY,CAAC;AAAA,EACjB,UAAA,EAAY,KAAA,CAAA;AAAA,EACZ,SAAA,EAAW,KAAA;AAAA,EACX,OAAA,EAAS,KAAA;AAAA,EACT,MAAA,EAAQ,KAAA,CAAA;AAAA,EACR,IAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA,EAAQ,QAAA,EAAU,KAAA,CAAA;AAAA,EAClB,QAAA,EAAU,KAAA;AACZ,CAAA,EAAA,GAAoC;AACl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AAA,CAAU,OAAA,GAAA,KAAA,EAAA,KAAA,EAAA,EAAA,MAAA,CAAQ,KAAA,CAAK,CAAA,CAAA;AAC1C,MAAA;AACd,IAAA;AACD,EAAA;AAEwD,EAAA;AACrC,IAAA;AAAA,EAAA;AAInB,EAAA;AAAC,IAAA;AAAA,IAAA;AACC,MAAA;AAGc,MAAA;AACC,MAAA;AACF,MAAA;AAEkD,MAAA;AAE/D,MAAA;AACW,MAAA;AACC,MAAA;AAEV,MAAA;AAGK,sBAAA;AAAA,QAAA;AAC+D,QAAA;AAClE,MAAA;AAGJ,MAAA;AACqC,MAAA;AACrC,MAAA;AACA,MAAA;AAEA,MAAA;AAAC,QAAA;AAAA,QAAA;AAC4C,UAAA;AAChC,UAAA;AACQ,UAAA;AAEG,UAAA;AAChB,UAAA;AACN,UAAA;AACA,UAAA;AAAA,QAAA;AACF,MAAA;AAAA,IAAA;AACF,EAAA;AAEJ;AAEe;ADpDqG;AACA;AE1FrG;AF4FqG;AACA;AACA;AACA;AACA","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-I4OVSJFQ.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { TabsProps } from '@fuf-stack/pixels';\nimport type { TabProps } from '@fuf-stack/pixels/Tabs';\nimport type { ReactElement, ReactNode } from 'react';\n\nimport { RadioGroup as HeroRadioGroup } from '@heroui/radio';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\nimport Tabs from '@fuf-stack/pixels/Tabs';\n\nimport { useController, useFormContext } from '../hooks';\nimport { FieldCopyTestIdButton } from '../partials/FieldCopyTestIdButton';\nimport { FieldValidationError } from '../partials/FieldValidationError';\n\nexport const radioTabsVariants = tv({\n slots: {\n base: 'group', // Needs group for group-data condition\n label:\n 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:text-danger',\n wrapper: '',\n tabList: '',\n tab: '',\n tabContent: '',\n cursor: '',\n panel: '',\n },\n});\n\ntype VariantProps = TVProps<typeof radioTabsVariants>;\ntype ClassName = TVClassName<typeof radioTabsVariants>;\n\nexport interface RadioTabsOption {\n /** Optional content inside of the tab */\n content?: ReactNode;\n /** disables the option */\n disabled?: boolean;\n /** option label */\n label?: React.ReactNode;\n /** option icon */\n icon?: ReactNode;\n /** HTML data-testid attribute of the option */\n testId?: string;\n /** option value */\n value: string;\n}\n\nexport interface RadioTabsProps extends VariantProps {\n /** CSS class name */\n className?: ClassName;\n /** Determines if the Buttons are disabled or not. */\n disabled?: boolean;\n /** determines orientation of the Buttons. */\n inline?: boolean;\n /** Label displayed next to the RadioButton. */\n label?: ReactNode;\n /** Name the RadioButtons are registered at in HTML forms (react-hook-form). */\n name: string;\n /** Radio button configuration. */\n options: RadioTabsOption[];\n /** Id to grab element in internal tests. */\n testId?: string;\n /** How the RadioTabs should look like. */\n variant?: TabsProps['variant'];\n}\n\n/**\n * RadioTabs component based on [HeroUI RadioGroup](https://www.heroui.com//docs/components/radio-group)\n * and [HeroUI Tabs](https://www.heroui.com//docs/components/tabs)\n */\nconst RadioTabs = ({\n className = undefined,\n disabled = false,\n inline = false,\n label = undefined,\n name,\n options,\n testId: _testId = undefined,\n variant = undefined,\n}: RadioTabsProps): ReactElement => {\n const { control, debugMode, getFieldState } = useFormContext();\n const { error, invalid, required, testId } = getFieldState(name, _testId);\n\n const { field } = useController({ control, disabled, name });\n const { disabled: isDisabled, onBlur, onChange, ref, value } = field;\n\n const showTestIdCopyButton = debugMode === 'debug-testids';\n const showLabel = label || showTestIdCopyButton;\n\n const variants = radioTabsVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n const tabOptions = options.map<TabProps>((option) => ({\n content: option?.content,\n disabled: option?.disabled,\n key: option.value,\n label: option?.label || option?.value,\n testId: slugify(`option_${option?.testId || option?.value}`, {\n replaceDots: true,\n }),\n }));\n\n const disabledAllKeys: string[] | undefined = tabOptions?.map(\n (option) => option.key as string,\n );\n\n return (\n <HeroRadioGroup\n classNames={classNames}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n errorMessage={\n error && <FieldValidationError error={error} testId={testId} />\n }\n isDisabled={isDisabled}\n isInvalid={invalid}\n isRequired={required}\n label={\n showLabel && (\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n <label>\n {label}\n {showTestIdCopyButton && <FieldCopyTestIdButton testId={testId} />}\n </label>\n )\n }\n name={name}\n orientation={inline ? 'horizontal' : 'vertical'}\n onBlur={onBlur}\n ref={ref}\n >\n <Tabs\n disabledKeys={disabled ? disabledAllKeys : undefined}\n fullWidth={false}\n onSelectionChange={onChange}\n // make sure component is controlled\n selectedKey={value ?? ''}\n tabs={tabOptions as TabProps[]}\n testId={testId}\n variant={variant}\n />\n </HeroRadioGroup>\n );\n};\n\nexport default RadioTabs;\n","import RadioTabs from './RadioTabs';\n\nexport type { RadioTabsProps } from './RadioTabs';\n\nexport { RadioTabs };\n\nexport default RadioTabs;\n"]}
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkI4OVSJFQcjs = require('./chunk-I4OVSJFQ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkU3XAM5F4cjs = require('./chunk-U3XAM5F4.cjs');
|
|
@@ -9,7 +9,7 @@ var _chunkU3XAM5F4cjs = require('./chunk-U3XAM5F4.cjs');
|
|
|
9
9
|
var _chunkPL44Y7AMcjs = require('./chunk-PL44Y7AM.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkDOBUPJPNcjs = require('./chunk-DOBUPJPN.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunkAZT3TDWZcjs = require('./chunk-AZT3TDWZ.cjs');
|
|
@@ -88,5 +88,5 @@ require('./chunk-555JRYCS.cjs');
|
|
|
88
88
|
|
|
89
89
|
|
|
90
90
|
|
|
91
|
-
exports.CheckboxGroup = _chunkGKAVSIH3cjs.CheckboxGroup_default; exports.FieldArray = _chunkNMYLBRT5cjs.FieldArray_default; exports.FieldCopyTestIdButton = _chunkPA2DQCBYcjs.FieldCopyTestIdButton_default; exports.FieldValidationError = _chunkGNYQC5IJcjs.FieldValidationError_default; exports.Form = _chunkXALYGZ3Rcjs.Form_default; exports.Grid = _chunkTTD3KL6Ecjs.Grid_default; exports.Input = _chunkSG6PWCRLcjs.Input_default; exports.RadioBoxes = _chunkUOTSJ55Bcjs.RadioBoxes_default; exports.RadioGroup = _chunkSGXLTMB5cjs.RadioGroup_default; exports.RadioTabs =
|
|
91
|
+
exports.CheckboxGroup = _chunkGKAVSIH3cjs.CheckboxGroup_default; exports.FieldArray = _chunkNMYLBRT5cjs.FieldArray_default; exports.FieldCopyTestIdButton = _chunkPA2DQCBYcjs.FieldCopyTestIdButton_default; exports.FieldValidationError = _chunkGNYQC5IJcjs.FieldValidationError_default; exports.Form = _chunkXALYGZ3Rcjs.Form_default; exports.Grid = _chunkTTD3KL6Ecjs.Grid_default; exports.Input = _chunkSG6PWCRLcjs.Input_default; exports.RadioBoxes = _chunkUOTSJ55Bcjs.RadioBoxes_default; exports.RadioGroup = _chunkSGXLTMB5cjs.RadioGroup_default; exports.RadioTabs = _chunkI4OVSJFQcjs.RadioTabs_default; exports.Select = _chunkU3XAM5F4cjs.Select_default; exports.SubmitButton = _chunkPL44Y7AMcjs.SubmitButton_default; exports.Switch = _chunkDOBUPJPNcjs.Switch_default; exports.TextArea = _chunkAZT3TDWZcjs.TextArea_default; exports.checkFieldIsRequired = _chunkY6EAPURVcjs.checkFieldIsRequired; exports.fromNullishString = _chunkL4YPB7MUcjs.fromNullishString; exports.toFormFormat = _chunkL4YPB7MUcjs.toFormFormat; exports.toNullishString = _chunkL4YPB7MUcjs.toNullishString; exports.toValidationFormat = _chunkL4YPB7MUcjs.toValidationFormat; exports.useClientValidation = _chunkY6EAPURVcjs.useClientValidation; exports.useController = _chunkY6EAPURVcjs.useController; exports.useFieldArray = _chunkY6EAPURVcjs.useFieldArray; exports.useFormContext = _chunkY6EAPURVcjs.useFormContext; exports.useInput = _chunkY6EAPURVcjs.useInput; exports.useInputValueDebounce = _chunkOWWUTKGYcjs.useInputValueDebounce; exports.useInputValueTransform = _chunkP6HJOG7Dcjs.useInputValueTransform;
|
|
92
92
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.cts
CHANGED
|
@@ -16,7 +16,7 @@ export { R as RadioGroup, a as RadioGroupProps } from './RadioGroup-BJijfixt.cjs
|
|
|
16
16
|
export { R as RadioTabs, a as RadioTabsProps } from './RadioTabs-CT8PT7ky.cjs';
|
|
17
17
|
export { S as Select, a as SelectProps } from './Select-JRwrSDew.cjs';
|
|
18
18
|
export { S as SubmitButton, a as SubmitButtonProps } from './SubmitButton-C81VCkmx.cjs';
|
|
19
|
-
export { S as Switch, a as SwitchProps } from './Switch-
|
|
19
|
+
export { S as Switch, a as SwitchProps } from './Switch-BaMtW2HN.cjs';
|
|
20
20
|
export { T as TextArea, a as TextAreaProps } from './TextArea-DnFGyl4a.cjs';
|
|
21
21
|
import 'react/jsx-runtime';
|
|
22
22
|
import 'tailwind-variants';
|
|
@@ -27,3 +27,4 @@ import '@fuf-stack/veto';
|
|
|
27
27
|
import './FormContext-ldCpxKnY.cjs';
|
|
28
28
|
import '@fuf-stack/pixels';
|
|
29
29
|
import 'react-select';
|
|
30
|
+
import '@heroui/switch';
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export { R as RadioGroup, a as RadioGroupProps } from './RadioGroup-BJijfixt.js'
|
|
|
16
16
|
export { R as RadioTabs, a as RadioTabsProps } from './RadioTabs-CT8PT7ky.js';
|
|
17
17
|
export { S as Select, a as SelectProps } from './Select-JRwrSDew.js';
|
|
18
18
|
export { S as SubmitButton, a as SubmitButtonProps } from './SubmitButton-C81VCkmx.js';
|
|
19
|
-
export { S as Switch, a as SwitchProps } from './Switch-
|
|
19
|
+
export { S as Switch, a as SwitchProps } from './Switch-BaMtW2HN.js';
|
|
20
20
|
export { T as TextArea, a as TextAreaProps } from './TextArea-DnFGyl4a.js';
|
|
21
21
|
import 'react/jsx-runtime';
|
|
22
22
|
import 'tailwind-variants';
|
|
@@ -27,3 +27,4 @@ import '@fuf-stack/veto';
|
|
|
27
27
|
import './FormContext-ldCpxKnY.js';
|
|
28
28
|
import '@fuf-stack/pixels';
|
|
29
29
|
import 'react-select';
|
|
30
|
+
import '@heroui/switch';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RadioTabs_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GHO2VFUQ.js";
|
|
4
4
|
import {
|
|
5
5
|
Select_default
|
|
6
6
|
} from "./chunk-TCYPTU4E.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-3BE3GUCZ.js";
|
|
10
10
|
import {
|
|
11
11
|
Switch_default
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3PTHYFAU.js";
|
|
13
13
|
import {
|
|
14
14
|
TextArea_default
|
|
15
15
|
} from "./chunk-NNKOK5EU.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuf-stack/uniform",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "fuf react form library",
|
|
5
5
|
"author": "Hannes Tiede",
|
|
6
6
|
"homepage": "https://github.com/fuf-stack/pixels#readme",
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"react-icons": "5.5.0",
|
|
144
144
|
"react-hook-form": "7.55.0",
|
|
145
145
|
"react-select": "5.10.1",
|
|
146
|
-
"@fuf-stack/pixels": "0.
|
|
146
|
+
"@fuf-stack/pixels": "0.45.0",
|
|
147
147
|
"@fuf-stack/pixel-utils": "0.5.5",
|
|
148
148
|
"@fuf-stack/veto": "0.12.1"
|
|
149
149
|
},
|
|
@@ -155,8 +155,8 @@
|
|
|
155
155
|
"react-dom": "19.0.0",
|
|
156
156
|
"@repo/storybook-config": "0.0.1",
|
|
157
157
|
"@repo/tailwind-config": "0.0.1",
|
|
158
|
-
"@repo/
|
|
159
|
-
"@repo/
|
|
158
|
+
"@repo/vite-config": "0.0.1",
|
|
159
|
+
"@repo/tsup-config": "0.0.1"
|
|
160
160
|
},
|
|
161
161
|
"scripts": {
|
|
162
162
|
"build": "tsup --config node_modules/@repo/tsup-config/config.ts",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-IAMV2JNU.cjs","../src/RadioTabs/RadioTabs.tsx","../src/RadioTabs/index.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACNA,sCAA6C;AAE7C,oDAAkD;AAClD,0FAAiB;AA0GA,+CAAA;AApGV,IAAM,kBAAA,EAAoB,4BAAA;AAAG,EAClC,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,OAAA;AAAA;AAAA,IACN,KAAA,EACE,oFAAA;AAAA,IACF,OAAA,EAAS,EAAA;AAAA,IACT,OAAA,EAAS,EAAA;AAAA,IACT,GAAA,EAAK,EAAA;AAAA,IACL,UAAA,EAAY,EAAA;AAAA,IACZ,MAAA,EAAQ,EAAA;AAAA,IACR,KAAA,EAAO;AAAA,EACT;AACF,CAAC,CAAA;AA2CD,IAAM,UAAA,EAAY,CAAC;AAAA,EACjB,UAAA,EAAY,KAAA,CAAA;AAAA,EACZ,SAAA,EAAW,KAAA;AAAA,EACX,OAAA,EAAS,KAAA;AAAA,EACT,MAAA,EAAQ,KAAA,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,CAAQ,KAAA,CAAA;AAAA,IAChC,MAAA,EAAQ,iCAAA,CAAQ,OAAA,EAAA,CAAU,OAAA,GAAA,KAAA,EAAA,KAAA,EAAA,EAAA,MAAA,CAAQ,MAAA,EAAA,GAAA,CAAU,OAAA,GAAA,KAAA,EAAA,KAAA,EAAA,EAAA,MAAA,CAAQ,KAAA,CAAK,CAAA,CAAA;AAC1C,MAAA;AACd,IAAA;AACD,EAAA;AAEwD,EAAA;AACrC,IAAA;AAAA,EAAA;AAInB,EAAA;AAAC,IAAA;AAAA,IAAA;AACC,MAAA;AAGc,MAAA;AACC,MAAA;AACF,MAAA;AAEkD,MAAA;AAE/D,MAAA;AACW,MAAA;AACC,MAAA;AAEV,MAAA;AAGK,sBAAA;AAAA,QAAA;AAC+D,QAAA;AAClE,MAAA;AAGJ,MAAA;AACqC,MAAA;AACrC,MAAA;AACA,MAAA;AAEA,MAAA;AAAC,QAAA;AAAA,QAAA;AAC4C,UAAA;AAChC,UAAA;AACQ,UAAA;AACN,UAAA;AACP,UAAA;AACN,UAAA;AACA,UAAA;AAAA,QAAA;AACF,MAAA;AAAA,IAAA;AACF,EAAA;AAEJ;AAEe;ADnDqG;AACA;AE1FrG;AF4FqG;AACA;AACA;AACA;AACA","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-IAMV2JNU.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { TabsProps } from '@fuf-stack/pixels';\nimport type { TabProps } from '@fuf-stack/pixels/Tabs';\nimport type { ReactElement, ReactNode } from 'react';\n\nimport { RadioGroup as HeroRadioGroup } from '@heroui/radio';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\nimport Tabs from '@fuf-stack/pixels/Tabs';\n\nimport { useController, useFormContext } from '../hooks';\nimport { FieldCopyTestIdButton } from '../partials/FieldCopyTestIdButton';\nimport { FieldValidationError } from '../partials/FieldValidationError';\n\nexport const radioTabsVariants = tv({\n slots: {\n base: 'group', // Needs group for group-data condition\n label:\n 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:text-danger',\n wrapper: '',\n tabList: '',\n tab: '',\n tabContent: '',\n cursor: '',\n panel: '',\n },\n});\n\ntype VariantProps = TVProps<typeof radioTabsVariants>;\ntype ClassName = TVClassName<typeof radioTabsVariants>;\n\nexport interface RadioTabsOption {\n /** Optional content inside of the tab */\n content?: ReactNode;\n /** disables the option */\n disabled?: boolean;\n /** option label */\n label?: React.ReactNode;\n /** option icon */\n icon?: ReactNode;\n /** HTML data-testid attribute of the option */\n testId?: string;\n /** option value */\n value: string;\n}\n\nexport interface RadioTabsProps extends VariantProps {\n /** CSS class name */\n className?: ClassName;\n /** Determines if the Buttons are disabled or not. */\n disabled?: boolean;\n /** determines orientation of the Buttons. */\n inline?: boolean;\n /** Label displayed next to the RadioButton. */\n label?: ReactNode;\n /** Name the RadioButtons are registered at in HTML forms (react-hook-form). */\n name: string;\n /** Radio button configuration. */\n options: RadioTabsOption[];\n /** Id to grab element in internal tests. */\n testId?: string;\n /** How the RadioTabs should look like. */\n variant?: TabsProps['variant'];\n}\n\n/**\n * RadioTabs component based on [HeroUI RadioGroup](https://www.heroui.com//docs/components/radio-group)\n * and [HeroUI Tabs](https://www.heroui.com//docs/components/tabs)\n */\nconst RadioTabs = ({\n className = undefined,\n disabled = false,\n inline = false,\n label = undefined,\n name,\n options,\n testId: _testId = undefined,\n variant = undefined,\n}: RadioTabsProps): ReactElement => {\n const { control, debugMode, getFieldState } = useFormContext();\n const { error, invalid, required, testId } = getFieldState(name, _testId);\n\n const { field } = useController({ control, disabled, name });\n const { disabled: isDisabled, onBlur, onChange, ref, value } = field;\n\n const showTestIdCopyButton = debugMode === 'debug-testids';\n const showLabel = label || showTestIdCopyButton;\n\n const variants = radioTabsVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n const tabOptions = options.map<TabProps>((option) => ({\n content: option?.content,\n disabled: option?.disabled,\n key: option.value,\n label: option?.label || option?.value,\n testId: slugify(`option_${option?.testId || option?.value}`, {\n replaceDots: true,\n }),\n }));\n\n const disabledAllKeys: string[] | undefined = tabOptions?.map(\n (option) => option.key as string,\n );\n\n return (\n <HeroRadioGroup\n classNames={classNames}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n errorMessage={\n error && <FieldValidationError error={error} testId={testId} />\n }\n isDisabled={isDisabled}\n isInvalid={invalid}\n isRequired={required}\n label={\n showLabel && (\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n <label>\n {label}\n {showTestIdCopyButton && <FieldCopyTestIdButton testId={testId} />}\n </label>\n )\n }\n name={name}\n orientation={inline ? 'horizontal' : 'vertical'}\n onBlur={onBlur}\n ref={ref}\n >\n <Tabs\n disabledKeys={disabled ? disabledAllKeys : undefined}\n fullWidth={false}\n onSelectionChange={onChange}\n selectedKey={value}\n tabs={tabOptions as TabProps[]}\n testId={testId}\n variant={variant}\n />\n </HeroRadioGroup>\n );\n};\n\nexport default RadioTabs;\n","import RadioTabs from './RadioTabs';\n\nexport type { RadioTabsProps } from './RadioTabs';\n\nexport { RadioTabs };\n\nexport default RadioTabs;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Switch/Switch.tsx","../src/Switch/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\n\nimport { Switch as HeroSwitch } from '@heroui/switch';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useController, useFormContext, useInput } from '../hooks';\nimport { FieldCopyTestIdButton } from '../partials/FieldCopyTestIdButton';\nimport { FieldValidationError } from '../partials/FieldValidationError';\n\nexport const switchVariants = tv({\n slots: {\n base: '',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n outerWrapper: 'place-content-center',\n startContent: '',\n thumb: '',\n thumbIcon: '',\n wrapper: '',\n },\n});\n\ntype VariantProps = TVProps<typeof switchVariants>;\ntype ClassName = TVClassName<typeof switchVariants>;\n\nexport interface SwitchProps extends VariantProps {\n /** CSS class name */\n className?: ClassName;\n /** whether the select should be disabled */\n disabled?: boolean;\n /** component displayed next to the switch. */\n label?: React.ReactNode;\n /** name the field is registered under */\n name: string;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * Switch component based on [HeroUI Switch](https://www.heroui.com//docs/components/switch)\n */\nconst Switch = ({\n className = undefined,\n disabled = false,\n label: _label = undefined,\n name,\n testId: _testId = undefined,\n}: SwitchProps) => {\n const { control, debugMode, getFieldState } = useFormContext();\n const { error, required, testId, invalid } = getFieldState(name, _testId);\n\n const { field } = useController({ name, control, disabled });\n const { disabled: isDisabled, value, ref, onBlur, onChange } = field;\n\n const { label, getInputProps, getErrorMessageProps } = useInput({\n errorMessage: JSON.stringify(error),\n isInvalid: invalid,\n isRequired: required,\n label: _label,\n labelPlacement: 'outside',\n placeholder: ' ',\n });\n\n const variants = switchVariants();\n const classNames = variantsToClassNames(variants, className, 'outerWrapper');\n\n const showTestIdCopyButton = debugMode === 'debug-testids';\n\n return (\n <div className={classNames.outerWrapper}>\n <HeroSwitch\n aria-describedby={getInputProps()['aria-describedby']}\n classNames={classNames}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n isDisabled={isDisabled}\n isSelected={!!value}\n name={name}\n onBlur={onBlur}\n onValueChange={onChange}\n ref={ref}\n required={required}\n value={value}\n >\n {label}\n {showTestIdCopyButton && <FieldCopyTestIdButton testId={testId} />}\n </HeroSwitch>\n {error && (\n <div className={classNames.errorMessage}>\n <div\n /* eslint-disable-next-line react/jsx-props-no-spreading */\n {...getErrorMessageProps()}\n >\n <FieldValidationError error={error} testId={testId} />\n </div>\n </div>\n )}\n </div>\n );\n};\n\nexport default Switch;\n","import Switch from './Switch';\n\nexport type { SwitchProps } from './Switch';\n\nexport { Switch };\n\nexport default Switch;\n"],"mappings":";;;;;;;;;;;;;;;;;AAEA,SAAS,UAAU,kBAAkB;AAErC,SAAS,IAAI,4BAA4B;AAuEnC,SAkB2B,KAlB3B;AAjEC,IAAM,iBAAiB,GAAG;AAAA,EAC/B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,cAAc;AAAA;AAAA;AAAA,IAGd,OACE;AAAA,IACF,cAAc;AAAA,IACd,cAAc;AAAA,IACd,OAAO;AAAA,IACP,WAAW;AAAA,IACX,SAAS;AAAA,EACX;AACF,CAAC;AAqBD,IAAM,SAAS,CAAC;AAAA,EACd,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,OAAO,SAAS;AAAA,EAChB;AAAA,EACA,QAAQ,UAAU;AACpB,MAAmB;AACjB,QAAM,EAAE,SAAS,WAAW,cAAc,IAAI,eAAe;AAC7D,QAAM,EAAE,OAAO,UAAU,QAAQ,QAAQ,IAAI,cAAc,MAAM,OAAO;AAExE,QAAM,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,SAAS,SAAS,CAAC;AAC3D,QAAM,EAAE,UAAU,YAAY,OAAO,KAAK,QAAQ,SAAS,IAAI;AAE/D,QAAM,EAAE,OAAO,eAAe,qBAAqB,IAAI,SAAS;AAAA,IAC9D,cAAc,KAAK,UAAU,KAAK;AAAA,IAClC,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,gBAAgB;AAAA,IAChB,aAAa;AAAA,EACf,CAAC;AAED,QAAM,WAAW,eAAe;AAChC,QAAM,aAAa,qBAAqB,UAAU,WAAW,cAAc;AAE3E,QAAM,uBAAuB,cAAc;AAE3C,SACE,qBAAC,SAAI,WAAW,WAAW,cACzB;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,oBAAkB,cAAc,EAAE,kBAAkB;AAAA,QACpD;AAAA,QAGA,gBAAc;AAAA,QACd,iBAAe;AAAA,QACf,eAAa;AAAA,QACb;AAAA,QACA,YAAY,CAAC,CAAC;AAAA,QACd;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,QAEC;AAAA;AAAA,UACA,wBAAwB,oBAAC,iCAAsB,QAAgB;AAAA;AAAA;AAAA,IAClE;AAAA,IACC,SACC,oBAAC,SAAI,WAAW,WAAW,cACzB;AAAA,MAAC;AAAA,uCAEK,qBAAqB,IAF1B;AAAA,QAIC,8BAAC,gCAAqB,OAAc,QAAgB;AAAA;AAAA,IACtD,GACF;AAAA,KAEJ;AAEJ;AAEA,IAAO,iBAAQ;;;ACvGf,IAAOA,kBAAQ;","names":["Switch_default"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-QTROOQ53.cjs","../src/Switch/Switch.tsx","../src/Switch/index.ts"],"names":["Switch_default"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACdA,wCAAqC;AAErC,oDAAyC;AAuEnC,+CAAA;AAjEC,IAAM,eAAA,EAAiB,4BAAA;AAAG,EAC/B,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,EAAA;AAAA,IACN,UAAA,EAAY,EAAA;AAAA,IACZ,YAAA,EAAc,WAAA;AAAA;AAAA;AAAA,IAGd,KAAA,EACE,yNAAA;AAAA,IACF,YAAA,EAAc,sBAAA;AAAA,IACd,YAAA,EAAc,EAAA;AAAA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ACE,8BAAA,KAAC,EAAA,EAAI,SAAA,EAAW,UAAA,CAAW,YAAA,EACzB,QAAA,EAAA;AAAA,oBAAA,8BAAA;AAAA,MAAC,cAAA;AAAA,MAAA;AAAA,QACC,kBAAA,EAAkB,aAAA,CAAc,CAAA,CAAE,kBAAkB,CAAA;AAAA,QACpD,UAAA;AAAA,QAGA,cAAA,EAAc,OAAA;AAAA,QACd,eAAA,EAAe,QAAA;AAAA,QACf,aAAA,EAAa,MAAA;AAAA,QACb,UAAA;AAAA,QACA,UAAA,EAAY,CAAC,CAAC,KAAA;AAAA,QACd,IAAA;AAAA,QACA,MAAA;AAAA,QACA,aAAA,EAAe,QAAA;AAAA,QACf,GAAA;AAAA,QACA,QAAA;AAAA,QACA,KAAA;AAAA,QAEC,QAAA,EAAA;AAAA,UAAA,KAAA;AAAA,UACA,qBAAA,mBAAwB,6BAAA,+CAAC,EAAA,EAAsB,OAAA,CAAgB;AAAA,QAAA;AAAA,MAAA;AAAA,IAClE,CAAA;AAAA,IACC,MAAA,mBACC,6BAAA,KAAC,EAAA,EAAI,SAAA,EAAW,UAAA,CAAW,YAAA,EACzB,QAAA,kBAAA,6BAAA;AAAA,MAAC,KAAA;AAAA,MAAA,6CAAA,8CAAA,CAAA,CAAA,EAEK,oBAAA,CAAqB,CAAA,CAAA,EAF1B;AAAA,QAIC,QAAA,kBAAA,6BAAA,8CAAC,EAAA,EAAqB,KAAA,EAAc,OAAA,CAAgB;AAAA,MAAA,CAAA;AAAA,IACtD,EAAA,CACF;AAAA,EAAA,EAAA,CAEJ,CAAA;AAEJ,CAAA;AAEA,IAAO,eAAA,EAAQ,MAAA;ADpBf;AACA;AEpFA,IAAOA,gBAAAA,EAAQ,cAAA;AFsFf;AACA;AACE;AACA;AACF,mFAAC","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-QTROOQ53.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\n\nimport { Switch as HeroSwitch } from '@heroui/switch';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useController, useFormContext, useInput } from '../hooks';\nimport { FieldCopyTestIdButton } from '../partials/FieldCopyTestIdButton';\nimport { FieldValidationError } from '../partials/FieldValidationError';\n\nexport const switchVariants = tv({\n slots: {\n base: '',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n outerWrapper: 'place-content-center',\n startContent: '',\n thumb: '',\n thumbIcon: '',\n wrapper: '',\n },\n});\n\ntype VariantProps = TVProps<typeof switchVariants>;\ntype ClassName = TVClassName<typeof switchVariants>;\n\nexport interface SwitchProps extends VariantProps {\n /** CSS class name */\n className?: ClassName;\n /** whether the select should be disabled */\n disabled?: boolean;\n /** component displayed next to the switch. */\n label?: React.ReactNode;\n /** name the field is registered under */\n name: string;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * Switch component based on [HeroUI Switch](https://www.heroui.com//docs/components/switch)\n */\nconst Switch = ({\n className = undefined,\n disabled = false,\n label: _label = undefined,\n name,\n testId: _testId = undefined,\n}: SwitchProps) => {\n const { control, debugMode, getFieldState } = useFormContext();\n const { error, required, testId, invalid } = getFieldState(name, _testId);\n\n const { field } = useController({ name, control, disabled });\n const { disabled: isDisabled, value, ref, onBlur, onChange } = field;\n\n const { label, getInputProps, getErrorMessageProps } = useInput({\n errorMessage: JSON.stringify(error),\n isInvalid: invalid,\n isRequired: required,\n label: _label,\n labelPlacement: 'outside',\n placeholder: ' ',\n });\n\n const variants = switchVariants();\n const classNames = variantsToClassNames(variants, className, 'outerWrapper');\n\n const showTestIdCopyButton = debugMode === 'debug-testids';\n\n return (\n <div className={classNames.outerWrapper}>\n <HeroSwitch\n aria-describedby={getInputProps()['aria-describedby']}\n classNames={classNames}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n isDisabled={isDisabled}\n isSelected={!!value}\n name={name}\n onBlur={onBlur}\n onValueChange={onChange}\n ref={ref}\n required={required}\n value={value}\n >\n {label}\n {showTestIdCopyButton && <FieldCopyTestIdButton testId={testId} />}\n </HeroSwitch>\n {error && (\n <div className={classNames.errorMessage}>\n <div\n /* eslint-disable-next-line react/jsx-props-no-spreading */\n {...getErrorMessageProps()}\n >\n <FieldValidationError error={error} testId={testId} />\n </div>\n </div>\n )}\n </div>\n );\n};\n\nexport default Switch;\n","import Switch from './Switch';\n\nexport type { SwitchProps } from './Switch';\n\nexport { Switch };\n\nexport default Switch;\n"]}
|