bromcom-ui-next 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bromcom-ui/bromcom-ui.css +1 -1
- package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/bromcom-ui.esm.js.map +1 -1
- package/dist/bromcom-ui/p-0d0d6483.entry.js +2 -0
- package/dist/bromcom-ui/{p-3b607038.entry.js.map → p-0d0d6483.entry.js.map} +1 -1
- package/dist/bromcom-ui/p-13784cd7.entry.js +2 -0
- package/dist/bromcom-ui/p-13784cd7.entry.js.map +1 -0
- package/dist/bromcom-ui/p-13a245f6.js +2 -0
- package/dist/bromcom-ui/p-13a245f6.js.map +1 -0
- package/dist/bromcom-ui/p-25038cc8.entry.js +2 -0
- package/dist/bromcom-ui/p-25038cc8.entry.js.map +1 -0
- package/dist/bromcom-ui/p-308f865b.entry.js +2 -0
- package/dist/bromcom-ui/p-308f865b.entry.js.map +1 -0
- package/dist/bromcom-ui/p-385fa0f3.entry.js +2 -0
- package/dist/bromcom-ui/p-385fa0f3.entry.js.map +1 -0
- package/dist/bromcom-ui/p-389f1976.entry.js +2 -0
- package/dist/bromcom-ui/p-389f1976.entry.js.map +1 -0
- package/dist/bromcom-ui/p-3b230145.entry.js +2 -0
- package/dist/bromcom-ui/p-3b230145.entry.js.map +1 -0
- package/dist/bromcom-ui/p-49b0e982.entry.js +2 -0
- package/dist/bromcom-ui/p-49b0e982.entry.js.map +1 -0
- package/dist/bromcom-ui/p-55c4263c.entry.js +2 -0
- package/dist/bromcom-ui/p-55c4263c.entry.js.map +1 -0
- package/dist/bromcom-ui/{p-ebed10d5.entry.js → p-58ee24a8.entry.js} +2 -2
- package/dist/bromcom-ui/{p-ebed10d5.entry.js.map → p-58ee24a8.entry.js.map} +1 -1
- package/dist/bromcom-ui/p-729a870f.js.map +1 -1
- package/dist/bromcom-ui/p-9551c35e.entry.js +2 -0
- package/dist/bromcom-ui/p-9551c35e.entry.js.map +1 -0
- package/dist/bromcom-ui/p-9594cebb.js +2 -0
- package/dist/bromcom-ui/p-9594cebb.js.map +1 -0
- package/dist/bromcom-ui/p-98c76392.entry.js +2 -0
- package/dist/bromcom-ui/p-98c76392.entry.js.map +1 -0
- package/dist/bromcom-ui/p-a29e61a4.entry.js +2 -0
- package/dist/bromcom-ui/{p-cd437280.entry.js.map → p-a29e61a4.entry.js.map} +1 -1
- package/dist/bromcom-ui/p-ba2410ef.js +2 -0
- package/dist/bromcom-ui/p-ba2410ef.js.map +1 -0
- package/dist/bromcom-ui/p-bd0f7e78.entry.js +2 -0
- package/dist/bromcom-ui/p-bd0f7e78.entry.js.map +1 -0
- package/dist/bromcom-ui/p-bf69fc8a.entry.js +2 -0
- package/dist/bromcom-ui/p-bf69fc8a.entry.js.map +1 -0
- package/dist/bromcom-ui/{p-5d0838e9.entry.js → p-c1161950.entry.js} +2 -2
- package/dist/bromcom-ui/{p-5d0838e9.entry.js.map → p-c1161950.entry.js.map} +1 -1
- package/dist/bromcom-ui/p-c2b3945e.entry.js +2 -0
- package/dist/bromcom-ui/p-c2b3945e.entry.js.map +1 -0
- package/dist/bromcom-ui/p-c427ffee.entry.js +2 -0
- package/dist/bromcom-ui/{p-dcea8d62.entry.js.map → p-c427ffee.entry.js.map} +1 -1
- package/dist/bromcom-ui/p-c444235a.entry.js +2 -0
- package/dist/bromcom-ui/p-c444235a.entry.js.map +1 -0
- package/dist/bromcom-ui/p-c995a48c.entry.js +2 -0
- package/dist/bromcom-ui/p-c995a48c.entry.js.map +1 -0
- package/dist/bromcom-ui/p-c9b736d9.js +3 -0
- package/dist/{cjs/index-4795c073.js.map → bromcom-ui/p-c9b736d9.js.map} +1 -1
- package/dist/bromcom-ui/p-cd271b49.entry.js +2 -0
- package/dist/bromcom-ui/p-cd271b49.entry.js.map +1 -0
- package/dist/bromcom-ui/p-cee68279.entry.js +2 -0
- package/dist/bromcom-ui/{p-1d86c1cf.entry.js.map → p-cee68279.entry.js.map} +1 -1
- package/dist/bromcom-ui/{p-a590f793.entry.js → p-d57587e5.entry.js} +2 -2
- package/dist/bromcom-ui/{p-a590f793.entry.js.map → p-d57587e5.entry.js.map} +1 -1
- package/dist/bromcom-ui/p-e89ab4a7.entry.js +2 -0
- package/dist/bromcom-ui/p-e89ab4a7.entry.js.map +1 -0
- package/dist/bromcom-ui/{p-1b11150b.entry.js → p-f2d8aa70.entry.js} +2 -2
- package/dist/bromcom-ui/{p-1b11150b.entry.js.map → p-f2d8aa70.entry.js.map} +1 -1
- package/dist/bromcom-ui/p-f4e8a47d.entry.js +2 -0
- package/dist/bromcom-ui/p-f4e8a47d.entry.js.map +1 -0
- package/dist/cjs/app-globals-29edfda4.js.map +1 -1
- package/dist/cjs/bcm-accordion-group.cjs.entry.js +2 -2
- package/dist/cjs/bcm-accordion-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bcm-accordion.cjs.entry.js +2 -2
- package/dist/cjs/bcm-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/bcm-alert.cjs.entry.js +2 -2
- package/dist/cjs/bcm-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/bcm-avatar_4.cjs.entry.js +13 -7
- package/dist/cjs/bcm-avatar_4.cjs.entry.js.map +1 -1
- package/dist/cjs/bcm-button-group.cjs.entry.js +97 -0
- package/dist/cjs/bcm-button-group.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-checkbox.cjs.entry.js +226 -0
- package/dist/cjs/bcm-checkbox.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-chip.cjs.entry.js +3 -3
- package/dist/cjs/bcm-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/bcm-divider.cjs.entry.js +3 -3
- package/dist/cjs/bcm-divider.cjs.entry.js.map +1 -1
- package/dist/cjs/bcm-dropdown-item.cjs.entry.js +63 -0
- package/dist/cjs/bcm-dropdown-item.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-dropdown.cjs.entry.js +56 -0
- package/dist/cjs/bcm-dropdown.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-input.cjs.entry.js +7 -6
- package/dist/cjs/bcm-input.cjs.entry.js.map +1 -1
- package/dist/cjs/bcm-linked.cjs.entry.js +91 -0
- package/dist/cjs/bcm-linked.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-pop-confirm.cjs.entry.js +252 -0
- package/dist/cjs/bcm-pop-confirm.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-popover.cjs.entry.js +191 -0
- package/dist/cjs/bcm-popover.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-radio-group.cjs.entry.js +171 -0
- package/dist/cjs/bcm-radio-group.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-radio.cjs.entry.js +173 -0
- package/dist/cjs/bcm-radio.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-segmented-picker-option.cjs.entry.js +109 -0
- package/dist/cjs/bcm-segmented-picker-option.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-segmented-picker.cjs.entry.js +146 -0
- package/dist/cjs/bcm-segmented-picker.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-switch.cjs.entry.js +188 -0
- package/dist/cjs/bcm-switch.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-tabs-content.cjs.entry.js +22 -0
- package/dist/cjs/bcm-tabs-content.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-tabs-list.cjs.entry.js +43 -0
- package/dist/cjs/bcm-tabs-list.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-tabs-trigger.cjs.entry.js +92 -0
- package/dist/cjs/bcm-tabs-trigger.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-tabs.cjs.entry.js +211 -0
- package/dist/cjs/bcm-tabs.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-text.cjs.entry.js +3 -3
- package/dist/cjs/bcm-text.cjs.entry.js.map +1 -1
- package/dist/cjs/bcm-textarea.cjs.entry.js +8 -7
- package/dist/cjs/bcm-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/bcm-tooltip.cjs.entry.js +187 -0
- package/dist/cjs/bcm-tooltip.cjs.entry.js.map +1 -0
- package/dist/cjs/bromcom-ui.cjs.js +2 -2
- package/dist/cjs/floating-ui.dom.esm-3ec8404c.js +2085 -0
- package/dist/cjs/floating-ui.dom.esm-3ec8404c.js.map +1 -0
- package/dist/{components/p-31354aaa.js → cjs/generate-id-f6982042.js} +4 -47
- package/dist/cjs/generate-id-f6982042.js.map +1 -0
- package/dist/cjs/{index-4795c073.js → index-9a2c5938.js} +36 -7
- package/dist/{bromcom-ui/p-15fe392b.js.map → cjs/index-9a2c5938.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/validation-messages-18389279.js +52 -0
- package/dist/cjs/validation-messages-18389279.js.map +1 -0
- package/dist/collection/collection-manifest.json +18 -1
- package/dist/collection/components/accordion/accordion.css +1 -1
- package/dist/collection/components/accordion-group/accordion-group.css +1 -1
- package/dist/collection/components/alert/alert.css +1 -1
- package/dist/collection/components/avatar/avatar.css +1 -1
- package/dist/collection/components/badge/badge.css +1 -1
- package/dist/collection/components/basic-badge/basic-badge.css +1 -1
- package/dist/collection/components/button/button.component.js +33 -2
- package/dist/collection/components/button/button.component.js.map +1 -1
- package/dist/collection/components/button/button.css +1 -1
- package/dist/collection/components/button/types.js.map +1 -1
- package/dist/collection/components/button-group/button-group.component.js +252 -0
- package/dist/collection/components/button-group/button-group.component.js.map +1 -0
- package/dist/collection/components/button-group/button-group.css +1 -0
- package/dist/collection/components/button-group/types.js +2 -0
- package/dist/collection/components/button-group/types.js.map +1 -0
- package/dist/collection/components/checkbox/checkbox.component.js +440 -0
- package/dist/collection/components/checkbox/checkbox.component.js.map +1 -0
- package/dist/collection/components/checkbox/checkbox.css +1 -0
- package/dist/collection/components/chip/chip.component.js +1 -1
- package/dist/collection/components/chip/chip.css +1 -1
- package/dist/collection/components/divider/divider.component.js +1 -1
- package/dist/collection/components/divider/divider.css +1 -1
- package/dist/collection/components/dropdown/dropdown.component.js +110 -0
- package/dist/collection/components/dropdown/dropdown.component.js.map +1 -0
- package/dist/collection/components/dropdown/dropdown.css +1 -0
- package/dist/collection/components/dropdown-item/dropdown-item.component.js +198 -0
- package/dist/collection/components/dropdown-item/dropdown-item.component.js.map +1 -0
- package/dist/collection/components/dropdown-item/dropdown-item.css +1 -0
- package/dist/collection/components/input/input.component.js +2 -2
- package/dist/collection/components/input/input.css +1 -1
- package/dist/collection/components/linked/linked.component.js +140 -0
- package/dist/collection/components/linked/linked.component.js.map +1 -0
- package/dist/collection/components/linked/linked.css +1 -0
- package/dist/collection/components/pop-confirm/pop-confirm.component.js +629 -0
- package/dist/collection/components/pop-confirm/pop-confirm.component.js.map +1 -0
- package/dist/collection/components/pop-confirm/pop-confirm.css +1 -0
- package/dist/collection/components/popover/popover.component.js +477 -0
- package/dist/collection/components/popover/popover.component.js.map +1 -0
- package/dist/collection/components/popover/popover.css +1 -0
- package/dist/collection/components/radio/radio.component.js +502 -0
- package/dist/collection/components/radio/radio.component.js.map +1 -0
- package/dist/collection/components/radio/radio.css +1 -0
- package/dist/collection/components/radio-group/radio-group.component.js +523 -0
- package/dist/collection/components/radio-group/radio-group.component.js.map +1 -0
- package/dist/collection/components/radio-group/radio-group.css +1 -0
- package/dist/collection/components/segmented-picker/segmented-picker-option.component.js +253 -0
- package/dist/collection/components/segmented-picker/segmented-picker-option.component.js.map +1 -0
- package/dist/collection/components/segmented-picker/segmented-picker-option.css +1 -0
- package/dist/collection/components/segmented-picker/segmented-picker.component.js +269 -0
- package/dist/collection/components/segmented-picker/segmented-picker.component.js.map +1 -0
- package/dist/collection/components/segmented-picker/segmented-picker.css +1 -0
- package/dist/collection/components/segmented-picker/types.js +2 -0
- package/dist/collection/components/segmented-picker/types.js.map +1 -0
- package/dist/collection/components/switch/switch.component.js +452 -0
- package/dist/collection/components/switch/switch.component.js.map +1 -0
- package/dist/collection/components/switch/switch.css +1 -0
- package/dist/collection/components/tabs/bcm-tabs.css +1 -0
- package/dist/collection/components/tabs/tabs-content.component.js +46 -0
- package/dist/collection/components/tabs/tabs-content.component.js.map +1 -0
- package/dist/collection/components/tabs/tabs-content.css +1 -0
- package/dist/collection/components/tabs/tabs-list.component.js +46 -0
- package/dist/collection/components/tabs/tabs-list.component.js.map +1 -0
- package/dist/collection/components/tabs/tabs-list.css +1 -0
- package/dist/collection/components/tabs/tabs-trigger.component.js +195 -0
- package/dist/collection/components/tabs/tabs-trigger.component.js.map +1 -0
- package/dist/collection/components/tabs/tabs-trigger.css +1 -0
- package/dist/collection/components/tabs/tabs.component.js +422 -0
- package/dist/collection/components/tabs/tabs.component.js.map +1 -0
- package/dist/collection/components/text/text.component.js +1 -1
- package/dist/collection/components/text/text.css +1 -1
- package/dist/collection/components/textarea/textarea.component.js +3 -3
- package/dist/collection/components/textarea/textarea.css +1 -1
- package/dist/collection/components/tooltip/tooltip.component.js +385 -0
- package/dist/collection/components/tooltip/tooltip.component.js.map +1 -0
- package/dist/collection/components/tooltip/tooltip.css +1 -0
- package/dist/collection/styles/theme-variables.js +29 -0
- package/dist/collection/styles/theme-variables.js.map +1 -1
- package/dist/components/bcm-accordion-group.js +2 -2
- package/dist/components/bcm-accordion-group.js.map +1 -1
- package/dist/components/bcm-accordion.js +2 -2
- package/dist/components/bcm-accordion.js.map +1 -1
- package/dist/components/bcm-alert.js +2 -2
- package/dist/components/bcm-alert.js.map +1 -1
- package/dist/components/bcm-avatar.js +3 -3
- package/dist/components/bcm-avatar.js.map +1 -1
- package/dist/components/bcm-badge.js +1 -1
- package/dist/components/bcm-basic-badge.js +2 -2
- package/dist/components/bcm-basic-badge.js.map +1 -1
- package/dist/components/bcm-button-group.d.ts +11 -0
- package/dist/components/bcm-button-group.js +120 -0
- package/dist/components/bcm-button-group.js.map +1 -0
- package/dist/components/bcm-button.js +1 -327
- package/dist/components/bcm-button.js.map +1 -1
- package/dist/components/bcm-checkbox.d.ts +11 -0
- package/dist/components/bcm-checkbox.js +256 -0
- package/dist/components/bcm-checkbox.js.map +1 -0
- package/dist/components/bcm-chip.js +3 -3
- package/dist/components/bcm-chip.js.map +1 -1
- package/dist/components/bcm-divider.js +3 -3
- package/dist/components/bcm-divider.js.map +1 -1
- package/dist/components/bcm-dropdown-item.d.ts +11 -0
- package/dist/components/bcm-dropdown-item.js +85 -0
- package/dist/components/bcm-dropdown-item.js.map +1 -0
- package/dist/components/bcm-dropdown.d.ts +11 -0
- package/dist/components/bcm-dropdown.js +87 -0
- package/dist/components/bcm-dropdown.js.map +1 -0
- package/dist/components/bcm-input.js +6 -5
- package/dist/components/bcm-input.js.map +1 -1
- package/dist/components/bcm-linked.d.ts +11 -0
- package/dist/components/bcm-linked.js +8 -0
- package/dist/components/bcm-linked.js.map +1 -0
- package/dist/components/bcm-pop-confirm.d.ts +11 -0
- package/dist/components/bcm-pop-confirm.js +288 -0
- package/dist/components/bcm-pop-confirm.js.map +1 -0
- package/dist/components/bcm-popover.d.ts +11 -0
- package/dist/components/bcm-popover.js +216 -0
- package/dist/components/bcm-popover.js.map +1 -0
- package/dist/components/bcm-radio-group.d.ts +11 -0
- package/dist/components/bcm-radio-group.js +200 -0
- package/dist/components/bcm-radio-group.js.map +1 -0
- package/dist/components/bcm-radio.d.ts +11 -0
- package/dist/components/bcm-radio.js +198 -0
- package/dist/components/bcm-radio.js.map +1 -0
- package/dist/components/bcm-segmented-picker-option.d.ts +11 -0
- package/dist/components/bcm-segmented-picker-option.js +131 -0
- package/dist/components/bcm-segmented-picker-option.js.map +1 -0
- package/dist/components/bcm-segmented-picker.d.ts +11 -0
- package/dist/components/bcm-segmented-picker.js +170 -0
- package/dist/components/bcm-segmented-picker.js.map +1 -0
- package/dist/components/bcm-switch.d.ts +11 -0
- package/dist/components/bcm-switch.js +215 -0
- package/dist/components/bcm-switch.js.map +1 -0
- package/dist/components/bcm-tabs-content.d.ts +11 -0
- package/dist/components/bcm-tabs-content.js +39 -0
- package/dist/components/bcm-tabs-content.js.map +1 -0
- package/dist/components/bcm-tabs-list.d.ts +11 -0
- package/dist/components/bcm-tabs-list.js +58 -0
- package/dist/components/bcm-tabs-list.js.map +1 -0
- package/dist/components/bcm-tabs-trigger.d.ts +11 -0
- package/dist/components/bcm-tabs-trigger.js +112 -0
- package/dist/components/bcm-tabs-trigger.js.map +1 -0
- package/dist/components/bcm-tabs.d.ts +11 -0
- package/dist/components/bcm-tabs.js +239 -0
- package/dist/components/bcm-tabs.js.map +1 -0
- package/dist/components/bcm-text.js +3 -3
- package/dist/components/bcm-text.js.map +1 -1
- package/dist/components/bcm-textarea.js +7 -6
- package/dist/components/bcm-textarea.js.map +1 -1
- package/dist/components/bcm-tooltip.d.ts +11 -0
- package/dist/components/bcm-tooltip.js +211 -0
- package/dist/components/bcm-tooltip.js.map +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/p-13a245f6.js +48 -0
- package/dist/components/p-13a245f6.js.map +1 -0
- package/dist/components/{p-39637e05.js → p-49f20ff7.js} +3 -3
- package/dist/components/{p-39637e05.js.map → p-49f20ff7.js.map} +1 -1
- package/dist/components/{p-13582168.js → p-5377117d.js} +32 -6
- package/dist/components/p-5377117d.js.map +1 -0
- package/dist/components/p-5f7a0d0d.js +107 -0
- package/dist/components/p-5f7a0d0d.js.map +1 -0
- package/dist/components/p-9594cebb.js +2078 -0
- package/dist/components/p-9594cebb.js.map +1 -0
- package/dist/{esm/validation-messages-a29d53be.js → components/p-ba2410ef.js} +2 -47
- package/dist/components/p-ba2410ef.js.map +1 -0
- package/dist/components/p-c3a60937.js +338 -0
- package/dist/components/p-c3a60937.js.map +1 -0
- package/dist/esm/app-globals-bfa07b76.js.map +1 -1
- package/dist/esm/bcm-accordion-group.entry.js +2 -2
- package/dist/esm/bcm-accordion-group.entry.js.map +1 -1
- package/dist/esm/bcm-accordion.entry.js +2 -2
- package/dist/esm/bcm-accordion.entry.js.map +1 -1
- package/dist/esm/bcm-alert.entry.js +2 -2
- package/dist/esm/bcm-alert.entry.js.map +1 -1
- package/dist/esm/bcm-avatar_4.entry.js +13 -7
- package/dist/esm/bcm-avatar_4.entry.js.map +1 -1
- package/dist/esm/bcm-button-group.entry.js +93 -0
- package/dist/esm/bcm-button-group.entry.js.map +1 -0
- package/dist/esm/bcm-checkbox.entry.js +222 -0
- package/dist/esm/bcm-checkbox.entry.js.map +1 -0
- package/dist/esm/bcm-chip.entry.js +3 -3
- package/dist/esm/bcm-chip.entry.js.map +1 -1
- package/dist/esm/bcm-divider.entry.js +3 -3
- package/dist/esm/bcm-divider.entry.js.map +1 -1
- package/dist/esm/bcm-dropdown-item.entry.js +59 -0
- package/dist/esm/bcm-dropdown-item.entry.js.map +1 -0
- package/dist/esm/bcm-dropdown.entry.js +52 -0
- package/dist/esm/bcm-dropdown.entry.js.map +1 -0
- package/dist/esm/bcm-input.entry.js +6 -5
- package/dist/esm/bcm-input.entry.js.map +1 -1
- package/dist/esm/bcm-linked.entry.js +87 -0
- package/dist/esm/bcm-linked.entry.js.map +1 -0
- package/dist/esm/bcm-pop-confirm.entry.js +248 -0
- package/dist/esm/bcm-pop-confirm.entry.js.map +1 -0
- package/dist/esm/bcm-popover.entry.js +187 -0
- package/dist/esm/bcm-popover.entry.js.map +1 -0
- package/dist/esm/bcm-radio-group.entry.js +167 -0
- package/dist/esm/bcm-radio-group.entry.js.map +1 -0
- package/dist/esm/bcm-radio.entry.js +169 -0
- package/dist/esm/bcm-radio.entry.js.map +1 -0
- package/dist/esm/bcm-segmented-picker-option.entry.js +105 -0
- package/dist/esm/bcm-segmented-picker-option.entry.js.map +1 -0
- package/dist/esm/bcm-segmented-picker.entry.js +142 -0
- package/dist/esm/bcm-segmented-picker.entry.js.map +1 -0
- package/dist/esm/bcm-switch.entry.js +184 -0
- package/dist/esm/bcm-switch.entry.js.map +1 -0
- package/dist/esm/bcm-tabs-content.entry.js +18 -0
- package/dist/esm/bcm-tabs-content.entry.js.map +1 -0
- package/dist/esm/bcm-tabs-list.entry.js +39 -0
- package/dist/esm/bcm-tabs-list.entry.js.map +1 -0
- package/dist/esm/bcm-tabs-trigger.entry.js +88 -0
- package/dist/esm/bcm-tabs-trigger.entry.js.map +1 -0
- package/dist/esm/bcm-tabs.entry.js +207 -0
- package/dist/esm/bcm-tabs.entry.js.map +1 -0
- package/dist/esm/bcm-text.entry.js +3 -3
- package/dist/esm/bcm-text.entry.js.map +1 -1
- package/dist/esm/bcm-textarea.entry.js +7 -6
- package/dist/esm/bcm-textarea.entry.js.map +1 -1
- package/dist/esm/bcm-tooltip.entry.js +183 -0
- package/dist/esm/bcm-tooltip.entry.js.map +1 -0
- package/dist/esm/bromcom-ui.js +3 -3
- package/dist/esm/floating-ui.dom.esm-480e0f15.js +2078 -0
- package/dist/esm/floating-ui.dom.esm-480e0f15.js.map +1 -0
- package/dist/{cjs/validation-messages-c36e5c31.js → esm/generate-id-3b2fcb93.js} +2 -52
- package/dist/esm/generate-id-3b2fcb93.js.map +1 -0
- package/dist/esm/{index-27cc1bac.js → index-8571fbf7.js} +36 -8
- package/dist/esm/index-8571fbf7.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/validation-messages-af4512f0.js +48 -0
- package/dist/esm/validation-messages-af4512f0.js.map +1 -0
- package/dist/types/components/button/button.component.d.ts +3 -1
- package/dist/types/components/button/types.d.ts +4 -4
- package/dist/types/components/button-group/button-group.component.d.ts +25 -0
- package/dist/types/components/button-group/types.d.ts +2 -0
- package/dist/types/components/checkbox/checkbox.component.d.ts +99 -0
- package/dist/types/components/dropdown/dropdown.component.d.ts +14 -0
- package/dist/types/components/dropdown-item/dropdown-item.component.d.ts +14 -0
- package/dist/types/components/linked/linked.component.d.ts +16 -0
- package/dist/types/components/pop-confirm/pop-confirm.component.d.ts +195 -0
- package/dist/types/components/popover/popover.component.d.ts +118 -0
- package/dist/types/components/radio/radio.component.d.ts +105 -0
- package/dist/types/components/radio-group/radio-group.component.d.ts +124 -0
- package/dist/types/components/segmented-picker/segmented-picker-option.component.d.ts +30 -0
- package/dist/types/components/segmented-picker/segmented-picker.component.d.ts +35 -0
- package/dist/types/components/segmented-picker/types.d.ts +1 -0
- package/dist/types/components/switch/switch.component.d.ts +62 -0
- package/dist/types/components/tabs/tabs-content.component.d.ts +13 -0
- package/dist/types/components/tabs/tabs-list.component.d.ts +12 -0
- package/dist/types/components/tabs/tabs-trigger.component.d.ts +41 -0
- package/dist/types/components/tabs/tabs.component.d.ts +88 -0
- package/dist/types/components/tooltip/tooltip.component.d.ts +86 -0
- package/dist/types/components.d.ts +2495 -649
- package/dist/types/styles/theme-variables.d.ts +29 -0
- package/package.json +2 -1
- package/dist/bromcom-ui/p-04f6d730.entry.js +0 -2
- package/dist/bromcom-ui/p-04f6d730.entry.js.map +0 -1
- package/dist/bromcom-ui/p-15fe392b.js +0 -3
- package/dist/bromcom-ui/p-1d86c1cf.entry.js +0 -2
- package/dist/bromcom-ui/p-31354aaa.js +0 -2
- package/dist/bromcom-ui/p-31354aaa.js.map +0 -1
- package/dist/bromcom-ui/p-3b607038.entry.js +0 -2
- package/dist/bromcom-ui/p-cd437280.entry.js +0 -2
- package/dist/bromcom-ui/p-dcea8d62.entry.js +0 -2
- package/dist/cjs/validation-messages-c36e5c31.js.map +0 -1
- package/dist/components/p-13582168.js.map +0 -1
- package/dist/components/p-31354aaa.js.map +0 -1
- package/dist/esm/index-27cc1bac.js.map +0 -1
- package/dist/esm/validation-messages-a29d53be.js.map +0 -1
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-9a2c5938.js');
|
|
6
6
|
const index$1 = require('./index-310db2a6.js');
|
|
7
7
|
const index$2 = require('./index-5a88e57b.js');
|
|
8
|
-
const
|
|
8
|
+
const generateId = require('./generate-id-f6982042.js');
|
|
9
|
+
const validationMessages = require('./validation-messages-18389279.js');
|
|
9
10
|
|
|
10
11
|
const defaultIcons = {
|
|
11
12
|
'search': 'fa-regular fa-magnifying-glass',
|
|
@@ -33,7 +34,7 @@ const checkSlotContent = (element, slotName) => {
|
|
|
33
34
|
return assignedNodes.length > 0;
|
|
34
35
|
};
|
|
35
36
|
|
|
36
|
-
const inputCss = ".visible{visibility:visible}.collapse{visibility:collapse}.relative{position:relative}.block{display:block}.table{display:table}.contents{display:contents}.hidden{display:none}.border-collapse{border-collapse:collapse}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.resize{resize:both}.border{border-width:1px}.underline{text-decoration-line:underline}.outline{outline-style:solid}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid oklch(.928 .006 264.531);box-sizing:border-box}:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:Inter,sans-serif;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:oklch(.707 .022 261.325);opacity:1}input::placeholder,textarea::placeholder{color:oklch(.707 .022 261.325);opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:host{display:inline-block}.bcm-ui-element{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,sans-serif}.static{position:static}.mt-1{margin-top:.25rem}.flex{display:flex}.h-10{height:2.5rem}.h-6{height:1.5rem}.h-8{height:2rem}.w-full{width:100%}.flex-1{flex:1 1 0%}.cursor-not-allowed{cursor:not-allowed}.appearance-none{appearance:none}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.text-ellipsis{text-overflow:ellipsis}.rounded{border-radius
|
|
37
|
+
const inputCss = ".visible{visibility:visible}.collapse{visibility:collapse}.relative{position:relative}.block{display:block}.table{display:table}.contents{display:contents}.hidden{display:none}.border-collapse{border-collapse:collapse}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.resize{resize:both}.border{border-width:1px}.underline{text-decoration-line:underline}.outline{outline-style:solid}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid oklch(.928 .006 264.531);box-sizing:border-box}:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:Inter,sans-serif;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:oklch(.707 .022 261.325);opacity:1}input::placeholder,textarea::placeholder{color:oklch(.707 .022 261.325);opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:host{display:inline-block}.bcm-ui-element{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,sans-serif}.static{position:static}.mt-1{margin-top:.25rem}.flex{display:flex}.h-10{height:2.5rem}.h-6{height:1.5rem}.h-8{height:2rem}.w-full{width:100%}.flex-1{flex:1 1 0%}.cursor-not-allowed{cursor:not-allowed}.appearance-none{appearance:none}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.text-ellipsis{text-overflow:ellipsis}.rounded{border-radius:var(--bcm-ui-border-radius-default,6px)}.border-0{border-width:0}.border-solid{border-style:solid}.border-\\[--bcm-ui-color-border-default\\]{border-color:var(--bcm-ui-color-border-default)}.border-\\[--bcm-ui-color-border-error\\]{border-color:var(--bcm-ui-color-border-error)}.border-\\[--bcm-ui-color-border-info\\]{border-color:var(--bcm-ui-color-border-info)}.border-\\[--bcm-ui-color-border-success\\]{border-color:var(--bcm-ui-color-border-success)}.border-\\[--bcm-ui-color-border-warning\\]{border-color:var(--bcm-ui-color-border-warning)}.bg-\\[--bcm-ui-color-background-base-default\\]{background-color:var(--bcm-ui-color-background-base-default)}.bg-transparent{background-color:transparent}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.font-sans{font-family:Inter,sans-serif}.text-size-3{font-size:var(--bcm-ui-font-size-3,12px);line-height:var(--bcm-ui-line-height-3,16px)}.text-size-4{font-size:var(--bcm-ui-font-size-4,14px);line-height:var(--bcm-ui-line-height-4,20px)}.text-size-5{font-size:var(--bcm-ui-font-size-5,16px);line-height:var(--bcm-ui-line-height-5,24px)}.text-size-6{font-size:var(--bcm-ui-font-size-6,18px);line-height:var(--bcm-ui-line-height-6,24px)}.font-medium{font-weight:500}.text-\\[--bcm-ui-color-text-caption\\]{color:var(--bcm-ui-color-text-caption)}.text-\\[--bcm-ui-color-text-default\\]{color:var(--bcm-ui-color-text-default)}.text-\\[--bcm-ui-color-text-disabled\\]{color:var(--bcm-ui-color-text-disabled)}.text-\\[--bcm-ui-color-text-error\\]{color:var(--bcm-ui-color-text-error)}.text-\\[--bcm-ui-color-text-info\\]{color:var(--bcm-ui-color-text-info)}.text-\\[--bcm-ui-color-text-success\\]{color:var(--bcm-ui-color-text-success)}.text-\\[--bcm-ui-color-text-warning\\]{color:var(--bcm-ui-color-text-warning)}.text-color-disabled{color:var(--bcm-ui-color-text-disabled)}.text-color-label{color:var(--bcm-ui-color-text-label)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.shadow{--tw-shadow:var(--bcm-ui-box-shadow-default);--tw-shadow-colored:var(--bcm-ui-box-shadow-default);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-0{outline-width:0}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.placeholder\\:font-normal::placeholder{font-weight:400}.placeholder\\:text-\\[--bcm-ui-color-text-placeholder\\]::placeholder{color:var(--bcm-ui-color-text-placeholder)}.hover\\:border-\\[--bcm-ui-color-border-error\\]:hover{border-color:var(--bcm-ui-color-border-error)}.hover\\:border-\\[--bcm-ui-color-border-info\\]:hover{border-color:var(--bcm-ui-color-border-info)}.hover\\:border-\\[--bcm-ui-color-border-primary\\]:hover{border-color:var(--bcm-ui-color-border-primary)}.hover\\:border-\\[--bcm-ui-color-border-success\\]:hover{border-color:var(--bcm-ui-color-border-success)}.hover\\:border-\\[--bcm-ui-color-border-warning\\]:hover{border-color:var(--bcm-ui-color-border-warning)}.has-\\[\\:focus\\]\\:border-\\[--bcm-ui-color-border-error\\]:has(:focus){border-color:var(--bcm-ui-color-border-error)}.has-\\[\\:focus\\]\\:border-\\[--bcm-ui-color-border-info\\]:has(:focus){border-color:var(--bcm-ui-color-border-info)}.has-\\[\\:focus\\]\\:border-\\[--bcm-ui-color-border-primary\\]:has(:focus){border-color:var(--bcm-ui-color-border-primary)}.has-\\[\\:focus\\]\\:border-\\[--bcm-ui-color-border-success\\]:has(:focus){border-color:var(--bcm-ui-color-border-success)}.has-\\[\\:focus\\]\\:border-\\[--bcm-ui-color-border-warning\\]:has(:focus){border-color:var(--bcm-ui-color-border-warning)}";
|
|
37
38
|
const BcmInputStyle0 = inputCss;
|
|
38
39
|
|
|
39
40
|
const BcmInput = class {
|
|
@@ -51,7 +52,7 @@ const BcmInput = class {
|
|
|
51
52
|
/** Input value */
|
|
52
53
|
this.value = '';
|
|
53
54
|
/** Input id */
|
|
54
|
-
this._id =
|
|
55
|
+
this._id = generateId.generateId('input');
|
|
55
56
|
/** Controls the input size */
|
|
56
57
|
this.size = 'medium';
|
|
57
58
|
/** Defines the input's status/state */
|
|
@@ -279,14 +280,14 @@ const BcmInput = class {
|
|
|
279
280
|
medium: 16,
|
|
280
281
|
large: 18,
|
|
281
282
|
}[this.size];
|
|
282
|
-
return (index.h("div", { key: '
|
|
283
|
+
return (index.h("div", { key: 'a0fa86f738a07e475cd809c9abe8bd7aa5f50d2e', class: "bcm-ui-element" }, this.label && (index.h("label", { key: 'b2715f3669bf51b2bc93b29a4ce78fc84d6a8fec', class: index$2.classNames('input-label font-medium', {
|
|
283
284
|
'text-color-label': !this.disabled,
|
|
284
285
|
'text-color-disabled': this.disabled,
|
|
285
286
|
}, {
|
|
286
287
|
'text-size-3': this.size === 'small',
|
|
287
288
|
'text-size-4': this.size === 'medium',
|
|
288
289
|
'text-size-5': this.size === 'large',
|
|
289
|
-
}), htmlFor: inputId }, index.h("slot", { key: '
|
|
290
|
+
}), htmlFor: inputId }, index.h("slot", { key: '26f991e1bad25cc2f074b9259320cc555c3d4bd9', name: "label" }, this.label), this.required && index.h("span", { key: '0b5a332b842ece285b093b2474e7dd376530d613' }, "*"))), index.h("div", { key: 'f4b1d4087e2bdfb07c140170e4e59e10c2163535', class: base() }, (this.hasSlotContent('prefix') || this.prefixIcon || this.getDefaultIconForType()) && (index.h("div", { key: 'dcc49ae6c4ad4795d1f10f85065e44cb061fce0e', class: "flex items-center gap-2 px-2" }, (this.prefixIcon || this.getDefaultIconForType()) && (index.h("bcm-icon", { key: 'c56c06852192dcfc4e7d3df24851afc31804b6b9', class: "prefix-icon", "icon-name": this.prefixIcon || this.getDefaultIconForType(), size: iconSize })), index.h("slot", { key: '29bd74d28492d5e95b4c3155b3c5a9fed3671a2a', name: "prefix" }))), index.h("input", { key: '21a06d459d5f68be085d46580134ea4718192d89', ref: el => (this.inputRef = el), id: inputId, class: inputClass(), type: this.type, name: this.name, disabled: this.disabled, readonly: this.readonly, required: this.required, placeholder: this.placeholder, autocomplete: this.autocomplete, minlength: this.minLength, maxlength: this.maxLength, min: this.min, max: this.max, step: this.step, pattern: this.pattern, "aria-invalid": this.status === 'error', "aria-required": this.required, "aria-labelledby": this.labelledby, "aria-describedby": this.describedby, value: this.value, onInput: this.onInput, onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur, onKeyDown: this.onKeyDown, onKeyUp: this.onKeyUp }), (this.hasSlotContent('suffix') || this.suffixIcon) && (index.h("div", { key: 'd3852234f0410ed5ceb7df79c2645a97c45afac2', class: "flex items-center gap-2 px-2" }, index.h("slot", { key: '1e280c327b4791631c3dda4f3ec49706b8a88300', name: "suffix" }), this.suffixIcon && index.h("bcm-icon", { key: 'd0d14a9d2c7ce1be1de030afb661866b7bf60546', class: "suffix-icon", "icon-name": this.suffixIcon, size: iconSize })))), (this.captionText || this.internalErrorMessage || this.validationMessage) && (index.h("div", { key: '4408fc79afa594d8a932898f13573395ae33cccd', class: index$2.classNames('input-caption-text font-regular mt-1', {
|
|
290
291
|
'text-[--bcm-ui-color-text-caption]': !this.disabled && this.internalStatus === 'default',
|
|
291
292
|
'text-[--bcm-ui-color-text-error]': !this.disabled && (this.internalStatus === 'error' || !this.isValid),
|
|
292
293
|
'text-[--bcm-ui-color-text-success]': !this.disabled && this.internalStatus === 'success',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"bcm-input.entry.cjs.js","mappings":";;;;;;;;;AAIO,MAAM,YAAY,GAAG;IAC1B,QAAQ,EAAE,gCAAgC;IAC1C,OAAO,EAAE,wBAAwB;IACjC,KAAK,EAAE,qBAAqB;IAC5B,KAAK,EAAE,oBAAoB;IAC3B,MAAM,EAAE,wBAAwB;IAChC,MAAM,EAAE,qBAAqB;IAC7B,gBAAgB,EAAE,8BAA8B;IAChD,UAAU,EAAE,oBAAoB;CACxB;;ACbV;;;;;;AAMO,MAAM,gBAAgB,GAAG,CAAC,OAAoB,EAAE,QAAgB;;IACrE,MAAM,IAAI,GAAG,MAAA,OAAO,CAAC,UAAU,0CAAE,aAAa,CAAC,cAAc,QAAQ,IAAI,CAAoB,CAAC;IAC9F,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IAExB,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;IAC3C,OAAO,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;AAClC,CAAC;;ACZD,MAAM,QAAQ,GAAG,i4OAAi4O,CAAC;AACn5O,uBAAe,QAAQ;;MCYV,QAAQ;IALrB;;;;;;;;QASW,cAAS,GAAG,KAAK,CAAC;QAElB,YAAO,GAAG,IAAI,CAAC;QACf,mBAAc,GAAgB,SAAS,CAAC;;QAKjD,UAAK,GAAW,EAAE,CAAC;;QAYnB,QAAG,GAAYA,6BAAU,CAAC,OAAO,CAAC,CAAC;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,GAAa,CACrG,CACP,CACG,EACL,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,oBAAoB,IAAI,IAAI,CAAC,iBAAiB,MACvEA,kEACE,KAAK,EAAEC,kBAAU,CACf,sCAAsC,EACtC;gBACE,oCAAoC,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS;gBACzF,kCAAkC,EAAE,CAAC,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,cAAc,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;gBACxG,oCAAoC,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS;gBACzF,oCAAoC,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS;gBACzF,iCAAiC,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,KAAK,MAAM;gBACnF,qCAAqC,EAAE,IAAI,CAAC,QAAQ;aACrD,EACD;gBACE,aAAa,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO;gBACpC,aAAa,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ;gBACrC,aAAa,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO;aACrC,CACF,IAEA,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,cAAc,KAAK,OAAO,GAAG,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,WAAW,CACpH,CACP,CACG,EACN;KACH;;;;;;;;;;;;","names":["generateId","tv","setValidationMessages","defaultValidationMessages","getValidationMessage","h","classNames"],"sources":["src/components/input/types.ts","src/utils/slot/check-slot-content.ts","src/components/input/input.scss?tag=bcm-input&encapsulation=shadow","src/components/input/input.component.tsx"],"sourcesContent":["export type InputSize = 'small' | 'medium' | 'large';\nexport type InputStatus = 'default' | 'error' | 'success' | 'warning' | 'info';\nexport type InputType = 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search' | 'date' | 'time' | 'datetime-local';\n\nexport const defaultIcons = {\n 'search': 'fa-regular fa-magnifying-glass',\n 'email': 'fa-regular fa-envelope',\n 'tel': 'fa-regular fa-phone',\n 'url': 'fa-regular fa-link',\n 'date': 'fa-regular fa-calendar',\n 'time': 'fa-regular fa-clock',\n 'datetime-local': 'fa-regular fa-calendar-clock',\n 'password': 'fa-regular fa-lock',\n} as const;\n","/**\n * Checks if a named slot has any content\n * @param element - The host element (component instance)\n * @param slotName - Name of the slot to check\n * @returns boolean indicating if the slot has any assigned nodes\n */\nexport const checkSlotContent = (element: HTMLElement, slotName: string): boolean => {\n const slot = element.shadowRoot?.querySelector(`slot[name=\"${slotName}\"]`) as HTMLSlotElement;\n if (!slot) return false;\n\n const assignedNodes = slot.assignedNodes();\n return assignedNodes.length > 0;\n};\n",":host {\n display: inline-block;\n}\n","import { Component, Prop, h, Event, EventEmitter, Method, State, Watch, Element } from '@stencil/core';\nimport { InputSize, InputStatus, InputType, defaultIcons } from './types';\nimport { tv } from 'tailwind-variants';\nimport classNames from 'classnames';\nimport { generateId } from '../../utils/id/generate-id';\nimport { checkSlotContent } from '../../utils/slot/check-slot-content';\nimport { getValidationMessage, setValidationMessages, defaultValidationMessages } from '../../utils/validation-messages';\n\n@Component({\n tag: 'bcm-input',\n styleUrl: 'input.scss',\n shadow: true,\n})\nexport class BcmInput {\n @Element() el: HTMLElement;\n private inputRef: HTMLInputElement;\n\n @State() isFocused = false;\n @State() validationMessage: string;\n @State() isValid = true;\n @State() internalStatus: InputStatus = 'default';\n @State() internalErrorMessage: string;\n\n /** Input value */\n @Prop({ mutable: true, reflect: true })\n value: string = '';\n\n /** Input placeholder text */\n @Prop()\n placeholder?: string;\n\n /** Input name */\n @Prop()\n name?: string;\n\n /** Input id */\n @Prop({ attribute: 'id', reflect: true })\n _id?: string = generateId('input');\n\n /** Controls the input size */\n @Prop()\n size: InputSize = 'medium';\n\n /** Defines the input's status/state */\n @Prop()\n status: InputStatus = 'default';\n\n /** Full width input */\n @Prop({ attribute: 'full-width', reflect: true })\n fullWidth = false;\n\n /** HTML input type */\n @Prop()\n type: InputType = 'text';\n\n /** Whether the input is disabled */\n @Prop()\n disabled = false;\n\n /** Whether the input is readonly */\n @Prop()\n readonly = false;\n\n /** Whether the input is required */\n @Prop()\n required = false;\n\n /** Input autocomplete attribute */\n @Prop()\n autocomplete?: string;\n\n /** Min length for text input */\n @Prop()\n minLength?: number;\n\n /** Max length for text input */\n @Prop()\n maxLength?: number;\n\n /** Min value for number input */\n @Prop()\n min?: number;\n\n /** Max value for number input */\n @Prop()\n max?: number;\n\n /** Step value for number input */\n @Prop()\n step?: number;\n\n /** Pattern for validation */\n @Prop()\n pattern?: string;\n\n /** Input label for accessibility */\n @Prop()\n label?: string;\n\n /** Error message to display */\n @Prop()\n errorMessage?: string;\n\n /** Caption text to display below input */\n @Prop()\n captionText?: string;\n\n /** ID of associated label element */\n @Prop()\n labelledby?: string;\n\n /** ID of associated caption/error text element */\n @Prop()\n describedby?: string;\n\n /** Prefix icon class name */\n @Prop()\n prefixIcon?: string;\n\n /** Suffix icon class name */\n @Prop()\n suffixIcon?: string;\n\n /** Whether to use native form validation\n * If false, component will handle validation internally\n */\n @Prop()\n useNativeValidation = true;\n\n /** Custom validation function */\n @Prop()\n validator?: (value: string) => string | undefined;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmInput: EventEmitter<InputEvent>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmChange: EventEmitter<Event>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmFocus: EventEmitter<FocusEvent>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmBlur: EventEmitter<FocusEvent>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmKeyDown: EventEmitter<KeyboardEvent>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmKeyUp: EventEmitter<KeyboardEvent>;\n\n @Watch('value')\n handleValueChange(newValue: string) {\n if (this.inputRef) {\n this.inputRef.value = newValue;\n }\n }\n\n @Watch('status')\n watchStatus(newValue: InputStatus) {\n this.internalStatus = newValue;\n }\n\n @Watch('errorMessage')\n watchErrorMessage(newValue: string) {\n this.internalErrorMessage = newValue;\n }\n\n @Method()\n async setFocus() {\n this.inputRef?.focus();\n }\n\n @Method()\n async setBlur() {\n this.inputRef?.blur();\n }\n\n @Method()\n async select() {\n this.inputRef?.select();\n }\n\n /** Sets locale and messages for all inputs */\n @Method()\n async setLocale(locale: string, messages: Record<string, string>) {\n // Set messages and update validation immediately\n setValidationMessages(locale, messages);\n\n // Mevcut validasyon mesajını güncelle\n if (!this.isValid) {\n this.validateInput();\n }\n }\n\n componentWillLoad() {\n // I18n için default mesajları set et\n setValidationMessages('en', defaultValidationMessages);\n this.internalStatus = this.status;\n this.internalErrorMessage = this.errorMessage;\n }\n\n private validateInput(): void {\n if (!this.inputRef) return;\n\n // Reset validation state\n this.isValid = true;\n this.validationMessage = '';\n\n const value = this.inputRef.value;\n\n // Required check\n if (this.required && !value) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('required');\n this.internalStatus = 'error';\n this.internalErrorMessage = this.validationMessage;\n return;\n }\n\n // Minimum length check\n else if (this.minLength && value.length < this.minLength) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('minlength', { min: this.minLength });\n }\n // Maximum length check\n else if (this.maxLength && value.length > this.maxLength) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('maxlength', { max: this.maxLength });\n }\n // Pattern check\n else if (this.pattern && !new RegExp(this.pattern).test(value)) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('pattern');\n }\n // Email check\n else if (this.type === 'email' && value && !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value)) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('email');\n }\n // Number range check\n else if (this.type === 'number' && value) {\n const numValue = parseFloat(value);\n if (this.min !== undefined && numValue < this.min) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('min', { min: this.min });\n } else if (this.max !== undefined && numValue > this.max) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('max', { max: this.max });\n }\n }\n\n // Update component state\n this.internalStatus = this.isValid ? 'default' : 'error';\n this.internalErrorMessage = this.validationMessage;\n }\n\n private onInput = (event: InputEvent) => {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n this.bcmInput.emit(event);\n this.validateInput();\n };\n\n private onChange = (event: Event) => {\n this.bcmChange.emit(event);\n };\n\n private onFocus = (event: FocusEvent) => {\n this.isFocused = true;\n this.bcmFocus.emit(event);\n };\n\n private onBlur = (event: FocusEvent) => {\n this.isFocused = false;\n this.bcmBlur.emit(event);\n this.validateInput();\n };\n\n private onKeyDown = (event: KeyboardEvent) => {\n this.bcmKeyDown.emit(event);\n };\n\n private onKeyUp = (event: KeyboardEvent) => {\n this.bcmKeyUp.emit(event);\n };\n\n private hasSlotContent(slotName: string): boolean {\n return checkSlotContent(this.el, slotName);\n }\n\n private styleClass = tv(\n {\n slots: {\n base: [\n 'bcm-input bcm-input__container',\n 'bg-[--bcm-ui-color-background-base-default]',\n 'border border-solid rounded',\n 'flex items-center justify-between',\n 'transition-colors duration-200',\n 'px-2',\n ],\n inputClass: [\n 'input',\n 'w-full flex-1',\n 'border-0 outline-0 bg-transparent',\n 'appearance-none text-ellipsis',\n 'text-[--bcm-ui-color-text-default] placeholder:text-[--bcm-ui-color-text-placeholder] placeholder:font-normal',\n 'font-sans antialiased font-medium',\n 'px-1',\n ],\n },\n variants: {\n size: {\n small: {\n base: '',\n inputClass: 'text-size-4 h-6',\n },\n medium: {\n base: '',\n inputClass: 'text-size-5 h-8',\n },\n large: {\n base: '',\n inputClass: 'text-size-6 h-10',\n },\n },\n status: {\n default: {\n base: ['border-[--bcm-ui-color-border-default]', 'hover:border-[--bcm-ui-color-border-primary]', 'has-[:focus]:border-[--bcm-ui-color-border-primary]'],\n },\n error: {\n base: ['border-[--bcm-ui-color-border-error]', 'hover:border-[--bcm-ui-color-border-error]', 'has-[:focus]:border-[--bcm-ui-color-border-error]'],\n },\n success: {\n base: ['border-[--bcm-ui-color-border-success]', 'hover:border-[--bcm-ui-color-border-success]', 'has-[:focus]:border-[--bcm-ui-color-border-success]'],\n },\n warning: {\n base: ['border-[--bcm-ui-color-border-warning]', 'hover:border-[--bcm-ui-color-border-warning]', 'has-[:focus]:border-[--bcm-ui-color-border-warning]'],\n },\n info: {\n base: ['border-[--bcm-ui-color-border-info]', 'hover:border-[--bcm-ui-color-border-info]', 'has-[:focus]:border-[--bcm-ui-color-border-info]'],\n },\n },\n fullWidth: {\n true: 'full-width w-full',\n },\n disabled: {\n true: 'disabled cursor-not-allowed',\n false: '',\n },\n focused: {\n true: {\n base: '',\n },\n },\n },\n defaultVariants: {\n size: 'medium',\n status: 'default',\n fullWidth: false,\n disabled: false,\n focused: false,\n },\n },\n {\n twMerge: false,\n },\n );\n\n private getDefaultIconForType(): string | undefined {\n return defaultIcons[this.type as keyof typeof defaultIcons];\n }\n\n render() {\n const inputId = this._id + '-input' || this.name;\n\n const { base, inputClass } = this.styleClass({\n size: this.size,\n status: this.internalStatus,\n fullWidth: this.fullWidth,\n disabled: this.disabled,\n focused: this.isFocused,\n });\n\n const iconSize = {\n small: 14,\n medium: 16,\n large: 18,\n }[this.size];\n\n return (\n <div class=\"bcm-ui-element\">\n {this.label && (\n <label\n class={classNames(\n 'input-label font-medium',\n {\n 'text-color-label': !this.disabled,\n 'text-color-disabled': this.disabled,\n },\n {\n 'text-size-3': this.size === 'small',\n 'text-size-4': this.size === 'medium',\n 'text-size-5': this.size === 'large',\n },\n )}\n htmlFor={inputId}\n >\n <slot name=\"label\">{this.label}</slot>\n {this.required && <span>*</span>}\n </label>\n )}\n\n <div class={base()}>\n {(this.hasSlotContent('prefix') || this.prefixIcon || this.getDefaultIconForType()) && (\n <div class=\"flex items-center gap-2 px-2\">\n {(this.prefixIcon || this.getDefaultIconForType()) && (\n <bcm-icon class=\"prefix-icon\" icon-name={this.prefixIcon || this.getDefaultIconForType()} size={iconSize}></bcm-icon>\n )}\n <slot name=\"prefix\"></slot>\n </div>\n )}\n <input\n ref={el => (this.inputRef = el)}\n id={inputId}\n class={inputClass()}\n type={this.type}\n name={this.name}\n disabled={this.disabled}\n readonly={this.readonly}\n required={this.required}\n placeholder={this.placeholder}\n autocomplete={this.autocomplete}\n minlength={this.minLength}\n maxlength={this.maxLength}\n min={this.min}\n max={this.max}\n step={this.step}\n pattern={this.pattern}\n aria-invalid={this.status === 'error'}\n aria-required={this.required}\n aria-labelledby={this.labelledby}\n aria-describedby={this.describedby}\n value={this.value}\n onInput={this.onInput}\n onChange={this.onChange}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onKeyDown={this.onKeyDown}\n onKeyUp={this.onKeyUp}\n />\n {(this.hasSlotContent('suffix') || this.suffixIcon) && (\n <div class=\"flex items-center gap-2 px-2\">\n <slot name=\"suffix\"></slot>\n {this.suffixIcon && <bcm-icon class=\"suffix-icon\" icon-name={this.suffixIcon} size={iconSize}></bcm-icon>}\n </div>\n )}\n </div>\n {(this.captionText || this.internalErrorMessage || this.validationMessage) && (\n <div\n class={classNames(\n 'input-caption-text font-regular mt-1',\n {\n 'text-[--bcm-ui-color-text-caption]': !this.disabled && this.internalStatus === 'default',\n 'text-[--bcm-ui-color-text-error]': !this.disabled && (this.internalStatus === 'error' || !this.isValid),\n 'text-[--bcm-ui-color-text-success]': !this.disabled && this.internalStatus === 'success',\n 'text-[--bcm-ui-color-text-warning]': !this.disabled && this.internalStatus === 'warning',\n 'text-[--bcm-ui-color-text-info]': !this.disabled && this.internalStatus === 'info',\n 'text-[--bcm-ui-color-text-disabled]': this.disabled,\n },\n {\n 'text-size-3': this.size === 'small',\n 'text-size-4': this.size === 'medium',\n 'text-size-5': this.size === 'large',\n },\n )}\n >\n {!this.isValid ? this.validationMessage : this.internalStatus === 'error' ? this.internalErrorMessage : this.captionText}\n </div>\n )}\n </div>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"bcm-input.entry.cjs.js","mappings":";;;;;;;;;;AAIO,MAAM,YAAY,GAAG;IAC1B,QAAQ,EAAE,gCAAgC;IAC1C,OAAO,EAAE,wBAAwB;IACjC,KAAK,EAAE,qBAAqB;IAC5B,KAAK,EAAE,oBAAoB;IAC3B,MAAM,EAAE,wBAAwB;IAChC,MAAM,EAAE,qBAAqB;IAC7B,gBAAgB,EAAE,8BAA8B;IAChD,UAAU,EAAE,oBAAoB;CACxB;;ACbV;;;;;;AAMO,MAAM,gBAAgB,GAAG,CAAC,OAAoB,EAAE,QAAgB;;IACrE,MAAM,IAAI,GAAG,MAAA,OAAO,CAAC,UAAU,0CAAE,aAAa,CAAC,cAAc,QAAQ,IAAI,CAAoB,CAAC;IAC9F,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IAExB,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;IAC3C,OAAO,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;AAClC,CAAC;;ACZD,MAAM,QAAQ,GAAG,k2OAAk2O,CAAC;AACp3O,uBAAe,QAAQ;;MCYV,QAAQ;IALrB;;;;;;;;QASW,cAAS,GAAG,KAAK,CAAC;QAElB,YAAO,GAAG,IAAI,CAAC;QACf,mBAAc,GAAgB,SAAS,CAAC;;QAKjD,UAAK,GAAW,EAAE,CAAC;;QAYnB,QAAG,GAAYA,qBAAU,CAAC,OAAO,CAAC,CAAC;;QAInC,SAAI,GAAc,QAAQ,CAAC;;QAI3B,WAAM,GAAgB,SAAS,CAAC;;QAIhC,cAAS,GAAG,KAAK,CAAC;;QAIlB,SAAI,GAAc,MAAM,CAAC;;QAIzB,aAAQ,GAAG,KAAK,CAAC;;QAIjB,aAAQ,GAAG,KAAK,CAAC;;QAIjB,aAAQ,GAAG,KAAK,CAAC;;;;QA8D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gBACzF,kCAAkC,EAAE,CAAC,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,cAAc,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;gBACxG,oCAAoC,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS;gBACzF,oCAAoC,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS;gBACzF,iCAAiC,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,KAAK,MAAM;gBACnF,qCAAqC,EAAE,IAAI,CAAC,QAAQ;aACrD,EACD;gBACE,aAAa,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO;gBACpC,aAAa,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ;gBACrC,aAAa,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO;aACrC,CACF,IAEA,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,cAAc,KAAK,OAAO,GAAG,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,WAAW,CACpH,CACP,CACG,EACN;KACH;;;;;;;;;;;;","names":["generateId","tv","setValidationMessages","defaultValidationMessages","getValidationMessage","h","classNames"],"sources":["src/components/input/types.ts","src/utils/slot/check-slot-content.ts","src/components/input/input.scss?tag=bcm-input&encapsulation=shadow","src/components/input/input.component.tsx"],"sourcesContent":["export type InputSize = 'small' | 'medium' | 'large';\nexport type InputStatus = 'default' | 'error' | 'success' | 'warning' | 'info';\nexport type InputType = 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search' | 'date' | 'time' | 'datetime-local';\n\nexport const defaultIcons = {\n 'search': 'fa-regular fa-magnifying-glass',\n 'email': 'fa-regular fa-envelope',\n 'tel': 'fa-regular fa-phone',\n 'url': 'fa-regular fa-link',\n 'date': 'fa-regular fa-calendar',\n 'time': 'fa-regular fa-clock',\n 'datetime-local': 'fa-regular fa-calendar-clock',\n 'password': 'fa-regular fa-lock',\n} as const;\n","/**\n * Checks if a named slot has any content\n * @param element - The host element (component instance)\n * @param slotName - Name of the slot to check\n * @returns boolean indicating if the slot has any assigned nodes\n */\nexport const checkSlotContent = (element: HTMLElement, slotName: string): boolean => {\n const slot = element.shadowRoot?.querySelector(`slot[name=\"${slotName}\"]`) as HTMLSlotElement;\n if (!slot) return false;\n\n const assignedNodes = slot.assignedNodes();\n return assignedNodes.length > 0;\n};\n",":host {\n display: inline-block;\n}\n","import { Component, Prop, h, Event, EventEmitter, Method, State, Watch, Element } from '@stencil/core';\nimport { InputSize, InputStatus, InputType, defaultIcons } from './types';\nimport { tv } from 'tailwind-variants';\nimport classNames from 'classnames';\nimport { generateId } from '../../utils/id/generate-id';\nimport { checkSlotContent } from '../../utils/slot/check-slot-content';\nimport { getValidationMessage, setValidationMessages, defaultValidationMessages } from '../../utils/validation-messages';\n\n@Component({\n tag: 'bcm-input',\n styleUrl: 'input.scss',\n shadow: true,\n})\nexport class BcmInput {\n @Element() el: HTMLElement;\n private inputRef: HTMLInputElement;\n\n @State() isFocused = false;\n @State() validationMessage: string;\n @State() isValid = true;\n @State() internalStatus: InputStatus = 'default';\n @State() internalErrorMessage: string;\n\n /** Input value */\n @Prop({ mutable: true, reflect: true })\n value: string = '';\n\n /** Input placeholder text */\n @Prop()\n placeholder?: string;\n\n /** Input name */\n @Prop()\n name?: string;\n\n /** Input id */\n @Prop({ attribute: 'id', reflect: true })\n _id?: string = generateId('input');\n\n /** Controls the input size */\n @Prop()\n size: InputSize = 'medium';\n\n /** Defines the input's status/state */\n @Prop()\n status: InputStatus = 'default';\n\n /** Full width input */\n @Prop({ attribute: 'full-width', reflect: true })\n fullWidth = false;\n\n /** HTML input type */\n @Prop()\n type: InputType = 'text';\n\n /** Whether the input is disabled */\n @Prop()\n disabled = false;\n\n /** Whether the input is readonly */\n @Prop()\n readonly = false;\n\n /** Whether the input is required */\n @Prop()\n required = false;\n\n /** Input autocomplete attribute */\n @Prop()\n autocomplete?: string;\n\n /** Min length for text input */\n @Prop()\n minLength?: number;\n\n /** Max length for text input */\n @Prop()\n maxLength?: number;\n\n /** Min value for number input */\n @Prop()\n min?: number;\n\n /** Max value for number input */\n @Prop()\n max?: number;\n\n /** Step value for number input */\n @Prop()\n step?: number;\n\n /** Pattern for validation */\n @Prop()\n pattern?: string;\n\n /** Input label for accessibility */\n @Prop()\n label?: string;\n\n /** Error message to display */\n @Prop()\n errorMessage?: string;\n\n /** Caption text to display below input */\n @Prop()\n captionText?: string;\n\n /** ID of associated label element */\n @Prop()\n labelledby?: string;\n\n /** ID of associated caption/error text element */\n @Prop()\n describedby?: string;\n\n /** Prefix icon class name */\n @Prop()\n prefixIcon?: string;\n\n /** Suffix icon class name */\n @Prop()\n suffixIcon?: string;\n\n /** Whether to use native form validation\n * If false, component will handle validation internally\n */\n @Prop()\n useNativeValidation = true;\n\n /** Custom validation function */\n @Prop()\n validator?: (value: string) => string | undefined;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmInput: EventEmitter<InputEvent>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmChange: EventEmitter<Event>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmFocus: EventEmitter<FocusEvent>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmBlur: EventEmitter<FocusEvent>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmKeyDown: EventEmitter<KeyboardEvent>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmKeyUp: EventEmitter<KeyboardEvent>;\n\n @Watch('value')\n handleValueChange(newValue: string) {\n if (this.inputRef) {\n this.inputRef.value = newValue;\n }\n }\n\n @Watch('status')\n watchStatus(newValue: InputStatus) {\n this.internalStatus = newValue;\n }\n\n @Watch('errorMessage')\n watchErrorMessage(newValue: string) {\n this.internalErrorMessage = newValue;\n }\n\n @Method()\n async setFocus() {\n this.inputRef?.focus();\n }\n\n @Method()\n async setBlur() {\n this.inputRef?.blur();\n }\n\n @Method()\n async select() {\n this.inputRef?.select();\n }\n\n /** Sets locale and messages for all inputs */\n @Method()\n async setLocale(locale: string, messages: Record<string, string>) {\n // Set messages and update validation immediately\n setValidationMessages(locale, messages);\n\n // Mevcut validasyon mesajını güncelle\n if (!this.isValid) {\n this.validateInput();\n }\n }\n\n componentWillLoad() {\n // I18n için default mesajları set et\n setValidationMessages('en', defaultValidationMessages);\n this.internalStatus = this.status;\n this.internalErrorMessage = this.errorMessage;\n }\n\n private validateInput(): void {\n if (!this.inputRef) return;\n\n // Reset validation state\n this.isValid = true;\n this.validationMessage = '';\n\n const value = this.inputRef.value;\n\n // Required check\n if (this.required && !value) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('required');\n this.internalStatus = 'error';\n this.internalErrorMessage = this.validationMessage;\n return;\n }\n\n // Minimum length check\n else if (this.minLength && value.length < this.minLength) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('minlength', { min: this.minLength });\n }\n // Maximum length check\n else if (this.maxLength && value.length > this.maxLength) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('maxlength', { max: this.maxLength });\n }\n // Pattern check\n else if (this.pattern && !new RegExp(this.pattern).test(value)) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('pattern');\n }\n // Email check\n else if (this.type === 'email' && value && !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value)) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('email');\n }\n // Number range check\n else if (this.type === 'number' && value) {\n const numValue = parseFloat(value);\n if (this.min !== undefined && numValue < this.min) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('min', { min: this.min });\n } else if (this.max !== undefined && numValue > this.max) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('max', { max: this.max });\n }\n }\n\n // Update component state\n this.internalStatus = this.isValid ? 'default' : 'error';\n this.internalErrorMessage = this.validationMessage;\n }\n\n private onInput = (event: InputEvent) => {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n this.bcmInput.emit(event);\n this.validateInput();\n };\n\n private onChange = (event: Event) => {\n this.bcmChange.emit(event);\n };\n\n private onFocus = (event: FocusEvent) => {\n this.isFocused = true;\n this.bcmFocus.emit(event);\n };\n\n private onBlur = (event: FocusEvent) => {\n this.isFocused = false;\n this.bcmBlur.emit(event);\n this.validateInput();\n };\n\n private onKeyDown = (event: KeyboardEvent) => {\n this.bcmKeyDown.emit(event);\n };\n\n private onKeyUp = (event: KeyboardEvent) => {\n this.bcmKeyUp.emit(event);\n };\n\n private hasSlotContent(slotName: string): boolean {\n return checkSlotContent(this.el, slotName);\n }\n\n private styleClass = tv(\n {\n slots: {\n base: [\n 'bcm-input bcm-input__container',\n 'bg-[--bcm-ui-color-background-base-default]',\n 'border border-solid rounded',\n 'flex items-center justify-between',\n 'transition-colors duration-200',\n 'px-2',\n ],\n inputClass: [\n 'input',\n 'w-full flex-1',\n 'border-0 outline-0 bg-transparent',\n 'appearance-none text-ellipsis',\n 'text-[--bcm-ui-color-text-default] placeholder:text-[--bcm-ui-color-text-placeholder] placeholder:font-normal',\n 'font-sans antialiased font-medium',\n 'px-1',\n ],\n },\n variants: {\n size: {\n small: {\n base: '',\n inputClass: 'text-size-4 h-6',\n },\n medium: {\n base: '',\n inputClass: 'text-size-5 h-8',\n },\n large: {\n base: '',\n inputClass: 'text-size-6 h-10',\n },\n },\n status: {\n default: {\n base: ['border-[--bcm-ui-color-border-default]', 'hover:border-[--bcm-ui-color-border-primary]', 'has-[:focus]:border-[--bcm-ui-color-border-primary]'],\n },\n error: {\n base: ['border-[--bcm-ui-color-border-error]', 'hover:border-[--bcm-ui-color-border-error]', 'has-[:focus]:border-[--bcm-ui-color-border-error]'],\n },\n success: {\n base: ['border-[--bcm-ui-color-border-success]', 'hover:border-[--bcm-ui-color-border-success]', 'has-[:focus]:border-[--bcm-ui-color-border-success]'],\n },\n warning: {\n base: ['border-[--bcm-ui-color-border-warning]', 'hover:border-[--bcm-ui-color-border-warning]', 'has-[:focus]:border-[--bcm-ui-color-border-warning]'],\n },\n info: {\n base: ['border-[--bcm-ui-color-border-info]', 'hover:border-[--bcm-ui-color-border-info]', 'has-[:focus]:border-[--bcm-ui-color-border-info]'],\n },\n },\n fullWidth: {\n true: 'full-width w-full',\n },\n disabled: {\n true: 'disabled cursor-not-allowed',\n false: '',\n },\n focused: {\n true: {\n base: '',\n },\n },\n },\n defaultVariants: {\n size: 'medium',\n status: 'default',\n fullWidth: false,\n disabled: false,\n focused: false,\n },\n },\n {\n twMerge: false,\n },\n );\n\n private getDefaultIconForType(): string | undefined {\n return defaultIcons[this.type as keyof typeof defaultIcons];\n }\n\n render() {\n const inputId = this._id + '-input' || this.name;\n\n const { base, inputClass } = this.styleClass({\n size: this.size,\n status: this.internalStatus,\n fullWidth: this.fullWidth,\n disabled: this.disabled,\n focused: this.isFocused,\n });\n\n const iconSize = {\n small: 14,\n medium: 16,\n large: 18,\n }[this.size];\n\n return (\n <div class=\"bcm-ui-element\">\n {this.label && (\n <label\n class={classNames(\n 'input-label font-medium',\n {\n 'text-color-label': !this.disabled,\n 'text-color-disabled': this.disabled,\n },\n {\n 'text-size-3': this.size === 'small',\n 'text-size-4': this.size === 'medium',\n 'text-size-5': this.size === 'large',\n },\n )}\n htmlFor={inputId}\n >\n <slot name=\"label\">{this.label}</slot>\n {this.required && <span>*</span>}\n </label>\n )}\n\n <div class={base()}>\n {(this.hasSlotContent('prefix') || this.prefixIcon || this.getDefaultIconForType()) && (\n <div class=\"flex items-center gap-2 px-2\">\n {(this.prefixIcon || this.getDefaultIconForType()) && (\n <bcm-icon class=\"prefix-icon\" icon-name={this.prefixIcon || this.getDefaultIconForType()} size={iconSize}></bcm-icon>\n )}\n <slot name=\"prefix\"></slot>\n </div>\n )}\n <input\n ref={el => (this.inputRef = el)}\n id={inputId}\n class={inputClass()}\n type={this.type}\n name={this.name}\n disabled={this.disabled}\n readonly={this.readonly}\n required={this.required}\n placeholder={this.placeholder}\n autocomplete={this.autocomplete}\n minlength={this.minLength}\n maxlength={this.maxLength}\n min={this.min}\n max={this.max}\n step={this.step}\n pattern={this.pattern}\n aria-invalid={this.status === 'error'}\n aria-required={this.required}\n aria-labelledby={this.labelledby}\n aria-describedby={this.describedby}\n value={this.value}\n onInput={this.onInput}\n onChange={this.onChange}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onKeyDown={this.onKeyDown}\n onKeyUp={this.onKeyUp}\n />\n {(this.hasSlotContent('suffix') || this.suffixIcon) && (\n <div class=\"flex items-center gap-2 px-2\">\n <slot name=\"suffix\"></slot>\n {this.suffixIcon && <bcm-icon class=\"suffix-icon\" icon-name={this.suffixIcon} size={iconSize}></bcm-icon>}\n </div>\n )}\n </div>\n {(this.captionText || this.internalErrorMessage || this.validationMessage) && (\n <div\n class={classNames(\n 'input-caption-text font-regular mt-1',\n {\n 'text-[--bcm-ui-color-text-caption]': !this.disabled && this.internalStatus === 'default',\n 'text-[--bcm-ui-color-text-error]': !this.disabled && (this.internalStatus === 'error' || !this.isValid),\n 'text-[--bcm-ui-color-text-success]': !this.disabled && this.internalStatus === 'success',\n 'text-[--bcm-ui-color-text-warning]': !this.disabled && this.internalStatus === 'warning',\n 'text-[--bcm-ui-color-text-info]': !this.disabled && this.internalStatus === 'info',\n 'text-[--bcm-ui-color-text-disabled]': this.disabled,\n },\n {\n 'text-size-3': this.size === 'small',\n 'text-size-4': this.size === 'medium',\n 'text-size-5': this.size === 'large',\n },\n )}\n >\n {!this.isValid ? this.validationMessage : this.internalStatus === 'error' ? this.internalErrorMessage : this.captionText}\n </div>\n )}\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-9a2c5938.js');
|
|
6
|
+
const floatingUi_dom_esm = require('./floating-ui.dom.esm-3ec8404c.js');
|
|
7
|
+
|
|
8
|
+
const linkedCss = ".contents{display:contents}:host{display:contents;width:100%}.static{position:static}.flex{display:flex}.max-h-\\[--dropdown-box-max-height\\]{max-height:var(--dropdown-box-max-height)}.w-full{width:100%}.min-w-\\[--dropdown-box-min-weight\\]{min-width:var(--dropdown-box-min-weight)}.max-w-\\[--dropdown-box-max-weight\\]{max-width:var(--dropdown-box-max-weight)}.flex-col{flex-direction:column}.items-center{align-items:center}.rounded-lg{border-radius:var(--bcm-ui-border-radius-lg,8px)}.bg-\\[--dropdown-box-background-color\\]{background-color:var(--dropdown-box-background-color)}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.shadow{--tw-shadow:var(--bcm-ui-box-shadow-default);--tw-shadow-colored:var(--bcm-ui-box-shadow-default)}.shadow,.shadow-3{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-3{--tw-shadow:var(--bcm-ui-box-shadow-3);--tw-shadow-colored:var(--bcm-ui-box-shadow-3)}.outline{outline-style:solid}.absolute{position:absolute}.z-\\[1000\\]{z-index:1000}.block{display:block}.min-w-max{min-width:max-content}";
|
|
9
|
+
const BcmLinkedStyle0 = linkedCss;
|
|
10
|
+
|
|
11
|
+
const BcmLinked = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.isVisible = false;
|
|
15
|
+
}
|
|
16
|
+
componentDidLoad() {
|
|
17
|
+
requestAnimationFrame(() => {
|
|
18
|
+
this.targetEl = this.targetElement || (this.targetId ? document.getElementById(this.targetId) : null);
|
|
19
|
+
this.floatingEl = this.host.shadowRoot.querySelector('.floating-content');
|
|
20
|
+
if (this.targetEl) {
|
|
21
|
+
this.targetEl.addEventListener('click', (e) => {
|
|
22
|
+
e.stopPropagation();
|
|
23
|
+
this.toggle();
|
|
24
|
+
});
|
|
25
|
+
const handleClickOutside = (e) => {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
const target = e.target;
|
|
28
|
+
if (!((_a = this.floatingEl) === null || _a === void 0 ? void 0 : _a.contains(target)) &&
|
|
29
|
+
!((_b = this.targetEl) === null || _b === void 0 ? void 0 : _b.contains(target)) &&
|
|
30
|
+
!this.host.contains(target)) {
|
|
31
|
+
this.hide();
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
document.addEventListener('click', handleClickOutside);
|
|
35
|
+
this.host['_handleClickOutside'] = handleClickOutside;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
async updatePosition() {
|
|
40
|
+
if (!this.targetEl || !this.floatingEl)
|
|
41
|
+
return;
|
|
42
|
+
const { x, y } = await floatingUi_dom_esm.computePosition(this.targetEl, this.floatingEl, {
|
|
43
|
+
placement: 'bottom-start',
|
|
44
|
+
middleware: [
|
|
45
|
+
floatingUi_dom_esm.offset(2),
|
|
46
|
+
floatingUi_dom_esm.flip({
|
|
47
|
+
fallbackPlacements: ['top-start'],
|
|
48
|
+
}),
|
|
49
|
+
floatingUi_dom_esm.shift({ padding: 8 }),
|
|
50
|
+
],
|
|
51
|
+
});
|
|
52
|
+
Object.assign(this.floatingEl.style, {
|
|
53
|
+
left: `${x}px`,
|
|
54
|
+
top: `${y}px`,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
show() {
|
|
58
|
+
this.isVisible = true;
|
|
59
|
+
this.updatePosition();
|
|
60
|
+
}
|
|
61
|
+
hide() {
|
|
62
|
+
this.isVisible = false;
|
|
63
|
+
}
|
|
64
|
+
toggle() {
|
|
65
|
+
this.isVisible = !this.isVisible;
|
|
66
|
+
if (this.isVisible) {
|
|
67
|
+
this.updatePosition();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
render() {
|
|
71
|
+
return (index.h("div", { key: '3f941aabcf3f17e8ee628c645ebb1316a305a43f', class: "floating-content z-[1000] flex min-w-max", style: {
|
|
72
|
+
display: this.isVisible ? 'block' : 'none',
|
|
73
|
+
position: 'absolute',
|
|
74
|
+
top: "0px",
|
|
75
|
+
left: "0px",
|
|
76
|
+
} }, index.h("slot", { key: 'd75ff826bc512230c7befcf51757797ffe52abc6' })));
|
|
77
|
+
}
|
|
78
|
+
disconnectedCallback() {
|
|
79
|
+
if (this.targetEl) {
|
|
80
|
+
this.targetEl.removeEventListener('mouseenter', () => this.show());
|
|
81
|
+
this.targetEl.removeEventListener('mouseleave', () => this.hide());
|
|
82
|
+
this.targetEl.removeEventListener('click', () => this.toggle());
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
get host() { return index.getElement(this); }
|
|
86
|
+
};
|
|
87
|
+
BcmLinked.style = BcmLinkedStyle0;
|
|
88
|
+
|
|
89
|
+
exports.bcm_linked = BcmLinked;
|
|
90
|
+
|
|
91
|
+
//# sourceMappingURL=bcm-linked.cjs.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"bcm-linked.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,SAAS,GAAG,0kCAA0kC,CAAC;AAC7lC,wBAAe,SAAS;;MCOX,SAAS;IALtB;;QAYa,cAAS,GAAY,KAAK,CAAC;KA4FvC;IAtFG,gBAAgB;QACZ,qBAAqB,CAAC;YAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;YACtG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC;YAE1E,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACf,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC;oBACtC,CAAC,CAAC,eAAe,EAAE,CAAC;oBACpB,IAAI,CAAC,MA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ACtB,IAAI,CAAC,cAAc,EAAE,CAAC;KACzB;IAEO,IAAI;QACR,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;KAC1B;IAEO,MAAM;QACV,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;QACjC,IAAI,IAAI,CAAC,SAAS,EAAE;YAChB,IAAI,CAAC,cAAc,EAAE,CAAC;SACzB;KACJ;IAED,MAAM;QACF,QACIC,kEACI,KAAK,EAAC,0CAA0C,EAChD,KAAK,EAAE;gBACH,OAAO,EAAE,IAAI,CAAC,SAAS,GAAG,OAAO,GAAG,MAAM;gBAC1C,QAAQ,EAAE,UAAU;gBACpB,GAAG,EAAE,KAAK;gBACV,IAAI,EAAE,KAAK;aACd,IAEDA,oEAAa,CACX,EACR;KACL;IAED,oBAAoB;QAChB,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YACnE,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YACnE,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;SACnE;KACJ;;;;;;;","names":["computePosition","offset","flip","shift","h"],"sources":["src/components/linked/linked.css?tag=bcm-linked&encapsulation=shadow","src/components/linked/linked.component.tsx"],"sourcesContent":[":host {\n display: contents;\n width: 100%;\n}\n","import { Component, ComponentInterface, Prop, Element, State, h } from \"@stencil/core\";\nimport { computePosition, flip, shift, offset } from '@floating-ui/dom';\n\n@Component({\n tag: 'bcm-linked',\n styleUrl: 'linked.css',\n shadow: true,\n})\nexport class BcmLinked implements ComponentInterface {\n @Element() host: HTMLElement;\n\n @Prop({ reflect: true, attribute: 'target-id' }) targetId: string;\n\n @Prop() targetElement?: HTMLElement;\n\n @State() isVisible: boolean = false;\n\n private floatingEl?: HTMLElement;\n private targetEl?: HTMLElement;\n\n\n componentDidLoad() {\n requestAnimationFrame(() => {\n this.targetEl = this.targetElement || (this.targetId ? document.getElementById(this.targetId) : null);\n this.floatingEl = this.host.shadowRoot.querySelector('.floating-content');\n\n if (this.targetEl) {\n this.targetEl.addEventListener('click', (e) => {\n e.stopPropagation();\n this.toggle();\n });\n\n const handleClickOutside = (e: MouseEvent) => {\n const target = e.target as Node;\n if (!this.floatingEl?.contains(target) &&\n !this.targetEl?.contains(target) &&\n !this.host.contains(target)) {\n this.hide();\n }\n };\n\n document.addEventListener('click', handleClickOutside);\n\n this.host['_handleClickOutside'] = handleClickOutside;\n }\n });\n }\n\n private async updatePosition() {\n if (!this.targetEl || !this.floatingEl) return;\n\n const { x, y } = await computePosition(this.targetEl, this.floatingEl, {\n placement: 'bottom-start',\n middleware: [\n offset(2),\n flip({\n fallbackPlacements: ['top-start'],\n }),\n shift({ padding: 8 }),\n ],\n });\n\n Object.assign(this.floatingEl.style, {\n left: `${x}px`,\n top: `${y}px`,\n });\n }\n\n private show() {\n this.isVisible = true;\n this.updatePosition();\n }\n\n private hide() {\n this.isVisible = false;\n }\n\n private toggle() {\n this.isVisible = !this.isVisible;\n if (this.isVisible) {\n this.updatePosition();\n }\n }\n\n render() {\n return (\n <div\n class=\"floating-content z-[1000] flex min-w-max\"\n style={{\n display: this.isVisible ? 'block' : 'none',\n position: 'absolute',\n top: \"0px\",\n left: \"0px\",\n }}\n >\n <slot></slot>\n </div>\n );\n }\n\n disconnectedCallback() {\n if (this.targetEl) {\n this.targetEl.removeEventListener('mouseenter', () => this.show());\n this.targetEl.removeEventListener('mouseleave', () => this.hide());\n this.targetEl.removeEventListener('click', () => this.toggle());\n }\n }\n}"],"version":3}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-9a2c5938.js');
|
|
6
|
+
const floatingUi_dom_esm = require('./floating-ui.dom.esm-3ec8404c.js');
|
|
7
|
+
const index$1 = require('./index-310db2a6.js');
|
|
8
|
+
|
|
9
|
+
const popConfirmCss = ".absolute{position:absolute}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.text-wrap{text-wrap:wrap}:host{--popover-bg:var(--bcm-ui-color-background-basic-panel);--popover-radius:6px;--popover-text-color:var(--bcm-ui-color-text-basic);display:inline-block}.arrow{background:var(--arrow-color);clip-path:polygon(50% 0,100% 100%,0 100%);position:absolute;z-index:1}.arrow.top{transform:rotate(180deg)}.arrow.bottom{transform:rotate(0deg)}.arrow.right{transform:rotate(-90deg)}.arrow.left{transform:rotate(90deg)}::slotted([slot=body]){text-wrap:pretty;font-family:Inter,sans-serif}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.bcm-ui-element{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,sans-serif}.static{position:static}.relative{position:relative}.z-\\[9999\\]{z-index:9999}.mx-auto{margin-left:auto;margin-right:auto}.flex{display:flex}.hidden{display:none}.size-6{height:1.5rem;width:1.5rem}.h-2{height:.5rem}.w-4{width:1rem}.w-full{width:100%}.max-w-64{max-width:16rem}.max-w-80{max-width:20rem}.max-w-96{max-width:24rem}.flex-1{flex:1 1 0%}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-2\\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.text-pretty{text-wrap:pretty}.rounded-\\[--popover-radius\\]{border-radius:var(--popover-radius)}.rounded-full{border-radius:var(--bcm-ui-border-radius-full,9999px)}.bg-\\[--popover-bg\\]{background-color:var(--popover-bg)}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.font-sans{font-family:Inter,sans-serif}.text-size-4{font-size:var(--bcm-ui-font-size-4,14px);line-height:var(--bcm-ui-line-height-4,20px)}.text-size-5{font-size:var(--bcm-ui-font-size-5,16px);line-height:var(--bcm-ui-line-height-5,24px)}.text-size-6{font-size:var(--bcm-ui-font-size-6,18px);line-height:var(--bcm-ui-line-height-6,24px)}.text-size-7{font-size:var(--bcm-ui-font-size-7,20px);line-height:var(--bcm-ui-line-height-7,28px)}.text-size-inherit{font-size:inherit;line-height:inherit}.font-semibold{font-weight:600}.\\!text-color-header{color:var(--bcm-ui-color-text-header)!important}.text-\\[--text-color\\]{color:var(--text-color)}.shadow{--tw-shadow:var(--bcm-ui-box-shadow-default);--tw-shadow-colored:var(--bcm-ui-box-shadow-default)}.shadow,.shadow-2{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-2{--tw-shadow:var(--bcm-ui-box-shadow-2);--tw-shadow-colored:var(--bcm-ui-box-shadow-2)}.outline{outline-style:solid}.hover\\:bg-gray-100:hover{background-color:oklch(.967 .003 264.542)}";
|
|
10
|
+
const BcmPopConfirmStyle0 = popConfirmCss;
|
|
11
|
+
|
|
12
|
+
// Status icons for different states
|
|
13
|
+
const statusIcons = {
|
|
14
|
+
info: 'fa-solid fa-circle-info',
|
|
15
|
+
success: 'fa-solid fa-circle-check',
|
|
16
|
+
warning: 'fa-solid fa-triangle-exclamation',
|
|
17
|
+
error: 'fa-solid fa-circle-x',
|
|
18
|
+
};
|
|
19
|
+
const PopConfirm = class {
|
|
20
|
+
constructor(hostRef) {
|
|
21
|
+
index.registerInstance(this, hostRef);
|
|
22
|
+
this.bcmConfirm = index.createEvent(this, "bcmConfirm", 1);
|
|
23
|
+
this.bcmCancel = index.createEvent(this, "bcmCancel", 1);
|
|
24
|
+
/**
|
|
25
|
+
* The color of the arrow pointing to the trigger element.
|
|
26
|
+
* Can be a CSS custom property or a specific color value.
|
|
27
|
+
* @default 'var(--bcm-ui-color-background-basic-panel)'
|
|
28
|
+
*/
|
|
29
|
+
this.arrowColor = 'var(--bcm-ui-color-background-basic-panel)'; // Default color
|
|
30
|
+
/**
|
|
31
|
+
* The text displayed on the cancel button.
|
|
32
|
+
* @default 'Cancel'
|
|
33
|
+
*/
|
|
34
|
+
this.cancelText = 'Cancel';
|
|
35
|
+
/**
|
|
36
|
+
* The text displayed on the confirm button.
|
|
37
|
+
* @default 'Yes'
|
|
38
|
+
*/
|
|
39
|
+
this.confirmText = 'Yes';
|
|
40
|
+
/**
|
|
41
|
+
* The description or body content of the pop-up.
|
|
42
|
+
* @default ''
|
|
43
|
+
*/
|
|
44
|
+
this.description = '';
|
|
45
|
+
/**
|
|
46
|
+
* The header text displayed at the top of the pop-up.
|
|
47
|
+
* @default ''
|
|
48
|
+
*/
|
|
49
|
+
this.headerText = '';
|
|
50
|
+
/**
|
|
51
|
+
* The placement position of the pop-up relative to the trigger element.
|
|
52
|
+
* @default 'bottom'
|
|
53
|
+
*/
|
|
54
|
+
this.placement = 'bottom';
|
|
55
|
+
/**
|
|
56
|
+
* The size of the pop-up, determining its dimensions and padding.
|
|
57
|
+
* @default 'medium'
|
|
58
|
+
*/
|
|
59
|
+
this.size = 'medium';
|
|
60
|
+
/**
|
|
61
|
+
* The status of the pop-up, affecting its icon and color scheme.
|
|
62
|
+
* @default 'info'
|
|
63
|
+
*/
|
|
64
|
+
this.status = 'info';
|
|
65
|
+
/**
|
|
66
|
+
* Whether to display a status icon based on the `status` prop.
|
|
67
|
+
* @default true
|
|
68
|
+
*/
|
|
69
|
+
this.statusIcon = true;
|
|
70
|
+
// State variables
|
|
71
|
+
/**
|
|
72
|
+
* Indicates whether the pop-up is currently open or closed.
|
|
73
|
+
* @default false
|
|
74
|
+
*/
|
|
75
|
+
this.isOpen = false;
|
|
76
|
+
/**
|
|
77
|
+
* Handles the click event on the trigger element to open the pop-up.
|
|
78
|
+
* Prevents default behavior and propagation, then opens the pop-up if it's closed.
|
|
79
|
+
* @param event The mouse event triggering the action.
|
|
80
|
+
*/
|
|
81
|
+
this.handleTriggerClick = (event) => {
|
|
82
|
+
event.preventDefault();
|
|
83
|
+
event.stopPropagation();
|
|
84
|
+
if (!this.isOpen) {
|
|
85
|
+
this.isOpen = true;
|
|
86
|
+
requestAnimationFrame(() => {
|
|
87
|
+
this.updatePosition();
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Handles the confirm button click, closing the pop-up and emitting the confirm event.
|
|
93
|
+
* Prevents default behavior and propagation.
|
|
94
|
+
* @param event The mouse event triggering the action.
|
|
95
|
+
*/
|
|
96
|
+
this.handleConfirm = (event) => {
|
|
97
|
+
event.preventDefault();
|
|
98
|
+
event.stopPropagation();
|
|
99
|
+
this.isOpen = false;
|
|
100
|
+
this.bcmConfirm.emit();
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Handles the cancel button click, closing the pop-up and emitting the cancel event.
|
|
104
|
+
* Prevents default behavior and propagation.
|
|
105
|
+
* @param event The mouse event triggering the action.
|
|
106
|
+
*/
|
|
107
|
+
this.handleCancel = (event) => {
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
event.stopPropagation();
|
|
110
|
+
this.isOpen = false;
|
|
111
|
+
this.bcmCancel.emit();
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Updates the position of the pop-up relative to the trigger element using Floating UI.
|
|
115
|
+
* Ensures the pop-up stays within viewport bounds and positions the arrow correctly.
|
|
116
|
+
*/
|
|
117
|
+
this.updatePosition = async () => {
|
|
118
|
+
if (!this.triggerElement || !this.popoverElement || !this.arrowElement)
|
|
119
|
+
return;
|
|
120
|
+
const { x, y, placement, middlewareData } = await floatingUi_dom_esm.computePosition(this.triggerElement, this.popoverElement, {
|
|
121
|
+
placement: this.placement,
|
|
122
|
+
middleware: [floatingUi_dom_esm.offset(12), floatingUi_dom_esm.flip({ fallbackPlacements: ['top', 'left', 'bottom', 'right'] }), floatingUi_dom_esm.shift({ padding: 8 }), floatingUi_dom_esm.arrow({ element: this.arrowElement })],
|
|
123
|
+
});
|
|
124
|
+
this.currentPlacement = placement;
|
|
125
|
+
Object.assign(this.popoverElement.style, {
|
|
126
|
+
left: `${x}px`,
|
|
127
|
+
top: `${y}px`,
|
|
128
|
+
});
|
|
129
|
+
const { x: arrowX, y: arrowY } = middlewareData.arrow || { x: 0, y: 0 };
|
|
130
|
+
const basePlacement = placement.split('-')[0];
|
|
131
|
+
const staticSide = {
|
|
132
|
+
top: 'bottom',
|
|
133
|
+
right: 'left',
|
|
134
|
+
bottom: 'top',
|
|
135
|
+
left: 'right',
|
|
136
|
+
}[basePlacement];
|
|
137
|
+
Object.assign(this.arrowElement.style, {
|
|
138
|
+
left: arrowX != null ? `${arrowX}px` : '',
|
|
139
|
+
top: arrowY != null ? `${arrowY}px` : '',
|
|
140
|
+
[staticSide]: ['top', 'bottom'].includes(basePlacement) ? '-8px' : '-12px',
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Defines Tailwind Variants classes for the pop-up's structure and styling.
|
|
145
|
+
* Supports different sizes and generates dynamic class names.
|
|
146
|
+
*/
|
|
147
|
+
this.classes = index$1.ce({
|
|
148
|
+
slots: {
|
|
149
|
+
container: 'absolute bcm-ui-element flex flex-col shadow-2 rounded-[--popover-radius] bg-[--popover-bg] z-[9999] w-full',
|
|
150
|
+
header: 'flex justify-between items-center',
|
|
151
|
+
headerLeftContent: 'flex items-center gap-2 text-size-inherit text-[--text-color]',
|
|
152
|
+
closeIconArea: 'flex flex-row gap-2 size-6 items-center justify-center hover:bg-gray-100 rounded-full cursor-pointer text-size-inherit',
|
|
153
|
+
titleContainer: '!text-color-header font-semibold',
|
|
154
|
+
footer: 'flex flex-row justify-end gap-2',
|
|
155
|
+
},
|
|
156
|
+
variants: {
|
|
157
|
+
size: {
|
|
158
|
+
small: {
|
|
159
|
+
container: 'text-size-4 max-w-64 p-4 gap-4',
|
|
160
|
+
header: 'text-size-4',
|
|
161
|
+
footer: 'text-size-4',
|
|
162
|
+
titleContainer: 'text-size-5',
|
|
163
|
+
headerLeftContent: 'gap-2',
|
|
164
|
+
},
|
|
165
|
+
medium: {
|
|
166
|
+
container: 'text-size-5 max-w-80 gap-6 p-6',
|
|
167
|
+
header: 'text-size-5',
|
|
168
|
+
footer: 'text-size-5',
|
|
169
|
+
titleContainer: 'text-size-6',
|
|
170
|
+
headerLeftContent: 'gap-2.5',
|
|
171
|
+
},
|
|
172
|
+
large: {
|
|
173
|
+
container: 'text-size-6 max-w-96 p-8 gap-8',
|
|
174
|
+
header: 'text-size-6',
|
|
175
|
+
footer: 'text-size-6',
|
|
176
|
+
titleContainer: 'text-size-7',
|
|
177
|
+
headerLeftContent: 'gap-3',
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
defaultVariants: {
|
|
182
|
+
size: 'medium',
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Lifecycle method called when the component is loaded.
|
|
188
|
+
* Initializes the trigger element and attaches a click event listener.
|
|
189
|
+
*/
|
|
190
|
+
componentDidLoad() {
|
|
191
|
+
this.triggerElement = document.getElementById(this.targetId);
|
|
192
|
+
if (!this.triggerElement) {
|
|
193
|
+
console.warn(`Target element with ID '${this.targetId}' not found.`);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
this.triggerElement.addEventListener('click', this.handleTriggerClick);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Programmatically shows the pop-up by setting `isOpen` to true and updating its position.
|
|
200
|
+
* @returns A promise that resolves when the pop-up is shown.
|
|
201
|
+
*/
|
|
202
|
+
async show() {
|
|
203
|
+
this.isOpen = true;
|
|
204
|
+
requestAnimationFrame(() => {
|
|
205
|
+
this.updatePosition();
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Programmatically hides the pop-up by setting `isOpen` to false.
|
|
210
|
+
* @returns A promise that resolves when the pop-up is hidden.
|
|
211
|
+
*/
|
|
212
|
+
async hide() {
|
|
213
|
+
this.isOpen = false;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Returns the dynamic styles for the pop-up, including text and arrow colors.
|
|
217
|
+
* @returns An object containing CSS custom properties.
|
|
218
|
+
*/
|
|
219
|
+
get popoverStyle() {
|
|
220
|
+
return {
|
|
221
|
+
'--text-color': `var(--bcm-ui-color-text-${this.status})`,
|
|
222
|
+
'--arrow-color': this.arrowColor,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Lifecycle method called when the component is removed from the DOM.
|
|
227
|
+
* Cleans up the event listener to prevent memory leaks.
|
|
228
|
+
*/
|
|
229
|
+
disconnectedCallback() {
|
|
230
|
+
if (this.triggerElement) {
|
|
231
|
+
this.triggerElement.removeEventListener('click', this.handleTriggerClick);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Renders the pop-up component, showing it only when `isOpen` is true.
|
|
236
|
+
* Includes header, main content, and footer sections with dynamic styling and slots for customization.
|
|
237
|
+
* @returns JSX.Element representing the pop-up or an empty fragment if closed.
|
|
238
|
+
*/
|
|
239
|
+
render() {
|
|
240
|
+
var _a;
|
|
241
|
+
const { container, header, footer, headerLeftContent, closeIconArea, titleContainer } = this.classes({
|
|
242
|
+
size: this.size,
|
|
243
|
+
});
|
|
244
|
+
return (index.h(index.Fragment, { key: '9c275c728ff7cabce1a564cf1f062b65c732c2f7' }, this.isOpen && (index.h("div", { key: '04b20e5773d7c2ce6a2bb4fbe2801bb0d775a425', role: "dialog", "aria-labelledby": "pop-confirm-title", style: this.popoverStyle, class: container(), ref: el => (this.popoverElement = el) }, index.h("div", { key: 'bff8a3617e2615efdfe24ff9e73bcad4b55e54ea', ref: el => (this.arrowElement = el), class: `arrow w-4 h-2 ${(_a = this.currentPlacement) !== null && _a !== void 0 ? _a : 'top'}` }), index.h("header", { key: 'fb7c440f138f4950dbfd0c6e473ab769d37e5e20', class: header() }, index.h("div", { key: 'ed166db8cf2ced87a0442af476037f0706ad5f67', class: headerLeftContent() }, this.statusIcon && index.h("bcm-icon", { key: '077dd2de165608062c49ad831c0d67488e5270de', "icon-name": statusIcons[this.status] }), index.h("span", { key: '4be735274dad1742b9cd956da5520eb922a9a817', class: titleContainer() }, this.headerText), index.h("slot", { key: '59cec868d0e73e3d8f0577fc7528a6332998b93a', name: "header" })), index.h("div", { key: '225623a00d44c07bfdd6611b7ee98a7fb49ba008', class: closeIconArea(), onClick: this.handleCancel }, index.h("bcm-icon", { key: '6b096f888794673d678d8edae338edc50485df57', "icon-name": "far fa-times" }))), index.h("main", { key: '4ff8930d218641bb7f3a722ca5a065f7df73a40e', class: "flex-1 mx-auto font-sans text-pretty" }, index.h("slot", { key: '0058d440b9e703ff30d2c41aee14d4122d82aeaa', name: "body" }, this.description)), index.h("footer", { key: '6ffcd9df426bf280b77d2cfb39552647115253ec', class: footer() }, index.h("bcm-button", { key: '997610d1ca83cf3357d0a8d3f1102e25d2966240', kind: "outline", size: this.size, onClick: this.handleCancel }, this.cancelText), index.h("bcm-button", { key: 'c1f633f3e8837b724dd9e26580a3c7260543e8b4', size: this.size, status: this.status, kind: "primary", onClick: this.handleConfirm }, this.confirmText), index.h("slot", { key: '2f9d5ab32c2e62bcdad247ab4ce93df53358f843', name: "footer" }))))));
|
|
245
|
+
}
|
|
246
|
+
get el() { return index.getElement(this); }
|
|
247
|
+
};
|
|
248
|
+
PopConfirm.style = BcmPopConfirmStyle0;
|
|
249
|
+
|
|
250
|
+
exports.bcm_pop_confirm = PopConfirm;
|
|
251
|
+
|
|
252
|
+
//# sourceMappingURL=bcm-pop-confirm.cjs.entry.js.map
|