@utilitywarehouse/hearth-react 0.1.0 → 0.2.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/{chunk-NYIZVR6U.cjs → chunk-37CE6EWY.cjs} +2 -2
- package/dist/chunk-37CE6EWY.cjs.map +1 -0
- package/dist/chunk-5OLLJKEO.js +2 -0
- package/dist/chunk-5OLLJKEO.js.map +1 -0
- package/dist/{chunk-WTEYCV3P.cjs → chunk-62VG5C3S.cjs} +2 -2
- package/dist/{chunk-WTEYCV3P.cjs.map → chunk-62VG5C3S.cjs.map} +1 -1
- package/dist/chunk-7BCHAXO2.js +2 -0
- package/dist/chunk-7BCHAXO2.js.map +1 -0
- package/dist/chunk-CQN4SZBT.js +2 -0
- package/dist/chunk-CQN4SZBT.js.map +1 -0
- package/dist/chunk-D6CQM2ZR.cjs +2 -0
- package/dist/chunk-D6CQM2ZR.cjs.map +1 -0
- package/dist/{chunk-LNST5XBT.js → chunk-DV32RESS.js} +2 -2
- package/dist/chunk-DV32RESS.js.map +1 -0
- package/dist/{chunk-3YGPQZGB.cjs → chunk-ETLTIDOX.cjs} +2 -2
- package/dist/{chunk-3YGPQZGB.cjs.map → chunk-ETLTIDOX.cjs.map} +1 -1
- package/dist/{chunk-6BKRNOB3.js → chunk-GBMQ4HCH.js} +2 -2
- package/dist/{chunk-UNKKBMOV.cjs → chunk-GSDFAL3H.cjs} +2 -2
- package/dist/{chunk-UNKKBMOV.cjs.map → chunk-GSDFAL3H.cjs.map} +1 -1
- package/dist/{chunk-FI7OM2M2.js → chunk-H7IDH6CJ.js} +2 -2
- package/dist/chunk-H7IDH6CJ.js.map +1 -0
- package/dist/{chunk-Y7BOCUYW.js → chunk-HKCUTYXG.js} +2 -2
- package/dist/chunk-HSPOCJ5A.cjs +2 -0
- package/dist/chunk-HSPOCJ5A.cjs.map +1 -0
- package/dist/chunk-JMAJZ2BL.cjs +2 -0
- package/dist/chunk-JMAJZ2BL.cjs.map +1 -0
- package/dist/{chunk-RA7PIIC6.cjs → chunk-JSIJQQYE.cjs} +2 -2
- package/dist/{chunk-RA7PIIC6.cjs.map → chunk-JSIJQQYE.cjs.map} +1 -1
- package/dist/{chunk-B32JIOPJ.js → chunk-KTWZRVIV.js} +2 -2
- package/dist/chunk-KTWZRVIV.js.map +1 -0
- package/dist/chunk-KW4TIBGT.js +2 -0
- package/dist/chunk-KW4TIBGT.js.map +1 -0
- package/dist/chunk-PDRE4SEJ.cjs +2 -0
- package/dist/chunk-PDRE4SEJ.cjs.map +1 -0
- package/dist/{chunk-JOYUGBJ2.js → chunk-PG455XUN.js} +2 -2
- package/dist/{chunk-YOH3OE2C.js → chunk-QGXYOTLB.js} +2 -2
- package/dist/chunk-SGZVBXYO.js +2 -0
- package/dist/chunk-SGZVBXYO.js.map +1 -0
- package/dist/chunk-SH7GIFPO.js +2 -0
- package/dist/chunk-SH7GIFPO.js.map +1 -0
- package/dist/chunk-T64W7Q7K.js +2 -0
- package/dist/chunk-T64W7Q7K.js.map +1 -0
- package/dist/{chunk-QUG4RSGO.cjs → chunk-UDOWEUCM.cjs} +2 -2
- package/dist/chunk-UDOWEUCM.cjs.map +1 -0
- package/dist/{chunk-QE7SFMVD.cjs → chunk-WOCOHW6C.cjs} +2 -2
- package/dist/chunk-WOCOHW6C.cjs.map +1 -0
- package/dist/chunk-XKYU3KUY.cjs +2 -0
- package/dist/chunk-XKYU3KUY.cjs.map +1 -0
- package/dist/chunk-XL3DXWPW.cjs +2 -0
- package/dist/chunk-XL3DXWPW.cjs.map +1 -0
- package/dist/chunk-XZNPGGRR.js +2 -0
- package/dist/chunk-XZNPGGRR.js.map +1 -0
- package/dist/{chunk-N2FOD332.cjs → chunk-Z5EIP7KH.cjs} +2 -2
- package/dist/chunk-Z5EIP7KH.cjs.map +1 -0
- package/dist/{chunk-MLABIXLN.cjs → chunk-ZJM6ZMUH.cjs} +2 -2
- package/dist/chunk-ZJM6ZMUH.cjs.map +1 -0
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.props.cjs +1 -1
- package/dist/components/Button/Button.props.d.cts +9 -0
- package/dist/components/Button/Button.props.d.ts +9 -0
- package/dist/components/Button/Button.props.js +1 -1
- package/dist/components/Checkbox/Checkbox.cjs +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.cjs +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.cjs.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.context.cjs +2 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.context.cjs.map +1 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.context.d.cts +13 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.context.d.ts +13 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.context.js +2 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.d.cts +5 -7
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +5 -7
- package/dist/components/CheckboxGroup/CheckboxGroup.js +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.props.d.cts +7 -16
- package/dist/components/CheckboxGroup/CheckboxGroup.props.d.ts +7 -16
- package/dist/components/CheckboxTile/CheckboxTile.cjs +1 -1
- package/dist/components/CheckboxTile/CheckboxTile.js +1 -1
- package/dist/components/FormGroupBase/FormGroupBase.cjs +2 -0
- package/dist/components/FormGroupBase/FormGroupBase.cjs.map +1 -0
- package/dist/components/FormGroupBase/FormGroupBase.context.cjs +2 -0
- package/dist/components/FormGroupBase/FormGroupBase.context.cjs.map +1 -0
- package/dist/components/FormGroupBase/FormGroupBase.context.d.cts +11 -0
- package/dist/components/FormGroupBase/FormGroupBase.context.d.ts +11 -0
- package/dist/components/FormGroupBase/FormGroupBase.context.js +2 -0
- package/dist/components/{Fieldset/Fieldset.d.cts → FormGroupBase/FormGroupBase.d.cts} +3 -3
- package/dist/components/{Fieldset/Fieldset.d.ts → FormGroupBase/FormGroupBase.d.ts} +3 -3
- package/dist/components/FormGroupBase/FormGroupBase.js +2 -0
- package/dist/components/FormGroupBase/FormGroupBase.props.cjs +1 -0
- package/dist/components/FormGroupBase/FormGroupBase.props.cjs.map +1 -0
- package/dist/components/{Fieldset/Fieldset.props.d.cts → FormGroupBase/FormGroupBase.props.d.cts} +2 -2
- package/dist/components/{Fieldset/Fieldset.props.d.ts → FormGroupBase/FormGroupBase.props.d.ts} +2 -2
- package/dist/components/FormGroupBase/FormGroupBase.props.js +1 -0
- package/dist/components/{FieldsetLegend/FieldsetLegend.cjs → FormGroupBase/Legend.cjs} +2 -2
- package/dist/components/FormGroupBase/Legend.cjs.map +1 -0
- package/dist/components/FormGroupBase/Legend.js +2 -0
- package/dist/components/FormGroupBase/Legend.js.map +1 -0
- package/dist/components/FormGroupBase/Legend.props.cjs.map +1 -0
- package/dist/components/PasswordInput/PasswordInput.cjs +1 -1
- package/dist/components/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/Radio/Radio.cjs +1 -1
- package/dist/components/Radio/Radio.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.cjs +1 -1
- package/dist/components/RadioGroup/RadioGroup.cjs.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.cts +4 -5
- package/dist/components/RadioGroup/RadioGroup.d.ts +4 -5
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.props.d.cts +3 -9
- package/dist/components/RadioGroup/RadioGroup.props.d.ts +3 -9
- package/dist/components/RadioTile/RadioTile.cjs +1 -1
- package/dist/components/RadioTile/RadioTile.js +1 -1
- package/dist/components/SearchInput/SearchInput.cjs +1 -1
- package/dist/components/SearchInput/SearchInput.js +1 -1
- package/dist/components/TextArea/TextArea.cjs +1 -1
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/TextInput/TextInput.cjs +1 -1
- package/dist/components/TextInput/TextInput.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -8
- package/dist/index.d.ts +4 -8
- package/dist/index.js +1 -1
- package/package.json +3 -3
- package/styles.css +39 -52
- package/dist/chunk-B32JIOPJ.js.map +0 -1
- package/dist/chunk-BBH2BLZX.cjs +0 -2
- package/dist/chunk-BBH2BLZX.cjs.map +0 -1
- package/dist/chunk-BC7Y6MZO.js +0 -2
- package/dist/chunk-BC7Y6MZO.js.map +0 -1
- package/dist/chunk-BJ2OK6RA.js +0 -2
- package/dist/chunk-BJ2OK6RA.js.map +0 -1
- package/dist/chunk-BYAQL5FQ.js +0 -2
- package/dist/chunk-BYAQL5FQ.js.map +0 -1
- package/dist/chunk-CEGUCKZW.js +0 -2
- package/dist/chunk-CEGUCKZW.js.map +0 -1
- package/dist/chunk-DKMO72XC.cjs +0 -2
- package/dist/chunk-DKMO72XC.cjs.map +0 -1
- package/dist/chunk-FI7OM2M2.js.map +0 -1
- package/dist/chunk-G4BATINY.js +0 -2
- package/dist/chunk-G4BATINY.js.map +0 -1
- package/dist/chunk-ICPNBPYR.cjs +0 -2
- package/dist/chunk-ICPNBPYR.cjs.map +0 -1
- package/dist/chunk-IKUFQM7T.js +0 -2
- package/dist/chunk-IKUFQM7T.js.map +0 -1
- package/dist/chunk-JEB5LCIV.cjs +0 -2
- package/dist/chunk-JEB5LCIV.cjs.map +0 -1
- package/dist/chunk-LNST5XBT.js.map +0 -1
- package/dist/chunk-MLABIXLN.cjs.map +0 -1
- package/dist/chunk-N2FOD332.cjs.map +0 -1
- package/dist/chunk-NYIZVR6U.cjs.map +0 -1
- package/dist/chunk-O63GLLKH.cjs +0 -2
- package/dist/chunk-O63GLLKH.cjs.map +0 -1
- package/dist/chunk-OFJ7WSSK.cjs +0 -2
- package/dist/chunk-OFJ7WSSK.cjs.map +0 -1
- package/dist/chunk-PFCKEVNT.cjs +0 -2
- package/dist/chunk-PFCKEVNT.cjs.map +0 -1
- package/dist/chunk-QE7SFMVD.cjs.map +0 -1
- package/dist/chunk-QEWR2ON7.js +0 -2
- package/dist/chunk-QEWR2ON7.js.map +0 -1
- package/dist/chunk-QUG4RSGO.cjs.map +0 -1
- package/dist/chunk-RSZBNTZ7.js +0 -2
- package/dist/chunk-RSZBNTZ7.js.map +0 -1
- package/dist/chunk-TKW3USYF.js +0 -2
- package/dist/chunk-TKW3USYF.js.map +0 -1
- package/dist/chunk-V63VK7GL.cjs +0 -2
- package/dist/chunk-V63VK7GL.cjs.map +0 -1
- package/dist/chunk-Z27JG5SL.js +0 -2
- package/dist/chunk-Z27JG5SL.js.map +0 -1
- package/dist/components/CheckboxGroupBase/CheckboxGroupBase.cjs +0 -2
- package/dist/components/CheckboxGroupBase/CheckboxGroupBase.cjs.map +0 -1
- package/dist/components/CheckboxGroupBase/CheckboxGroupBase.context.cjs +0 -2
- package/dist/components/CheckboxGroupBase/CheckboxGroupBase.context.cjs.map +0 -1
- package/dist/components/CheckboxGroupBase/CheckboxGroupBase.context.d.cts +0 -13
- package/dist/components/CheckboxGroupBase/CheckboxGroupBase.context.d.ts +0 -13
- package/dist/components/CheckboxGroupBase/CheckboxGroupBase.context.js +0 -2
- package/dist/components/CheckboxGroupBase/CheckboxGroupBase.d.cts +0 -11
- package/dist/components/CheckboxGroupBase/CheckboxGroupBase.d.ts +0 -11
- package/dist/components/CheckboxGroupBase/CheckboxGroupBase.js +0 -2
- package/dist/components/CheckboxGroupBase/CheckboxGroupBase.props.cjs +0 -1
- package/dist/components/CheckboxGroupBase/CheckboxGroupBase.props.cjs.map +0 -1
- package/dist/components/CheckboxGroupBase/CheckboxGroupBase.props.d.cts +0 -11
- package/dist/components/CheckboxGroupBase/CheckboxGroupBase.props.d.ts +0 -11
- package/dist/components/CheckboxGroupBase/CheckboxGroupBase.props.js +0 -1
- package/dist/components/Fieldset/Fieldset.cjs +0 -2
- package/dist/components/Fieldset/Fieldset.cjs.map +0 -1
- package/dist/components/Fieldset/Fieldset.context.cjs +0 -2
- package/dist/components/Fieldset/Fieldset.context.cjs.map +0 -1
- package/dist/components/Fieldset/Fieldset.context.d.cts +0 -11
- package/dist/components/Fieldset/Fieldset.context.d.ts +0 -11
- package/dist/components/Fieldset/Fieldset.context.js +0 -2
- package/dist/components/Fieldset/Fieldset.js +0 -2
- package/dist/components/Fieldset/Fieldset.js.map +0 -1
- package/dist/components/Fieldset/Fieldset.props.cjs +0 -1
- package/dist/components/Fieldset/Fieldset.props.cjs.map +0 -1
- package/dist/components/Fieldset/Fieldset.props.js +0 -1
- package/dist/components/Fieldset/Fieldset.props.js.map +0 -1
- package/dist/components/FieldsetLegend/FieldsetLegend.cjs.map +0 -1
- package/dist/components/FieldsetLegend/FieldsetLegend.d.cts +0 -8
- package/dist/components/FieldsetLegend/FieldsetLegend.d.ts +0 -8
- package/dist/components/FieldsetLegend/FieldsetLegend.js +0 -2
- package/dist/components/FieldsetLegend/FieldsetLegend.js.map +0 -1
- package/dist/components/FieldsetLegend/FieldsetLegend.props.cjs +0 -1
- package/dist/components/FieldsetLegend/FieldsetLegend.props.cjs.map +0 -1
- package/dist/components/FieldsetLegend/FieldsetLegend.props.d.cts +0 -8
- package/dist/components/FieldsetLegend/FieldsetLegend.props.d.ts +0 -8
- package/dist/components/FieldsetLegend/FieldsetLegend.props.js +0 -1
- package/dist/components/FieldsetLegend/FieldsetLegend.props.js.map +0 -1
- package/dist/components/Legend/Legend.cjs +0 -2
- package/dist/components/Legend/Legend.cjs.map +0 -1
- package/dist/components/Legend/Legend.js +0 -2
- package/dist/components/Legend/Legend.js.map +0 -1
- package/dist/components/Legend/Legend.props.cjs.map +0 -1
- /package/dist/{chunk-6BKRNOB3.js.map → chunk-GBMQ4HCH.js.map} +0 -0
- /package/dist/{chunk-Y7BOCUYW.js.map → chunk-HKCUTYXG.js.map} +0 -0
- /package/dist/{chunk-JOYUGBJ2.js.map → chunk-PG455XUN.js.map} +0 -0
- /package/dist/{chunk-YOH3OE2C.js.map → chunk-QGXYOTLB.js.map} +0 -0
- /package/dist/components/{CheckboxGroupBase/CheckboxGroupBase.context.js.map → CheckboxGroup/CheckboxGroup.context.js.map} +0 -0
- /package/dist/components/{CheckboxGroupBase/CheckboxGroupBase.js.map → FormGroupBase/FormGroupBase.context.js.map} +0 -0
- /package/dist/components/{CheckboxGroupBase/CheckboxGroupBase.props.js.map → FormGroupBase/FormGroupBase.js.map} +0 -0
- /package/dist/components/{Fieldset/Fieldset.context.js.map → FormGroupBase/FormGroupBase.props.js.map} +0 -0
- /package/dist/components/{Legend → FormGroupBase}/Legend.d.cts +0 -0
- /package/dist/components/{Legend → FormGroupBase}/Legend.d.ts +0 -0
- /package/dist/components/{Legend → FormGroupBase}/Legend.props.cjs +0 -0
- /package/dist/components/{Legend → FormGroupBase}/Legend.props.d.cts +0 -0
- /package/dist/components/{Legend → FormGroupBase}/Legend.props.d.ts +0 -0
- /package/dist/components/{Legend → FormGroupBase}/Legend.props.js +0 -0
- /package/dist/components/{Legend → FormGroupBase}/Legend.props.js.map +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkGFWH3VRNcjs = require('./chunk-GFWH3VRN.cjs');var _chunkK5BEIZDAcjs = require('./chunk-K5BEIZDA.cjs');var
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkGFWH3VRNcjs = require('./chunk-GFWH3VRN.cjs');var _chunkK5BEIZDAcjs = require('./chunk-K5BEIZDA.cjs');var _chunkHSPOCJ5Acjs = require('./chunk-HSPOCJ5A.cjs');var _chunkUDOWEUCMcjs = require('./chunk-UDOWEUCM.cjs');var _chunkVRX67OL2cjs = require('./chunk-VRX67OL2.cjs');var _chunkTMWB3U4Xcjs = require('./chunk-TMWB3U4X.cjs');var _chunk4H5JT5ORcjs = require('./chunk-4H5JT5OR.cjs');var _react = require('react'); var e = _interopRequireWildcard(_react);var _clsx = require('clsx'); var _clsx2 = _interopRequireDefault(_clsx);var _hearthreacticons = require('@utilitywarehouse/hearth-react-icons');var _radixui = require('radix-ui');var R="CheckboxTile",U=_chunk4H5JT5ORcjs.b.call(void 0, R),B= exports.a =e.forwardRef(({className:I,id:y,disabled:a,value:o="on",onCheckedChange:i,label:c,helperText:l,"aria-labelledby":N,...G},H)=>{let{id:m,labelId:s,helperTextId:n}=_chunkTMWB3U4Xcjs.a.call(void 0, {providedId:y,prefix:"radio"}),r=_chunkHSPOCJ5Acjs.c.call(void 0, ),t=_chunkUDOWEUCMcjs.c.call(void 0, ),w=_optionalChain([t, 'optionalAccess', _ => _.value, 'optionalAccess', _2 => _2.includes, 'call', _3 => _3(o)]),E=_optionalChain([r, 'optionalAccess', _4 => _4.hasGroupHelperText]),F=r?r["aria-describedby"]:"",d=!E&&!!l,L=!!c;return e.createElement("label",{className:_clsx2.default.call(void 0, U,I),"data-disabled":a?"":void 0},e.createElement(_radixui.Checkbox.Root,{ref:H,className:"hearth-CheckboxRoot",name:_optionalChain([t, 'optionalAccess', _5 => _5.name]),checked:w,value:o,...G,id:m,disabled:a,"aria-describedby":d?n:F,"aria-labelledby":N||L?s:void 0,onCheckedChange:b=>{r&&(b?_optionalChain([t, 'optionalAccess', _6 => _6.onItemCheck, 'call', _7 => _7(o)]):_optionalChain([t, 'optionalAccess', _8 => _8.onItemUncheck, 'call', _9 => _9(o)])),i&&i(b)}},e.createElement(_radixui.Checkbox.Indicator,{asChild:!0,className:"hearth-CheckboxIndicator"},e.createElement(_hearthreacticons.TickSmallIcon,null))),e.createElement(_chunkVRX67OL2cjs.a,{direction:"column"},e.createElement(_chunkGFWH3VRNcjs.a,{id:s,htmlFor:m,disableUserSelect:!0},c),d?e.createElement(_chunkK5BEIZDAcjs.a,{id:n,disableUserSelect:!0},l):null))});B.displayName=R;exports.a = B;
|
|
2
|
+
//# sourceMappingURL=chunk-37CE6EWY.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/hearth/hearth/packages/react/dist/chunk-37CE6EWY.cjs","../src/components/CheckboxTile/CheckboxTile.tsx"],"names":["componentName","componentClassName","withGlobalPrefix","CheckboxTile","className","providedId","disabled","value","onCheckedChange","label","helperText","ariaLabelledby","props","ref","id","labelId","helperTextId","useIds","context","useFormGroupBase","checkboxContext","useCheckboxGroup","checked","hasGroupHelperText","ariaDescribedby","showHelperText","showLabel","clsx","RadixCheckbox","TickSmallIcon","Flex","Label","HelperText"],"mappings":"AAAA,u/BAAwC,wDAAyC,wDAAyC,wDA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AAAA,cAAAA","file":"/home/runner/work/hearth/hearth/packages/react/dist/chunk-37CE6EWY.cjs","sourcesContent":[null,"import * as React from 'react';\n\nimport clsx from 'clsx';\n\nimport { CheckboxTileProps } from './CheckboxTile.props';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport type { ElementRef } from 'react';\nimport { useIds } from '../../hooks/use-ids';\nimport { TickSmallIcon } from '@utilitywarehouse/hearth-react-icons';\nimport { Label } from '../Label/Label';\nimport { HelperText } from '../HelperText/HelperText';\nimport { Flex } from '../Flex/Flex';\nimport { Checkbox as RadixCheckbox } from 'radix-ui';\nimport { useCheckboxGroup } from '../CheckboxGroup/CheckboxGroup.context';\nimport { useFormGroupBase } from '../FormGroupBase/FormGroupBase.context';\n\nconst componentName = 'CheckboxTile';\nconst componentClassName = withGlobalPrefix(componentName);\n\ntype CheckboxTileElement = ElementRef<'button'>;\n\nexport const CheckboxTile = React.forwardRef<CheckboxTileElement, CheckboxTileProps>(\n (\n {\n className,\n id: providedId,\n disabled,\n value = 'on',\n onCheckedChange,\n label,\n helperText,\n 'aria-labelledby': ariaLabelledby,\n ...props\n },\n ref\n ) => {\n const { id, labelId, helperTextId } = useIds({ providedId, prefix: 'radio' });\n const context = useFormGroupBase();\n const checkboxContext = useCheckboxGroup();\n const checked = checkboxContext?.value?.includes(value);\n const hasGroupHelperText = context?.hasGroupHelperText;\n const ariaDescribedby = context ? context['aria-describedby'] : '';\n const showHelperText = !hasGroupHelperText && !!helperText;\n const showLabel = !!label;\n return (\n <label\n className={clsx(componentClassName, className)}\n data-disabled={disabled ? '' : undefined}\n >\n <RadixCheckbox.Root\n ref={ref}\n className=\"hearth-CheckboxRoot\"\n name={checkboxContext?.name}\n checked={checked}\n value={value}\n {...props}\n id={id}\n disabled={disabled}\n aria-describedby={showHelperText ? helperTextId : ariaDescribedby}\n aria-labelledby={ariaLabelledby || showLabel ? labelId : undefined}\n onCheckedChange={(checked: boolean) => {\n if (context) {\n if (checked) {\n checkboxContext?.onItemCheck(value);\n } else {\n checkboxContext?.onItemUncheck(value);\n }\n }\n if (onCheckedChange) {\n onCheckedChange(checked);\n }\n }}\n >\n <RadixCheckbox.Indicator asChild className=\"hearth-CheckboxIndicator\">\n <TickSmallIcon />\n </RadixCheckbox.Indicator>\n </RadixCheckbox.Root>\n <Flex direction=\"column\">\n <Label id={labelId} htmlFor={id} disableUserSelect>\n {label}\n </Label>\n {showHelperText ? (\n <HelperText id={helperTextId} disableUserSelect>\n {helperText}\n </HelperText>\n ) : null}\n </Flex>\n </label>\n );\n }\n);\n\nCheckboxTile.displayName = componentName;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/FormGroupBase/FormGroupBase.context.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nexport type FormGroupBaseContextValue = {\n hasGroupHelperText: boolean;\n 'aria-describedby'?: string;\n};\n\nexport const FormGroupBaseContext = createContext<FormGroupBaseContextValue>({\n hasGroupHelperText: false,\n} as FormGroupBaseContextValue);\n\nexport const FormGroupBaseProvider = FormGroupBaseContext.Provider;\n\nexport const useFormGroupBase = () => useContext(FormGroupBaseContext);\n"],"mappings":"AAAA,OAAS,iBAAAA,EAAe,cAAAC,MAAkB,QAOnC,IAAMC,EAAuBF,EAAyC,CAC3E,mBAAoB,EACtB,CAA8B,EAEjBG,EAAwBD,EAAqB,SAE7CE,EAAmB,IAAMH,EAAWC,CAAoB","names":["createContext","useContext","FormGroupBaseContext","FormGroupBaseProvider","useFormGroupBase"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkJMAJZ2BLcjs = require('./chunk-JMAJZ2BL.cjs');var _chunk24SSG67Rcjs = require('./chunk-24SSG67R.cjs');var _chunkJ6LUMWNIcjs = require('./chunk-J6LUMWNI.cjs');var _chunk4H5JT5ORcjs = require('./chunk-4H5JT5OR.cjs');var _clsx = require('clsx'); var _clsx2 = _interopRequireDefault(_clsx);var _react = require('react'); var _react2 = _interopRequireDefault(_react);var _hearthreacticons = require('@utilitywarehouse/hearth-react-icons');var f="PasswordInput",P=_chunk4H5JT5ORcjs.b.call(void 0, f),h= exports.a =_react2.default.forwardRef(({className:d,disabled:r,...c},b)=>{let y=_react2.default.useRef(null),s=b||y,[o,w]=_react2.default.useState(!1),[n,l]=_react2.default.useState(!1),I=_react2.default.useCallback(()=>{let e=!o,i=!n;w(e),l(i)},[o,n]);_react2.default.useEffect(()=>{let e=null;s&&typeof s=="object"&&s.current&&(e=s.current);let i=()=>{_optionalChain([e, 'optionalAccess', _ => _.type])&&(e.type="password")};return e&&e.form!==null&&e.form.addEventListener("submit",i),()=>{_optionalChain([e, 'optionalAccess', _2 => _2.form])&&e.form.removeEventListener("submit",i)}},[s]);let E=`Your password is ${o?"shown":"hidden"}!`;return _react2.default.useEffect(()=>{setTimeout(()=>{l(!1)},1500)},[n]),_react2.default.createElement(_react2.default.Fragment,null,_react2.default.createElement(_chunkJMAJZ2BLcjs.a,{ref:s,className:_clsx2.default.call(void 0, P,d),type:o?"text":"password",disabled:r,...c},_react2.default.createElement(_chunk24SSG67Rcjs.a,{placement:"suffix"},_react2.default.createElement(_chunkJ6LUMWNIcjs.a,{type:"button",label:"toggle password visibility",onClick:I,disabled:r,"aria-pressed":o},o?_react2.default.createElement(_hearthreacticons.EyeSmallIcon,null):_react2.default.createElement(_hearthreacticons.EyeOffSmallIcon,null)))),_react2.default.createElement("div",{"data-visually-hidden":!0,"aria-live":"assertive",role:"status"},n?E:""))});h.displayName=f;exports.a = h;
|
|
2
|
+
//# sourceMappingURL=chunk-62VG5C3S.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/hearth/hearth/packages/react/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/hearth/hearth/packages/react/dist/chunk-62VG5C3S.cjs","../src/components/PasswordInput/PasswordInput.tsx"],"names":["componentName","componentClassName","withGlobalPrefix","PasswordInput","React","className","disabled","props","forwardedRef","defaultRef","inputRef","visible","setVisible","showVisibilityMessage","setShowVisibilityMessage","handleVisibility","newVisibilityState","newVisibilityMessageState","currentElement","handleSubmit","visibilityMessage","TextInput","clsx","TextInputSlot","UnstyledIconButton","EyeSmallIcon","EyeOffSmallIcon"],"mappings":"AAAA,quBAAwC,wDAAyC,wDAAyC,wDAAyC,wECElJ,4EACC,wEAK4B,IAExCA,CAAAA,CAAgB,eAAA,CAChBC,CAAAA,CAAqBC,iCAAAA,CAA8B,CAAA,CAI5CC,CAAAA,aAAgBC,eAAAA,CAAM,UAAA,CACjC,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,QAAA,CAAAC,CAAAA,CAAU,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAAiB,CACnD,IAAMC,CAAAA,CA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packages/react/dist/chunk-62VG5C3S.cjs","sourcesContent":[null,"import type { ElementRef } from 'react';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport clsx from 'clsx';\nimport React from 'react';\nimport { PasswordInputProps } from './PasswordInput.props';\nimport { TextInput } from '../TextInput/TextInput';\nimport { TextInputSlot } from '../TextInputSlot/TextInputSlot';\nimport { UnstyledIconButton } from '../UnstyledIconButton/UnstyledIconButton';\nimport { EyeOffSmallIcon, EyeSmallIcon } from '@utilitywarehouse/hearth-react-icons';\n\nconst componentName = 'PasswordInput';\nconst componentClassName = withGlobalPrefix(componentName);\n\ntype PasswordInputElement = ElementRef<'input'>;\n\nexport const PasswordInput = React.forwardRef<PasswordInputElement, PasswordInputProps>(\n ({ className, disabled, ...props }, forwardedRef) => {\n const defaultRef = React.useRef<HTMLInputElement | null>(null);\n const inputRef = forwardedRef || defaultRef;\n const [visible, setVisible] = React.useState(false);\n const [showVisibilityMessage, setShowVisibilityMessage] = React.useState(false);\n\n const handleVisibility = React.useCallback(() => {\n const newVisibilityState = !visible;\n const newVisibilityMessageState = !showVisibilityMessage;\n setVisible(newVisibilityState);\n setShowVisibilityMessage(newVisibilityMessageState);\n }, [visible, showVisibilityMessage]);\n\n // If the PasswordInput is inside a form we should switch the input type\n // back to password when its parent form is submitted\n React.useEffect(() => {\n // Get the ref value and ensure proper typing\n let currentElement: HTMLInputElement | null = null;\n if (inputRef && typeof inputRef === 'object' && inputRef.current) {\n // Type assertion to ensure TypeScript understands this is a valid ref object\n const refObject = inputRef as React.RefObject<HTMLInputElement>;\n currentElement = refObject.current;\n }\n\n const handleSubmit = () => {\n if (currentElement?.type) {\n currentElement.type = 'password';\n }\n };\n\n if (currentElement && currentElement.form !== null) {\n currentElement.form.addEventListener('submit', handleSubmit);\n }\n return () => {\n if (currentElement?.form) {\n currentElement.form.removeEventListener('submit', handleSubmit);\n }\n };\n }, [inputRef]);\n\n const visibilityMessage = `Your password is ${visible ? 'shown' : 'hidden'}!`;\n\n React.useEffect(() => {\n setTimeout(() => {\n setShowVisibilityMessage(false);\n }, 1500);\n }, [showVisibilityMessage]);\n\n return (\n <>\n <TextInput\n ref={inputRef}\n className={clsx(componentClassName, className)}\n type={visible ? 'text' : 'password'}\n disabled={disabled}\n {...props}\n >\n <TextInputSlot placement=\"suffix\">\n <UnstyledIconButton\n type=\"button\"\n label=\"toggle password visibility\"\n onClick={handleVisibility}\n disabled={disabled}\n aria-pressed={visible}\n >\n {visible ? <EyeSmallIcon /> : <EyeOffSmallIcon />}\n </UnstyledIconButton>\n </TextInputSlot>\n </TextInput>\n <div data-visually-hidden aria-live=\"assertive\" role=\"status\">\n {showVisibilityMessage ? visibilityMessage : ''}\n </div>\n </>\n );\n }\n);\n\nPasswordInput.displayName = componentName;\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as y}from"./chunk-PJXMEG7B.js";import{a as I}from"./chunk-C2M7FEJX.js";import{a as h}from"./chunk-JPYVWTDN.js";import{a}from"./chunk-35HZSCJP.js";import{a as T}from"./chunk-VBMXLPU5.js";import{a as b}from"./chunk-XQ5A24NX.js";import{a as v}from"./chunk-QC4ZMGCU.js";import{a as x}from"./chunk-RTGGS5XX.js";import{b as c}from"./chunk-4PEMW3UE.js";import{a as g}from"./chunk-DVGYWBKQ.js";import O from"clsx";import e from"react";var P="TextInput",j=c(P),k=e.forwardRef((E,L)=>{let{className:N,validationStatus:t,validationText:d,label:F,helperText:r,children:w,id:D,disabled:n,readOnly:l,hideLabel:H,required:s,placeholder:S,"aria-describedby":V,...q}=x(E,b),{id:p,labelId:m,helperTextId:u,validationTextId:o}=v({providedId:D,prefix:"input"}),f=!l&&!n&&t!==void 0&&d!==void 0,B=g(V,r?u:void 0,f?o:void 0),U=e.useRef(null),i=L||U;return e.createElement(a,{className:O(j,N),direction:"column",gap:"75","data-validation-status":t||void 0,"data-disabled":n?"":void 0,onPointerDown:C=>{if(!C.target.closest("input, button, a")&&i&&typeof i=="object"&&i.current){let M=i.current;requestAnimationFrame(()=>{M.focus()})}}},e.createElement(a,{direction:"column","data-visually-hidden":H?"":void 0},e.createElement(I,{htmlFor:p,id:m,disableUserSelect:!0,fontWeight:"semibold"},F,s?null:e.createElement(T,{as:"span",marginLeft:"50"},"(optional)")),r?e.createElement(h,{id:u,disableUserSelect:!0},r):null),e.createElement("div",{className:"hearth-TextInputRoot"},e.createElement("input",{ref:i,spellCheck:"false",id:p,required:s,disabled:n,readOnly:l,placeholder:n?void 0:S,"aria-labelledby":m,"aria-describedby":B,"aria-invalid":t==="invalid"?!0:void 0,"aria-errormessage":t==="invalid"?o:void 0,...q}),w),f?e.createElement(y,{status:t,disableUserSelect:!0,id:o},d):null)});k.displayName=P;export{k as a};
|
|
2
|
+
//# sourceMappingURL=chunk-7BCHAXO2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/TextInput/TextInput.tsx"],"sourcesContent":["import type { ElementRef } from 'react';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport { TextInputProps } from './TextInput.props';\nimport { extractProps } from '../../helpers/extract-props';\nimport clsx from 'clsx';\nimport React from 'react';\nimport { Label } from '../Label/Label';\nimport { HelperText } from '../HelperText/HelperText';\nimport { Flex } from '../Flex/Flex';\nimport { useIds } from '../../hooks/use-ids';\nimport { ValidationText } from '../ValidationText/ValidationText';\nimport { mergeIds } from '../../helpers/merge-ids';\nimport { BodyText } from '../BodyText/BodyText';\nimport { marginPropDefs } from '../../props/margin.props';\n\nconst componentName = 'TextInput';\nconst componentClassName = withGlobalPrefix(componentName);\n\ntype TextInputElement = ElementRef<'input'>;\n\nexport const TextInput = React.forwardRef<TextInputElement, TextInputProps>(\n (props, forwardedRef) => {\n const {\n className,\n validationStatus,\n validationText,\n label,\n helperText,\n children,\n id: providedId,\n disabled,\n readOnly,\n hideLabel,\n required,\n placeholder,\n 'aria-describedby': ariaDescribedby,\n ...textInputProps\n } = extractProps(props, marginPropDefs);\n const { id, labelId, helperTextId, validationTextId } = useIds({\n providedId,\n prefix: 'input',\n });\n\n const showValidationText = Boolean(\n !readOnly && !disabled && validationStatus !== undefined && validationText !== undefined\n );\n const ariaDescribedbyValue = mergeIds(\n ariaDescribedby,\n !!helperText ? helperTextId : undefined,\n showValidationText ? validationTextId : undefined\n );\n\n const defaultRef = React.useRef<HTMLInputElement>(null);\n const inputRef = forwardedRef || defaultRef;\n return (\n <Flex\n className={clsx(componentClassName, className)}\n direction=\"column\"\n gap=\"75\"\n data-validation-status={validationStatus ? validationStatus : undefined}\n data-disabled={disabled ? '' : undefined}\n onPointerDown={event => {\n // avoid losing focus when users click on non-interactive slot elements, such as icons\n const target = event.target as HTMLElement;\n if (target.closest('input, button, a')) return;\n\n if (inputRef && typeof inputRef === 'object' && inputRef.current) {\n const input = inputRef.current;\n requestAnimationFrame(() => {\n input.focus();\n });\n }\n }}\n >\n <Flex direction=\"column\" data-visually-hidden={hideLabel ? '' : undefined}>\n <Label htmlFor={id} id={labelId} disableUserSelect fontWeight=\"semibold\">\n {label}\n {required ? null : (\n <BodyText as=\"span\" marginLeft=\"50\">\n (optional)\n </BodyText>\n )}\n </Label>\n {helperText ? (\n <HelperText id={helperTextId} disableUserSelect>\n {helperText}\n </HelperText>\n ) : null}\n </Flex>\n <div className=\"hearth-TextInputRoot\">\n <input\n ref={inputRef}\n spellCheck=\"false\"\n id={id}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n placeholder={!disabled ? placeholder : undefined}\n aria-labelledby={labelId}\n aria-describedby={ariaDescribedbyValue}\n aria-invalid={validationStatus === 'invalid' ? true : undefined}\n aria-errormessage={validationStatus === 'invalid' ? validationTextId : undefined}\n {...textInputProps}\n />\n {children}\n </div>\n {showValidationText ? (\n <ValidationText status={validationStatus} disableUserSelect id={validationTextId}>\n {validationText}\n </ValidationText>\n ) : null}\n </Flex>\n );\n }\n);\n\nTextInput.displayName = componentName;\n"],"mappings":"2YAIA,OAAOA,MAAU,OACjB,OAAOC,MAAW,QA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P,EAAA,cAACmC,EAAA,CAAW,GAAId,EAAc,kBAAiB,IAC5Cd,CACH,EACE,IACN,EACAP,EAAA,cAAC,OAAI,UAAU,wBACbA,EAAA,cAAC,SACC,IAAK4B,EACL,WAAW,QACX,GAAIT,EACJ,SAAUN,EACV,SAAUH,EACV,SAAUC,EACV,YAAcD,EAAyB,OAAdI,EACzB,kBAAiBM,EACjB,mBAAkBK,EAClB,eAAcrB,IAAqB,UAAY,GAAO,OACtD,oBAAmBA,IAAqB,UAAYkB,EAAmB,OACtE,GAAGN,EACN,EACCR,CACH,EACCgB,EACCxB,EAAA,cAACoC,EAAA,CAAe,OAAQhC,EAAkB,kBAAiB,GAAC,GAAIkB,GAC7DjB,CACH,EACE,IACN,CAEJ,CACF,EAEAN,EAAU,YAAcH","names":["clsx","React","componentName","componentClassName","withGlobalPrefix","TextInput","React","props","forwardedRef","className","validationStatus","validationText","label","helperText","children","providedId","disabled","readOnly","hideLabel","required","placeholder","ariaDescribedby","textInputProps","extractProps","marginPropDefs","id","labelId","helperTextId","validationTextId","useIds","showValidationText","ariaDescribedbyValue","mergeIds","defaultRef","inputRef","Flex","clsx","event","input","Label","BodyText","HelperText","ValidationText"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as h}from"./chunk-C2M7FEJX.js";import{a as f}from"./chunk-JPYVWTDN.js";import{c as C}from"./chunk-5OLLJKEO.js";import{c as u}from"./chunk-T64W7Q7K.js";import{a as x}from"./chunk-35HZSCJP.js";import{a as k}from"./chunk-QC4ZMGCU.js";import{b as p}from"./chunk-4PEMW3UE.js";import*as e from"react";import P from"clsx";import{TickSmallIcon as S}from"@utilitywarehouse/hearth-react-icons";import{Checkbox as T}from"radix-ui";var R="CheckboxTile",U=p(R),B=e.forwardRef(({className:I,id:y,disabled:a,value:o="on",onCheckedChange:i,label:c,helperText:l,"aria-labelledby":N,...G},H)=>{let{id:m,labelId:s,helperTextId:n}=k({providedId:y,prefix:"radio"}),r=C(),t=u(),w=t?.value?.includes(o),E=r?.hasGroupHelperText,F=r?r["aria-describedby"]:"",d=!E&&!!l,L=!!c;return e.createElement("label",{className:P(U,I),"data-disabled":a?"":void 0},e.createElement(T.Root,{ref:H,className:"hearth-CheckboxRoot",name:t?.name,checked:w,value:o,...G,id:m,disabled:a,"aria-describedby":d?n:F,"aria-labelledby":N||L?s:void 0,onCheckedChange:b=>{r&&(b?t?.onItemCheck(o):t?.onItemUncheck(o)),i&&i(b)}},e.createElement(T.Indicator,{asChild:!0,className:"hearth-CheckboxIndicator"},e.createElement(S,null))),e.createElement(x,{direction:"column"},e.createElement(h,{id:s,htmlFor:m,disableUserSelect:!0},c),d?e.createElement(f,{id:n,disableUserSelect:!0},l):null))});B.displayName=R;export{B as a};
|
|
2
|
+
//# sourceMappingURL=chunk-CQN4SZBT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/CheckboxTile/CheckboxTile.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport clsx from 'clsx';\n\nimport { CheckboxTileProps } from './CheckboxTile.props';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport type { ElementRef } from 'react';\nimport { useIds } from '../../hooks/use-ids';\nimport { TickSmallIcon } from '@utilitywarehouse/hearth-react-icons';\nimport { Label } from '../Label/Label';\nimport { HelperText } from '../HelperText/HelperText';\nimport { Flex } from '../Flex/Flex';\nimport { Checkbox as RadixCheckbox } from 'radix-ui';\nimport { useCheckboxGroup } from '../CheckboxGroup/CheckboxGroup.context';\nimport { useFormGroupBase } from '../FormGroupBase/FormGroupBase.context';\n\nconst componentName = 'CheckboxTile';\nconst componentClassName = withGlobalPrefix(componentName);\n\ntype CheckboxTileElement = ElementRef<'button'>;\n\nexport const CheckboxTile = React.forwardRef<CheckboxTileElement, CheckboxTileProps>(\n (\n {\n className,\n id: providedId,\n disabled,\n value = 'on',\n onCheckedChange,\n label,\n helperText,\n 'aria-labelledby': ariaLabelledby,\n ...props\n },\n ref\n ) => {\n const { id, labelId, helperTextId } = useIds({ providedId, prefix: 'radio' });\n const context = useFormGroupBase();\n const checkboxContext = useCheckboxGroup();\n const checked = checkboxContext?.value?.includes(value);\n const hasGroupHelperText = context?.hasGroupHelperText;\n const ariaDescribedby = context ? context['aria-describedby'] : '';\n const showHelperText = !hasGroupHelperText && !!helperText;\n const showLabel = !!label;\n return (\n <label\n className={clsx(componentClassName, className)}\n data-disabled={disabled ? '' : undefined}\n >\n <RadixCheckbox.Root\n ref={ref}\n className=\"hearth-CheckboxRoot\"\n name={checkboxContext?.name}\n checked={checked}\n value={value}\n {...props}\n id={id}\n disabled={disabled}\n aria-describedby={showHelperText ? helperTextId : ariaDescribedby}\n aria-labelledby={ariaLabelledby || showLabel ? labelId : undefined}\n onCheckedChange={(checked: boolean) => {\n if (context) {\n if (checked) {\n checkboxContext?.onItemCheck(value);\n } else {\n checkboxContext?.onItemUncheck(value);\n }\n }\n if (onCheckedChange) {\n onCheckedChange(checked);\n }\n }}\n >\n <RadixCheckbox.Indicator asChild className=\"hearth-CheckboxIndicator\">\n <TickSmallIcon />\n </RadixCheckbox.Indicator>\n </RadixCheckbox.Root>\n <Flex direction=\"column\">\n <Label id={labelId} htmlFor={id} disableUserSelect>\n {label}\n </Label>\n {showHelperText ? (\n <HelperText id={helperTextId} disableUserSelect>\n {helperText}\n </HelperText>\n ) : null}\n </Flex>\n </label>\n );\n }\n);\n\nCheckboxTile.displayName = componentName;\n"],"mappings":"wRAAA,UAAYA,MAAW,QAEvB,OAAOC,MAAU,OAMjB,OAAS,iBAAAC,MAAqB,uCAI9B,OAAS,YAAYC,MAAqB,WAI1C,IAAMC,EAAgB,eAChBC,EAAqBC,EAAiBF,CAAa,EAI5CG,EAAqB,aAChC,CACE,CACE,UAAAC,EACA,GAAIC,EACJ,SAAAC,EACA,MAAAC,EAAQ,KACR,gBAAAC,EACA,MAAAC,EACA,WAAAC,EACA,kBAAmBC,EACnB,GAAGC,CACL,EACAC,IACG,CACH,GAAM,CAAE,GAAAC,EAAI,QAAAC,EAAS,aAAAC,CAAa,EAAIC,EAAO,CAAE,WAAAZ,EAAY,OAAQ,OAAQ,CAAC,EACtEa,EAAUC,EAAiB,EAC3BC,EAAkBC,EAAiB,EACnCC,EAAUF,GAAiB,OAAO,SAASb,CAAK,EAChDgB,EAAqBL,GAAS,mBAC9BM,EAAkBN,EAAUA,EAAQ,kBAAkB,EAAI,GAC1DO,EAAiB,CAACF,GAAsB,CAAC,CAACb,EAC1CgB,EAAY,CAAC,CAACjB,EACpB,OACE,gBAAC,SACC,UAAWkB,EAAK1B,EAAoBG,CAAS,EAC7C,gBAAeE,EAAW,GAAK,QAE/B,gBAACsB,EAAc,KAAd,CACC,IAAKf,EACL,UAAU,sBACV,KAAMO,GAAiB,KACvB,QAASE,EACT,MAAOf,EACN,GAAGK,EACJ,GAAIE,EACJ,SAAUR,EACV,mBAAkBmB,EAAiBT,EAAeQ,EAClD,kBAAiBb,GAAkBe,EAAYX,EAAU,OACzD,gBAAkBO,GAAqB,CACjCJ,IACEI,EACFF,GAAiB,YAAYb,CAAK,EAElCa,GAAiB,cAAcb,CAAK,GAGpCC,GACFA,EAAgBc,CAAO,CAE3B,GAEA,gBAACM,EAAc,UAAd,CAAwB,QAAO,GAAC,UAAU,4BACzC,gBAACC,EAAA,IAAc,CACjB,CACF,EACA,gBAACC,EAAA,CAAK,UAAU,UACd,gBAACC,EAAA,CAAM,GAAIhB,EAAS,QAASD,EAAI,kBAAiB,IAC/CL,CACH,EACCgB,EACC,gBAACO,EAAA,CAAW,GAAIhB,EAAc,kBAAiB,IAC5CN,CACH,EACE,IACN,CACF,CAEJ,CACF,EAEAP,EAAa,YAAcH","names":["React","clsx","TickSmallIcon","RadixCheckbox","componentName","componentClassName","withGlobalPrefix","CheckboxTile","className","providedId","disabled","value","onCheckedChange","label","helperText","ariaLabelledby","props","ref","id","labelId","helperTextId","useIds","context","useFormGroupBase","checkboxContext","useCheckboxGroup","checked","hasGroupHelperText","ariaDescribedby","showHelperText","showLabel","clsx","RadixCheckbox","TickSmallIcon","Flex","Label","HelperText"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkPDRE4SEJcjs = require('./chunk-PDRE4SEJ.cjs');var _chunkVRX67OL2cjs = require('./chunk-VRX67OL2.cjs');var _chunk4H5JT5ORcjs = require('./chunk-4H5JT5OR.cjs');var _react = require('react'); var o = _interopRequireWildcard(_react);var _clsx = require('clsx'); var _clsx2 = _interopRequireDefault(_clsx);var _radixui = require('radix-ui');var s="RadioGroup",C=_chunk4H5JT5ORcjs.b.call(void 0, s),v= exports.a =o.forwardRef(({children:R,contentWidth:r,direction:t="column",className:l,label:f,helperText:n,validationText:d,validationStatus:u,required:a,disabled:e,loop:c,defaultValue:G,value:x,onValueChange:P,name:h,...w},E)=>{let F={...w,disabled:e,required:a,label:f,helperText:n,validationText:d,validationStatus:u},N={width:r,direction:t,name:h,required:a,disabled:e,loop:c,defaultValue:G,value:x,onValueChange:P};return o.createElement(_chunkPDRE4SEJcjs.a,{ref:E,...F},o.createElement(_radixui.RadioGroup.Root,{asChild:!0,className:_clsx2.default.call(void 0, C,l),...N,orientation:t==="column"?"vertical":"horizontal"},o.createElement(_chunkVRX67OL2cjs.a,{width:r},R)))});v.displayName=s;exports.a = v;
|
|
2
|
+
//# sourceMappingURL=chunk-D6CQM2ZR.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/hearth/hearth/packages/react/dist/chunk-D6CQM2ZR.cjs","../src/components/RadioGroup/RadioGroup.tsx"],"names":["componentName","componentClassName","withGlobalPrefix","RadioGroup","children","contentWidth","direction","className","label","helperText","validationText","validationStatus","required","disabled","loop","defaultValue","value","onValueChange","name","props","ref","fieldsetProps","radioGroupRootProps","FormGroupBase","RadixRadioGroup","clsx","Flex"],"mappings":"AAAA,mfAAwC,wDAAyC,wDAAyC,uECAnG,wEAEN,mCAE6B,IAOxCA,CAAAA,CAAgB,YAAA,CAChBC,CAAAA,CAAqBC,iCAAAA,CAA8B,CAAA,CAI5CC,CAAAA,aAAmB,CAAA,CAAA,UAAA,CAC9B,CACE,CACE,QAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CAAY,QAAA,CACZ,SAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,GAAGC,CACL,CAAA,CACAC,CAAAA,CAAAA,EACG,CACH,IAAMC,CAAAA,CAAgB,CACpB,GAAGF,CAAAA,CACH,QAAA,CAAAN,CAAAA,CACA,QAAA,CAAAD,CAAAA,CACA,KAAA,CAAAJ,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CACF,CAAA,CACMW,CAAAA,CAAsB,CAC1B,KAAA,CAAOjB,CAAAA,CACP,SAAA,CAAAC,CAAAA,CACA,IAAA,CAAAY,CAAAA,CACA,QAAA,CAAAN,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CACF,CAAA,CAEA,OACE,CAAA,CAAA,aAAA,CAACM,mBAAAA,CAAA,CAAc,GAAA,CAAKH,CAAAA,CAAM,GAAGC,CAAAA,CAAAA,CAC3B,CAAA,CAAA,aAAA,CAACG,mBAAAA,CAAgB,IAAA,CAAhB,CACC,OAAA,CAAO,CAAA,CAAA,CACP,SAAA,CAAWC,4BAAAA,CAAKxB,CAAoBM,CAAS,CAAA,CAC5C,GAAGe,CAAAA,CACJ,WAAA,CAAahB,CAAAA,GAAc,QAAA,CAAW,UAAA,CAAa,YAAA,CAAA,CAEnD,CAAA,CAAA,aAAA,CAACoB,mBAAAA,CAAA,CAAK,KAAA,CAAOrB,CAAAA,CAAAA,CAAeD,CAAS,CACvC,CACF,CAEJ,CACF,CAAA,CAEAD,CAAAA,CAAW,WAAA,CAAcH,CAAAA,CAAAA,cAAAA","file":"/home/runner/work/hearth/hearth/packages/react/dist/chunk-D6CQM2ZR.cjs","sourcesContent":[null,"import * as React from 'react';\n\nimport clsx from 'clsx';\n\nimport { RadioGroup as RadixRadioGroup } from 'radix-ui';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport type { ElementRef } from 'react';\nimport { RadioGroupProps } from './RadioGroup.props';\nimport { Flex } from '../Flex/Flex';\nimport { FormGroupBase } from '../FormGroupBase/FormGroupBase';\n\nconst componentName = 'RadioGroup';\nconst componentClassName = withGlobalPrefix(componentName);\n\ntype RadioGroupElement = ElementRef<'fieldset'>;\n\nexport const RadioGroup = React.forwardRef<RadioGroupElement, RadioGroupProps>(\n (\n {\n children,\n contentWidth,\n direction = 'column',\n className,\n label,\n helperText,\n validationText,\n validationStatus,\n required,\n disabled,\n loop,\n defaultValue,\n value,\n onValueChange,\n name,\n ...props\n },\n ref\n ) => {\n const fieldsetProps = {\n ...props,\n disabled,\n required,\n label,\n helperText,\n validationText,\n validationStatus,\n };\n const radioGroupRootProps = {\n width: contentWidth,\n direction,\n name,\n required,\n disabled,\n loop,\n defaultValue,\n value,\n onValueChange,\n };\n\n return (\n <FormGroupBase ref={ref} {...fieldsetProps}>\n <RadixRadioGroup.Root\n asChild\n className={clsx(componentClassName, className)}\n {...radioGroupRootProps}\n orientation={direction === 'column' ? 'vertical' : 'horizontal'}\n >\n <Flex width={contentWidth}>{children}</Flex>\n </RadixRadioGroup.Root>\n </FormGroupBase>\n );\n }\n);\n\nRadioGroup.displayName = componentName;\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as p}from"./chunk-C2M7FEJX.js";import{a as n}from"./chunk-JPYVWTDN.js";import{c as f}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as p}from"./chunk-C2M7FEJX.js";import{a as n}from"./chunk-JPYVWTDN.js";import{c as f}from"./chunk-5OLLJKEO.js";import{a as l}from"./chunk-35HZSCJP.js";import{a as c}from"./chunk-QC4ZMGCU.js";import{b as s}from"./chunk-4PEMW3UE.js";import*as e from"react";import w from"clsx";import{RadioGroup as R}from"radix-ui";var b="Radio",E=s(b),F=e.forwardRef(({id:h,label:o,helperText:a,className:u,labelFontWeight:x,"aria-labelledby":r,...y},I)=>{let{id:i,labelId:t,helperTextId:d}=c({providedId:h,prefix:"radio"}),{hasGroupHelperText:N,"aria-describedby":G}=f(),m=!N&&a!==void 0,v=!!o;return e.createElement("div",{className:w(E,u)},e.createElement("div",{className:"hearth-RadioContainer"},e.createElement(R.Item,{ref:I,...y,id:i,"aria-describedby":m?d:G,"aria-labelledby":r||(o?t:void 0),className:"hearth-RadioItem"},e.createElement(R.Indicator,{className:"hearth-RadioIndicator"}))),v?e.createElement(l,{direction:"column",gap:"50"},e.createElement(p,{id:t,htmlFor:i,disableUserSelect:!0,fontWeight:x,className:"hearth-RadioLabel"},o),m?e.createElement(n,{id:d,disableUserSelect:!0},a):null):null)});F.displayName=b;export{F as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DV32RESS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Radio/Radio.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport clsx from 'clsx';\n\nimport type { RadioProps } from './Radio.props';\n\nimport { RadioGroup as RadixRadioGroup } from 'radix-ui';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport { Flex } from '../Flex/Flex';\nimport { Label } from '../Label/Label';\nimport { useIds } from '../../hooks/use-ids';\nimport { HelperText } from '../HelperText/HelperText';\nimport type { ElementRef } from 'react';\nimport { useFormGroupBase } from '../FormGroupBase/FormGroupBase.context';\n\nconst componentName = 'Radio';\nconst componentClassName = withGlobalPrefix(componentName);\n\ntype RadioElement = ElementRef<'button'>;\n\n/**\n * `Radio` can be used to choose between a set of more than two options.\n *\n * `Radio` should always be used with a `RadioGroup` or `RadioGridGroup` to\n * handle the state control and layout.\n *\n * `Radio` is, by default, appropriately labelled when using\n * the `label` prop, if you do not provide a label, you must specify an\n * `aria-label` or `aria-labelledby` for accessibility.\n *\n * > This component does not need to be wrapped in a `ThemeProvider` and can be used standalone with other component libraries.\n */\nexport const Radio = React.forwardRef<RadioElement, RadioProps>(\n (\n {\n id: providedId,\n label,\n helperText,\n className,\n labelFontWeight,\n 'aria-labelledby': ariaLabelledby,\n ...props\n },\n ref\n ) => {\n const { id, labelId, helperTextId } = useIds({ providedId, prefix: 'radio' });\n const { hasGroupHelperText, 'aria-describedby': ariaDescribedby } = useFormGroupBase();\n const showHelperText = Boolean(!hasGroupHelperText && helperText !== undefined);\n const showLabel = !!label;\n return (\n <div className={clsx(componentClassName, className)}>\n <div className=\"hearth-RadioContainer\">\n <RadixRadioGroup.Item\n ref={ref}\n {...props}\n id={id}\n aria-describedby={showHelperText ? helperTextId : ariaDescribedby}\n aria-labelledby={ariaLabelledby ? ariaLabelledby : label ? labelId : undefined}\n className=\"hearth-RadioItem\"\n >\n <RadixRadioGroup.Indicator className=\"hearth-RadioIndicator\" />\n </RadixRadioGroup.Item>\n </div>\n {showLabel ? (\n <Flex direction=\"column\" gap=\"50\">\n <Label\n id={labelId}\n htmlFor={id}\n disableUserSelect\n fontWeight={labelFontWeight}\n className=\"hearth-RadioLabel\"\n >\n {label}\n </Label>\n {showHelperText ? (\n <HelperText id={helperTextId} disableUserSelect>\n {helperText}\n </HelperText>\n ) : null}\n </Flex>\n ) : null}\n </div>\n );\n }\n);\n\nRadio.displayName = componentName;\n"],"mappings":"gPAAA,UAAYA,MAAW,QAEvB,OAAOC,MAAU,OAIjB,OAAS,cAAcC,MAAuB,WAS9C,IAAMC,EAAgB,QAChBC,EAAqBC,EAAiBF,CAAa,EAgB5CG,EAAc,aACzB,CACE,CACE,GAAIC,EACJ,MAAAC,EACA,WAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,kBAAmBC,EACnB,GAAGC,CACL,EACAC,IACG,CACH,GAAM,CAAE,GAAAC,EAAI,QAAAC,EAAS,aAAAC,CAAa,EAAIC,EAAO,CAAE,WAAAX,EAAY,OAAQ,OAAQ,CAAC,EACtE,CAAE,mBAAAY,EAAoB,mBAAoBC,CAAgB,EAAIC,EAAiB,EAC/EC,EAAyB,CAACH,GAAsBV,IAAe,OAC/Dc,EAAY,CAAC,CAACf,EACpB,OACE,gBAAC,OAAI,UAAWgB,EAAKpB,EAAoBM,CAAS,GAChD,gBAAC,OAAI,UAAU,yBACb,gBAACe,EAAgB,KAAhB,CACC,IAAKX,EACJ,GAAGD,EACJ,GAAIE,EACJ,mBAAkBO,EAAiBL,EAAeG,EAClD,kBAAiBR,IAAkCJ,EAAQQ,EAAU,QACrE,UAAU,oBAEV,gBAACS,EAAgB,UAAhB,CAA0B,UAAU,wBAAwB,CAC/D,CACF,EACCF,EACC,gBAACG,EAAA,CAAK,UAAU,SAAS,IAAI,MAC3B,gBAACC,EAAA,CACC,GAAIX,EACJ,QAASD,EACT,kBAAiB,GACjB,WAAYJ,EACZ,UAAU,qBAETH,CACH,EACCc,EACC,gBAACM,EAAA,CAAW,GAAIX,EAAc,kBAAiB,IAC5CR,CACH,EACE,IACN,EACE,IACN,CAEJ,CACF,EAEAH,EAAM,YAAcH","names":["React","clsx","RadixRadioGroup","componentName","componentClassName","withGlobalPrefix","Radio","providedId","label","helperText","className","labelFontWeight","ariaLabelledby","props","ref","id","labelId","helperTextId","useIds","hasGroupHelperText","ariaDescribedby","useFormGroupBase","showHelperText","showLabel","clsx","RadixRadioGroup","Flex","Label","HelperText"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkJMAJZ2BLcjs = require('./chunk-JMAJZ2BL.cjs');var _chunk24SSG67Rcjs = require('./chunk-24SSG67R.cjs');var _chunkJ6LUMWNIcjs = require('./chunk-J6LUMWNI.cjs');var _chunk3EVYXZRLcjs = require('./chunk-3EVYXZRL.cjs');var _chunk4H5JT5ORcjs = require('./chunk-4H5JT5OR.cjs');var _clsx = require('clsx'); var _clsx2 = _interopRequireDefault(_clsx);var _react = require('react'); var _react2 = _interopRequireDefault(_react);var _hearthreacticons = require('@utilitywarehouse/hearth-react-icons');var f="SearchInput",T=_chunk4H5JT5ORcjs.b.call(void 0, f),E= exports.a =_react2.default.forwardRef(({className:i,disabled:l,value:o,onClear:r,loading:s,...a},I)=>{let h=_react2.default.useRef(null),t=I||h,S=_react2.default.useCallback(x=>{typeof r!="function"||x.button!==0||(r(),t&&typeof t=="object"&&t.current&&t.current.focus())},[t,r]);return _react2.default.createElement(_chunkJMAJZ2BLcjs.a,{ref:t,className:_clsx2.default.call(void 0, T,i),type:"search",role:"search",enterKeyHint:"search",disabled:l,hideLabel:!0,value:o,...a},_react2.default.createElement(_chunk24SSG67Rcjs.a,{placement:"prefix"},_react2.default.createElement(_hearthreacticons.SearchMediumIcon,null)),s?_react2.default.createElement(_chunk24SSG67Rcjs.a,{placement:"suffix"},_react2.default.createElement(_chunk3EVYXZRLcjs.a,{size:"xs",color:"grey1000"})):null,o!==void 0&&String(o).length>0?_react2.default.createElement(_chunk24SSG67Rcjs.a,{placement:"suffix"},_react2.default.createElement(_chunkJ6LUMWNIcjs.a,{type:"button",label:"clear search",onClick:S,disabled:l},_react2.default.createElement(_hearthreacticons.CloseSmallIcon,null))):null)});E.displayName=f;exports.a = E;
|
|
2
|
+
//# sourceMappingURL=chunk-ETLTIDOX.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/hearth/hearth/packages/react/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/hearth/hearth/packages/react/dist/chunk-ETLTIDOX.cjs","../src/components/SearchInput/SearchInput.tsx"],"names":["componentName","componentClassName","withGlobalPrefix","SearchInput","React","className","disabled","value","onClear","loading","props","forwardedRef","defaultRef","inputRef","handleClear","event","TextInput","clsx","TextInputSlot","SearchMediumIcon","Spinner","UnstyledIconButton","CloseSmallIcon"],"mappings":"AAAA,iOAAwC,wDAAyC,wDAAyC,wDAAyC,wDAAyC,wECE3L,4EACC,wEAM+B,IAE3CA,CAAAA,CAAgB,aAAA,CAChBC,CAAAA,CAAqBC,iCAAAA,CAA8B,CAAA,CAI5CC,CAAAA,aAAcC,eAAAA,CAAM,UAAA,CAC/B,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,QAAA,CAAAC,CAAAA,CAAU,KAAA,CAAAC,CAAAA,CAAO,OAAA,CAAAC,CAAAA,CAAS,OAAA,CAAAC,CAAAA,CAAS,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAAiB,CAC5E,IAAMC,CAAAA,CAAaR,eAAAA,CAAM,MAAA,CAAgC,IAAI,CAAA,CACvDS,CAAAA,CAAWF,CAAAA,EAAgBC,CAAAA,CAE3BE,CAAAA,CAAcV,eAAAA,CAAM,WAAA,CACvBW,CAAAA,EAA+C,CAC1C,OAAOP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QAAA,CAAUR,CAAAA,CAAAA,CAEVF,eAAAA,CAAA,aAAA,CAACkB,gCAAAA,CAAA,IAAe,CAClB,CACF,CAAA,CACE,IACN,CAEJ,CACF,CAAA,CAEAnB,CAAAA,CAAY,WAAA,CAAcH,CAAAA,CAAAA,cAAAA","file":"/home/runner/work/hearth/hearth/packages/react/dist/chunk-ETLTIDOX.cjs","sourcesContent":[null,"import type { ElementRef } from 'react';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport clsx from 'clsx';\nimport React from 'react';\nimport { TextInput } from '../TextInput/TextInput';\nimport { TextInputSlot } from '../TextInputSlot/TextInputSlot';\nimport { UnstyledIconButton } from '../UnstyledIconButton/UnstyledIconButton';\nimport { SearchInputProps } from './SearchInput.props';\nimport { Spinner } from '../Spinner/Spinner';\nimport { CloseSmallIcon, SearchMediumIcon } from '@utilitywarehouse/hearth-react-icons';\n\nconst componentName = 'SearchInput';\nconst componentClassName = withGlobalPrefix(componentName);\n\ntype SearchInputElement = ElementRef<'input'>;\n\nexport const SearchInput = React.forwardRef<SearchInputElement, SearchInputProps>(\n ({ className, disabled, value, onClear, loading, ...props }, forwardedRef) => {\n const defaultRef = React.useRef<HTMLInputElement | null>(null);\n const inputRef = forwardedRef || defaultRef;\n\n const handleClear = React.useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n if (typeof onClear !== 'function' || event.button !== 0) {\n return;\n }\n onClear();\n\n if (inputRef && typeof inputRef === 'object' && inputRef.current) {\n inputRef.current.focus();\n }\n },\n [inputRef, onClear]\n );\n\n return (\n <TextInput\n ref={inputRef}\n className={clsx(componentClassName, className)}\n type=\"search\"\n role=\"search\"\n enterKeyHint=\"search\"\n disabled={disabled}\n hideLabel\n value={value}\n {...props}\n >\n <TextInputSlot placement=\"prefix\">\n <SearchMediumIcon />\n </TextInputSlot>\n {loading ? (\n <TextInputSlot placement=\"suffix\">\n <Spinner size=\"xs\" color=\"grey1000\" />\n </TextInputSlot>\n ) : null}\n {value !== undefined && String(value).length > 0 ? (\n <TextInputSlot placement=\"suffix\">\n <UnstyledIconButton\n type=\"button\"\n label=\"clear search\"\n onClick={handleClear}\n disabled={disabled}\n >\n <CloseSmallIcon />\n </UnstyledIconButton>\n </TextInputSlot>\n ) : null}\n </TextInput>\n );\n }\n);\n\nSearchInput.displayName = componentName;\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as m}from"./chunk-E2FMYLM2.js";import{a as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as m}from"./chunk-E2FMYLM2.js";import{a as n}from"./chunk-XZNPGGRR.js";import{a}from"./chunk-4L7UQYRQ.js";import{a as s}from"./chunk-RTGGS5XX.js";import{b as r}from"./chunk-4PEMW3UE.js";import*as t from"react";import u from"clsx";var i="Button",B=r(i),h=t.forwardRef((p,l)=>{let{className:c,children:o,disabled:d,loading:e,...f}=s(p,n);return t.createElement(a,{ref:l,className:u(B,c),disabled:d||e,...f},e?t.createElement("div",{className:"hearth-loading"},t.createElement("div",null,t.createElement(m,{size:"xs",currentColor:!0})),t.createElement("span",{className:"hearth-hidden"},o)):o)});h.displayName=i;export{h as a};
|
|
2
|
+
//# sourceMappingURL=chunk-GBMQ4HCH.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkTIOWEGWWcjs = require('./chunk-TIOWEGWW.cjs');var _chunkGFWH3VRNcjs = require('./chunk-GFWH3VRN.cjs');var _chunkK5BEIZDAcjs = require('./chunk-K5BEIZDA.cjs');var _chunkVRX67OL2cjs = require('./chunk-VRX67OL2.cjs');var _chunk7TQMVZ2Rcjs = require('./chunk-7TQMVZ2R.cjs');var _chunkLAVQWQP2cjs = require('./chunk-LAVQWQP2.cjs');var _chunkTMWB3U4Xcjs = require('./chunk-TMWB3U4X.cjs');var _chunk5DRU6TDWcjs = require('./chunk-5DRU6TDW.cjs');var _chunk4H5JT5ORcjs = require('./chunk-4H5JT5OR.cjs');var _chunkDSW76HKTcjs = require('./chunk-DSW76HKT.cjs');var _react = require('react'); var e = _interopRequireWildcard(_react);var _clsx = require('clsx'); var _clsx2 = _interopRequireDefault(_clsx);var g="TextArea",U=_chunk4H5JT5ORcjs.b.call(void 0, g),q= exports.a =e.forwardRef((I,N)=>{let{className:P,validationStatus:a,validationText:d,label:R,helperText:i,id:w,disabled:r,readOnly:l,required:n,placeholder:F,resize:E,rows:S=3,...V}=_chunk5DRU6TDWcjs.a.call(void 0, I,_chunkLAVQWQP2cjs.a),{id:s,labelId:m,helperTextId:p,validationTextId:o}=_chunkTMWB3U4Xcjs.a.call(void 0, {providedId:w,prefix:"textarea"}),f=!l&&!r&&a!==void 0&&d!==void 0,B=_chunkDSW76HKTcjs.a.call(void 0, i?p:void 0,f?o:void 0);return e.createElement(_chunkVRX67OL2cjs.a,{direction:"column",gap:"75",className:_clsx2.default.call(void 0, U,P),"data-validation-status":a||void 0,"data-disabled":r?"":void 0},e.createElement(_chunkVRX67OL2cjs.a,{direction:"column"},e.createElement(_chunkGFWH3VRNcjs.a,{htmlFor:s,id:m,disableUserSelect:!0,fontWeight:"semibold"},R,n?null:e.createElement(_chunk7TQMVZ2Rcjs.a,{as:"span",marginLeft:"50"},"(optional)")),i?e.createElement(_chunkK5BEIZDAcjs.a,{id:p,disableUserSelect:!0},i):null),e.createElement(_chunkVRX67OL2cjs.a,{direction:"column",className:"hearth-TextAreaRoot"},e.createElement("textarea",{ref:N,id:s,rows:S,required:n,disabled:r,readOnly:l,placeholder:r?void 0:F,"aria-labelledby":m,"aria-describedby":B,"aria-invalid":a==="invalid"?!0:void 0,"aria-errormessage":a==="invalid"?o:void 0,"data-resize":E,...V})),f?e.createElement(_chunkTIOWEGWWcjs.a,{status:a,disableUserSelect:!0,id:o},d):null)});q.displayName=g;exports.a = q;
|
|
2
|
+
//# sourceMappingURL=chunk-GSDFAL3H.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/hearth/hearth/packages/react/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/hearth/hearth/packages/react/dist/chunk-GSDFAL3H.cjs","../src/components/TextArea/TextArea.tsx"],"names":["componentName","componentClassName","withGlobalPrefix","TextArea","props","ref","className","validationStatus","validationText","label","helperText","providedId","disabled","readOnly","required","placeholder","resize","rows","textAreaProps","extractProps","marginPropDefs","id","labelId","helperTextId","validationTextId","useIds","showValidationText","ariaDescribedbyValue","mergeIds","Flex","clsx","Label","BodyText","HelperText","ValidationText"],"mappings":"AAAA,mfAAwC,wDAAyC,wDAAyC,wDAAyC,wDAAyC,wDAAyC,wDAAyC,wDAAyC,wDAAyC,wDAAyC,uECAlY,wEAGN,IAaXA,CAAAA,CAAgB,UAAA,CAChBC,CAAAA,CAAqBC,iCAAAA,CAA8B,CAAA,CAI5CC,CAAAA,aAAiB,CAAA,CAAA,UAAA,CAA2C,CAACC,CAAAA,CAAOC,CAAAA,CAAAA,EAAQ,CACvF,GAAM,CACJ,SAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CA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k-GSDFAL3H.cjs","sourcesContent":[null,"import * as React from 'react';\nimport type { ElementRef } from 'react';\n\nimport clsx from 'clsx';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport { mergeIds } from '../../helpers/merge-ids';\nimport { useIds } from '../../hooks/use-ids';\nimport { TextAreaProps } from './TextArea.props';\nimport { Label } from '../Label/Label';\nimport { HelperText } from '../HelperText/HelperText';\nimport { ValidationText } from '../ValidationText/ValidationText';\nimport { Flex } from '../Flex/Flex';\nimport { BodyText } from '../BodyText/BodyText';\nimport { extractProps } from '../../helpers/extract-props';\nimport { marginPropDefs } from '../../props/margin.props';\n\nconst componentName = 'TextArea';\nconst componentClassName = withGlobalPrefix(componentName);\n\ntype TextAreaElement = ElementRef<'textarea'>;\n\nexport const TextArea = React.forwardRef<TextAreaElement, TextAreaProps>((props, ref) => {\n const {\n className,\n validationStatus,\n validationText,\n label,\n helperText,\n id: providedId,\n disabled,\n readOnly,\n required,\n placeholder,\n resize,\n rows = 3,\n ...textAreaProps\n } = extractProps(props, marginPropDefs);\n const { id, labelId, helperTextId, validationTextId } = useIds({\n providedId,\n prefix: 'textarea',\n });\n\n const showValidationText = Boolean(\n !readOnly && !disabled && validationStatus !== undefined && validationText !== undefined\n );\n\n const ariaDescribedbyValue = mergeIds(\n !!helperText ? helperTextId : undefined,\n showValidationText ? validationTextId : undefined\n );\n\n return (\n <Flex\n direction=\"column\"\n gap=\"75\"\n className={clsx(componentClassName, className)}\n data-validation-status={validationStatus ? validationStatus : undefined}\n data-disabled={disabled ? '' : undefined}\n >\n <Flex direction=\"column\">\n <Label htmlFor={id} id={labelId} disableUserSelect fontWeight=\"semibold\">\n {label}\n {required ? null : (\n <BodyText as=\"span\" marginLeft=\"50\">\n (optional)\n </BodyText>\n )}\n </Label>\n {helperText ? (\n <HelperText id={helperTextId} disableUserSelect>\n {helperText}\n </HelperText>\n ) : null}\n </Flex>\n <Flex direction=\"column\" className=\"hearth-TextAreaRoot\">\n <textarea\n ref={ref}\n id={id}\n rows={rows}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n placeholder={!disabled ? placeholder : undefined}\n aria-labelledby={labelId}\n aria-describedby={ariaDescribedbyValue}\n aria-invalid={validationStatus === 'invalid' ? true : undefined}\n aria-errormessage={validationStatus === 'invalid' ? validationTextId : undefined}\n data-resize={resize}\n {...textAreaProps}\n />\n </Flex>\n {showValidationText ? (\n <ValidationText status={validationStatus} disableUserSelect id={validationTextId}>\n {validationText}\n </ValidationText>\n ) : null}\n </Flex>\n );\n});\n\nTextArea.displayName = componentName;\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as p}from"./chunk-C2M7FEJX.js";import{a as n}from"./chunk-JPYVWTDN.js";import{c as f}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as p}from"./chunk-C2M7FEJX.js";import{a as n}from"./chunk-JPYVWTDN.js";import{c as f}from"./chunk-5OLLJKEO.js";import{a as s}from"./chunk-35HZSCJP.js";import{a as c}from"./chunk-QC4ZMGCU.js";import{b as m}from"./chunk-4PEMW3UE.js";import*as e from"react";import N from"clsx";import{RadioGroup as R}from"radix-ui";var b="RadioTile",G=m(b),v=e.forwardRef(({className:u,id:x,label:o,helperText:i,"aria-labelledby":r,...T},h)=>{let{id:a,labelId:t,helperTextId:d}=c({providedId:x,prefix:"radio"}),{hasGroupHelperText:y,"aria-describedby":I}=f(),l=!y&&i!==void 0;return e.createElement(R.Item,{ref:h,className:N(G,u),...T,id:a,"aria-describedby":l?d:I,"aria-labelledby":r||(o?t:void 0)},e.createElement("div",{className:"hearth-RadioContainer"},e.createElement("div",{className:"hearth-RadioItem"},e.createElement(R.Indicator,{className:"hearth-RadioIndicator"})),e.createElement(s,{direction:"column"},e.createElement(p,{id:t,htmlFor:a,disableUserSelect:!0},o),l?e.createElement(n,{id:d,disableUserSelect:!0},i):null)))});v.displayName=b;export{v as a};
|
|
2
|
+
//# sourceMappingURL=chunk-H7IDH6CJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/RadioTile/RadioTile.tsx"],"sourcesContent":["import * as React from 'react';\nimport clsx from 'clsx';\nimport type { ElementRef } from 'react';\nimport type { RadioTileProps } from './RadioTile.props';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport { RadioGroup as RadixRadioGroup } from 'radix-ui';\nimport { useIds } from '../../hooks/use-ids';\nimport { Label } from '../Label/Label';\nimport { HelperText } from '../HelperText/HelperText';\nimport { Flex } from '../Flex/Flex';\nimport { useFormGroupBase } from '../FormGroupBase/FormGroupBase.context';\n\nconst componentName = 'RadioTile';\nconst componentClassName = withGlobalPrefix(componentName);\n\ntype RadioTileElement = ElementRef<'button'>;\n\nexport const RadioTile = React.forwardRef<RadioTileElement, RadioTileProps>(\n (\n { className, id: providedId, label, helperText, 'aria-labelledby': ariaLabelledby, ...props },\n ref\n ) => {\n const { id, labelId, helperTextId } = useIds({ providedId, prefix: 'radio' });\n const { hasGroupHelperText, 'aria-describedby': ariaDescribedby } = useFormGroupBase();\n const showHelperText = Boolean(!hasGroupHelperText && helperText !== undefined);\n return (\n <RadixRadioGroup.Item\n ref={ref}\n className={clsx(componentClassName, className)}\n {...props}\n id={id}\n aria-describedby={showHelperText ? helperTextId : ariaDescribedby}\n aria-labelledby={ariaLabelledby ? ariaLabelledby : label ? labelId : undefined}\n >\n <div className=\"hearth-RadioContainer\">\n <div className=\"hearth-RadioItem\">\n <RadixRadioGroup.Indicator className=\"hearth-RadioIndicator\" />\n </div>\n <Flex direction=\"column\">\n <Label id={labelId} htmlFor={id} disableUserSelect>\n {label}\n </Label>\n {showHelperText ? (\n <HelperText id={helperTextId} disableUserSelect>\n {helperText}\n </HelperText>\n ) : null}\n </Flex>\n </div>\n </RadixRadioGroup.Item>\n );\n }\n);\n\nRadioTile.displayName = componentName;\n"],"mappings":"gPAAA,UAAYA,MAAW,QACvB,OAAOC,MAAU,OAIjB,OAAS,cAAcC,MAAuB,WAO9C,IAAMC,EAAgB,YAChBC,EAAqBC,EAAiBF,CAAa,EAI5CG,EAAkB,aAC7B,CACE,CAAE,UAAAC,EAAW,GAAIC,EAAY,MAAAC,EAAO,WAAAC,EAAY,kBAAmBC,EAAgB,GAAGC,CAAM,EAC5FC,IACG,CACH,GAAM,CAAE,GAAAC,EAAI,QAAAC,EAAS,aAAAC,CAAa,EAAIC,EAAO,CAAE,WAAAT,EAAY,OAAQ,OAAQ,CAAC,EACtE,CAAE,mBAAAU,EAAoB,mBAAoBC,CAAgB,EAAIC,EAAiB,EAC/EC,EAAyB,CAACH,GAAsBR,IAAe,OACrE,OACE,gBAACY,EAAgB,KAAhB,CACC,IAAKT,EACL,UAAWU,EAAKnB,EAAoBG,CAAS,EAC5C,GAAGK,EACJ,GAAIE,EACJ,mBAAkBO,EAAiBL,EAAeG,EAClD,kBAAiBR,IAAkCF,EAAQM,EAAU,SAErE,gBAAC,OAAI,UAAU,yBACb,gBAAC,OAAI,UAAU,oBACb,gBAACO,EAAgB,UAAhB,CAA0B,UAAU,wBAAwB,CAC/D,EACA,gBAACE,EAAA,CAAK,UAAU,UACd,gBAACC,EAAA,CAAM,GAAIV,EAAS,QAASD,EAAI,kBAAiB,IAC/CL,CACH,EACCY,EACC,gBAACK,EAAA,CAAW,GAAIV,EAAc,kBAAiB,IAC5CN,CACH,EACE,IACN,CACF,CACF,CAEJ,CACF,EAEAJ,EAAU,YAAcH","names":["React","clsx","RadixRadioGroup","componentName","componentClassName","withGlobalPrefix","RadioTile","className","providedId","label","helperText","ariaLabelledby","props","ref","id","labelId","helperTextId","useIds","hasGroupHelperText","ariaDescribedby","useFormGroupBase","showHelperText","RadixRadioGroup","clsx","Flex","Label","HelperText"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as p}from"./chunk-7BCHAXO2.js";import{a as u}from"./chunk-PUVKWSFV.js";import{a as m}from"./chunk-4WMT5PSA.js";import{b as a}from"./chunk-4PEMW3UE.js";import v from"clsx";import t from"react";import{EyeOffSmallIcon as S,EyeSmallIcon as x}from"@utilitywarehouse/hearth-react-icons";var f="PasswordInput",P=a(f),h=t.forwardRef(({className:d,disabled:r,...c},b)=>{let y=t.useRef(null),s=b||y,[o,w]=t.useState(!1),[n,l]=t.useState(!1),I=t.useCallback(()=>{let e=!o,i=!n;w(e),l(i)},[o,n]);t.useEffect(()=>{let e=null;s&&typeof s=="object"&&s.current&&(e=s.current);let i=()=>{e?.type&&(e.type="password")};return e&&e.form!==null&&e.form.addEventListener("submit",i),()=>{e?.form&&e.form.removeEventListener("submit",i)}},[s]);let E=`Your password is ${o?"shown":"hidden"}!`;return t.useEffect(()=>{setTimeout(()=>{l(!1)},1500)},[n]),t.createElement(t.Fragment,null,t.createElement(p,{ref:s,className:v(P,d),type:o?"text":"password",disabled:r,...c},t.createElement(u,{placement:"suffix"},t.createElement(m,{type:"button",label:"toggle password visibility",onClick:I,disabled:r,"aria-pressed":o},o?t.createElement(x,null):t.createElement(S,null)))),t.createElement("div",{"data-visually-hidden":!0,"aria-live":"assertive",role:"status"},n?E:""))});h.displayName=f;export{h as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HKCUTYXG.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _react = require('react');var e=_react.createContext.call(void 0, {hasGroupHelperText:!1}),a= exports.b =e.Provider,s= exports.c =()=>_react.useContext.call(void 0, e);exports.a = e; exports.b = a; exports.c = s;
|
|
2
|
+
//# sourceMappingURL=chunk-HSPOCJ5A.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/FormGroupBase/FormGroupBase.context.ts"],"names":["FormGroupBaseContext","createContext","FormGroupBaseProvider","useFormGroupBase","useContext"],"mappings":"AAAA,uGAA0C,IAO7BA,CAAAA,CAAuBC,kCAAAA,CAClC,kBAAA,CAAoB,CAAA,CACtB,CAA8B,CAAA,CAEjBC,CAAAA,aAAwBF,CAAAA,CAAqB,QAAA,CAE7CG,CAAAA,aAAmB,CAAA,CAAA,EAAMC,+BAAAA,CAA+B,CAAA,CAAA,4CAAA","file":"/home/runner/work/hearth/hearth/packages/react/dist/chunk-HSPOCJ5A.cjs","sourcesContent":["import { createContext, useContext } from 'react';\n\nexport type FormGroupBaseContextValue = {\n hasGroupHelperText: boolean;\n 'aria-describedby'?: string;\n};\n\nexport const FormGroupBaseContext = createContext<FormGroupBaseContextValue>({\n hasGroupHelperText: false,\n} as FormGroupBaseContextValue);\n\nexport const FormGroupBaseProvider = FormGroupBaseContext.Provider;\n\nexport const useFormGroupBase = () => useContext(FormGroupBaseContext);\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkTIOWEGWWcjs = require('./chunk-TIOWEGWW.cjs');var _chunkGFWH3VRNcjs = require('./chunk-GFWH3VRN.cjs');var _chunkK5BEIZDAcjs = require('./chunk-K5BEIZDA.cjs');var _chunkVRX67OL2cjs = require('./chunk-VRX67OL2.cjs');var _chunk7TQMVZ2Rcjs = require('./chunk-7TQMVZ2R.cjs');var _chunkLAVQWQP2cjs = require('./chunk-LAVQWQP2.cjs');var _chunkTMWB3U4Xcjs = require('./chunk-TMWB3U4X.cjs');var _chunk5DRU6TDWcjs = require('./chunk-5DRU6TDW.cjs');var _chunk4H5JT5ORcjs = require('./chunk-4H5JT5OR.cjs');var _chunkDSW76HKTcjs = require('./chunk-DSW76HKT.cjs');var _clsx = require('clsx'); var _clsx2 = _interopRequireDefault(_clsx);var _react = require('react'); var _react2 = _interopRequireDefault(_react);var P="TextInput",j=_chunk4H5JT5ORcjs.b.call(void 0, P),k= exports.a =_react2.default.forwardRef((E,L)=>{let{className:N,validationStatus:t,validationText:d,label:F,helperText:r,children:w,id:D,disabled:n,readOnly:l,hideLabel:H,required:s,placeholder:S,"aria-describedby":V,...q}=_chunk5DRU6TDWcjs.a.call(void 0, E,_chunkLAVQWQP2cjs.a),{id:p,labelId:m,helperTextId:u,validationTextId:o}=_chunkTMWB3U4Xcjs.a.call(void 0, {providedId:D,prefix:"input"}),f=!l&&!n&&t!==void 0&&d!==void 0,B=_chunkDSW76HKTcjs.a.call(void 0, V,r?u:void 0,f?o:void 0),U=_react2.default.useRef(null),i=L||U;return _react2.default.createElement(_chunkVRX67OL2cjs.a,{className:_clsx2.default.call(void 0, j,N),direction:"column",gap:"75","data-validation-status":t||void 0,"data-disabled":n?"":void 0,onPointerDown:C=>{if(!C.target.closest("input, button, a")&&i&&typeof i=="object"&&i.current){let M=i.current;requestAnimationFrame(()=>{M.focus()})}}},_react2.default.createElement(_chunkVRX67OL2cjs.a,{direction:"column","data-visually-hidden":H?"":void 0},_react2.default.createElement(_chunkGFWH3VRNcjs.a,{htmlFor:p,id:m,disableUserSelect:!0,fontWeight:"semibold"},F,s?null:_react2.default.createElement(_chunk7TQMVZ2Rcjs.a,{as:"span",marginLeft:"50"},"(optional)")),r?_react2.default.createElement(_chunkK5BEIZDAcjs.a,{id:u,disableUserSelect:!0},r):null),_react2.default.createElement("div",{className:"hearth-TextInputRoot"},_react2.default.createElement("input",{ref:i,spellCheck:"false",id:p,required:s,disabled:n,readOnly:l,placeholder:n?void 0:S,"aria-labelledby":m,"aria-describedby":B,"aria-invalid":t==="invalid"?!0:void 0,"aria-errormessage":t==="invalid"?o:void 0,...q}),w),f?_react2.default.createElement(_chunkTIOWEGWWcjs.a,{status:t,disableUserSelect:!0,id:o},d):null)});k.displayName=P;exports.a = k;
|
|
2
|
+
//# sourceMappingURL=chunk-JMAJZ2BL.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/hearth/hearth/packages/react/dist/chunk-JMAJZ2BL.cjs","../src/components/TextInput/TextInput.tsx"],"names":["componentName","componentClassName","withGlobalPrefix","TextInput","React","props","forwardedRef","className","validationStatus","validationText","label","helperText","children","providedId","disabled","readOnly","hideLabel","required","placeholder","ariaDescribedby","textInputProps","extractProps","marginPropDefs","id","labelId","helperTextId","validationTextId","useIds","showValidationText","ariaDescribedbyValue","mergeIds","defaultRef","inputRef","Flex","clsx","event","input","Label","BodyText","HelperText","ValidationText"],"mappings":"AAAA,iOAAwC,wDAAyC,wDAAyC,wDAAoC,wDAAyC,wDAAyC,wDAAyC,wDAAyC,wDAAyC,wDAAyC,wECInY,4EACC,IAUZA,CAAAA,CAAgB,WAAA,CAChBC,CAAAA,CAAqBC,iCAAAA,CAA8B,CAAA,CAI5CC,CAAAA,aAAYC,eAAAA,CAAM,UAAA,CAC7B,CAACC,CAAAA,CAAOC,CAAAA,CAAAA,EAAiB,CACvB,GAAM,CACJ,SAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,EAAA,CAAIC,CAAAA,CACJ,QAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,kBAAA,CAAoBC,CAAAA,CACpB,GAAGC,CACL,CAAA,CAAIC,iCAAAA,CAAahB,CAAOiB,mBAAc,CAAA,CAChC,CAAE,EAAA,CAAAC,CAAAA,CAAI,OAAA,CAAAC,CAAAA,CAAS,YAAA,CAAAC,CAAAA,CAAc,gBAAA,CAAAC,CAAiB,CAAA,CAAIC,iCAAAA,CACtD,UAAA,CAAAd,CAAAA,CACA,MAAA,CAAQ,OACV,CAAC,CAAA,CAEKe,CAAAA,CACJ,CAACb,CAAAA,EAAY,CAACD,CAAAA,EAAYN,CAAAA,GAAqB,KAAA,CAAA,EAAaC,CAAAA,GAAmB,KAAA,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A,aAAA,CAACkC,mBAAAA,CAAA,CAAS,EAAA,CAAG,MAAA,CAAO,UAAA,CAAW,IAAA,CAAA,CAAK,YAEpC,CAEJ,CAAA,CACC3B,CAAAA,CACCP,eAAAA,CAAA,aAAA,CAACmC,mBAAAA,CAAA,CAAW,EAAA,CAAId,CAAAA,CAAc,iBAAA,CAAiB,CAAA,CAAA,CAAA,CAC5Cd,CACH,CAAA,CACE,IACN,CAAA,CACAP,eAAAA,CAAA,aAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,sBAAA,CAAA,CACbA,eAAAA,CAAA,aAAA,CAAC,OAAA,CAAA,CACC,GAAA,CAAK4B,CAAAA,CACL,UAAA,CAAW,OAAA,CACX,EAAA,CAAIT,CAAAA,CACJ,QAAA,CAAUN,CAAAA,CACV,QAAA,CAAUH,CAAAA,CACV,QAAA,CAAUC,CAAAA,CACV,WAAA,CAAcD,CAAAA,CAAyB,KAAA,CAAA,CAAdI,CAAAA,CACzB,iBAAA,CAAiBM,CAAAA,CACjB,kBAAA,CAAkBK,CAAAA,CAClB,cAAA,CAAcrB,CAAAA,GAAqB,SAAA,CAAY,CAAA,CAAA,CAAO,KAAA,CAAA,CACtD,mBAAA,CAAmBA,CAAAA,GAAqB,SAAA,CAAYkB,CAAAA,CAAmB,KAAA,CAAA,CACtE,GAAGN,CAAAA,CACN,CAAA,CACCR,CACH,CAAA,CACCgB,CAAAA,CACCxB,eAAAA,CAAA,aAAA,CAACoC,mBAAAA,CAAA,CAAe,MAAA,CAAQhC,CAAAA,CAAkB,iBAAA,CAAiB,CAAA,CAAA,CAAC,EAAA,CAAIkB,CAAAA,CAAAA,CAC7DjB,CACH,CAAA,CACE,IACN,CAEJ,CACF,CAAA,CAEAN,CAAAA,CAAU,WAAA,CAAcH,CAAAA,CAAAA,cAAAA","file":"/home/runner/work/hearth/hearth/packages/react/dist/chunk-JMAJZ2BL.cjs","sourcesContent":[null,"import type { ElementRef } from 'react';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport { TextInputProps } from './TextInput.props';\nimport { extractProps } from '../../helpers/extract-props';\nimport clsx from 'clsx';\nimport React from 'react';\nimport { Label } from '../Label/Label';\nimport { HelperText } from '../HelperText/HelperText';\nimport { Flex } from '../Flex/Flex';\nimport { useIds } from '../../hooks/use-ids';\nimport { ValidationText } from '../ValidationText/ValidationText';\nimport { mergeIds } from '../../helpers/merge-ids';\nimport { BodyText } from '../BodyText/BodyText';\nimport { marginPropDefs } from '../../props/margin.props';\n\nconst componentName = 'TextInput';\nconst componentClassName = withGlobalPrefix(componentName);\n\ntype TextInputElement = ElementRef<'input'>;\n\nexport const TextInput = React.forwardRef<TextInputElement, TextInputProps>(\n (props, forwardedRef) => {\n const {\n className,\n validationStatus,\n validationText,\n label,\n helperText,\n children,\n id: providedId,\n disabled,\n readOnly,\n hideLabel,\n required,\n placeholder,\n 'aria-describedby': ariaDescribedby,\n ...textInputProps\n } = extractProps(props, marginPropDefs);\n const { id, labelId, helperTextId, validationTextId } = useIds({\n providedId,\n prefix: 'input',\n });\n\n const showValidationText = Boolean(\n !readOnly && !disabled && validationStatus !== undefined && validationText !== undefined\n );\n const ariaDescribedbyValue = mergeIds(\n ariaDescribedby,\n !!helperText ? helperTextId : undefined,\n showValidationText ? validationTextId : undefined\n );\n\n const defaultRef = React.useRef<HTMLInputElement>(null);\n const inputRef = forwardedRef || defaultRef;\n return (\n <Flex\n className={clsx(componentClassName, className)}\n direction=\"column\"\n gap=\"75\"\n data-validation-status={validationStatus ? validationStatus : undefined}\n data-disabled={disabled ? '' : undefined}\n onPointerDown={event => {\n // avoid losing focus when users click on non-interactive slot elements, such as icons\n const target = event.target as HTMLElement;\n if (target.closest('input, button, a')) return;\n\n if (inputRef && typeof inputRef === 'object' && inputRef.current) {\n const input = inputRef.current;\n requestAnimationFrame(() => {\n input.focus();\n });\n }\n }}\n >\n <Flex direction=\"column\" data-visually-hidden={hideLabel ? '' : undefined}>\n <Label htmlFor={id} id={labelId} disableUserSelect fontWeight=\"semibold\">\n {label}\n {required ? null : (\n <BodyText as=\"span\" marginLeft=\"50\">\n (optional)\n </BodyText>\n )}\n </Label>\n {helperText ? (\n <HelperText id={helperTextId} disableUserSelect>\n {helperText}\n </HelperText>\n ) : null}\n </Flex>\n <div className=\"hearth-TextInputRoot\">\n <input\n ref={inputRef}\n spellCheck=\"false\"\n id={id}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n placeholder={!disabled ? placeholder : undefined}\n aria-labelledby={labelId}\n aria-describedby={ariaDescribedbyValue}\n aria-invalid={validationStatus === 'invalid' ? true : undefined}\n aria-errormessage={validationStatus === 'invalid' ? validationTextId : undefined}\n {...textInputProps}\n />\n {children}\n </div>\n {showValidationText ? (\n <ValidationText status={validationStatus} disableUserSelect id={validationTextId}>\n {validationText}\n </ValidationText>\n ) : null}\n </Flex>\n );\n }\n);\n\nTextInput.displayName = componentName;\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk3EVYXZRLcjs = require('./chunk-3EVYXZRL.cjs');var
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk3EVYXZRLcjs = require('./chunk-3EVYXZRL.cjs');var _chunkXKYU3KUYcjs = require('./chunk-XKYU3KUY.cjs');var _chunkPRACO7UDcjs = require('./chunk-PRACO7UD.cjs');var _chunk5DRU6TDWcjs = require('./chunk-5DRU6TDW.cjs');var _chunk4H5JT5ORcjs = require('./chunk-4H5JT5OR.cjs');var _react = require('react'); var t = _interopRequireWildcard(_react);var _clsx = require('clsx'); var _clsx2 = _interopRequireDefault(_clsx);var i="Button",B=_chunk4H5JT5ORcjs.b.call(void 0, i),h= exports.a =t.forwardRef((p,l)=>{let{className:c,children:o,disabled:d,loading:e,...f}=_chunk5DRU6TDWcjs.a.call(void 0, p,_chunkXKYU3KUYcjs.a);return t.createElement(_chunkPRACO7UDcjs.a,{ref:l,className:_clsx2.default.call(void 0, B,c),disabled:d||e,...f},e?t.createElement("div",{className:"hearth-loading"},t.createElement("div",null,t.createElement(_chunk3EVYXZRLcjs.a,{size:"xs",currentColor:!0})),t.createElement("span",{className:"hearth-hidden"},o)):o)});h.displayName=i;exports.a = h;
|
|
2
|
+
//# sourceMappingURL=chunk-JSIJQQYE.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/hearth/hearth/packages/react/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/hearth/hearth/packages/react/dist/chunk-JSIJQQYE.cjs","../src/components/Button/Button.tsx"],"names":["componentName","componentClassName","withGlobalPrefix","Button","props","forwardedRef","className","children","disabled","loading","buttonProps","extractProps","buttonPropDefs","ButtonBase","clsx","Spinner"],"mappings":"AAAA,mfAAwC,wDAAyC,wDAAoC,wDAAyC,wDAAyC,uECAhL,wEAEN,IAOXA,CAAAA,CAAgB,QAAA,CAChBC,CAAAA,CAAqBC,iCAAAA,CAA8B,CAAA,CAE5CC,CAAAA,aAAe,CAAA,CAAA,UAAA,CAA2C,CAACC,CAAAA,CAAOC,CAAAA,CAAAA,EAAiB,CAC9F,GAAM,CAAE,SAAA,CAAAC,CAAAA,CAAW,QAAA,CAAAC,CAAAA,CAAU,QAAA,CAAAC,CAAAA,CAAU,OAAA,CAAAC,CAAAA,CAAS,GAAGC,CAAY,CAAA,CAAIC,iCAAAA,CACjEP,CACAQ,mBACF,CAAA,CACA,OACE,CAAA,CAAA,aAAA,CAACC,mBAAAA,CAAA,CACC,GAAA,CAAKR,CAAAA,CACL,SAAA,CAAWS,4BAAAA,CAAKb,CAAoBK,CAAS,CAAA,CAC7C,QAAA,CAAUE,CAAAA,EAAYC,CAAAA,CACrB,GAAGC,CAAAA,CAAAA,CAEHD,CAAAA,CACC,CAAA,CAAA,aAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,gBAAA,CAAA,CACb,CAAA,CAAA,aAAA,CAAC,KAAA,CAAA,IAAA,CACC,CAAA,CAAA,aAAA,CAACM,mBAAAA,CAAA,CAAQ,IAAA,CAAK,IAAA,CAAK,YAAA,CAAY,CAAA,CAAA,CAAC,CAClC,CAAA,CACA,CAAA,CAAA,aAAA,CAAC,MAAA,CAAA,CAAK,SAAA,CAAU,eAAA,CAAA,CAAiBR,CAAS,CAC5C,CAAA,CAEAA,CAEJ,CAEJ,CAAC,CAAA,CAEDJ,CAAAA,CAAO,WAAA,CAAcH,CAAAA,CAAAA,cAAAA","file":"/home/runner/work/hearth/hearth/packages/react/dist/chunk-JSIJQQYE.cjs","sourcesContent":[null,"import * as React from 'react';\n\nimport clsx from 'clsx';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport { extractProps } from '../../helpers/extract-props';\nimport { ButtonBase, ButtonBaseElement } from '../ButtonBase/ButtonBase';\nimport { buttonPropDefs, ButtonProps } from './Button.props';\nimport { Spinner } from '../Spinner/Spinner';\n\nconst componentName = 'Button';\nconst componentClassName = withGlobalPrefix(componentName);\n\nexport const Button = React.forwardRef<ButtonBaseElement, ButtonProps>((props, forwardedRef) => {\n const { className, children, disabled, loading, ...buttonProps } = extractProps(\n props,\n buttonPropDefs\n );\n return (\n <ButtonBase\n ref={forwardedRef}\n className={clsx(componentClassName, className)}\n disabled={disabled || loading}\n {...buttonProps}\n >\n {loading ? (\n <div className=\"hearth-loading\">\n <div>\n <Spinner size=\"xs\" currentColor />\n </div>\n <span className=\"hearth-hidden\">{children}</span>\n </div>\n ) : (\n children\n )}\n </ButtonBase>\n );\n});\n\nButton.displayName = componentName;\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as C}from"./chunk-C2M7FEJX.js";import{a as u}from"./chunk-JPYVWTDN.js";import{c as y}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as C}from"./chunk-C2M7FEJX.js";import{a as u}from"./chunk-JPYVWTDN.js";import{c as y}from"./chunk-5OLLJKEO.js";import{c as I}from"./chunk-T64W7Q7K.js";import{a}from"./chunk-35HZSCJP.js";import{a as k}from"./chunk-XQ5A24NX.js";import{a as R}from"./chunk-QC4ZMGCU.js";import{a as f}from"./chunk-RTGGS5XX.js";import{b as h}from"./chunk-4PEMW3UE.js";import*as e from"react";import S from"clsx";import{TickSmallIcon as U}from"@utilitywarehouse/hearth-react-icons";import{Checkbox as T}from"radix-ui";var N="Checkbox",D=h(N),B=e.forwardRef((P,g)=>{let{id:F,label:c,helperText:l,className:G,disabled:i,onCheckedChange:s,value:o="on","aria-labelledby":H,...v}=f(P,k),{id:m,labelId:n,helperTextId:d}=R({providedId:F,prefix:"checkbox"}),r=y(),t=I(),w=t?.value?.includes(o),E=r?.hasGroupHelperText,L=r?r["aria-describedby"]:"",p=!E&&!!l,b=!!c;return e.createElement(a,{gap:"100",className:S(D,G),"data-disabled":i?"":void 0},e.createElement(T.Root,{ref:g,className:"hearth-CheckboxRoot",name:t?.name,checked:w,value:o,...v,id:m,disabled:i,"aria-describedby":p?d:L,"aria-labelledby":H||b?n:void 0,onCheckedChange:x=>{r&&(x?t?.onItemCheck(o):t?.onItemUncheck(o)),s&&s(x)}},e.createElement(T.Indicator,{asChild:!0,className:"hearth-CheckboxIndicator"},e.createElement(U,null))),b?e.createElement(a,{direction:"column",gap:"50"},e.createElement(C,{id:n,htmlFor:m,disableUserSelect:!0},c),p?e.createElement(u,{id:d,disableUserSelect:!0},l):null):null)});B.displayName=N;export{B as a};
|
|
2
|
+
//# sourceMappingURL=chunk-KTWZRVIV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport clsx from 'clsx';\nimport type { CheckboxProps } from './Checkbox.props';\nimport { Flex } from '../Flex/Flex';\nimport { Label } from '../Label/Label';\nimport { HelperText } from '../HelperText/HelperText';\nimport type { ElementRef } from 'react';\nimport { TickSmallIcon } from '@utilitywarehouse/hearth-react-icons';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport { useIds } from '../../hooks/use-ids';\nimport { marginPropDefs } from '../../props/margin.props';\nimport { extractProps } from '../../helpers/extract-props';\nimport { Checkbox as RadixCheckbox } from 'radix-ui';\nimport { useCheckboxGroup } from '../CheckboxGroup/CheckboxGroup.context';\nimport { useFormGroupBase } from '../FormGroupBase/FormGroupBase.context';\n\nconst componentName = 'Checkbox';\nconst componentClassName = withGlobalPrefix(componentName);\n\nexport type CheckboxElement = ElementRef<'button'>;\n\nexport const Checkbox = React.forwardRef<CheckboxElement, CheckboxProps>((props, ref) => {\n const {\n id: providedId,\n label,\n helperText,\n className,\n disabled,\n onCheckedChange,\n value = 'on',\n 'aria-labelledby': ariaLabelledby,\n ...checkboxProps\n } = extractProps(props, marginPropDefs);\n const { id, labelId, helperTextId } = useIds({ providedId, prefix: 'checkbox' });\n const context = useFormGroupBase();\n const checkboxContext = useCheckboxGroup();\n const checked = checkboxContext?.value?.includes(value);\n const hasGroupHelperText = context?.hasGroupHelperText;\n const ariaDescribedby = context ? context['aria-describedby'] : '';\n const showHelperText = !hasGroupHelperText && !!helperText;\n const showLabel = !!label;\n\n return (\n <Flex\n gap=\"100\"\n className={clsx(componentClassName, className)}\n data-disabled={disabled ? '' : undefined}\n >\n <RadixCheckbox.Root\n ref={ref}\n className=\"hearth-CheckboxRoot\"\n name={checkboxContext?.name}\n checked={checked}\n value={value}\n {...checkboxProps}\n id={id}\n disabled={disabled}\n aria-describedby={showHelperText ? helperTextId : ariaDescribedby}\n aria-labelledby={ariaLabelledby || showLabel ? labelId : undefined}\n onCheckedChange={(checked: boolean) => {\n if (context) {\n if (checked) {\n checkboxContext?.onItemCheck(value);\n } else {\n checkboxContext?.onItemUncheck(value);\n }\n }\n if (onCheckedChange) {\n onCheckedChange(checked);\n }\n }}\n >\n <RadixCheckbox.Indicator asChild className=\"hearth-CheckboxIndicator\">\n <TickSmallIcon />\n </RadixCheckbox.Indicator>\n </RadixCheckbox.Root>\n {showLabel ? (\n <Flex direction=\"column\" gap=\"50\">\n <Label id={labelId} htmlFor={id} disableUserSelect>\n {label}\n </Label>\n {showHelperText ? (\n <HelperText id={helperTextId} disableUserSelect>\n {helperText}\n </HelperText>\n ) : null}\n </Flex>\n ) : null}\n </Flex>\n );\n});\n\nCheckbox.displayName = componentName;\n"],"mappings":"mWAAA,UAAYA,MAAW,QACvB,OAAOC,MAAU,OAMjB,OAAS,iBAAAC,MAAqB,uCAK9B,OAAS,YAAYC,MAAqB,WAI1C,IAAMC,EAAgB,WAChBC,EAAqBC,EAAiBF,CAAa,EAI5CG,EAAiB,aAA2C,CAACC,EAAOC,IAAQ,CACvF,GAAM,CACJ,GAAIC,EACJ,MAAAC,EACA,WAAAC,EACA,UAAAC,EACA,SAAAC,EACA,gBAAAC,EACA,MAAAC,EAAQ,KACR,kBAAmBC,EACnB,GAAGC,CACL,EAAIC,EAAaX,EAAOY,CAAc,EAChC,CAAE,GAAAC,EAAI,QAAAC,EAAS,aAAAC,CAAa,EAAIC,EAAO,CAAE,WAAAd,EAAY,OAAQ,UAAW,CAAC,EACzEe,EAAUC,EAAiB,EAC3BC,EAAkBC,EAAiB,EACnCC,EAAUF,GAAiB,OAAO,SAASX,CAAK,EAChDc,EAAqBL,GAAS,mBAC9BM,EAAkBN,EAAUA,EAAQ,kBAAkB,EAAI,GAC1DO,EAAiB,CAACF,GAAsB,CAAC,CAAClB,EAC1CqB,EAAY,CAAC,CAACtB,EAEpB,OACE,gBAACuB,EAAA,CACC,IAAI,MACJ,UAAWC,EAAK9B,EAAoBQ,CAAS,EAC7C,gBAAeC,EAAW,GAAK,QAE/B,gBAACsB,EAAc,KAAd,CACC,IAAK3B,EACL,UAAU,sBACV,KAAMkB,GAAiB,KACvB,QAASE,EACT,MAAOb,EACN,GAAGE,EACJ,GAAIG,EACJ,SAAUP,EACV,mBAAkBkB,EAAiBT,EAAeQ,EAClD,kBAAiBd,GAAkBgB,EAAYX,EAAU,OACzD,gBAAkBO,GAAqB,CACjCJ,IACEI,EACFF,GAAiB,YAAYX,CAAK,EAElCW,GAAiB,cAAcX,CAAK,GAGpCD,GACFA,EAAgBc,CAAO,CAE3B,GAEA,gBAACO,EAAc,UAAd,CAAwB,QAAO,GAAC,UAAU,4BACzC,gBAACC,EAAA,IAAc,CACjB,CACF,EACCJ,EACC,gBAACC,EAAA,CAAK,UAAU,SAAS,IAAI,MAC3B,gBAACI,EAAA,CAAM,GAAIhB,EAAS,QAASD,EAAI,kBAAiB,IAC/CV,CACH,EACCqB,EACC,gBAACO,EAAA,CAAW,GAAIhB,EAAc,kBAAiB,IAC5CX,CACH,EACE,IACN,EACE,IACN,CAEJ,CAAC,EAEDL,EAAS,YAAcH","names":["React","clsx","TickSmallIcon","RadixCheckbox","componentName","componentClassName","withGlobalPrefix","Checkbox","props","ref","providedId","label","helperText","className","disabled","onCheckedChange","value","ariaLabelledby","checkboxProps","extractProps","marginPropDefs","id","labelId","helperTextId","useIds","context","useFormGroupBase","checkboxContext","useCheckboxGroup","checked","hasGroupHelperText","ariaDescribedby","showHelperText","showLabel","Flex","clsx","RadixCheckbox","TickSmallIcon","Label","HelperText"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as k}from"./chunk-SH7GIFPO.js";import{b as C}from"./chunk-T64W7Q7K.js";import{a as h}from"./chunk-35HZSCJP.js";import{b as f}from"./chunk-4PEMW3UE.js";import*as o from"react";import U from"clsx";import{useControllableState as z}from"@radix-ui/react-use-controllable-state";var x="CheckboxGroup",S=f(x),j=o.forwardRef(({disabled:r,required:a,label:G,helperText:b,validationText:d,validationStatus:v,value:m,contentWidth:p="fit-content",direction:n="column",defaultValue:s,onValueChange:l,children:u,className:P,name:i,...R},N)=>{let w={...R,disabled:r,required:a,label:G,helperText:b,validationText:d,validationStatus:v},E={width:p,direction:n,name:i,required:a,disabled:r,defaultValue:s,value:m,onValueChange:l,children:u},[F=[],e]=z({prop:m,defaultProp:s,onChange:l}),I=o.useCallback(t=>e((c=[])=>[...c,t]),[e]),y=o.useCallback(t=>e((c=[])=>c.filter(g=>g!==t)),[e]),B={name:i,value:F,onItemCheck:I,onItemUncheck:y};return o.createElement(k,{ref:N,className:U(S,P),...w},o.createElement(h,{...E,className:"hearth-CheckboxGroupContent","data-orientation":n==="column"?"vertical":"horizontal","data-disabled":r?"":void 0,width:p},o.createElement(C,{value:B},u)))});j.displayName=x;export{j as a};
|
|
2
|
+
//# sourceMappingURL=chunk-KW4TIBGT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/CheckboxGroup/CheckboxGroup.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport clsx from 'clsx';\n\nimport { CheckboxGroupProps } from './CheckboxGroup.props';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport type { ElementRef } from 'react';\nimport { Flex } from '../Flex/Flex';\nimport { FormGroupBase } from '../FormGroupBase/FormGroupBase';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { CheckboxGroupProvider } from './CheckboxGroup.context';\n\nconst componentName = 'CheckboxGroup';\nconst componentClassName = withGlobalPrefix(componentName);\n\ntype CheckboxGroupElement = ElementRef<'fieldset'>;\n\nexport const CheckboxGroup = React.forwardRef<CheckboxGroupElement, CheckboxGroupProps>(\n (\n {\n disabled,\n required,\n label,\n helperText,\n validationText,\n validationStatus,\n value: valueProp,\n contentWidth = 'fit-content',\n direction = 'column',\n defaultValue,\n onValueChange,\n children,\n className,\n name,\n ...props\n },\n ref\n ) => {\n const formGroupBaseProps = {\n ...props,\n disabled,\n required,\n label,\n helperText,\n validationText,\n validationStatus,\n };\n const checkboxGroupProps = {\n width: contentWidth,\n direction,\n name,\n required,\n disabled,\n defaultValue,\n value: valueProp,\n onValueChange,\n children,\n };\n // useControllableState will handle whether controlled or uncontrolled\n const [value = [], setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n const handleItemCheck = React.useCallback(\n (itemValue: string) => setValue((prevValue = []) => [...prevValue, itemValue]),\n [setValue]\n );\n\n const handleItemUncheck = React.useCallback(\n (itemValue: string) =>\n setValue((prevValue = []) => prevValue.filter(value => value !== itemValue)),\n [setValue]\n );\n\n const providerValue = {\n name,\n value,\n onItemCheck: handleItemCheck,\n onItemUncheck: handleItemUncheck,\n };\n return (\n <FormGroupBase\n ref={ref}\n className={clsx(componentClassName, className)}\n {...formGroupBaseProps}\n >\n <Flex\n {...checkboxGroupProps}\n className=\"hearth-CheckboxGroupContent\"\n data-orientation={direction === 'column' ? 'vertical' : 'horizontal'}\n data-disabled={disabled ? '' : undefined}\n width={contentWidth}\n >\n <CheckboxGroupProvider value={providerValue}>{children}</CheckboxGroupProvider>\n </Flex>\n </FormGroupBase>\n );\n }\n);\n\nCheckboxGroup.displayName = componentName;\n"],"mappings":"gKAAA,UAAYA,MAAW,QAEvB,OAAOC,MAAU,OAOjB,OAAS,wBAAAC,MAA4B,yCAGrC,IAAMC,EAAgB,gBAChBC,EAAqBC,EAAiBF,CAAa,EAI5CG,EAAsB,aACjC,CACE,CACE,SAAAC,EACA,SAAAC,EACA,MAAAC,EACA,WAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,MAAOC,EACP,aAAAC,EAAe,cACf,UAAAC,EAAY,SACZ,aAAAC,EACA,cAAAC,EACA,SAAAC,EACA,UAAAC,EACA,KAAAC,EACA,GAAGC,CACL,EACAC,IACG,CACH,IAAMC,EAAqB,CACzB,GAAGF,EACH,SAAAd,EACA,SAAAC,EACA,MAAAC,EACA,WAAAC,EACA,eAAAC,EACA,iBAAAC,CACF,EACMY,EAAqB,CACzB,MAAOV,EACP,UAAAC,EACA,KAAAK,EACA,SAAAZ,EACA,SAAAD,EACA,aAAAS,EACA,MAAOH,EACP,cAAAI,EACA,SAAAC,CACF,EAEM,CAACO,EAAQ,CAAC,EAAGC,CAAQ,EAAIC,EAAqB,CAClD,KAAMd,EACN,YAAaG,EACb,SAAUC,CACZ,CAAC,EAEKW,EAAwB,cAC3BC,GAAsBH,EAAS,CAACI,EAAY,CAAC,IAAM,CAAC,GAAGA,EAAWD,CAAS,CAAC,EAC7E,CAACH,CAAQ,CACX,EAEMK,EAA0B,cAC7BF,GACCH,EAAS,CAACI,EAAY,CAAC,IAAMA,EAAU,OAAOL,GAASA,IAAUI,CAAS,CAAC,EAC7E,CAACH,CAAQ,CACX,EAEMM,EAAgB,CACpB,KAAAZ,EACA,MAAAK,EACA,YAAaG,EACb,cAAeG,CACjB,EACA,OACE,gBAACE,EAAA,CACC,IAAKX,EACL,UAAWY,EAAK9B,EAAoBe,CAAS,EAC5C,GAAGI,GAEJ,gBAACY,EAAA,CACE,GAAGX,EACJ,UAAU,8BACV,mBAAkBT,IAAc,SAAW,WAAa,aACxD,gBAAeR,EAAW,GAAK,OAC/B,MAAOO,GAEP,gBAACsB,EAAA,CAAsB,MAAOJ,GAAgBd,CAAS,CACzD,CACF,CAEJ,CACF,EAEAZ,EAAc,YAAcH","names":["React","clsx","useControllableState","componentName","componentClassName","withGlobalPrefix","CheckboxGroup","disabled","required","label","helperText","validationText","validationStatus","valueProp","contentWidth","direction","defaultValue","onValueChange","children","className","name","props","ref","formGroupBaseProps","checkboxGroupProps","value","setValue","useControllableState","handleItemCheck","itemValue","prevValue","handleItemUncheck","providerValue","FormGroupBase","clsx","Flex","CheckboxGroupProvider"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _chunkTIOWEGWWcjs = require('./chunk-TIOWEGWW.cjs');var _chunkK5BEIZDAcjs = require('./chunk-K5BEIZDA.cjs');var _chunkHSPOCJ5Acjs = require('./chunk-HSPOCJ5A.cjs');var _chunkVRX67OL2cjs = require('./chunk-VRX67OL2.cjs');var _chunkLAVQWQP2cjs = require('./chunk-LAVQWQP2.cjs');var _chunkTMWB3U4Xcjs = require('./chunk-TMWB3U4X.cjs');var _chunk5DRU6TDWcjs = require('./chunk-5DRU6TDW.cjs');var _chunk4H5JT5ORcjs = require('./chunk-4H5JT5OR.cjs');var _chunkDSW76HKTcjs = require('./chunk-DSW76HKT.cjs');var _react = require('react'); var e = _interopRequireWildcard(_react);var _clsx = require('clsx'); var _clsx2 = _interopRequireDefault(_clsx);var F="FormGroupBase",C=_chunk4H5JT5ORcjs.b.call(void 0, F),M= exports.a =e.forwardRef((g,v)=>{let{children:P,className:I,id:N,label:o,helperText:a,validationText:i,validationStatus:t,disabled:l,"aria-labelledby":E,"aria-describedby":H,"aria-errormessage":d,...R}=_chunk5DRU6TDWcjs.a.call(void 0, g,_chunkLAVQWQP2cjs.a),{id:V,labelId:n,helperTextId:m,validationTextId:s}=_chunkTMWB3U4Xcjs.a.call(void 0, {providedId:N,prefix:"fieldset"}),w=!!o,p=!!a,r=!!(t&&i),f=_chunkDSW76HKTcjs.a.call(void 0, H||a?m:void 0,d||r?s:void 0),D={hasGroupHelperText:p,hasGroupValidationText:t!==void 0&&i!==void 0,"aria-describedby":f};return e.createElement("fieldset",{className:_clsx2.default.call(void 0, C,I),ref:v,...R,disabled:l,id:V,"data-disabled":l?"":void 0,"aria-errormessage":d||r?s:void 0,"aria-labelledby":_nullishCoalesce(E, () => ((o?n:void 0))),"aria-invalid":r,"aria-describedby":f},w?e.createElement(e.Fragment,null,e.createElement("legend",{id:n,className:"hearth-Legend"},o),p||r?e.createElement(_chunkVRX67OL2cjs.a,{direction:"column",alignItems:"start",className:"hearth-HelperTextContainer"},a?e.createElement(_chunkK5BEIZDAcjs.a,{id:m,disabled:l},a):null,r?e.createElement(_chunkTIOWEGWWcjs.a,{id:s,status:t},i):null):null):null,e.createElement(_chunkHSPOCJ5Acjs.b,{value:D},P))});M.displayName=F;exports.a = M;
|
|
2
|
+
//# sourceMappingURL=chunk-PDRE4SEJ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/hearth/hearth/packages/react/dist/chunk-PDRE4SEJ.cjs","../src/components/FormGroupBase/FormGroupBase.tsx"],"names":["componentName","componentClassName","withGlobalPrefix","FormGroupBase","props","ref","children","className","providedId","label","helperText","validationText","validationStatus","disabled","ariaLabelledby","ariaDescribedby","ariaErrorMessage","fieldsetProps","extractProps","marginPropDefs","id","labelId","helperTextId","validationTextId","useIds","hasLabel","hasHelperText","showValidationText","ariaDescribedbyValue","mergeIds","value","clsx","Flex","HelperText","ValidationText","FormGroupBaseProvider"],"mappings":"AAAA,ulBAAwC,wDAAyC,wDAAyC,wDAAyC,wDAAyC,wDAAyC,wDAAyC,wDAAyC,wDAAyC,uECAzV,wEAON,IAOXA,CAAAA,CAAgB,eAAA,CAChBC,CAAAA,CAAqBC,iCAAAA,CAA8B,CAAA,CAI5CC,CAAAA,aAAsB,CAAA,CAAA,UAAA,CACjC,CAACC,CAAAA,CAAOC,CAAAA,CAAAA,EAAQ,CACd,GAAM,CACJ,QAAA,CAAAC,CAAAA,CACA,SAAA,CAA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CAAW,EAAA,CAAK,KAAA,CAAA,CAC/B,mBAAA,CAAmBG,CAAAA,EAAoBW,CAAAA,CAAqBJ,CAAAA,CAAmB,KAAA,CAAA,CAC/E,iBAAA,kBAAiBT,CAAAA,SAAAA,CAA2BL,CAAAA,CAASY,CAAAA,CAAU,KAAA,CAAA,GAAA,CAC/D,cAAA,CAAcM,CAAAA,CACd,kBAAA,CAAkBC,CAAAA,CAAAA,CAEjBH,CAAAA,CACC,CAAA,CAAA,aAAA,CAAA,CAAA,CAAA,QAAA,CAAA,IAAA,CACE,CAAA,CAAA,aAAA,CAAC,QAAA,CAAA,CAAO,EAAA,CAAIJ,CAAAA,CAAS,SAAA,CAAU,eAAA,CAAA,CAC5BZ,CACH,CAAA,CACCiB,CAAAA,EAAiBC,CAAAA,CAChB,CAAA,CAAA,aAAA,CAACK,mBAAAA,CAAA,CAAK,SAAA,CAAU,QAAA,CAAS,UAAA,CAAW,OAAA,CAAQ,SAAA,CAAU,4BAAA,CAAA,CACnDtB,CAAAA,CACC,CAAA,CAAA,aAAA,CAACuB,mBAAAA,CAAA,CAAW,EAAA,CAAIX,CAAAA,CAAc,QAAA,CAAUT,CAAAA,CAAAA,CACrCH,CACH,CAAA,CACE,IAAA,CACHiB,CAAAA,CACC,CAAA,CAAA,aAAA,CAACO,mBAAAA,CAAA,CAAe,EAAA,CAAIX,CAAAA,CAAkB,MAAA,CAAQX,CAAAA,CAAAA,CAC3CD,CACH,CAAA,CACE,IACN,CAAA,CACE,IACN,CAAA,CACE,IAAA,CACJ,CAAA,CAAA,aAAA,CAACwB,mBAAAA,CAAA,CAAsB,KAAA,CAAOL,CAAAA,CAAAA,CAAQxB,CAAS,CACjD,CAEJ,CACF,CAAA,CAEAH,CAAAA,CAAc,WAAA,CAAcH,CAAAA,CAAAA,cAAAA","file":"/home/runner/work/hearth/hearth/packages/react/dist/chunk-PDRE4SEJ.cjs","sourcesContent":[null,"import * as React from 'react';\nimport type { ElementRef } from 'react';\nimport { useIds } from '../../hooks/use-ids';\nimport { mergeIds } from '../../helpers/merge-ids';\nimport { Flex } from '../Flex/Flex';\nimport { HelperText } from '../HelperText/HelperText';\nimport { ValidationText } from '../ValidationText/ValidationText';\nimport clsx from 'clsx';\nimport type { FormGroupBaseProps } from './FormGroupBase.props';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport { extractProps } from '../../helpers/extract-props';\nimport { marginPropDefs } from '../../props/margin.props';\nimport { FormGroupBaseProvider } from './FormGroupBase.context';\n\nconst componentName = 'FormGroupBase';\nconst componentClassName = withGlobalPrefix(componentName);\n\ntype FormGroupBaseElement = ElementRef<'fieldset'>;\n\nexport const FormGroupBase = React.forwardRef<FormGroupBaseElement, FormGroupBaseProps>(\n (props, ref) => {\n const {\n children,\n className,\n id: providedId,\n label,\n helperText,\n validationText,\n validationStatus,\n disabled,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-errormessage': ariaErrorMessage,\n ...fieldsetProps\n } = extractProps(props, marginPropDefs);\n const { id, labelId, helperTextId, validationTextId } = useIds({\n providedId,\n prefix: 'fieldset',\n });\n const hasLabel = Boolean(label);\n const hasHelperText = Boolean(helperText);\n const showValidationText = Boolean(validationStatus && validationText);\n const ariaDescribedbyValue = mergeIds(\n ariaDescribedby || !!helperText ? helperTextId : undefined,\n ariaErrorMessage || showValidationText ? validationTextId : undefined\n );\n const value = {\n hasGroupHelperText: hasHelperText,\n hasGroupValidationText: Boolean(\n validationStatus !== undefined && validationText !== undefined\n ),\n 'aria-describedby': ariaDescribedbyValue,\n };\n\n return (\n <fieldset\n className={clsx(componentClassName, className)}\n ref={ref}\n {...fieldsetProps}\n disabled={disabled}\n id={id}\n data-disabled={disabled ? '' : undefined}\n aria-errormessage={ariaErrorMessage || showValidationText ? validationTextId : undefined}\n aria-labelledby={ariaLabelledby ?? (Boolean(label) ? labelId : undefined)}\n aria-invalid={showValidationText}\n aria-describedby={ariaDescribedbyValue}\n >\n {hasLabel ? (\n <>\n <legend id={labelId} className=\"hearth-Legend\">\n {label}\n </legend>\n {hasHelperText || showValidationText ? (\n <Flex direction=\"column\" alignItems=\"start\" className=\"hearth-HelperTextContainer\">\n {helperText ? (\n <HelperText id={helperTextId} disabled={disabled}>\n {helperText}\n </HelperText>\n ) : null}\n {showValidationText ? (\n <ValidationText id={validationTextId} status={validationStatus}>\n {validationText}\n </ValidationText>\n ) : null}\n </Flex>\n ) : null}\n </>\n ) : null}\n <FormGroupBaseProvider value={value}>{children}</FormGroupBaseProvider>\n </fieldset>\n );\n }\n);\n\nFormGroupBase.displayName = componentName;\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as c}from"./chunk-7BCHAXO2.js";import{a as n}from"./chunk-PUVKWSFV.js";import{a as u}from"./chunk-4WMT5PSA.js";import{a as m}from"./chunk-E2FMYLM2.js";import{b as p}from"./chunk-4PEMW3UE.js";import d from"clsx";import e from"react";import{CloseSmallIcon as y,SearchMediumIcon as b}from"@utilitywarehouse/hearth-react-icons";var f="SearchInput",T=p(f),E=e.forwardRef(({className:i,disabled:l,value:o,onClear:r,loading:s,...a},I)=>{let h=e.useRef(null),t=I||h,S=e.useCallback(x=>{typeof r!="function"||x.button!==0||(r(),t&&typeof t=="object"&&t.current&&t.current.focus())},[t,r]);return e.createElement(c,{ref:t,className:d(T,i),type:"search",role:"search",enterKeyHint:"search",disabled:l,hideLabel:!0,value:o,...a},e.createElement(n,{placement:"prefix"},e.createElement(b,null)),s?e.createElement(n,{placement:"suffix"},e.createElement(m,{size:"xs",color:"grey1000"})):null,o!==void 0&&String(o).length>0?e.createElement(n,{placement:"suffix"},e.createElement(u,{type:"button",label:"clear search",onClick:S,disabled:l},e.createElement(y,null))):null)});E.displayName=f;export{E as a};
|
|
2
|
+
//# sourceMappingURL=chunk-PG455XUN.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as y}from"./chunk-PJXMEG7B.js";import{a as T}from"./chunk-C2M7FEJX.js";import{a as h}from"./chunk-JPYVWTDN.js";import{a as t}from"./chunk-35HZSCJP.js";import{a as b}from"./chunk-VBMXLPU5.js";import{a as u}from"./chunk-XQ5A24NX.js";import{a as v}from"./chunk-QC4ZMGCU.js";import{a as c}from"./chunk-RTGGS5XX.js";import{b as x}from"./chunk-4PEMW3UE.js";import{a as A}from"./chunk-DVGYWBKQ.js";import*as e from"react";import L from"clsx";var g="TextArea",U=x(g),q=e.forwardRef((I,N)=>{let{className:P,validationStatus:a,validationText:d,label:R,helperText:i,id:w,disabled:r,readOnly:l,required:n,placeholder:F,resize:E,rows:S=3,...V}=c(I,u),{id:s,labelId:m,helperTextId:p,validationTextId:o}=v({providedId:w,prefix:"textarea"}),f=!l&&!r&&a!==void 0&&d!==void 0,B=A(i?p:void 0,f?o:void 0);return e.createElement(t,{direction:"column",gap:"75",className:L(U,P),"data-validation-status":a||void 0,"data-disabled":r?"":void 0},e.createElement(t,{direction:"column"},e.createElement(T,{htmlFor:s,id:m,disableUserSelect:!0,fontWeight:"semibold"},R,n?null:e.createElement(b,{as:"span",marginLeft:"50"},"(optional)")),i?e.createElement(h,{id:p,disableUserSelect:!0},i):null),e.createElement(t,{direction:"column",className:"hearth-TextAreaRoot"},e.createElement("textarea",{ref:N,id:s,rows:S,required:n,disabled:r,readOnly:l,placeholder:r?void 0:F,"aria-labelledby":m,"aria-describedby":B,"aria-invalid":a==="invalid"?!0:void 0,"aria-errormessage":a==="invalid"?o:void 0,"data-resize":E,...V})),f?e.createElement(y,{status:a,disableUserSelect:!0,id:o},d):null)});q.displayName=g;export{q as a};
|
|
2
|
+
//# sourceMappingURL=chunk-QGXYOTLB.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as i}from"./chunk-SH7GIFPO.js";import{a as p}from"./chunk-35HZSCJP.js";import{b as m}from"./chunk-4PEMW3UE.js";import*as o from"react";import y from"clsx";import{RadioGroup as B}from"radix-ui";var s="RadioGroup",C=m(s),v=o.forwardRef(({children:R,contentWidth:r,direction:t="column",className:l,label:f,helperText:n,validationText:d,validationStatus:u,required:a,disabled:e,loop:c,defaultValue:G,value:x,onValueChange:P,name:h,...w},E)=>{let F={...w,disabled:e,required:a,label:f,helperText:n,validationText:d,validationStatus:u},N={width:r,direction:t,name:h,required:a,disabled:e,loop:c,defaultValue:G,value:x,onValueChange:P};return o.createElement(i,{ref:E,...F},o.createElement(B.Root,{asChild:!0,className:y(C,l),...N,orientation:t==="column"?"vertical":"horizontal"},o.createElement(p,{width:r},R)))});v.displayName=s;export{v as a};
|
|
2
|
+
//# sourceMappingURL=chunk-SGZVBXYO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport clsx from 'clsx';\n\nimport { RadioGroup as RadixRadioGroup } from 'radix-ui';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport type { ElementRef } from 'react';\nimport { RadioGroupProps } from './RadioGroup.props';\nimport { Flex } from '../Flex/Flex';\nimport { FormGroupBase } from '../FormGroupBase/FormGroupBase';\n\nconst componentName = 'RadioGroup';\nconst componentClassName = withGlobalPrefix(componentName);\n\ntype RadioGroupElement = ElementRef<'fieldset'>;\n\nexport const RadioGroup = React.forwardRef<RadioGroupElement, RadioGroupProps>(\n (\n {\n children,\n contentWidth,\n direction = 'column',\n className,\n label,\n helperText,\n validationText,\n validationStatus,\n required,\n disabled,\n loop,\n defaultValue,\n value,\n onValueChange,\n name,\n ...props\n },\n ref\n ) => {\n const fieldsetProps = {\n ...props,\n disabled,\n required,\n label,\n helperText,\n validationText,\n validationStatus,\n };\n const radioGroupRootProps = {\n width: contentWidth,\n direction,\n name,\n required,\n disabled,\n loop,\n defaultValue,\n value,\n onValueChange,\n };\n\n return (\n <FormGroupBase ref={ref} {...fieldsetProps}>\n <RadixRadioGroup.Root\n asChild\n className={clsx(componentClassName, className)}\n {...radioGroupRootProps}\n orientation={direction === 'column' ? 'vertical' : 'horizontal'}\n >\n <Flex width={contentWidth}>{children}</Flex>\n </RadixRadioGroup.Root>\n </FormGroupBase>\n );\n }\n);\n\nRadioGroup.displayName = componentName;\n"],"mappings":"wHAAA,UAAYA,MAAW,QAEvB,OAAOC,MAAU,OAEjB,OAAS,cAAcC,MAAuB,WAO9C,IAAMC,EAAgB,aAChBC,EAAqBC,EAAiBF,CAAa,EAI5CG,EAAmB,aAC9B,CACE,CACE,SAAAC,EACA,aAAAC,EACA,UAAAC,EAAY,SACZ,UAAAC,EACA,MAAAC,EACA,WAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,SAAAC,EACA,SAAAC,EACA,KAAAC,EACA,aAAAC,EACA,MAAAC,EACA,cAAAC,EACA,KAAAC,EACA,GAAGC,CACL,EACAC,IACG,CACH,IAAMC,EAAgB,CACpB,GAAGF,EACH,SAAAN,EACA,SAAAD,EACA,MAAAJ,EACA,WAAAC,EACA,eAAAC,EACA,iBAAAC,CACF,EACMW,EAAsB,CAC1B,MAAOjB,EACP,UAAAC,EACA,KAAAY,EACA,SAAAN,EACA,SAAAC,EACA,KAAAC,EACA,aAAAC,EACA,MAAAC,EACA,cAAAC,CACF,EAEA,OACE,gBAACM,EAAA,CAAc,IAAKH,EAAM,GAAGC,GAC3B,gBAACG,EAAgB,KAAhB,CACC,QAAO,GACP,UAAWC,EAAKxB,EAAoBM,CAAS,EAC5C,GAAGe,EACJ,YAAahB,IAAc,SAAW,WAAa,cAEnD,gBAACoB,EAAA,CAAK,MAAOrB,GAAeD,CAAS,CACvC,CACF,CAEJ,CACF,EAEAD,EAAW,YAAcH","names":["React","clsx","RadixRadioGroup","componentName","componentClassName","withGlobalPrefix","RadioGroup","children","contentWidth","direction","className","label","helperText","validationText","validationStatus","required","disabled","loop","defaultValue","value","onValueChange","name","props","ref","fieldsetProps","radioGroupRootProps","FormGroupBase","RadixRadioGroup","clsx","Flex"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as h}from"./chunk-PJXMEG7B.js";import{a as B}from"./chunk-JPYVWTDN.js";import{b as G}from"./chunk-5OLLJKEO.js";import{a as x}from"./chunk-35HZSCJP.js";import{a as b}from"./chunk-XQ5A24NX.js";import{a as T}from"./chunk-QC4ZMGCU.js";import{a as c}from"./chunk-RTGGS5XX.js";import{b as u}from"./chunk-4PEMW3UE.js";import{a as y}from"./chunk-DVGYWBKQ.js";import*as e from"react";import L from"clsx";var F="FormGroupBase",C=u(F),M=e.forwardRef((g,v)=>{let{children:P,className:I,id:N,label:o,helperText:a,validationText:i,validationStatus:t,disabled:l,"aria-labelledby":E,"aria-describedby":H,"aria-errormessage":d,...R}=c(g,b),{id:V,labelId:n,helperTextId:m,validationTextId:s}=T({providedId:N,prefix:"fieldset"}),w=!!o,p=!!a,r=!!(t&&i),f=y(H||a?m:void 0,d||r?s:void 0),D={hasGroupHelperText:p,hasGroupValidationText:t!==void 0&&i!==void 0,"aria-describedby":f};return e.createElement("fieldset",{className:L(C,I),ref:v,...R,disabled:l,id:V,"data-disabled":l?"":void 0,"aria-errormessage":d||r?s:void 0,"aria-labelledby":E??(o?n:void 0),"aria-invalid":r,"aria-describedby":f},w?e.createElement(e.Fragment,null,e.createElement("legend",{id:n,className:"hearth-Legend"},o),p||r?e.createElement(x,{direction:"column",alignItems:"start",className:"hearth-HelperTextContainer"},a?e.createElement(B,{id:m,disabled:l},a):null,r?e.createElement(h,{id:s,status:t},i):null):null):null,e.createElement(G,{value:D},P))});M.displayName=F;export{M as a};
|
|
2
|
+
//# sourceMappingURL=chunk-SH7GIFPO.js.map
|