@ind-ds/core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -0
- package/dist/cjs/ind-alarm.cjs.entry.js +35 -0
- package/dist/cjs/ind-alarm.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-app-header.cjs.entry.js +42 -0
- package/dist/cjs/ind-app-header.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-button.cjs.entry.js +79 -0
- package/dist/cjs/ind-button.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-checkbox.cjs.entry.js +49 -0
- package/dist/cjs/ind-checkbox.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-dialog.cjs.entry.js +101 -0
- package/dist/cjs/ind-dialog.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-divider.cjs.entry.js +21 -0
- package/dist/cjs/ind-divider.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-ds.cjs.js +27 -0
- package/dist/cjs/ind-ds.cjs.js.map +1 -0
- package/dist/cjs/ind-fill-row.cjs.entry.js +34 -0
- package/dist/cjs/ind-fill-row.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-health-card.cjs.entry.js +38 -0
- package/dist/cjs/ind-health-card.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-input.cjs.entry.js +57 -0
- package/dist/cjs/ind-input.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-led.cjs.entry.js +29 -0
- package/dist/cjs/ind-led.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-mqtt-monitor.cjs.entry.js +75 -0
- package/dist/cjs/ind-mqtt-monitor.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-nav-item.cjs.entry.js +48 -0
- package/dist/cjs/ind-nav-item.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-progress.cjs.entry.js +48 -0
- package/dist/cjs/ind-progress.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-scara-canvas.cjs.entry.js +57 -0
- package/dist/cjs/ind-scara-canvas.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-select.cjs.entry.js +55 -0
- package/dist/cjs/ind-select.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-shelf-canvas.cjs.entry.js +88 -0
- package/dist/cjs/ind-shelf-canvas.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-sidebar-nav.cjs.entry.js +20 -0
- package/dist/cjs/ind-sidebar-nav.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-status-bar.cjs.entry.js +22 -0
- package/dist/cjs/ind-status-bar.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-status-dot.cjs.entry.js +31 -0
- package/dist/cjs/ind-status-dot.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-textarea.cjs.entry.js +66 -0
- package/dist/cjs/ind-textarea.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-toolbar-action.cjs.entry.js +23 -0
- package/dist/cjs/ind-toolbar-action.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-value.cjs.entry.js +47 -0
- package/dist/cjs/ind-value.cjs.entry.js.map +1 -0
- package/dist/cjs/ind-valve.cjs.entry.js +31 -0
- package/dist/cjs/ind-valve.cjs.entry.js.map +1 -0
- package/dist/cjs/index-ph7ZTjuY.js +1638 -0
- package/dist/cjs/index-ph7ZTjuY.js.map +1 -0
- package/dist/cjs/index.cjs.js +5 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +35 -0
- package/dist/collection/components/atoms/alarm/alarm.css +87 -0
- package/dist/collection/components/atoms/alarm/alarm.js +122 -0
- package/dist/collection/components/atoms/alarm/alarm.js.map +1 -0
- package/dist/collection/components/atoms/button/button.css +110 -0
- package/dist/collection/components/atoms/button/button.js +215 -0
- package/dist/collection/components/atoms/button/button.js.map +1 -0
- package/dist/collection/components/atoms/checkbox/checkbox.css +92 -0
- package/dist/collection/components/atoms/checkbox/checkbox.js +214 -0
- package/dist/collection/components/atoms/checkbox/checkbox.js.map +1 -0
- package/dist/collection/components/atoms/dialog/dialog.css +85 -0
- package/dist/collection/components/atoms/dialog/dialog.js +265 -0
- package/dist/collection/components/atoms/dialog/dialog.js.map +1 -0
- package/dist/collection/components/atoms/divider/divider.css +16 -0
- package/dist/collection/components/atoms/divider/divider.js +50 -0
- package/dist/collection/components/atoms/divider/divider.js.map +1 -0
- package/dist/collection/components/atoms/input/input.css +92 -0
- package/dist/collection/components/atoms/input/input.js +427 -0
- package/dist/collection/components/atoms/input/input.js.map +1 -0
- package/dist/collection/components/atoms/led/led.css +91 -0
- package/dist/collection/components/atoms/led/led.js +123 -0
- package/dist/collection/components/atoms/led/led.js.map +1 -0
- package/dist/collection/components/atoms/progress/progress.css +69 -0
- package/dist/collection/components/atoms/progress/progress.js +221 -0
- package/dist/collection/components/atoms/progress/progress.js.map +1 -0
- package/dist/collection/components/atoms/scara-canvas/scara-canvas.css +100 -0
- package/dist/collection/components/atoms/scara-canvas/scara-canvas.js +138 -0
- package/dist/collection/components/atoms/scara-canvas/scara-canvas.js.map +1 -0
- package/dist/collection/components/atoms/select/select.css +88 -0
- package/dist/collection/components/atoms/select/select.js +244 -0
- package/dist/collection/components/atoms/select/select.js.map +1 -0
- package/dist/collection/components/atoms/shelf-canvas/shelf-canvas.css +67 -0
- package/dist/collection/components/atoms/shelf-canvas/shelf-canvas.js +184 -0
- package/dist/collection/components/atoms/shelf-canvas/shelf-canvas.js.map +1 -0
- package/dist/collection/components/atoms/status-dot/status-dot.css +69 -0
- package/dist/collection/components/atoms/status-dot/status-dot.js +125 -0
- package/dist/collection/components/atoms/status-dot/status-dot.js.map +1 -0
- package/dist/collection/components/atoms/textarea/textarea.css +74 -0
- package/dist/collection/components/atoms/textarea/textarea.js +331 -0
- package/dist/collection/components/atoms/textarea/textarea.js.map +1 -0
- package/dist/collection/components/atoms/value/value.css +115 -0
- package/dist/collection/components/atoms/value/value.js +223 -0
- package/dist/collection/components/atoms/value/value.js.map +1 -0
- package/dist/collection/components/atoms/valve/valve.css +101 -0
- package/dist/collection/components/atoms/valve/valve.js +150 -0
- package/dist/collection/components/atoms/valve/valve.js.map +1 -0
- package/dist/collection/components/molecules/fill-row/fill-row.css +70 -0
- package/dist/collection/components/molecules/fill-row/fill-row.js +181 -0
- package/dist/collection/components/molecules/fill-row/fill-row.js.map +1 -0
- package/dist/collection/components/molecules/health-card/health-card.css +53 -0
- package/dist/collection/components/molecules/health-card/health-card.js +124 -0
- package/dist/collection/components/molecules/health-card/health-card.js.map +1 -0
- package/dist/collection/components/molecules/nav-item/nav-item.css +82 -0
- package/dist/collection/components/molecules/nav-item/nav-item.js +165 -0
- package/dist/collection/components/molecules/nav-item/nav-item.js.map +1 -0
- package/dist/collection/components/molecules/toolbar-action/toolbar-action.css +36 -0
- package/dist/collection/components/molecules/toolbar-action/toolbar-action.js +45 -0
- package/dist/collection/components/molecules/toolbar-action/toolbar-action.js.map +1 -0
- package/dist/collection/components/organisms/app-header/app-header.css +127 -0
- package/dist/collection/components/organisms/app-header/app-header.js +256 -0
- package/dist/collection/components/organisms/app-header/app-header.js.map +1 -0
- package/dist/collection/components/organisms/mqtt-monitor/mqtt-monitor.css +96 -0
- package/dist/collection/components/organisms/mqtt-monitor/mqtt-monitor.js +205 -0
- package/dist/collection/components/organisms/mqtt-monitor/mqtt-monitor.js.map +1 -0
- package/dist/collection/components/organisms/sidebar-nav/sidebar-nav.css +39 -0
- package/dist/collection/components/organisms/sidebar-nav/sidebar-nav.js +26 -0
- package/dist/collection/components/organisms/sidebar-nav/sidebar-nav.js.map +1 -0
- package/dist/collection/components/organisms/status-bar/status-bar.css +34 -0
- package/dist/collection/components/organisms/status-bar/status-bar.js +76 -0
- package/dist/collection/components/organisms/status-bar/status-bar.js.map +1 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/components/ind-alarm.d.ts +11 -0
- package/dist/components/ind-alarm.js +2 -0
- package/dist/components/ind-alarm.js.map +1 -0
- package/dist/components/ind-app-header.d.ts +11 -0
- package/dist/components/ind-app-header.js +2 -0
- package/dist/components/ind-app-header.js.map +1 -0
- package/dist/components/ind-button.d.ts +11 -0
- package/dist/components/ind-button.js +2 -0
- package/dist/components/ind-button.js.map +1 -0
- package/dist/components/ind-checkbox.d.ts +11 -0
- package/dist/components/ind-checkbox.js +2 -0
- package/dist/components/ind-checkbox.js.map +1 -0
- package/dist/components/ind-dialog.d.ts +11 -0
- package/dist/components/ind-dialog.js +2 -0
- package/dist/components/ind-dialog.js.map +1 -0
- package/dist/components/ind-divider.d.ts +11 -0
- package/dist/components/ind-divider.js +2 -0
- package/dist/components/ind-divider.js.map +1 -0
- package/dist/components/ind-fill-row.d.ts +11 -0
- package/dist/components/ind-fill-row.js +2 -0
- package/dist/components/ind-fill-row.js.map +1 -0
- package/dist/components/ind-health-card.d.ts +11 -0
- package/dist/components/ind-health-card.js +2 -0
- package/dist/components/ind-health-card.js.map +1 -0
- package/dist/components/ind-input.d.ts +11 -0
- package/dist/components/ind-input.js +2 -0
- package/dist/components/ind-input.js.map +1 -0
- package/dist/components/ind-led.d.ts +11 -0
- package/dist/components/ind-led.js +2 -0
- package/dist/components/ind-led.js.map +1 -0
- package/dist/components/ind-mqtt-monitor.d.ts +11 -0
- package/dist/components/ind-mqtt-monitor.js +2 -0
- package/dist/components/ind-mqtt-monitor.js.map +1 -0
- package/dist/components/ind-nav-item.d.ts +11 -0
- package/dist/components/ind-nav-item.js +2 -0
- package/dist/components/ind-nav-item.js.map +1 -0
- package/dist/components/ind-progress.d.ts +11 -0
- package/dist/components/ind-progress.js +2 -0
- package/dist/components/ind-progress.js.map +1 -0
- package/dist/components/ind-scara-canvas.d.ts +11 -0
- package/dist/components/ind-scara-canvas.js +2 -0
- package/dist/components/ind-scara-canvas.js.map +1 -0
- package/dist/components/ind-select.d.ts +11 -0
- package/dist/components/ind-select.js +2 -0
- package/dist/components/ind-select.js.map +1 -0
- package/dist/components/ind-shelf-canvas.d.ts +11 -0
- package/dist/components/ind-shelf-canvas.js +2 -0
- package/dist/components/ind-shelf-canvas.js.map +1 -0
- package/dist/components/ind-sidebar-nav.d.ts +11 -0
- package/dist/components/ind-sidebar-nav.js +2 -0
- package/dist/components/ind-sidebar-nav.js.map +1 -0
- package/dist/components/ind-status-bar.d.ts +11 -0
- package/dist/components/ind-status-bar.js +2 -0
- package/dist/components/ind-status-bar.js.map +1 -0
- package/dist/components/ind-status-dot.d.ts +11 -0
- package/dist/components/ind-status-dot.js +2 -0
- package/dist/components/ind-status-dot.js.map +1 -0
- package/dist/components/ind-textarea.d.ts +11 -0
- package/dist/components/ind-textarea.js +2 -0
- package/dist/components/ind-textarea.js.map +1 -0
- package/dist/components/ind-toolbar-action.d.ts +11 -0
- package/dist/components/ind-toolbar-action.js +2 -0
- package/dist/components/ind-toolbar-action.js.map +1 -0
- package/dist/components/ind-value.d.ts +11 -0
- package/dist/components/ind-value.js +2 -0
- package/dist/components/ind-value.js.map +1 -0
- package/dist/components/ind-valve.d.ts +11 -0
- package/dist/components/ind-valve.js +2 -0
- package/dist/components/ind-valve.js.map +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/p-D-FsSjAC.js +2 -0
- package/dist/components/p-D-FsSjAC.js.map +1 -0
- package/dist/components/p-acsAzrRn.js +2 -0
- package/dist/components/p-acsAzrRn.js.map +1 -0
- package/dist/docs.d.ts +480 -0
- package/dist/docs.json +5360 -0
- package/dist/esm/ind-alarm.entry.js +33 -0
- package/dist/esm/ind-alarm.entry.js.map +1 -0
- package/dist/esm/ind-app-header.entry.js +40 -0
- package/dist/esm/ind-app-header.entry.js.map +1 -0
- package/dist/esm/ind-button.entry.js +77 -0
- package/dist/esm/ind-button.entry.js.map +1 -0
- package/dist/esm/ind-checkbox.entry.js +47 -0
- package/dist/esm/ind-checkbox.entry.js.map +1 -0
- package/dist/esm/ind-dialog.entry.js +99 -0
- package/dist/esm/ind-dialog.entry.js.map +1 -0
- package/dist/esm/ind-divider.entry.js +19 -0
- package/dist/esm/ind-divider.entry.js.map +1 -0
- package/dist/esm/ind-ds.js +23 -0
- package/dist/esm/ind-ds.js.map +1 -0
- package/dist/esm/ind-fill-row.entry.js +32 -0
- package/dist/esm/ind-fill-row.entry.js.map +1 -0
- package/dist/esm/ind-health-card.entry.js +36 -0
- package/dist/esm/ind-health-card.entry.js.map +1 -0
- package/dist/esm/ind-input.entry.js +55 -0
- package/dist/esm/ind-input.entry.js.map +1 -0
- package/dist/esm/ind-led.entry.js +27 -0
- package/dist/esm/ind-led.entry.js.map +1 -0
- package/dist/esm/ind-mqtt-monitor.entry.js +73 -0
- package/dist/esm/ind-mqtt-monitor.entry.js.map +1 -0
- package/dist/esm/ind-nav-item.entry.js +46 -0
- package/dist/esm/ind-nav-item.entry.js.map +1 -0
- package/dist/esm/ind-progress.entry.js +46 -0
- package/dist/esm/ind-progress.entry.js.map +1 -0
- package/dist/esm/ind-scara-canvas.entry.js +55 -0
- package/dist/esm/ind-scara-canvas.entry.js.map +1 -0
- package/dist/esm/ind-select.entry.js +53 -0
- package/dist/esm/ind-select.entry.js.map +1 -0
- package/dist/esm/ind-shelf-canvas.entry.js +86 -0
- package/dist/esm/ind-shelf-canvas.entry.js.map +1 -0
- package/dist/esm/ind-sidebar-nav.entry.js +18 -0
- package/dist/esm/ind-sidebar-nav.entry.js.map +1 -0
- package/dist/esm/ind-status-bar.entry.js +20 -0
- package/dist/esm/ind-status-bar.entry.js.map +1 -0
- package/dist/esm/ind-status-dot.entry.js +29 -0
- package/dist/esm/ind-status-dot.entry.js.map +1 -0
- package/dist/esm/ind-textarea.entry.js +64 -0
- package/dist/esm/ind-textarea.entry.js.map +1 -0
- package/dist/esm/ind-toolbar-action.entry.js +21 -0
- package/dist/esm/ind-toolbar-action.entry.js.map +1 -0
- package/dist/esm/ind-value.entry.js +45 -0
- package/dist/esm/ind-value.entry.js.map +1 -0
- package/dist/esm/ind-valve.entry.js +29 -0
- package/dist/esm/ind-valve.entry.js.map +1 -0
- package/dist/esm/index-D2yNiL0d.js +1628 -0
- package/dist/esm/index-D2yNiL0d.js.map +1 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/ind-ds/ind-ds.css +1 -0
- package/dist/ind-ds/ind-ds.esm.js +2 -0
- package/dist/ind-ds/ind-ds.esm.js.map +1 -0
- package/dist/ind-ds/index.esm.js +2 -0
- package/dist/ind-ds/index.esm.js.map +1 -0
- package/dist/ind-ds/p-0840007d.entry.js +2 -0
- package/dist/ind-ds/p-0840007d.entry.js.map +1 -0
- package/dist/ind-ds/p-1727b403.entry.js +2 -0
- package/dist/ind-ds/p-1727b403.entry.js.map +1 -0
- package/dist/ind-ds/p-1d871f3f.entry.js +2 -0
- package/dist/ind-ds/p-1d871f3f.entry.js.map +1 -0
- package/dist/ind-ds/p-296b0c55.entry.js +2 -0
- package/dist/ind-ds/p-296b0c55.entry.js.map +1 -0
- package/dist/ind-ds/p-459405b6.entry.js +2 -0
- package/dist/ind-ds/p-459405b6.entry.js.map +1 -0
- package/dist/ind-ds/p-4a4811ab.entry.js +2 -0
- package/dist/ind-ds/p-4a4811ab.entry.js.map +1 -0
- package/dist/ind-ds/p-52b18003.entry.js +2 -0
- package/dist/ind-ds/p-52b18003.entry.js.map +1 -0
- package/dist/ind-ds/p-5369d63a.entry.js +2 -0
- package/dist/ind-ds/p-5369d63a.entry.js.map +1 -0
- package/dist/ind-ds/p-595ccdce.entry.js +2 -0
- package/dist/ind-ds/p-595ccdce.entry.js.map +1 -0
- package/dist/ind-ds/p-6c5c8053.entry.js +2 -0
- package/dist/ind-ds/p-6c5c8053.entry.js.map +1 -0
- package/dist/ind-ds/p-6c8f4bbd.entry.js +2 -0
- package/dist/ind-ds/p-6c8f4bbd.entry.js.map +1 -0
- package/dist/ind-ds/p-781e21df.entry.js +2 -0
- package/dist/ind-ds/p-781e21df.entry.js.map +1 -0
- package/dist/ind-ds/p-8817625a.entry.js +2 -0
- package/dist/ind-ds/p-8817625a.entry.js.map +1 -0
- package/dist/ind-ds/p-99f55d2a.entry.js +2 -0
- package/dist/ind-ds/p-99f55d2a.entry.js.map +1 -0
- package/dist/ind-ds/p-9b93fb09.entry.js +2 -0
- package/dist/ind-ds/p-9b93fb09.entry.js.map +1 -0
- package/dist/ind-ds/p-D2yNiL0d.js +3 -0
- package/dist/ind-ds/p-D2yNiL0d.js.map +1 -0
- package/dist/ind-ds/p-c8de42e9.entry.js +2 -0
- package/dist/ind-ds/p-c8de42e9.entry.js.map +1 -0
- package/dist/ind-ds/p-c9f752e6.entry.js +2 -0
- package/dist/ind-ds/p-c9f752e6.entry.js.map +1 -0
- package/dist/ind-ds/p-cee8bf2b.entry.js +2 -0
- package/dist/ind-ds/p-cee8bf2b.entry.js.map +1 -0
- package/dist/ind-ds/p-cf07b580.entry.js +2 -0
- package/dist/ind-ds/p-cf07b580.entry.js.map +1 -0
- package/dist/ind-ds/p-d1edc052.entry.js +2 -0
- package/dist/ind-ds/p-d1edc052.entry.js.map +1 -0
- package/dist/ind-ds/p-ea24a59d.entry.js +2 -0
- package/dist/ind-ds/p-ea24a59d.entry.js.map +1 -0
- package/dist/ind-ds/p-ec0b3785.entry.js +2 -0
- package/dist/ind-ds/p-ec0b3785.entry.js.map +1 -0
- package/dist/ind-ds/p-ee453874.entry.js +2 -0
- package/dist/ind-ds/p-ee453874.entry.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/atoms/alarm/alarm.d.ts +13 -0
- package/dist/types/components/atoms/button/button.d.ts +31 -0
- package/dist/types/components/atoms/checkbox/checkbox.d.ts +18 -0
- package/dist/types/components/atoms/dialog/dialog.d.ts +29 -0
- package/dist/types/components/atoms/divider/divider.d.ts +6 -0
- package/dist/types/components/atoms/input/input.d.ts +34 -0
- package/dist/types/components/atoms/led/led.d.ts +14 -0
- package/dist/types/components/atoms/progress/progress.d.ts +24 -0
- package/dist/types/components/atoms/scara-canvas/scara-canvas.d.ts +21 -0
- package/dist/types/components/atoms/select/select.d.ts +27 -0
- package/dist/types/components/atoms/shelf-canvas/shelf-canvas.d.ts +29 -0
- package/dist/types/components/atoms/status-dot/status-dot.d.ts +14 -0
- package/dist/types/components/atoms/textarea/textarea.d.ts +28 -0
- package/dist/types/components/atoms/value/value.d.ts +24 -0
- package/dist/types/components/atoms/valve/valve.d.ts +17 -0
- package/dist/types/components/molecules/fill-row/fill-row.d.ts +19 -0
- package/dist/types/components/molecules/health-card/health-card.d.ts +13 -0
- package/dist/types/components/molecules/nav-item/nav-item.d.ts +17 -0
- package/dist/types/components/molecules/toolbar-action/toolbar-action.d.ts +6 -0
- package/dist/types/components/organisms/app-header/app-header.d.ts +26 -0
- package/dist/types/components/organisms/mqtt-monitor/mqtt-monitor.d.ts +23 -0
- package/dist/types/components/organisms/sidebar-nav/sidebar-nav.d.ts +11 -0
- package/dist/types/components/organisms/status-bar/status-bar.d.ts +13 -0
- package/dist/types/components.d.ts +1775 -0
- package/dist/types/index.d.ts +21 -0
- package/dist/types/stencil-public-runtime.d.ts +1861 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +87 -0
- package/utilities.css +324 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-ph7ZTjuY.js');
|
|
4
|
+
|
|
5
|
+
const defineCustomElements = async (win, options) => {
|
|
6
|
+
if (typeof window === 'undefined') return undefined;
|
|
7
|
+
await index.globalScripts();
|
|
8
|
+
return index.bootstrapLazy([["ind-app-header.cjs",[[769,"ind-app-header",{"brand":[1],"subBrand":[1,"sub-brand"],"machineId":[1,"machine-id"],"mqttState":[1,"mqtt-state"],"mqttLabel":[1,"mqtt-label"],"version":[1],"docsUrl":[1,"docs-url"],"hideChangeMachine":[4,"hide-change-machine"],"hideDisconnect":[4,"hide-disconnect"]}]]],["ind-fill-row.cjs",[[769,"ind-fill-row",{"tag":[1],"label":[1],"value":[2],"max":[2],"unit":[1],"variant":[513],"severity":[4]}]]],["ind-health-card.cjs",[[513,"ind-health-card",{"heading":[1],"state":[513],"stateLabel":[1,"state-label"],"detail":[1]}]]],["ind-status-bar.cjs",[[769,"ind-status-bar",{"state":[513],"message":[1]}]]],["ind-alarm.cjs",[[513,"ind-alarm",{"priority":[513],"acknowledged":[516],"label":[1],"timestamp":[1]}]]],["ind-button.cjs",[[769,"ind-button",{"variant":[513],"size":[513],"disabled":[516],"label":[1],"holdToConfirmMs":[2,"hold-to-confirm-ms"],"progress":[32]}]]],["ind-checkbox.cjs",[[513,"ind-checkbox",{"checked":[1540],"indeterminate":[516],"disabled":[516],"size":[513],"label":[1],"name":[1],"value":[1]},null,{"indeterminate":[{"syncIndeterminate":0}]}]]],["ind-dialog.cjs",[[769,"ind-dialog",{"open":[1540],"heading":[1],"size":[513],"closeOnBackdrop":[4,"close-on-backdrop"],"hasFooter":[32],"show":[64],"close":[64]},null,{"open":[{"onOpenChange":0}]}]]],["ind-divider.cjs",[[513,"ind-divider",{"orientation":[513]}]]],["ind-input.cjs",[[769,"ind-input",{"type":[513],"size":[513],"value":[1025],"placeholder":[1],"disabled":[516],"readonly":[516],"invalid":[516],"label":[1],"name":[1],"min":[8],"max":[8],"step":[8],"pattern":[1],"autocomplete":[1],"mode":[1,"inputmode"],"hasFocus":[32],"setFocus":[64]}]]],["ind-led.cjs",[[513,"ind-led",{"state":[513],"size":[513],"blinking":[516],"label":[1]}]]],["ind-mqtt-monitor.cjs",[[513,"ind-mqtt-monitor",{"log":[1],"filterValue":[1025,"filter-value"],"paused":[1028],"rows":[2]},null,{"log":[{"onLogChange":0}]}]]],["ind-nav-item.cjs",[[769,"ind-nav-item",{"active":[516],"disabled":[516],"label":[1],"href":[1],"badge":[8]}]]],["ind-scara-canvas.cjs",[[513,"ind-scara-canvas",{"joints":[1],"linkLengths":[1,"link-lengths"],"state":[513]}]]],["ind-select.cjs",[[513,"ind-select",{"options":[1],"value":[1025],"placeholder":[1],"label":[1],"name":[1],"size":[513],"disabled":[516],"invalid":[516]}]]],["ind-shelf-canvas.cjs",[[513,"ind-shelf-canvas",{"slots":[1],"rows":[2],"cols":[2],"heading":[1]}]]],["ind-sidebar-nav.cjs",[[257,"ind-sidebar-nav"]]],["ind-textarea.cjs",[[513,"ind-textarea",{"value":[1025],"placeholder":[1],"label":[1],"name":[1],"rows":[2],"size":[513],"variant":[513],"disabled":[516],"readonly":[516],"invalid":[516],"autoScroll":[4,"auto-scroll"]},null,{"value":[{"onValueChange":0}]}]]],["ind-toolbar-action.cjs",[[769,"ind-toolbar-action",{"counter":[8]}]]],["ind-value.cjs",[[513,"ind-value",{"value":[8],"unit":[1],"precision":[2],"alarm":[513],"trend":[513],"size":[513],"label":[1],"tag":[1]}]]],["ind-valve.cjs",[[513,"ind-valve",{"state":[513],"orientation":[513],"size":[513],"label":[1],"tag":[1]}]]],["ind-progress.cjs",[[513,"ind-progress",{"value":[2],"max":[2],"variant":[513],"size":[513],"label":[1],"showValue":[4,"show-value"],"unit":[1],"indeterminate":[516]}]]],["ind-status-dot.cjs",[[513,"ind-status-dot",{"state":[513],"size":[513],"blinking":[516],"label":[1]}]]]], options);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
exports.setNonce = index.setNonce;
|
|
12
|
+
exports.defineCustomElements = defineCustomElements;
|
|
13
|
+
//# sourceMappingURL=loader.cjs.js.map
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=loader.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.cjs.js","sources":["@lazy-external-entrypoint?app-data=conditional"],"sourcesContent":["export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\nexport const defineCustomElements = async (win, options) => {\n if (typeof window === 'undefined') return undefined;\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n};\n"],"names":["globalScripts","bootstrapLazy"],"mappings":";;;;AAGY,MAAC,oBAAoB,GAAG,OAAO,GAAG,EAAE,OAAO,KAAK;AAC5D,EAAE,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,OAAO,SAAS;AACrD,EAAE,MAAMA,mBAAa,EAAE;AACvB,EAAE,OAAOC,mBAAa,CAAC,4BAA4B,EAAE,OAAO,CAAC;AAC7D;;;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entries": [
|
|
3
|
+
"components/atoms/alarm/alarm.js",
|
|
4
|
+
"components/organisms/app-header/app-header.js",
|
|
5
|
+
"components/atoms/button/button.js",
|
|
6
|
+
"components/atoms/checkbox/checkbox.js",
|
|
7
|
+
"components/atoms/dialog/dialog.js",
|
|
8
|
+
"components/atoms/divider/divider.js",
|
|
9
|
+
"components/molecules/fill-row/fill-row.js",
|
|
10
|
+
"components/molecules/health-card/health-card.js",
|
|
11
|
+
"components/atoms/input/input.js",
|
|
12
|
+
"components/atoms/led/led.js",
|
|
13
|
+
"components/atoms/progress/progress.js",
|
|
14
|
+
"components/atoms/scara-canvas/scara-canvas.js",
|
|
15
|
+
"components/atoms/select/select.js",
|
|
16
|
+
"components/atoms/shelf-canvas/shelf-canvas.js",
|
|
17
|
+
"components/organisms/status-bar/status-bar.js",
|
|
18
|
+
"components/atoms/status-dot/status-dot.js",
|
|
19
|
+
"components/atoms/textarea/textarea.js",
|
|
20
|
+
"components/atoms/value/value.js",
|
|
21
|
+
"components/atoms/valve/valve.js",
|
|
22
|
+
"components/molecules/nav-item/nav-item.js",
|
|
23
|
+
"components/molecules/toolbar-action/toolbar-action.js",
|
|
24
|
+
"components/organisms/mqtt-monitor/mqtt-monitor.js",
|
|
25
|
+
"components/organisms/sidebar-nav/sidebar-nav.js"
|
|
26
|
+
],
|
|
27
|
+
"mixins": [],
|
|
28
|
+
"compiler": {
|
|
29
|
+
"name": "@stencil/core",
|
|
30
|
+
"version": "4.43.5",
|
|
31
|
+
"typescriptVersion": "5.8.3"
|
|
32
|
+
},
|
|
33
|
+
"collections": [],
|
|
34
|
+
"bundles": []
|
|
35
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: var(--ind-spacing-4, 8px);
|
|
5
|
+
padding: var(--ind-spacing-2, 4px) var(--ind-spacing-5, 12px);
|
|
6
|
+
border-radius: var(--ind-radius-md, 3px);
|
|
7
|
+
font-family: var(--ind-font-family-sans);
|
|
8
|
+
font-size: var(--ind-font-size-base, 12px);
|
|
9
|
+
border: 1px solid;
|
|
10
|
+
font-feature-settings: var(--ind-font-feature-tabular, "tnum" 1);
|
|
11
|
+
max-width: 100%;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.badge {
|
|
15
|
+
font-family: var(--ind-font-family-mono);
|
|
16
|
+
font-weight: var(--ind-font-weight-bold, 700);
|
|
17
|
+
font-size: var(--ind-font-size-sm, 11px);
|
|
18
|
+
letter-spacing: 0.04em;
|
|
19
|
+
padding: 1px var(--ind-spacing-2, 4px);
|
|
20
|
+
border-radius: var(--ind-radius-sm, 2px);
|
|
21
|
+
background: rgba(0, 0, 0, 0.25);
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.label {
|
|
26
|
+
flex: 1;
|
|
27
|
+
font-weight: var(--ind-font-weight-medium, 500);
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
text-overflow: ellipsis;
|
|
30
|
+
white-space: nowrap;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.timestamp {
|
|
34
|
+
font-family: var(--ind-font-family-mono);
|
|
35
|
+
font-size: var(--ind-font-size-sm, 11px);
|
|
36
|
+
opacity: 0.85;
|
|
37
|
+
white-space: nowrap;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:host([priority="high-high"]) {
|
|
41
|
+
background: var(--ind-alarm-high-high-bg, #dc2626);
|
|
42
|
+
color: var(--ind-alarm-high-high-fg, #ffffff);
|
|
43
|
+
border-color: var(--ind-alarm-high-high-border, #f87171);
|
|
44
|
+
}
|
|
45
|
+
:host([priority="high"]) {
|
|
46
|
+
background: var(--ind-alarm-high-bg, #f59e0b);
|
|
47
|
+
color: var(--ind-alarm-high-fg, #000000);
|
|
48
|
+
border-color: var(--ind-alarm-high-border, #fcd34d);
|
|
49
|
+
}
|
|
50
|
+
:host([priority="low"]) {
|
|
51
|
+
background: var(--ind-alarm-low-bg, #0891b2);
|
|
52
|
+
color: var(--ind-alarm-low-fg, #ffffff);
|
|
53
|
+
border-color: var(--ind-alarm-low-border, #22d3ee);
|
|
54
|
+
}
|
|
55
|
+
:host([priority="low-low"]) {
|
|
56
|
+
background: var(--ind-alarm-low-low-bg, #7c3aed);
|
|
57
|
+
color: var(--ind-alarm-low-low-fg, #ffffff);
|
|
58
|
+
border-color: var(--ind-alarm-low-low-border, #a78bfa);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Unacknowledged → blink at the priority-appropriate rate. */
|
|
62
|
+
:host(:not([acknowledged])) {
|
|
63
|
+
animation: ind-alarm-blink var(--ind-motion-blink-fast, 400ms) steps(2, end) infinite;
|
|
64
|
+
}
|
|
65
|
+
:host([priority="high-high"]:not([acknowledged])) {
|
|
66
|
+
animation-duration: var(--ind-motion-blink-urgent, 200ms);
|
|
67
|
+
}
|
|
68
|
+
:host([priority="low"]:not([acknowledged])),
|
|
69
|
+
:host([priority="low-low"]:not([acknowledged])) {
|
|
70
|
+
animation-duration: var(--ind-motion-blink-slow, 1000ms);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* Acknowledged → muted, no animation (ISA-18.2 convention). */
|
|
74
|
+
:host([acknowledged]) .label { opacity: 0.75; }
|
|
75
|
+
:host([acknowledged]) .badge { opacity: 0.85; }
|
|
76
|
+
|
|
77
|
+
@keyframes ind-alarm-blink {
|
|
78
|
+
50% { filter: brightness(0.6); }
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@media (prefers-reduced-motion: reduce) {
|
|
82
|
+
:host(:not([acknowledged])) {
|
|
83
|
+
animation: none;
|
|
84
|
+
outline: 3px solid currentColor;
|
|
85
|
+
outline-offset: 2px;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
const PRIORITY_LABEL = {
|
|
3
|
+
'high-high': 'HH',
|
|
4
|
+
'high': 'H',
|
|
5
|
+
'low': 'L',
|
|
6
|
+
'low-low': 'LL',
|
|
7
|
+
};
|
|
8
|
+
export class IndAlarm {
|
|
9
|
+
/** ISA-18.2 alarm priority. */
|
|
10
|
+
priority = 'high';
|
|
11
|
+
/** When false, the chip blinks (per ISA-18.2 unack convention). */
|
|
12
|
+
acknowledged = false;
|
|
13
|
+
/** Required human description of the alarm. */
|
|
14
|
+
label;
|
|
15
|
+
/** Optional ISO-8601 timestamp. Rendered with `<time>`. */
|
|
16
|
+
timestamp;
|
|
17
|
+
render() {
|
|
18
|
+
const prio = PRIORITY_LABEL[this.priority];
|
|
19
|
+
return (h(Host, { key: '4aa256413a1b908acbe8dda509a7524fbd3c50df', role: "alert", "aria-live": this.priority === 'high-high' && !this.acknowledged ? 'assertive' : 'polite', "aria-atomic": "true" }, h("span", { key: '19ee856cc6f4ee90f0db296fae69547c8bfa9c0f', class: "badge", part: "badge", "aria-label": `priority ${prio}` }, prio), h("span", { key: '54e66ef997a6ed665e4f0d59f87532368103d686', class: "label", part: "label" }, this.label), this.timestamp && (h("time", { key: '954956c17cce6c16df50710c6eb12fad827e8c45', class: "timestamp", part: "timestamp", dateTime: this.timestamp }, this.timestamp))));
|
|
20
|
+
}
|
|
21
|
+
static get is() { return "ind-alarm"; }
|
|
22
|
+
static get encapsulation() { return "shadow"; }
|
|
23
|
+
static get originalStyleUrls() {
|
|
24
|
+
return {
|
|
25
|
+
"$": ["alarm.css"]
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
static get styleUrls() {
|
|
29
|
+
return {
|
|
30
|
+
"$": ["alarm.css"]
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
static get properties() {
|
|
34
|
+
return {
|
|
35
|
+
"priority": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"mutable": false,
|
|
38
|
+
"complexType": {
|
|
39
|
+
"original": "AlarmPriority",
|
|
40
|
+
"resolved": "\"high\" | \"high-high\" | \"low\" | \"low-low\"",
|
|
41
|
+
"references": {
|
|
42
|
+
"AlarmPriority": {
|
|
43
|
+
"location": "local",
|
|
44
|
+
"path": "C:/www/ind-ds/packages/core/src/components/atoms/alarm/alarm.tsx",
|
|
45
|
+
"id": "src/components/atoms/alarm/alarm.tsx::AlarmPriority"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"required": false,
|
|
50
|
+
"optional": false,
|
|
51
|
+
"docs": {
|
|
52
|
+
"tags": [],
|
|
53
|
+
"text": "ISA-18.2 alarm priority."
|
|
54
|
+
},
|
|
55
|
+
"getter": false,
|
|
56
|
+
"setter": false,
|
|
57
|
+
"reflect": true,
|
|
58
|
+
"attribute": "priority",
|
|
59
|
+
"defaultValue": "'high'"
|
|
60
|
+
},
|
|
61
|
+
"acknowledged": {
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"mutable": false,
|
|
64
|
+
"complexType": {
|
|
65
|
+
"original": "boolean",
|
|
66
|
+
"resolved": "boolean",
|
|
67
|
+
"references": {}
|
|
68
|
+
},
|
|
69
|
+
"required": false,
|
|
70
|
+
"optional": false,
|
|
71
|
+
"docs": {
|
|
72
|
+
"tags": [],
|
|
73
|
+
"text": "When false, the chip blinks (per ISA-18.2 unack convention)."
|
|
74
|
+
},
|
|
75
|
+
"getter": false,
|
|
76
|
+
"setter": false,
|
|
77
|
+
"reflect": true,
|
|
78
|
+
"attribute": "acknowledged",
|
|
79
|
+
"defaultValue": "false"
|
|
80
|
+
},
|
|
81
|
+
"label": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"mutable": false,
|
|
84
|
+
"complexType": {
|
|
85
|
+
"original": "string",
|
|
86
|
+
"resolved": "string",
|
|
87
|
+
"references": {}
|
|
88
|
+
},
|
|
89
|
+
"required": true,
|
|
90
|
+
"optional": false,
|
|
91
|
+
"docs": {
|
|
92
|
+
"tags": [],
|
|
93
|
+
"text": "Required human description of the alarm."
|
|
94
|
+
},
|
|
95
|
+
"getter": false,
|
|
96
|
+
"setter": false,
|
|
97
|
+
"reflect": false,
|
|
98
|
+
"attribute": "label"
|
|
99
|
+
},
|
|
100
|
+
"timestamp": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"mutable": false,
|
|
103
|
+
"complexType": {
|
|
104
|
+
"original": "string",
|
|
105
|
+
"resolved": "string | undefined",
|
|
106
|
+
"references": {}
|
|
107
|
+
},
|
|
108
|
+
"required": false,
|
|
109
|
+
"optional": true,
|
|
110
|
+
"docs": {
|
|
111
|
+
"tags": [],
|
|
112
|
+
"text": "Optional ISO-8601 timestamp. Rendered with `<time>`."
|
|
113
|
+
},
|
|
114
|
+
"getter": false,
|
|
115
|
+
"setter": false,
|
|
116
|
+
"reflect": false,
|
|
117
|
+
"attribute": "timestamp"
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=alarm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alarm.js","sourceRoot":"","sources":["../../../../src/components/atoms/alarm/alarm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAIzD,MAAM,cAAc,GAAkC;IACpD,WAAW,EAAE,IAAI;IACjB,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,GAAG;IACV,SAAS,EAAE,IAAI;CAChB,CAAC;AAOF,MAAM,OAAO,QAAQ;IACnB,+BAA+B;IACN,QAAQ,GAAkB,MAAM,CAAC;IAE1D,mEAAmE;IAC1C,YAAY,GAAY,KAAK,CAAC;IAEvD,+CAA+C;IACvC,KAAK,CAAU;IAEvB,2DAA2D;IACnD,SAAS,CAAU;IAE3B,MAAM;QACJ,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3C,OAAO,CACL,EAAC,IAAI,qDACH,IAAI,EAAC,OAAO,eAEV,IAAI,CAAC,QAAQ,KAAK,WAAW,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,iBAElE,MAAM;YAElB,6DAAM,KAAK,EAAC,OAAO,EAAC,IAAI,EAAC,OAAO,gBAAa,YAAY,IAAI,EAAE,IAAG,IAAI,CAAQ;YAC9E,6DAAM,KAAK,EAAC,OAAO,EAAC,IAAI,EAAC,OAAO,IAAE,IAAI,CAAC,KAAK,CAAQ;YACnD,IAAI,CAAC,SAAS,IAAI,CACjB,6DAAM,KAAK,EAAC,WAAW,EAAC,IAAI,EAAC,WAAW,EAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,IAC9D,IAAI,CAAC,SAAS,CACV,CACR,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h, Host } from '@stencil/core';\n\nexport type AlarmPriority = 'high-high' | 'high' | 'low' | 'low-low';\n\nconst PRIORITY_LABEL: Record<AlarmPriority, string> = {\n 'high-high': 'HH',\n 'high': 'H',\n 'low': 'L',\n 'low-low': 'LL',\n};\n\n@Component({\n tag: 'ind-alarm',\n styleUrl: 'alarm.css',\n shadow: true,\n})\nexport class IndAlarm {\n /** ISA-18.2 alarm priority. */\n @Prop({ reflect: true }) priority: AlarmPriority = 'high';\n\n /** When false, the chip blinks (per ISA-18.2 unack convention). */\n @Prop({ reflect: true }) acknowledged: boolean = false;\n\n /** Required human description of the alarm. */\n @Prop() label!: string;\n\n /** Optional ISO-8601 timestamp. Rendered with `<time>`. */\n @Prop() timestamp?: string;\n\n render() {\n const prio = PRIORITY_LABEL[this.priority];\n return (\n <Host\n role=\"alert\"\n aria-live={\n this.priority === 'high-high' && !this.acknowledged ? 'assertive' : 'polite'\n }\n aria-atomic=\"true\"\n >\n <span class=\"badge\" part=\"badge\" aria-label={`priority ${prio}`}>{prio}</span>\n <span class=\"label\" part=\"label\">{this.label}</span>\n {this.timestamp && (\n <time class=\"timestamp\" part=\"timestamp\" dateTime={this.timestamp}>\n {this.timestamp}\n </time>\n )}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
font-family: var(--ind-font-family-sans);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.btn {
|
|
7
|
+
position: relative;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
gap: var(--ind-spacing-3, 6px);
|
|
13
|
+
padding: var(--ind-spacing-3, 6px) var(--ind-spacing-6, 16px);
|
|
14
|
+
|
|
15
|
+
font-family: inherit;
|
|
16
|
+
font-size: var(--ind-font-size-md, 13px);
|
|
17
|
+
font-weight: var(--ind-font-weight-semibold, 600);
|
|
18
|
+
line-height: 1;
|
|
19
|
+
letter-spacing: 0.01em;
|
|
20
|
+
|
|
21
|
+
background: var(--_bg, var(--ind-button-default-bg, #1a2129));
|
|
22
|
+
color: var(--_fg, var(--ind-button-default-fg, #eef1f5));
|
|
23
|
+
border: 1px solid var(--_border, var(--ind-button-default-border, #3d4856));
|
|
24
|
+
border-radius: var(--ind-radius-md, 3px);
|
|
25
|
+
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
user-select: none;
|
|
28
|
+
touch-action: manipulation;
|
|
29
|
+
transition:
|
|
30
|
+
background-color var(--ind-motion-duration-fast, 120ms),
|
|
31
|
+
border-color var(--ind-motion-duration-fast, 120ms);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.btn:hover:not(:disabled) {
|
|
35
|
+
background: var(--_bg-hover, var(--ind-button-default-bg-hover, #2a3340));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.btn:active:not(:disabled),
|
|
39
|
+
.btn.is-holding:not(:disabled) {
|
|
40
|
+
background: var(--_bg-active, var(--ind-button-default-bg-active, #3d4856));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.btn:focus-visible {
|
|
44
|
+
outline: 2px solid var(--ind-surface-focus-ring, #22d3ee);
|
|
45
|
+
outline-offset: 2px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.btn:disabled {
|
|
49
|
+
opacity: 0.5;
|
|
50
|
+
cursor: not-allowed;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host([variant="primary"]) .btn {
|
|
54
|
+
--_bg: var(--ind-button-primary-bg, #2563eb);
|
|
55
|
+
--_bg-hover: var(--ind-button-primary-bg-hover, #60a5fa);
|
|
56
|
+
--_bg-active: var(--ind-button-primary-bg-active, #60a5fa);
|
|
57
|
+
--_fg: var(--ind-button-primary-fg, #ffffff);
|
|
58
|
+
--_border: var(--ind-button-primary-border, #60a5fa);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:host([variant="danger"]) .btn {
|
|
62
|
+
--_bg: var(--ind-button-danger-bg, #dc2626);
|
|
63
|
+
--_bg-hover: var(--ind-button-danger-bg-hover, #f87171);
|
|
64
|
+
--_bg-active: var(--ind-button-danger-bg-active, #f87171);
|
|
65
|
+
--_fg: var(--ind-button-danger-fg, #ffffff);
|
|
66
|
+
--_border: var(--ind-button-danger-border, #f87171);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
:host([variant="ghost"]) .btn {
|
|
70
|
+
--_bg: transparent;
|
|
71
|
+
--_bg-hover: var(--ind-button-ghost-bg-hover, #1a2129);
|
|
72
|
+
--_bg-active: var(--ind-button-ghost-bg-active, #2a3340);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:host([size="sm"]) .btn {
|
|
76
|
+
font-size: var(--ind-font-size-sm, 11px);
|
|
77
|
+
padding: var(--ind-spacing-2, 4px) var(--ind-spacing-5, 12px);
|
|
78
|
+
}
|
|
79
|
+
:host([size="lg"]) .btn {
|
|
80
|
+
font-size: var(--ind-font-size-lg, 14px);
|
|
81
|
+
padding: var(--ind-spacing-5, 12px) var(--ind-spacing-7, 20px);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.content {
|
|
85
|
+
position: relative;
|
|
86
|
+
z-index: 1;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.hold-progress {
|
|
90
|
+
position: absolute;
|
|
91
|
+
inset: 0;
|
|
92
|
+
background: currentColor;
|
|
93
|
+
opacity: 0.18;
|
|
94
|
+
transform-origin: left center;
|
|
95
|
+
transform: scaleX(0);
|
|
96
|
+
transition: transform 60ms linear;
|
|
97
|
+
pointer-events: none;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.sr-only {
|
|
101
|
+
position: absolute;
|
|
102
|
+
width: 1px;
|
|
103
|
+
height: 1px;
|
|
104
|
+
padding: 0;
|
|
105
|
+
margin: -1px;
|
|
106
|
+
overflow: hidden;
|
|
107
|
+
clip: rect(0, 0, 0, 0);
|
|
108
|
+
white-space: nowrap;
|
|
109
|
+
border: 0;
|
|
110
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { h, Host, } from "@stencil/core";
|
|
2
|
+
export class IndButton {
|
|
3
|
+
/** Visual variant. `danger` should be paired with `holdToConfirmMs` for critical actions. */
|
|
4
|
+
variant = 'default';
|
|
5
|
+
/** Size. */
|
|
6
|
+
size = 'md';
|
|
7
|
+
/** Disabled state. */
|
|
8
|
+
disabled = false;
|
|
9
|
+
/** Optional accessible label (falls back to slotted text). */
|
|
10
|
+
label;
|
|
11
|
+
/**
|
|
12
|
+
* If > 0, the button must be held this many milliseconds before activating.
|
|
13
|
+
* Use for critical actions (Stop, Trip, Reset) to prevent accidental clicks —
|
|
14
|
+
* standard NAMUR / safety-instrumented operating practice.
|
|
15
|
+
*/
|
|
16
|
+
holdToConfirmMs = 0;
|
|
17
|
+
/** Fired on click (or after hold completes if `holdToConfirmMs > 0`). */
|
|
18
|
+
indActivate;
|
|
19
|
+
progress = 0;
|
|
20
|
+
holdStart = 0;
|
|
21
|
+
rafHandle = null;
|
|
22
|
+
startHold = (e) => {
|
|
23
|
+
if (this.disabled)
|
|
24
|
+
return;
|
|
25
|
+
e.preventDefault();
|
|
26
|
+
if (this.holdToConfirmMs <= 0) {
|
|
27
|
+
this.indActivate.emit();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
this.holdStart = performance.now();
|
|
31
|
+
this.progress = 0;
|
|
32
|
+
this.tick();
|
|
33
|
+
};
|
|
34
|
+
tick = () => {
|
|
35
|
+
const elapsed = performance.now() - this.holdStart;
|
|
36
|
+
this.progress = Math.min(1, elapsed / this.holdToConfirmMs);
|
|
37
|
+
if (this.progress >= 1) {
|
|
38
|
+
this.cancelHold();
|
|
39
|
+
this.indActivate.emit();
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this.rafHandle = requestAnimationFrame(this.tick);
|
|
43
|
+
};
|
|
44
|
+
cancelHold = () => {
|
|
45
|
+
if (this.rafHandle !== null) {
|
|
46
|
+
cancelAnimationFrame(this.rafHandle);
|
|
47
|
+
this.rafHandle = null;
|
|
48
|
+
}
|
|
49
|
+
this.progress = 0;
|
|
50
|
+
};
|
|
51
|
+
onKeyDown = (e) => {
|
|
52
|
+
if (e.key === ' ' || e.key === 'Enter') {
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
this.startHold(e);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
disconnectedCallback() {
|
|
58
|
+
this.cancelHold();
|
|
59
|
+
}
|
|
60
|
+
render() {
|
|
61
|
+
const isHolding = this.progress > 0 && this.progress < 1;
|
|
62
|
+
return (h(Host, { key: 'bbafede18f13eac5486d9cae0c2bd727375e7762' }, h("button", { key: '82bf34d3c9943e33edd5c8863be6457d3c201ece', type: "button", class: { btn: true, 'is-holding': isHolding }, part: "btn", disabled: this.disabled, "aria-label": this.label, "aria-describedby": this.holdToConfirmMs > 0 ? 'hold-hint' : undefined, onPointerDown: this.startHold, onPointerUp: this.cancelHold, onPointerLeave: this.cancelHold, onPointerCancel: this.cancelHold, onKeyDown: this.onKeyDown, onKeyUp: this.cancelHold }, h("span", { key: '75252fda5e1229f6c335df277b0c09a18d0b621d', class: "content", part: "content" }, h("slot", { key: 'f9a158deadf76da0cf1e13680c1b1dd444273387' }, this.label)), this.holdToConfirmMs > 0 && (h("span", { key: '7ba778902c08b3d8fe6b1c6a963c4ab645369110', class: "hold-progress", part: "hold-progress", style: { transform: `scaleX(${this.progress})` }, "aria-hidden": "true" }))), this.holdToConfirmMs > 0 && (h("span", { key: '9c2f72de9486bfed4855c5dc81dbf54161c97842', id: "hold-hint", class: "sr-only" }, "Hold to confirm (", this.holdToConfirmMs, " ms)"))));
|
|
63
|
+
}
|
|
64
|
+
static get is() { return "ind-button"; }
|
|
65
|
+
static get encapsulation() { return "shadow"; }
|
|
66
|
+
static get originalStyleUrls() {
|
|
67
|
+
return {
|
|
68
|
+
"$": ["button.css"]
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
static get styleUrls() {
|
|
72
|
+
return {
|
|
73
|
+
"$": ["button.css"]
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
static get properties() {
|
|
77
|
+
return {
|
|
78
|
+
"variant": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"mutable": false,
|
|
81
|
+
"complexType": {
|
|
82
|
+
"original": "ButtonVariant",
|
|
83
|
+
"resolved": "\"danger\" | \"default\" | \"ghost\" | \"primary\"",
|
|
84
|
+
"references": {
|
|
85
|
+
"ButtonVariant": {
|
|
86
|
+
"location": "local",
|
|
87
|
+
"path": "C:/www/ind-ds/packages/core/src/components/atoms/button/button.tsx",
|
|
88
|
+
"id": "src/components/atoms/button/button.tsx::ButtonVariant"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"required": false,
|
|
93
|
+
"optional": false,
|
|
94
|
+
"docs": {
|
|
95
|
+
"tags": [],
|
|
96
|
+
"text": "Visual variant. `danger` should be paired with `holdToConfirmMs` for critical actions."
|
|
97
|
+
},
|
|
98
|
+
"getter": false,
|
|
99
|
+
"setter": false,
|
|
100
|
+
"reflect": true,
|
|
101
|
+
"attribute": "variant",
|
|
102
|
+
"defaultValue": "'default'"
|
|
103
|
+
},
|
|
104
|
+
"size": {
|
|
105
|
+
"type": "string",
|
|
106
|
+
"mutable": false,
|
|
107
|
+
"complexType": {
|
|
108
|
+
"original": "ButtonSize",
|
|
109
|
+
"resolved": "\"lg\" | \"md\" | \"sm\"",
|
|
110
|
+
"references": {
|
|
111
|
+
"ButtonSize": {
|
|
112
|
+
"location": "local",
|
|
113
|
+
"path": "C:/www/ind-ds/packages/core/src/components/atoms/button/button.tsx",
|
|
114
|
+
"id": "src/components/atoms/button/button.tsx::ButtonSize"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"required": false,
|
|
119
|
+
"optional": false,
|
|
120
|
+
"docs": {
|
|
121
|
+
"tags": [],
|
|
122
|
+
"text": "Size."
|
|
123
|
+
},
|
|
124
|
+
"getter": false,
|
|
125
|
+
"setter": false,
|
|
126
|
+
"reflect": true,
|
|
127
|
+
"attribute": "size",
|
|
128
|
+
"defaultValue": "'md'"
|
|
129
|
+
},
|
|
130
|
+
"disabled": {
|
|
131
|
+
"type": "boolean",
|
|
132
|
+
"mutable": false,
|
|
133
|
+
"complexType": {
|
|
134
|
+
"original": "boolean",
|
|
135
|
+
"resolved": "boolean",
|
|
136
|
+
"references": {}
|
|
137
|
+
},
|
|
138
|
+
"required": false,
|
|
139
|
+
"optional": false,
|
|
140
|
+
"docs": {
|
|
141
|
+
"tags": [],
|
|
142
|
+
"text": "Disabled state."
|
|
143
|
+
},
|
|
144
|
+
"getter": false,
|
|
145
|
+
"setter": false,
|
|
146
|
+
"reflect": true,
|
|
147
|
+
"attribute": "disabled",
|
|
148
|
+
"defaultValue": "false"
|
|
149
|
+
},
|
|
150
|
+
"label": {
|
|
151
|
+
"type": "string",
|
|
152
|
+
"mutable": false,
|
|
153
|
+
"complexType": {
|
|
154
|
+
"original": "string",
|
|
155
|
+
"resolved": "string | undefined",
|
|
156
|
+
"references": {}
|
|
157
|
+
},
|
|
158
|
+
"required": false,
|
|
159
|
+
"optional": true,
|
|
160
|
+
"docs": {
|
|
161
|
+
"tags": [],
|
|
162
|
+
"text": "Optional accessible label (falls back to slotted text)."
|
|
163
|
+
},
|
|
164
|
+
"getter": false,
|
|
165
|
+
"setter": false,
|
|
166
|
+
"reflect": false,
|
|
167
|
+
"attribute": "label"
|
|
168
|
+
},
|
|
169
|
+
"holdToConfirmMs": {
|
|
170
|
+
"type": "number",
|
|
171
|
+
"mutable": false,
|
|
172
|
+
"complexType": {
|
|
173
|
+
"original": "number",
|
|
174
|
+
"resolved": "number",
|
|
175
|
+
"references": {}
|
|
176
|
+
},
|
|
177
|
+
"required": false,
|
|
178
|
+
"optional": false,
|
|
179
|
+
"docs": {
|
|
180
|
+
"tags": [],
|
|
181
|
+
"text": "If > 0, the button must be held this many milliseconds before activating.\nUse for critical actions (Stop, Trip, Reset) to prevent accidental clicks \u2014\nstandard NAMUR / safety-instrumented operating practice."
|
|
182
|
+
},
|
|
183
|
+
"getter": false,
|
|
184
|
+
"setter": false,
|
|
185
|
+
"reflect": false,
|
|
186
|
+
"attribute": "hold-to-confirm-ms",
|
|
187
|
+
"defaultValue": "0"
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
static get states() {
|
|
192
|
+
return {
|
|
193
|
+
"progress": {}
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
static get events() {
|
|
197
|
+
return [{
|
|
198
|
+
"method": "indActivate",
|
|
199
|
+
"name": "indActivate",
|
|
200
|
+
"bubbles": true,
|
|
201
|
+
"cancelable": true,
|
|
202
|
+
"composed": true,
|
|
203
|
+
"docs": {
|
|
204
|
+
"tags": [],
|
|
205
|
+
"text": "Fired on click (or after hold completes if `holdToConfirmMs > 0`)."
|
|
206
|
+
},
|
|
207
|
+
"complexType": {
|
|
208
|
+
"original": "void",
|
|
209
|
+
"resolved": "void",
|
|
210
|
+
"references": {}
|
|
211
|
+
}
|
|
212
|
+
}];
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../../src/components/atoms/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,KAAK,EACL,KAAK,EAEL,CAAC,EACD,IAAI,GACL,MAAM,eAAe,CAAC;AAUvB,MAAM,OAAO,SAAS;IACpB,6FAA6F;IACpE,OAAO,GAAkB,SAAS,CAAC;IAE5D,YAAY;IACa,IAAI,GAAe,IAAI,CAAC;IAEjD,sBAAsB;IACG,QAAQ,GAAY,KAAK,CAAC;IAEnD,8DAA8D;IACtD,KAAK,CAAU;IAEvB;;;;OAIG;IACK,eAAe,GAAW,CAAC,CAAC;IAEpC,yEAAyE;IAChE,WAAW,CAAsB;IAEzB,QAAQ,GAAW,CAAC,CAAC;IAE9B,SAAS,GAAG,CAAC,CAAC;IACd,SAAS,GAAkB,IAAI,CAAC;IAEhC,SAAS,GAAG,CAAC,CAAQ,EAAE,EAAE;QAC/B,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO;QAC1B,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,IAAI,IAAI,CAAC,eAAe,IAAI,CAAC,EAAE,CAAC;YAC9B,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;YACxB,OAAO;QACT,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QACnC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC,CAAC;IAEM,IAAI,GAAG,GAAG,EAAE;QAClB,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;QACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC;QAC5D,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,UAAU,EAAE,CAAC;YAClB,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;YACxB,OAAO;QACT,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC,CAAC;IAEM,UAAU,GAAG,GAAG,EAAE;QACxB,IAAI,IAAI,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;YAC5B,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACrC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACxB,CAAC;QACD,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;IACpB,CAAC,CAAC;IAEM,SAAS,GAAG,CAAC,CAAgB,EAAE,EAAE;QACvC,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;YACvC,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,CAAC;IAEF,oBAAoB;QAClB,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED,MAAM;QACJ,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QACzD,OAAO,CACL,EAAC,IAAI;YACH,+DACE,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,EAC7C,IAAI,EAAC,KAAK,EACV,QAAQ,EAAE,IAAI,CAAC,QAAQ,gBACX,IAAI,CAAC,KAAK,sBACJ,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EACpE,aAAa,EAAE,IAAI,CAAC,SAAS,EAC7B,WAAW,EAAE,IAAI,CAAC,UAAU,EAC5B,cAAc,EAAE,IAAI,CAAC,UAAU,EAC/B,eAAe,EAAE,IAAI,CAAC,UAAU,EAChC,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,OAAO,EAAE,IAAI,CAAC,UAAU;gBAExB,6DAAM,KAAK,EAAC,SAAS,EAAC,IAAI,EAAC,SAAS;oBAClC,+DAAO,IAAI,CAAC,KAAK,CAAQ,CACpB;gBACN,IAAI,CAAC,eAAe,GAAG,CAAC,IAAI,CAC3B,6DACE,KAAK,EAAC,eAAe,EACrB,IAAI,EAAC,eAAe,EACpB,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,IAAI,CAAC,QAAQ,GAAG,EAAE,iBACpC,MAAM,GAClB,CACH,CACM;YACR,IAAI,CAAC,eAAe,GAAG,CAAC,IAAI,CAC3B,6DAAM,EAAE,EAAC,WAAW,EAAC,KAAK,EAAC,SAAS;;gBAChB,IAAI,CAAC,eAAe;uBACjC,CACR,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Prop,\n State,\n Event,\n EventEmitter,\n h,\n Host,\n} from '@stencil/core';\n\nexport type ButtonVariant = 'default' | 'primary' | 'danger' | 'ghost';\nexport type ButtonSize = 'sm' | 'md' | 'lg';\n\n@Component({\n tag: 'ind-button',\n styleUrl: 'button.css',\n shadow: true,\n})\nexport class IndButton {\n /** Visual variant. `danger` should be paired with `holdToConfirmMs` for critical actions. */\n @Prop({ reflect: true }) variant: ButtonVariant = 'default';\n\n /** Size. */\n @Prop({ reflect: true }) size: ButtonSize = 'md';\n\n /** Disabled state. */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Optional accessible label (falls back to slotted text). */\n @Prop() label?: string;\n\n /**\n * If > 0, the button must be held this many milliseconds before activating.\n * Use for critical actions (Stop, Trip, Reset) to prevent accidental clicks —\n * standard NAMUR / safety-instrumented operating practice.\n */\n @Prop() holdToConfirmMs: number = 0;\n\n /** Fired on click (or after hold completes if `holdToConfirmMs > 0`). */\n @Event() indActivate!: EventEmitter<void>;\n\n @State() private progress: number = 0;\n\n private holdStart = 0;\n private rafHandle: number | null = null;\n\n private startHold = (e: Event) => {\n if (this.disabled) return;\n e.preventDefault();\n if (this.holdToConfirmMs <= 0) {\n this.indActivate.emit();\n return;\n }\n this.holdStart = performance.now();\n this.progress = 0;\n this.tick();\n };\n\n private tick = () => {\n const elapsed = performance.now() - this.holdStart;\n this.progress = Math.min(1, elapsed / this.holdToConfirmMs);\n if (this.progress >= 1) {\n this.cancelHold();\n this.indActivate.emit();\n return;\n }\n this.rafHandle = requestAnimationFrame(this.tick);\n };\n\n private cancelHold = () => {\n if (this.rafHandle !== null) {\n cancelAnimationFrame(this.rafHandle);\n this.rafHandle = null;\n }\n this.progress = 0;\n };\n\n private onKeyDown = (e: KeyboardEvent) => {\n if (e.key === ' ' || e.key === 'Enter') {\n e.preventDefault();\n this.startHold(e);\n }\n };\n\n disconnectedCallback() {\n this.cancelHold();\n }\n\n render() {\n const isHolding = this.progress > 0 && this.progress < 1;\n return (\n <Host>\n <button\n type=\"button\"\n class={{ btn: true, 'is-holding': isHolding }}\n part=\"btn\"\n disabled={this.disabled}\n aria-label={this.label}\n aria-describedby={this.holdToConfirmMs > 0 ? 'hold-hint' : undefined}\n onPointerDown={this.startHold}\n onPointerUp={this.cancelHold}\n onPointerLeave={this.cancelHold}\n onPointerCancel={this.cancelHold}\n onKeyDown={this.onKeyDown}\n onKeyUp={this.cancelHold}\n >\n <span class=\"content\" part=\"content\">\n <slot>{this.label}</slot>\n </span>\n {this.holdToConfirmMs > 0 && (\n <span\n class=\"hold-progress\"\n part=\"hold-progress\"\n style={{ transform: `scaleX(${this.progress})` }}\n aria-hidden=\"true\"\n />\n )}\n </button>\n {this.holdToConfirmMs > 0 && (\n <span id=\"hold-hint\" class=\"sr-only\">\n Hold to confirm ({this.holdToConfirmMs} ms)\n </span>\n )}\n </Host>\n );\n }\n}\n"]}
|