@powerhousedao/document-engineering 1.37.0 → 1.39.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/setupTests.d.ts +2 -0
- package/dist/setupTests.d.ts.map +1 -0
- package/dist/setupTests.js +2 -0
- package/dist/setupTests.js.map +1 -0
- package/dist/src/scalars/components/aid-field/aid-field.stories.d.ts +71 -0
- package/dist/src/scalars/components/aid-field/aid-field.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/aid-field/aid-field.stories.js +495 -0
- package/dist/src/scalars/components/aid-field/aid-field.stories.js.map +1 -0
- package/dist/src/scalars/components/aid-field/aid-field.test.d.ts +2 -0
- package/dist/src/scalars/components/aid-field/aid-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/aid-field/aid-field.test.js +180 -0
- package/dist/src/scalars/components/aid-field/aid-field.test.js.map +1 -0
- package/dist/src/scalars/components/amount-field/amount-field.stories.d.ts +267 -0
- package/dist/src/scalars/components/amount-field/amount-field.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/amount-field/amount-field.stories.js +339 -0
- package/dist/src/scalars/components/amount-field/amount-field.stories.js.map +1 -0
- package/dist/src/scalars/components/amount-field/amount-field.test.d.ts +2 -0
- package/dist/src/scalars/components/amount-field/amount-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/amount-field/amount-field.test.js +53 -0
- package/dist/src/scalars/components/amount-field/amount-field.test.js.map +1 -0
- package/dist/src/scalars/components/boolean-field/boolean-field.stories.d.ts +85 -0
- package/dist/src/scalars/components/boolean-field/boolean-field.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/boolean-field/boolean-field.stories.js +113 -0
- package/dist/src/scalars/components/boolean-field/boolean-field.stories.js.map +1 -0
- package/dist/src/scalars/components/boolean-field/boolean-field.test.d.ts +2 -0
- package/dist/src/scalars/components/boolean-field/boolean-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/boolean-field/boolean-field.test.js +82 -0
- package/dist/src/scalars/components/boolean-field/boolean-field.test.js.map +1 -0
- package/dist/src/scalars/components/country-code-field/country-code-field.js +1 -1
- package/dist/src/scalars/components/country-code-field/country-code-field.js.map +1 -1
- package/dist/src/scalars/components/country-code-field/country-code-field.stories.d.ts +19 -0
- package/dist/src/scalars/components/country-code-field/country-code-field.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/country-code-field/country-code-field.stories.js +173 -0
- package/dist/src/scalars/components/country-code-field/country-code-field.stories.js.map +1 -0
- package/dist/src/scalars/components/country-code-field/country-code-field.test.d.ts +2 -0
- package/dist/src/scalars/components/country-code-field/country-code-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/country-code-field/country-code-field.test.js +116 -0
- package/dist/src/scalars/components/country-code-field/country-code-field.test.js.map +1 -0
- package/dist/src/scalars/components/currency-code-field/currency-code-field.stories.d.ts +12 -0
- package/dist/src/scalars/components/currency-code-field/currency-code-field.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/currency-code-field/currency-code-field.stories.js +160 -0
- package/dist/src/scalars/components/currency-code-field/currency-code-field.stories.js.map +1 -0
- package/dist/src/scalars/components/currency-code-field/currency-code-field.test.d.ts +2 -0
- package/dist/src/scalars/components/currency-code-field/currency-code-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/currency-code-field/currency-code-field.test.js +47 -0
- package/dist/src/scalars/components/currency-code-field/currency-code-field.test.js.map +1 -0
- package/dist/src/scalars/components/date-picker-field/date-picker-field.stories.d.ts +26 -0
- package/dist/src/scalars/components/date-picker-field/date-picker-field.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/date-picker-field/date-picker-field.stories.js +296 -0
- package/dist/src/scalars/components/date-picker-field/date-picker-field.stories.js.map +1 -0
- package/dist/src/scalars/components/date-picker-field/date-picker-field.test.d.ts +2 -0
- package/dist/src/scalars/components/date-picker-field/date-picker-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/date-picker-field/date-picker-field.test.js +119 -0
- package/dist/src/scalars/components/date-picker-field/date-picker-field.test.js.map +1 -0
- package/dist/src/scalars/components/date-time-picker-field/date-time-picker-field.stories.d.ts +19 -0
- package/dist/src/scalars/components/date-time-picker-field/date-time-picker-field.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/date-time-picker-field/date-time-picker-field.stories.js +218 -0
- package/dist/src/scalars/components/date-time-picker-field/date-time-picker-field.stories.js.map +1 -0
- package/dist/src/scalars/components/date-time-picker-field/date-time-picker-field.test.d.ts +2 -0
- package/dist/src/scalars/components/date-time-picker-field/date-time-picker-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/date-time-picker-field/date-time-picker-field.test.js +125 -0
- package/dist/src/scalars/components/date-time-picker-field/date-time-picker-field.test.js.map +1 -0
- package/dist/src/scalars/components/email-field/email-field.stories.d.ts +12 -0
- package/dist/src/scalars/components/email-field/email-field.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/email-field/email-field.stories.js +108 -0
- package/dist/src/scalars/components/email-field/email-field.stories.js.map +1 -0
- package/dist/src/scalars/components/email-field/email-field.test.d.ts +2 -0
- package/dist/src/scalars/components/email-field/email-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/email-field/email-field.test.js +162 -0
- package/dist/src/scalars/components/email-field/email-field.test.js.map +1 -0
- package/dist/src/scalars/components/enum-field/enum-field.stories.d.ts +46 -0
- package/dist/src/scalars/components/enum-field/enum-field.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/enum-field/enum-field.stories.js +360 -0
- package/dist/src/scalars/components/enum-field/enum-field.stories.js.map +1 -0
- package/dist/src/scalars/components/enum-field/enum-field.test.d.ts +2 -0
- package/dist/src/scalars/components/enum-field/enum-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/enum-field/enum-field.test.js +89 -0
- package/dist/src/scalars/components/enum-field/enum-field.test.js.map +1 -0
- package/dist/src/scalars/components/examples/enum-field-example/enum-field-example.stories.d.ts +21 -0
- package/dist/src/scalars/components/examples/enum-field-example/enum-field-example.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/examples/enum-field-example/enum-field-example.stories.js +76 -0
- package/dist/src/scalars/components/examples/enum-field-example/enum-field-example.stories.js.map +1 -0
- package/dist/src/scalars/components/examples/multiple-fields-with-complex-layout/multiple-fields-with-complex-layout.stories.d.ts +21 -0
- package/dist/src/scalars/components/examples/multiple-fields-with-complex-layout/multiple-fields-with-complex-layout.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/examples/multiple-fields-with-complex-layout/multiple-fields-with-complex-layout.stories.js +141 -0
- package/dist/src/scalars/components/examples/multiple-fields-with-complex-layout/multiple-fields-with-complex-layout.stories.js.map +1 -0
- package/dist/src/scalars/components/examples/reset-button/reset-button.stories.d.ts +21 -0
- package/dist/src/scalars/components/examples/reset-button/reset-button.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/examples/reset-button/reset-button.stories.js +48 -0
- package/dist/src/scalars/components/examples/reset-button/reset-button.stories.js.map +1 -0
- package/dist/src/scalars/components/examples/reset-on-successful-submit/reset-on-successful-submit.stories.d.ts +21 -0
- package/dist/src/scalars/components/examples/reset-on-successful-submit/reset-on-successful-submit.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/examples/reset-on-successful-submit/reset-on-successful-submit.stories.js +47 -0
- package/dist/src/scalars/components/examples/reset-on-successful-submit/reset-on-successful-submit.stories.js.map +1 -0
- package/dist/src/scalars/components/examples/submit-changes-only/submit-changes-only.stories.d.ts +21 -0
- package/dist/src/scalars/components/examples/submit-changes-only/submit-changes-only.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/examples/submit-changes-only/submit-changes-only.stories.js +19 -0
- package/dist/src/scalars/components/examples/submit-changes-only/submit-changes-only.stories.js.map +1 -0
- package/dist/src/scalars/components/file-field/file-field.stories.d.ts +15 -0
- package/dist/src/scalars/components/file-field/file-field.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/file-field/file-field.stories.js +199 -0
- package/dist/src/scalars/components/file-field/file-field.stories.js.map +1 -0
- package/dist/src/scalars/components/file-field/index.js +1 -0
- package/dist/src/scalars/components/file-field/index.js.map +1 -1
- package/dist/src/scalars/components/form/form.test.d.ts +2 -0
- package/dist/src/scalars/components/form/form.test.d.ts.map +1 -0
- package/dist/src/scalars/components/form/form.test.js +129 -0
- package/dist/src/scalars/components/form/form.test.js.map +1 -0
- package/dist/src/scalars/components/fragments/button/button.test.d.ts +2 -0
- package/dist/src/scalars/components/fragments/button/button.test.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/button/button.test.js +11 -0
- package/dist/src/scalars/components/fragments/button/button.test.js.map +1 -0
- package/dist/src/scalars/components/fragments/character-counter/character-counter.stories.d.ts +30 -0
- package/dist/src/scalars/components/fragments/character-counter/character-counter.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/character-counter/character-counter.stories.js +48 -0
- package/dist/src/scalars/components/fragments/character-counter/character-counter.stories.js.map +1 -0
- package/dist/src/scalars/components/fragments/character-counter/character-counter.test.d.ts +2 -0
- package/dist/src/scalars/components/fragments/character-counter/character-counter.test.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/character-counter/character-counter.test.js +36 -0
- package/dist/src/scalars/components/fragments/character-counter/character-counter.test.js.map +1 -0
- package/dist/src/scalars/components/fragments/checkbox-field/checkbox-field.test.d.ts +2 -0
- package/dist/src/scalars/components/fragments/checkbox-field/checkbox-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/checkbox-field/checkbox-field.test.js +53 -0
- package/dist/src/scalars/components/fragments/checkbox-field/checkbox-field.test.js.map +1 -0
- package/dist/src/scalars/components/fragments/command/command.d.ts +3 -3
- package/dist/src/scalars/components/fragments/command/command.d.ts.map +1 -1
- package/dist/src/scalars/components/fragments/command/command.test.d.ts +2 -0
- package/dist/src/scalars/components/fragments/command/command.test.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/command/command.test.js +11 -0
- package/dist/src/scalars/components/fragments/command/command.test.js.map +1 -0
- package/dist/src/scalars/components/fragments/form-description/form-description.stories.d.ts +18 -0
- package/dist/src/scalars/components/fragments/form-description/form-description.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/form-description/form-description.stories.js +25 -0
- package/dist/src/scalars/components/fragments/form-description/form-description.stories.js.map +1 -0
- package/dist/src/scalars/components/fragments/form-description/form-description.test.d.ts +2 -0
- package/dist/src/scalars/components/fragments/form-description/form-description.test.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/form-description/form-description.test.js +29 -0
- package/dist/src/scalars/components/fragments/form-description/form-description.test.js.map +1 -0
- package/dist/src/scalars/components/fragments/form-group/form-group.test.d.ts +2 -0
- package/dist/src/scalars/components/fragments/form-group/form-group.test.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/form-group/form-group.test.js +16 -0
- package/dist/src/scalars/components/fragments/form-group/form-group.test.js.map +1 -0
- package/dist/src/scalars/components/fragments/form-label/form-label.stories.d.ts +11 -0
- package/dist/src/scalars/components/fragments/form-label/form-label.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/form-label/form-label.stories.js +74 -0
- package/dist/src/scalars/components/fragments/form-label/form-label.stories.js.map +1 -0
- package/dist/src/scalars/components/fragments/form-label/form-label.test.d.ts +2 -0
- package/dist/src/scalars/components/fragments/form-label/form-label.test.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/form-label/form-label.test.js +53 -0
- package/dist/src/scalars/components/fragments/form-label/form-label.test.js.map +1 -0
- package/dist/src/scalars/components/fragments/form-message/form-message.stories.d.ts +9 -0
- package/dist/src/scalars/components/fragments/form-message/form-message.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/form-message/form-message.stories.js +43 -0
- package/dist/src/scalars/components/fragments/form-message/form-message.stories.js.map +1 -0
- package/dist/src/scalars/components/fragments/form-message/form-message.test.d.ts +2 -0
- package/dist/src/scalars/components/fragments/form-message/form-message.test.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/form-message/form-message.test.js +49 -0
- package/dist/src/scalars/components/fragments/form-message/form-message.test.js.map +1 -0
- package/dist/src/scalars/components/fragments/id-autocomplete/id-autocomplete-input-container.js +1 -1
- package/dist/src/scalars/components/fragments/id-autocomplete/id-autocomplete-input-container.js.map +1 -1
- package/dist/src/scalars/components/fragments/id-autocomplete/id-autocomplete-list.d.ts +1 -1
- package/dist/src/scalars/components/fragments/id-autocomplete/id-autocomplete-list.d.ts.map +1 -1
- package/dist/src/scalars/components/fragments/id-autocomplete/id-autocomplete.d.ts +1 -2
- package/dist/src/scalars/components/fragments/id-autocomplete/id-autocomplete.d.ts.map +1 -1
- package/dist/src/scalars/components/fragments/id-autocomplete/id-autocomplete.js +13 -13
- package/dist/src/scalars/components/fragments/id-autocomplete/id-autocomplete.js.map +1 -1
- package/dist/src/scalars/components/fragments/id-autocomplete/id-autocomplete.test.d.ts +2 -0
- package/dist/src/scalars/components/fragments/id-autocomplete/id-autocomplete.test.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/id-autocomplete/id-autocomplete.test.js +136 -0
- package/dist/src/scalars/components/fragments/id-autocomplete/id-autocomplete.test.js.map +1 -0
- package/dist/src/scalars/components/fragments/id-autocomplete/use-id-autocomplete.d.ts +1 -1
- package/dist/src/scalars/components/fragments/popover/popover.test.d.ts +2 -0
- package/dist/src/scalars/components/fragments/popover/popover.test.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/popover/popover.test.js +11 -0
- package/dist/src/scalars/components/fragments/popover/popover.test.js.map +1 -0
- package/dist/src/scalars/components/fragments/progress-bar/progress-bar.test.d.ts +2 -0
- package/dist/src/scalars/components/fragments/progress-bar/progress-bar.test.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/progress-bar/progress-bar.test.js +18 -0
- package/dist/src/scalars/components/fragments/progress-bar/progress-bar.test.js.map +1 -0
- package/dist/src/scalars/components/fragments/radio-group-field/radio-group-field.test.d.ts +2 -0
- package/dist/src/scalars/components/fragments/radio-group-field/radio-group-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/radio-group-field/radio-group-field.test.js +133 -0
- package/dist/src/scalars/components/fragments/radio-group-field/radio-group-field.test.js.map +1 -0
- package/dist/src/scalars/components/fragments/select-field/select-field.test.d.ts +2 -0
- package/dist/src/scalars/components/fragments/select-field/select-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/select-field/select-field.test.js +160 -0
- package/dist/src/scalars/components/fragments/select-field/select-field.test.js.map +1 -0
- package/dist/src/scalars/components/fragments/tabs/tabs.test.d.ts +2 -0
- package/dist/src/scalars/components/fragments/tabs/tabs.test.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/tabs/tabs.test.js +47 -0
- package/dist/src/scalars/components/fragments/tabs/tabs.test.js.map +1 -0
- package/dist/src/scalars/components/fragments/text-field/text-field.test.d.ts +2 -0
- package/dist/src/scalars/components/fragments/text-field/text-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/text-field/text-field.test.js +106 -0
- package/dist/src/scalars/components/fragments/text-field/text-field.test.js.map +1 -0
- package/dist/src/scalars/components/fragments/textarea-field/textarea-field.test.d.ts +2 -0
- package/dist/src/scalars/components/fragments/textarea-field/textarea-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/textarea-field/textarea-field.test.js +100 -0
- package/dist/src/scalars/components/fragments/textarea-field/textarea-field.test.js.map +1 -0
- package/dist/src/scalars/components/fragments/toggle-field/toggle-field.test.d.ts +2 -0
- package/dist/src/scalars/components/fragments/toggle-field/toggle-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/toggle-field/toggle-field.test.js +56 -0
- package/dist/src/scalars/components/fragments/toggle-field/toggle-field.test.js.map +1 -0
- package/dist/src/scalars/components/fragments/value-transformer/value-transformer.d.ts +1 -1
- package/dist/src/scalars/components/fragments/value-transformer/value-transformer.d.ts.map +1 -1
- package/dist/src/scalars/components/fragments/value-transformer/value-transformer.js +2 -1
- package/dist/src/scalars/components/fragments/value-transformer/value-transformer.js.map +1 -1
- package/dist/src/scalars/components/fragments/value-transformer/value-transformer.test.d.ts +2 -0
- package/dist/src/scalars/components/fragments/value-transformer/value-transformer.test.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/value-transformer/value-transformer.test.js +102 -0
- package/dist/src/scalars/components/fragments/value-transformer/value-transformer.test.js.map +1 -0
- package/dist/src/scalars/components/fragments/with-field-validation/with-field-validation.test.d.ts +2 -0
- package/dist/src/scalars/components/fragments/with-field-validation/with-field-validation.test.d.ts.map +1 -0
- package/dist/src/scalars/components/fragments/with-field-validation/with-field-validation.test.js +141 -0
- package/dist/src/scalars/components/fragments/with-field-validation/with-field-validation.test.js.map +1 -0
- package/dist/src/scalars/components/id-field/id-field.stories.d.ts +58 -0
- package/dist/src/scalars/components/id-field/id-field.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/id-field/id-field.stories.js +73 -0
- package/dist/src/scalars/components/id-field/id-field.stories.js.map +1 -0
- package/dist/src/scalars/components/id-field/id-field.test.d.ts +2 -0
- package/dist/src/scalars/components/id-field/id-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/id-field/id-field.test.js +80 -0
- package/dist/src/scalars/components/id-field/id-field.test.js.map +1 -0
- package/dist/src/scalars/components/number-field/number-field.d.ts +2 -1
- package/dist/src/scalars/components/number-field/number-field.d.ts.map +1 -1
- package/dist/src/scalars/components/number-field/number-field.js.map +1 -1
- package/dist/src/scalars/components/number-field/number-field.stories.d.ts +156 -0
- package/dist/src/scalars/components/number-field/number-field.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/number-field/number-field.stories.js +228 -0
- package/dist/src/scalars/components/number-field/number-field.stories.js.map +1 -0
- package/dist/src/scalars/components/number-field/number-field.test.d.ts +2 -0
- package/dist/src/scalars/components/number-field/number-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/number-field/number-field.test.js +336 -0
- package/dist/src/scalars/components/number-field/number-field.test.js.map +1 -0
- package/dist/src/scalars/components/oid-field/oid-field.stories.d.ts +69 -0
- package/dist/src/scalars/components/oid-field/oid-field.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/oid-field/oid-field.stories.js +447 -0
- package/dist/src/scalars/components/oid-field/oid-field.stories.js.map +1 -0
- package/dist/src/scalars/components/oid-field/oid-field.test.d.ts +2 -0
- package/dist/src/scalars/components/oid-field/oid-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/oid-field/oid-field.test.js +161 -0
- package/dist/src/scalars/components/oid-field/oid-field.test.js.map +1 -0
- package/dist/src/scalars/components/password-field/password-field.stories.d.ts +23 -0
- package/dist/src/scalars/components/password-field/password-field.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/password-field/password-field.stories.js +234 -0
- package/dist/src/scalars/components/password-field/password-field.stories.js.map +1 -0
- package/dist/src/scalars/components/password-field/password-field.test.d.ts +2 -0
- package/dist/src/scalars/components/password-field/password-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/password-field/password-field.test.js +112 -0
- package/dist/src/scalars/components/password-field/password-field.test.js.map +1 -0
- package/dist/src/scalars/components/phid-field/phid-field.stories.d.ts +69 -0
- package/dist/src/scalars/components/phid-field/phid-field.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/phid-field/phid-field.stories.js +476 -0
- package/dist/src/scalars/components/phid-field/phid-field.stories.js.map +1 -0
- package/dist/src/scalars/components/phid-field/phid-field.test.d.ts +2 -0
- package/dist/src/scalars/components/phid-field/phid-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/phid-field/phid-field.test.js +164 -0
- package/dist/src/scalars/components/phid-field/phid-field.test.js.map +1 -0
- package/dist/src/scalars/components/phone-number-field/phone-number-field.stories.d.ts +19 -0
- package/dist/src/scalars/components/phone-number-field/phone-number-field.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/phone-number-field/phone-number-field.stories.js +116 -0
- package/dist/src/scalars/components/phone-number-field/phone-number-field.stories.js.map +1 -0
- package/dist/src/scalars/components/phone-number-field/phone-number-field.test.d.ts +2 -0
- package/dist/src/scalars/components/phone-number-field/phone-number-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/phone-number-field/phone-number-field.test.js +225 -0
- package/dist/src/scalars/components/phone-number-field/phone-number-field.test.js.map +1 -0
- package/dist/src/scalars/components/string-field/string-field.stories.d.ts +18 -0
- package/dist/src/scalars/components/string-field/string-field.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/string-field/string-field.stories.js +143 -0
- package/dist/src/scalars/components/string-field/string-field.stories.js.map +1 -0
- package/dist/src/scalars/components/string-field/string-field.test.d.ts +2 -0
- package/dist/src/scalars/components/string-field/string-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/string-field/string-field.test.js +60 -0
- package/dist/src/scalars/components/string-field/string-field.test.js.map +1 -0
- package/dist/src/scalars/components/time-picker-field/time-picker-field.stories.d.ts +25 -0
- package/dist/src/scalars/components/time-picker-field/time-picker-field.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/time-picker-field/time-picker-field.stories.js +150 -0
- package/dist/src/scalars/components/time-picker-field/time-picker-field.stories.js.map +1 -0
- package/dist/src/scalars/components/time-picker-field/time-picker-field.test.d.ts +2 -0
- package/dist/src/scalars/components/time-picker-field/time-picker-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/time-picker-field/time-picker-field.test.js +123 -0
- package/dist/src/scalars/components/time-picker-field/time-picker-field.test.js.map +1 -0
- package/dist/src/scalars/components/url-field/url-field.stories.d.ts +17 -0
- package/dist/src/scalars/components/url-field/url-field.stories.d.ts.map +1 -0
- package/dist/src/scalars/components/url-field/url-field.stories.js +146 -0
- package/dist/src/scalars/components/url-field/url-field.stories.js.map +1 -0
- package/dist/src/scalars/components/url-field/url-field.test.d.ts +2 -0
- package/dist/src/scalars/components/url-field/url-field.test.d.ts.map +1 -0
- package/dist/src/scalars/components/url-field/url-field.test.js +131 -0
- package/dist/src/scalars/components/url-field/url-field.test.js.map +1 -0
- package/dist/src/scalars/graphql/test/Amount.test.d.ts +2 -0
- package/dist/src/scalars/graphql/test/Amount.test.d.ts.map +1 -0
- package/dist/src/scalars/graphql/test/Amount.test.js +135 -0
- package/dist/src/scalars/graphql/test/Amount.test.js.map +1 -0
- package/dist/src/scalars/graphql/test/AmountCrypto.test.d.ts +2 -0
- package/dist/src/scalars/graphql/test/AmountCrypto.test.d.ts.map +1 -0
- package/dist/src/scalars/graphql/test/AmountCrypto.test.js +138 -0
- package/dist/src/scalars/graphql/test/AmountCrypto.test.js.map +1 -0
- package/dist/src/scalars/graphql/test/AmountCurrency.test.d.ts +2 -0
- package/dist/src/scalars/graphql/test/AmountCurrency.test.d.ts.map +1 -0
- package/dist/src/scalars/graphql/test/AmountCurrency.test.js +141 -0
- package/dist/src/scalars/graphql/test/AmountCurrency.test.js.map +1 -0
- package/dist/src/scalars/graphql/test/AmountFiat.test.d.ts +2 -0
- package/dist/src/scalars/graphql/test/AmountFiat.test.d.ts.map +1 -0
- package/dist/src/scalars/graphql/test/AmountFiat.test.js +129 -0
- package/dist/src/scalars/graphql/test/AmountFiat.test.js.map +1 -0
- package/dist/src/scalars/graphql/test/AmountMoney.test.d.ts +2 -0
- package/dist/src/scalars/graphql/test/AmountMoney.test.d.ts.map +1 -0
- package/dist/src/scalars/graphql/test/AmountMoney.test.js +50 -0
- package/dist/src/scalars/graphql/test/AmountMoney.test.js.map +1 -0
- package/dist/src/scalars/graphql/test/AmountPercentage.test.d.ts +2 -0
- package/dist/src/scalars/graphql/test/AmountPercentage.test.d.ts.map +1 -0
- package/dist/src/scalars/graphql/test/AmountPercentage.test.js +50 -0
- package/dist/src/scalars/graphql/test/AmountPercentage.test.js.map +1 -0
- package/dist/src/scalars/graphql/test/AmountTokens.test.d.ts +2 -0
- package/dist/src/scalars/graphql/test/AmountTokens.test.d.ts.map +1 -0
- package/dist/src/scalars/graphql/test/AmountTokens.test.js +50 -0
- package/dist/src/scalars/graphql/test/AmountTokens.test.js.map +1 -0
- package/dist/src/scalars/graphql/test/Currency.test.d.ts +2 -0
- package/dist/src/scalars/graphql/test/Currency.test.d.ts.map +1 -0
- package/dist/src/scalars/graphql/test/Currency.test.js +35 -0
- package/dist/src/scalars/graphql/test/Currency.test.js.map +1 -0
- package/dist/src/scalars/graphql/test/Date.test.d.ts +2 -0
- package/dist/src/scalars/graphql/test/Date.test.d.ts.map +1 -0
- package/dist/src/scalars/graphql/test/Date.test.js +50 -0
- package/dist/src/scalars/graphql/test/Date.test.js.map +1 -0
- package/dist/src/scalars/graphql/test/DateTime.test.d.ts +2 -0
- package/dist/src/scalars/graphql/test/DateTime.test.d.ts.map +1 -0
- package/dist/src/scalars/graphql/test/DateTime.test.js +50 -0
- package/dist/src/scalars/graphql/test/DateTime.test.js.map +1 -0
- package/dist/src/scalars/graphql/test/EmailAddress.test.d.ts +2 -0
- package/dist/src/scalars/graphql/test/EmailAddress.test.d.ts.map +1 -0
- package/dist/src/scalars/graphql/test/EmailAddress.test.js +50 -0
- package/dist/src/scalars/graphql/test/EmailAddress.test.js.map +1 -0
- package/dist/src/scalars/graphql/test/EthereumAddress.test.d.ts +2 -0
- package/dist/src/scalars/graphql/test/EthereumAddress.test.d.ts.map +1 -0
- package/dist/src/scalars/graphql/test/EthereumAddress.test.js +50 -0
- package/dist/src/scalars/graphql/test/EthereumAddress.test.js.map +1 -0
- package/dist/src/scalars/graphql/test/OID.test.d.ts +2 -0
- package/dist/src/scalars/graphql/test/OID.test.d.ts.map +1 -0
- package/dist/src/scalars/graphql/test/OID.test.js +35 -0
- package/dist/src/scalars/graphql/test/OID.test.js.map +1 -0
- package/dist/src/scalars/graphql/test/OLabel.test.d.ts +2 -0
- package/dist/src/scalars/graphql/test/OLabel.test.d.ts.map +1 -0
- package/dist/src/scalars/graphql/test/OLabel.test.js +35 -0
- package/dist/src/scalars/graphql/test/OLabel.test.js.map +1 -0
- package/dist/src/scalars/graphql/test/PHID.test.d.ts +2 -0
- package/dist/src/scalars/graphql/test/PHID.test.d.ts.map +1 -0
- package/dist/src/scalars/graphql/test/PHID.test.js +35 -0
- package/dist/src/scalars/graphql/test/PHID.test.js.map +1 -0
- package/dist/src/scalars/graphql/test/URL.test.d.ts +2 -0
- package/dist/src/scalars/graphql/test/URL.test.d.ts.map +1 -0
- package/dist/src/scalars/graphql/test/URL.test.js +50 -0
- package/dist/src/scalars/graphql/test/URL.test.js.map +1 -0
- package/dist/src/scalars/hooks/useEllipsis.d.ts +1 -1
- package/dist/src/scalars/hooks/useEllipsis.d.ts.map +1 -1
- package/dist/src/scalars/hooks/useEllipsis.js.map +1 -1
- package/dist/src/scalars/lib/deep-equal.test.d.ts +2 -0
- package/dist/src/scalars/lib/deep-equal.test.d.ts.map +1 -0
- package/dist/src/scalars/lib/deep-equal.test.js +70 -0
- package/dist/src/scalars/lib/deep-equal.test.js.map +1 -0
- package/dist/src/scalars/lib/is-empty.test.d.ts +2 -0
- package/dist/src/scalars/lib/is-empty.test.d.ts.map +1 -0
- package/dist/src/scalars/lib/is-empty.test.js +87 -0
- package/dist/src/scalars/lib/is-empty.test.js.map +1 -0
- package/dist/src/table/components/cells/render-cell/render-cell.d.ts.map +1 -1
- package/dist/src/table/components/cells/render-cell/render-cell.js +3 -13
- package/dist/src/table/components/cells/render-cell/render-cell.js.map +1 -1
- package/dist/src/table/components/cells/render-cell/use-cell-logic.d.ts +10 -4
- package/dist/src/table/components/cells/render-cell/use-cell-logic.d.ts.map +1 -1
- package/dist/src/table/components/cells/render-cell/use-cell-logic.js +21 -1
- package/dist/src/table/components/cells/render-cell/use-cell-logic.js.map +1 -1
- package/dist/src/table/components/default-cell-editors/amount-editor.js.map +1 -1
- package/dist/src/table/components/default-cell-editors/country-editor.d.ts +1 -1
- package/dist/src/table/components/default-cell-editors/country-editor.d.ts.map +1 -1
- package/dist/src/table/components/default-cell-editors/country-editor.js +2 -4
- package/dist/src/table/components/default-cell-editors/country-editor.js.map +1 -1
- package/dist/src/table/components/default-cell-renderers/country-render.d.ts +2 -2
- package/dist/src/table/components/default-cell-renderers/country-render.d.ts.map +1 -1
- package/dist/src/table/components/default-cell-renderers/country-render.js +8 -4
- package/dist/src/table/components/default-cell-renderers/country-render.js.map +1 -1
- package/dist/src/table/components/rows/row-actions.d.ts +1 -1
- package/dist/src/table/components/rows/row-actions.d.ts.map +1 -1
- package/dist/src/table/components/table-focus-trap.d.ts.map +1 -1
- package/dist/src/table/components/table-focus-trap.js +10 -0
- package/dist/src/table/components/table-focus-trap.js.map +1 -1
- package/dist/src/table/components/table-provider/table-provider.d.ts +1 -1
- package/dist/src/table/components/table-provider/table-provider.d.ts.map +1 -1
- package/dist/src/table/components/table-provider/table-provider.js +1 -1
- package/dist/src/table/components/table-provider/table-provider.js.map +1 -1
- package/dist/src/table/components/table-provider/table-reducer.d.ts +1 -1
- package/dist/src/table/components/table-provider/table-reducer.d.ts.map +1 -1
- package/dist/src/table/examples/api-usage/api-usage.stories.d.ts +16 -0
- package/dist/src/table/examples/api-usage/api-usage.stories.d.ts.map +1 -0
- package/dist/src/table/examples/api-usage/api-usage.stories.js +15 -0
- package/dist/src/table/examples/api-usage/api-usage.stories.js.map +1 -0
- package/dist/src/table/examples/column-visibility/column-visibility.stories.d.ts +23 -0
- package/dist/src/table/examples/column-visibility/column-visibility.stories.d.ts.map +1 -0
- package/dist/src/table/examples/column-visibility/column-visibility.stories.js +127 -0
- package/dist/src/table/examples/column-visibility/column-visibility.stories.js.map +1 -0
- package/dist/src/table/examples/computed-columns/computed-columns.stories.d.ts +23 -0
- package/dist/src/table/examples/computed-columns/computed-columns.stories.d.ts.map +1 -0
- package/dist/src/table/examples/computed-columns/computed-columns.stories.js +89 -0
- package/dist/src/table/examples/computed-columns/computed-columns.stories.js.map +1 -0
- package/dist/src/table/examples/custom-cell-editors/custom-cell-editors.d.ts.map +1 -1
- package/dist/src/table/examples/custom-cell-editors/custom-cell-editors.js +1 -0
- package/dist/src/table/examples/custom-cell-editors/custom-cell-editors.js.map +1 -1
- package/dist/src/table/examples/custom-cell-editors/custom-cell-editors.stories.d.ts +23 -0
- package/dist/src/table/examples/custom-cell-editors/custom-cell-editors.stories.d.ts.map +1 -0
- package/dist/src/table/examples/custom-cell-editors/custom-cell-editors.stories.js +332 -0
- package/dist/src/table/examples/custom-cell-editors/custom-cell-editors.stories.js.map +1 -0
- package/dist/src/table/examples/custom-rendering/custom-rendering.stories.d.ts +23 -0
- package/dist/src/table/examples/custom-rendering/custom-rendering.stories.d.ts.map +1 -0
- package/dist/src/table/examples/custom-rendering/custom-rendering.stories.js +112 -0
- package/dist/src/table/examples/custom-rendering/custom-rendering.stories.js.map +1 -0
- package/dist/src/table/examples/events/events.d.ts.map +1 -1
- package/dist/src/table/examples/events/events.js +1 -0
- package/dist/src/table/examples/events/events.js.map +1 -1
- package/dist/src/table/examples/events/events.stories.d.ts +16 -0
- package/dist/src/table/examples/events/events.stories.d.ts.map +1 -0
- package/dist/src/table/examples/events/events.stories.js +15 -0
- package/dist/src/table/examples/events/events.stories.js.map +1 -0
- package/dist/src/table/examples/row-reordering/row-reordering.stories.d.ts +37 -0
- package/dist/src/table/examples/row-reordering/row-reordering.stories.d.ts.map +1 -0
- package/dist/src/table/examples/row-reordering/row-reordering.stories.js +143 -0
- package/dist/src/table/examples/row-reordering/row-reordering.stories.js.map +1 -0
- package/dist/src/table/examples/table-editing/table-editing.d.ts.map +1 -1
- package/dist/src/table/examples/table-editing/table-editing.js +15 -0
- package/dist/src/table/examples/table-editing/table-editing.js.map +1 -1
- package/dist/src/table/examples/table-editing/table-editing.stories.d.ts +43 -0
- package/dist/src/table/examples/table-editing/table-editing.stories.d.ts.map +1 -0
- package/dist/src/table/examples/table-editing/table-editing.stories.js +163 -0
- package/dist/src/table/examples/table-editing/table-editing.stories.js.map +1 -0
- package/dist/src/table/logic/table-api.d.ts +1 -1
- package/dist/src/table/logic/table-api.d.ts.map +1 -1
- package/dist/src/table/logic/table-api.js.map +1 -1
- package/dist/src/table/table/mock-data.d.ts +1 -0
- package/dist/src/table/table/mock-data.d.ts.map +1 -1
- package/dist/src/table/table/mock-data.js +39 -32
- package/dist/src/table/table/mock-data.js.map +1 -1
- package/dist/src/table/table/object-set-table.stories.d.ts +97 -0
- package/dist/src/table/table/object-set-table.stories.d.ts.map +1 -0
- package/dist/src/table/table/object-set-table.stories.js +300 -0
- package/dist/src/table/table/object-set-table.stories.js.map +1 -0
- package/dist/src/table/table/utils.d.ts +1 -1
- package/dist/src/table/table/utils.d.ts.map +1 -1
- package/dist/src/table/table/utils.js.map +1 -1
- package/dist/src/ui/components/button/button.stories.d.ts +32 -0
- package/dist/src/ui/components/button/button.stories.d.ts.map +1 -0
- package/dist/src/ui/components/button/button.stories.js +121 -0
- package/dist/src/ui/components/button/button.stories.js.map +1 -0
- package/dist/src/ui/components/button/button.test.d.ts +2 -0
- package/dist/src/ui/components/button/button.test.d.ts.map +1 -0
- package/dist/src/ui/components/button/button.test.js +71 -0
- package/dist/src/ui/components/button/button.test.js.map +1 -0
- package/dist/src/ui/components/confirm/alert-dialog.test.d.ts +2 -0
- package/dist/src/ui/components/confirm/alert-dialog.test.d.ts.map +1 -0
- package/dist/src/ui/components/confirm/alert-dialog.test.js +20 -0
- package/dist/src/ui/components/confirm/alert-dialog.test.js.map +1 -0
- package/dist/src/ui/components/confirm/confirm.stories.d.ts +37 -0
- package/dist/src/ui/components/confirm/confirm.stories.d.ts.map +1 -0
- package/dist/src/ui/components/confirm/confirm.stories.js +75 -0
- package/dist/src/ui/components/confirm/confirm.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/aid-input/aid-input.stories.d.ts +74 -0
- package/dist/src/ui/components/data-entry/aid-input/aid-input.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/aid-input/aid-input.stories.js +505 -0
- package/dist/src/ui/components/data-entry/aid-input/aid-input.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/aid-input/aid-input.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/aid-input/aid-input.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/aid-input/aid-input.test.js +191 -0
- package/dist/src/ui/components/data-entry/aid-input/aid-input.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/amount-input/amount-input.d.ts +1 -1
- package/dist/src/ui/components/data-entry/amount-input/amount-input.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/amount-input/amount-input.stories.d.ts +269 -0
- package/dist/src/ui/components/data-entry/amount-input/amount-input.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/amount-input/amount-input.stories.js +363 -0
- package/dist/src/ui/components/data-entry/amount-input/amount-input.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/amount-input/amount-input.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/amount-input/amount-input.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/amount-input/amount-input.test.js +98 -0
- package/dist/src/ui/components/data-entry/amount-input/amount-input.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/amount-input/utils.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/amount-input/utils.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/amount-input/utils.test.js +64 -0
- package/dist/src/ui/components/data-entry/amount-input/utils.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/checkbox/checkbox-base.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/checkbox/checkbox-base.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/checkbox/checkbox-base.test.js +57 -0
- package/dist/src/ui/components/data-entry/checkbox/checkbox-base.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/checkbox/checkbox.stories.d.ts +73 -0
- package/dist/src/ui/components/data-entry/checkbox/checkbox.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/checkbox/checkbox.stories.js +139 -0
- package/dist/src/ui/components/data-entry/checkbox/checkbox.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/checkbox/index.js +1 -0
- package/dist/src/ui/components/data-entry/checkbox/index.js.map +1 -1
- package/dist/src/ui/components/data-entry/country-code-picker/country-code-picker.js +1 -1
- package/dist/src/ui/components/data-entry/country-code-picker/country-code-picker.js.map +1 -1
- package/dist/src/ui/components/data-entry/country-code-picker/country-code-picker.stories.d.ts +33 -0
- package/dist/src/ui/components/data-entry/country-code-picker/country-code-picker.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/country-code-picker/country-code-picker.stories.js +194 -0
- package/dist/src/ui/components/data-entry/country-code-picker/country-code-picker.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/country-code-picker/country-code-picker.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/country-code-picker/country-code-picker.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/country-code-picker/country-code-picker.test.js +173 -0
- package/dist/src/ui/components/data-entry/country-code-picker/country-code-picker.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/currency-code-picker/currency-code-picker.stories.d.ts +28 -0
- package/dist/src/ui/components/data-entry/currency-code-picker/currency-code-picker.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/currency-code-picker/currency-code-picker.stories.js +185 -0
- package/dist/src/ui/components/data-entry/currency-code-picker/currency-code-picker.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/currency-code-picker/currency-code-picker.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/currency-code-picker/currency-code-picker.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/currency-code-picker/currency-code-picker.test.js +161 -0
- package/dist/src/ui/components/data-entry/currency-code-picker/currency-code-picker.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/date-picker/date-picker.stories.d.ts +104 -0
- package/dist/src/ui/components/data-entry/date-picker/date-picker.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/date-picker/date-picker.stories.js +360 -0
- package/dist/src/ui/components/data-entry/date-picker/date-picker.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/date-picker/date-picker.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/date-picker/date-picker.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/date-picker/date-picker.test.js +225 -0
- package/dist/src/ui/components/data-entry/date-picker/date-picker.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/date-picker/index.js +1 -0
- package/dist/src/ui/components/data-entry/date-picker/index.js.map +1 -1
- package/dist/src/ui/components/data-entry/date-picker/subcomponents/calendar-nav/calendar-nav.d.ts +1 -1
- package/dist/src/ui/components/data-entry/date-picker/subcomponents/calendar-nav/calendar-nav.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/date-picker/subcomponents/calendar-nav/calendar-nav.js.map +1 -1
- package/dist/src/ui/components/data-entry/date-picker/subcomponents/caption-label/caption-label.d.ts +1 -1
- package/dist/src/ui/components/data-entry/date-picker/subcomponents/caption-label/caption-label.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/date-time-picker/date-time-picker.stories.d.ts +152 -0
- package/dist/src/ui/components/data-entry/date-time-picker/date-time-picker.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/date-time-picker/date-time-picker.stories.js +376 -0
- package/dist/src/ui/components/data-entry/date-time-picker/date-time-picker.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/date-time-picker/date-time-picker.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/date-time-picker/date-time-picker.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/date-time-picker/date-time-picker.test.js +241 -0
- package/dist/src/ui/components/data-entry/date-time-picker/date-time-picker.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/date-time-picker/use-date-time-picker.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/date-time-picker/utils.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/date-time-picker/utils.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/date-time-picker/utils.test.js +38 -0
- package/dist/src/ui/components/data-entry/date-time-picker/utils.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/email-input/email-input.stories.d.ts +17 -0
- package/dist/src/ui/components/data-entry/email-input/email-input.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/email-input/email-input.stories.js +80 -0
- package/dist/src/ui/components/data-entry/email-input/email-input.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/email-input/index.js +1 -0
- package/dist/src/ui/components/data-entry/email-input/index.js.map +1 -1
- package/dist/src/ui/components/data-entry/file-input/examples/file-upload-item-example.stories.d.ts +31 -0
- package/dist/src/ui/components/data-entry/file-input/examples/file-upload-item-example.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/examples/file-upload-item-example.stories.js +193 -0
- package/dist/src/ui/components/data-entry/file-input/examples/file-upload-item-example.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/file-input.stories.d.ts +16 -0
- package/dist/src/ui/components/data-entry/file-input/file-input.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/file-input.stories.js +199 -0
- package/dist/src/ui/components/data-entry/file-input/file-input.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/file-input.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/file-input/file-input.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/file-input.test.js +114 -0
- package/dist/src/ui/components/data-entry/file-input/file-input.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/file-input/index.js +1 -0
- package/dist/src/ui/components/data-entry/file-input/index.js.map +1 -1
- package/dist/src/ui/components/data-entry/file-input/sub-components/loading-bar.d.ts +1 -0
- package/dist/src/ui/components/data-entry/file-input/sub-components/loading-bar.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/file-input/sub-components/loading-bar.js.map +1 -1
- package/dist/src/ui/components/data-entry/input/input.stories.d.ts +41 -0
- package/dist/src/ui/components/data-entry/input/input.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/input/input.stories.js +70 -0
- package/dist/src/ui/components/data-entry/input/input.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/input/input.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/input/input.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/input/input.test.js +46 -0
- package/dist/src/ui/components/data-entry/input/input.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/input/splitted-input-diff.d.ts +1 -0
- package/dist/src/ui/components/data-entry/input/splitted-input-diff.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/input/splitted-input-diff.js.map +1 -1
- package/dist/src/ui/components/data-entry/input/subcomponent/text-diff.d.ts +1 -0
- package/dist/src/ui/components/data-entry/input/subcomponent/text-diff.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/input/subcomponent/text-diff.js.map +1 -1
- package/dist/src/ui/components/data-entry/number-input/number-input.stories.d.ts +173 -0
- package/dist/src/ui/components/data-entry/number-input/number-input.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/number-input/number-input.stories.js +249 -0
- package/dist/src/ui/components/data-entry/number-input/number-input.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/number-input/number-input.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/number-input/number-input.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/number-input/number-input.test.js +234 -0
- package/dist/src/ui/components/data-entry/number-input/number-input.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/number-input/use-number-input.d.ts +1 -1
- package/dist/src/ui/components/data-entry/oid-input/oid-input.stories.d.ts +72 -0
- package/dist/src/ui/components/data-entry/oid-input/oid-input.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/oid-input/oid-input.stories.js +457 -0
- package/dist/src/ui/components/data-entry/oid-input/oid-input.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/oid-input/oid-input.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/oid-input/oid-input.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/oid-input/oid-input.test.js +176 -0
- package/dist/src/ui/components/data-entry/oid-input/oid-input.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/password-input/password-input.stories.d.ts +21 -0
- package/dist/src/ui/components/data-entry/password-input/password-input.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/password-input/password-input.stories.js +101 -0
- package/dist/src/ui/components/data-entry/password-input/password-input.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/password-input/password-input.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/password-input/password-input.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/password-input/password-input.test.js +92 -0
- package/dist/src/ui/components/data-entry/password-input/password-input.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/phid-input/phid-input.stories.d.ts +72 -0
- package/dist/src/ui/components/data-entry/phid-input/phid-input.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/phid-input/phid-input.stories.js +486 -0
- package/dist/src/ui/components/data-entry/phid-input/phid-input.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/phid-input/phid-input.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/phid-input/phid-input.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/phid-input/phid-input.test.js +179 -0
- package/dist/src/ui/components/data-entry/phid-input/phid-input.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/phone-number-input/phone-number-input.stories.d.ts +21 -0
- package/dist/src/ui/components/data-entry/phone-number-input/phone-number-input.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/phone-number-input/phone-number-input.stories.js +122 -0
- package/dist/src/ui/components/data-entry/phone-number-input/phone-number-input.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/phone-number-input/phone-number-input.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/phone-number-input/phone-number-input.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/phone-number-input/phone-number-input.test.js +190 -0
- package/dist/src/ui/components/data-entry/phone-number-input/phone-number-input.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/phone-number-input/use-phone-number-input.d.ts +1 -1
- package/dist/src/ui/components/data-entry/phone-number-input/use-phone-number-input.js +1 -1
- package/dist/src/ui/components/data-entry/phone-number-input/use-phone-number-input.js.map +1 -1
- package/dist/src/ui/components/data-entry/radio-group/customizable-radio-group.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/radio-group/customizable-radio-group.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/radio-group/customizable-radio-group.test.js +76 -0
- package/dist/src/ui/components/data-entry/radio-group/customizable-radio-group.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/radio-group/radio-group.stories.d.ts +86 -0
- package/dist/src/ui/components/data-entry/radio-group/radio-group.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/radio-group/radio-group.stories.js +250 -0
- package/dist/src/ui/components/data-entry/radio-group/radio-group.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/radio-group/radio-group.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/radio-group/radio-group.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/radio-group/radio-group.test.js +136 -0
- package/dist/src/ui/components/data-entry/radio-group/radio-group.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/radio-group/radio.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/radio-group/radio.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/radio-group/radio.test.js +63 -0
- package/dist/src/ui/components/data-entry/radio-group/radio.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/select/content.d.ts +1 -1
- package/dist/src/ui/components/data-entry/select/content.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/select/select-diff.d.ts +1 -0
- package/dist/src/ui/components/data-entry/select/select-diff.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/select/select-diff.js.map +1 -1
- package/dist/src/ui/components/data-entry/select/select.stories.d.ts +75 -0
- package/dist/src/ui/components/data-entry/select/select.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/select/select.stories.js +439 -0
- package/dist/src/ui/components/data-entry/select/select.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/select/select.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/select/select.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/select/select.test.js +218 -0
- package/dist/src/ui/components/data-entry/select/select.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/select/use-select.d.ts +1 -1
- package/dist/src/ui/components/data-entry/select/use-select.js.map +1 -1
- package/dist/src/ui/components/data-entry/text-input/index.js +1 -0
- package/dist/src/ui/components/data-entry/text-input/index.js.map +1 -1
- package/dist/src/ui/components/data-entry/text-input/text-input.js +1 -1
- package/dist/src/ui/components/data-entry/text-input/text-input.js.map +1 -1
- package/dist/src/ui/components/data-entry/text-input/text-input.stories.d.ts +171 -0
- package/dist/src/ui/components/data-entry/text-input/text-input.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/text-input/text-input.stories.js +133 -0
- package/dist/src/ui/components/data-entry/text-input/text-input.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/textarea/textarea.d.ts +2 -3
- package/dist/src/ui/components/data-entry/textarea/textarea.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/textarea/textarea.js +10 -10
- package/dist/src/ui/components/data-entry/textarea/textarea.js.map +1 -1
- package/dist/src/ui/components/data-entry/textarea/textarea.stories.d.ts +177 -0
- package/dist/src/ui/components/data-entry/textarea/textarea.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/textarea/textarea.stories.js +167 -0
- package/dist/src/ui/components/data-entry/textarea/textarea.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/time-picker/index.js +1 -0
- package/dist/src/ui/components/data-entry/time-picker/index.js.map +1 -1
- package/dist/src/ui/components/data-entry/time-picker/subcomponents/time-selector.js +2 -2
- package/dist/src/ui/components/data-entry/time-picker/subcomponents/time-selector.js.map +1 -1
- package/dist/src/ui/components/data-entry/time-picker/subcomponents/use-time-selector.d.ts +2 -2
- package/dist/src/ui/components/data-entry/time-picker/subcomponents/use-time-selector.d.ts.map +1 -1
- package/dist/src/ui/components/data-entry/time-picker/time-picker.stories.d.ts +66 -0
- package/dist/src/ui/components/data-entry/time-picker/time-picker.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/time-picker/time-picker.stories.js +228 -0
- package/dist/src/ui/components/data-entry/time-picker/time-picker.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/time-picker/time-picker.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/time-picker/time-picker.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/time-picker/time-picker.test.js +235 -0
- package/dist/src/ui/components/data-entry/time-picker/time-picker.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/time-picker/utils.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/time-picker/utils.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/time-picker/utils.test.js +149 -0
- package/dist/src/ui/components/data-entry/time-picker/utils.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/toggle/toggle-base.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/toggle/toggle-base.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/toggle/toggle-base.test.js +98 -0
- package/dist/src/ui/components/data-entry/toggle/toggle-base.test.js.map +1 -0
- package/dist/src/ui/components/data-entry/toggle/toggle.stories.d.ts +68 -0
- package/dist/src/ui/components/data-entry/toggle/toggle.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/toggle/toggle.stories.js +131 -0
- package/dist/src/ui/components/data-entry/toggle/toggle.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/url-input/url-input.stories.d.ts +34 -0
- package/dist/src/ui/components/data-entry/url-input/url-input.stories.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/url-input/url-input.stories.js +156 -0
- package/dist/src/ui/components/data-entry/url-input/url-input.stories.js.map +1 -0
- package/dist/src/ui/components/data-entry/url-input/url-input.test.d.ts +2 -0
- package/dist/src/ui/components/data-entry/url-input/url-input.test.d.ts.map +1 -0
- package/dist/src/ui/components/data-entry/url-input/url-input.test.js +72 -0
- package/dist/src/ui/components/data-entry/url-input/url-input.test.js.map +1 -0
- package/dist/src/ui/components/dropdown/dropdown.stories.d.ts +169 -0
- package/dist/src/ui/components/dropdown/dropdown.stories.d.ts.map +1 -0
- package/dist/src/ui/components/dropdown/dropdown.stories.js +194 -0
- package/dist/src/ui/components/dropdown/dropdown.stories.js.map +1 -0
- package/dist/src/ui/components/icon/icon.stories.d.ts +16 -0
- package/dist/src/ui/components/icon/icon.stories.d.ts.map +1 -0
- package/dist/src/ui/components/icon/icon.stories.js +37 -0
- package/dist/src/ui/components/icon/icon.stories.js.map +1 -0
- package/dist/src/ui/components/icon/index.js +1 -0
- package/dist/src/ui/components/icon/index.js.map +1 -1
- package/dist/src/ui/components/sidebar/sidebar.stories.d.ts +147 -0
- package/dist/src/ui/components/sidebar/sidebar.stories.d.ts.map +1 -0
- package/dist/src/ui/components/sidebar/sidebar.stories.js +420 -0
- package/dist/src/ui/components/sidebar/sidebar.stories.js.map +1 -0
- package/dist/src/ui/components/sidebar/sidebar.test.d.ts +2 -0
- package/dist/src/ui/components/sidebar/sidebar.test.d.ts.map +1 -0
- package/dist/src/ui/components/sidebar/sidebar.test.js +357 -0
- package/dist/src/ui/components/sidebar/sidebar.test.js.map +1 -0
- package/dist/src/ui/components/sidebar/subcomponents/sidebar-item.d.ts.map +1 -1
- package/dist/src/ui/components/sidebar/subcomponents/sidebar-item.js +3 -1
- package/dist/src/ui/components/sidebar/subcomponents/sidebar-item.js.map +1 -1
- package/dist/src/ui/components/sidebar/subcomponents/sidebar-provider/sidebar-provider.d.ts +1 -1
- package/dist/src/ui/components/sidebar/subcomponents/sidebar-provider/sidebar-provider.d.ts.map +1 -1
- package/dist/src/ui/components/sidebar/subcomponents/status-icon.d.ts +1 -1
- package/dist/src/ui/components/sidebar/subcomponents/status-icon.d.ts.map +1 -1
- package/dist/src/ui/components/sidebar/use-sidebar-resize.d.ts +1 -1
- package/dist/src/ui/components/tooltip/tooltip.stories.d.ts +11 -0
- package/dist/src/ui/components/tooltip/tooltip.stories.d.ts.map +1 -0
- package/dist/src/ui/components/tooltip/tooltip.stories.js +87 -0
- package/dist/src/ui/components/tooltip/tooltip.stories.js.map +1 -0
- package/dist/src/ui/components/tooltip/tooltip.test.d.ts +2 -0
- package/dist/src/ui/components/tooltip/tooltip.test.d.ts.map +1 -0
- package/dist/src/ui/components/tooltip/tooltip.test.js +60 -0
- package/dist/src/ui/components/tooltip/tooltip.test.js.map +1 -0
- package/dist/style.css +15 -13
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/vitest.config.d.ts +3 -0
- package/dist/vitest.config.d.ts.map +1 -0
- package/dist/vitest.config.js +16 -0
- package/dist/vitest.config.js.map +1 -0
- package/package.json +90 -88
- package/dist/scripts/create-icon-components.d.ts +0 -2
- package/dist/scripts/create-icon-components.d.ts.map +0 -1
- package/dist/scripts/create-icon-components.js +0 -91
- package/dist/scripts/create-icon-components.js.map +0 -1
- package/dist/tsconfig.lib.tsbuildinfo +0 -1
package/dist/src/scalars/components/fragments/with-field-validation/with-field-validation.test.js
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { act, render, screen } from '@testing-library/react';
|
|
3
|
+
import { userEvent } from '@testing-library/user-event';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
6
|
+
import { Input } from '../../../../ui/components/index.js';
|
|
7
|
+
import { renderWithForm } from '../../../lib/testing.js';
|
|
8
|
+
import { Form } from '../../form/index.js';
|
|
9
|
+
import { FormGroup } from '../form-group/index.js';
|
|
10
|
+
import { FormLabel } from '../form-label/index.js';
|
|
11
|
+
import { FormMessageList } from '../form-message/index.js';
|
|
12
|
+
import { withFieldValidation } from './with-field-validation.js';
|
|
13
|
+
// Test component that will be wrapped
|
|
14
|
+
const TextFieldTesting = React.forwardRef(({ label, value, defaultValue, onChange, errors, pattern, ...props }, ref) => {
|
|
15
|
+
return (_jsxs(FormGroup, { children: [label && (_jsx(FormLabel, { htmlFor: "test", required: props.required, disabled: props.disabled, hasError: !!errors?.length, children: label })), _jsx(Input, { id: "test", "data-testid": "test-input", value: value, defaultValue: defaultValue, onChange: onChange, pattern: pattern?.toString(), ref: ref, ...props }), errors && _jsx(FormMessageList, { "data-testid": "error-message", messages: errors, type: "error" })] }));
|
|
16
|
+
});
|
|
17
|
+
TextFieldTesting.displayName = 'TextFieldTesting';
|
|
18
|
+
const WrappedComponent = withFieldValidation(TextFieldTesting);
|
|
19
|
+
describe('withFieldValidation', () => {
|
|
20
|
+
it('should render the wrapped component', () => {
|
|
21
|
+
renderWithForm(_jsx(WrappedComponent, { name: "test" }));
|
|
22
|
+
expect(screen.getByTestId('test-input')).toBeInTheDocument();
|
|
23
|
+
});
|
|
24
|
+
it('should handle required validation', async () => {
|
|
25
|
+
renderWithForm(_jsx(WrappedComponent, { name: "test", required: true }));
|
|
26
|
+
const input = screen.getByTestId('test-input');
|
|
27
|
+
await userEvent.click(input);
|
|
28
|
+
await userEvent.keyboard('{Enter}'); // submit the form should fail
|
|
29
|
+
expect(await screen.findByTestId('error-message')).toBeInTheDocument();
|
|
30
|
+
});
|
|
31
|
+
it('should handle pattern validation', async () => {
|
|
32
|
+
renderWithForm(_jsx(WrappedComponent, { name: "test", pattern: /^[A-Z]+$/ }));
|
|
33
|
+
const input = screen.getByTestId('test-input');
|
|
34
|
+
await userEvent.type(input, 'abc');
|
|
35
|
+
await userEvent.keyboard('{Enter}');
|
|
36
|
+
expect(await screen.findByTestId('error-message')).toBeInTheDocument();
|
|
37
|
+
});
|
|
38
|
+
it('should handle minLength validation', async () => {
|
|
39
|
+
renderWithForm(_jsx(WrappedComponent, { name: "test", minLength: 3 }));
|
|
40
|
+
const input = screen.getByTestId('test-input');
|
|
41
|
+
await userEvent.type(input, '12');
|
|
42
|
+
await userEvent.keyboard('{Enter}');
|
|
43
|
+
expect(await screen.findByTestId('error-message')).toBeInTheDocument();
|
|
44
|
+
});
|
|
45
|
+
it('should handle extra component validators', async () => {
|
|
46
|
+
const validator = (value) => {
|
|
47
|
+
return value === 'valid' || 'Custom error message';
|
|
48
|
+
};
|
|
49
|
+
renderWithForm(_jsx(WrappedComponent, { name: "test", validators: validator }));
|
|
50
|
+
const input = screen.getByTestId('test-input');
|
|
51
|
+
await userEvent.type(input, 'invalid');
|
|
52
|
+
await userEvent.keyboard('{Enter}');
|
|
53
|
+
expect(await screen.findByTestId('error-message')).toBeInTheDocument();
|
|
54
|
+
});
|
|
55
|
+
it('should handle multiple extra component validators', async () => {
|
|
56
|
+
const validator1 = vi.fn().mockReturnValue(true);
|
|
57
|
+
const validator2 = vi.fn().mockReturnValue(true);
|
|
58
|
+
renderWithForm(_jsx(WrappedComponent, { name: "test", validators: [validator1, validator2] }));
|
|
59
|
+
const input = screen.getByTestId('test-input');
|
|
60
|
+
await userEvent.type(input, 'test');
|
|
61
|
+
await userEvent.keyboard('{Enter}');
|
|
62
|
+
expect(validator1).toHaveBeenCalledTimes(1);
|
|
63
|
+
expect(validator2).toHaveBeenCalledTimes(1);
|
|
64
|
+
});
|
|
65
|
+
it('should handle multiple validation rules', async () => {
|
|
66
|
+
renderWithForm(_jsx(WrappedComponent, { name: "test", required: true, minLength: 5 }));
|
|
67
|
+
const input = screen.getByTestId('test-input');
|
|
68
|
+
await userEvent.type(input, '1234');
|
|
69
|
+
await userEvent.keyboard('{Enter}');
|
|
70
|
+
expect(await screen.findByTestId('error-message')).toBeInTheDocument();
|
|
71
|
+
});
|
|
72
|
+
it('should pass through custom error messages', async () => {
|
|
73
|
+
await act(() => renderWithForm(_jsx(WrappedComponent, { name: "test", errors: ['Custom error'] })));
|
|
74
|
+
expect(screen.getByTestId('error-message')).toHaveTextContent('Custom error');
|
|
75
|
+
});
|
|
76
|
+
it('should handle form submission with default values', async () => {
|
|
77
|
+
const handleSubmit = vi.fn();
|
|
78
|
+
render(_jsxs(Form, { onSubmit: handleSubmit, defaultValues: { test: 'default' }, children: [_jsx(WrappedComponent, { name: "test" }), _jsx("button", { type: "submit", children: "Submit" })] }));
|
|
79
|
+
const submitButton = screen.getByRole('button', { name: 'Submit' });
|
|
80
|
+
await userEvent.click(submitButton);
|
|
81
|
+
expect(handleSubmit).toHaveBeenCalledWith({ test: 'default' });
|
|
82
|
+
});
|
|
83
|
+
it('should not submit values if the form has errors', async () => {
|
|
84
|
+
const handleSubmit = vi.fn();
|
|
85
|
+
render(_jsxs(Form, { onSubmit: handleSubmit, children: [_jsx(WrappedComponent, { name: "test", value: "", onChange: () => undefined, required: true }), _jsx("button", { type: "submit", children: "Submit" })] }));
|
|
86
|
+
const submitButton = screen.getByRole('button', { name: 'Submit' });
|
|
87
|
+
await userEvent.click(submitButton);
|
|
88
|
+
expect(handleSubmit).not.toHaveBeenCalled();
|
|
89
|
+
expect(await screen.findByTestId('error-message')).toBeInTheDocument();
|
|
90
|
+
});
|
|
91
|
+
it('should validate custom validators', async () => {
|
|
92
|
+
const WrappedComponentWithValidator = withFieldValidation(TextFieldTesting, {
|
|
93
|
+
validations: {
|
|
94
|
+
_isPrime: () => ((value) => {
|
|
95
|
+
return Number(value) % 2 === 0 || 'Custom error message';
|
|
96
|
+
}),
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
renderWithForm(_jsx(WrappedComponentWithValidator, { name: "test" }));
|
|
100
|
+
const input = screen.getByTestId('test-input');
|
|
101
|
+
await userEvent.type(input, '3');
|
|
102
|
+
await userEvent.keyboard('{Enter}');
|
|
103
|
+
expect(await screen.findByTestId('error-message')).toBeInTheDocument();
|
|
104
|
+
});
|
|
105
|
+
it('should validate custom validators using parent props', async () => {
|
|
106
|
+
const WrappedComponentWithValidator = withFieldValidation(TextFieldTesting, {
|
|
107
|
+
validations: {
|
|
108
|
+
_autoCompleteRequireLength3: (props) => ((value) => {
|
|
109
|
+
return props.autoComplete ? (value.length > 3 ? true : 'Error') : true;
|
|
110
|
+
}),
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
renderWithForm(_jsx(WrappedComponentWithValidator, { name: "test", autoComplete: true }));
|
|
114
|
+
const input = screen.getByTestId('test-input');
|
|
115
|
+
await userEvent.type(input, '12');
|
|
116
|
+
await userEvent.keyboard('{Enter}');
|
|
117
|
+
expect(await screen.findByTestId('error-message')).toBeInTheDocument();
|
|
118
|
+
});
|
|
119
|
+
it('should revalidate on change after a submission with errors', async () => {
|
|
120
|
+
renderWithForm(_jsx(WrappedComponent, { name: "test", required: true }));
|
|
121
|
+
const input = screen.getByTestId('test-input');
|
|
122
|
+
// submit with empty value should fail as the field is required
|
|
123
|
+
await userEvent.type(input, '{Enter}');
|
|
124
|
+
expect(await screen.findByTestId('error-message')).toBeInTheDocument();
|
|
125
|
+
// change the value to trigger revalidation
|
|
126
|
+
await userEvent.type(input, '123');
|
|
127
|
+
expect(screen.queryByTestId('error-message')).toBeNull();
|
|
128
|
+
});
|
|
129
|
+
it('should forward refs to the wrapped component', () => {
|
|
130
|
+
const inputRef = React.createRef();
|
|
131
|
+
renderWithForm(_jsx(WrappedComponent, { name: "test", ref: inputRef }));
|
|
132
|
+
const input = screen.getByTestId('test-input');
|
|
133
|
+
// initially, the input should not have focus
|
|
134
|
+
expect(input).not.toHaveFocus();
|
|
135
|
+
// directly focus the input using the ref
|
|
136
|
+
inputRef.current?.focus();
|
|
137
|
+
// the input should now have focus
|
|
138
|
+
expect(input).toHaveFocus();
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
//# sourceMappingURL=with-field-validation.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-field-validation.test.js","sourceRoot":"","sources":["../../../../../../src/scalars/components/fragments/with-field-validation/with-field-validation.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AACvD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AACjD,OA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C,6CAA6C;QAC7C,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,CAAA;QAE/B,yCAAyC;QACzC,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,CAAA;QAEzB,kCAAkC;QAClC,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAA;IAC7B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { IdField } from './id-field.js';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: import("react").FC<import("./id-field.js").IdFieldProps>;
|
|
6
|
+
decorators: import("@storybook/react").Decorator[];
|
|
7
|
+
tags: string[];
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
};
|
|
11
|
+
argTypes: {
|
|
12
|
+
name: {
|
|
13
|
+
control: false;
|
|
14
|
+
description: string;
|
|
15
|
+
table: {
|
|
16
|
+
type: {
|
|
17
|
+
summary: string;
|
|
18
|
+
};
|
|
19
|
+
defaultValue: {
|
|
20
|
+
summary: string;
|
|
21
|
+
};
|
|
22
|
+
category: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
value: {
|
|
26
|
+
control: false;
|
|
27
|
+
description: string;
|
|
28
|
+
table: {
|
|
29
|
+
type: {
|
|
30
|
+
summary: string;
|
|
31
|
+
};
|
|
32
|
+
defaultValue: {
|
|
33
|
+
summary: string;
|
|
34
|
+
};
|
|
35
|
+
category: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
generator: {
|
|
39
|
+
control: false;
|
|
40
|
+
description: string;
|
|
41
|
+
table: {
|
|
42
|
+
type: {
|
|
43
|
+
summary: string;
|
|
44
|
+
};
|
|
45
|
+
defaultValue: {
|
|
46
|
+
summary: string;
|
|
47
|
+
};
|
|
48
|
+
category: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export default meta;
|
|
54
|
+
type Story = StoryObj<typeof IdField>;
|
|
55
|
+
export declare const Default: Story;
|
|
56
|
+
export declare const CustomGenerator: Story;
|
|
57
|
+
export declare const CustomIdValue: Story;
|
|
58
|
+
//# sourceMappingURL=id-field.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id-field.stories.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/id-field/id-field.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCsB,CAAA;AAEhC,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,OAAO,CAAC,CAAA;AAErC,eAAO,MAAM,OAAO,EAAE,KAmBrB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAmB7B,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAmB3B,CAAA"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { withForm } from '../../lib/decorators.js';
|
|
3
|
+
import { IdField } from './id-field.js';
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Scalars/Id Field',
|
|
6
|
+
component: IdField,
|
|
7
|
+
decorators: [withForm],
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
name: {
|
|
14
|
+
control: false,
|
|
15
|
+
description: 'Name of the field in the form data',
|
|
16
|
+
table: {
|
|
17
|
+
type: { summary: 'string' },
|
|
18
|
+
defaultValue: { summary: 'id' },
|
|
19
|
+
category: 'Default',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
value: {
|
|
23
|
+
control: false,
|
|
24
|
+
description: 'A predefined value for the ID field. If provided, this value will be used instead of generating a new ID.',
|
|
25
|
+
table: {
|
|
26
|
+
type: { summary: 'string' },
|
|
27
|
+
defaultValue: { summary: 'auto-generated' },
|
|
28
|
+
category: 'Default',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
generator: {
|
|
32
|
+
control: false,
|
|
33
|
+
description: 'Generator function or built-in generator to generate the ID.',
|
|
34
|
+
table: {
|
|
35
|
+
type: { summary: 'UUID | (() => string)' },
|
|
36
|
+
defaultValue: { summary: 'UUID' },
|
|
37
|
+
category: 'Default',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
export default meta;
|
|
43
|
+
export const Default = {
|
|
44
|
+
render: () => (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("div", { className: "text-sm text-gray-500", children: [_jsx("p", { children: "This form contains a hidden IdField that will generate a UUID." }), _jsx("p", { children: "Submit the form to see the generated ID in the alert." })] }), _jsx(IdField, {}), _jsx("button", { type: "submit", children: "Submit to see ID" })] })),
|
|
45
|
+
parameters: {
|
|
46
|
+
docs: {
|
|
47
|
+
source: {
|
|
48
|
+
code: '<IdField />',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
export const CustomGenerator = {
|
|
54
|
+
render: () => (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("div", { className: "text-sm text-gray-500", children: [_jsx("p", { children: "This form contains a hidden IdField with a custom ID generator." }), _jsx("p", { children: "Submit the form to see the generated ID in the alert." })] }), _jsx(IdField, { generator: () => `custom-${Date.now()}` }), _jsx("button", { type: "submit", children: "Submit to see ID" })] })),
|
|
55
|
+
parameters: {
|
|
56
|
+
docs: {
|
|
57
|
+
source: {
|
|
58
|
+
code: '<IdField generator={() => `custom-${Date.now()}`} />',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
export const CustomIdValue = {
|
|
64
|
+
render: () => (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("div", { className: "text-sm text-gray-500", children: [_jsx("p", { children: "This form contains a hidden IdField with the id: \"custom-id\"." }), _jsx("p", { children: "Submit the form to see the ID in the alert." })] }), _jsx(IdField, { value: "custom-id" }), _jsx("button", { type: "submit", children: "Submit to see ID" })] })),
|
|
65
|
+
parameters: {
|
|
66
|
+
docs: {
|
|
67
|
+
source: {
|
|
68
|
+
code: '<IdField value="custom-id" />',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=id-field.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id-field.stories.js","sourceRoot":"","sources":["../../../../../src/scalars/components/id-field/id-field.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,OAAO;IAClB,UAAU,EAAE,CAAC,QAAQ,CAAC;IACtB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;KACnB;IACD,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE,KAAK;YACd,WAAW,EAAE,oCAAoC;YACjD,KAAK,EAAE;gBACL,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;gBAC3B,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;gBAC/B,QAAQ,EAAE,SAAS;aACpB;SACF;QACD,KAAK,EAAE;YACL,OAAO,EAAE,KAAK;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AED,MAAM,CAAC,MAAM,aAAa,GAAU;IAClC,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,eAAK,SAAS,EAAC,qBAAqB,aAClC,eAAK,SAAS,EAAC,uBAAuB,aACpC,0FAA8E,EAC9E,sEAAkD,IAC9C,EAEN,KAAC,OAAO,IAAC,KAAK,EAAC,WAAW,GAAG,EAC7B,iBAAQ,IAAI,EAAC,QAAQ,iCAA0B,IAC3C,CACP;IACD,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,+BAA+B;aACtC;SACF;KACF;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id-field.test.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/id-field/id-field.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Form } from '../form/form.js';
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import { userEvent } from '@testing-library/user-event';
|
|
5
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
6
|
+
import { IdField } from './id-field.js';
|
|
7
|
+
describe('IdField', () => {
|
|
8
|
+
it('should render a hidden input field', () => {
|
|
9
|
+
render(_jsx(Form, { onSubmit: () => undefined, children: _jsx(IdField, { "data-testid": "id-field" }) }));
|
|
10
|
+
const input = screen.getByTestId('id-field');
|
|
11
|
+
expect(input).toHaveAttribute('type', 'hidden');
|
|
12
|
+
expect(input).toHaveAttribute('value');
|
|
13
|
+
});
|
|
14
|
+
it("should use default name 'id' when no name prop provided", () => {
|
|
15
|
+
render(_jsx(Form, { onSubmit: () => undefined, children: _jsx(IdField, { "data-testid": "id-field" }) }));
|
|
16
|
+
const input = screen.getByTestId('id-field');
|
|
17
|
+
expect(input).toHaveAttribute('name', 'id');
|
|
18
|
+
});
|
|
19
|
+
it('should use custom name when name prop provided', () => {
|
|
20
|
+
render(_jsx(Form, { onSubmit: () => undefined, children: _jsx(IdField, { name: "customId", "data-testid": "id-field" }) }));
|
|
21
|
+
const input = screen.getByTestId('id-field');
|
|
22
|
+
expect(input).toHaveAttribute('name', 'customId');
|
|
23
|
+
});
|
|
24
|
+
it('should use provided value when value prop is set', () => {
|
|
25
|
+
render(_jsx(Form, { onSubmit: () => undefined, children: _jsx(IdField, { value: "static-id", "data-testid": "id-field" }) }));
|
|
26
|
+
const input = screen.getByTestId('id-field');
|
|
27
|
+
expect(input).toHaveValue('static-id');
|
|
28
|
+
});
|
|
29
|
+
it('should use nanoid generator by default', () => {
|
|
30
|
+
vi.mock('nanoid', () => ({
|
|
31
|
+
nanoid: () => 'aaa',
|
|
32
|
+
}));
|
|
33
|
+
render(_jsx(Form, { onSubmit: () => undefined, children: _jsx(IdField, { "data-testid": "id-field" }) }));
|
|
34
|
+
const input = screen.getByTestId('id-field');
|
|
35
|
+
expect(input).toHaveValue('aaa');
|
|
36
|
+
});
|
|
37
|
+
it('should use custom generator function when provided', () => {
|
|
38
|
+
const customGenerator = () => 'custom-generated-id';
|
|
39
|
+
render(_jsx(Form, { onSubmit: () => undefined, children: _jsx(IdField, { generator: customGenerator, "data-testid": "id-field" }) }));
|
|
40
|
+
const input = screen.getByTestId('id-field');
|
|
41
|
+
expect(input).toHaveValue('custom-generated-id');
|
|
42
|
+
});
|
|
43
|
+
it('should generate new ID on form submission', async () => {
|
|
44
|
+
const user = userEvent.setup();
|
|
45
|
+
const mockUUID1 = '00000000-0000-0000-0000-000000000000';
|
|
46
|
+
const mockUUID2 = '00000000-0000-0000-0000-000000000001';
|
|
47
|
+
const mockRandomUUID = vi.spyOn(crypto, 'randomUUID').mockReturnValueOnce(mockUUID1).mockReturnValueOnce(mockUUID2);
|
|
48
|
+
const handleSubmit = vi.fn();
|
|
49
|
+
render(_jsxs(Form, { onSubmit: handleSubmit, children: [_jsx(IdField, { "data-testid": "id-field", generator: "uuid" }), _jsx("button", { type: "submit", children: "Submit" })] }));
|
|
50
|
+
const input = screen.getByTestId('id-field');
|
|
51
|
+
expect(input).toHaveValue(mockUUID1);
|
|
52
|
+
await user.click(screen.getByRole('button'));
|
|
53
|
+
expect(handleSubmit).toHaveBeenCalled();
|
|
54
|
+
expect(input).toHaveValue(mockUUID2);
|
|
55
|
+
expect(mockRandomUUID).toHaveBeenCalledTimes(2);
|
|
56
|
+
});
|
|
57
|
+
it('should not generate new ID on submission when value prop is provided', async () => {
|
|
58
|
+
const user = userEvent.setup();
|
|
59
|
+
const handleSubmit = vi.fn();
|
|
60
|
+
render(_jsxs(Form, { onSubmit: handleSubmit, children: [_jsx(IdField, { value: "static-id", "data-testid": "id-field" }), _jsx("button", { type: "submit", children: "Submit" })] }));
|
|
61
|
+
const input = screen.getByTestId('id-field');
|
|
62
|
+
expect(input).toHaveValue('static-id');
|
|
63
|
+
await user.click(screen.getByRole('button'));
|
|
64
|
+
expect(handleSubmit).toHaveBeenCalled();
|
|
65
|
+
expect(input).toHaveValue('static-id');
|
|
66
|
+
});
|
|
67
|
+
it('should call custom generator on each submission', async () => {
|
|
68
|
+
const user = userEvent.setup();
|
|
69
|
+
const customGenerator = vi.fn().mockReturnValueOnce('custom-id-1').mockReturnValueOnce('custom-id-2');
|
|
70
|
+
const handleSubmit = vi.fn();
|
|
71
|
+
render(_jsxs(Form, { onSubmit: handleSubmit, children: [_jsx(IdField, { generator: customGenerator, "data-testid": "id-field" }), _jsx("button", { type: "submit", children: "Submit" })] }));
|
|
72
|
+
const input = screen.getByTestId('id-field');
|
|
73
|
+
expect(input).toHaveValue('custom-id-1');
|
|
74
|
+
await user.click(screen.getByRole('button'));
|
|
75
|
+
expect(handleSubmit).toHaveBeenCalled();
|
|
76
|
+
expect(input).toHaveValue('custom-id-2');
|
|
77
|
+
expect(customGenerator).toHaveBeenCalledTimes(2);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=id-field.test.js.map
|
|
@@ -0,0 +1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AAC,QAAQ,uBAAgB,IAChC,CACR,CAAA;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;QAC5C,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,CAAA;QAExC,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAA;QAE5C,MAAM,CAAC,YAAY,CAAC,CAAC,gBAAgB,EAAE,CAAA;QACvC,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,CAAA;QACxC,MAAM,CAAC,eAAe,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;IAClD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { NumberFieldProps } from './types.js';
|
|
2
2
|
declare const NumberField: import("react").ForwardRefExoticComponent<NumberFieldProps & import("react").RefAttributes<unknown>>;
|
|
3
|
-
export { NumberField
|
|
3
|
+
export { NumberField };
|
|
4
|
+
export type { NumberFieldProps };
|
|
4
5
|
//# sourceMappingURL=number-field.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number-field.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/number-field/number-field.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,QAAA,MAAM,WAAW,sGAIf,CAAA;AAGF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAA"}
|
|
1
|
+
{"version":3,"file":"number-field.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/number-field/number-field.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,QAAA,MAAM,WAAW,sGAIf,CAAA;AAGF,OAAO,EAAE,WAAW,EAAE,CAAA;AACtB,YAAY,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number-field.js","sourceRoot":"","sources":["../../../../../src/scalars/components/number-field/number-field.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,gEAAgE,CAAA;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,6DAA6D,CAAA;AAGjG,MAAM,WAAW,GAAG,mBAAmB,CAAmB,WAAW,EAAE;IACrE,WAAW,EAAE;QACX,YAAY,EAAE,mBAAmB;KAClC;CACF,CAAC,CAAA;AAEF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAA;AACvC,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"number-field.js","sourceRoot":"","sources":["../../../../../src/scalars/components/number-field/number-field.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,gEAAgE,CAAA;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,6DAA6D,CAAA;AAGjG,MAAM,WAAW,GAAG,mBAAmB,CAAmB,WAAW,EAAE;IACrE,WAAW,EAAE;QACX,YAAY,EAAE,mBAAmB;KAClC;CACF,CAAC,CAAA;AAEF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { StorybookControlCategory } from '../../lib/storybook-arg-types.js';
|
|
3
|
+
import { NumberField } from './number-field.js';
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: import("react").ForwardRefExoticComponent<import("./types.js").NumberFieldProps & import("react").RefAttributes<unknown>>;
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
decorators: import("@storybook/react").Decorator[];
|
|
11
|
+
tags: string[];
|
|
12
|
+
argTypes: {
|
|
13
|
+
baseValue: {
|
|
14
|
+
control: "text";
|
|
15
|
+
description: string;
|
|
16
|
+
table: {
|
|
17
|
+
type: {
|
|
18
|
+
summary: string;
|
|
19
|
+
};
|
|
20
|
+
category: StorybookControlCategory;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
viewMode: {
|
|
24
|
+
control: "select";
|
|
25
|
+
description: string;
|
|
26
|
+
options: string[];
|
|
27
|
+
table: {
|
|
28
|
+
type: {
|
|
29
|
+
summary: string;
|
|
30
|
+
};
|
|
31
|
+
defaultValue: {
|
|
32
|
+
summary: string;
|
|
33
|
+
};
|
|
34
|
+
category: StorybookControlCategory;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
trailingZeros: {
|
|
38
|
+
control: "boolean";
|
|
39
|
+
description: string;
|
|
40
|
+
table: {
|
|
41
|
+
type: {
|
|
42
|
+
summary: string;
|
|
43
|
+
};
|
|
44
|
+
category: StorybookControlCategory;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
precision: {
|
|
48
|
+
control: "number";
|
|
49
|
+
description: string;
|
|
50
|
+
table: {
|
|
51
|
+
type: {
|
|
52
|
+
summary: string;
|
|
53
|
+
};
|
|
54
|
+
category: StorybookControlCategory;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
maxValue: {
|
|
58
|
+
control: "number";
|
|
59
|
+
description: string;
|
|
60
|
+
table: {
|
|
61
|
+
type: {
|
|
62
|
+
summary: string;
|
|
63
|
+
};
|
|
64
|
+
category: StorybookControlCategory;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
minValue: {
|
|
68
|
+
control: "number";
|
|
69
|
+
description: string;
|
|
70
|
+
table: {
|
|
71
|
+
type: {
|
|
72
|
+
summary: string;
|
|
73
|
+
};
|
|
74
|
+
category: StorybookControlCategory;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
placeholder: {
|
|
78
|
+
control: "text";
|
|
79
|
+
description: string;
|
|
80
|
+
table: {
|
|
81
|
+
type: {
|
|
82
|
+
summary: string;
|
|
83
|
+
};
|
|
84
|
+
category: StorybookControlCategory;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
step: {
|
|
88
|
+
control: "number";
|
|
89
|
+
description: string;
|
|
90
|
+
table: {
|
|
91
|
+
type: {
|
|
92
|
+
summary: string;
|
|
93
|
+
};
|
|
94
|
+
defaultValue: {
|
|
95
|
+
summary: string;
|
|
96
|
+
};
|
|
97
|
+
category: StorybookControlCategory;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
autoFocus: {
|
|
101
|
+
table: {
|
|
102
|
+
disable: true;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
numericType: {
|
|
106
|
+
control: {
|
|
107
|
+
type: "select";
|
|
108
|
+
};
|
|
109
|
+
options: string[];
|
|
110
|
+
description: string;
|
|
111
|
+
table: {
|
|
112
|
+
defaultValue: {
|
|
113
|
+
summary: string;
|
|
114
|
+
};
|
|
115
|
+
type: {
|
|
116
|
+
summary: string;
|
|
117
|
+
};
|
|
118
|
+
category: StorybookControlCategory;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
enableStepCarets: {
|
|
122
|
+
control: "boolean";
|
|
123
|
+
description: string;
|
|
124
|
+
table: {
|
|
125
|
+
type: {
|
|
126
|
+
summary: string;
|
|
127
|
+
};
|
|
128
|
+
defaultValue: {
|
|
129
|
+
summary: string;
|
|
130
|
+
};
|
|
131
|
+
category: StorybookControlCategory;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
args: {
|
|
136
|
+
name: string;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
export default meta;
|
|
140
|
+
type Story = StoryObj<typeof NumberField>;
|
|
141
|
+
export declare const Default: Story;
|
|
142
|
+
export declare const Active: Story;
|
|
143
|
+
export declare const Disable: Story;
|
|
144
|
+
export declare const Required: Story;
|
|
145
|
+
export declare const WithWarning: Story;
|
|
146
|
+
export declare const WithError: Story;
|
|
147
|
+
export declare const WithMultipleErrors: Story;
|
|
148
|
+
export declare const WithValue: Story;
|
|
149
|
+
export declare const WithDescription: Story;
|
|
150
|
+
export declare const WithFloatNumber: Story;
|
|
151
|
+
export declare const WithBigInt: Story;
|
|
152
|
+
export declare const WithStep: Story;
|
|
153
|
+
export declare const WithDifferencesAddition: Story;
|
|
154
|
+
export declare const WithDifferencesRemoval: Story;
|
|
155
|
+
export declare const WithDifferencesMixed: Story;
|
|
156
|
+
//# sourceMappingURL=number-field.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number-field.stories.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/number-field/number-field.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,EAIL,wBAAwB,EACzB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuF0B,CAAA;AAEpC,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAA;AAEzC,eAAO,MAAM,OAAO,EAAE,KAOrB,CAAA;AACD,eAAO,MAAM,MAAM,EAAE,KAWpB,CAAA;AACD,eAAO,MAAM,OAAO,EAAE,KAOrB,CAAA;AACD,eAAO,MAAM,QAAQ,EAAE,KAQtB,CAAA;AACD,eAAO,MAAM,WAAW,EAAE,KAQzB,CAAA;AACD,eAAO,MAAM,SAAS,EAAE,KAQvB,CAAA;AACD,eAAO,MAAM,kBAAkB,EAAE,KAQhC,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAOvB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAQ7B,CAAA;AAGD,eAAO,MAAM,eAAe,EAAE,KAS7B,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAQxB,CAAA;AAGD,eAAO,MAAM,QAAQ,EAAE,KAStB,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,KAOrC,CAAA;AACD,eAAO,MAAM,sBAAsB,EAAE,KAOpC,CAAA;AACD,eAAO,MAAM,oBAAoB,EAAE,KAOlC,CAAA"}
|