@pine-ds/core 3.4.0 → 3.4.2
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/components/mock-pds-modal.js +1 -1
- package/components/mock-pds-modal.js.map +1 -1
- package/components/pds-box2.js +8 -4
- package/components/pds-box2.js.map +1 -1
- package/components/pds-button2.js +1 -1
- package/components/pds-button2.js.map +1 -1
- package/components/pds-checkbox2.js +45 -7
- package/components/pds-checkbox2.js.map +1 -1
- package/components/pds-input.js +56 -3
- package/components/pds-input.js.map +1 -1
- package/components/pds-modal.js +1 -1
- package/components/pds-modal.js.map +1 -1
- package/components/pds-radio.js +1 -1
- package/components/pds-radio.js.map +1 -1
- package/components/pds-select.js +77 -3
- package/components/pds-select.js.map +1 -1
- package/components/pds-switch.js +47 -4
- package/components/pds-switch.js.map +1 -1
- package/components/pds-textarea.js +56 -6
- package/components/pds-textarea.js.map +1 -1
- package/components/utils.js +38 -5
- package/components/utils.js.map +1 -1
- package/dist/cjs/{index-CxX7ua5d.js → index-g-uSeICs.js} +30 -2
- package/dist/cjs/index-g-uSeICs.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mock-pds-modal.cjs.entry.js +2 -2
- package/dist/cjs/mock-pds-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/mock-pds-modal.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-accordion.cjs.entry.js +1 -1
- package/dist/cjs/pds-alert.cjs.entry.js +1 -1
- package/dist/cjs/pds-avatar.cjs.entry.js +1 -1
- package/dist/cjs/pds-box.cjs.entry.js +9 -5
- package/dist/cjs/pds-box.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-box.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-button.cjs.entry.js +3 -3
- package/dist/cjs/pds-button.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-button.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-checkbox.cjs.entry.js +44 -6
- package/dist/cjs/pds-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-checkbox.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-chip.cjs.entry.js +1 -1
- package/dist/cjs/pds-combobox.cjs.entry.js +1 -1
- package/dist/cjs/pds-copytext.cjs.entry.js +1 -1
- package/dist/cjs/pds-divider.cjs.entry.js +1 -1
- package/dist/cjs/pds-dropdown-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/pds-dropdown-menu-separator.cjs.entry.js +1 -1
- package/dist/cjs/pds-dropdown-menu.cjs.entry.js +1 -1
- package/dist/cjs/pds-icon.cjs.entry.js +1 -1
- package/dist/cjs/pds-image.cjs.entry.js +1 -1
- package/dist/cjs/pds-input.cjs.entry.js +56 -4
- package/dist/cjs/pds-input.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-input.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-link.cjs.entry.js +2 -2
- package/dist/cjs/pds-loader.cjs.entry.js +1 -1
- package/dist/cjs/pds-modal-content.cjs.entry.js +1 -1
- package/dist/cjs/pds-modal-footer.cjs.entry.js +1 -1
- package/dist/cjs/pds-modal-header.cjs.entry.js +1 -1
- package/dist/cjs/pds-modal.cjs.entry.js +2 -2
- package/dist/cjs/pds-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-modal.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-popover.cjs.entry.js +1 -1
- package/dist/cjs/pds-progress.cjs.entry.js +1 -1
- package/dist/cjs/pds-property.cjs.entry.js +1 -1
- package/dist/cjs/pds-radio.cjs.entry.js +2 -2
- package/dist/cjs/pds-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-radio.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-row.cjs.entry.js +1 -1
- package/dist/cjs/pds-select.cjs.entry.js +77 -3
- package/dist/cjs/pds-select.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-select.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-sortable-item.cjs.entry.js +1 -1
- package/dist/cjs/pds-sortable.cjs.entry.js +1 -1
- package/dist/cjs/pds-switch.cjs.entry.js +45 -4
- package/dist/cjs/pds-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-switch.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-tab.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-body.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-cell.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-head-cell.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-head.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-row.cjs.entry.js +1 -1
- package/dist/cjs/pds-table.cjs.entry.js +1 -1
- package/dist/cjs/pds-tabpanel.cjs.entry.js +1 -1
- package/dist/cjs/pds-tabs.cjs.entry.js +1 -1
- package/dist/cjs/pds-text.cjs.entry.js +2 -2
- package/dist/cjs/pds-textarea.cjs.entry.js +57 -7
- package/dist/cjs/pds-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-textarea.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-toast.cjs.entry.js +1 -1
- package/dist/cjs/pds-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/pine-core.cjs.js +2 -2
- package/dist/cjs/utils-7jx8T2mW.js +79 -0
- package/dist/cjs/utils-7jx8T2mW.js.map +1 -0
- package/dist/collection/components/pds-box/pds-box.css +1 -1
- package/dist/collection/components/pds-box/pds-box.js +10 -6
- package/dist/collection/components/pds-box/pds-box.js.map +1 -1
- package/dist/collection/components/pds-button/pds-button.css +3 -2
- package/dist/collection/components/pds-checkbox/pds-checkbox.css +1 -0
- package/dist/collection/components/pds-checkbox/pds-checkbox.js +44 -3
- package/dist/collection/components/pds-checkbox/pds-checkbox.js.map +1 -1
- package/dist/collection/components/pds-input/pds-input.css +10 -6
- package/dist/collection/components/pds-input/pds-input.js +72 -1
- package/dist/collection/components/pds-input/pds-input.js.map +1 -1
- package/dist/collection/components/pds-input/stories/pds-input.stories.js +11 -0
- package/dist/collection/components/pds-modal/pds-modal.css +1 -1
- package/dist/collection/components/pds-radio/pds-radio.css +1 -0
- package/dist/collection/components/pds-select/pds-select.css +2 -1
- package/dist/collection/components/pds-select/pds-select.js +75 -1
- package/dist/collection/components/pds-select/pds-select.js.map +1 -1
- package/dist/collection/components/pds-switch/pds-switch.js +47 -3
- package/dist/collection/components/pds-switch/pds-switch.js.map +1 -1
- package/dist/collection/components/pds-textarea/pds-textarea.css +1 -1
- package/dist/collection/components/pds-textarea/pds-textarea.js +54 -4
- package/dist/collection/components/pds-textarea/pds-textarea.js.map +1 -1
- package/dist/collection/utils/utils.js +37 -4
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/docs.json +28 -14
- package/dist/esm/{index-Uh5ntVcq.js → index-BVCWKPy3.js} +30 -2
- package/dist/esm/index-BVCWKPy3.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mock-pds-modal.entry.js +2 -2
- package/dist/esm/mock-pds-modal.entry.js.map +1 -1
- package/dist/esm/pds-accordion.entry.js +1 -1
- package/dist/esm/pds-alert.entry.js +1 -1
- package/dist/esm/pds-avatar.entry.js +1 -1
- package/dist/esm/pds-box.entry.js +9 -5
- package/dist/esm/pds-box.entry.js.map +1 -1
- package/dist/esm/pds-button.entry.js +3 -3
- package/dist/esm/pds-button.entry.js.map +1 -1
- package/dist/esm/pds-checkbox.entry.js +44 -6
- package/dist/esm/pds-checkbox.entry.js.map +1 -1
- package/dist/esm/pds-chip.entry.js +1 -1
- package/dist/esm/pds-combobox.entry.js +1 -1
- package/dist/esm/pds-copytext.entry.js +1 -1
- package/dist/esm/pds-divider.entry.js +1 -1
- package/dist/esm/pds-dropdown-menu-item.entry.js +1 -1
- package/dist/esm/pds-dropdown-menu-separator.entry.js +1 -1
- package/dist/esm/pds-dropdown-menu.entry.js +1 -1
- package/dist/esm/pds-icon.entry.js +1 -1
- package/dist/esm/pds-image.entry.js +1 -1
- package/dist/esm/pds-input.entry.js +56 -4
- package/dist/esm/pds-input.entry.js.map +1 -1
- package/dist/esm/pds-link.entry.js +2 -2
- package/dist/esm/pds-loader.entry.js +1 -1
- package/dist/esm/pds-modal-content.entry.js +1 -1
- package/dist/esm/pds-modal-footer.entry.js +1 -1
- package/dist/esm/pds-modal-header.entry.js +1 -1
- package/dist/esm/pds-modal.entry.js +2 -2
- package/dist/esm/pds-modal.entry.js.map +1 -1
- package/dist/esm/pds-popover.entry.js +1 -1
- package/dist/esm/pds-progress.entry.js +1 -1
- package/dist/esm/pds-property.entry.js +1 -1
- package/dist/esm/pds-radio.entry.js +2 -2
- package/dist/esm/pds-radio.entry.js.map +1 -1
- package/dist/esm/pds-row.entry.js +1 -1
- package/dist/esm/pds-select.entry.js +77 -3
- package/dist/esm/pds-select.entry.js.map +1 -1
- package/dist/esm/pds-sortable-item.entry.js +1 -1
- package/dist/esm/pds-sortable.entry.js +1 -1
- package/dist/esm/pds-switch.entry.js +45 -4
- package/dist/esm/pds-switch.entry.js.map +1 -1
- package/dist/esm/pds-tab.entry.js +1 -1
- package/dist/esm/pds-table-body.entry.js +1 -1
- package/dist/esm/pds-table-cell.entry.js +1 -1
- package/dist/esm/pds-table-head-cell.entry.js +1 -1
- package/dist/esm/pds-table-head.entry.js +1 -1
- package/dist/esm/pds-table-row.entry.js +1 -1
- package/dist/esm/pds-table.entry.js +1 -1
- package/dist/esm/pds-tabpanel.entry.js +1 -1
- package/dist/esm/pds-tabs.entry.js +1 -1
- package/dist/esm/pds-text.entry.js +2 -2
- package/dist/esm/pds-textarea.entry.js +57 -7
- package/dist/esm/pds-textarea.entry.js.map +1 -1
- package/dist/esm/pds-toast.entry.js +1 -1
- package/dist/esm/pds-tooltip.entry.js +1 -1
- package/dist/esm/pine-core.js +3 -3
- package/dist/esm/utils-tJa4KYNO.js +74 -0
- package/dist/esm/utils-tJa4KYNO.js.map +1 -0
- package/dist/esm-es5/index-BVCWKPy3.js +3 -0
- package/dist/esm-es5/index-BVCWKPy3.js.map +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mock-pds-modal.entry.js +1 -1
- package/dist/esm-es5/mock-pds-modal.entry.js.map +1 -1
- package/dist/esm-es5/pds-accordion.entry.js +1 -1
- package/dist/esm-es5/pds-alert.entry.js +1 -1
- package/dist/esm-es5/pds-avatar.entry.js +1 -1
- package/dist/esm-es5/pds-box.entry.js +1 -1
- package/dist/esm-es5/pds-box.entry.js.map +1 -1
- package/dist/esm-es5/pds-button.entry.js +1 -1
- package/dist/esm-es5/pds-button.entry.js.map +1 -1
- package/dist/esm-es5/pds-checkbox.entry.js +1 -1
- package/dist/esm-es5/pds-checkbox.entry.js.map +1 -1
- package/dist/esm-es5/pds-chip.entry.js +1 -1
- package/dist/esm-es5/pds-combobox.entry.js +1 -1
- package/dist/esm-es5/pds-copytext.entry.js +1 -1
- package/dist/esm-es5/pds-divider.entry.js +1 -1
- package/dist/esm-es5/pds-dropdown-menu-item.entry.js +1 -1
- package/dist/esm-es5/pds-dropdown-menu-separator.entry.js +1 -1
- package/dist/esm-es5/pds-dropdown-menu.entry.js +1 -1
- package/dist/esm-es5/pds-icon.entry.js +1 -1
- package/dist/esm-es5/pds-image.entry.js +1 -1
- package/dist/esm-es5/pds-input.entry.js +1 -1
- package/dist/esm-es5/pds-input.entry.js.map +1 -1
- package/dist/esm-es5/pds-link.entry.js +1 -1
- package/dist/esm-es5/pds-loader.entry.js +1 -1
- package/dist/esm-es5/pds-modal-content.entry.js +1 -1
- package/dist/esm-es5/pds-modal-footer.entry.js +1 -1
- package/dist/esm-es5/pds-modal-header.entry.js +1 -1
- package/dist/esm-es5/pds-modal.entry.js +1 -1
- package/dist/esm-es5/pds-modal.entry.js.map +1 -1
- package/dist/esm-es5/pds-popover.entry.js +1 -1
- package/dist/esm-es5/pds-progress.entry.js +1 -1
- package/dist/esm-es5/pds-property.entry.js +1 -1
- package/dist/esm-es5/pds-radio.entry.js +1 -1
- package/dist/esm-es5/pds-radio.entry.js.map +1 -1
- package/dist/esm-es5/pds-row.entry.js +1 -1
- package/dist/esm-es5/pds-select.entry.js +1 -1
- package/dist/esm-es5/pds-select.entry.js.map +1 -1
- package/dist/esm-es5/pds-sortable-item.entry.js +1 -1
- package/dist/esm-es5/pds-sortable.entry.js +1 -1
- package/dist/esm-es5/pds-switch.entry.js +1 -1
- package/dist/esm-es5/pds-switch.entry.js.map +1 -1
- package/dist/esm-es5/pds-tab.entry.js +1 -1
- package/dist/esm-es5/pds-table-body.entry.js +1 -1
- package/dist/esm-es5/pds-table-cell.entry.js +1 -1
- package/dist/esm-es5/pds-table-head-cell.entry.js +1 -1
- package/dist/esm-es5/pds-table-head.entry.js +1 -1
- package/dist/esm-es5/pds-table-row.entry.js +1 -1
- package/dist/esm-es5/pds-table.entry.js +1 -1
- package/dist/esm-es5/pds-tabpanel.entry.js +1 -1
- package/dist/esm-es5/pds-tabs.entry.js +1 -1
- package/dist/esm-es5/pds-text.entry.js +1 -1
- package/dist/esm-es5/pds-textarea.entry.js +1 -1
- package/dist/esm-es5/pds-textarea.entry.js.map +1 -1
- package/dist/esm-es5/pds-toast.entry.js +1 -1
- package/dist/esm-es5/pds-tooltip.entry.js +1 -1
- package/dist/esm-es5/pine-core.js +1 -1
- package/dist/esm-es5/utils-tJa4KYNO.js +2 -0
- package/dist/esm-es5/utils-tJa4KYNO.js.map +1 -0
- package/dist/pine-core/index.esm.js +1 -1
- package/dist/pine-core/mock-pds-modal.entry.esm.js.map +1 -1
- package/dist/pine-core/{p-fd3b7077.entry.js → p-0066d249.entry.js} +2 -2
- package/dist/pine-core/{p-c5da4a97.system.entry.js → p-0199e3e9.system.entry.js} +2 -2
- package/dist/pine-core/{p-982edcaf.system.entry.js → p-03d17841.system.entry.js} +2 -2
- package/dist/pine-core/p-03d17841.system.entry.js.map +1 -0
- package/dist/pine-core/p-042ee55c.entry.js +2 -0
- package/dist/pine-core/p-042ee55c.entry.js.map +1 -0
- package/dist/pine-core/{p-9d8bb7f7.system.entry.js → p-051ff780.system.entry.js} +2 -2
- package/dist/pine-core/{p-2a2cd90d.entry.js → p-064e3d73.entry.js} +2 -2
- package/dist/pine-core/{p-90a8d1bd.entry.js → p-075eecf9.entry.js} +2 -2
- package/dist/pine-core/{p-3df372d1.entry.js → p-0a4fc9c7.entry.js} +3 -3
- package/dist/pine-core/{p-30449e82.entry.js → p-0dbb2ae9.entry.js} +2 -2
- package/dist/pine-core/{p-667eb50e.entry.js → p-11d4036e.entry.js} +2 -2
- package/dist/pine-core/{p-f29baa16.entry.js → p-126197e5.entry.js} +2 -2
- package/dist/pine-core/{p-b6d18604.entry.js → p-13ac0852.entry.js} +2 -2
- package/dist/pine-core/{p-d64527b2.system.entry.js → p-14b424ab.system.entry.js} +2 -2
- package/dist/pine-core/{p-eef645bd.system.entry.js → p-1858ad6d.system.entry.js} +2 -2
- package/dist/pine-core/p-19d08886.system.entry.js +2 -0
- package/dist/pine-core/p-19d08886.system.entry.js.map +1 -0
- package/dist/pine-core/{p-f7c02b89.entry.js → p-1a5e79af.entry.js} +2 -2
- package/dist/pine-core/p-209b1d69.entry.js +2 -0
- package/dist/pine-core/p-209b1d69.entry.js.map +1 -0
- package/dist/pine-core/p-2436cb86.system.entry.js +2 -0
- package/dist/pine-core/p-2436cb86.system.entry.js.map +1 -0
- package/dist/pine-core/{p-383af1d4.system.entry.js → p-276a6a8b.system.entry.js} +2 -2
- package/dist/pine-core/{p-e7322ff9.system.entry.js → p-280a0ec1.system.entry.js} +2 -2
- package/dist/pine-core/{p-160c6806.system.entry.js → p-2aad0209.system.entry.js} +2 -2
- package/dist/pine-core/{p-357b6dd6.system.entry.js → p-2fb60757.system.entry.js} +2 -2
- package/dist/pine-core/{p-ClrDO1lY.system.js.map → p-2kXtbFXu.system.js.map} +1 -1
- package/dist/pine-core/{p-5a1af174.entry.js → p-33016dd0.entry.js} +2 -2
- package/dist/pine-core/p-380d1056.entry.js +2 -0
- package/dist/pine-core/p-380d1056.entry.js.map +1 -0
- package/dist/pine-core/{p-d451c7b5.system.entry.js → p-39488f2c.system.entry.js} +2 -2
- package/dist/pine-core/p-3EWr6ZgL.system.js.map +1 -0
- package/dist/pine-core/{p-000ed179.entry.js → p-3e6229cc.entry.js} +3 -3
- package/dist/pine-core/{p-e0a6ba6f.system.entry.js → p-3f83d4c4.system.entry.js} +2 -2
- package/dist/pine-core/{p-e8a4eafa.system.entry.js → p-4066a9c0.system.entry.js} +2 -2
- package/dist/pine-core/{p-e8a4eafa.system.entry.js.map → p-4066a9c0.system.entry.js.map} +1 -1
- package/dist/pine-core/{p-2fbc5f8c.system.entry.js → p-41bf807f.system.entry.js} +2 -2
- package/dist/pine-core/{p-91520803.system.entry.js → p-487552a9.system.entry.js} +2 -2
- package/dist/pine-core/{p-b214c043.entry.js → p-4e5b9d19.entry.js} +2 -2
- package/dist/pine-core/{p-62bc2080.system.entry.js → p-51d83489.system.entry.js} +2 -2
- package/dist/pine-core/{p-a4d19fb1.entry.js → p-51e463bf.entry.js} +2 -2
- package/dist/pine-core/{p-a4d19fb1.entry.js.map → p-51e463bf.entry.js.map} +1 -1
- package/dist/pine-core/{p-f4fff209.system.entry.js → p-52af1890.system.entry.js} +2 -2
- package/dist/pine-core/{p-256d15bc.system.entry.js → p-55bf6be2.system.entry.js} +2 -2
- package/dist/pine-core/{p-47a7a65b.entry.js → p-5a709348.entry.js} +2 -2
- package/dist/pine-core/{p-fe73a67f.entry.js → p-63ef55dd.entry.js} +2 -2
- package/dist/pine-core/{p-fe73a67f.entry.js.map → p-63ef55dd.entry.js.map} +1 -1
- package/dist/pine-core/{p-d6b1f60d.system.entry.js → p-6438a29d.system.entry.js} +2 -2
- package/dist/pine-core/p-65275835.system.entry.js +2 -0
- package/dist/pine-core/p-65275835.system.entry.js.map +1 -0
- package/dist/pine-core/{p-6ef51211.entry.js → p-66b10d29.entry.js} +2 -2
- package/dist/pine-core/p-6bd5811c.system.entry.js +2 -0
- package/dist/pine-core/p-6bd5811c.system.entry.js.map +1 -0
- package/dist/pine-core/{p-b93825c4.system.entry.js → p-6d601fc2.system.entry.js} +2 -2
- package/dist/pine-core/{p-5fdbbab9.entry.js → p-6fd385ec.entry.js} +2 -2
- package/dist/pine-core/{p-7da6180d.system.entry.js → p-7a95a90f.system.entry.js} +2 -2
- package/dist/pine-core/{p-d989287d.entry.js → p-7c867f1b.entry.js} +2 -2
- package/dist/pine-core/{p-e416f7a8.system.entry.js → p-7eb4ac7c.system.entry.js} +2 -2
- package/dist/pine-core/{p-61b7ff04.system.entry.js → p-8096b988.system.entry.js} +2 -2
- package/dist/pine-core/p-8096b988.system.entry.js.map +1 -0
- package/dist/pine-core/{p-e53547e2.system.entry.js → p-81a28f54.system.entry.js} +2 -2
- package/dist/pine-core/{p-faaa1caa.system.entry.js → p-89d9f273.system.entry.js} +3 -3
- package/dist/pine-core/{p-36d3352a.entry.js → p-8cb99f2f.entry.js} +2 -2
- package/dist/pine-core/{p-82388e60.entry.js → p-91c6bd68.entry.js} +2 -2
- package/dist/pine-core/{p-64c897bb.entry.js → p-94982c57.entry.js} +2 -2
- package/dist/pine-core/{p-ef08f005.entry.js → p-978e722a.entry.js} +2 -2
- package/dist/pine-core/{p-cc15bf6c.system.entry.js → p-9860d0a8.system.entry.js} +2 -2
- package/dist/pine-core/p-987a7e4f.entry.js +2 -0
- package/dist/pine-core/p-987a7e4f.entry.js.map +1 -0
- package/dist/pine-core/{p-Bgszb25I.system.js.map → p-ACQU83St.system.js.map} +1 -1
- package/dist/pine-core/p-B0PUl1_1.system.js.map +1 -0
- package/dist/pine-core/{p-Cly-fzRE.system.js.map → p-B4ww2WM0.system.js.map} +1 -1
- package/dist/pine-core/{p-ydqm5FGv.system.js.map → p-B6IFMveo.system.js.map} +1 -1
- package/dist/pine-core/{p-B2gfQpwn.system.js.map → p-B7S-9dbT.system.js.map} +1 -1
- package/dist/pine-core/{p-DKGUedTE.system.js.map → p-BCZ4LK15.system.js.map} +1 -1
- package/dist/pine-core/{p-CLscfXhT.system.js.map → p-BEky6idI.system.js.map} +1 -1
- package/dist/pine-core/p-BG6uGRQj.system.js +2 -0
- package/dist/pine-core/p-BG6uGRQj.system.js.map +1 -0
- package/dist/pine-core/p-BGbUqsWH.system.js +2 -0
- package/dist/pine-core/p-BGbUqsWH.system.js.map +1 -0
- package/dist/pine-core/p-BVCWKPy3.js +3 -0
- package/dist/pine-core/p-BVCWKPy3.js.map +1 -0
- package/dist/pine-core/{p-B-xQ7Q5Y.system.js.map → p-BY7O1nGC.system.js.map} +1 -1
- package/dist/pine-core/p-B_C-mRjx.system.js +3 -0
- package/dist/pine-core/p-B_C-mRjx.system.js.map +1 -0
- package/dist/pine-core/{p-PwBWYqtO.system.js.map → p-B_c-HOvq.system.js.map} +1 -1
- package/dist/pine-core/p-BdBU6s5P.system.js.map +1 -0
- package/dist/pine-core/p-BmoX08WO.system.js.map +1 -0
- package/dist/pine-core/{p-Ci1ZzxGS.system.js.map → p-Bw9e5h_G.system.js.map} +1 -1
- package/dist/pine-core/{p-b6lYO9O3.system.js.map → p-C36pvE-A.system.js.map} +1 -1
- package/dist/pine-core/{p-CaJHqbdu.system.js.map → p-C3lnYhcV.system.js.map} +1 -1
- package/dist/pine-core/{p-CtuIf6LK.system.js.map → p-C5Wo1bN2.system.js.map} +1 -1
- package/dist/pine-core/{p-CTJnwc4I.system.js.map → p-C5Y492i0.system.js.map} +1 -1
- package/dist/pine-core/{p-lWwPttyv.system.js.map → p-CG_aggl0.system.js.map} +1 -1
- package/dist/pine-core/{p-zZHye4hT.system.js.map → p-CMLxdmO2.system.js.map} +1 -1
- package/dist/pine-core/{p-C47kwjaJ.system.js.map → p-CNOeJ6ra.system.js.map} +1 -1
- package/dist/pine-core/p-CXLBzkzl.system.js.map +1 -0
- package/dist/pine-core/{p-DQCWs_Ih.system.js.map → p-CbDQeXQ4.system.js.map} +1 -1
- package/dist/pine-core/{p-Bdnq3aMi.system.js.map → p-ChslVme6.system.js.map} +1 -1
- package/dist/pine-core/p-CmJBNVRO.system.js.map +1 -0
- package/dist/pine-core/{p-BPlIGHM4.system.js.map → p-CoHBlcHu.system.js.map} +1 -1
- package/dist/pine-core/{p-DX9uSGoE.system.js.map → p-CqzGa2j0.system.js.map} +1 -1
- package/dist/pine-core/{p-y1DacLeb.system.js.map → p-DCdSlcTO.system.js.map} +1 -1
- package/dist/pine-core/{p-mWJg54bF.system.js.map → p-DKuFjXiD.system.js.map} +1 -1
- package/dist/pine-core/{p-PuPjQNmU.system.js.map → p-DMNp4slx.system.js.map} +1 -1
- package/dist/pine-core/{p-CD40xhZg.system.js.map → p-DQ-QGnGf.system.js.map} +1 -1
- package/dist/pine-core/{p-DwwM3-D4.system.js.map → p-DQnK6lQ2.system.js.map} +1 -1
- package/dist/pine-core/{p-Gn2xhxDz.system.js.map → p-DRqkTTfb.system.js.map} +1 -1
- package/dist/pine-core/{p-CuHZffVk.system.js.map → p-DXuK7cEc.system.js.map} +1 -1
- package/dist/pine-core/{p-B-hSZadO.system.js.map → p-DYb5Y47j.system.js.map} +1 -1
- package/dist/pine-core/{p-D1LdgjO0.system.js.map → p-DdEbUZw3.system.js.map} +1 -1
- package/dist/pine-core/p-De9tROL-.system.js +2 -0
- package/dist/pine-core/{p-BsL2GDnH.system.js.map → p-De9tROL-.system.js.map} +1 -1
- package/dist/pine-core/p-DgMvQlxU.system.js.map +1 -0
- package/dist/pine-core/{p-BJRnZhwF.system.js.map → p-DvZWnvRb.system.js.map} +1 -1
- package/dist/pine-core/{p-ipxZYSGJ.system.js.map → p-EytFbMH4.system.js.map} +1 -1
- package/dist/pine-core/{p-Bpn2QYa2.system.js.map → p-KkT5zjJU.system.js.map} +1 -1
- package/dist/pine-core/{p-Bok_Wwo5.system.js.map → p-PgQPKVDh.system.js.map} +1 -1
- package/dist/pine-core/{p-BSg_Clcf.system.js.map → p-REBgf8JA.system.js.map} +1 -1
- package/dist/pine-core/{p-6tdMlyau.system.js.map → p-XHvXi3U6.system.js.map} +1 -1
- package/dist/pine-core/{p-2f0aedfa.entry.js → p-a2d16624.entry.js} +2 -2
- package/dist/pine-core/{p-3b43a1ea.entry.js → p-a54f1d9e.entry.js} +2 -2
- package/dist/pine-core/p-a7204f01.entry.js +2 -0
- package/dist/pine-core/p-a7cb24c3.system.entry.js +2 -0
- package/dist/pine-core/p-a7cb24c3.system.entry.js.map +1 -0
- package/dist/pine-core/p-aafb6e06.system.entry.js +2 -0
- package/dist/pine-core/p-aafb6e06.system.entry.js.map +1 -0
- package/dist/pine-core/{p-9df7ba40.system.entry.js → p-adf2449e.system.entry.js} +2 -2
- package/dist/pine-core/{p-e0a35811.system.entry.js → p-b2b405ca.system.entry.js} +3 -3
- package/dist/pine-core/p-b649d711.entry.js +2 -0
- package/dist/pine-core/p-b649d711.entry.js.map +1 -0
- package/dist/pine-core/{p-d21156cf.entry.js → p-b956922a.entry.js} +2 -2
- package/dist/pine-core/{p-5706c81b.system.entry.js → p-b9fe17b8.system.entry.js} +2 -2
- package/dist/pine-core/{p-af5c9fbd.system.entry.js → p-c1099665.system.entry.js} +2 -2
- package/dist/pine-core/{p-0c6e9ba0.system.entry.js → p-c1115d78.system.entry.js} +2 -2
- package/dist/pine-core/{p-6d36fae0.entry.js → p-c16d01cc.entry.js} +2 -2
- package/dist/pine-core/{p-b5dc7a18.entry.js → p-c1a1475e.entry.js} +2 -2
- package/dist/pine-core/{p-27b52fc5.entry.js → p-c1f5148f.entry.js} +2 -2
- package/dist/pine-core/p-c1f5148f.entry.js.map +1 -0
- package/dist/pine-core/{p-9e22eab5.system.entry.js → p-c3f32f26.system.entry.js} +2 -2
- package/dist/pine-core/{p-9e22eab5.system.entry.js.map → p-c3f32f26.system.entry.js.map} +1 -1
- package/dist/pine-core/{p-5033d9e8.entry.js → p-c652847a.entry.js} +2 -2
- package/dist/pine-core/{p-31fe86a6.entry.js → p-c7075f11.entry.js} +2 -2
- package/dist/pine-core/p-c7075f11.entry.js.map +1 -0
- package/dist/pine-core/p-c721e8cf.entry.js +2 -0
- package/dist/pine-core/p-c721e8cf.entry.js.map +1 -0
- package/dist/pine-core/{p-4d22ca40.entry.js → p-c82c277f.entry.js} +2 -2
- package/dist/pine-core/{p-f9005ac9.entry.js → p-c82d0a99.entry.js} +2 -2
- package/dist/pine-core/{p-c93786f1.system.entry.js → p-ce0d9f05.system.entry.js} +2 -2
- package/dist/pine-core/{p-9b8a3659.system.entry.js → p-cf5506db.system.entry.js} +2 -2
- package/dist/pine-core/{p-c5a7c8e9.system.entry.js → p-d08ecd18.system.entry.js} +2 -2
- package/dist/pine-core/{p-4a69106a.system.entry.js → p-d6d87fbc.system.entry.js} +2 -2
- package/dist/pine-core/{p-80246c79.entry.js → p-df15e16a.entry.js} +2 -2
- package/dist/pine-core/{p-d0ec666b.entry.js → p-e05135c5.entry.js} +2 -2
- package/dist/pine-core/{p-39fbd912.entry.js → p-e30601a6.entry.js} +2 -2
- package/dist/pine-core/{p-1e056ca3.system.entry.js → p-e3fb0bc2.system.entry.js} +2 -2
- package/dist/pine-core/{p-3bbb6fc1.entry.js → p-e8d76117.entry.js} +2 -2
- package/dist/pine-core/{p-f30b1479.entry.js → p-ed94947b.entry.js} +2 -2
- package/dist/pine-core/{p-822e90ee.entry.js → p-f35a5afa.entry.js} +2 -2
- package/dist/pine-core/{p-9cc1844a.system.entry.js → p-f647c1af.system.entry.js} +2 -2
- package/dist/pine-core/{p-1ef5f46b.system.entry.js → p-f9bd0bc2.system.entry.js} +2 -2
- package/dist/pine-core/{p-7a431264.system.entry.js → p-ffe867ef.system.entry.js} +2 -2
- package/dist/pine-core/{p-U_efBpHV.system.js.map → p-lMetQ5Q0.system.js.map} +1 -1
- package/dist/pine-core/{p-Bq1H4MPi.system.js.map → p-pm8ElBzm.system.js.map} +1 -1
- package/dist/pine-core/p-qjvXmIGJ.system.js.map +1 -0
- package/dist/pine-core/p-tJa4KYNO.js +2 -0
- package/dist/pine-core/p-tJa4KYNO.js.map +1 -0
- package/dist/pine-core/pds-box.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-button.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-checkbox.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-input.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-modal.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-radio.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-select.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-switch.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-textarea.entry.esm.js.map +1 -1
- package/dist/pine-core/pine-core.esm.js +1 -1
- package/dist/pine-core/pine-core.js +1 -1
- package/dist/types/components/pds-box/pds-box.d.ts +2 -1
- package/dist/types/components/pds-checkbox/pds-checkbox.d.ts +6 -0
- package/dist/types/components/pds-input/pds-input.d.ts +22 -0
- package/dist/types/components/pds-select/pds-select.d.ts +19 -0
- package/dist/types/components/pds-switch/pds-switch.d.ts +6 -0
- package/dist/types/components/pds-textarea/pds-textarea.d.ts +17 -0
- package/dist/types/components.d.ts +12 -4
- package/dist/types/utils/utils.d.ts +10 -3
- package/hydrate/index.js +359 -67
- package/hydrate/index.mjs +359 -67
- package/package.json +2 -2
- package/dist/cjs/index-CxX7ua5d.js.map +0 -1
- package/dist/cjs/utils-jWx-Mf12.js +0 -45
- package/dist/cjs/utils-jWx-Mf12.js.map +0 -1
- package/dist/esm/index-Uh5ntVcq.js.map +0 -1
- package/dist/esm/utils-DkabwBZT.js +0 -41
- package/dist/esm/utils-DkabwBZT.js.map +0 -1
- package/dist/esm-es5/index-Uh5ntVcq.js +0 -3
- package/dist/esm-es5/index-Uh5ntVcq.js.map +0 -1
- package/dist/esm-es5/utils-DkabwBZT.js +0 -2
- package/dist/esm-es5/utils-DkabwBZT.js.map +0 -1
- package/dist/pine-core/p-27b52fc5.entry.js.map +0 -1
- package/dist/pine-core/p-307b456a.entry.js +0 -2
- package/dist/pine-core/p-307b456a.entry.js.map +0 -1
- package/dist/pine-core/p-31fe86a6.entry.js.map +0 -1
- package/dist/pine-core/p-38248640.entry.js +0 -2
- package/dist/pine-core/p-38248640.entry.js.map +0 -1
- package/dist/pine-core/p-3fd658ad.system.entry.js +0 -2
- package/dist/pine-core/p-3fd658ad.system.entry.js.map +0 -1
- package/dist/pine-core/p-447fa824.system.entry.js +0 -2
- package/dist/pine-core/p-447fa824.system.entry.js.map +0 -1
- package/dist/pine-core/p-495a206d.entry.js +0 -2
- package/dist/pine-core/p-495a206d.entry.js.map +0 -1
- package/dist/pine-core/p-61b7ff04.system.entry.js.map +0 -1
- package/dist/pine-core/p-708c66c2.entry.js +0 -2
- package/dist/pine-core/p-708c66c2.entry.js.map +0 -1
- package/dist/pine-core/p-73412ca9.system.entry.js +0 -2
- package/dist/pine-core/p-73412ca9.system.entry.js.map +0 -1
- package/dist/pine-core/p-982edcaf.system.entry.js.map +0 -1
- package/dist/pine-core/p-BHZ6CSg4.system.js.map +0 -1
- package/dist/pine-core/p-BhPuKJbQ.system.js +0 -2
- package/dist/pine-core/p-BhPuKJbQ.system.js.map +0 -1
- package/dist/pine-core/p-BlpTiOHo.system.js.map +0 -1
- package/dist/pine-core/p-BsL2GDnH.system.js +0 -2
- package/dist/pine-core/p-CLsVcJCa.system.js.map +0 -1
- package/dist/pine-core/p-CUHK9C55.system.js.map +0 -1
- package/dist/pine-core/p-C_8VmA8d.system.js +0 -3
- package/dist/pine-core/p-C_8VmA8d.system.js.map +0 -1
- package/dist/pine-core/p-Ctwx2R4g.system.js.map +0 -1
- package/dist/pine-core/p-CuIq_L5Z.system.js +0 -2
- package/dist/pine-core/p-CuIq_L5Z.system.js.map +0 -1
- package/dist/pine-core/p-DJPo1iGw.system.js.map +0 -1
- package/dist/pine-core/p-DNqc41uY.system.js.map +0 -1
- package/dist/pine-core/p-DkabwBZT.js +0 -2
- package/dist/pine-core/p-DkabwBZT.js.map +0 -1
- package/dist/pine-core/p-DxydR7R6.system.js.map +0 -1
- package/dist/pine-core/p-Uh5ntVcq.js +0 -3
- package/dist/pine-core/p-Uh5ntVcq.js.map +0 -1
- package/dist/pine-core/p-d2d6b3a6.system.entry.js +0 -2
- package/dist/pine-core/p-d2d6b3a6.system.entry.js.map +0 -1
- package/dist/pine-core/p-e68dd704.system.entry.js +0 -2
- package/dist/pine-core/p-e68dd704.system.entry.js.map +0 -1
- package/dist/pine-core/p-ec1c3452.system.entry.js +0 -2
- package/dist/pine-core/p-ec1c3452.system.entry.js.map +0 -1
- package/dist/pine-core/p-ee0117a2.entry.js +0 -2
- package/dist/pine-core/p-ee0117a2.entry.js.map +0 -1
- package/dist/pine-core/p-f256dd8a.entry.js +0 -2
- package/dist/pine-core/p-f256dd8a.entry.js.map +0 -1
- package/dist/pine-core/p-f455deb5.entry.js +0 -2
- /package/dist/pine-core/{p-fd3b7077.entry.js.map → p-0066d249.entry.js.map} +0 -0
- /package/dist/pine-core/{p-c5da4a97.system.entry.js.map → p-0199e3e9.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-9d8bb7f7.system.entry.js.map → p-051ff780.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-2a2cd90d.entry.js.map → p-064e3d73.entry.js.map} +0 -0
- /package/dist/pine-core/{p-90a8d1bd.entry.js.map → p-075eecf9.entry.js.map} +0 -0
- /package/dist/pine-core/{p-3df372d1.entry.js.map → p-0a4fc9c7.entry.js.map} +0 -0
- /package/dist/pine-core/{p-30449e82.entry.js.map → p-0dbb2ae9.entry.js.map} +0 -0
- /package/dist/pine-core/{p-667eb50e.entry.js.map → p-11d4036e.entry.js.map} +0 -0
- /package/dist/pine-core/{p-f29baa16.entry.js.map → p-126197e5.entry.js.map} +0 -0
- /package/dist/pine-core/{p-b6d18604.entry.js.map → p-13ac0852.entry.js.map} +0 -0
- /package/dist/pine-core/{p-d64527b2.system.entry.js.map → p-14b424ab.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-eef645bd.system.entry.js.map → p-1858ad6d.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-f7c02b89.entry.js.map → p-1a5e79af.entry.js.map} +0 -0
- /package/dist/pine-core/{p-383af1d4.system.entry.js.map → p-276a6a8b.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-e7322ff9.system.entry.js.map → p-280a0ec1.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-160c6806.system.entry.js.map → p-2aad0209.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-357b6dd6.system.entry.js.map → p-2fb60757.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-5a1af174.entry.js.map → p-33016dd0.entry.js.map} +0 -0
- /package/dist/pine-core/{p-d451c7b5.system.entry.js.map → p-39488f2c.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-000ed179.entry.js.map → p-3e6229cc.entry.js.map} +0 -0
- /package/dist/pine-core/{p-e0a6ba6f.system.entry.js.map → p-3f83d4c4.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-2fbc5f8c.system.entry.js.map → p-41bf807f.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-91520803.system.entry.js.map → p-487552a9.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-b214c043.entry.js.map → p-4e5b9d19.entry.js.map} +0 -0
- /package/dist/pine-core/{p-62bc2080.system.entry.js.map → p-51d83489.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-f4fff209.system.entry.js.map → p-52af1890.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-256d15bc.system.entry.js.map → p-55bf6be2.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-47a7a65b.entry.js.map → p-5a709348.entry.js.map} +0 -0
- /package/dist/pine-core/{p-d6b1f60d.system.entry.js.map → p-6438a29d.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-6ef51211.entry.js.map → p-66b10d29.entry.js.map} +0 -0
- /package/dist/pine-core/{p-b93825c4.system.entry.js.map → p-6d601fc2.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-5fdbbab9.entry.js.map → p-6fd385ec.entry.js.map} +0 -0
- /package/dist/pine-core/{p-7da6180d.system.entry.js.map → p-7a95a90f.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-d989287d.entry.js.map → p-7c867f1b.entry.js.map} +0 -0
- /package/dist/pine-core/{p-e416f7a8.system.entry.js.map → p-7eb4ac7c.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-e53547e2.system.entry.js.map → p-81a28f54.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-faaa1caa.system.entry.js.map → p-89d9f273.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-36d3352a.entry.js.map → p-8cb99f2f.entry.js.map} +0 -0
- /package/dist/pine-core/{p-82388e60.entry.js.map → p-91c6bd68.entry.js.map} +0 -0
- /package/dist/pine-core/{p-64c897bb.entry.js.map → p-94982c57.entry.js.map} +0 -0
- /package/dist/pine-core/{p-ef08f005.entry.js.map → p-978e722a.entry.js.map} +0 -0
- /package/dist/pine-core/{p-cc15bf6c.system.entry.js.map → p-9860d0a8.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-2f0aedfa.entry.js.map → p-a2d16624.entry.js.map} +0 -0
- /package/dist/pine-core/{p-3b43a1ea.entry.js.map → p-a54f1d9e.entry.js.map} +0 -0
- /package/dist/pine-core/{p-f455deb5.entry.js.map → p-a7204f01.entry.js.map} +0 -0
- /package/dist/pine-core/{p-9df7ba40.system.entry.js.map → p-adf2449e.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-e0a35811.system.entry.js.map → p-b2b405ca.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-d21156cf.entry.js.map → p-b956922a.entry.js.map} +0 -0
- /package/dist/pine-core/{p-5706c81b.system.entry.js.map → p-b9fe17b8.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-af5c9fbd.system.entry.js.map → p-c1099665.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-0c6e9ba0.system.entry.js.map → p-c1115d78.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-6d36fae0.entry.js.map → p-c16d01cc.entry.js.map} +0 -0
- /package/dist/pine-core/{p-b5dc7a18.entry.js.map → p-c1a1475e.entry.js.map} +0 -0
- /package/dist/pine-core/{p-5033d9e8.entry.js.map → p-c652847a.entry.js.map} +0 -0
- /package/dist/pine-core/{p-4d22ca40.entry.js.map → p-c82c277f.entry.js.map} +0 -0
- /package/dist/pine-core/{p-f9005ac9.entry.js.map → p-c82d0a99.entry.js.map} +0 -0
- /package/dist/pine-core/{p-c93786f1.system.entry.js.map → p-ce0d9f05.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-9b8a3659.system.entry.js.map → p-cf5506db.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-c5a7c8e9.system.entry.js.map → p-d08ecd18.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-4a69106a.system.entry.js.map → p-d6d87fbc.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-80246c79.entry.js.map → p-df15e16a.entry.js.map} +0 -0
- /package/dist/pine-core/{p-d0ec666b.entry.js.map → p-e05135c5.entry.js.map} +0 -0
- /package/dist/pine-core/{p-39fbd912.entry.js.map → p-e30601a6.entry.js.map} +0 -0
- /package/dist/pine-core/{p-1e056ca3.system.entry.js.map → p-e3fb0bc2.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-3bbb6fc1.entry.js.map → p-e8d76117.entry.js.map} +0 -0
- /package/dist/pine-core/{p-f30b1479.entry.js.map → p-ed94947b.entry.js.map} +0 -0
- /package/dist/pine-core/{p-822e90ee.entry.js.map → p-f35a5afa.entry.js.map} +0 -0
- /package/dist/pine-core/{p-9cc1844a.system.entry.js.map → p-f647c1af.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-1ef5f46b.system.entry.js.map → p-f9bd0bc2.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-7a431264.system.entry.js.map → p-ffe867ef.system.entry.js.map} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { normalizeColorValue } from "../../utils/utils";
|
|
2
3
|
export class PdsBox {
|
|
3
4
|
constructor() {
|
|
4
5
|
/**
|
|
@@ -17,7 +18,7 @@ export class PdsBox {
|
|
|
17
18
|
${this.display !== undefined && this.display.trim() !== '' ? `pds-box--display-${this.display}` : ''}
|
|
18
19
|
${this.fit ? 'pds-box--fit' : ''}
|
|
19
20
|
${this.gap !== undefined && this.gap.trim() !== '' ? `pds-box-gap-${this.gap}` : ''}
|
|
20
|
-
${this.flex !== undefined && this.flex.trim() !== '' ? `pds-box--flex-${this.flex}` : ''}
|
|
21
|
+
${this.flex !== undefined && this.flex.trim() !== '' && ['none', 'grow', 'shrink'].includes(this.flex) ? `pds-box--flex-${this.flex}` : ''}
|
|
21
22
|
${this.justifyContent !== undefined && this.justifyContent.trim() !== '' ? `pds-justify-content-${this.justifyContent}` : ''}
|
|
22
23
|
${this.marginBlockStart !== undefined && this.marginBlockStart.trim() !== '' ? `pds-margin-block-start-${this.marginBlockStart}` : ''}
|
|
23
24
|
${this.marginInlineStart !== undefined && this.marginInlineStart.trim() !== '' ? `pds-margin-inline-start-${this.marginInlineStart}` : ''}
|
|
@@ -47,8 +48,11 @@ export class PdsBox {
|
|
|
47
48
|
this.sizeLg == undefined &&
|
|
48
49
|
this.sizeXl == undefined ? 'pds-box' : ''}
|
|
49
50
|
`;
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
// Normalize so pds-box accepts --token, var(--token), or literals (no semantic names)
|
|
52
|
+
const normalizedBackground = normalizeColorValue(this.backgroundColor);
|
|
53
|
+
const normalizedBorder = normalizeColorValue(this.borderColor);
|
|
54
|
+
const boxInlineStyles = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (normalizedBackground && { '--color-background-box': normalizedBackground })), (normalizedBorder && { '--color-border-box': normalizedBorder })), (this.minHeight && { '--sizing-min-height-box': this.minHeight })), (this.minWidth && { '--sizing-min-width-box': this.minWidth })), (this.flex && !['none', 'grow', 'shrink'].includes(this.flex) && { 'flex': this.flex }));
|
|
55
|
+
return (h(Host, { key: 'ba5e7700117f6cf138ce1346676b44c50e746563', class: boxClasses, style: boxInlineStyles }));
|
|
52
56
|
}
|
|
53
57
|
static get is() { return "pds-box"; }
|
|
54
58
|
static get originalStyleUrls() {
|
|
@@ -301,8 +305,8 @@ export class PdsBox {
|
|
|
301
305
|
"type": "string",
|
|
302
306
|
"mutable": false,
|
|
303
307
|
"complexType": {
|
|
304
|
-
"original": "`none` | `grow` | `shrink`",
|
|
305
|
-
"resolved": "
|
|
308
|
+
"original": "`none` | `grow` | `shrink` | string",
|
|
309
|
+
"resolved": "string",
|
|
306
310
|
"references": {}
|
|
307
311
|
},
|
|
308
312
|
"required": false,
|
|
@@ -312,7 +316,7 @@ export class PdsBox {
|
|
|
312
316
|
"name": "defaultValue",
|
|
313
317
|
"text": "none"
|
|
314
318
|
}],
|
|
315
|
-
"text": "Defines how a box will grow or shrink to fit the space available in its container."
|
|
319
|
+
"text": "Defines how a box will grow or shrink to fit the space available in its container.\nCan be a predefined value ('none', 'grow', 'shrink') or a custom flex value (e.g., '1', '0 1 auto')."
|
|
316
320
|
},
|
|
317
321
|
"getter": false,
|
|
318
322
|
"setter": false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-box.js","sourceRoot":"","sources":["../../../src/components/pds-box/pds-box.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAQzD,MAAM,OAAO,MAAM;IAJnB;QA2BE;;WAEG;QACK,WAAM,GAAI,KAAK,CAAC;KA2OzB;IAtDC,MAAM;QACJ,MAAM,UAAU,GAAG;MACjB,IAAI,CAAC,UAAU,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,mBAAmB,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE;MAC1G,I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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Host, Prop } from '@stencil/core';\n\nimport { BoxColumnType, BoxTShirtSizeType, BoxShadowSizeType } from '../../utils/types';\n\n@Component({\n tag: 'pds-box',\n styleUrl: 'pds-box.scss',\n})\nexport class PdsBox {\n /**\n * Defines how items within the box are aligned.\n * @defaultValue start\n */\n @Prop() alignItems?: `start` | `center` | `end` | `baseline` | `stretch`;\n\n /**\n * Defines how the box is aligned within its container.\n * @defaultValue start\n */\n @Prop() alignSelf?: `start` | `center` | `end` | `baseline` | `stretch`;\n\n /**\n * If `true`, the box will be sized to fit its contents.\n */\n @Prop() auto?: boolean;\n\n /**\n * Defines the background-color of the box.\n */\n @Prop() backgroundColor?: string;\n\n /**\n * If `true`, the box will have a border.\n */\n @Prop() border? = false;\n\n /**\n * Defines the border color of the box.\n */\n @Prop() borderColor?: string;\n\n /**\n * Defines how rounded the box corners are.\n * @defaultValue none\n */\n @Prop() borderRadius?: `none` | `xs`| `sm` | `md` | `lg` | `circle`;\n\n /**\n * Defines the orientation of the box items.\n * @defaultValue row\n */\n @Prop() direction?: `row` | `column`;\n\n /**\n * Defines the display style of the box.\n * @defaultValue flex\n */\n @Prop() display?: `flex` | `inline-flex` | `block` | `inline-block`;\n\n /**\n * If `true`, sets the box `max-width` to `100%`.\n */\n @Prop() fit?: boolean;\n\n /**\n * Defines the spacing between the box items.\n * @defaultValue none\n */\n @Prop() gap?: BoxTShirtSizeType;\n\n /**\n * Defines how a box will grow or shrink to fit the space available in its container.\n * @defaultValue none\n */\n @Prop() flex?: `none` | `grow` | `shrink`;\n\n /**\n * Defines the horizontal alignment of the box items.\n * @defaultValue start\n */\n @Prop() justifyContent?: `start` | `center` | `end` | `space-between` | `space-around`;\n\n /**\n * Defines the box's outer top spacing.\n * @defaultValue none\n */\n @Prop() marginBlockStart?: BoxTShirtSizeType;\n\n /**\n * Defines the box's outer left spacing.\n * @defaultValue none\n */\n @Prop() marginInlineStart?: BoxTShirtSizeType;\n\n /**\n * Defines the box's outer right spacing.\n * @defaultValue none\n */\n @Prop() marginInlineEnd?: BoxTShirtSizeType;\n\n /**\n * Defines the box's outer bottom spacing.\n * @defaultValue none\n */\n @Prop() marginBlockEnd?: BoxTShirtSizeType;\n\n /**\n * The minimum height of the row. Used in conjunction with alignment props\n */\n @Prop() minHeight?: string;\n\n /**\n * The minimum width of the row. Used in conjunction with alignment props\n */\n @Prop() minWidth?: string;\n\n /**\n * Move columns to the end direction of the row for all screen sizes. Increases the starting margin of a column by specified number of columns.\n */\n @Prop() offset?: BoxColumnType;\n\n /**\n * Move columns to the end direction of the row for `XS` screen sizes. Increases the starting margin of a column by specified number of columns.\n */\n @Prop() offsetXs?: BoxColumnType;\n\n /**\n * Move columns to the end direction of the row for `SM` screen sizes. Increases the starting margin of a column by specified number of columns.\n */\n @Prop() offsetSm?: BoxColumnType;\n\n /**\n * Move columns to the end direction of the row for `MD` screen sizes. Increases the starting margin of a column by specified number of columns.\n */\n @Prop() offsetMd?: BoxColumnType;\n\n /**\n * Move columns to the end direction of the row for `LG` screen sizes. Increases the starting margin of a column by specified number of columns.\n */\n @Prop() offsetLg?: BoxColumnType;\n\n /**\n * Move columns to the end direction of the row for `XL` screen sizes. Increases the starting margin of a column by specified number of columns.\n */\n @Prop() offsetXl?: BoxColumnType;\n\n /**\n * Defines the spacing between the box items.\n * @defaultValue none\n */\n @Prop() padding?: BoxTShirtSizeType;\n\n\n /**\n * Defines the top spacing.\n * @defaultValue none\n */\n @Prop() paddingBlockStart?: BoxTShirtSizeType;\n\n /**\n * Defines the bottom spacing.\n * @defaultValue none\n */\n @Prop() paddingBlockEnd?: BoxTShirtSizeType;\n\n /**\n * Defines the left spacing.\n * @defaultValue none\n */\n @Prop() paddingInlineStart?: BoxTShirtSizeType;\n\n /**\n * Defines the right spacing.\n * @defaultValue none\n */\n @Prop() paddingInlineEnd?: BoxTShirtSizeType;\n\n /**\n * Defines the box shadow.\n * @defaultValue none\n */\n @Prop() shadow?: BoxShadowSizeType;\n\n /**\n * Sets the default column width for the component. This value applies from the smallest screen size (XS) upwards, unless overridden by a breakpoint-specific size prop at that breakpoint or larger.\n */\n @Prop() size?: BoxColumnType;\n\n /**\n * At the XS breakpoint, this prop will take the number of columns specified. This overrides the base size prop for this specific range.\n */\n @Prop() sizeXs?: BoxColumnType;\n\n /**\n * At screen sizes from the SM breakpoint and larger (576px and up), this will take the specified number of columns. This overrides any value set by size or sizeXs.\n */\n @Prop() sizeSm?: BoxColumnType;\n\n /**\n * At screen sizes from the MD breakpoint and larger (768px and up), this will take the specified number of columns. This overrides any value set by size, sizeXs, and up.\n */\n @Prop() sizeMd?: BoxColumnType;\n\n /**\n * At screen sizes from the LG breakpoint and larger (992px and up), this will take the specified number of columns. This overrides any value set by size, sizeXs, and up.\n */\n @Prop() sizeLg?: BoxColumnType;\n\n /**\n * At screen sizes from the XL breakpoint and larger (1200px and up), this will take the specified number of columns. This overrides any value set by size, sizeXs, and up.\n */\n @Prop() sizeXl?: BoxColumnType;\n\n\n\n render() {\n const boxClasses = `\n ${this.alignItems !== undefined && this.alignItems.trim() !== '' ? `pds-align-items-${this.alignItems}` : ''}\n ${this.alignSelf !== undefined && this.alignSelf.trim() !== '' ? `pds-align-self-${this.alignSelf}` : ''}\n ${this.auto ? 'pds-box--auto' : ''}\n ${this.border ? 'pds-box--border' : ''}\n ${this.borderRadius !== undefined && this.borderRadius.trim() !== '' ? `pds-border-radius-${this.borderRadius}` : ''}\n ${this.direction !== undefined && this.direction.trim() !== '' ? `pds-box-direction-${this.direction}` : ''}\n ${this.display !== undefined && this.display.trim() !== '' ? `pds-box--display-${this.display}` : ''}\n ${this.fit ? 'pds-box--fit' : ''}\n ${this.gap !== undefined && this.gap.trim() !== '' ? `pds-box-gap-${this.gap}` : ''}\n ${this.flex !== undefined && this.flex.trim() !== '' ? `pds-box--flex-${this.flex}` : ''}\n ${this.justifyContent !== undefined && this.justifyContent.trim() !== '' ? `pds-justify-content-${this.justifyContent}` : ''}\n ${this.marginBlockStart !== undefined && this.marginBlockStart.trim() !== '' ? `pds-margin-block-start-${this.marginBlockStart}` : ''}\n ${this.marginInlineStart !== undefined && this.marginInlineStart.trim() !== '' ? `pds-margin-inline-start-${this.marginInlineStart}` : ''}\n ${this.marginInlineEnd !== undefined && this.marginInlineEnd.trim() !== '' ? `pds-margin-inline-end-${this.marginInlineEnd}` : ''}\n ${this.marginBlockEnd !== undefined && this.marginBlockEnd.trim() !== '' ? `pds-margin-block-end-${this.marginBlockEnd}` : ''}\n ${this.offset !== undefined && this.offset.trim() !== '' ? `pds-box-offset-${this.offset}` : ''}\n ${this.offsetXs !== undefined && this.offsetXs.trim() !== '' ? `pds-box-offset-xs-${this.offsetXs}` : ''}\n ${this.offsetSm !== undefined && this.offsetSm.trim() !== '' ? `pds-box-offset-sm-${this.offsetSm}` : ''}\n ${this.offsetMd !== undefined && this.offsetMd.trim() !== '' ? `pds-box-offset-md-${this.offsetMd}` : ''}\n ${this.offsetLg !== undefined && this.offsetLg.trim() !== '' ? `pds-box-offset-lg-${this.offsetLg}` : ''}\n ${this.offsetXl !== undefined && this.offsetXl.trim() !== '' ? `pds-box-offset-xl-${this.offsetXl}` : ''}\n ${this.padding !== undefined && this.padding.trim() !== '' ? `pds-padding-${this.padding}` : ''}\n ${this.paddingBlockStart !== undefined && this.paddingBlockStart.trim() !== '' ? `pds-padding-block-start-${this.paddingBlockStart}` : ''}\n ${this.paddingBlockEnd !== undefined && this.paddingBlockEnd.trim() !== '' ? `pds-padding-block-end-${this.paddingBlockEnd}` : ''}\n ${this.paddingInlineStart !== undefined && this.paddingInlineStart.trim() !== '' ? `pds-padding-inline-start-${this.paddingInlineStart}` : ''}\n ${this.paddingInlineEnd !== undefined && this.paddingInlineEnd.trim() !== '' ? `pds-padding-inline-end-${this.paddingInlineEnd}` : ''}\n ${this.shadow !== undefined && this.shadow.trim() !== '' ? `pds-shadow-${this.shadow}` : ''}\n ${this.size !== undefined && this.size.trim() !== '' ? `pds-box pds-box-${this.size}` : ''}\n ${this.sizeXs !== undefined && this.sizeXs.trim() !== '' ? `pds-box-xs-${this.sizeXs}` : ''}\n ${this.sizeSm !== undefined && this.sizeSm.trim() !== '' ? `pds-box-sm-${this.sizeSm}` : ''}\n ${this.sizeMd !== undefined && this.sizeMd.trim() !== '' ? `pds-box-md-${this.sizeMd}` : ''}\n ${this.sizeLg !== undefined && this.sizeLg.trim() !== '' ? `pds-box-lg-${this.sizeLg}` : ''}\n ${this.sizeXl !== undefined && this.sizeXl.trim() !== '' ? `pds-box-xl-${this.sizeXl}` : ''}\n ${this.size == undefined &&\n this.sizeSm == undefined &&\n this.sizeMd == undefined &&\n this.sizeLg == undefined &&\n this.sizeXl == undefined ? 'pds-box' : ''}\n `;\n\n const boxInlineStyles = {\n ...(this.backgroundColor && { '--color-background-box': this.backgroundColor }),\n ...(this.borderColor && { '--color-border-box': this.borderColor }),\n ...(this.minHeight && { '--sizing-min-height-box': this.minHeight }),\n ...(this.minWidth && { '--sizing-min-width-box': this.minWidth }),\n };\n\n return (\n <Host class={boxClasses} style={boxInlineStyles}>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pds-box.js","sourceRoot":"","sources":["../../../src/components/pds-box/pds-box.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAGzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAMxD,MAAM,OAAO,MAAM;IAJnB;QA2BE;;WAEG;QACK,WAAM,GAAI,KAAK,CAAC;KAiPzB;IA3DC,MAAM;QACJ,MAAM,UAAU,GAAG;MACjB,IAAI,CAAC,UAAU,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,mBAAmB,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE;MAC1G,IAAI,CAAC,SAAS,KAAK,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,kBAAkB,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE;MACtG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE;MAChC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE;MACpC,IAAI,CAAC,YAAY,KAAK,SAAS,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,qBAAqB,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE;MAClH,IAAI,CAAC,SAAS,KAAK,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Host, Prop } from '@stencil/core';\n\nimport { BoxColumnType, BoxTShirtSizeType, BoxShadowSizeType } from '../../utils/types';\nimport { normalizeColorValue } from '../../utils/utils';\n\n@Component({\n tag: 'pds-box',\n styleUrl: 'pds-box.scss',\n})\nexport class PdsBox {\n /**\n * Defines how items within the box are aligned.\n * @defaultValue start\n */\n @Prop() alignItems?: `start` | `center` | `end` | `baseline` | `stretch`;\n\n /**\n * Defines how the box is aligned within its container.\n * @defaultValue start\n */\n @Prop() alignSelf?: `start` | `center` | `end` | `baseline` | `stretch`;\n\n /**\n * If `true`, the box will be sized to fit its contents.\n */\n @Prop() auto?: boolean;\n\n /**\n * Defines the background-color of the box.\n */\n @Prop() backgroundColor?: string;\n\n /**\n * If `true`, the box will have a border.\n */\n @Prop() border? = false;\n\n /**\n * Defines the border color of the box.\n */\n @Prop() borderColor?: string;\n\n /**\n * Defines how rounded the box corners are.\n * @defaultValue none\n */\n @Prop() borderRadius?: `none` | `xs`| `sm` | `md` | `lg` | `circle`;\n\n /**\n * Defines the orientation of the box items.\n * @defaultValue row\n */\n @Prop() direction?: `row` | `column`;\n\n /**\n * Defines the display style of the box.\n * @defaultValue flex\n */\n @Prop() display?: `flex` | `inline-flex` | `block` | `inline-block`;\n\n /**\n * If `true`, sets the box `max-width` to `100%`.\n */\n @Prop() fit?: boolean;\n\n /**\n * Defines the spacing between the box items.\n * @defaultValue none\n */\n @Prop() gap?: BoxTShirtSizeType;\n\n /**\n * Defines how a box will grow or shrink to fit the space available in its container.\n * Can be a predefined value ('none', 'grow', 'shrink') or a custom flex value (e.g., '1', '0 1 auto').\n * @defaultValue none\n */\n @Prop() flex?: `none` | `grow` | `shrink` | string;\n\n /**\n * Defines the horizontal alignment of the box items.\n * @defaultValue start\n */\n @Prop() justifyContent?: `start` | `center` | `end` | `space-between` | `space-around`;\n\n /**\n * Defines the box's outer top spacing.\n * @defaultValue none\n */\n @Prop() marginBlockStart?: BoxTShirtSizeType;\n\n /**\n * Defines the box's outer left spacing.\n * @defaultValue none\n */\n @Prop() marginInlineStart?: BoxTShirtSizeType;\n\n /**\n * Defines the box's outer right spacing.\n * @defaultValue none\n */\n @Prop() marginInlineEnd?: BoxTShirtSizeType;\n\n /**\n * Defines the box's outer bottom spacing.\n * @defaultValue none\n */\n @Prop() marginBlockEnd?: BoxTShirtSizeType;\n\n /**\n * The minimum height of the row. Used in conjunction with alignment props\n */\n @Prop() minHeight?: string;\n\n /**\n * The minimum width of the row. Used in conjunction with alignment props\n */\n @Prop() minWidth?: string;\n\n /**\n * Move columns to the end direction of the row for all screen sizes. Increases the starting margin of a column by specified number of columns.\n */\n @Prop() offset?: BoxColumnType;\n\n /**\n * Move columns to the end direction of the row for `XS` screen sizes. Increases the starting margin of a column by specified number of columns.\n */\n @Prop() offsetXs?: BoxColumnType;\n\n /**\n * Move columns to the end direction of the row for `SM` screen sizes. Increases the starting margin of a column by specified number of columns.\n */\n @Prop() offsetSm?: BoxColumnType;\n\n /**\n * Move columns to the end direction of the row for `MD` screen sizes. Increases the starting margin of a column by specified number of columns.\n */\n @Prop() offsetMd?: BoxColumnType;\n\n /**\n * Move columns to the end direction of the row for `LG` screen sizes. Increases the starting margin of a column by specified number of columns.\n */\n @Prop() offsetLg?: BoxColumnType;\n\n /**\n * Move columns to the end direction of the row for `XL` screen sizes. Increases the starting margin of a column by specified number of columns.\n */\n @Prop() offsetXl?: BoxColumnType;\n\n /**\n * Defines the spacing between the box items.\n * @defaultValue none\n */\n @Prop() padding?: BoxTShirtSizeType;\n\n\n /**\n * Defines the top spacing.\n * @defaultValue none\n */\n @Prop() paddingBlockStart?: BoxTShirtSizeType;\n\n /**\n * Defines the bottom spacing.\n * @defaultValue none\n */\n @Prop() paddingBlockEnd?: BoxTShirtSizeType;\n\n /**\n * Defines the left spacing.\n * @defaultValue none\n */\n @Prop() paddingInlineStart?: BoxTShirtSizeType;\n\n /**\n * Defines the right spacing.\n * @defaultValue none\n */\n @Prop() paddingInlineEnd?: BoxTShirtSizeType;\n\n /**\n * Defines the box shadow.\n * @defaultValue none\n */\n @Prop() shadow?: BoxShadowSizeType;\n\n /**\n * Sets the default column width for the component. This value applies from the smallest screen size (XS) upwards, unless overridden by a breakpoint-specific size prop at that breakpoint or larger.\n */\n @Prop() size?: BoxColumnType;\n\n /**\n * At the XS breakpoint, this prop will take the number of columns specified. This overrides the base size prop for this specific range.\n */\n @Prop() sizeXs?: BoxColumnType;\n\n /**\n * At screen sizes from the SM breakpoint and larger (576px and up), this will take the specified number of columns. This overrides any value set by size or sizeXs.\n */\n @Prop() sizeSm?: BoxColumnType;\n\n /**\n * At screen sizes from the MD breakpoint and larger (768px and up), this will take the specified number of columns. This overrides any value set by size, sizeXs, and up.\n */\n @Prop() sizeMd?: BoxColumnType;\n\n /**\n * At screen sizes from the LG breakpoint and larger (992px and up), this will take the specified number of columns. This overrides any value set by size, sizeXs, and up.\n */\n @Prop() sizeLg?: BoxColumnType;\n\n /**\n * At screen sizes from the XL breakpoint and larger (1200px and up), this will take the specified number of columns. This overrides any value set by size, sizeXs, and up.\n */\n @Prop() sizeXl?: BoxColumnType;\n\n\n\n render() {\n const boxClasses = `\n ${this.alignItems !== undefined && this.alignItems.trim() !== '' ? `pds-align-items-${this.alignItems}` : ''}\n ${this.alignSelf !== undefined && this.alignSelf.trim() !== '' ? `pds-align-self-${this.alignSelf}` : ''}\n ${this.auto ? 'pds-box--auto' : ''}\n ${this.border ? 'pds-box--border' : ''}\n ${this.borderRadius !== undefined && this.borderRadius.trim() !== '' ? `pds-border-radius-${this.borderRadius}` : ''}\n ${this.direction !== undefined && this.direction.trim() !== '' ? `pds-box-direction-${this.direction}` : ''}\n ${this.display !== undefined && this.display.trim() !== '' ? `pds-box--display-${this.display}` : ''}\n ${this.fit ? 'pds-box--fit' : ''}\n ${this.gap !== undefined && this.gap.trim() !== '' ? `pds-box-gap-${this.gap}` : ''}\n ${this.flex !== undefined && this.flex.trim() !== '' && ['none', 'grow', 'shrink'].includes(this.flex) ? `pds-box--flex-${this.flex}` : ''}\n ${this.justifyContent !== undefined && this.justifyContent.trim() !== '' ? `pds-justify-content-${this.justifyContent}` : ''}\n ${this.marginBlockStart !== undefined && this.marginBlockStart.trim() !== '' ? `pds-margin-block-start-${this.marginBlockStart}` : ''}\n ${this.marginInlineStart !== undefined && this.marginInlineStart.trim() !== '' ? `pds-margin-inline-start-${this.marginInlineStart}` : ''}\n ${this.marginInlineEnd !== undefined && this.marginInlineEnd.trim() !== '' ? `pds-margin-inline-end-${this.marginInlineEnd}` : ''}\n ${this.marginBlockEnd !== undefined && this.marginBlockEnd.trim() !== '' ? `pds-margin-block-end-${this.marginBlockEnd}` : ''}\n ${this.offset !== undefined && this.offset.trim() !== '' ? `pds-box-offset-${this.offset}` : ''}\n ${this.offsetXs !== undefined && this.offsetXs.trim() !== '' ? `pds-box-offset-xs-${this.offsetXs}` : ''}\n ${this.offsetSm !== undefined && this.offsetSm.trim() !== '' ? `pds-box-offset-sm-${this.offsetSm}` : ''}\n ${this.offsetMd !== undefined && this.offsetMd.trim() !== '' ? `pds-box-offset-md-${this.offsetMd}` : ''}\n ${this.offsetLg !== undefined && this.offsetLg.trim() !== '' ? `pds-box-offset-lg-${this.offsetLg}` : ''}\n ${this.offsetXl !== undefined && this.offsetXl.trim() !== '' ? `pds-box-offset-xl-${this.offsetXl}` : ''}\n ${this.padding !== undefined && this.padding.trim() !== '' ? `pds-padding-${this.padding}` : ''}\n ${this.paddingBlockStart !== undefined && this.paddingBlockStart.trim() !== '' ? `pds-padding-block-start-${this.paddingBlockStart}` : ''}\n ${this.paddingBlockEnd !== undefined && this.paddingBlockEnd.trim() !== '' ? `pds-padding-block-end-${this.paddingBlockEnd}` : ''}\n ${this.paddingInlineStart !== undefined && this.paddingInlineStart.trim() !== '' ? `pds-padding-inline-start-${this.paddingInlineStart}` : ''}\n ${this.paddingInlineEnd !== undefined && this.paddingInlineEnd.trim() !== '' ? `pds-padding-inline-end-${this.paddingInlineEnd}` : ''}\n ${this.shadow !== undefined && this.shadow.trim() !== '' ? `pds-shadow-${this.shadow}` : ''}\n ${this.size !== undefined && this.size.trim() !== '' ? `pds-box pds-box-${this.size}` : ''}\n ${this.sizeXs !== undefined && this.sizeXs.trim() !== '' ? `pds-box-xs-${this.sizeXs}` : ''}\n ${this.sizeSm !== undefined && this.sizeSm.trim() !== '' ? `pds-box-sm-${this.sizeSm}` : ''}\n ${this.sizeMd !== undefined && this.sizeMd.trim() !== '' ? `pds-box-md-${this.sizeMd}` : ''}\n ${this.sizeLg !== undefined && this.sizeLg.trim() !== '' ? `pds-box-lg-${this.sizeLg}` : ''}\n ${this.sizeXl !== undefined && this.sizeXl.trim() !== '' ? `pds-box-xl-${this.sizeXl}` : ''}\n ${this.size == undefined &&\n this.sizeSm == undefined &&\n this.sizeMd == undefined &&\n this.sizeLg == undefined &&\n this.sizeXl == undefined ? 'pds-box' : ''}\n `;\n\n // Normalize so pds-box accepts --token, var(--token), or literals (no semantic names)\n const normalizedBackground = normalizeColorValue(this.backgroundColor);\n const normalizedBorder = normalizeColorValue(this.borderColor);\n\n const boxInlineStyles = {\n ...(normalizedBackground && { '--color-background-box': normalizedBackground }),\n ...(normalizedBorder && { '--color-border-box': normalizedBorder }),\n ...(this.minHeight && { '--sizing-min-height-box': this.minHeight }),\n ...(this.minWidth && { '--sizing-min-width-box': this.minWidth }),\n ...(this.flex && !['none', 'grow', 'shrink'].includes(this.flex) && { 'flex': this.flex }),\n };\n\n return (\n <Host class={boxClasses} style={boxInlineStyles}>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
--pds-button-border-radius-start-start: var(--pine-border-radius-full);
|
|
7
7
|
--pds-button-border-radius-end-end: var(--pine-border-radius-full);
|
|
8
8
|
--pds-button-border-radius-end-start: var(--pine-border-radius-full);
|
|
9
|
-
--pds-button-min-height:
|
|
9
|
+
--pds-button-min-height: var(--pine-dimension-450);
|
|
10
10
|
--color-border-default: transparent;
|
|
11
11
|
--color-border-disabled: transparent;
|
|
12
12
|
--color-border-focus: transparent;
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
font: var(--pine-typography-body-brand-label);
|
|
57
57
|
letter-spacing: var(--pine-letter-spacing);
|
|
58
58
|
min-height: var(--pds-button-min-height);
|
|
59
|
-
padding: var(--pine-dimension-xs) var(--pine-dimension-sm);
|
|
59
|
+
padding: calc(var(--pine-dimension-xs) - var(--pine-border-width)) var(--pine-dimension-sm);
|
|
60
60
|
position: relative;
|
|
61
61
|
text-decoration: none;
|
|
62
62
|
}
|
|
@@ -166,6 +166,7 @@
|
|
|
166
166
|
.pds-button__text {
|
|
167
167
|
align-items: center;
|
|
168
168
|
display: inline-flex;
|
|
169
|
+
white-space: nowrap;
|
|
169
170
|
}
|
|
170
171
|
|
|
171
172
|
.pds-button__icon--hidden,
|
|
@@ -15,6 +15,7 @@ export class PdsCheckbox {
|
|
|
15
15
|
}
|
|
16
16
|
const target = e.target;
|
|
17
17
|
this.checked = target.checked;
|
|
18
|
+
this.updateFormValue();
|
|
18
19
|
this.pdsCheckboxChange.emit({
|
|
19
20
|
checked: target.checked,
|
|
20
21
|
value: this.value
|
|
@@ -43,16 +44,53 @@ export class PdsCheckbox {
|
|
|
43
44
|
}
|
|
44
45
|
return classNames.join(' ');
|
|
45
46
|
}
|
|
47
|
+
connectedCallback() {
|
|
48
|
+
if (this.el.attachInternals) {
|
|
49
|
+
this.internals = this.el.attachInternals();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
componentDidLoad() {
|
|
53
|
+
this.updateFormValue();
|
|
54
|
+
}
|
|
55
|
+
checkedChanged() {
|
|
56
|
+
this.updateFormValue();
|
|
57
|
+
}
|
|
58
|
+
updateFormValue() {
|
|
59
|
+
var _a;
|
|
60
|
+
if (typeof jest !== 'undefined' || typeof process !== 'undefined' && ((_a = process.env) === null || _a === void 0 ? void 0 : _a.NODE_ENV) === 'test') {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (this.internals && this.internals.setFormValue) {
|
|
64
|
+
// For checkboxes, only send the value when checked, otherwise send null
|
|
65
|
+
const formValue = this.checked ? (this.value || 'on') : null;
|
|
66
|
+
this.internals.setFormValue(formValue);
|
|
67
|
+
}
|
|
68
|
+
if (this.internals && this.internals.setValidity) {
|
|
69
|
+
this.internals.setValidity({});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
formStateRestoreCallback(state) {
|
|
73
|
+
if (state instanceof FormData) {
|
|
74
|
+
// For checkboxes, restore if the value exists in FormData
|
|
75
|
+
const value = this.value || 'on';
|
|
76
|
+
this.checked = state.get(this.name) === value;
|
|
77
|
+
}
|
|
78
|
+
else if (typeof state === 'string') {
|
|
79
|
+
// Restore from string state
|
|
80
|
+
this.checked = state === (this.value || 'on');
|
|
81
|
+
}
|
|
82
|
+
}
|
|
46
83
|
componentWillLoad() {
|
|
47
84
|
this.inheritedAttributes = Object.assign({}, inheritAriaAttributes(this.el));
|
|
48
85
|
}
|
|
49
86
|
render() {
|
|
50
|
-
return (h(Host, { key: '
|
|
51
|
-
h("div", { key: '
|
|
52
|
-
h("div", { key: '
|
|
87
|
+
return (h(Host, { key: 'f3a4cc998ec87374f2ee2dd91956d3bdd94d18ca', class: this.classNames() }, h("label", { key: '5c8ec6b36e50dedd76b0c23f912091ed40278d0f', htmlFor: this.componentId }, h("input", Object.assign({ key: '0969ba3846816446acc935636176b44aec9d90f5', type: "checkbox", "aria-describedby": assignDescription(this.componentId, this.invalid, this.errorMessage || this.helperMessage), "aria-invalid": this.invalid ? "true" : undefined, id: this.componentId, indeterminate: this.indeterminate, name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onChange: this.handleCheckboxChange, onInput: this.handleInput }, this.inheritedAttributes)), h("span", { key: 'ba47123715955ddad09296fbcfab6a423940f1f3', class: this.hideLabel ? 'visually-hidden' : '' }, this.label)), this.helperMessage &&
|
|
88
|
+
h("div", { key: '942c6ae8e8d77be86480395263dee5071e8132ea', class: 'pds-checkbox__message', id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
|
|
89
|
+
h("div", { key: '74ea1c3b398d072faf9d5359f00bacaa9a0a4169', class: `pds-checkbox__message pds-checkbox__message--error`, id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, h("pds-icon", { key: '9b7aa5f226c169a1cd8e559dc731ea49be7ada6c', icon: danger, size: "small" }), this.errorMessage)));
|
|
53
90
|
}
|
|
54
91
|
static get is() { return "pds-checkbox"; }
|
|
55
92
|
static get encapsulation() { return "shadow"; }
|
|
93
|
+
static get formAssociated() { return true; }
|
|
56
94
|
static get originalStyleUrls() {
|
|
57
95
|
return {
|
|
58
96
|
"$": ["../../global/styles/utils/label.scss", "pds-checkbox.scss"]
|
|
@@ -346,6 +384,9 @@ export class PdsCheckbox {
|
|
|
346
384
|
return [{
|
|
347
385
|
"propName": "checked",
|
|
348
386
|
"methodName": "updateIndeterminate"
|
|
387
|
+
}, {
|
|
388
|
+
"propName": "checked",
|
|
389
|
+
"methodName": "checkedChanged"
|
|
349
390
|
}];
|
|
350
391
|
}
|
|
351
392
|
}
|
|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AC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,IACjD,IAAI,CAAC,KAAK,CACN,CACD;YACP,IAAI,CAAC,aAAa;gBACjB,4DACE,KAAK,EAAE,uBAAuB,EAC9B,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,IAExC,IAAI,CAAC,aAAa,CACf;YAEP,IAAI,CAAC,YAAY;gBAChB,4DACE,KAAK,EAAE,oDAAoD,EAC3D,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,eAC9B,WAAW;oBAErB,iEAAU,IAAI,EAAE,MAAM,EAAE,IAAI,EAAC,OAAO,GAAG;oBACtC,IAAI,CAAC,YAAY,CACd,CAEH,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Prop, Host, Event, EventEmitter, Watch } from '@stencil/core';\nimport { assignDescription, messageId } from '../../utils/form';\nimport { CheckboxChangeEventDetail } from './checkbox-interface';\nimport { danger } from '@pine-ds/icons/icons';\n\nimport { inheritAriaAttributes } from '@utils/attributes';\nimport type { Attributes } from '@utils/attributes';\n\n@Component({\n tag: 'pds-checkbox',\n styleUrls: ['../../global/styles/utils/label.scss', 'pds-checkbox.scss'],\n shadow: true,\n})\nexport class PdsCheckbox {\n private inheritedAttributes: Attributes = {};\n\n @Element() el: HTMLPdsCheckboxElement;\n\n /**\n * It determines whether or not the checkbox is checked.\n */\n @Prop({ mutable: true }) checked?: boolean = false;\n\n /**\n * A unique identifier used for the underlying component `id` attribute and the label `for` attribute.\n */\n @Prop() componentId!: string;\n\n /**\n * It determines whether or not the checkbox is disabled.\n */\n @Prop() disabled: boolean;\n\n /**\n * Displays message text describing an invalid state.\n */\n @Prop() errorMessage: string;\n\n /**\n * String used for helper message below checkbox.\n */\n @Prop() helperMessage: string;\n\n /**\n * If `true`, the checkbox will visually appear as indeterminate.\n * Only JavaScript can set the objects `indeterminate` property. See [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#indeterminate_state_checkboxes).\n */\n @Prop({ mutable: true }) indeterminate: boolean;\n\n /**\n * It determines whether or not the checkbox is invalid.\n */\n @Prop() invalid: boolean;\n\n /**\n * String used for label text next to checkbox.\n */\n @Prop() label: string;\n\n /**\n * Visually hides the label text for instances where only the checkbox should be displayed. Label remains accessible to assistive technology such as screen readers.\n */\n @Prop() hideLabel: boolean;\n\n /**\n * String used for checkbox `name` attribute.\n */\n @Prop() name: string;\n\n /**\n * It determines whether or not the checkbox is required.\n */\n @Prop() required: boolean;\n\n /**\n * The value of the checkbox that is submitted with a form.\n */\n @Prop() value: string;\n\n /**\n * Event emitted that contains the `value` and `checked`.\n */\n @Event() pdsCheckboxChange: EventEmitter<CheckboxChangeEventDetail>;\n\n @Event() pdsCheckboxInput: EventEmitter<CheckboxChangeEventDetail>;\n\n @Watch('checked')\n updateIndeterminate() {\n this.indeterminate = undefined\n }\n\n private handleCheckboxChange = (e: Event) => {\n if (this.disabled) {\n return;\n }\n\n const target = e.target as HTMLInputElement;\n this.checked = target.checked;\n\n this.pdsCheckboxChange.emit({\n checked: target.checked,\n value: this.value\n });\n }\n\n private handleInput = () => {\n this.pdsCheckboxInput.emit({\n checked: this.checked,\n value: this.value\n });\n }\n\n private classNames() {\n const classNames = [];\n\n if (this.invalid) { classNames.push('is-invalid'); }\n if (this.indeterminate) { classNames.push('is-indeterminate'); }\n if (this.disabled) { classNames.push('is-disabled'); }\n\n return classNames.join(' ');\n }\n\n componentWillLoad() {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el)\n }\n }\n\n render() {\n return (\n <Host class={this.classNames()}>\n <label htmlFor={this.componentId}>\n <input\n type=\"checkbox\"\n aria-describedby={assignDescription(this.componentId, this.invalid, this.errorMessage || this.helperMessage)}\n aria-invalid={this.invalid ? \"true\" : undefined}\n id={this.componentId}\n indeterminate={this.indeterminate}\n name={this.name}\n value={this.value}\n checked={this.checked}\n required={this.required}\n disabled={this.disabled}\n onChange={this.handleCheckboxChange}\n onInput={this.handleInput}\n {...this.inheritedAttributes}\n />\n <span class={this.hideLabel ? 'visually-hidden' : ''}>\n {this.label}\n </span>\n </label>\n {this.helperMessage &&\n <div\n class={'pds-checkbox__message'}\n id={messageId(this.componentId, 'helper')}\n >\n {this.helperMessage}\n </div>\n }\n {this.errorMessage &&\n <div\n class={`pds-checkbox__message pds-checkbox__message--error`}\n id={messageId(this.componentId, 'error')}\n aria-live=\"assertive\"\n >\n <pds-icon icon={danger} size=\"small\" />\n {this.errorMessage}\n </div>\n }\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pds-checkbox.js","sourceRoot":"","sources":["../../../src/components/pds-checkbox/pds-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAS1D,MAAM,OAAO,WAAW;IANxB;QAOU,wBAAmB,GAAe,EAAE,CAAC;QAK7C;;WAEG;QACsB,YAAO,GAAa,KAAK,CAAC;QAsE3C,yBA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B,iEAAU,IAAI,EAAE,MAAM,EAAE,IAAI,EAAC,OAAO,GAAG;oBACtC,IAAI,CAAC,YAAY,CACd,CAEH,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Prop, Host, Event, EventEmitter, Watch } from '@stencil/core';\nimport { assignDescription, messageId } from '../../utils/form';\nimport { CheckboxChangeEventDetail } from './checkbox-interface';\nimport { danger } from '@pine-ds/icons/icons';\n\nimport { inheritAriaAttributes } from '@utils/attributes';\nimport type { Attributes } from '@utils/attributes';\n\n@Component({\n tag: 'pds-checkbox',\n styleUrls: ['../../global/styles/utils/label.scss', 'pds-checkbox.scss'],\n shadow: true,\n formAssociated: true,\n})\nexport class PdsCheckbox {\n private inheritedAttributes: Attributes = {};\n private internals?: ElementInternals;\n\n @Element() el: HTMLPdsCheckboxElement;\n\n /**\n * It determines whether or not the checkbox is checked.\n */\n @Prop({ mutable: true }) checked?: boolean = false;\n\n /**\n * A unique identifier used for the underlying component `id` attribute and the label `for` attribute.\n */\n @Prop() componentId!: string;\n\n /**\n * It determines whether or not the checkbox is disabled.\n */\n @Prop() disabled: boolean;\n\n /**\n * Displays message text describing an invalid state.\n */\n @Prop() errorMessage: string;\n\n /**\n * String used for helper message below checkbox.\n */\n @Prop() helperMessage: string;\n\n /**\n * If `true`, the checkbox will visually appear as indeterminate.\n * Only JavaScript can set the objects `indeterminate` property. See [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#indeterminate_state_checkboxes).\n */\n @Prop({ mutable: true }) indeterminate: boolean;\n\n /**\n * It determines whether or not the checkbox is invalid.\n */\n @Prop() invalid: boolean;\n\n /**\n * String used for label text next to checkbox.\n */\n @Prop() label: string;\n\n /**\n * Visually hides the label text for instances where only the checkbox should be displayed. Label remains accessible to assistive technology such as screen readers.\n */\n @Prop() hideLabel: boolean;\n\n /**\n * String used for checkbox `name` attribute.\n */\n @Prop() name: string;\n\n /**\n * It determines whether or not the checkbox is required.\n */\n @Prop() required: boolean;\n\n /**\n * The value of the checkbox that is submitted with a form.\n */\n @Prop() value: string;\n\n /**\n * Event emitted that contains the `value` and `checked`.\n */\n @Event() pdsCheckboxChange: EventEmitter<CheckboxChangeEventDetail>;\n\n @Event() pdsCheckboxInput: EventEmitter<CheckboxChangeEventDetail>;\n\n @Watch('checked')\n updateIndeterminate() {\n this.indeterminate = undefined\n }\n\n private handleCheckboxChange = (e: Event) => {\n if (this.disabled) {\n return;\n }\n\n const target = e.target as HTMLInputElement;\n this.checked = target.checked;\n\n this.updateFormValue();\n\n this.pdsCheckboxChange.emit({\n checked: target.checked,\n value: this.value\n });\n }\n\n private handleInput = () => {\n this.pdsCheckboxInput.emit({\n checked: this.checked,\n value: this.value\n });\n }\n\n private classNames() {\n const classNames = [];\n\n if (this.invalid) { classNames.push('is-invalid'); }\n if (this.indeterminate) { classNames.push('is-indeterminate'); }\n if (this.disabled) { classNames.push('is-disabled'); }\n\n return classNames.join(' ');\n }\n\n connectedCallback() {\n if (this.el.attachInternals) {\n this.internals = this.el.attachInternals();\n }\n }\n\n componentDidLoad() {\n this.updateFormValue();\n }\n\n @Watch('checked')\n checkedChanged() {\n this.updateFormValue();\n }\n\n private updateFormValue() {\n if (typeof jest !== 'undefined' || typeof process !== 'undefined' && process.env?.NODE_ENV === 'test') {\n return;\n }\n\n if (this.internals && this.internals.setFormValue) {\n // For checkboxes, only send the value when checked, otherwise send null\n const formValue = this.checked ? (this.value || 'on') : null;\n this.internals.setFormValue(formValue);\n }\n\n if (this.internals && this.internals.setValidity) {\n this.internals.setValidity({});\n }\n }\n\n formStateRestoreCallback(state: string | FormData | null) {\n if (state instanceof FormData) {\n // For checkboxes, restore if the value exists in FormData\n const value = this.value || 'on';\n this.checked = state.get(this.name as string) === value;\n } else if (typeof state === 'string') {\n // Restore from string state\n this.checked = state === (this.value || 'on');\n }\n }\n\n componentWillLoad() {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el)\n }\n }\n\n render() {\n return (\n <Host class={this.classNames()}>\n <label htmlFor={this.componentId}>\n <input\n type=\"checkbox\"\n aria-describedby={assignDescription(this.componentId, this.invalid, this.errorMessage || this.helperMessage)}\n aria-invalid={this.invalid ? \"true\" : undefined}\n id={this.componentId}\n indeterminate={this.indeterminate}\n name={this.name}\n value={this.value}\n checked={this.checked}\n required={this.required}\n disabled={this.disabled}\n onChange={this.handleCheckboxChange}\n onInput={this.handleInput}\n {...this.inheritedAttributes}\n />\n <span class={this.hideLabel ? 'visually-hidden' : ''}>\n {this.label}\n </span>\n </label>\n {this.helperMessage &&\n <div\n class={'pds-checkbox__message'}\n id={messageId(this.componentId, 'helper')}\n >\n {this.helperMessage}\n </div>\n }\n {this.errorMessage &&\n <div\n class={`pds-checkbox__message pds-checkbox__message--error`}\n id={messageId(this.componentId, 'error')}\n aria-live=\"assertive\"\n >\n <pds-icon icon={danger} size=\"small\" />\n {this.errorMessage}\n </div>\n }\n </Host>\n );\n }\n}\n"]}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
--pds-input-border-radius: var(--pine-dimension-125);
|
|
7
7
|
--pds-input-border-width: var(--pine-border-width-thin);
|
|
8
8
|
--pds-input-padding-x: var(--pine-dimension-150);
|
|
9
|
-
--pds-input-padding-y: var(--pine-dimension-xs);
|
|
9
|
+
--pds-input-padding-y: calc(var(--pine-dimension-xs) - var(--pine-border-width));
|
|
10
10
|
--pds-input-font: var(--pine-typography-body);
|
|
11
11
|
--pds-input-text-color: var(--pine-color-text-active);
|
|
12
12
|
--pds-input-placeholder-color: var(--pine-color-text-placeholder);
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
--pds-input-error-border-hover: var(--pine-color-border-danger-hover);
|
|
20
20
|
--pds-input-addon-background: var(--pine-color-background-subtle);
|
|
21
21
|
--pds-input-addon-color: var(--pine-color-text-secondary);
|
|
22
|
-
--pds-input-field-min-height:
|
|
22
|
+
--pds-input-field-min-height: var(--pine-dimension-450);
|
|
23
23
|
--box-shadow-focus: 0 0 0 1px #ffffff, 0 0 0 3px var(--pine-color-focus-ring);
|
|
24
24
|
--box-shadow-focus-error: 0 0 0 1px #ffffff, 0 0 0 3px var(--pine-color-focus-ring-danger);
|
|
25
25
|
display: inline;
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
--pds-select-border: var(--pine-border-width-none);
|
|
94
94
|
--pds-select-border-radius-end-end: var(--pine-dimension-none);
|
|
95
95
|
--pds-select-border-radius-start-end: var(--pine-dimension-none);
|
|
96
|
-
--pds-select-min-height: var(--pine-dimension-450);
|
|
96
|
+
--pds-select-min-height: calc(var(--pine-dimension-450) - calc(2 * var(--pine-border-width)));
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
/* stylelint-disable-next-line */
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
--pds-select-border: var(--pine-border-width-none);
|
|
103
103
|
--pds-select-border-radius-end-start: var(--pine-dimension-none);
|
|
104
104
|
--pds-select-border-radius-start-start: var(--pine-dimension-none);
|
|
105
|
-
--pds-select-min-height: var(--pine-dimension-450);
|
|
105
|
+
--pds-select-min-height: calc(var(--pine-dimension-450) - calc(2 * var(--pine-border-width)));
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
:host([aria-readonly=true]) input {
|
|
@@ -115,6 +115,10 @@
|
|
|
115
115
|
border: var(--pds-input-border-width) solid var(--pds-input-border-color-disabled);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
:host([full-width=true]) {
|
|
119
|
+
width: 100%;
|
|
120
|
+
}
|
|
121
|
+
|
|
118
122
|
:host([invalid=true])::part(prepend), :host([invalid=true])::part(append) {
|
|
119
123
|
background-color: var(--pds-input-error-background);
|
|
120
124
|
border: var(--pds-input-border-width) solid var(--pds-input-error-border);
|
|
@@ -123,7 +127,6 @@
|
|
|
123
127
|
.pds-input {
|
|
124
128
|
display: flex;
|
|
125
129
|
flex-direction: column;
|
|
126
|
-
gap: var(--pine-dimension-2xs);
|
|
127
130
|
}
|
|
128
131
|
|
|
129
132
|
.pds-input__label-wrapper {
|
|
@@ -221,7 +224,8 @@
|
|
|
221
224
|
|
|
222
225
|
.pds-input__error-message,
|
|
223
226
|
.pds-input__helper-message {
|
|
224
|
-
|
|
227
|
+
color: var(--pine-color-text-message);
|
|
228
|
+
font: var(--pine-typography-body-sm);
|
|
225
229
|
margin-block-end: var(--pine-dimension-none);
|
|
226
230
|
margin-block-start: var(--pine-dimension-2xs);
|
|
227
231
|
}
|
|
@@ -147,9 +147,17 @@ export class PdsInput {
|
|
|
147
147
|
// Store the original pdsInput event emitter
|
|
148
148
|
this.originalPdsInput = this.pdsInput;
|
|
149
149
|
}
|
|
150
|
+
connectedCallback() {
|
|
151
|
+
// Initialize ElementInternals for form association
|
|
152
|
+
if (this.el.attachInternals) {
|
|
153
|
+
this.internals = this.el.attachInternals();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
150
156
|
componentDidLoad() {
|
|
151
157
|
this.debounceChanged();
|
|
152
158
|
this.updateAddonWidths();
|
|
159
|
+
// Set initial form value
|
|
160
|
+
this.updateFormValue();
|
|
153
161
|
}
|
|
154
162
|
componentDidUpdate() {
|
|
155
163
|
this.updateAddonWidths();
|
|
@@ -168,6 +176,8 @@ export class PdsInput {
|
|
|
168
176
|
if (nativeInput && nativeInput.value !== value && !this.isComposing) {
|
|
169
177
|
nativeInput.value = value;
|
|
170
178
|
}
|
|
179
|
+
// Update form value when value changes
|
|
180
|
+
this.updateFormValue();
|
|
171
181
|
}
|
|
172
182
|
getValue() {
|
|
173
183
|
return typeof this.value === 'number' ? this.value.toString() : (this.value || '').toString();
|
|
@@ -190,6 +200,47 @@ export class PdsInput {
|
|
|
190
200
|
const newValue = value == null ? value : value.toString();
|
|
191
201
|
this.pdsInput.emit({ value: newValue, event });
|
|
192
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* Updates the form value using ElementInternals API
|
|
205
|
+
*/
|
|
206
|
+
updateFormValue() {
|
|
207
|
+
if (this.internals && this.internals.setFormValue) {
|
|
208
|
+
const value = this.getValue();
|
|
209
|
+
this.internals.setFormValue(value || null);
|
|
210
|
+
// Set validity based on native input validation
|
|
211
|
+
if (this.nativeInput && this.internals && this.internals.setValidity) {
|
|
212
|
+
this.internals.setValidity(this.nativeInput.validity, this.nativeInput.validationMessage, this.nativeInput);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Form Associated Custom Elements API: Called when the form is reset
|
|
218
|
+
*/
|
|
219
|
+
formResetCallback() {
|
|
220
|
+
this.value = '';
|
|
221
|
+
this.updateFormValue();
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Form Associated Custom Elements API: Called when the form is disabled
|
|
225
|
+
*/
|
|
226
|
+
formDisabledCallback(disabled) {
|
|
227
|
+
this.disabled = disabled;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Form Associated Custom Elements API: Called to restore form state
|
|
231
|
+
*/
|
|
232
|
+
formStateRestoreCallback(state) {
|
|
233
|
+
if (typeof state === 'string') {
|
|
234
|
+
this.value = state;
|
|
235
|
+
}
|
|
236
|
+
else if (state instanceof FormData && this.name) {
|
|
237
|
+
// Extract value from FormData using the input's name
|
|
238
|
+
const value = state.get(this.name);
|
|
239
|
+
if (typeof value === 'string') {
|
|
240
|
+
this.value = value;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
193
244
|
render() {
|
|
194
245
|
const { componentId, disabled, errorMessage, helperMessage, invalid = false, label, } = this;
|
|
195
246
|
const value = this.getValue();
|
|
@@ -203,10 +254,11 @@ export class PdsInput {
|
|
|
203
254
|
'has-prepend': this.hasPrepend,
|
|
204
255
|
'has-append': this.hasAppend,
|
|
205
256
|
};
|
|
206
|
-
return (h(Host, { key: '
|
|
257
|
+
return (h(Host, { key: 'eac6a9c04f98b10e4eb6cb3eee49c7ecf4e2d8a2', "aria-disabled": this.disabled ? 'true' : null, "aria-readonly": this.readonly ? 'true' : null, "has-prefix": this.hasPrefix ? 'true' : null, "has-suffix": this.hasSuffix ? 'true' : null, "has-prepend": this.hasPrepend ? 'true' : null, "has-append": this.hasAppend ? 'true' : null, "has-action": this.hasAction ? 'true' : null, "full-width": this.fullWidth ? 'true' : null }, h("div", { key: 'f67b518f3debb5f21cf48bd573126962d81deff5', class: "pds-input" }, label && (h("div", { key: 'a45a7bd41f7d3f8009d2bbf6bcc432c45c0fc733', class: "pds-input__label-wrapper" }, h("label", { key: '31b41266335a5197313d6aa44c277de57afe2f54', htmlFor: componentId, class: "pds-input__label" }, label, this.required && h("span", { key: '4113f0e0e85cb81c5a501e52b3489b125fdb1cbf', class: "pds-input__required-indicator" }, " *")), this.renderAction())), h("div", { key: 'ea99ed08f755dc72517fb1594054250a492340d0', class: inputWrapperClasses }, this.renderPrepend(), this.renderPrefix(), h("input", Object.assign({ key: 'b48f1ccb88fdaa96b9e81cb1c459d3bfd1b512e0', ref: (input) => (this.nativeInput = input), class: "pds-input__field", "aria-describedby": assignDescription(componentId, invalid, helperMessage), "aria-invalid": invalid ? "true" : undefined, autocomplete: this.autocomplete, disabled: disabled, id: componentId, max: this.max, maxlength: this.maxlength, min: this.min, minlength: this.minlength, name: this.name, pattern: this.pattern, placeholder: this.placeholder, readOnly: this.readonly, required: this.required, step: this.step, type: this.type, value: value, onInput: this.onInputEvent, onChange: this.onChangeEvent, onBlur: this.onBlurEvent, onFocus: this.onFocusEvent, onCompositionstart: this.onCompositionStart, onCompositionend: this.onCompositionEnd }, this.inheritedAttributes)), this.renderSuffix(), this.renderAppend()), helperMessage && (h("p", { key: '3f84a41082d20917d9ab85051cdfbb7c2a6407ee', class: "pds-input__helper-message", id: messageId(componentId, 'helper') }, helperMessage)), errorMessage && (h("p", { key: 'd991dfdfc44a41640ef0070ce17e52b3f86b7782', class: "pds-input__error-message", id: messageId(componentId, 'error') }, h("pds-icon", { key: '5ea499d7d2f5ff2602dbf39f81df59c06116c6d2', icon: danger, size: "small" }), errorMessage)))));
|
|
207
258
|
}
|
|
208
259
|
static get is() { return "pds-input"; }
|
|
209
260
|
static get encapsulation() { return "shadow"; }
|
|
261
|
+
static get formAssociated() { return true; }
|
|
210
262
|
static get originalStyleUrls() {
|
|
211
263
|
return {
|
|
212
264
|
"$": ["pds-input.tokens.scss", "../../global/styles/utils/label.scss", "pds-input.scss"]
|
|
@@ -603,6 +655,25 @@ export class PdsInput {
|
|
|
603
655
|
"attribute": "value",
|
|
604
656
|
"reflect": false,
|
|
605
657
|
"defaultValue": "''"
|
|
658
|
+
},
|
|
659
|
+
"fullWidth": {
|
|
660
|
+
"type": "boolean",
|
|
661
|
+
"mutable": false,
|
|
662
|
+
"complexType": {
|
|
663
|
+
"original": "boolean",
|
|
664
|
+
"resolved": "boolean",
|
|
665
|
+
"references": {}
|
|
666
|
+
},
|
|
667
|
+
"required": false,
|
|
668
|
+
"optional": true,
|
|
669
|
+
"docs": {
|
|
670
|
+
"tags": [],
|
|
671
|
+
"text": "Determines whether or not the input field takes full width of its container."
|
|
672
|
+
},
|
|
673
|
+
"getter": false,
|
|
674
|
+
"setter": false,
|
|
675
|
+
"attribute": "full-width",
|
|
676
|
+
"reflect": false
|
|
606
677
|
}
|
|
607
678
|
};
|
|
608
679
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-input.js","sourceRoot":"","sources":["../../../src/components/pds-input/pds-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from '@stencil/core';\nimport { assignDescription, messageId } from '../../utils/form';\nimport { inheritAriaAttributes } from '@utils/attributes';\nimport type { Attributes } from '@utils/attributes';\nimport { InputChangeEventDetail, InputInputEventDetail } from './input-interface';\nimport { debounceEvent } from '@utils/utils';\nimport { danger } from '@pine-ds/icons/icons';\n\n/**\n * @slot append - Content to be displayed after the input field\n * @slot prefix - Content that is displayed visually within the input field before the input field\n * @slot prepend - Content to be displayed before the input field\n * @slot suffix - Content that is displayed visually within the input field after the input field\n * @slot action - Content to be displayed in the label area, typically for help icons or links\n */\n@Component({\n tag: 'pds-input',\n styleUrls: ['pds-input.tokens.scss', '../../global/styles/utils/label.scss', 'pds-input.scss'],\n shadow: true,\n})\nexport class PdsInput {\n private nativeInput?: HTMLInputElement;\n private inheritedAttributes: Attributes = {};\n private isComposing = false;\n private prefixEl?: HTMLElement;\n private suffixEl?: HTMLElement;\n private focusedValue?: string | number | null;\n private originalPdsInput?: EventEmitter<InputInputEventDetail>;\n\n @Element() el!: HTMLPdsInputElement;\n\n /**\n * If true, the input has prefix content (non-focusable)\n */\n @State() hasPrefix = false;\n\n /**\n * If true, the input has suffix content (non-focusable)\n */\n @State() hasSuffix = false;\n\n /**\n * If true, the input has prepend content (focusable)\n */\n @State() hasPrepend = false;\n\n /**\n * If true, the input has append content (focusable)\n */\n @State() hasAppend = false;\n\n /**\n * If true, the input has action content in the label area\n */\n @State() hasAction = false;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() pdsBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the value has changed.\n *\n * This event will not emit when programmatically setting the `value` property.\n */\n @Event() pdsChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() pdsFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when a keyboard input occurs.\n */\n @Event() pdsInput: EventEmitter<InputInputEventDetail>;\n\n /**\n * Sets focus on the native `input` in the `pds-input`. Use this method instead of the global\n * `input.focus()`.\n */\n @Method()\n async setFocus() {\n if (this.nativeInput) {\n this.nativeInput.focus();\n }\n }\n\n\n /**\n * Specifies if and how the browser provides `autocomplete` assistance for the field.\n */\n @Prop() autocomplete: string;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId!: string;\n\n /**\n * Sets the number of milliseconds to wait before updating the value.\n */\n @Prop() debounce?: number;\n\n /**\n * Determines whether or not the input field is disabled.\n */\n @Prop() disabled?: boolean;\n\n /**\n * Specifies the error message and provides an error-themed treatment to the field.\n */\n @Prop() errorMessage?: string;\n\n /**\n * Displays a message or hint below the input field.\n */\n @Prop() helperMessage?: string;\n\n /**\n * Determines whether or not the input field is invalid or throws an error.\n */\n @Prop() invalid?: boolean;\n\n /**\n * Text to be displayed as the input label.\n */\n @Prop() label?: string;\n\n /**\n * Specifies the maximum value for the input field.\n */\n @Prop() max?: string;\n\n /**\n * Specifies the maximum number of characters allowed in the input field.\n */\n @Prop() maxlength?: string;\n\n /**\n * Specifies the minimum value for the input field.\n */\n @Prop() min?: string;\n\n /**\n * Specifies the minimum number of characters allowed in the input field.\n */\n @Prop() minlength?: string;\n\n /**\n * Specifies the name. Submitted with the form name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * Specifies the regular expression that the input value is checked against.\n */\n @Prop() pattern?: string;\n\n /**\n * Specifies a short hint that describes the expected value of the input field.\n */\n @Prop() placeholder?: string;\n\n /**\n * Determines whether or not the input field is readonly.\n */\n @Prop() readonly?: boolean;\n\n /**\n * Determines whether or not the input field is required.\n */\n @Prop() required?: boolean;\n\n /**\n * Works with the `min` and `max` attributes to define increments for the input field.\n */\n @Prop() step?: string;\n\n /**\n * Determines the type of control that will be displayed\n * `'email'`, `'number'`, `'password'`, `'tel'`, `'text'`, `'url'`\n * @defaultValue \"text\"\n */\n @Prop() type = 'text';\n\n /**\n * The value of the input.\n */\n @Prop({mutable: true}) value?: string | number | null = '';\n\n /**\n * Determines if the input has focus.\n */\n @State() hasFocus = false;\n\n private updateAddonWidths() {\n requestAnimationFrame(() => {\n if (this.prefixEl) {\n const prefixWidth = this.prefixEl.offsetWidth;\n this.el.style.setProperty('--prefix-width', `${prefixWidth}px`);\n }\n\n if (this.suffixEl) {\n const suffixWidth = this.suffixEl.offsetWidth;\n this.el.style.setProperty('--suffix-width', `${suffixWidth}px`);\n }\n });\n }\n\n private renderPrefix() {\n const hasPrefix = this.el.querySelector('[slot=\"prefix\"]') !== null;\n if (hasPrefix) {\n return (\n <div class=\"pds-input__prefix\" part=\"prefix\" ref={(el) => this.prefixEl = el as HTMLElement}>\n <slot name=\"prefix\" onSlotchange={() => this.updateAddonWidths()}></slot>\n </div>\n );\n }\n return null;\n }\n\n private renderSuffix() {\n const hasSuffix = this.el.querySelector('[slot=\"suffix\"]') !== null;\n if (hasSuffix) {\n return (\n <div class=\"pds-input__suffix\" part=\"suffix\" ref={(el) => this.suffixEl = el as HTMLElement}>\n <slot name=\"suffix\" onSlotchange={() => this.updateAddonWidths()}></slot>\n </div>\n );\n }\n return null;\n }\n\n private renderPrepend() {\n const hasPrepend = this.el.querySelector('[slot=\"prepend\"]') !== null;\n if (hasPrepend) {\n return (\n <div class=\"pds-input__prepend\" part=\"prepend\">\n <slot name=\"prepend\"></slot>\n </div>\n );\n }\n return null;\n }\n\n private renderAppend() {\n const hasAppend = this.el.querySelector('[slot=\"append\"]') !== null;\n if (hasAppend) {\n return (\n <div class=\"pds-input__append\" part=\"append\">\n <slot name=\"append\"></slot>\n </div>\n );\n }\n return null;\n }\n\n private renderAction() {\n const hasAction = this.el.querySelector('[slot=\"action\"]') !== null;\n if (hasAction) {\n return (\n <div class=\"pds-input__action\" part=\"action\">\n <slot name=\"action\"></slot>\n </div>\n );\n }\n return null;\n }\n\n componentWillLoad() {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el)\n };\n this.hasPrefix = this.el.querySelector('[slot=\"prefix\"]') !== null;\n this.hasSuffix = this.el.querySelector('[slot=\"suffix\"]') !== null;\n this.hasPrepend = this.el.querySelector('[slot=\"prepend\"]') !== null;\n this.hasAppend = this.el.querySelector('[slot=\"append\"]') !== null;\n this.hasAction = this.el.querySelector('[slot=\"action\"]') !== null;\n\n // Store the original pdsInput event emitter\n this.originalPdsInput = this.pdsInput;\n }\n\n componentDidLoad() {\n this.debounceChanged();\n this.updateAddonWidths();\n }\n\n componentDidUpdate() {\n this.updateAddonWidths();\n }\n\n @Watch('debounce')\n protected debounceChanged() {\n const { pdsInput, debounce, originalPdsInput } = this;\n\n /**\n * If debounce is undefined, we have to manually revert the pdsInput emitter in case\n * debounce used to be set to a number. Otherwise, the event would stay debounced.\n */\n this.pdsInput = debounce === undefined ? originalPdsInput ?? pdsInput : debounceEvent(pdsInput, debounce);\n }\n\n @Watch('value')\n protected valueChanged() {\n const nativeInput = this.nativeInput;\n const value = this.getValue();\n\n if (nativeInput && nativeInput.value !== value && !this.isComposing) {\n nativeInput.value = value;\n }\n }\n\n private getValue(): string {\n return typeof this.value === 'number' ? this.value.toString() : (this.value || '').toString();\n }\n\n private onInputEvent = (ev: Event) => {\n const input = ev.target as HTMLInputElement | null;\n if (input) {\n this.value = input.value || '';\n }\n this.emitInputChange(ev);\n };\n\n private onChangeEvent = (ev: Event) => {\n this.emitValueChange(ev);\n };\n\n private onBlurEvent = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n if (this.focusedValue !== this.value) {\n /**\n * Emits the `pdsChange` event when the input value\n * is different than the value when the input was focused.\n */\n this.emitValueChange(ev);\n }\n\n this.pdsBlur.emit(ev);\n };\n\n private onFocusEvent = (ev: FocusEvent) => {\n this.hasFocus = true;\n this.focusedValue = this.value;\n\n this.pdsFocus.emit(ev);\n };\n\n private onCompositionStart = () => {\n this.isComposing = true;\n }\n\n private onCompositionEnd = () => {\n this.isComposing = false;\n }\n\n /**\n * Emits a pdsChange event\n */\n private emitValueChange(event?: Event) {\n const { value } = this;\n const newValue = value == null ? value : value.toString();\n\n this.focusedValue = newValue;\n this.pdsChange.emit({ value: newValue, event });\n }\n\n /**\n * Emits a `pdsInput` event\n */\n private emitInputChange(event?: Event) {\n const { value } = this;\n\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n\n this.pdsInput.emit({ value: newValue, event });\n }\n\n render() {\n const {\n componentId,\n disabled,\n errorMessage,\n helperMessage,\n invalid = false,\n label,\n } = this;\n\n const value = this.getValue();\n\n const inputWrapperClasses = {\n 'pds-input__field-wrapper': true,\n 'has-focus': this.hasFocus,\n 'has-error': invalid || !!errorMessage,\n 'is-disabled': disabled,\n 'has-prefix': this.hasPrefix,\n 'has-suffix': this.hasSuffix,\n 'has-prepend': this.hasPrepend,\n 'has-append': this.hasAppend,\n };\n\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n aria-readonly={this.readonly ? 'true' : null}\n has-prefix={this.hasPrefix ? 'true' : null}\n has-suffix={this.hasSuffix ? 'true' : null}\n has-prepend={this.hasPrepend ? 'true' : null}\n has-append={this.hasAppend ? 'true' : null}\n has-action={this.hasAction ? 'true' : null}\n >\n <div class=\"pds-input\">\n {label && (\n <div class=\"pds-input__label-wrapper\">\n <label htmlFor={componentId} class=\"pds-input__label\">\n {label}\n {this.required && <span class=\"pds-input__required-indicator\"> *</span>}\n </label>\n {this.renderAction()}\n </div>\n )}\n\n <div class={inputWrapperClasses}>\n {this.renderPrepend()}\n {this.renderPrefix()}\n <input\n ref={(input) => (this.nativeInput = input)}\n class=\"pds-input__field\"\n aria-describedby={assignDescription(componentId, invalid, helperMessage)}\n aria-invalid={invalid ? \"true\" : undefined}\n autocomplete={this.autocomplete}\n disabled={disabled}\n id={componentId}\n max={this.max}\n maxlength={this.maxlength}\n min={this.min}\n minlength={this.minlength}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n step={this.step}\n type={this.type}\n value={value}\n onInput={this.onInputEvent}\n onChange={this.onChangeEvent}\n onBlur={this.onBlurEvent}\n onFocus={this.onFocusEvent}\n onCompositionstart={this.onCompositionStart}\n onCompositionend={this.onCompositionEnd}\n {...this.inheritedAttributes}\n />\n {this.renderSuffix()}\n {this.renderAppend()}\n </div>\n\n {helperMessage && (\n <p class=\"pds-input__helper-message\" id={messageId(componentId, 'helper')}>\n {helperMessage}\n </p>\n )}\n\n {errorMessage && (\n <p class=\"pds-input__error-message\" id={messageId(componentId, 'error')}>\n <pds-icon icon={danger} size=\"small\" />\n {errorMessage}\n </p>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pds-input.js","sourceRoot":"","sources":["../../../src/components/pds-input/pds-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C;;;;;;GAMG;AAOH,MAAM,OAAO,QAAQ;IANrB;QASU,wBAAmB,GAAe,EA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from '@stencil/core';\nimport { assignDescription, messageId } from '../../utils/form';\nimport { inheritAriaAttributes } from '@utils/attributes';\nimport type { Attributes } from '@utils/attributes';\nimport { InputChangeEventDetail, InputInputEventDetail } from './input-interface';\nimport { debounceEvent } from '@utils/utils';\nimport { danger } from '@pine-ds/icons/icons';\n\n/**\n * @slot append - Content to be displayed after the input field\n * @slot prefix - Content that is displayed visually within the input field before the input field\n * @slot prepend - Content to be displayed before the input field\n * @slot suffix - Content that is displayed visually within the input field after the input field\n * @slot action - Content to be displayed in the label area, typically for help icons or links\n */\n@Component({\n tag: 'pds-input',\n styleUrls: ['pds-input.tokens.scss', '../../global/styles/utils/label.scss', 'pds-input.scss'],\n shadow: true,\n formAssociated: true,\n})\nexport class PdsInput {\n\n private nativeInput?: HTMLInputElement;\n private inheritedAttributes: Attributes = {};\n private isComposing = false;\n private prefixEl?: HTMLElement;\n private suffixEl?: HTMLElement;\n private focusedValue?: string | number | null;\n private originalPdsInput?: EventEmitter<InputInputEventDetail>;\n private internals?: ElementInternals;\n\n @Element() el!: HTMLPdsInputElement;\n\n /**\n * If true, the input has prefix content (non-focusable)\n */\n @State() hasPrefix = false;\n\n /**\n * If true, the input has suffix content (non-focusable)\n */\n @State() hasSuffix = false;\n\n /**\n * If true, the input has prepend content (focusable)\n */\n @State() hasPrepend = false;\n\n /**\n * If true, the input has append content (focusable)\n */\n @State() hasAppend = false;\n\n /**\n * If true, the input has action content in the label area\n */\n @State() hasAction = false;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() pdsBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the value has changed.\n *\n * This event will not emit when programmatically setting the `value` property.\n */\n @Event() pdsChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() pdsFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when a keyboard input occurs.\n */\n @Event() pdsInput: EventEmitter<InputInputEventDetail>;\n\n /**\n * Sets focus on the native `input` in the `pds-input`. Use this method instead of the global\n * `input.focus()`.\n */\n @Method()\n async setFocus() {\n if (this.nativeInput) {\n this.nativeInput.focus();\n }\n }\n\n\n /**\n * Specifies if and how the browser provides `autocomplete` assistance for the field.\n */\n @Prop() autocomplete: string;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId!: string;\n\n /**\n * Sets the number of milliseconds to wait before updating the value.\n */\n @Prop() debounce?: number;\n\n /**\n * Determines whether or not the input field is disabled.\n */\n @Prop() disabled?: boolean;\n\n /**\n * Specifies the error message and provides an error-themed treatment to the field.\n */\n @Prop() errorMessage?: string;\n\n /**\n * Displays a message or hint below the input field.\n */\n @Prop() helperMessage?: string;\n\n /**\n * Determines whether or not the input field is invalid or throws an error.\n */\n @Prop() invalid?: boolean;\n\n /**\n * Text to be displayed as the input label.\n */\n @Prop() label?: string;\n\n /**\n * Specifies the maximum value for the input field.\n */\n @Prop() max?: string;\n\n /**\n * Specifies the maximum number of characters allowed in the input field.\n */\n @Prop() maxlength?: string;\n\n /**\n * Specifies the minimum value for the input field.\n */\n @Prop() min?: string;\n\n /**\n * Specifies the minimum number of characters allowed in the input field.\n */\n @Prop() minlength?: string;\n\n /**\n * Specifies the name. Submitted with the form name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * Specifies the regular expression that the input value is checked against.\n */\n @Prop() pattern?: string;\n\n /**\n * Specifies a short hint that describes the expected value of the input field.\n */\n @Prop() placeholder?: string;\n\n /**\n * Determines whether or not the input field is readonly.\n */\n @Prop() readonly?: boolean;\n\n /**\n * Determines whether or not the input field is required.\n */\n @Prop() required?: boolean;\n\n /**\n * Works with the `min` and `max` attributes to define increments for the input field.\n */\n @Prop() step?: string;\n\n /**\n * Determines the type of control that will be displayed\n * `'email'`, `'number'`, `'password'`, `'tel'`, `'text'`, `'url'`\n * @defaultValue \"text\"\n */\n @Prop() type = 'text';\n\n /**\n * The value of the input.\n */\n @Prop({mutable: true}) value?: string | number | null = '';\n\n /**\n * Determines whether or not the input field takes full width of its container.\n */\n @Prop() fullWidth?: boolean;\n\n /**\n * Determines if the input has focus.\n */\n @State() hasFocus = false;\n\n private updateAddonWidths() {\n requestAnimationFrame(() => {\n if (this.prefixEl) {\n const prefixWidth = this.prefixEl.offsetWidth;\n this.el.style.setProperty('--prefix-width', `${prefixWidth}px`);\n }\n\n if (this.suffixEl) {\n const suffixWidth = this.suffixEl.offsetWidth;\n this.el.style.setProperty('--suffix-width', `${suffixWidth}px`);\n }\n });\n }\n\n private renderPrefix() {\n const hasPrefix = this.el.querySelector('[slot=\"prefix\"]') !== null;\n if (hasPrefix) {\n return (\n <div class=\"pds-input__prefix\" part=\"prefix\" ref={(el) => this.prefixEl = el as HTMLElement}>\n <slot name=\"prefix\" onSlotchange={() => this.updateAddonWidths()}></slot>\n </div>\n );\n }\n return null;\n }\n\n private renderSuffix() {\n const hasSuffix = this.el.querySelector('[slot=\"suffix\"]') !== null;\n if (hasSuffix) {\n return (\n <div class=\"pds-input__suffix\" part=\"suffix\" ref={(el) => this.suffixEl = el as HTMLElement}>\n <slot name=\"suffix\" onSlotchange={() => this.updateAddonWidths()}></slot>\n </div>\n );\n }\n return null;\n }\n\n private renderPrepend() {\n const hasPrepend = this.el.querySelector('[slot=\"prepend\"]') !== null;\n if (hasPrepend) {\n return (\n <div class=\"pds-input__prepend\" part=\"prepend\">\n <slot name=\"prepend\"></slot>\n </div>\n );\n }\n return null;\n }\n\n private renderAppend() {\n const hasAppend = this.el.querySelector('[slot=\"append\"]') !== null;\n if (hasAppend) {\n return (\n <div class=\"pds-input__append\" part=\"append\">\n <slot name=\"append\"></slot>\n </div>\n );\n }\n return null;\n }\n\n private renderAction() {\n const hasAction = this.el.querySelector('[slot=\"action\"]') !== null;\n if (hasAction) {\n return (\n <div class=\"pds-input__action\" part=\"action\">\n <slot name=\"action\"></slot>\n </div>\n );\n }\n return null;\n }\n\n componentWillLoad() {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el)\n };\n this.hasPrefix = this.el.querySelector('[slot=\"prefix\"]') !== null;\n this.hasSuffix = this.el.querySelector('[slot=\"suffix\"]') !== null;\n this.hasPrepend = this.el.querySelector('[slot=\"prepend\"]') !== null;\n this.hasAppend = this.el.querySelector('[slot=\"append\"]') !== null;\n this.hasAction = this.el.querySelector('[slot=\"action\"]') !== null;\n\n // Store the original pdsInput event emitter\n this.originalPdsInput = this.pdsInput;\n }\n\n connectedCallback() {\n // Initialize ElementInternals for form association\n if (this.el.attachInternals) {\n this.internals = this.el.attachInternals();\n }\n }\n\n componentDidLoad() {\n this.debounceChanged();\n this.updateAddonWidths();\n // Set initial form value\n this.updateFormValue();\n }\n\n componentDidUpdate() {\n this.updateAddonWidths();\n }\n\n @Watch('debounce')\n protected debounceChanged() {\n const { pdsInput, debounce, originalPdsInput } = this;\n\n /**\n * If debounce is undefined, we have to manually revert the pdsInput emitter in case\n * debounce used to be set to a number. Otherwise, the event would stay debounced.\n */\n this.pdsInput = debounce === undefined ? originalPdsInput ?? pdsInput : debounceEvent(pdsInput, debounce);\n }\n\n @Watch('value')\n protected valueChanged() {\n const nativeInput = this.nativeInput;\n const value = this.getValue();\n\n if (nativeInput && nativeInput.value !== value && !this.isComposing) {\n nativeInput.value = value;\n }\n\n // Update form value when value changes\n this.updateFormValue();\n }\n\n private getValue(): string {\n return typeof this.value === 'number' ? this.value.toString() : (this.value || '').toString();\n }\n\n private onInputEvent = (ev: Event) => {\n const input = ev.target as HTMLInputElement | null;\n if (input) {\n this.value = input.value || '';\n }\n this.emitInputChange(ev);\n };\n\n private onChangeEvent = (ev: Event) => {\n this.emitValueChange(ev);\n };\n\n private onBlurEvent = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n if (this.focusedValue !== this.value) {\n /**\n * Emits the `pdsChange` event when the input value\n * is different than the value when the input was focused.\n */\n this.emitValueChange(ev);\n }\n\n this.pdsBlur.emit(ev);\n };\n\n private onFocusEvent = (ev: FocusEvent) => {\n this.hasFocus = true;\n this.focusedValue = this.value;\n\n this.pdsFocus.emit(ev);\n };\n\n private onCompositionStart = () => {\n this.isComposing = true;\n }\n\n private onCompositionEnd = () => {\n this.isComposing = false;\n }\n\n /**\n * Emits a pdsChange event\n */\n private emitValueChange(event?: Event) {\n const { value } = this;\n const newValue = value == null ? value : value.toString();\n\n this.focusedValue = newValue;\n this.pdsChange.emit({ value: newValue, event });\n }\n\n /**\n * Emits a `pdsInput` event\n */\n private emitInputChange(event?: Event) {\n const { value } = this;\n\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n\n this.pdsInput.emit({ value: newValue, event });\n }\n\n /**\n * Updates the form value using ElementInternals API\n */\n private updateFormValue() {\n if (this.internals && this.internals.setFormValue) {\n const value = this.getValue();\n this.internals.setFormValue(value || null);\n\n // Set validity based on native input validation\n if (this.nativeInput && this.internals && this.internals.setValidity) {\n this.internals.setValidity(\n this.nativeInput.validity,\n this.nativeInput.validationMessage,\n this.nativeInput\n );\n }\n }\n }\n\n /**\n * Form Associated Custom Elements API: Called when the form is reset\n */\n formResetCallback() {\n this.value = '';\n this.updateFormValue();\n }\n\n /**\n * Form Associated Custom Elements API: Called when the form is disabled\n */\n formDisabledCallback(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Form Associated Custom Elements API: Called to restore form state\n */\n formStateRestoreCallback(state: string | FormData | null) {\n if (typeof state === 'string') {\n this.value = state;\n } else if (state instanceof FormData && this.name) {\n // Extract value from FormData using the input's name\n const value = state.get(this.name);\n if (typeof value === 'string') {\n this.value = value;\n }\n }\n }\n\n render() {\n const {\n componentId,\n disabled,\n errorMessage,\n helperMessage,\n invalid = false,\n label,\n } = this;\n\n const value = this.getValue();\n\n const inputWrapperClasses = {\n 'pds-input__field-wrapper': true,\n 'has-focus': this.hasFocus,\n 'has-error': invalid || !!errorMessage,\n 'is-disabled': disabled,\n 'has-prefix': this.hasPrefix,\n 'has-suffix': this.hasSuffix,\n 'has-prepend': this.hasPrepend,\n 'has-append': this.hasAppend,\n };\n\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n aria-readonly={this.readonly ? 'true' : null}\n has-prefix={this.hasPrefix ? 'true' : null}\n has-suffix={this.hasSuffix ? 'true' : null}\n has-prepend={this.hasPrepend ? 'true' : null}\n has-append={this.hasAppend ? 'true' : null}\n has-action={this.hasAction ? 'true' : null}\n full-width={this.fullWidth ? 'true' : null}\n >\n <div class=\"pds-input\">\n {label && (\n <div class=\"pds-input__label-wrapper\">\n <label htmlFor={componentId} class=\"pds-input__label\">\n {label}\n {this.required && <span class=\"pds-input__required-indicator\"> *</span>}\n </label>\n {this.renderAction()}\n </div>\n )}\n\n <div class={inputWrapperClasses}>\n {this.renderPrepend()}\n {this.renderPrefix()}\n <input\n ref={(input) => (this.nativeInput = input)}\n class=\"pds-input__field\"\n aria-describedby={assignDescription(componentId, invalid, helperMessage)}\n aria-invalid={invalid ? \"true\" : undefined}\n autocomplete={this.autocomplete}\n disabled={disabled}\n id={componentId}\n max={this.max}\n maxlength={this.maxlength}\n min={this.min}\n minlength={this.minlength}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n step={this.step}\n type={this.type}\n value={value}\n onInput={this.onInputEvent}\n onChange={this.onChangeEvent}\n onBlur={this.onBlurEvent}\n onFocus={this.onFocusEvent}\n onCompositionstart={this.onCompositionStart}\n onCompositionend={this.onCompositionEnd}\n {...this.inheritedAttributes}\n />\n {this.renderSuffix()}\n {this.renderAppend()}\n </div>\n\n {helperMessage && (\n <p class=\"pds-input__helper-message\" id={messageId(componentId, 'helper')}>\n {helperMessage}\n </p>\n )}\n\n {errorMessage && (\n <p class=\"pds-input__error-message\" id={messageId(componentId, 'error')}>\n <pds-icon icon={danger} size=\"small\" />\n {errorMessage}\n </p>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
|