@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
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { getDefaultArgTypes, getValidationArgTypes, PrebuiltArgTypes, StorybookControlCategory, } from '@powerhousedao/document-engineering/scalars/lib/storybook-arg-types.js';
|
|
2
|
+
import { TimePicker } from './time-picker.js';
|
|
3
|
+
/**
|
|
4
|
+
* The `TimePicker` component provides an input field for selecting times.
|
|
5
|
+
* It supports multiple configuration properties like:
|
|
6
|
+
* - label
|
|
7
|
+
* - description
|
|
8
|
+
* - timeFormat
|
|
9
|
+
* - timeIntervals
|
|
10
|
+
* - timeZone
|
|
11
|
+
* - showTimezoneSelect
|
|
12
|
+
*
|
|
13
|
+
* Features include:
|
|
14
|
+
* - Customizable time format (12/24 hour)
|
|
15
|
+
* - Configurable time intervals
|
|
16
|
+
* - Timezone selection support
|
|
17
|
+
* - Custom placeholder support
|
|
18
|
+
*
|
|
19
|
+
* ## Time Picker Customization
|
|
20
|
+
* The time picker can be customized using the `className` prop which accepts a string of Tailwind classes.
|
|
21
|
+
* Each class should follow the format `[&_.time-picker\\_\\_{element}]:{tailwind-classes}`.
|
|
22
|
+
*
|
|
23
|
+
* Base classes available for customization:
|
|
24
|
+
* - .base-picker__input: Input field container
|
|
25
|
+
* - .base-picker__popover: Popover container
|
|
26
|
+
* - .time-picker__content: Main container for the time picker
|
|
27
|
+
* - .time-picker__period: AM/PM selector section
|
|
28
|
+
* - .time-picker__selector: Time selection area (hours/minutes)
|
|
29
|
+
* - .time-picker__buttons: Container for action buttons (Cancel/OK)
|
|
30
|
+
* - .time-picker__select: Individual time selection buttons
|
|
31
|
+
* - .time-picker__hour: Hour display in 24-hour format
|
|
32
|
+
* - .time-picker__minute: Minute display
|
|
33
|
+
* - .time-picker__separator: Colon separator between hours and minutes
|
|
34
|
+
* - .time-picker__am-pm: AM/PM button in 12-hour format
|
|
35
|
+
*
|
|
36
|
+
* # Example Usage
|
|
37
|
+
* When using Tailwind CSS with custom class names, use `String.raw` to properly escape class names:
|
|
38
|
+
*
|
|
39
|
+
* ```tsx
|
|
40
|
+
* <TimePicker
|
|
41
|
+
* name="custom-time"
|
|
42
|
+
* label="Select Time"
|
|
43
|
+
* className={String.raw`
|
|
44
|
+
* [&_.time-picker\\_\\_content]:bg-blue-100
|
|
45
|
+
* [&_.time-picker\\_\\_selector]:[&>div]:bg-green-100
|
|
46
|
+
* [&_.time-picker\\_\\_period]:[&>button]:text-red-500
|
|
47
|
+
* [&_.time-picker\\_\\_buttons]:[&>button]:bg-gray-800
|
|
48
|
+
* `}
|
|
49
|
+
* />
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* > **Note:** This component does not have built-in validation. If you need built-in validation
|
|
53
|
+
* > you can use the [Time Picker](?path=/docs/scalars-timepickerfield--readme)
|
|
54
|
+
* > component.
|
|
55
|
+
*/
|
|
56
|
+
const meta = {
|
|
57
|
+
title: 'Data Entry/Time Picker',
|
|
58
|
+
component: TimePicker,
|
|
59
|
+
parameters: {
|
|
60
|
+
layout: 'centered',
|
|
61
|
+
form: {
|
|
62
|
+
resetBehavior: 'unmount',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
tags: ['autodocs'],
|
|
66
|
+
argTypes: {
|
|
67
|
+
...getDefaultArgTypes(),
|
|
68
|
+
timeFormat: {
|
|
69
|
+
control: {
|
|
70
|
+
type: 'select',
|
|
71
|
+
},
|
|
72
|
+
description: 'The format of the time in the time picker',
|
|
73
|
+
table: {
|
|
74
|
+
type: { summary: 'string' },
|
|
75
|
+
category: StorybookControlCategory.COMPONENT_SPECIFIC,
|
|
76
|
+
},
|
|
77
|
+
options: ['hh:mm a', 'HH:mm'],
|
|
78
|
+
defaultValue: { summary: 'hh:mm a' },
|
|
79
|
+
},
|
|
80
|
+
showTimezoneSelect: {
|
|
81
|
+
control: {
|
|
82
|
+
type: 'boolean',
|
|
83
|
+
},
|
|
84
|
+
description: 'Show timezone select',
|
|
85
|
+
table: {
|
|
86
|
+
category: StorybookControlCategory.COMPONENT_SPECIFIC,
|
|
87
|
+
type: { summary: 'boolean' },
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
timeIntervals: {
|
|
91
|
+
description: 'The interval between each time option',
|
|
92
|
+
control: {
|
|
93
|
+
type: 'number',
|
|
94
|
+
},
|
|
95
|
+
type: 'number',
|
|
96
|
+
min: 1,
|
|
97
|
+
max: 60,
|
|
98
|
+
table: {
|
|
99
|
+
category: StorybookControlCategory.COMPONENT_SPECIFIC,
|
|
100
|
+
},
|
|
101
|
+
defaultValue: { summary: 1 },
|
|
102
|
+
},
|
|
103
|
+
timeZone: {
|
|
104
|
+
description: 'The timezone to display in the time picker',
|
|
105
|
+
control: {
|
|
106
|
+
type: 'text',
|
|
107
|
+
},
|
|
108
|
+
table: {
|
|
109
|
+
category: StorybookControlCategory.COMPONENT_SPECIFIC,
|
|
110
|
+
type: { summary: 'string' },
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
includeContinent: {
|
|
114
|
+
description: 'Show continent name in the timezone select',
|
|
115
|
+
control: {
|
|
116
|
+
type: 'boolean',
|
|
117
|
+
defaultValue: false,
|
|
118
|
+
},
|
|
119
|
+
table: {
|
|
120
|
+
category: StorybookControlCategory.COMPONENT_SPECIFIC,
|
|
121
|
+
defaultValue: { summary: 'false ' },
|
|
122
|
+
type: { summary: 'boolean' },
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
placeholder: {
|
|
126
|
+
description: 'The placeholder text for the time picker',
|
|
127
|
+
table: {
|
|
128
|
+
category: StorybookControlCategory.DEFAULT,
|
|
129
|
+
type: { summary: 'string' },
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
...getValidationArgTypes({
|
|
133
|
+
enabledArgTypes: {
|
|
134
|
+
validators: false,
|
|
135
|
+
showErrorOnBlur: false,
|
|
136
|
+
showErrorOnChange: false,
|
|
137
|
+
},
|
|
138
|
+
}),
|
|
139
|
+
...PrebuiltArgTypes.viewMode,
|
|
140
|
+
...PrebuiltArgTypes.baseValue,
|
|
141
|
+
},
|
|
142
|
+
args: {
|
|
143
|
+
name: 'time-picker-field',
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
export default meta;
|
|
147
|
+
export const Default = {
|
|
148
|
+
args: {
|
|
149
|
+
name: 'time',
|
|
150
|
+
label: 'Pick a time',
|
|
151
|
+
placeholder: 'HH:mm',
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
export const Disabled = {
|
|
155
|
+
args: {
|
|
156
|
+
name: 'time',
|
|
157
|
+
label: 'Pick a time',
|
|
158
|
+
placeholder: 'HH:mm',
|
|
159
|
+
disabled: true,
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
export const Filled = {
|
|
163
|
+
args: {
|
|
164
|
+
name: 'time',
|
|
165
|
+
label: 'Pick a time',
|
|
166
|
+
value: '12:00 PM',
|
|
167
|
+
placeholder: 'HH:mm',
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
export const WithCustomizedCalendar = {
|
|
171
|
+
args: {
|
|
172
|
+
name: 'time',
|
|
173
|
+
label: 'Pick a time',
|
|
174
|
+
placeholder: 'HH:mm',
|
|
175
|
+
className: String.raw `
|
|
176
|
+
[&.base-picker\\_\\_input]:w-[275px]
|
|
177
|
+
[&.base-picker\\_\\_popover]:w-[275px]
|
|
178
|
+
[&_.time-picker\\_\\_content]:bg-red-300
|
|
179
|
+
[&_.time-picker\\_\\_content]:border-2
|
|
180
|
+
[&_.time-picker\\_\\_content]:border-cyan-400
|
|
181
|
+
[&_.time-picker\\_\\_content]:rounded-lg
|
|
182
|
+
[&_.time-picker\\_\\_content]:p-2
|
|
183
|
+
[&_.time-picker\\_\\_content]:transition-all
|
|
184
|
+
[&_.time-picker\\_\\_content]:duration-300
|
|
185
|
+
[&_.time-picker\\_\\_content]:font-mono
|
|
186
|
+
[&_.time-picker\\_\\_content]:text-lg
|
|
187
|
+
[&_.time-picker\\_\\_content]:border-b
|
|
188
|
+
[&_.time-picker\\_\\_content]:border-cyan-400/30
|
|
189
|
+
[&_.time-picker\\_\\_period]:[&>button]:text-blue-500
|
|
190
|
+
[&_.time-picker\\_\\_period]:[&>button[data-selected=true]]:bg-blue-100
|
|
191
|
+
[&_.time-picker\\_\\_period]:[&>button[data-selected=true]]:rounded-md
|
|
192
|
+
[&_.time-picker\\_\\_period]:[&>button[data-selected=true]]:font-bold
|
|
193
|
+
[&_.time-picker\\_\\_selector]:[&>div]:bg-green-500
|
|
194
|
+
[&_.time-picker\\_\\_buttons]:[&>button]:text-gray-900
|
|
195
|
+
[&_.time-picker\\_\\_select]:[&>button]:text-gray-900
|
|
196
|
+
[&_.time-picker\\_\\_select]:[&>button]:bg-red-500
|
|
197
|
+
[&_.time-picker\\_\\_select]:[&>button]:rounded-lg
|
|
198
|
+
[&_.time-picker\\_\\_select]:[&>button]:p-2
|
|
199
|
+
[&_.time-picker\\_\\_select]:[&>button]:transition-all
|
|
200
|
+
[&_.time-picker\\_\\_select]:[&>button]:duration-300
|
|
201
|
+
`,
|
|
202
|
+
},
|
|
203
|
+
};
|
|
204
|
+
export const WithDifferencesAddition = {
|
|
205
|
+
args: {
|
|
206
|
+
label: 'Time difference addition',
|
|
207
|
+
value: '12:00 PM',
|
|
208
|
+
baseValue: '11:00 AM',
|
|
209
|
+
viewMode: 'addition',
|
|
210
|
+
},
|
|
211
|
+
};
|
|
212
|
+
export const WithDifferencesRemoval = {
|
|
213
|
+
args: {
|
|
214
|
+
label: 'Time difference removal',
|
|
215
|
+
value: '12:00 PM',
|
|
216
|
+
baseValue: '11:00 AM',
|
|
217
|
+
viewMode: 'removal',
|
|
218
|
+
},
|
|
219
|
+
};
|
|
220
|
+
export const WithDifferencesMixed = {
|
|
221
|
+
args: {
|
|
222
|
+
label: 'Time difference mixed',
|
|
223
|
+
value: '12:00 PM',
|
|
224
|
+
baseValue: '11:00 AM',
|
|
225
|
+
viewMode: 'mixed',
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
//# sourceMappingURL=time-picker.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time-picker.stories.js","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/time-picker/time-picker.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,wEAAwE,CAAA;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,MAAM,IAAI,GAA4B;IACpC,KAAK,EAAE,wBAAwB;IAC/B,SAAS,EAAE,UAAU;IACrB,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;QAClB,IAAI,EAAE;YACJ,aAAa,EAAE,SAAS;SACzB;KACF;IACD,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,GAAG,kBAAkB,EAAE;QACvB,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;aACf;YACD,WAAW,EAAE,2CAA2C;YACxD,KAAK,EAAE;gBACL,IAAI,EAA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EAAE,UAAU;QACrB,QAAQ,EAAE,UAAU;KACrB;CACF,CAAA;AACD,MAAM,CAAC,MAAM,sBAAsB,GAAU;IAC3C,IAAI,EAAE;QACJ,KAAK,EAAE,yBAAyB;QAChC,KAAK,EAAE,UAAU;QACjB,SAAS,EAAE,UAAU;QACrB,QAAQ,EAAE,SAAS;KACpB;CACF,CAAA;AACD,MAAM,CAAC,MAAM,oBAAoB,GAAU;IACzC,IAAI,EAAE;QACJ,KAAK,EAAE,uBAAuB;QAC9B,KAAK,EAAE,UAAU;QACjB,SAAS,EAAE,UAAU;QACrB,QAAQ,EAAE,OAAO;KAClB;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time-picker.test.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/time-picker/time-picker.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { userEvent } from '@testing-library/user-event';
|
|
4
|
+
import { TimePicker } from './time-picker.js';
|
|
5
|
+
import { vi } from 'vitest';
|
|
6
|
+
describe('TimePicker', () => {
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
// Mock the timezone to be consistent across all tests
|
|
9
|
+
vi.spyOn(Intl, 'DateTimeFormat').mockImplementation(() => ({
|
|
10
|
+
resolvedOptions: () => ({
|
|
11
|
+
timeZone: 'America/New_York',
|
|
12
|
+
}),
|
|
13
|
+
}));
|
|
14
|
+
});
|
|
15
|
+
afterEach(() => {
|
|
16
|
+
vi.restoreAllMocks();
|
|
17
|
+
});
|
|
18
|
+
it('should render with basic props', () => {
|
|
19
|
+
const { container } = render(_jsx(TimePicker, { label: "Test Label", name: "test-time", id: "test-id", required: true, disabled: false }));
|
|
20
|
+
expect(container).toMatchSnapshot();
|
|
21
|
+
});
|
|
22
|
+
it('should display the label when provided', () => {
|
|
23
|
+
const labelText = 'Test Label';
|
|
24
|
+
render(_jsx(TimePicker, { name: "test-time", label: labelText }));
|
|
25
|
+
expect(screen.getByText(labelText)).toBeInTheDocument();
|
|
26
|
+
});
|
|
27
|
+
it('should not render the label when label prop is not provided', () => {
|
|
28
|
+
render(_jsx(TimePicker, { name: "test-time" }));
|
|
29
|
+
expect(screen.queryByText('Test Label')).not.toBeInTheDocument();
|
|
30
|
+
});
|
|
31
|
+
it('should mark the label as required when required prop is true', () => {
|
|
32
|
+
render(_jsx(TimePicker, { name: "test-time", label: "Test Label", required: true }));
|
|
33
|
+
const label = screen.getByText('Test Label');
|
|
34
|
+
const asterisk = screen.getByText('*');
|
|
35
|
+
expect(label).toBeInTheDocument();
|
|
36
|
+
expect(asterisk).toBeInTheDocument();
|
|
37
|
+
});
|
|
38
|
+
it('should mark the label as disabled when disabled prop is true', () => {
|
|
39
|
+
render(_jsx(TimePicker, { name: "test-time", label: "Test Label", disabled: true }));
|
|
40
|
+
const label = screen.getByText('Test Label');
|
|
41
|
+
expect(label).toHaveClass('cursor-not-allowed');
|
|
42
|
+
expect(label).toHaveClass('text-gray-700');
|
|
43
|
+
});
|
|
44
|
+
it('should handle timeIntervals prop correctly with 15-minute intervals', async () => {
|
|
45
|
+
const user = userEvent.setup();
|
|
46
|
+
render(_jsx(TimePicker, { name: "test-time", label: "Test Label", timeIntervals: 15 }));
|
|
47
|
+
const clockButton = screen.getByRole('button');
|
|
48
|
+
await user.click(clockButton);
|
|
49
|
+
const popoverContent = await screen.findByRole('dialog');
|
|
50
|
+
expect(popoverContent).toBeVisible();
|
|
51
|
+
const minutes = ['00', '15', '30', '45'];
|
|
52
|
+
for (const minute of minutes) {
|
|
53
|
+
const minuteElements = await screen.findAllByText(minute);
|
|
54
|
+
expect(minuteElements.length).toBeGreaterThan(0);
|
|
55
|
+
expect(minuteElements[0]).toBeInTheDocument();
|
|
56
|
+
}
|
|
57
|
+
;
|
|
58
|
+
['13', '20', '25', '35', '40', '50', '55'].forEach((minute) => {
|
|
59
|
+
expect(screen.queryByText(minute)).not.toBeInTheDocument();
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
it('should handle timeIntervals prop correctly with 30-minute intervals', async () => {
|
|
63
|
+
const user = userEvent.setup();
|
|
64
|
+
render(_jsx(TimePicker, { name: "test-time", label: "Test Label", timeIntervals: 30 }));
|
|
65
|
+
const clockButton = screen.getByRole('button');
|
|
66
|
+
await user.click(clockButton);
|
|
67
|
+
const popoverContent = await screen.findByRole('dialog');
|
|
68
|
+
expect(popoverContent).toBeVisible();
|
|
69
|
+
const minutes = ['00', '30'];
|
|
70
|
+
for (const minute of minutes) {
|
|
71
|
+
const minuteElements = await screen.findAllByText(minute);
|
|
72
|
+
expect(minuteElements.length).toBeGreaterThan(0);
|
|
73
|
+
expect(minuteElements[0]).toBeInTheDocument();
|
|
74
|
+
}
|
|
75
|
+
;
|
|
76
|
+
['15', '45'].forEach((minute) => {
|
|
77
|
+
expect(screen.queryByText(minute)).not.toBeInTheDocument();
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
it('should handle timezone selection when timeZone prop is provided', async () => {
|
|
81
|
+
const user = userEvent.setup();
|
|
82
|
+
const timeZoneValue = 'America/New_York';
|
|
83
|
+
render(_jsx(TimePicker, { name: "test-time", label: "Test Label", timeZone: timeZoneValue, showTimezoneSelect: true }));
|
|
84
|
+
const clockButton = screen.getByRole('button');
|
|
85
|
+
await user.click(clockButton);
|
|
86
|
+
const popoverContent = await screen.findByRole('dialog');
|
|
87
|
+
expect(popoverContent).toBeVisible();
|
|
88
|
+
const select = await screen.findByRole('combobox');
|
|
89
|
+
expect(select).toBeDisabled();
|
|
90
|
+
const timezoneText = screen.getByText((content) => {
|
|
91
|
+
return content.includes('New York') && content.includes('(');
|
|
92
|
+
});
|
|
93
|
+
expect(timezoneText).toBeInTheDocument();
|
|
94
|
+
});
|
|
95
|
+
it('should display description when provided', () => {
|
|
96
|
+
const description = 'Test description';
|
|
97
|
+
render(_jsx(TimePicker, { name: "test-time", label: "Test Label", description: description }));
|
|
98
|
+
expect(screen.getByText(description)).toBeInTheDocument();
|
|
99
|
+
});
|
|
100
|
+
it('should display error messages when provided', () => {
|
|
101
|
+
const errors = ['Error 1', 'Error 2'];
|
|
102
|
+
render(_jsx(TimePicker, { name: "test-time", label: "Test Label", errors: errors }));
|
|
103
|
+
errors.forEach((error) => {
|
|
104
|
+
expect(screen.getByText(error)).toBeInTheDocument();
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
it('should display warning messages when provided', () => {
|
|
108
|
+
const warnings = ['Warning 1', 'Warning 2'];
|
|
109
|
+
render(_jsx(TimePicker, { name: "test-time", label: "Test Label", warnings: warnings }));
|
|
110
|
+
warnings.forEach((warning) => {
|
|
111
|
+
expect(screen.getByText(warning)).toBeInTheDocument();
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
it('should handle different time formats', async () => {
|
|
115
|
+
const user = userEvent.setup();
|
|
116
|
+
render(_jsx(TimePicker, { name: "test-time", label: "Test Label", timeFormat: "HH:mm" }));
|
|
117
|
+
const clockButton = screen.getByRole('button');
|
|
118
|
+
await user.click(clockButton);
|
|
119
|
+
const popoverContent = await screen.findByRole('dialog');
|
|
120
|
+
expect(popoverContent).toBeVisible();
|
|
121
|
+
// Verify 24-hour format is used
|
|
122
|
+
const hours = [
|
|
123
|
+
'00',
|
|
124
|
+
'01',
|
|
125
|
+
'02',
|
|
126
|
+
'03',
|
|
127
|
+
'04',
|
|
128
|
+
'05',
|
|
129
|
+
'06',
|
|
130
|
+
'07',
|
|
131
|
+
'08',
|
|
132
|
+
'09',
|
|
133
|
+
'10',
|
|
134
|
+
'11',
|
|
135
|
+
'12',
|
|
136
|
+
'13',
|
|
137
|
+
'14',
|
|
138
|
+
'15',
|
|
139
|
+
'16',
|
|
140
|
+
'17',
|
|
141
|
+
'18',
|
|
142
|
+
'19',
|
|
143
|
+
'20',
|
|
144
|
+
'21',
|
|
145
|
+
'22',
|
|
146
|
+
'23',
|
|
147
|
+
];
|
|
148
|
+
for (const hour of hours) {
|
|
149
|
+
const hourElements = await screen.findAllByText(hour);
|
|
150
|
+
expect(hourElements.length).toBeGreaterThan(0);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
it('should show timezone select when showTimezoneSelect is true', async () => {
|
|
154
|
+
const user = userEvent.setup();
|
|
155
|
+
render(_jsx(TimePicker, { name: "test-time", label: "Test Label", showTimezoneSelect: true }));
|
|
156
|
+
const clockButton = screen.getByRole('button');
|
|
157
|
+
await user.click(clockButton);
|
|
158
|
+
const popoverContent = await screen.findByRole('dialog');
|
|
159
|
+
expect(popoverContent).toBeVisible();
|
|
160
|
+
const select = await screen.findByRole('combobox');
|
|
161
|
+
expect(select).toBeInTheDocument();
|
|
162
|
+
expect(select).not.toBeDisabled();
|
|
163
|
+
});
|
|
164
|
+
it('should include continent in timezone display when includeContinent is true', async () => {
|
|
165
|
+
const user = userEvent.setup();
|
|
166
|
+
const timeZoneValue = 'America/New_York';
|
|
167
|
+
render(_jsx(TimePicker, { name: "test-time", label: "Test Label", timeZone: timeZoneValue, showTimezoneSelect: true, includeContinent: true }));
|
|
168
|
+
const clockButton = screen.getByRole('button');
|
|
169
|
+
await user.click(clockButton);
|
|
170
|
+
const popoverContent = await screen.findByRole('dialog');
|
|
171
|
+
expect(popoverContent).toBeVisible();
|
|
172
|
+
const timezoneText = screen.getByText((content) => {
|
|
173
|
+
return content.includes('America') && content.includes('New York');
|
|
174
|
+
});
|
|
175
|
+
expect(timezoneText).toBeInTheDocument();
|
|
176
|
+
});
|
|
177
|
+
it('should not include continent in timezone display when includeContinent is false', async () => {
|
|
178
|
+
const user = userEvent.setup();
|
|
179
|
+
const timeZoneValue = 'America/New_York';
|
|
180
|
+
render(_jsx(TimePicker, { name: "test-time", label: "Test Label", timeZone: timeZoneValue, showTimezoneSelect: true, includeContinent: false }));
|
|
181
|
+
const clockButton = screen.getByRole('button');
|
|
182
|
+
await user.click(clockButton);
|
|
183
|
+
const popoverContent = await screen.findByRole('dialog');
|
|
184
|
+
expect(popoverContent).toBeVisible();
|
|
185
|
+
const timezoneText = screen.getByText((content) => {
|
|
186
|
+
return content.includes('New York') && !content.includes('America');
|
|
187
|
+
});
|
|
188
|
+
expect(timezoneText).toBeInTheDocument();
|
|
189
|
+
});
|
|
190
|
+
it('should not show timezone select when showTimezoneSelect is false', async () => {
|
|
191
|
+
const user = userEvent.setup();
|
|
192
|
+
// Mock the timezone to be Montevideo
|
|
193
|
+
vi.spyOn(Intl, 'DateTimeFormat').mockImplementation(() => ({
|
|
194
|
+
resolvedOptions: () => ({
|
|
195
|
+
timeZone: 'America/Montevideo',
|
|
196
|
+
}),
|
|
197
|
+
formatToParts: () => [{ type: 'timeZoneName', value: 'GMT-03:00' }],
|
|
198
|
+
}));
|
|
199
|
+
render(_jsx(TimePicker, { name: "test-time", label: "Test Label", timeZone: "America/Montevideo", showTimezoneSelect: false }));
|
|
200
|
+
const clockButton = screen.getByRole('button');
|
|
201
|
+
await user.click(clockButton);
|
|
202
|
+
const popoverContent = await screen.findByRole('dialog');
|
|
203
|
+
expect(popoverContent).toBeVisible();
|
|
204
|
+
const select = screen.getByRole('combobox');
|
|
205
|
+
expect(select).toBeInTheDocument();
|
|
206
|
+
expect(select).toHaveTextContent('(UTC-03) Montevideo');
|
|
207
|
+
});
|
|
208
|
+
describe('TimePicker differences', () => {
|
|
209
|
+
it('should render differences when viewMode is addition', () => {
|
|
210
|
+
render(_jsx(TimePicker, { name: "test-time", label: "Test Label", viewMode: "addition", value: "14:30", baseValue: "13:30", timeFormat: "HH:mm" }));
|
|
211
|
+
expect(screen.getByTestId('time-picker-diff')).toBeInTheDocument();
|
|
212
|
+
expect(screen.getByText('14:30')).toBeInTheDocument();
|
|
213
|
+
expect(screen.queryByText('13:30')).not.toBeInTheDocument();
|
|
214
|
+
});
|
|
215
|
+
it('should render differences when viewMode is removal', () => {
|
|
216
|
+
render(_jsx(TimePicker, { name: "test-time", label: "Test Label", viewMode: "removal", value: "14:30", baseValue: "13:30", timeFormat: "HH:mm" }));
|
|
217
|
+
expect(screen.getByTestId('time-picker-diff')).toBeInTheDocument();
|
|
218
|
+
expect(screen.queryByText('14:30')).not.toBeInTheDocument();
|
|
219
|
+
expect(screen.getByText('13:30')).toBeInTheDocument();
|
|
220
|
+
});
|
|
221
|
+
it('should render differences when viewMode is mixed', () => {
|
|
222
|
+
render(_jsx(TimePicker, { name: "test-time", label: "Test Label", viewMode: "mixed", value: "14:30", baseValue: "13:30", timeFormat: "HH:mm" }));
|
|
223
|
+
expect(screen.getByTestId('time-picker-diff')).toBeInTheDocument();
|
|
224
|
+
expect(screen.getByText('13:30')).toBeInTheDocument();
|
|
225
|
+
expect(screen.getByText('14:30')).toBeInTheDocument();
|
|
226
|
+
});
|
|
227
|
+
it('should render input field when viewMode is edition', () => {
|
|
228
|
+
render(_jsx(TimePicker, { name: "test-time", label: "Test Label", viewMode: "edition", value: "14:30" }));
|
|
229
|
+
const input = screen.getByRole('textbox');
|
|
230
|
+
expect(input).toBeInTheDocument();
|
|
231
|
+
expect(input).toHaveValue('02:30 PM');
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
//# sourceMappingURL=time-picker.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time-picker.test.js","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/time-picker/time-picker.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE3B,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,UAAU,CAAC,GAAG,EAAE;QACd,sDAAsD;QACtD,EAAE,CAAC,K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AAA;QACvD,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;YAC5D,MAAM,CAAC,KAAC,UAAU,IAAC,IAAI,EAAC,WAAW,EAAC,KAAK,EAAC,YAAY,EAAC,QAAQ,EAAC,SAAS,EAAC,KAAK,EAAC,OAAO,GAAG,CAAC,CAAA;YAC3F,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;YACzC,MAAM,CAAC,KAAK,CAAC,CAAC,iBAAiB,EAAE,CAAA;YACjC,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;QACvC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.test.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/time-picker/utils.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { transformInputTime } from './utils.js';
|
|
3
|
+
describe('transformInputTime', () => {
|
|
4
|
+
describe('empty or null input', () => {
|
|
5
|
+
it('should return empty values for empty input', () => {
|
|
6
|
+
const result = transformInputTime('', true);
|
|
7
|
+
expect(result).toEqual({ hour: '', minute: '', period: undefined });
|
|
8
|
+
});
|
|
9
|
+
it('should return empty values for input with only spaces', () => {
|
|
10
|
+
const result = transformInputTime(' ', false);
|
|
11
|
+
expect(result).toEqual({ hour: '', minute: '', period: undefined });
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
describe('12-hour format', () => {
|
|
15
|
+
it('should transform time in 12h format with AM', () => {
|
|
16
|
+
const result = transformInputTime('09:30 AM', true);
|
|
17
|
+
expect(result).toEqual({ hour: '09', minute: '30', period: 'AM' });
|
|
18
|
+
});
|
|
19
|
+
it('should transform time in 12h format with PM', () => {
|
|
20
|
+
const result = transformInputTime('02:45 PM', true);
|
|
21
|
+
expect(result).toEqual({ hour: '02', minute: '45', period: 'PM' });
|
|
22
|
+
});
|
|
23
|
+
it('should automatically convert 24h time to 12h if format is 12h', () => {
|
|
24
|
+
const result = transformInputTime('14:30', true);
|
|
25
|
+
expect(result).toEqual({ hour: '02', minute: '30', period: 'PM' });
|
|
26
|
+
});
|
|
27
|
+
it('should handle noon (12:00) as 12:00 PM', () => {
|
|
28
|
+
const result = transformInputTime('12:00', true);
|
|
29
|
+
expect(result).toEqual({ hour: '12', minute: '00', period: 'PM' });
|
|
30
|
+
});
|
|
31
|
+
it('should determine AM/PM based on original hour when not specified', () => {
|
|
32
|
+
// Hour 8-11 should be AM
|
|
33
|
+
const result1 = transformInputTime('09:00', true);
|
|
34
|
+
expect(result1).toEqual({ hour: '09', minute: '00', period: 'AM' });
|
|
35
|
+
// Hour 1-7 should be PM
|
|
36
|
+
const result2 = transformInputTime('03:00', true);
|
|
37
|
+
expect(result2).toEqual({ hour: '03', minute: '00', period: 'PM' });
|
|
38
|
+
});
|
|
39
|
+
it('should use periodToCheck when provided', () => {
|
|
40
|
+
const result = transformInputTime('14:30', true, 1, 'AM');
|
|
41
|
+
expect(result).toEqual({ hour: '02', minute: '30', period: 'AM' });
|
|
42
|
+
});
|
|
43
|
+
it('should handle input without minutes', () => {
|
|
44
|
+
const result = transformInputTime('9', true);
|
|
45
|
+
expect(result).toEqual({ hour: '', minute: '', period: undefined });
|
|
46
|
+
});
|
|
47
|
+
it('should handle 4-digit input', () => {
|
|
48
|
+
const result = transformInputTime('1430', true);
|
|
49
|
+
expect(result).toEqual({ hour: '02', minute: '30', period: 'PM' });
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
describe('24-hour format', () => {
|
|
53
|
+
it('should maintain time in 24h format', () => {
|
|
54
|
+
const result = transformInputTime('14:30', false);
|
|
55
|
+
expect(result).toEqual({ hour: '14', minute: '30', period: undefined });
|
|
56
|
+
});
|
|
57
|
+
it('should convert AM/PM to 24h format', () => {
|
|
58
|
+
const result = transformInputTime('02:30 PM', false);
|
|
59
|
+
expect(result).toEqual({ hour: '14', minute: '30', period: undefined });
|
|
60
|
+
});
|
|
61
|
+
it('should convert 12:00 AM to 00:00', () => {
|
|
62
|
+
const result = transformInputTime('12:00 AM', false);
|
|
63
|
+
expect(result).toEqual({ hour: '00', minute: '00', period: undefined });
|
|
64
|
+
});
|
|
65
|
+
it('should maintain 12:00 PM as 12:00', () => {
|
|
66
|
+
const result = transformInputTime('12:00 PM', false);
|
|
67
|
+
expect(result).toEqual({ hour: '12', minute: '00', period: undefined });
|
|
68
|
+
});
|
|
69
|
+
it('should handle input without minutes in 24h format', () => {
|
|
70
|
+
const result = transformInputTime('14', false);
|
|
71
|
+
expect(result).toEqual({ hour: '', minute: '', period: undefined });
|
|
72
|
+
});
|
|
73
|
+
it('should handle 4-digit input in 24h format', () => {
|
|
74
|
+
const result = transformInputTime('1430', false);
|
|
75
|
+
expect(result).toEqual({ hour: '14', minute: '30', period: undefined });
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
describe('minute rounding', () => {
|
|
79
|
+
it('should round minutes to specified interval', () => {
|
|
80
|
+
const result = transformInputTime('09:32', true, 5);
|
|
81
|
+
expect(result).toEqual({ hour: '09', minute: '30', period: 'AM' });
|
|
82
|
+
});
|
|
83
|
+
it('should round up when close to next interval', () => {
|
|
84
|
+
const result = transformInputTime('09:33', true, 5);
|
|
85
|
+
expect(result).toEqual({ hour: '09', minute: '35', period: 'AM' });
|
|
86
|
+
});
|
|
87
|
+
it('should round down when close to previous interval', () => {
|
|
88
|
+
const result = transformInputTime('09:31', true, 5);
|
|
89
|
+
expect(result).toEqual({ hour: '09', minute: '30', period: 'AM' });
|
|
90
|
+
});
|
|
91
|
+
it('should handle rounding at 60-minute limit', () => {
|
|
92
|
+
const result = transformInputTime('09:58', true, 5);
|
|
93
|
+
expect(result).toEqual({ hour: '09', minute: '55', period: 'AM' });
|
|
94
|
+
});
|
|
95
|
+
it('should use default interval of 1 minute', () => {
|
|
96
|
+
const result = transformInputTime('09:30', true);
|
|
97
|
+
expect(result).toEqual({ hour: '09', minute: '30', period: 'AM' });
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
describe('edge cases and validation', () => {
|
|
101
|
+
it('should handle invalid numeric values', () => {
|
|
102
|
+
const result = transformInputTime('abcd', true);
|
|
103
|
+
expect(result).toEqual({ hour: '', minute: '', period: undefined });
|
|
104
|
+
});
|
|
105
|
+
it('should handle invalid numeric values', () => {
|
|
106
|
+
const result = transformInputTime('ab:cd', true);
|
|
107
|
+
expect(result).toEqual({ hour: '', minute: '', period: undefined });
|
|
108
|
+
});
|
|
109
|
+
it('should handle only invalid minutes', () => {
|
|
110
|
+
const result = transformInputTime('09:ab', true);
|
|
111
|
+
expect(result).toEqual({ hour: '', minute: '', period: undefined });
|
|
112
|
+
});
|
|
113
|
+
it('should handle only invalid hours', () => {
|
|
114
|
+
const result = transformInputTime('ab:30', true);
|
|
115
|
+
expect(result).toEqual({ hour: '', minute: '', period: undefined });
|
|
116
|
+
});
|
|
117
|
+
it('should handle input with extra spaces', () => {
|
|
118
|
+
const result = transformInputTime(' 09:30 AM ', true);
|
|
119
|
+
expect(result).toEqual({ hour: '09', minute: '30', period: 'AM' });
|
|
120
|
+
});
|
|
121
|
+
it('should handle input with multiple spaces', () => {
|
|
122
|
+
const result = transformInputTime('09:30 AM', true);
|
|
123
|
+
expect(result).toEqual({ hour: '09', minute: '30', period: 'AM' });
|
|
124
|
+
});
|
|
125
|
+
it('should convert 12h if had AM/PM', () => {
|
|
126
|
+
const result = transformInputTime('02:30 PM', false);
|
|
127
|
+
expect(result).toEqual({ hour: '14', minute: '30', period: undefined });
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
describe('complex combinations', () => {
|
|
131
|
+
it('should handle 24h to 12h conversion with rounding', () => {
|
|
132
|
+
const result = transformInputTime('14:32', true, 5);
|
|
133
|
+
expect(result).toEqual({ hour: '02', minute: '30', period: 'PM' });
|
|
134
|
+
});
|
|
135
|
+
it('should handle 12h to 24h conversion with rounding', () => {
|
|
136
|
+
const result = transformInputTime('02:32 PM', false, 5);
|
|
137
|
+
expect(result).toEqual({ hour: '14', minute: '30', period: undefined });
|
|
138
|
+
});
|
|
139
|
+
it('should handle 4-digit input with rounding', () => {
|
|
140
|
+
const result = transformInputTime('1432', true, 5);
|
|
141
|
+
expect(result).toEqual({ hour: '02', minute: '30', period: 'PM' });
|
|
142
|
+
});
|
|
143
|
+
it('should handle 4-digit input with rounding in 24h format', () => {
|
|
144
|
+
const result = transformInputTime('1432', false, 5);
|
|
145
|
+
expect(result).toEqual({ hour: '14', minute: '30', period: undefined });
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
//# sourceMappingURL=utils.test.js.map
|