@accelint/design-toolkit 2.4.3 → 2.6.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/components/accordion/index.d.ts +1 -1
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/accordion/styles.d.ts +1 -5
- package/dist/components/accordion/styles.js +1 -1
- package/dist/components/accordion/styles.js.map +1 -1
- package/dist/components/accordion/types.d.ts +9 -10
- package/dist/components/avatar/index.d.ts +4 -2
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/avatar/styles.d.ts +16 -15
- package/dist/components/avatar/styles.js +1 -1
- package/dist/components/avatar/styles.js.map +1 -1
- package/dist/components/avatar/types.d.ts +7 -7
- package/dist/components/badge/index.d.ts +3 -2
- package/dist/components/badge/index.js +1 -1
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/badge/styles.js +1 -1
- package/dist/components/badge/styles.js.map +1 -1
- package/dist/components/badge/types.d.ts +3 -4
- package/dist/components/box/index.js +1 -1
- package/dist/components/box/index.js.map +1 -1
- package/dist/components/button/index.d.ts +6 -4
- package/dist/components/button/index.js +1 -1
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button/styles.d.ts +25 -24
- package/dist/components/button/styles.js +1 -1
- package/dist/components/button/styles.js.map +1 -1
- package/dist/components/button/types.d.ts +3 -5
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox/styles.d.ts +19 -18
- package/dist/components/checkbox/styles.js +1 -1
- package/dist/components/checkbox/styles.js.map +1 -1
- package/dist/components/chip/index.d.ts +4 -2
- package/dist/components/chip/index.js +1 -1
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip/styles.d.ts +70 -69
- package/dist/components/chip/styles.js +1 -1
- package/dist/components/chip/styles.js.map +1 -1
- package/dist/components/chip/types.d.ts +5 -5
- package/dist/components/classification-badge/index.d.ts +3 -2
- package/dist/components/classification-badge/index.js +1 -1
- package/dist/components/classification-badge/index.js.map +1 -1
- package/dist/components/classification-badge/styles.js +1 -1
- package/dist/components/classification-badge/styles.js.map +1 -1
- package/dist/components/classification-badge/types.d.ts +3 -4
- package/dist/components/classification-banner/index.d.ts +3 -2
- package/dist/components/classification-banner/index.js +1 -1
- package/dist/components/classification-banner/index.js.map +1 -1
- package/dist/components/classification-banner/styles.js +1 -1
- package/dist/components/classification-banner/styles.js.map +1 -1
- package/dist/components/classification-banner/types.d.ts +3 -4
- package/dist/components/color-picker/index.d.ts +45 -15
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/color-picker/styles.d.ts +42 -0
- package/dist/components/color-picker/styles.js +2 -0
- package/dist/components/color-picker/styles.js.map +1 -0
- package/dist/components/color-picker/types.d.ts +13 -0
- package/dist/components/color-picker/types.js +2 -0
- package/dist/components/color-picker/types.js.map +1 -0
- package/dist/components/combobox-field/index.d.ts +18 -0
- package/dist/components/combobox-field/index.js +2 -0
- package/dist/components/combobox-field/index.js.map +1 -0
- package/dist/components/combobox-field/styles.d.ts +72 -0
- package/dist/components/combobox-field/styles.js +2 -0
- package/dist/components/combobox-field/styles.js.map +1 -0
- package/dist/components/combobox-field/types.d.ts +28 -0
- package/dist/components/combobox-field/types.js +2 -0
- package/dist/components/combobox-field/types.js.map +1 -0
- package/dist/components/date-field/index.d.ts +8 -24
- package/dist/components/date-field/index.js +1 -1
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-field/styles.d.ts +69 -0
- package/dist/components/date-field/styles.js +2 -0
- package/dist/components/date-field/styles.js.map +1 -0
- package/dist/components/date-field/types.d.ts +29 -0
- package/dist/components/date-field/types.js +2 -0
- package/dist/components/date-field/types.js.map +1 -0
- package/dist/components/details-list/index.d.ts +59 -0
- package/dist/components/details-list/index.js +2 -0
- package/dist/components/details-list/index.js.map +1 -0
- package/dist/components/details-list/styles.d.ts +65 -0
- package/dist/components/details-list/styles.js +2 -0
- package/dist/components/details-list/styles.js.map +1 -0
- package/dist/components/details-list/types.d.ts +16 -0
- package/dist/components/details-list/types.js +2 -0
- package/dist/components/details-list/types.js.map +1 -0
- package/dist/components/dialog/index.d.ts +1 -0
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/drawer/context.d.ts +13 -0
- package/dist/components/drawer/context.js +2 -0
- package/dist/components/drawer/context.js.map +1 -0
- package/dist/components/drawer/index.d.ts +48 -0
- package/dist/components/drawer/index.js +2 -0
- package/dist/components/drawer/index.js.map +1 -0
- package/dist/components/drawer/state.d.ts +26 -0
- package/dist/components/drawer/state.js +2 -0
- package/dist/components/drawer/state.js.map +1 -0
- package/dist/components/drawer/styles.d.ts +118 -0
- package/dist/components/drawer/styles.js +2 -0
- package/dist/components/drawer/styles.js.map +1 -0
- package/dist/components/drawer/types.d.ts +279 -0
- package/dist/components/drawer/types.js +2 -0
- package/dist/components/drawer/types.js.map +1 -0
- package/dist/components/hero/index.d.ts +45 -0
- package/dist/components/hero/index.js +2 -0
- package/dist/components/hero/index.js.map +1 -0
- package/dist/components/hero/styles.d.ts +48 -0
- package/dist/components/hero/styles.js +2 -0
- package/dist/components/hero/styles.js.map +1 -0
- package/dist/components/hero/types.d.ts +13 -0
- package/dist/components/hero/types.js +2 -0
- package/dist/components/hero/types.js.map +1 -0
- package/dist/components/hotkey/index.d.ts +25 -0
- package/dist/components/hotkey/index.js +2 -0
- package/dist/components/hotkey/index.js.map +1 -0
- package/dist/components/hotkey/styles.d.ts +53 -0
- package/dist/components/hotkey/styles.js +2 -0
- package/dist/components/hotkey/styles.js.map +1 -0
- package/dist/components/hotkey/types.d.ts +8 -0
- package/dist/components/hotkey/types.js +2 -0
- package/dist/components/hotkey/types.js.map +1 -0
- package/dist/components/icon/index.d.ts +3 -2
- package/dist/components/icon/index.js +1 -1
- package/dist/components/icon/index.js.map +1 -1
- package/dist/components/icon/styles.js +1 -1
- package/dist/components/icon/styles.js.map +1 -1
- package/dist/components/icon/types.d.ts +4 -5
- package/dist/components/input/index.d.ts +1 -0
- package/dist/components/input/index.js +1 -1
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/input/styles.d.ts +2 -24
- package/dist/components/input/styles.js +1 -1
- package/dist/components/input/styles.js.map +1 -1
- package/dist/components/input/types.d.ts +1 -0
- package/dist/components/label/index.d.ts +3 -2
- package/dist/components/label/index.js +1 -1
- package/dist/components/label/index.js.map +1 -1
- package/dist/components/label/styles.js +1 -1
- package/dist/components/label/styles.js.map +1 -1
- package/dist/components/label/types.d.ts +2 -3
- package/dist/components/menu/index.d.ts +16 -21
- package/dist/components/menu/index.js +1 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/menu/styles.d.ts +9 -6
- package/dist/components/menu/styles.js +1 -1
- package/dist/components/menu/styles.js.map +1 -1
- package/dist/components/menu/types.d.ts +9 -2
- package/dist/components/options/index.d.ts +28 -22
- package/dist/components/options/index.js +1 -1
- package/dist/components/options/index.js.map +1 -1
- package/dist/components/options/styles.d.ts +72 -0
- package/dist/components/options/styles.js +2 -0
- package/dist/components/options/styles.js.map +1 -0
- package/dist/components/options/types.d.ts +29 -0
- package/dist/components/options/types.js +2 -0
- package/dist/components/options/types.js.map +1 -0
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/popover/styles.d.ts +16 -15
- package/dist/components/popover/styles.js +1 -1
- package/dist/components/popover/styles.js.map +1 -1
- package/dist/components/query-builder/action-element.js +1 -1
- package/dist/components/query-builder/action-element.js.map +1 -1
- package/dist/components/query-builder/constants.js +1 -1
- package/dist/components/query-builder/constants.js.map +1 -1
- package/dist/components/query-builder/group.js +1 -1
- package/dist/components/query-builder/group.js.map +1 -1
- package/dist/components/query-builder/index.d.ts +5 -20
- package/dist/components/query-builder/index.js +1 -1
- package/dist/components/query-builder/index.js.map +1 -1
- package/dist/components/query-builder/rule.js +1 -1
- package/dist/components/query-builder/rule.js.map +1 -1
- package/dist/components/query-builder/types.d.ts +22 -0
- package/dist/components/query-builder/types.js +2 -0
- package/dist/components/query-builder/types.js.map +1 -0
- package/dist/components/query-builder/utils.js +1 -1
- package/dist/components/query-builder/utils.js.map +1 -1
- package/dist/components/query-builder/value-editor.js +1 -1
- package/dist/components/query-builder/value-editor.js.map +1 -1
- package/dist/components/query-builder/value-selector.js +1 -1
- package/dist/components/query-builder/value-selector.js.map +1 -1
- package/dist/components/radio/index.js +1 -1
- package/dist/components/radio/index.js.map +1 -1
- package/dist/components/radio/styles.d.ts +19 -18
- package/dist/components/radio/styles.js +1 -1
- package/dist/components/radio/styles.js.map +1 -1
- package/dist/components/radio/types.d.ts +2 -3
- package/dist/components/search-field/index.d.ts +56 -15
- package/dist/components/search-field/index.js +1 -1
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/search-field/styles.d.ts +53 -0
- package/dist/components/search-field/styles.js +2 -0
- package/dist/components/search-field/styles.js.map +1 -0
- package/dist/components/search-field/types.d.ts +25 -0
- package/dist/components/search-field/types.js +2 -0
- package/dist/components/search-field/types.js.map +1 -0
- package/dist/components/select-field/index.d.ts +23 -0
- package/dist/components/select-field/index.js +2 -0
- package/dist/components/select-field/index.js.map +1 -0
- package/dist/components/select-field/styles.d.ts +60 -0
- package/dist/components/select-field/styles.js +2 -0
- package/dist/components/select-field/styles.js.map +1 -0
- package/dist/components/select-field/types.d.ts +26 -0
- package/dist/components/select-field/types.js +2 -0
- package/dist/components/select-field/types.js.map +1 -0
- package/dist/components/skeleton/index.d.ts +42 -0
- package/dist/components/skeleton/index.js +2 -0
- package/dist/components/skeleton/index.js.map +1 -0
- package/dist/components/skeleton/styles.d.ts +23 -0
- package/dist/components/skeleton/styles.js +2 -0
- package/dist/components/skeleton/styles.js.map +1 -0
- package/dist/components/skeleton/types.d.ts +8 -0
- package/dist/components/skeleton/types.js +2 -0
- package/dist/components/skeleton/types.js.map +1 -0
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/switch/index.d.ts +3 -2
- package/dist/components/switch/index.js +1 -1
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/styles.d.ts +13 -12
- package/dist/components/switch/styles.js +1 -1
- package/dist/components/switch/styles.js.map +1 -1
- package/dist/components/switch/types.d.ts +2 -3
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/text-area-field/index.d.ts +4 -3
- package/dist/components/text-area-field/index.js +1 -1
- package/dist/components/text-area-field/index.js.map +1 -1
- package/dist/components/text-area-field/styles.d.ts +19 -18
- package/dist/components/text-area-field/styles.js +1 -1
- package/dist/components/text-area-field/styles.js.map +1 -1
- package/dist/components/text-area-field/types.d.ts +2 -3
- package/dist/components/text-field/index.d.ts +4 -2
- package/dist/components/text-field/index.js +1 -1
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/text-field/styles.d.ts +19 -18
- package/dist/components/text-field/styles.js +1 -1
- package/dist/components/text-field/styles.js.map +1 -1
- package/dist/components/text-field/types.d.ts +4 -4
- package/dist/components/tooltip/index.d.ts +14 -28
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/tooltip/styles.d.ts +5 -0
- package/dist/components/tooltip/styles.js +2 -0
- package/dist/components/tooltip/styles.js.map +1 -0
- package/dist/components/tooltip/types.d.ts +8 -0
- package/dist/components/tooltip/types.js +2 -0
- package/dist/components/tooltip/types.js.map +1 -0
- package/dist/components/view-stack/index.d.ts +28 -0
- package/dist/components/view-stack/index.js +2 -0
- package/dist/components/view-stack/index.js.map +1 -0
- package/dist/components/view-stack/types.d.ts +58 -0
- package/dist/components/view-stack/types.js +2 -0
- package/dist/components/view-stack/types.js.map +1 -0
- package/dist/icons/catalog.js +1 -1
- package/dist/index.css +20 -0
- package/dist/index.d.ts +60 -27
- package/dist/index.js +1 -1
- package/dist/lib/react.d.ts +13 -12
- package/dist/lib/react.js +4 -4
- package/dist/lib/react.js.map +1 -1
- package/dist/lib/types.d.ts +6 -2
- package/dist/lib/utils.js +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/styles.css +1476 -321
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/index.js.map +1 -1
- package/dist/variants/variants.css +6 -0
- package/package.json +84 -56
- package/dist/components/combobox/index.d.ts +0 -32
- package/dist/components/combobox/index.js +0 -2
- package/dist/components/combobox/index.js.map +0 -1
- package/dist/components/options-item/index.d.ts +0 -30
- package/dist/components/options-item/index.js +0 -2
- package/dist/components/options-item/index.js.map +0 -1
- package/dist/components/query-builder/example-configuration.d.ts +0 -30
- package/dist/components/query-builder/example-configuration.js +0 -2
- package/dist/components/query-builder/example-configuration.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/query-builder/rule.tsx"],"names":["Rule","props","rule","useRule","context","useContext","classNames","disabled","operators","outerClassName","field","operator","value","valueSource","FieldSelectorControlElement","OperatorSelectorControlElement","ValueSourceSelectorControlElement","ValueEditorControlElement","CloneRuleActionControlElement","LockRuleActionControlElement","RemoveRuleActionControlElement","fields","listsAsArrays","parseNumbers","showCloneButtons","showLockButtons","fieldData","generateOnChangeHandler","inputType","parentDisabled","path","translations","valueEditorType","valueEditorSeparator","values","valueSources","valueSourceOptions","validationResult","cloneRule","useStopEventPropagation","toggleLockRule","removeRule","coreRuleProps","renderValueSources","jsxs","Fragment","jsx","TestID"],"mappings":"yJAsBO,SAASA,CAAAA,CAAKC,CAAAA,CAAkB,CACrC,IAAMC,EAAOC,OAAAA,CAAQF,CAAK,EACpBG,CAAAA,CAAmCC,UAAAA,CAAWJ,EAAM,OAAO,CAAA,CAE3D,CACJ,UAAA,CAAAK,CAAAA,CACA,QAAA,CAAAC,EACA,SAAA,CAAAC,CAAAA,CACA,eAAAC,CAAAA,CACA,IAAA,CAAM,CAAE,KAAA,CAAAC,CAAAA,CAAO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AAA,CACC,MAAA,CAAQ4B,MAAAA,CAAO,QAAA,CACf,KAAA,CAAOhB,CAAAA,CAAa,QAAA,CAAS,OAAS,MAAA,CACtC,KAAA,CAAOA,EAAa,QAAA,CAAS,KAAA,EAAS,OACtC,SAAA,CAAWzB,CAAAA,CAAW,QAAA,CACtB,aAAA,CAAekC,CAAAA,CACf,mBAAA,CACEX,EAAiB,MAAA,CAAYE,CAAAA,CAAa,iBAE5C,WAAA,CAAa7B,CAAAA,CAAK,KACjB,GAAGwC,CAAAA,CACN,CAAA,CAAA,CAEJ,CAAA,CAAA,CACF,CAEJ","file":"rule.js","sourcesContent":["// __private-exports\n/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useContext } from 'react';\nimport {\n type RuleProps,\n TestID,\n useRule,\n useStopEventPropagation,\n} from 'react-querybuilder';\nimport type { QueryBuilderContextType } from './';\n\nexport function Rule(props: RuleProps) {\n const rule = useRule(props);\n const context: QueryBuilderContextType = useContext(props.context);\n\n const {\n classNames,\n disabled,\n operators,\n outerClassName,\n rule: { field, operator, value, valueSource },\n schema: {\n controls: {\n fieldSelector: FieldSelectorControlElement,\n operatorSelector: OperatorSelectorControlElement,\n valueSourceSelector: ValueSourceSelectorControlElement,\n valueEditor: ValueEditorControlElement,\n cloneRuleAction: CloneRuleActionControlElement,\n lockRuleAction: LockRuleActionControlElement,\n removeRuleAction: RemoveRuleActionControlElement,\n },\n fields,\n listsAsArrays,\n parseNumbers,\n showCloneButtons,\n showLockButtons,\n },\n fieldData,\n generateOnChangeHandler,\n inputType,\n parentDisabled,\n path,\n translations,\n valueEditorType,\n valueEditorSeparator,\n values,\n valueSources,\n valueSourceOptions,\n validationResult,\n } = rule;\n\n const cloneRule = useStopEventPropagation(rule.cloneRule);\n const toggleLockRule = useStopEventPropagation(rule.toggleLockRule);\n const removeRule = useStopEventPropagation(rule.removeRule);\n\n const coreRuleProps = {\n context,\n disabled,\n level: path.length,\n path,\n schema: rule.schema,\n validation: validationResult,\n };\n\n const renderValueSources =\n !['null', 'notNull'].includes(operator) && valueSources.length > 1;\n\n return (\n <>\n {context.showRuleLines && <span className='rule-lines relative' />}\n <div className={outerClassName}>\n <FieldSelectorControlElement\n testID={TestID.fields}\n options={fields}\n title={translations.fields.title}\n value={field}\n operator={operator}\n className={classNames.fields}\n handleOnChange={generateOnChangeHandler('field')}\n rule={rule.rule}\n {...coreRuleProps}\n />\n <OperatorSelectorControlElement\n testID={TestID.operators}\n field={field}\n fieldData={rule.fieldData}\n title={rule.translations.operators.title}\n options={operators}\n value={operator}\n className={rule.classNames.operators}\n handleOnChange={rule.generateOnChangeHandler('operator')}\n rule={rule.rule}\n {...coreRuleProps}\n />\n <ValueEditorControlElement\n testID={TestID.valueEditor}\n field={field}\n fieldData={fieldData}\n title={translations.value.title}\n operator={operator}\n value={value}\n valueSource={valueSource ?? 'value'}\n type={valueEditorType}\n inputType={inputType}\n values={values}\n listsAsArrays={listsAsArrays}\n parseNumbers={parseNumbers}\n separator={valueEditorSeparator}\n className={classNames.value}\n handleOnChange={generateOnChangeHandler('value')}\n rule={rule.rule}\n {...coreRuleProps}\n />\n {renderValueSources && (\n <ValueSourceSelectorControlElement\n testID={TestID.valueSourceSelector}\n field={field}\n fieldData={fieldData}\n title={translations.valueSourceSelector.title}\n options={valueSourceOptions}\n value={valueSource ?? 'value'}\n className={classNames.valueSource}\n handleOnChange={generateOnChangeHandler('valueSource')}\n rule={rule.rule}\n {...coreRuleProps}\n />\n )}\n </div>\n <div className={outerClassName}>\n <RemoveRuleActionControlElement\n testID={TestID.removeRule}\n label={translations.removeRule.label ?? 'remove'}\n title={translations.removeRule.title ?? 'remove'}\n className={classNames.removeRule}\n handleOnClick={removeRule}\n ruleOrGroup={rule.rule}\n {...coreRuleProps}\n />\n {showCloneButtons && (\n <CloneRuleActionControlElement\n testID={TestID.cloneRule}\n label={translations.cloneRule.label ?? 'clone'}\n title={translations.cloneRule.title ?? 'clone'}\n className={classNames.cloneRule}\n handleOnClick={cloneRule}\n ruleOrGroup={rule.rule}\n {...coreRuleProps}\n />\n )}\n {showLockButtons && (\n <LockRuleActionControlElement\n testID={TestID.lockRule}\n label={translations.lockRule.label ?? 'lock'}\n title={translations.lockRule.title ?? 'lock'}\n className={classNames.lockRule}\n handleOnClick={toggleLockRule}\n disabledTranslation={\n parentDisabled ? undefined : translations.lockRuleDisabled\n }\n ruleOrGroup={rule.rule}\n {...coreRuleProps}\n />\n )}\n </div>\n </>\n );\n}\n"]}
|
1
|
+
{"version":3,"sources":["../../../src/components/query-builder/rule.tsx"],"names":["Rule","props","rule","useRule","context","useContext","classNames","disabled","operators","outerClassName","field","operator","value","valueSource","FieldSelectorControlElement","OperatorSelectorControlElement","ValueSourceSelectorControlElement","ValueEditorControlElement","CloneRuleActionControlElement","LockRuleActionControlElement","RemoveRuleActionControlElement","fields","listsAsArrays","parseNumbers","showCloneButtons","showLockButtons","fieldData","generateOnChangeHandler","inputType","parentDisabled","path","translations","valueEditorType","valueEditorSeparator","values","valueSources","valueSourceOptions","validationResult","cloneRule","useStopEventPropagation","toggleLockRule","removeRule","coreRuleProps","renderValueSources","jsxs","Fragment","jsx","TestID"],"mappings":"6KAwBO,SAASA,CAAAA,CAAKC,CAAAA,CAAkB,CACrC,MAAMC,CAAAA,CAAOC,QAAQF,CAAK,CAAA,CACpBG,EAAmCC,UAAAA,CAAWJ,CAAAA,CAAM,OAAO,CAAA,CAE3D,CACJ,UAAA,CAAAK,EACA,QAAA,CAAAC,CAAAA,CACA,UAAAC,CAAAA,CACA,cAAA,CAAAC,EACA,IAAA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CACN,CAAA,CAEDjB,GACCqB,GAAAA,CAAC3B,CAAAA,CAAA,CACC,MAAA,CAAQ4B,MAAAA,CAAO,QAAA,CACf,KAAA,CAAOhB,CAAAA,CAAa,QAAA,CAAS,OAAS,MAAA,CACtC,KAAA,CAAOA,EAAa,QAAA,CAAS,KAAA,EAAS,OACtC,SAAA,CAAWzB,CAAAA,CAAW,QAAA,CACtB,aAAA,CAAekC,CAAAA,CACf,mBAAA,CACEX,EAAiB,MAAA,CAAYE,CAAAA,CAAa,iBAE5C,WAAA,CAAa7B,CAAAA,CAAK,KACjB,GAAGwC,CAAAA,CACN,CAAA,CAAA,CAEJ,CAAA,CAAA,CACF,CAEJ","file":"rule.js","sourcesContent":["// __private-exports\n/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { useContext } from 'react';\nimport {\n type RuleProps,\n TestID,\n useRule,\n useStopEventPropagation,\n} from 'react-querybuilder';\nimport type { QueryBuilderContextType } from './types';\n\nexport function Rule(props: RuleProps) {\n const rule = useRule(props);\n const context: QueryBuilderContextType = useContext(props.context);\n\n const {\n classNames,\n disabled,\n operators,\n outerClassName,\n rule: { field, operator, value, valueSource },\n schema: {\n controls: {\n fieldSelector: FieldSelectorControlElement,\n operatorSelector: OperatorSelectorControlElement,\n valueSourceSelector: ValueSourceSelectorControlElement,\n valueEditor: ValueEditorControlElement,\n cloneRuleAction: CloneRuleActionControlElement,\n lockRuleAction: LockRuleActionControlElement,\n removeRuleAction: RemoveRuleActionControlElement,\n },\n fields,\n listsAsArrays,\n parseNumbers,\n showCloneButtons,\n showLockButtons,\n },\n fieldData,\n generateOnChangeHandler,\n inputType,\n parentDisabled,\n path,\n translations,\n valueEditorType,\n valueEditorSeparator,\n values,\n valueSources,\n valueSourceOptions,\n validationResult,\n } = rule;\n\n const cloneRule = useStopEventPropagation(rule.cloneRule);\n const toggleLockRule = useStopEventPropagation(rule.toggleLockRule);\n const removeRule = useStopEventPropagation(rule.removeRule);\n\n const coreRuleProps = {\n context,\n disabled,\n level: path.length,\n path,\n schema: rule.schema,\n validation: validationResult,\n };\n\n const renderValueSources =\n !['null', 'notNull'].includes(operator) && valueSources.length > 1;\n\n return (\n <>\n {context.showRuleLines && <span className='rule-lines relative' />}\n <div className={outerClassName}>\n <FieldSelectorControlElement\n testID={TestID.fields}\n options={fields}\n title={translations.fields.title}\n value={field}\n operator={operator}\n className={classNames.fields}\n handleOnChange={generateOnChangeHandler('field')}\n rule={rule.rule}\n {...coreRuleProps}\n />\n <OperatorSelectorControlElement\n testID={TestID.operators}\n field={field}\n fieldData={rule.fieldData}\n title={rule.translations.operators.title}\n options={operators}\n value={operator}\n className={rule.classNames.operators}\n handleOnChange={rule.generateOnChangeHandler('operator')}\n rule={rule.rule}\n {...coreRuleProps}\n />\n <ValueEditorControlElement\n testID={TestID.valueEditor}\n field={field}\n fieldData={fieldData}\n title={translations.value.title}\n operator={operator}\n value={value}\n valueSource={valueSource ?? 'value'}\n type={valueEditorType}\n inputType={inputType}\n values={values}\n listsAsArrays={listsAsArrays}\n parseNumbers={parseNumbers}\n separator={valueEditorSeparator}\n className={classNames.value}\n handleOnChange={generateOnChangeHandler('value')}\n rule={rule.rule}\n {...coreRuleProps}\n />\n {renderValueSources && (\n <ValueSourceSelectorControlElement\n testID={TestID.valueSourceSelector}\n field={field}\n fieldData={fieldData}\n title={translations.valueSourceSelector.title}\n options={valueSourceOptions}\n value={valueSource ?? 'value'}\n className={classNames.valueSource}\n handleOnChange={generateOnChangeHandler('valueSource')}\n rule={rule.rule}\n {...coreRuleProps}\n />\n )}\n </div>\n <div className={outerClassName}>\n <RemoveRuleActionControlElement\n testID={TestID.removeRule}\n label={translations.removeRule.label ?? 'remove'}\n title={translations.removeRule.title ?? 'remove'}\n className={classNames.removeRule}\n handleOnClick={removeRule}\n ruleOrGroup={rule.rule}\n {...coreRuleProps}\n />\n {showCloneButtons && (\n <CloneRuleActionControlElement\n testID={TestID.cloneRule}\n label={translations.cloneRule.label ?? 'clone'}\n title={translations.cloneRule.title ?? 'clone'}\n className={classNames.cloneRule}\n handleOnClick={cloneRule}\n ruleOrGroup={rule.rule}\n {...coreRuleProps}\n />\n )}\n {showLockButtons && (\n <LockRuleActionControlElement\n testID={TestID.lockRule}\n label={translations.lockRule.label ?? 'lock'}\n title={translations.lockRule.title ?? 'lock'}\n className={classNames.lockRule}\n handleOnClick={toggleLockRule}\n disabledTranslation={\n parentDisabled ? undefined : translations.lockRuleDisabled\n }\n ruleOrGroup={rule.rule}\n {...coreRuleProps}\n />\n )}\n </div>\n </>\n );\n}\n"]}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { ReactElement } from 'react';
|
2
|
+
import { QueryBuilderProps as QueryBuilderProps$1, RuleGroupType as RuleGroupType$1, FullField, FullOperator, FullCombinator, Classnames, Field as Field$1, ValueEditorProps } from 'react-querybuilder';
|
3
|
+
import { LiteralUnion } from 'type-fest';
|
4
|
+
|
5
|
+
type RuleGroupType = RuleGroupType$1;
|
6
|
+
type Field = Field$1;
|
7
|
+
type DefaultRQBProps = QueryBuilderProps$1<RuleGroupType, FullField, FullOperator, FullCombinator>;
|
8
|
+
type QueryBuilderValueEditors = Record<LiteralUnion<Exclude<ValueEditorProps['type'], null | undefined | 'multiselect'>, string>, (props: ValueEditorProps) => ReactElement>;
|
9
|
+
/**
|
10
|
+
* Omitted props are currently unsupported functionality
|
11
|
+
*/
|
12
|
+
type QueryBuilderProps = Partial<Omit<DefaultRQBProps, 'showCombinatorsBetweenRules' | 'independentCombinators' | 'listsAsArrays' | 'enableDragAndDrop' | 'showNotToggle' | 'showShiftActions'> & {
|
13
|
+
orientation?: 'horizontal' | 'vertical';
|
14
|
+
showRuleLines?: boolean;
|
15
|
+
}>;
|
16
|
+
/**
|
17
|
+
* Omitted classnames are for unsupported features
|
18
|
+
*/
|
19
|
+
type ClassNames = Omit<Classnames, 'betweenRules' | 'branches' | 'dndDragging' | 'dndOver' | 'dndCopy' | 'dndGroup' | 'dragHandle' | 'shiftActions' | 'notToggle'>;
|
20
|
+
type QueryBuilderContextType = Pick<QueryBuilderProps, 'showRuleLines' | 'orientation'>;
|
21
|
+
|
22
|
+
export type { ClassNames, DefaultRQBProps, Field, QueryBuilderContextType, QueryBuilderProps, QueryBuilderValueEditors, RuleGroupType };
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {noop}from'@accelint/core';
|
1
|
+
import {noop}from'@accelint/core';const s=(t,o)=>{if(!o)return {valid:true};const e=o(t);return typeof e=="boolean"?{valid:e}:{valid:e.valid,reasons:e.valid?[]:e.reasons}},n=t=>({...t,preventDefault:noop,stopPropagation:noop});export{s as getValidationResult,n as pressToMouseEvent};//# sourceMappingURL=utils.js.map
|
2
2
|
//# sourceMappingURL=utils.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/query-builder/utils.ts"],"names":["getValidationResult","rule","validator","result","pressToMouseEvent","event","noop"],"mappings":"kCAsBO,
|
1
|
+
{"version":3,"sources":["../../../src/components/query-builder/utils.ts"],"names":["getValidationResult","rule","validator","result","pressToMouseEvent","event","noop"],"mappings":"kCAsBO,MAAMA,EAAsB,CACjCC,CAAAA,CACAC,CAAAA,GACqB,CACrB,GAAI,CAACA,EACH,OAAO,CAAE,KAAA,CAAO,IAAK,CAAA,CAGvB,MAAMC,EAASD,CAAAA,CAAUD,CAAI,CAAA,CAE7B,OAAI,OAAOE,CAAAA,EAAW,UACb,CAAE,KAAA,CAAOA,CAAO,CAAA,CAGlB,CACL,KAAA,CAAOA,EAAO,KAAA,CACd,OAAA,CAASA,CAAAA,CAAO,KAAA,CAAQ,EAAC,CAAIA,EAAO,OACtC,CACF,CAAA,CAQaC,CAAAA,CAAqBC,CAAAA,GAC/B,CACC,GAAGA,CAAAA,CACH,cAAA,CAAgBC,IAAAA,CAChB,eAAA,CAAiBA,IACnB,CAAA","file":"utils.js","sourcesContent":["// __private-exports\n/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { noop } from '@accelint/core';\nimport type { PressEvent } from '@react-types/shared';\nimport type { MouseEvent } from 'react';\nimport type {\n RuleType,\n RuleValidator,\n ValidationResult,\n} from 'react-querybuilder';\n\nexport const getValidationResult = (\n rule: RuleType,\n validator?: RuleValidator,\n): ValidationResult => {\n if (!validator) {\n return { valid: true };\n }\n\n const result = validator(rule);\n\n if (typeof result === 'boolean') {\n return { valid: result };\n }\n\n return {\n valid: result.valid,\n reasons: result.valid ? [] : result.reasons,\n };\n};\n\n/**\n * This is required because the design system Button supports an onPress event but\n * QueryBuilder provides a callback that expects a MouseEvent and will error\n * out if preventDefault is not available as a method.\n * @param event\n */\nexport const pressToMouseEvent = (event: PressEvent) =>\n ({\n ...event,\n preventDefault: noop,\n stopPropagation: noop,\n }) as unknown as MouseEvent;\n"]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {useCallback}from'react';import {useValueEditor}from'react-querybuilder';import {Checkbox}from'../checkbox/index.js';import {Radio}from'../radio/index.js';import {Switch}from'../switch/index.js';import {TextAreaField}from'../text-area-field/index.js';import {TextField}from'../text-field/index.js';import {multiValueOperators}from'./constants.js';import {getValidationResult}from'./utils.js';import {ValueSelector}from'./value-selector.js';
|
1
|
+
import {jsx,Fragment}from'react/jsx-runtime';import'client-only';import {useCallback}from'react';import {useValueEditor}from'react-querybuilder';import {Checkbox}from'../checkbox/index.js';import {Radio}from'../radio/index.js';import {Switch}from'../switch/index.js';import {TextAreaField}from'../text-area-field/index.js';import {TextField}from'../text-field/index.js';import {multiValueOperators}from'./constants.js';import {getValidationResult}from'./utils.js';import {ValueSelector}from'./value-selector.js';function k({disabled:a,fieldData:{name:e,validator:t},handleOnChange:i,rule:o,value:r}){const{valid:l}=getValidationResult(o,t);return jsx(Checkbox,{isDisabled:a,isSelected:r,onChange:i,"aria-invalid":!l,"aria-label":e})}function x({disabled:a,fieldData:{name:e,validator:t},handleOnChange:i,rule:o,value:r,values:l}){const{valid:d}=getValidationResult(o,t);return jsx(Radio.Group,{value:r,isDisabled:a,onChange:i,"aria-invalid":!d,"aria-label":e,"aria-labelledby":e,children:l?.map(n=>jsx(Radio,{value:n.value,children:n.label},n.name))})}const R=[];function S({disabled:a,fieldData:{name:e,validator:t},handleOnChange:i,rule:o,type:r,value:l,values:d=R,...n}){const{valid:c}=getValidationResult(o,t);return jsx(ValueSelector,{...n,disabled:a,multiple:r==="multiselect",options:d,title:e,validation:!c,value:l,handleOnChange:i,"aria-labelledby":e})}function T({disabled:a,fieldData:{name:e,validator:t},handleOnChange:i,rule:o,value:r}){const{valid:l}=getValidationResult(o,t);return jsx(Switch,{isDisabled:a,isSelected:!!r,onChange:i,"aria-invalid":!l,"aria-label":e,"aria-labelledby":e})}function w({disabled:a,fieldData:{name:e,placeholder:t,validator:i},handleOnChange:o,inputType:r,rule:l,value:d}){const{valid:n,reasons:c}=getValidationResult(l,i);return jsx(TextField,{inputProps:{placeholder:t,type:r??"text"},size:"small",value:d,isDisabled:a,isInvalid:!n,onChange:o,"aria-invalid":!n,"aria-label":e,"aria-labelledby":e,errorMessage:c?.join("/n")})}function I({disabled:a,fieldData:{name:e,placeholder:t,validator:i},handleOnChange:o,rule:r,value:l}){const{valid:d,reasons:n}=getValidationResult(r,i);return jsx(TextAreaField,{size:"small",errorMessage:n?.join("/n"),inputProps:{placeholder:t},value:l,isDisabled:a,isInvalid:!d,onChange:o,"aria-label":e,"aria-invalid":!d,"aria-labelledby":e})}const O={checkbox:k,radio:x,select:S,switch:T,text:w,textarea:I};function J(a){const{fieldData:{name:e,valueEditorType:t},operator:i,rule:o}=a,{valueAsArray:r,multiValueHandler:l}=useValueEditor({...a,skipHook:true}),d=useCallback(s=>({...o,value:r[s]}),[o,r]),n=useCallback(s=>l(s,0),[l]),c=useCallback(s=>l(s,1),[l]),E=(typeof t=="function"?t(i):t)??"text",f=O?.[E];return i==="null"||i==="notNull"||!f?null:multiValueOperators.includes(i)?jsx(Fragment,{children:["start","end"].map((s,m)=>jsx("div",{children:jsx(f,{...a,rule:d(m),value:r[m],handleOnChange:m?c:n})},`${e}-${s}`))}):jsx("div",{children:jsx(f,{...a})})}export{J as ValueEditor};//# sourceMappingURL=value-editor.js.map
|
2
2
|
//# sourceMappingURL=value-editor.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/query-builder/value-editor.tsx"],"names":["name","rule","value","validator","p","jsx","u","h","values","m","option","defaultOptions","type","rest","P","y","valid","reasons","C","inputType","g","valueEditors","RadioGroupValueEditor","SelectValueEditor","SwitchValueEditor","TextValueEditor","ruleProp","props","V","useCallback","b","valueAsArray","index","handleRangeStartChange","multiValueHandler","handleRangeEndChange","valueEditorType","operator","multiValueOperators","D","A","term"],"mappings":"4eA6BA,SACE,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,SAAaA,CAAM,CAAA,IAAA,CAAA,CAAA,CAAA,SACnB,CAAA,CAAA,CAAA,CAAA,cACAC,CAAAA,CACA,CAAA,IAAA,CAAAC,CACF,CAAA,KACQ,CAAE,OAAM,CAAA,K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AA,CAAA,CAAA,CAAA,CAAA,CAAAC,GACC,CAAA,KAAA,CAAA,CAAA,QAAS,CAAGqB,GAAAA,CAAO,EACrB,CAEJ,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA","file":"value-editor.js","sourcesContent":["// __private-exports\n/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useCallback } from 'react';\nimport {\n type InputType,\n type ValueEditorProps,\n useValueEditor,\n} from 'react-querybuilder';\nimport { Checkbox } from '../checkbox';\nimport { Radio } from '../radio';\nimport { Switch } from '../switch';\nimport { TextAreaField } from '../text-area-field';\nimport { TextField } from '../text-field';\nimport type { QueryBuilderValueEditors } from './';\nimport { multiValueOperators } from './constants';\nimport { getValidationResult } from './utils';\nimport { ValueSelector } from './value-selector';\n\nfunction CheckboxValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Checkbox\n isDisabled={disabled}\n isSelected={value}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n />\n );\n}\n\nfunction RadioGroupValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n values,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Radio.Group\n value={value}\n isDisabled={disabled}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n >\n {values?.map((option) => (\n <Radio key={option.name} value={option.value}>\n {option.label}\n </Radio>\n ))}\n </Radio.Group>\n );\n}\n\nconst defaultOptions: unknown[] = [];\n\nfunction SelectValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n type,\n value,\n values = defaultOptions,\n ...rest\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <ValueSelector\n {...rest}\n disabled={disabled}\n multiple={type === 'multiselect'}\n options={values}\n title={name}\n validation={!valid}\n value={value}\n handleOnChange={handleOnChange}\n aria-labelledby={name}\n />\n );\n}\n\nfunction SwitchValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Switch\n isDisabled={disabled}\n isSelected={Boolean(value)}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n />\n );\n}\n\nfunction TextValueEditor({\n disabled,\n fieldData: { name, placeholder, validator },\n handleOnChange,\n inputType,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid, reasons } = getValidationResult(rule, validator);\n\n return (\n <TextField\n inputProps={{ placeholder }}\n type={(inputType as InputType) ?? 'text'}\n size='small'\n value={value}\n isDisabled={disabled}\n isInvalid={!valid}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n errorMessage={reasons?.join('/n')}\n />\n );\n}\n\nfunction TextareaValueEditor({\n disabled,\n fieldData: { name, placeholder, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid, reasons } = getValidationResult(rule, validator);\n\n return (\n <TextAreaField\n size='small'\n errorMessage={reasons?.join('/n')}\n inputProps={{ placeholder }}\n value={value}\n isDisabled={disabled}\n isInvalid={!valid}\n onChange={handleOnChange}\n aria-label={name}\n aria-invalid={!valid}\n aria-labelledby={name}\n />\n );\n}\n\nconst valueEditors: QueryBuilderValueEditors = {\n checkbox: CheckboxValueEditor,\n radio: RadioGroupValueEditor,\n select: SelectValueEditor,\n switch: SwitchValueEditor,\n text: TextValueEditor,\n textarea: TextareaValueEditor,\n};\n\nexport function ValueEditor(props: ValueEditorProps) {\n const {\n fieldData: { name, valueEditorType },\n operator,\n rule: ruleProp,\n } = props;\n\n const { valueAsArray, multiValueHandler } = useValueEditor({\n ...props,\n skipHook: true,\n });\n\n const rule = useCallback(\n (index: number) => ({\n ...ruleProp,\n value: valueAsArray[index],\n }),\n [ruleProp, valueAsArray],\n );\n\n const handleRangeStartChange = useCallback(\n (value: string) => multiValueHandler(value, 0),\n [multiValueHandler],\n );\n\n const handleRangeEndChange = useCallback(\n (value: string) => multiValueHandler(value, 1),\n [multiValueHandler],\n );\n\n const type =\n (typeof valueEditorType === 'function'\n ? valueEditorType(operator)\n : valueEditorType) ?? 'text';\n\n const Editor = valueEditors?.[type];\n\n if (operator === 'null' || operator === 'notNull' || !Editor) {\n return null;\n }\n\n if (multiValueOperators.includes(operator)) {\n return (\n <>\n {['start', 'end'].map((term, index) => (\n <div key={`${name}-${term}`}>\n <Editor\n {...props}\n rule={rule(index)}\n value={valueAsArray[index]}\n handleOnChange={\n index ? handleRangeEndChange : handleRangeStartChange\n }\n />\n </div>\n ))}\n </>\n );\n }\n\n return (\n <div>\n <Editor {...props} />\n </div>\n );\n}\n"]}
|
1
|
+
{"version":3,"sources":["../../../src/components/query-builder/value-editor.tsx"],"names":["value","valid","getValidationResult","disabled","p","u","y","rule","validator","b","name","values","defaultOptions","type","jsx","h","handleOnChange","inputType","TextField","placeholder","P","TextareaValueEditor","TextAreaField","g","valueEditors","CheckboxValueEditor","SelectValueEditor","ruleProp","props","valueAsArray","useValueEditor","useCallback","index","multiValueHandler","v","valueEditorType","operator","Editor","multiValueOperators","Fragment","C","A","handleRangeStartChange","term"],"mappings":"ggBA+BE,SACA,CAAA,CAAA,CAAA,QACA,CAAA,CAAAA,CACF,SACU,CAAA,CAAA,IAAAC,CAAM,CAAA,CAAIC,2BAId,CAAA,CAAA,CAAYC,IACZ,CAAA,CAAA,CAAA,KAAA,CAAYH,CAAAA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CAAA,CAAA,QAAA,CAAAA,GAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA","file":"value-editor.js","sourcesContent":["// __private-exports\n/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { useCallback } from 'react';\nimport { type ValueEditorProps, useValueEditor } from 'react-querybuilder';\nimport { Checkbox } from '../checkbox';\nimport type { InputProps } from '../input/types';\nimport { Radio } from '../radio';\nimport { Switch } from '../switch';\nimport { TextAreaField } from '../text-area-field';\nimport { TextField } from '../text-field';\nimport { multiValueOperators } from './constants';\nimport type { QueryBuilderValueEditors } from './types';\nimport { getValidationResult } from './utils';\nimport { ValueSelector } from './value-selector';\n\nfunction CheckboxValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Checkbox\n isDisabled={disabled}\n isSelected={value}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n />\n );\n}\n\nfunction RadioGroupValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n values,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Radio.Group\n value={value}\n isDisabled={disabled}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n >\n {values?.map((option) => (\n <Radio key={option.name} value={option.value}>\n {option.label}\n </Radio>\n ))}\n </Radio.Group>\n );\n}\n\nconst defaultOptions: unknown[] = [];\n\nfunction SelectValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n type,\n value,\n values = defaultOptions,\n ...rest\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <ValueSelector\n {...rest}\n disabled={disabled}\n multiple={type === 'multiselect'}\n options={values}\n title={name}\n validation={!valid}\n value={value}\n handleOnChange={handleOnChange}\n aria-labelledby={name}\n />\n );\n}\n\nfunction SwitchValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Switch\n isDisabled={disabled}\n isSelected={Boolean(value)}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n />\n );\n}\n\nfunction TextValueEditor({\n disabled,\n fieldData: { name, placeholder, validator },\n handleOnChange,\n inputType,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid, reasons } = getValidationResult(rule, validator);\n\n return (\n <TextField\n inputProps={{\n placeholder,\n type: (inputType as InputProps['type']) ?? 'text',\n }}\n size='small'\n value={value}\n isDisabled={disabled}\n isInvalid={!valid}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n errorMessage={reasons?.join('/n')}\n />\n );\n}\n\nfunction TextareaValueEditor({\n disabled,\n fieldData: { name, placeholder, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid, reasons } = getValidationResult(rule, validator);\n\n return (\n <TextAreaField\n size='small'\n errorMessage={reasons?.join('/n')}\n inputProps={{ placeholder }}\n value={value}\n isDisabled={disabled}\n isInvalid={!valid}\n onChange={handleOnChange}\n aria-label={name}\n aria-invalid={!valid}\n aria-labelledby={name}\n />\n );\n}\n\nconst valueEditors: QueryBuilderValueEditors = {\n checkbox: CheckboxValueEditor,\n radio: RadioGroupValueEditor,\n select: SelectValueEditor,\n switch: SwitchValueEditor,\n text: TextValueEditor,\n textarea: TextareaValueEditor,\n};\n\nexport function ValueEditor(props: ValueEditorProps) {\n const {\n fieldData: { name, valueEditorType },\n operator,\n rule: ruleProp,\n } = props;\n\n const { valueAsArray, multiValueHandler } = useValueEditor({\n ...props,\n skipHook: true,\n });\n\n const rule = useCallback(\n (index: number) => ({\n ...ruleProp,\n value: valueAsArray[index],\n }),\n [ruleProp, valueAsArray],\n );\n\n const handleRangeStartChange = useCallback(\n (value: string) => multiValueHandler(value, 0),\n [multiValueHandler],\n );\n\n const handleRangeEndChange = useCallback(\n (value: string) => multiValueHandler(value, 1),\n [multiValueHandler],\n );\n\n const type =\n (typeof valueEditorType === 'function'\n ? valueEditorType(operator)\n : valueEditorType) ?? 'text';\n\n const Editor = valueEditors?.[type];\n\n if (operator === 'null' || operator === 'notNull' || !Editor) {\n return null;\n }\n\n if (multiValueOperators.includes(operator)) {\n return (\n <>\n {['start', 'end'].map((term, index) => (\n <div key={`${name}-${term}`}>\n <Editor\n {...props}\n rule={rule(index)}\n value={valueAsArray[index]}\n handleOnChange={\n index ? handleRangeEndChange : handleRangeStartChange\n }\n />\n </div>\n ))}\n </>\n );\n }\n\n return (\n <div>\n <Editor {...props} />\n </div>\n );\n}\n"]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {
|
1
|
+
import {jsx}from'react/jsx-runtime';import'client-only';import {useCallback,useMemo}from'react';import {useValueSelector,isOptionGroupArray}from'react-querybuilder';import {ComboBoxField}from'../combobox-field/index.js';import {Options}from'../options/index.js';function K(s){const{handleOnChange:n,disabled:m,listsAsArrays:p,options:l,multiple:d,title:u,validation:V,value:y,...c}=s,{onChange:i,val:o}=useValueSelector({handleOnChange:n,listsAsArrays:p,multiple:d,value:y}),b=useCallback(e=>{e&&i(`${e}`);},[i]),h=useMemo(()=>isOptionGroupArray(l)?l.map(e=>jsx(Options.Section,{header:e.label,children:e.options.map(t=>jsx(Options.Item,{id:t.name,children:t.label},t.name))},e.label)):l.map(e=>jsx(Options.Item,{textValue:e.label,id:e.name,children:e.label},e.name)),[l]);return jsx(ComboBoxField,{size:"small",isDisabled:m,...c,selectedKey:Array.isArray(o)?o[0]:o,"aria-labelledby":u,onSelectionChange:b,children:h})}export{K as ValueSelector};//# sourceMappingURL=value-selector.js.map
|
2
2
|
//# sourceMappingURL=value-selector.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/query-builder/value-selector.tsx"],"names":["
|
1
|
+
{"version":3,"sources":["../../../src/components/query-builder/value-selector.tsx"],"names":["multiple","title","validation","value","onChange","val","useValueSelector","handleOnChange","O","selection","S","options","useMemo","isOptionGroupArray","optionsProp","section","jsx","Options","C","r","option","a","A","disabled","handleSelectionChange"],"mappings":"sQA2BI,SAAA,CAAA,CAAA,CAAA,CAAA,CAAA,oBAEA,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,eACAA,CAAAA,OACAC,CAAAA,CACA,CAAA,QAAA,CAAA,CAAAC,MACA,CAAA,CAAAC,CAAAA,UAIM,CAAA,CAAA,CAAA,KAAA,CAAAC,CAAAA,CAAU,GAAA,CAAAC,CAAI,CAAA,CAAIC,CAAAA,CAAiB,QACzC,CAAA,CAAA,CAAA,GAAA,CAAA,CAAAC,CAAAA,CACAC,gCACA,CAAA,CAAA,CAAA,aACAL,CACF,CAAC,CAAA,QAG4B,CACrBM,CAAAA,CAAAA,KACO,CAAGA,CAAS,EAAE,CAE3B,CAAA,CACAC,WAACN,CAAQ,CACX,EAEMO,CAAAA,CAAUC,EACd,CAAA,CAAA,CAAA,EACEC,CAAmBC,CAAW,CAAA,EAC1BA,CAAAA,CAAY,IAAKC,CAAAA,CAAAA,CACfC,OAAAA,CAACC,IAAQC,kBAAA,CAAA,CAAA,CAAA,CAAA,CAAR,CAAoC,GAAA,CAAA,CAAA,EAAQH,GAAAA,CAAQI,eAClD,CAAA,CAAA,MAAQ,QAAQ,CAAA,QACdF,CAAAA,CAAQ,CAAA,OAAK,CAAIG,GAAO,CAAA,CAAA,EACtBC,GAAA,CAAAF,OAAA,CAAA,IAAA,CAAAC,GAAO,CAAA,CAAA,CAAA,IAD0BA,CAAO,QAFzBL,CAAAA,CAAQ,CAAA,KAO/B,CAAA,CACDD,CAAAA,CAAY,IAAKM,CAAAA,CAAAA,CACfJ,CAAAA,CAACC,MAAQ,CAAR,CACC,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,EAAWG,GAAAA,CAAOD,YAClB,CAAA,CAAA,SAGC,CAAA,CAAA,CAAA,KAAAC,CAAAA,SAFIA,CAAO,QAKrBN,CAAW,CACd,MAEA,CAAA,CAAA,CACEE,CAAAA,IACE,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,OACLK,GAAA,CAAAC,aAAA,CAAA,CAAA,IAAYC,mBAEC,CAAA,CAAA,CAAA,GAAM,CAAA,CAAA,WAAmB,CAAC,KACvC,CAAA,OAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiBtB,CAAAA,CACjB,kBAAmBuB,CAAAA,CAElB,iBAGP,CAAA,CAAA,CAAA,QAAA,CAAA,CAAA,CAAA,CAAA","file":"value-selector.js","sourcesContent":["// __private-exports\n/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport type { Key } from '@react-types/shared';\nimport { useCallback, useMemo } from 'react';\nimport {\n type ValueSelectorProps,\n isOptionGroupArray,\n useValueSelector,\n} from 'react-querybuilder';\nimport { ComboBoxField } from '../combobox-field';\nimport { Options } from '../options';\n\nexport function ValueSelector(props: ValueSelectorProps) {\n const {\n handleOnChange,\n disabled,\n listsAsArrays,\n options: optionsProp,\n multiple,\n title,\n validation,\n value,\n ...rest\n } = props;\n\n const { onChange, val } = useValueSelector({\n handleOnChange,\n listsAsArrays,\n multiple,\n value,\n });\n\n const handleSelectionChange = useCallback(\n (selection: Key | null) => {\n if (selection) {\n onChange(`${selection}`);\n }\n },\n [onChange],\n );\n\n const options = useMemo(\n () =>\n isOptionGroupArray(optionsProp)\n ? optionsProp.map((section) => (\n <Options.Section key={section.label} header={section.label}>\n {section.options.map((option) => (\n <Options.Item id={option.name} key={option.name}>\n {option.label}\n </Options.Item>\n ))}\n </Options.Section>\n ))\n : optionsProp.map((option) => (\n <Options.Item\n textValue={option.label}\n id={option.name}\n key={option.name}\n >\n {option.label}\n </Options.Item>\n )),\n [optionsProp],\n );\n\n return (\n <ComboBoxField\n size='small'\n isDisabled={disabled}\n {...rest}\n selectedKey={Array.isArray(val) ? val[0] : val}\n aria-labelledby={title}\n onSelectionChange={handleSelectionChange}\n >\n {options}\n </ComboBoxField>\n );\n}\n"]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import'client-only';import {createContext}from'react';import {Radio,composeRenderProps,useContextProps,RadioGroup}from'react-aria-components';import {Label}from'../label/index.js';import {RadioStyles}from'./styles.js';
|
1
|
+
import {jsx,jsxs,Fragment}from'react/jsx-runtime';import'client-only';import {createContext}from'react';import {Radio,composeRenderProps,useContextProps,RadioGroup}from'react-aria-components';import {Label}from'../label/index.js';import {RadioStyles}from'./styles.js';const {group:y,groupLabel:C,radio:A,control:L,label:g}=RadioStyles(),D=createContext(null);function p({ref:o,...r}){[r,o]=useContextProps(r,o??null,D);const{children:s,classNames:a,label:t,...m}=r;return jsx(RadioGroup,{...m,ref:o,className:composeRenderProps(a?.group,l=>y({className:l})),children:composeRenderProps(s,(l,{isDisabled:R,isRequired:c})=>jsxs(Fragment,{children:[t&&jsx(Label,{className:C({className:a?.label}),isDisabled:R,isRequired:c,children:t}),l]}))})}p.displayName="Radio.Group";function d({classNames:o,children:r,...s}){return jsx(Radio,{...s,className:composeRenderProps(o?.radio,a=>A({className:a})),children:composeRenderProps(r,a=>jsxs(Fragment,{children:[jsx("span",{className:L({className:o?.control})}),jsx("span",{className:g({className:o?.label}),children:a})]}))})}d.displayName="Radio",d.Group=p;export{d as Radio,D as RadioContext};//# sourceMappingURL=index.js.map
|
2
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/radio/index.tsx"],"names":["
|
1
|
+
{"version":3,"sources":["../../../src/components/radio/index.tsx"],"names":["groupLabel","RadioContext","x","G","props","useContextProps","ref","P","classNames","rest","AriaRadioGroup","b","composeRenderProps","className","group","children","i","isDisabled","isRequired","u","label","jsx","e","RadioGroup","AriaRadio","radio"],"mappings":"4QA0Be,MAAA,CAAA,KAAAA,CAAAA,CAAY,CAAA,UAAO,CAAA,CAAA,CAAA,KAAS,CAAA,CAAA,CAAA,OAAsB,EAEpDC,CAAAA,KACkD,CAAA,CAAI,CAAA,CAEnEC,WAAA,EAAA,CAAA,CAAA,CAAAC,aAAA,CAAA,IAAsB,EAAA,SAAc,CAAoB,CACtD,CAACC,GAAU,CAAA,CAAIC,CAAAA,GAAuBC,GAAO,CAAA,CAAA,CAAA,CAAA,CAAML,CAAY,CAAAM,eAE/D,CAAA,CAAA,CAAA,CAAA,EAAQ,IAAA,CAAA,CAAA,CAAA,CAAA,KAAU,CAAA,QAAAC,CAAAA,CAAY,CAAA,UAAUC,CAAK,EAAIL,KAEjD,CAAA,CAAA,CAAA,GACGM,CAAAA,CAAA,CACE,SACIJ,GAAAA,CACLK,UAAA,CAAA,CAAA,GAAA,CAAA,CAAA,GAAWC,CAAmBJ,CAAAA,CAAAA,SAAoBK,CAChDC,kBAAAA,CAAM,CAAE,EAAA,KAAA,CAAA,CAAA,EAAU,CAAC,CACrB,CAAA,SAEC,CAAAF,CAAAA,CAAmBG,CAAAA,CAAU,CAACA,QAAY,CAAAC,kBAAA,CAAA,CAAA,CAAA,CAAAC,CAAAA,CAAY,WAAAC,CAAW,CAAA,CAAA,UAE7D,CAAA,CAAA,CAAA,GAAAC,IAAAC,CAAAA,QAAAA,CACCC,CAAAA,QACE,CAAA,CAAA,CAAA,EAAAC,GAAWtB,CAAAA,KAAW,CAAE,CAAA,SAAWQ,CAAAA,CAAAA,CAAY,CAAA,SAC/C,CAAA,CAAA,EAAA,KAAYS,CAAAA,CACZ,CAAA,UAAYC,CAAAA,CAEX,CAAA,UACH,CAAA,CAEDH,CAAAA,QAMXQ,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WAAA,CAElB,uBAAiBf,CAAAA,CAAY,CAAA,UAAU,CAAA,CAAA,CAAGC,QAC/C,CAAA,CAAA,CACEY,GAACG,CAAA,CACE,CAAA,CAAA,qBAC6BhB,CAAAA,CAAAA,SAAoBK,CAChDY,kBAAAA,CAAM,CAAE,EAAA,KAAA,CAAA,CAAA,EAAU,CAAC,CACrB,CAAA,SAEC,CAAAb,EAAmBG,CAAAA,CAAWA,CAAAA,QAE3B,CAAAC,kBAAA,CAAA,CAAA,CAAA,CAAA,EAAAG,IAAAE,SAAC,CAAA,CAAA,QAAK,CAAA,CAAAC,GAAA,CAAA,MAAmB,CAAE,CAAA,SAAWd,CAAAA,CAAAA,CAAY,UAAY,EAC9Da,EAAC,OAAA,CAAK,cAAiB,CAAE,CAAA,SAAWb,CAAAA,CAAAA,CAAY,CAAA,SAC7C,CAAA,CAAA,EAAA,KACH,CAAA,CAAA,CACF,QAKF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WACd,CAAA,OAAQe,CAAAA,CAAAA,CAAAA,KAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { createContext } from 'react';\nimport {\n Radio as AriaRadio,\n RadioGroup as AriaRadioGroup,\n type ContextValue,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Label } from '../label';\nimport { RadioStyles } from './styles';\nimport type { RadioGroupProps, RadioProps } from './types';\n\nconst { group, groupLabel, radio, control, label } = RadioStyles();\n\nexport const RadioContext =\n createContext<ContextValue<RadioGroupProps, HTMLDivElement>>(null);\n\nfunction RadioGroup({ ref, ...props }: RadioGroupProps) {\n [props, ref] = useContextProps(props, ref ?? null, RadioContext);\n\n const { children, classNames, label, ...rest } = props;\n\n return (\n <AriaRadioGroup\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.group, (className) =>\n group({ className }),\n )}\n >\n {composeRenderProps(children, (children, { isDisabled, isRequired }) => (\n <>\n {label && (\n <Label\n className={groupLabel({ className: classNames?.label })}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {label}\n </Label>\n )}\n {children}\n </>\n ))}\n </AriaRadioGroup>\n );\n}\nRadioGroup.displayName = 'Radio.Group';\n\nexport function Radio({ classNames, children, ...rest }: RadioProps) {\n return (\n <AriaRadio\n {...rest}\n className={composeRenderProps(classNames?.radio, (className) =>\n radio({ className }),\n )}\n >\n {composeRenderProps(children, (children) => (\n <>\n <span className={control({ className: classNames?.control })} />\n <span className={label({ className: classNames?.label })}>\n {children}\n </span>\n </>\n ))}\n </AriaRadio>\n );\n}\nRadio.displayName = 'Radio';\nRadio.Group = RadioGroup;\n"]}
|
@@ -1,23 +1,24 @@
|
|
1
1
|
import * as tailwind_variants from 'tailwind-variants';
|
2
|
+
import * as tailwind_merge from 'tailwind-merge';
|
2
3
|
|
3
4
|
declare const RadioStyles: tailwind_variants.TVReturnType<{
|
4
5
|
[key: string]: {
|
5
|
-
[key: string]:
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
groupLabel?:
|
10
|
-
control?:
|
6
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
7
|
+
label?: tailwind_merge.ClassNameValue;
|
8
|
+
group?: tailwind_merge.ClassNameValue;
|
9
|
+
radio?: tailwind_merge.ClassNameValue;
|
10
|
+
groupLabel?: tailwind_merge.ClassNameValue;
|
11
|
+
control?: tailwind_merge.ClassNameValue;
|
11
12
|
};
|
12
13
|
};
|
13
14
|
} | {
|
14
15
|
[x: string]: {
|
15
|
-
[x: string]:
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
groupLabel?:
|
20
|
-
control?:
|
16
|
+
[x: string]: tailwind_merge.ClassNameValue | {
|
17
|
+
label?: tailwind_merge.ClassNameValue;
|
18
|
+
group?: tailwind_merge.ClassNameValue;
|
19
|
+
radio?: tailwind_merge.ClassNameValue;
|
20
|
+
groupLabel?: tailwind_merge.ClassNameValue;
|
21
|
+
control?: tailwind_merge.ClassNameValue;
|
21
22
|
};
|
22
23
|
};
|
23
24
|
} | {}, {
|
@@ -28,12 +29,12 @@ declare const RadioStyles: tailwind_variants.TVReturnType<{
|
|
28
29
|
label: string[];
|
29
30
|
}, undefined, {
|
30
31
|
[key: string]: {
|
31
|
-
[key: string]:
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
groupLabel?:
|
36
|
-
control?:
|
32
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
33
|
+
label?: tailwind_merge.ClassNameValue;
|
34
|
+
group?: tailwind_merge.ClassNameValue;
|
35
|
+
radio?: tailwind_merge.ClassNameValue;
|
36
|
+
groupLabel?: tailwind_merge.ClassNameValue;
|
37
|
+
control?: tailwind_merge.ClassNameValue;
|
37
38
|
};
|
38
39
|
};
|
39
40
|
} | {}, {
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {tv}from'./../../lib/utils.js';
|
1
|
+
import {tv}from'./../../lib/utils.js';const r=tv({slots:{group:["group/radio-group flex gap-xs","orientation-horizontal:flex-wrap","orientation-vertical:flex-col"],groupLabel:"w-full",radio:["group/radio flex cursor-pointer items-center gap-m group-orientation-horizontal/radio-group:grow group-orientation-horizontal/radio-group:basis-1/3","disabled:cursor-not-allowed"],control:["my-xxs flex size-l items-center justify-center rounded-full outline outline-interactive before:block before:size-s before:rounded-full","group-enabled/radio:group-focus/radio:outline-interactive-hover","group-enabled/radio:group-hover/radio:outline-interactive-hover","group-enabled/radio:group-selected/radio:outline-highlight group-enabled/radio:group-selected/radio:before:bg-highlight","group-enabled/radio:group-selected/radio:group-focus/radio:outline-interactive-hover","group-enabled/radio:group-selected/radio:group-hover/radio:outline-interactive-hover","group-disabled/radio:outline-interactive-disabled","group-disabled/radio:group-selected/radio:before:bg-interactive-disabled"],label:["text-body-s text-interactive-default","group-disabled/radio:text-interactive-disabled"]}});export{r as RadioStyles};//# sourceMappingURL=styles.js.map
|
2
2
|
//# sourceMappingURL=styles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/radio/styles.ts"],"names":["e"],"mappings":"sCAeE,
|
1
|
+
{"version":3,"sources":["../../../src/components/radio/styles.ts"],"names":["e"],"mappings":"sCAeE,MAAA,CAAO,CACLA,EAAA,CAAA,CAAA,KACE,CAAA,CAAA,KAAA,CAAA,CAAA,+BACA,CAAA,kEAGF,CAAA,CAAA,UACA,CAAA,QACE,CAAA,KAAA,CAAA,CAAA,qJACA,CAAA,6BAEO,CACP,kJACA,CAAA,iEACA,CAAA,2LAEA,CAAA,sFACA,CAAA,sFACA,CAAA,mDACA,CAAA,yHAIA,CAAA,gDAGL,CAAA,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\n\nexport const RadioStyles = tv({\n slots: {\n group: [\n 'group/radio-group flex gap-xs',\n 'orientation-horizontal:flex-wrap',\n 'orientation-vertical:flex-col',\n ],\n groupLabel: 'w-full',\n radio: [\n 'group/radio flex cursor-pointer items-center gap-m group-orientation-horizontal/radio-group:grow group-orientation-horizontal/radio-group:basis-1/3',\n 'disabled:cursor-not-allowed',\n ],\n control: [\n 'my-xxs flex size-l items-center justify-center rounded-full outline outline-interactive before:block before:size-s before:rounded-full',\n 'group-enabled/radio:group-focus/radio:outline-interactive-hover',\n 'group-enabled/radio:group-hover/radio:outline-interactive-hover',\n 'group-enabled/radio:group-selected/radio:outline-highlight group-enabled/radio:group-selected/radio:before:bg-highlight',\n 'group-enabled/radio:group-selected/radio:group-focus/radio:outline-interactive-hover',\n 'group-enabled/radio:group-selected/radio:group-hover/radio:outline-interactive-hover',\n 'group-disabled/radio:outline-interactive-disabled',\n 'group-disabled/radio:group-selected/radio:before:bg-interactive-disabled',\n ],\n label: [\n 'text-body-s text-interactive-default',\n 'group-disabled/radio:text-interactive-disabled',\n ],\n },\n});\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { RefAttributes
|
1
|
+
import { RefAttributes } from 'react';
|
2
2
|
import { RadioProps as RadioProps$1, RadioGroupProps as RadioGroupProps$1 } from 'react-aria-components';
|
3
3
|
import { LabelProps } from '../label/types.js';
|
4
4
|
|
@@ -16,6 +16,5 @@ type RadioProps = Omit<RadioProps$1, 'className'> & RefAttributes<HTMLLabelEleme
|
|
16
16
|
label?: string;
|
17
17
|
};
|
18
18
|
};
|
19
|
-
type RadioProviderProps = PropsWithChildren<RadioGroupProps>;
|
20
19
|
|
21
|
-
export type { RadioGroupProps, RadioProps
|
20
|
+
export type { RadioGroupProps, RadioProps };
|
@@ -1,19 +1,60 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
|
+
import * as react from 'react';
|
3
|
+
import { ProviderProps } from '../../lib/types.js';
|
4
|
+
import { ContextValue } from 'react-aria-components';
|
5
|
+
import { SearchFieldProps } from './types.js';
|
6
|
+
import 'tailwind-variants';
|
7
|
+
import '../button/types.js';
|
8
|
+
import '../button/styles.js';
|
9
|
+
import 'tailwind-merge';
|
10
|
+
import '../icon/types.js';
|
11
|
+
import './styles.js';
|
2
12
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
+
declare const SearchFieldContext: react.Context<ContextValue<SearchFieldProps, HTMLDivElement>>;
|
14
|
+
declare function SearchFieldProvider({ children, ...props }: ProviderProps<SearchFieldProps>): react_jsx_runtime.JSX.Element;
|
15
|
+
declare namespace SearchFieldProvider {
|
16
|
+
var displayName: string;
|
17
|
+
}
|
18
|
+
/**
|
19
|
+
* SearchField - A customizable search input component built on React Aria Components
|
20
|
+
*
|
21
|
+
* Provides a search input with integrated search icon, loading state, and clear functionality.
|
22
|
+
* Supports two visual variants (filled/outlined), and granular styling control.
|
23
|
+
*
|
24
|
+
* @example
|
25
|
+
* // Basic search field
|
26
|
+
* <SearchField placeholder="Search..." />
|
27
|
+
*
|
28
|
+
* @example
|
29
|
+
* // Filled variant with custom styling
|
30
|
+
* <SearchField
|
31
|
+
* variant="filled"
|
32
|
+
* placeholder="Search products"
|
33
|
+
* classNames={{
|
34
|
+
* input: "bg-gray-100",
|
35
|
+
* searchIcon: "text-blue-600"
|
36
|
+
* }}
|
37
|
+
* />
|
38
|
+
*
|
39
|
+
* @example
|
40
|
+
* // With event handlers
|
41
|
+
* <SearchField
|
42
|
+
* placeholder="Type to search"
|
43
|
+
* onSubmit={(value) => console.log('Search:', value)}
|
44
|
+
* onChange={(value) => setQuery(value)}
|
45
|
+
* />
|
46
|
+
*
|
47
|
+
* @example
|
48
|
+
* // Using context provider for default props
|
49
|
+
* <SearchField.Provider variant="filled">
|
50
|
+
* <SearchField placeholder="Search 1" />
|
51
|
+
* <SearchField placeholder="Search 2" />
|
52
|
+
* </SearchField.Provider>
|
53
|
+
*/
|
54
|
+
declare function SearchField({ ref, ...props }: SearchFieldProps): react_jsx_runtime.JSX.Element;
|
55
|
+
declare namespace SearchField {
|
56
|
+
var displayName: string;
|
57
|
+
var Provider: typeof SearchFieldProvider;
|
13
58
|
}
|
14
|
-
declare const SearchField: {
|
15
|
-
({ className, placeholder, variant, isLoading, ...rest }: SearchFieldProps): react_jsx_runtime.JSX.Element;
|
16
|
-
displayName: string;
|
17
|
-
};
|
18
59
|
|
19
|
-
export { SearchField,
|
60
|
+
export { SearchField, SearchFieldContext };
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {
|
1
|
+
import {jsx,jsxs}from'react/jsx-runtime';import'client-only';import {Search,Loop,CancelFill}from'@accelint/icons';import {createContext}from'react';import {useContextProps,SearchField,composeRenderProps,Input,Button}from'react-aria-components';import {Icon}from'../icon/index.js';import {SearchFieldStyles,SearchFieldStylesDefaults}from'./styles.js';const {field:I,input:g,search:L,loading:A,clear:B}=SearchFieldStyles(),c=createContext(null);function n({children:r,...a}){return jsx(c.Provider,{value:a,children:r})}n.displayName="SearchField.Provider";function d({ref:r,...a}){[a,r]=useContextProps(a,r??null,c);const{classNames:o,inputProps:p,isLoading:m=false,variant:i=SearchFieldStylesDefaults.variant,...h}=a;return jsx(Icon.Provider,{size:"small",children:jsxs(SearchField,{...h,ref:r,className:composeRenderProps(o?.field,l=>I({className:l,variant:i})),children:[jsx(Icon,{className:L({className:o?.search,variant:i}),children:jsx(Search,{})}),jsx(Input,{...p,className:composeRenderProps(o?.input,l=>g({className:l,variant:i})),type:"search"}),m?jsx(Icon,{className:A({className:o?.loading,variant:i}),children:jsx(Loop,{})}):jsx(Button,{className:composeRenderProps(o?.clear,l=>B({className:l,variant:i})),children:jsx(Icon,{children:jsx(CancelFill,{})})})]})})}d.displayName="SearchField",d.Provider=n;export{d as SearchField,c as SearchFieldContext};//# sourceMappingURL=index.js.map
|
2
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/search-field/index.tsx"],"names":["
|
1
|
+
{"version":3,"sources":["../../../src/components/search-field/index.tsx"],"names":["input","SearchFieldContext","x","F","props","jsx","e","SearchFieldProvider","useContextProps","ref","N","inputProps","isLoading","variant","SearchFieldStylesDefaults","rest","C","Icon","t","v","composeRenderProps","classNames","className","field","search","Search","Input","u","y","loading","Loop","Button","S","clear","CancelFill","P","SearchField"],"mappings":"8VA6Be,MAAA,CAAAA,KAAO,CAAA,CAAA,CAAA,KAAQ,CAAA,CAAA,CAAA,MAAS,CAAA,CAAA,CAAA,OAA4B,CAAA,CAEtDC,CAAAA,KACmD,CAAA,CAAI,CAAA,CAEpEC,iBAAA,EAAA,CAAA,CAAA,CAAAC,aAAA,CAAA,IACE,EAAA,SACA,CAAA,CAAA,CAAGC,QAEH,CAAA,CAAA,CACEC,GAACJ,CAAmB,CAAA,CAAA,CAAA,OAASK,GAAA,CAAA,CAAA,CAAA,QAC1B,CAAA,CAAA,KACH,CAEJ,CACAC,CAAAA,QAAoB,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WAAA,CAAA,sBAsCJ,CAAA,SAAc,CAAqB,CAC/D,CAACH,GAAU,CAAA,CAAII,CAAAA,GAAuBC,CAAAA,CAAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAMR,CAAkB,CAAAS,eAErE,CAAA,CAAA,CAAA,CAAA,EACE,IAAA,CAAA,CAAA,CAAA,CAAA,KACA,CAAA,UAAAC,CAAAA,CACA,CAAA,UA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AAoBC,CAChDW,kBAAAA,CAAM,CAAE,EAAA,KAAA,CAAA,CAAA,EAAAX,CAAW,CAAA,CAAA,SACrB,CAAA,CAEA,CAAA,OAAA,CAAAjB,CAAAA,CAACY,CAAAA,CAAA,CACC,QAAA,CAAAZ,GAAAA,CAAC6B,IAAAA,CAAA,CAAA,QAIT,CAAA5B,GACF,CAEJ6B,UAEAC,CAAAA,EAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WAAA,CAC1BA,aAAuB7B,CAAAA,CAAAA,CAAAA,QAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport type { ProviderProps } from '@/lib/types';\nimport { CancelFill, Loop, Search } from '@accelint/icons';\nimport { createContext } from 'react';\nimport {\n SearchField as AriaSearchField,\n Button,\n type ContextValue,\n Input,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\nimport { SearchFieldStyles, SearchFieldStylesDefaults } from './styles';\nimport type { SearchFieldProps } from './types';\n\nconst { field, input, search, loading, clear } = SearchFieldStyles();\n\nexport const SearchFieldContext =\n createContext<ContextValue<SearchFieldProps, HTMLDivElement>>(null);\n\nfunction SearchFieldProvider({\n children,\n ...props\n}: ProviderProps<SearchFieldProps>) {\n return (\n <SearchFieldContext.Provider value={props}>\n {children}\n </SearchFieldContext.Provider>\n );\n}\nSearchFieldProvider.displayName = 'SearchField.Provider';\n\n/**\n * SearchField - A customizable search input component built on React Aria Components\n *\n * Provides a search input with integrated search icon, loading state, and clear functionality.\n * Supports two visual variants (filled/outlined), and granular styling control.\n *\n * @example\n * // Basic search field\n * <SearchField placeholder=\"Search...\" />\n *\n * @example\n * // Filled variant with custom styling\n * <SearchField\n * variant=\"filled\"\n * placeholder=\"Search products\"\n * classNames={{\n * input: \"bg-gray-100\",\n * searchIcon: \"text-blue-600\"\n * }}\n * />\n *\n * @example\n * // With event handlers\n * <SearchField\n * placeholder=\"Type to search\"\n * onSubmit={(value) => console.log('Search:', value)}\n * onChange={(value) => setQuery(value)}\n * />\n *\n * @example\n * // Using context provider for default props\n * <SearchField.Provider variant=\"filled\">\n * <SearchField placeholder=\"Search 1\" />\n * <SearchField placeholder=\"Search 2\" />\n * </SearchField.Provider>\n */\nexport function SearchField({ ref, ...props }: SearchFieldProps) {\n [props, ref] = useContextProps(props, ref ?? null, SearchFieldContext);\n\n const {\n classNames,\n inputProps,\n isLoading = false,\n variant = SearchFieldStylesDefaults.variant,\n ...rest\n } = props;\n\n return (\n <Icon.Provider size='small'>\n <AriaSearchField\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.field, (className) =>\n field({ className, variant }),\n )}\n >\n <Icon className={search({ className: classNames?.search, variant })}>\n <Search />\n </Icon>\n <Input\n {...inputProps}\n className={composeRenderProps(classNames?.input, (className) =>\n input({ className, variant }),\n )}\n type='search'\n />\n {isLoading ? (\n <Icon\n className={loading({ className: classNames?.loading, variant })}\n >\n <Loop />\n </Icon>\n ) : (\n <Button\n className={composeRenderProps(classNames?.clear, (className) =>\n clear({ className, variant }),\n )}\n >\n <Icon>\n <CancelFill />\n </Icon>\n </Button>\n )}\n </AriaSearchField>\n </Icon.Provider>\n );\n}\n\nSearchField.displayName = 'SearchField';\nSearchField.Provider = SearchFieldProvider;\n"]}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import * as tailwind_variants from 'tailwind-variants';
|
2
|
+
|
3
|
+
declare const SearchFieldStylesDefaults: {
|
4
|
+
readonly variant: "outlined";
|
5
|
+
};
|
6
|
+
declare const SearchFieldStyles: tailwind_variants.TVReturnType<{
|
7
|
+
variant: {
|
8
|
+
filled: {
|
9
|
+
field: string;
|
10
|
+
};
|
11
|
+
outlined: {
|
12
|
+
field: string;
|
13
|
+
};
|
14
|
+
};
|
15
|
+
}, {
|
16
|
+
field: string[];
|
17
|
+
input: string[];
|
18
|
+
clear: string[];
|
19
|
+
loading: string;
|
20
|
+
search: string;
|
21
|
+
}, undefined, {
|
22
|
+
variant: {
|
23
|
+
filled: {
|
24
|
+
field: string;
|
25
|
+
};
|
26
|
+
outlined: {
|
27
|
+
field: string;
|
28
|
+
};
|
29
|
+
};
|
30
|
+
}, {
|
31
|
+
field: string[];
|
32
|
+
input: string[];
|
33
|
+
clear: string[];
|
34
|
+
loading: string;
|
35
|
+
search: string;
|
36
|
+
}, tailwind_variants.TVReturnType<{
|
37
|
+
variant: {
|
38
|
+
filled: {
|
39
|
+
field: string;
|
40
|
+
};
|
41
|
+
outlined: {
|
42
|
+
field: string;
|
43
|
+
};
|
44
|
+
};
|
45
|
+
}, {
|
46
|
+
field: string[];
|
47
|
+
input: string[];
|
48
|
+
clear: string[];
|
49
|
+
loading: string;
|
50
|
+
search: string;
|
51
|
+
}, undefined, unknown, unknown, undefined>>;
|
52
|
+
|
53
|
+
export { SearchFieldStyles, SearchFieldStylesDefaults };
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import {tv}from'./../../lib/utils.js';const i={variant:"outlined"},l=tv({slots:{field:["group/search-field fg-default-light flex items-center gap-s rounded-round p-s outline","focus-within:outline-highlight","hover:outline-interactive-hover","disabled:fg-disabled disabled:placeholder:fg-disabled disabled:cursor-not-allowed disabled:outline-interactive-disabled"],input:["hide-cancel block w-full font-display text-body-s outline-none","placeholder:text-default-dark","disabled:cursor-not-allowed"],clear:["fg-interactive cursor-pointer","focus:fg-interactive-hover","hover:fg-interactive-hover","group-empty/search-field:invisible group-disabled/search-field:invisible"],loading:"motion-safe:animate-spin",search:""},variants:{variant:{filled:{field:"bg-surface-raised outline-static-dark"},outlined:{field:"outline-interactive"}}},defaultVariants:i});export{l as SearchFieldStyles,i as SearchFieldStylesDefaults};//# sourceMappingURL=styles.js.map
|
2
|
+
//# sourceMappingURL=styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/components/search-field/styles.ts"],"names":["e"],"mappings":"sCAeE,MAAA,CAAS,CAAA,CAAA,OAAA,CACX,UAGE,CAAA,CAAA,CAAO,CACLA,EAAA,CAAA,CAAA,KACE,CAAA,CAAA,KAAA,CAAA,CAAA,uFACA,CAAA,gCACA,CAAA,iCACA,CAAA,yHAGA,CAAA,CAAA,KAAA,CAAA,CAAA,gEACA,CAAA,+BACA,CAAA,6BAGA,CAAA,CAAA,KAAA,CAAA,CAAA,+BACA,CAAA,4BACA,CAAA,4BACA,CAAA,0EAEO,CAAA,CAAA,OAAA,CAAA,0BAEX,CAAA,MACA,CAAA,EAAA,CAAU,CACR,QAAS,CACP,CAAA,OACE,CAAA,CAAA,MAAO,CAAA,CAAA,KAAA,CAAA,uCAET,CAAU,CACR,QAAO,CAAA,CAAA,KAAA,CAAA,qBAIb,CAAA,CAAA,CAAA,CAAA,eACD,CAAA,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\n\nexport const SearchFieldStylesDefaults = {\n variant: 'outlined',\n} as const;\n\nexport const SearchFieldStyles = tv({\n slots: {\n field: [\n 'group/search-field fg-default-light flex items-center gap-s rounded-round p-s outline',\n 'focus-within:outline-highlight',\n 'hover:outline-interactive-hover',\n 'disabled:fg-disabled disabled:placeholder:fg-disabled disabled:cursor-not-allowed disabled:outline-interactive-disabled',\n ],\n input: [\n 'hide-cancel block w-full font-display text-body-s outline-none',\n 'placeholder:text-default-dark',\n 'disabled:cursor-not-allowed',\n ],\n clear: [\n 'fg-interactive cursor-pointer',\n 'focus:fg-interactive-hover',\n 'hover:fg-interactive-hover',\n 'group-empty/search-field:invisible group-disabled/search-field:invisible',\n ],\n loading: 'motion-safe:animate-spin',\n search: '',\n },\n variants: {\n variant: {\n filled: {\n field: 'bg-surface-raised outline-static-dark',\n },\n outlined: {\n field: 'outline-interactive',\n },\n },\n },\n defaultVariants: SearchFieldStylesDefaults,\n});\n"]}
|