@livenetworks/ashlar 1.6.0 → 2.0.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/LICENSE +641 -0
- package/README.md +202 -86
- package/{js → components}/COMPONENTS.md +1116 -1108
- package/{js → components}/index.js +81 -58
- package/{js → components}/ln-accordion/README.md +7 -6
- package/components/ln-accordion/ln-accordion-dev.scss +8 -0
- package/components/ln-accordion/ln-accordion.js +1 -0
- package/components/ln-accordion/ln-accordion.schema.json +30 -0
- package/components/ln-accordion/ln-accordion.scss +8 -0
- package/{js → components}/ln-accordion/src/ln-accordion.js +8 -2
- package/{js → components}/ln-ajax/README.md +171 -160
- package/components/ln-ajax/ln-ajax-dev.scss +8 -0
- package/components/ln-ajax/ln-ajax.js +1 -0
- package/components/ln-ajax/ln-ajax.schema.json +30 -0
- package/{js → components}/ln-ajax/src/ln-ajax.js +65 -30
- package/{js → components}/ln-api-connector/README.md +27 -5
- package/components/ln-api-connector/ln-api-connector.js +1 -0
- package/components/ln-api-connector/ln-api-connector.schema.json +96 -0
- package/components/ln-api-connector/src/connector-core.js +97 -0
- package/components/ln-api-connector/src/ln-api-connector.js +447 -0
- package/{js → components}/ln-api-queue/README.md +12 -9
- package/components/ln-api-queue/ln-api-queue.js +1 -0
- package/components/ln-api-queue/ln-api-queue.schema.json +34 -0
- package/{js → components}/ln-api-queue/src/ln-api-queue.js +33 -14
- package/{js → components}/ln-api-queue/src/queue-storage.js +7 -3
- package/{js → components}/ln-autoresize/README.md +129 -127
- package/components/ln-autoresize/ln-autoresize-dev.scss +8 -0
- package/components/ln-autoresize/ln-autoresize.js +1 -0
- package/components/ln-autoresize/ln-autoresize.schema.json +22 -0
- package/{js → components}/ln-autoresize/src/ln-autoresize.js +8 -1
- package/{js → components}/ln-autosave/README.md +127 -124
- package/components/ln-autosave/ln-autosave-dev.scss +13 -0
- package/components/ln-autosave/ln-autosave.js +1 -0
- package/components/ln-autosave/ln-autosave.schema.json +48 -0
- package/components/ln-autosave/src/autosave-model.js +34 -0
- package/{js → components}/ln-autosave/src/ln-autosave.js +65 -58
- package/components/ln-chart/README.md +145 -0
- package/components/ln-chart/ln-chart-dev.scss +20 -0
- package/components/ln-chart/ln-chart.js +1 -0
- package/components/ln-chart/ln-chart.schema.json +146 -0
- package/components/ln-chart/ln-chart.scss +8 -0
- package/components/ln-chart/src/chart-model.js +154 -0
- package/components/ln-chart/src/ln-chart.js +176 -0
- package/{js → components}/ln-circular-progress/README.md +15 -14
- package/components/ln-circular-progress/ln-circular-progress-dev.scss +8 -0
- package/components/ln-circular-progress/ln-circular-progress.js +1 -0
- package/components/ln-circular-progress/ln-circular-progress.schema.json +42 -0
- package/{js → components}/ln-circular-progress/src/ln-circular-progress.js +32 -50
- package/components/ln-confirm/README.md +216 -0
- package/components/ln-confirm/ln-confirm-dev.scss +24 -0
- package/components/ln-confirm/ln-confirm.js +1 -0
- package/components/ln-confirm/ln-confirm.schema.json +66 -0
- package/components/ln-confirm/ln-confirm.scss +24 -0
- package/{js → components}/ln-confirm/src/ln-confirm.js +180 -167
- package/{js → components}/ln-core/README.md +374 -149
- package/components/ln-core/attrs.js +273 -0
- package/components/ln-core/compare.js +40 -0
- package/components/ln-core/crypto.js +265 -0
- package/components/ln-core/date.js +50 -0
- package/components/ln-core/dom.js +115 -0
- package/components/ln-core/events.js +122 -0
- package/components/ln-core/form.js +136 -0
- package/{js → components}/ln-core/hash.js +149 -92
- package/components/ln-core/helpers.js +33 -0
- package/components/ln-core/http.js +48 -0
- package/components/ln-core/index.js +11 -0
- package/components/ln-core/lifecycle.js +403 -0
- package/components/ln-core/ln-core.schema.json +109 -0
- package/components/ln-core/locale.js +55 -0
- package/components/ln-core/matching.js +78 -0
- package/components/ln-core/number.js +125 -0
- package/components/ln-core/progress.js +30 -0
- package/components/ln-core/template.js +206 -0
- package/{js → components}/ln-core/window-cache.js +247 -213
- package/{js → components}/ln-couchdb-connector/README.md +7 -5
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -0
- package/components/ln-couchdb-connector/ln-couchdb-connector.schema.json +50 -0
- package/{js → components}/ln-couchdb-connector/src/ln-couchdb-connector.js +29 -43
- package/{js → components}/ln-data-coordinator/README.md +109 -73
- package/components/ln-data-coordinator/ln-data-coordinator-dev.scss +8 -0
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -0
- package/components/ln-data-coordinator/ln-data-coordinator.schema.json +196 -0
- package/components/ln-data-coordinator/src/data-read-policy.js +41 -0
- package/{js → components}/ln-data-coordinator/src/ln-data-coordinator.js +411 -154
- package/{js → components}/ln-data-coordinator/src/mutation-receipts.js +0 -5
- package/{js → components}/ln-data-store/README.md +42 -17
- package/components/ln-data-store/ln-data-store-dev.scss +13 -0
- package/components/ln-data-store/ln-data-store.js +1 -0
- package/components/ln-data-store/ln-data-store.schema.json +84 -0
- package/components/ln-data-store/src/data-store-model.js +155 -0
- package/{js → components}/ln-data-store/src/ln-data-store.js +407 -105
- package/components/ln-data-store/src/window-index.js +119 -0
- package/{js → components}/ln-date/README.md +17 -7
- package/{js → components}/ln-date/ln-date-dev.scss +14 -14
- package/components/ln-date/ln-date.js +1 -0
- package/components/ln-date/ln-date.schema.json +92 -0
- package/components/ln-date/src/date-model.js +186 -0
- package/components/ln-date/src/ln-date.js +486 -0
- package/components/ln-debug/README.md +132 -0
- package/components/ln-debug/ln-debug.js +1 -0
- package/components/ln-debug/ln-debug.schema.json +28 -0
- package/components/ln-debug/src/console-sink.js +19 -0
- package/components/ln-debug/src/debug-verifier.js +331 -0
- package/components/ln-debug/src/gate.js +95 -0
- package/components/ln-debug/src/generated-attributes.js +299 -0
- package/components/ln-debug/src/ln-debug.js +60 -0
- package/{js → components}/ln-dropdown/README.md +150 -140
- package/components/ln-dropdown/ln-dropdown-dev.scss +13 -0
- package/components/ln-dropdown/ln-dropdown.js +1 -0
- package/components/ln-dropdown/ln-dropdown.schema.json +90 -0
- package/components/ln-dropdown/ln-dropdown.scss +18 -0
- package/{js → components}/ln-dropdown/src/ln-dropdown.js +114 -11
- package/{js → components}/ln-editor/README.md +11 -9
- package/components/ln-editor/ln-editor-dev.scss +18 -0
- package/components/ln-editor/ln-editor.js +1 -0
- package/components/ln-editor/ln-editor.schema.json +58 -0
- package/components/ln-editor/ln-editor.scss +13 -0
- package/{js → components}/ln-editor/src/ln-editor.js +59 -11
- package/{js → components}/ln-external-links/README.md +10 -8
- package/components/ln-external-links/ln-external-links.js +1 -0
- package/components/ln-external-links/ln-external-links.schema.json +18 -0
- package/{js → components}/ln-external-links/src/ln-external-links.js +13 -11
- package/{js → components}/ln-fill/README.md +6 -8
- package/components/ln-fill/ln-fill.js +1 -0
- package/components/ln-fill/ln-fill.schema.json +23 -0
- package/{js → components}/ln-fill/src/ln-fill.js +7 -1
- package/components/ln-filter/README.md +131 -0
- package/components/ln-filter/ln-filter-dev.scss +13 -0
- package/components/ln-filter/ln-filter.js +1 -0
- package/components/ln-filter/ln-filter.schema.json +153 -0
- package/components/ln-filter/src/filter-model.js +185 -0
- package/components/ln-filter/src/ln-filter.js +435 -0
- package/{js → components}/ln-form/README.md +260 -264
- package/components/ln-form/ln-form-dev.scss +8 -0
- package/components/ln-form/ln-form.js +1 -0
- package/components/ln-form/ln-form.schema.json +45 -0
- package/{js → components}/ln-form/src/ln-form.js +107 -99
- package/{js → components}/ln-http/README.md +11 -6
- package/components/ln-http/ln-http.js +1 -0
- package/components/ln-http/ln-http.schema.json +6 -0
- package/components/ln-http/src/http-core.js +51 -0
- package/{js → components}/ln-http/src/ln-http.js +28 -33
- package/{js → components}/ln-icon/README.md +16 -9
- package/components/ln-icon/ln-icon.schema.json +6 -0
- package/components/ln-include/README.md +75 -0
- package/components/ln-include/ln-include-dev.scss +13 -0
- package/components/ln-include/ln-include.js +1 -0
- package/components/ln-include/ln-include.schema.json +23 -0
- package/components/ln-include/src/ln-include.js +111 -0
- package/components/ln-key/README.md +130 -0
- package/components/ln-key/ln-key-dev.scss +18 -0
- package/components/ln-key/ln-key.js +1 -0
- package/components/ln-key/ln-key.schema.json +56 -0
- package/components/ln-key/src/key-model.js +146 -0
- package/components/ln-key/src/ln-key.js +201 -0
- package/{js → components}/ln-link/README.md +7 -9
- package/components/ln-link/ln-link-dev.scss +8 -0
- package/components/ln-link/ln-link.js +1 -0
- package/components/ln-link/ln-link.schema.json +22 -0
- package/{js → components}/ln-link/src/ln-link.js +16 -11
- package/components/ln-list/README.md +152 -0
- package/components/ln-list/ln-list-dev.scss +8 -0
- package/components/ln-list/ln-list.js +1 -0
- package/components/ln-list/ln-list.schema.json +166 -0
- package/components/ln-list/ln-list.scss +25 -0
- package/{js → components}/ln-list/src/ln-list.js +1301 -1216
- package/{js → components}/ln-modal/README.md +13 -10
- package/components/ln-modal/ln-modal-dev.scss +18 -0
- package/components/ln-modal/ln-modal.js +1 -0
- package/components/ln-modal/ln-modal.schema.json +54 -0
- package/components/ln-modal/ln-modal.scss +51 -0
- package/{js → components}/ln-modal/src/ln-modal.js +164 -137
- package/{js → components}/ln-nav/README.md +11 -11
- package/components/ln-nav/ln-nav.js +1 -0
- package/components/ln-nav/ln-nav.schema.json +25 -0
- package/{js → components}/ln-nav/src/ln-nav.js +25 -14
- package/components/ln-number/README.md +205 -0
- package/{js → components}/ln-number/ln-number-dev.scss +13 -13
- package/components/ln-number/ln-number.js +1 -0
- package/components/ln-number/ln-number.schema.json +63 -0
- package/components/ln-number/src/ln-number.js +400 -0
- package/components/ln-number/src/number-model.js +31 -0
- package/components/ln-obfuscator/README.md +60 -0
- package/components/ln-obfuscator/ln-obfuscator.js +1 -0
- package/components/ln-obfuscator/ln-obfuscator.schema.json +49 -0
- package/components/ln-obfuscator/src/ln-obfuscator.js +159 -0
- package/components/ln-obfuscator/src/obfuscator-model.js +250 -0
- package/{js → components}/ln-options/README.md +3 -1
- package/components/ln-options/ln-options-dev.scss +13 -0
- package/components/ln-options/ln-options.js +1 -0
- package/components/ln-options/ln-options.schema.json +41 -0
- package/{js → components}/ln-options/src/ln-options.js +13 -5
- package/components/ln-persist/README.md +151 -0
- package/components/ln-persist/ln-persist.js +1 -0
- package/components/ln-persist/ln-persist.schema.json +28 -0
- package/components/ln-persist/src/ln-persist.js +83 -0
- package/components/ln-picklist/README.md +230 -0
- package/components/ln-picklist/ln-picklist-dev.scss +22 -0
- package/components/ln-picklist/ln-picklist.js +1 -0
- package/components/ln-picklist/ln-picklist.schema.json +49 -0
- package/components/ln-picklist/src/ln-picklist.js +228 -0
- package/{js → components}/ln-popover/README.md +164 -162
- package/components/ln-popover/ln-popover-dev.scss +13 -0
- package/components/ln-popover/ln-popover.js +1 -0
- package/components/ln-popover/ln-popover.schema.json +82 -0
- package/components/ln-popover/ln-popover.scss +18 -0
- package/{js → components}/ln-popover/src/ln-popover.js +42 -36
- package/{js → components}/ln-progress/README.md +410 -413
- package/components/ln-progress/ln-progress-dev.scss +8 -0
- package/components/ln-progress/ln-progress.js +1 -0
- package/components/ln-progress/ln-progress.schema.json +40 -0
- package/components/ln-progress/src/ln-progress.js +91 -0
- package/components/ln-progress/src/progress-model.js +20 -0
- package/{js → components}/ln-router/README.md +443 -432
- package/components/ln-router/ln-router-dev.scss +13 -0
- package/components/ln-router/ln-router.js +1 -0
- package/components/ln-router/ln-router.schema.json +68 -0
- package/{js → components}/ln-router/src/ln-router.js +585 -539
- package/components/ln-router/src/router-model.js +50 -0
- package/components/ln-scroll/README.md +45 -0
- package/components/ln-scroll/ln-scroll.js +1 -0
- package/components/ln-scroll/ln-scroll.schema.json +85 -0
- package/components/ln-scroll/src/ln-scroll.js +150 -0
- package/components/ln-search/README.md +188 -0
- package/components/ln-search/ln-search-dev.scss +13 -0
- package/components/ln-search/ln-search.js +1 -0
- package/components/ln-search/ln-search.schema.json +103 -0
- package/components/ln-search/src/ln-search.js +330 -0
- package/{js → components}/ln-slug/README.md +6 -3
- package/components/ln-slug/ln-slug-dev.scss +18 -0
- package/components/ln-slug/ln-slug.js +1 -0
- package/components/ln-slug/ln-slug.schema.json +23 -0
- package/{js → components}/ln-slug/src/ln-slug.js +20 -13
- package/components/ln-slug/src/slug-model.js +21 -0
- package/{js → components}/ln-sort/README.md +178 -170
- package/{js → components}/ln-sort/ln-sort-dev.scss +8 -8
- package/components/ln-sort/ln-sort.js +1 -0
- package/components/ln-sort/ln-sort.schema.json +104 -0
- package/components/ln-sort/src/ln-sort.js +321 -0
- package/components/ln-sort/src/sort-model.js +117 -0
- package/{js → components}/ln-sortable/README.md +7 -11
- package/components/ln-sortable/ln-sortable-dev.scss +13 -0
- package/components/ln-sortable/ln-sortable.js +1 -0
- package/components/ln-sortable/ln-sortable.schema.json +36 -0
- package/{js → components}/ln-sortable/src/ln-sortable.js +8 -13
- package/{js → components}/ln-stat/README.md +3 -1
- package/components/ln-stat/ln-stat-dev.scss +8 -0
- package/components/ln-stat/ln-stat.js +1 -0
- package/components/ln-stat/ln-stat.schema.json +32 -0
- package/{js → components}/ln-stat/src/ln-stat.js +14 -18
- package/components/ln-stat/src/stat-model.js +28 -0
- package/{js → components}/ln-table/README.md +37 -24
- package/{js → components}/ln-table/ln-table-dev.scss +17 -17
- package/components/ln-table/ln-table.js +1 -0
- package/components/ln-table/ln-table.schema.json +211 -0
- package/components/ln-table/ln-table.scss +15 -0
- package/{js → components}/ln-table/src/ln-table.js +1365 -1493
- package/components/ln-table/src/table-model.js +98 -0
- package/components/ln-table-coordinator/README.md +61 -0
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -0
- package/components/ln-table-coordinator/ln-table-coordinator.schema.json +93 -0
- package/components/ln-table-coordinator/src/ln-table-coordinator.js +193 -0
- package/{js → components}/ln-tabs/README.md +32 -14
- package/components/ln-tabs/ln-tabs-dev.scss +24 -0
- package/components/ln-tabs/ln-tabs.js +1 -0
- package/components/ln-tabs/ln-tabs.schema.json +75 -0
- package/components/ln-tabs/ln-tabs.scss +8 -0
- package/components/ln-tabs/src/ln-tabs.js +207 -0
- package/components/ln-tabs/src/tabs-model.js +82 -0
- package/{js → components}/ln-time/README.md +96 -95
- package/components/ln-time/ln-time-dev.scss +13 -0
- package/components/ln-time/ln-time.js +1 -0
- package/components/ln-time/ln-time.schema.json +38 -0
- package/{js → components}/ln-time/src/ln-time.js +206 -223
- package/components/ln-time/src/time-model.js +64 -0
- package/{js → components}/ln-toast/README.md +23 -5
- package/components/ln-toast/ln-toast-dev.scss +8 -0
- package/components/ln-toast/ln-toast.js +1 -0
- package/components/ln-toast/ln-toast.schema.json +65 -0
- package/components/ln-toast/ln-toast.scss +59 -0
- package/{js → components}/ln-toast/src/ln-toast.js +233 -232
- package/{js → components}/ln-toggle/README.md +198 -196
- package/{js → components}/ln-toggle/ln-toggle-dev.scss +13 -13
- package/components/ln-toggle/ln-toggle.js +1 -0
- package/components/ln-toggle/ln-toggle.schema.json +52 -0
- package/components/ln-toggle/ln-toggle.scss +37 -0
- package/{js → components}/ln-toggle/src/ln-toggle.js +61 -46
- package/{js → components}/ln-tooltip/README.md +6 -6
- package/{js → components}/ln-tooltip/ln-tooltip-dev.scss +9 -9
- package/components/ln-tooltip/ln-tooltip.js +1 -0
- package/components/ln-tooltip/ln-tooltip.schema.json +86 -0
- package/components/ln-tooltip/ln-tooltip.scss +9 -0
- package/{js → components}/ln-tooltip/src/ln-tooltip.js +14 -3
- package/{js → components}/ln-translations/README.md +3 -1
- package/components/ln-translations/ln-translations-dev.scss +13 -0
- package/components/ln-translations/ln-translations.js +1 -0
- package/components/ln-translations/ln-translations.schema.json +120 -0
- package/{js → components}/ln-translations/src/ln-translations.js +25 -10
- package/components/ln-ui-coordinator/README.md +101 -0
- package/components/ln-ui-coordinator/ln-ui-coordinator-dev.scss +8 -0
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -0
- package/components/ln-ui-coordinator/ln-ui-coordinator.schema.json +60 -0
- package/{js/ln-modal-coordinator/src/ln-modal-coordinator.js → components/ln-ui-coordinator/src/ln-ui-coordinator.js} +403 -345
- package/components/ln-upload/README.md +133 -0
- package/components/ln-upload/ln-upload-dev.scss +18 -0
- package/components/ln-upload/ln-upload.js +1 -0
- package/components/ln-upload/ln-upload.schema.json +193 -0
- package/components/ln-upload/ln-upload.scss +20 -0
- package/components/ln-upload/src/ln-upload.js +652 -0
- package/components/ln-upload/src/upload-model.js +78 -0
- package/{js → components}/ln-validate/README.md +182 -180
- package/{js → components}/ln-validate/ln-validate-dev.scss +15 -15
- package/components/ln-validate/ln-validate.js +1 -0
- package/components/ln-validate/ln-validate.schema.json +50 -0
- package/components/ln-validate/ln-validate.scss +7 -0
- package/{js → components}/ln-validate/src/ln-validate.js +23 -45
- package/components/ln-validate/src/validate-model.js +64 -0
- package/components/ln-websocket-connector/README.md +166 -0
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -0
- package/components/ln-websocket-connector/ln-websocket-connector.schema.json +29 -0
- package/components/ln-websocket-connector/src/ln-websocket-connector.js +279 -0
- package/ln-ashlar.html-data.json +1796 -0
- package/package.json +84 -61
- package/{scss → theme}/base/_global.scss +1 -2
- package/{scss → theme}/base/_reset.scss +1 -1
- package/{scss → theme}/base/_typography.scss +2 -0
- package/theme/brand.css +73 -0
- package/{scss → theme}/components/_app-shell.scss +8 -0
- package/theme/components/_button.scss +24 -0
- package/theme/components/_chart.scss +5 -0
- package/theme/components/_confirm.scss +6 -0
- package/{scss → theme}/components/_date.scss +30 -22
- package/{scss → theme}/components/_dropdown.scss +6 -1
- package/theme/components/_form.scss +140 -0
- package/{scss → theme}/components/_layout.scss +6 -0
- package/{scss → theme}/components/_ln-table.scss +1 -6
- package/theme/components/_picklist.scss +3 -0
- package/{scss → theme}/components/_sort.scss +10 -10
- package/theme/components/_status-badge.scss +6 -0
- package/{scss → theme}/components/_table.scss +16 -0
- package/{scss → theme}/components/_tabs.scss +0 -4
- package/theme/components/_toast.scss +48 -0
- package/{scss → theme}/components/_toggle.scss +1 -1
- package/theme/components/_upload.scss +45 -0
- package/{scss → theme}/config/_breakpoints.scss +1 -1
- package/theme/config/_contrast.scss +128 -0
- package/{scss → theme}/config/_density.scss +191 -205
- package/theme/config/_palette.scss +274 -0
- package/theme/config/_theme.scss +293 -0
- package/{scss → theme}/config/_tokens.scss +285 -441
- package/{scss → theme}/config/mixins/_accordion.scss +1 -1
- package/{scss → theme}/config/mixins/_alert.scss +1 -0
- package/{scss → theme}/config/mixins/_app-shell.scss +4 -2
- package/{scss → theme}/config/mixins/_borders.scss +2 -0
- package/theme/config/mixins/_btn.scss +175 -0
- package/{scss → theme}/config/mixins/_card.scss +55 -46
- package/theme/config/mixins/_chart.scss +82 -0
- package/{scss → theme}/config/mixins/_collapsible.scss +2 -1
- package/{scss → theme}/config/mixins/_colors.scss +8 -14
- package/{scss → theme}/config/mixins/_diagnostics.scss +48 -48
- package/theme/config/mixins/_dropdown.scss +169 -0
- package/{scss → theme}/config/mixins/_editor.scss +0 -7
- package/{scss → theme}/config/mixins/_filter.scss +47 -47
- package/{scss → theme}/config/mixins/_footer.scss +1 -1
- package/{scss → theme}/config/mixins/_form.scss +49 -18
- package/{scss → theme}/config/mixins/_index.scss +62 -61
- package/{scss → theme}/config/mixins/_layout.scss +6 -2
- package/{scss → theme}/config/mixins/_ln-table.scss +31 -10
- package/{scss → theme}/config/mixins/_loader.scss +1 -1
- package/{scss → theme}/config/mixins/_modal.scss +145 -149
- package/{scss → theme}/config/mixins/_motion.scss +13 -0
- package/{scss → theme}/config/mixins/_nav.scss +7 -7
- package/theme/config/mixins/_picklist.scss +66 -0
- package/theme/config/mixins/_popover.scss +96 -0
- package/{scss → theme}/config/mixins/_sidebar.scss +7 -4
- package/{scss → theme}/config/mixins/_sort.scss +43 -42
- package/{scss → theme}/config/mixins/_status-badge.scss +15 -2
- package/{scss → theme}/config/mixins/_table.scss +25 -14
- package/{scss → theme}/config/mixins/_tabs.scss +1 -1
- package/{scss → theme}/config/mixins/_toast.scss +174 -179
- package/{scss → theme}/config/mixins/_tooltip.scss +2 -2
- package/{scss → theme}/config/mixins/_typography.scss +16 -5
- package/{scss → theme}/config/mixins/_upload.scss +8 -6
- package/theme/ln-ashlar-core.scss +24 -0
- package/theme/ln-ashlar-dev.scss +66 -0
- package/theme/ln-ashlar-landing.scss +56 -0
- package/{scss/ln-ashlar.scss → theme/ln-ashlar-theme.scss} +63 -69
- package/theme/ln-ashlar.scss +8 -0
- package/theme/presentation/_bento.scss +151 -0
- package/theme/presentation/_cta.scss +111 -0
- package/theme/presentation/_effects.scss +216 -0
- package/theme/presentation/_features.scss +108 -0
- package/theme/presentation/_footer.scss +129 -0
- package/theme/presentation/_hero.scss +158 -0
- package/theme/presentation/_layout.scss +170 -0
- package/theme/presentation/_navbar.scss +140 -0
- package/theme/presentation/_pricing.scss +262 -0
- package/theme/presentation/_stats.scss +87 -0
- package/theme/presentation/_testimonials.scss +124 -0
- package/theme/presentation/_tokens.scss +39 -0
- package/theme/presentation/_typography.scss +163 -0
- package/{scss → theme}/utilities/_animations.scss +38 -0
- package/{scss → theme}/utilities/_utilities.scss +6 -0
- package/web-types.json +2312 -0
- package/js/ln-accordion/ln-accordion.js +0 -1
- package/js/ln-ajax/ln-ajax.js +0 -1
- package/js/ln-api-connector/ln-api-connector.js +0 -1
- package/js/ln-api-connector/src/ln-api-connector.js +0 -368
- package/js/ln-api-queue/ln-api-queue.js +0 -1
- package/js/ln-autoresize/ln-autoresize.js +0 -1
- package/js/ln-autosave/ln-autosave.js +0 -1
- package/js/ln-circular-progress/ln-circular-progress.js +0 -1
- package/js/ln-confirm/README.md +0 -162
- package/js/ln-confirm/_ln-confirm.scss +0 -24
- package/js/ln-confirm/ln-confirm.js +0 -1
- package/js/ln-core/crypto.js +0 -83
- package/js/ln-core/helpers.js +0 -788
- package/js/ln-core/index.js +0 -7
- package/js/ln-core/persist.js +0 -97
- package/js/ln-couchdb-connector/ln-couchdb-connector.js +0 -1
- package/js/ln-data-coordinator/ln-data-coordinator.js +0 -1
- package/js/ln-data-coordinator/src/data-read-policy.js +0 -18
- package/js/ln-data-store/ln-data-store.js +0 -1
- package/js/ln-date/ln-date.js +0 -1
- package/js/ln-date/src/ln-date.js +0 -603
- package/js/ln-debug/README.md +0 -58
- package/js/ln-debug/ln-debug.js +0 -1
- package/js/ln-debug/src/ln-debug.js +0 -19
- package/js/ln-dropdown/ln-dropdown.js +0 -1
- package/js/ln-dropdown/ln-dropdown.scss +0 -15
- package/js/ln-editor/ln-editor.js +0 -1
- package/js/ln-editor/ln-editor.scss +0 -43
- package/js/ln-external-links/ln-external-links.js +0 -1
- package/js/ln-fill/ln-fill.js +0 -1
- package/js/ln-filter/README.md +0 -189
- package/js/ln-filter/ln-filter-dev.scss +0 -8
- package/js/ln-filter/ln-filter.js +0 -1
- package/js/ln-filter/src/ln-filter.js +0 -419
- package/js/ln-form/ln-form.js +0 -1
- package/js/ln-http/ln-http.js +0 -1
- package/js/ln-link/ln-link.js +0 -1
- package/js/ln-list/README.md +0 -129
- package/js/ln-list/ln-list.js +0 -1
- package/js/ln-list/ln-list.scss +0 -28
- package/js/ln-modal/ln-modal-dev.scss +0 -13
- package/js/ln-modal/ln-modal.js +0 -1
- package/js/ln-modal/ln-modal.scss +0 -35
- package/js/ln-modal-coordinator/README.md +0 -99
- package/js/ln-modal-coordinator/ln-modal-coordinator-dev.scss +0 -8
- package/js/ln-modal-coordinator/ln-modal-coordinator.js +0 -1
- package/js/ln-nav/ln-nav.js +0 -1
- package/js/ln-number/README.md +0 -149
- package/js/ln-number/ln-number.js +0 -1
- package/js/ln-number/src/ln-number.js +0 -443
- package/js/ln-options/ln-options.js +0 -1
- package/js/ln-popover/ln-popover.js +0 -1
- package/js/ln-progress/ln-progress.js +0 -1
- package/js/ln-progress/src/ln-progress.js +0 -98
- package/js/ln-router/ln-router.js +0 -1
- package/js/ln-search/README.md +0 -158
- package/js/ln-search/ln-search-dev.scss +0 -8
- package/js/ln-search/ln-search.js +0 -1
- package/js/ln-search/src/ln-search.js +0 -117
- package/js/ln-slug/ln-slug.js +0 -1
- package/js/ln-sort/ln-sort.js +0 -1
- package/js/ln-sort/src/ln-sort.js +0 -178
- package/js/ln-sortable/ln-sortable.js +0 -1
- package/js/ln-stat/ln-stat.js +0 -1
- package/js/ln-table/ln-table.js +0 -1
- package/js/ln-table/ln-table.scss +0 -11
- package/js/ln-table-coordinator/README.md +0 -73
- package/js/ln-table-coordinator/ln-table-coordinator.js +0 -1
- package/js/ln-table-coordinator/src/ln-table-coordinator.js +0 -160
- package/js/ln-tabs/ln-tabs-dev.scss +0 -18
- package/js/ln-tabs/ln-tabs.js +0 -1
- package/js/ln-tabs/src/ln-tabs.js +0 -188
- package/js/ln-time/ln-time.js +0 -1
- package/js/ln-toast/ln-toast.js +0 -1
- package/js/ln-toggle/ln-toggle.js +0 -1
- package/js/ln-tooltip/ln-tooltip.js +0 -1
- package/js/ln-tooltip/ln-tooltip.scss +0 -9
- package/js/ln-translations/ln-translations.js +0 -1
- package/js/ln-upload/README.md +0 -255
- package/js/ln-upload/ln-upload.js +0 -1
- package/js/ln-upload/ln-upload.scss +0 -20
- package/js/ln-upload/src/ln-upload.js +0 -423
- package/js/ln-validate/ln-validate.js +0 -1
- package/scss/components/_button.scss +0 -20
- package/scss/components/_confirm.scss +0 -5
- package/scss/components/_form.scss +0 -107
- package/scss/components/_status-badge.scss +0 -4
- package/scss/components/_toast.scss +0 -68
- package/scss/components/_upload.scss +0 -51
- package/scss/config/_theme.scss +0 -216
- package/scss/config/mixins/_btn.scss +0 -179
- package/scss/config/mixins/_confirm.scss +0 -31
- package/scss/config/mixins/_dropdown.scss +0 -141
- package/scss/config/mixins/_popover.scss +0 -64
- package/scss/ln-ashlar-dev.scss +0 -39
- /package/{js → components}/ln-core/positioning.js +0 -0
- /package/{js → components}/ln-core/reactive.js +0 -0
- /package/{js → components}/ln-filter/ln-filter.scss +0 -0
- /package/{js → components}/ln-icon/ln-icon.js +0 -0
- /package/{js → components}/ln-icon/src/ln-icon.js +0 -0
- /package/{js → components}/ln-search/ln-search.scss +0 -0
- /package/{js → components}/ln-toast/template.html +0 -0
- /package/{scss → theme}/components/_accordion.scss +0 -0
- /package/{scss → theme}/components/_ajax.scss +0 -0
- /package/{scss → theme}/components/_alert.scss +0 -0
- /package/{scss → theme}/components/_avatar.scss +0 -0
- /package/{scss → theme}/components/_breadcrumbs.scss +0 -0
- /package/{scss → theme}/components/_card.scss +0 -0
- /package/{scss → theme}/components/_chip.scss +0 -0
- /package/{scss → theme}/components/_circular-progress.scss +0 -0
- /package/{scss → theme}/components/_editor.scss +0 -0
- /package/{scss → theme}/components/_empty-state.scss +0 -0
- /package/{scss → theme}/components/_filter.scss +0 -0
- /package/{scss → theme}/components/_link.scss +0 -0
- /package/{scss → theme}/components/_loader.scss +0 -0
- /package/{scss → theme}/components/_modal.scss +0 -0
- /package/{scss → theme}/components/_nav.scss +0 -0
- /package/{scss → theme}/components/_page-header.scss +0 -0
- /package/{scss → theme}/components/_popover.scss +0 -0
- /package/{scss → theme}/components/_progress.scss +0 -0
- /package/{scss → theme}/components/_prose.scss +0 -0
- /package/{scss → theme}/components/_scrollbar.scss +0 -0
- /package/{scss → theme}/components/_sections.scss +0 -0
- /package/{scss → theme}/components/_sidebar.scss +0 -0
- /package/{scss → theme}/components/_stat-card.scss +0 -0
- /package/{scss → theme}/components/_stepper.scss +0 -0
- /package/{scss → theme}/components/_timeline.scss +0 -0
- /package/{scss → theme}/components/_tooltip.scss +0 -0
- /package/{scss → theme}/components/_translations.scss +0 -0
- /package/{scss → theme}/config/_icons.scss +0 -0
- /package/{scss → theme}/config/_mixins.scss +0 -0
- /package/{scss → theme}/config/mixins/_ajax.scss +0 -0
- /package/{scss → theme}/config/mixins/_avatar.scss +0 -0
- /package/{scss → theme}/config/mixins/_breadcrumbs.scss +0 -0
- /package/{scss → theme}/config/mixins/_breakpoints.scss +0 -0
- /package/{scss → theme}/config/mixins/_chip.scss +0 -0
- /package/{scss → theme}/config/mixins/_circular-progress.scss +0 -0
- /package/{scss → theme}/config/mixins/_display.scss +0 -0
- /package/{scss → theme}/config/mixins/_empty-state.scss +0 -0
- /package/{scss → theme}/config/mixins/_focus.scss +0 -0
- /package/{scss → theme}/config/mixins/_interaction.scss +0 -0
- /package/{scss → theme}/config/mixins/_kbd.scss +0 -0
- /package/{scss → theme}/config/mixins/_link.scss +0 -0
- /package/{scss → theme}/config/mixins/_page-header.scss +0 -0
- /package/{scss → theme}/config/mixins/_position.scss +0 -0
- /package/{scss → theme}/config/mixins/_progress.scss +0 -0
- /package/{scss → theme}/config/mixins/_prose.scss +0 -0
- /package/{scss → theme}/config/mixins/_shadows.scss +0 -0
- /package/{scss → theme}/config/mixins/_sizing.scss +0 -0
- /package/{scss → theme}/config/mixins/_spacing.scss +0 -0
- /package/{scss → theme}/config/mixins/_stat-card.scss +0 -0
- /package/{scss → theme}/config/mixins/_stepper.scss +0 -0
- /package/{scss → theme}/config/mixins/_timeline.scss +0 -0
- /package/{scss → theme}/config/mixins/_transitions.scss +0 -0
- /package/{scss → theme}/config/mixins/_translations.scss +0 -0
- /package/{scss → theme}/tabler-icons.txt +0 -0
|
@@ -1,423 +0,0 @@
|
|
|
1
|
-
import { guardBody, dispatch, buildDict, cloneTemplateScoped, fill } from '../../ln-core';
|
|
2
|
-
|
|
3
|
-
(function () {
|
|
4
|
-
const DOM_SELECTOR = 'data-ln-upload';
|
|
5
|
-
const DOM_ATTRIBUTE = 'lnUpload';
|
|
6
|
-
const DICT_SELECTOR = 'data-ln-upload-dict';
|
|
7
|
-
const ACCEPT_ATTR = 'data-ln-upload-accept';
|
|
8
|
-
const CONTEXT_ATTR = 'data-ln-upload-context';
|
|
9
|
-
|
|
10
|
-
const DEFAULT_ITEM_TEMPLATE_HTML =
|
|
11
|
-
'<template data-ln-template="ln-upload-item">' +
|
|
12
|
-
'<li class="ln-upload__item" data-ln-class="ln-upload__item--uploading:uploading, ln-upload__item--error:error, ln-upload__item--deleting:deleting">' +
|
|
13
|
-
'<svg class="ln-icon" aria-hidden="true"><use data-ln-attr="href:iconHref" href="#ln-icon-file"></use></svg>' +
|
|
14
|
-
'<span class="ln-upload__name" data-ln-field="name"></span>' +
|
|
15
|
-
'<span class="ln-upload__size" data-ln-field="sizeText"></span>' +
|
|
16
|
-
'<button type="button" class="ln-upload__remove" data-ln-upload-action="remove" data-ln-attr="aria-label:removeLabel, title:removeLabel">' +
|
|
17
|
-
'<svg class="ln-icon" aria-hidden="true"><use href="#ln-icon-x"></use></svg>' +
|
|
18
|
-
'</button>' +
|
|
19
|
-
'<div class="ln-upload__progress"><div class="ln-upload__progress-bar"></div></div>' +
|
|
20
|
-
'</li>' +
|
|
21
|
-
'</template>';
|
|
22
|
-
|
|
23
|
-
function _ensureDefaultItemTemplate() {
|
|
24
|
-
if (document.querySelector('[data-ln-template="ln-upload-item"]')) return;
|
|
25
|
-
if (!document.body) return;
|
|
26
|
-
const holder = document.createElement('div');
|
|
27
|
-
// Trust boundary: DEFAULT_ITEM_TEMPLATE_HTML is a hardcoded template string defined above
|
|
28
|
-
holder.innerHTML = DEFAULT_ITEM_TEMPLATE_HTML;
|
|
29
|
-
const tmpl = holder.firstElementChild;
|
|
30
|
-
if (tmpl) document.body.appendChild(tmpl);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (window[DOM_ATTRIBUTE] !== undefined) return;
|
|
34
|
-
|
|
35
|
-
function _formatSize(bytes) {
|
|
36
|
-
if (bytes === 0) return '0 B';
|
|
37
|
-
const k = 1024;
|
|
38
|
-
const sizes = ['B', 'KB', 'MB', 'GB'];
|
|
39
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
40
|
-
return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i];
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function _getExtension(filename) {
|
|
44
|
-
return filename.split('.').pop().toLowerCase();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function _getIconId(extension) {
|
|
48
|
-
if (extension === 'docx') extension = 'doc';
|
|
49
|
-
const supported = ['pdf', 'doc', 'epub'];
|
|
50
|
-
return supported.includes(extension) ? 'ln-icon-custom-file-' + extension : 'ln-icon-file';
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function _isValidFile(file, acceptString) {
|
|
54
|
-
if (!acceptString) return true;
|
|
55
|
-
const ext = '.' + _getExtension(file.name);
|
|
56
|
-
const allowed = acceptString.split(',').map(function (s) { return s.trim().toLowerCase(); });
|
|
57
|
-
return allowed.includes(ext.toLowerCase());
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function _initUpload(container) {
|
|
61
|
-
if (container.lnUploadAPI) return;
|
|
62
|
-
|
|
63
|
-
_ensureDefaultItemTemplate();
|
|
64
|
-
const dict = buildDict(container, DICT_SELECTOR);
|
|
65
|
-
const zone = container.querySelector('.ln-upload__zone');
|
|
66
|
-
const list = container.querySelector('.ln-upload__list');
|
|
67
|
-
const acceptString = container.getAttribute(ACCEPT_ATTR) || '';
|
|
68
|
-
|
|
69
|
-
if (!zone || !list) {
|
|
70
|
-
console.warn('[ln-upload] Missing .ln-upload__zone or .ln-upload__list in container:', container);
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
let input = container.querySelector('input[type="file"]');
|
|
75
|
-
if (!input) {
|
|
76
|
-
input = document.createElement('input');
|
|
77
|
-
input.type = 'file';
|
|
78
|
-
input.multiple = true;
|
|
79
|
-
input.classList.add('hidden');
|
|
80
|
-
if (acceptString) {
|
|
81
|
-
input.accept = acceptString.split(',').map(function(ext) {
|
|
82
|
-
ext = ext.trim();
|
|
83
|
-
return ext.startsWith('.') ? ext : '.' + ext;
|
|
84
|
-
}).join(',');
|
|
85
|
-
}
|
|
86
|
-
container.appendChild(input);
|
|
87
|
-
}
|
|
88
|
-
const uploadUrl = container.getAttribute(DOM_SELECTOR) || '/files/upload';
|
|
89
|
-
const uploadContextFallback = container.getAttribute(CONTEXT_ATTR) || '';
|
|
90
|
-
const deleteUrlPattern = container.getAttribute('data-ln-upload-delete') ||
|
|
91
|
-
(uploadUrl.includes('/upload') ? uploadUrl.replace(/\/upload\/?$/, '/{id}') : uploadUrl + '/{id}');
|
|
92
|
-
|
|
93
|
-
const uploadedFiles = new Map();
|
|
94
|
-
let fileIdCounter = 0;
|
|
95
|
-
|
|
96
|
-
function getCsrfToken() {
|
|
97
|
-
const meta = document.querySelector('meta[name="csrf-token"]');
|
|
98
|
-
return meta ? meta.getAttribute('content') : '';
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function addFile(file) {
|
|
102
|
-
if (!_isValidFile(file, acceptString)) {
|
|
103
|
-
const message = dict['invalid-type'];
|
|
104
|
-
dispatch(container, 'ln-upload:invalid', {
|
|
105
|
-
file: file,
|
|
106
|
-
message: message
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
dispatch(window, 'ln-toast:enqueue', {
|
|
110
|
-
type: 'error',
|
|
111
|
-
title: dict['invalid-title'] || 'Invalid File',
|
|
112
|
-
message: message || dict['invalid-type'] || 'This file type is not allowed'
|
|
113
|
-
});
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const localId = 'file-' + (++fileIdCounter);
|
|
118
|
-
const ext = _getExtension(file.name);
|
|
119
|
-
const iconId = _getIconId(ext);
|
|
120
|
-
|
|
121
|
-
const fragment = cloneTemplateScoped(container, 'ln-upload-item', 'ln-upload');
|
|
122
|
-
if (!fragment) return;
|
|
123
|
-
const li = fragment.firstElementChild;
|
|
124
|
-
if (!li) return;
|
|
125
|
-
|
|
126
|
-
li.setAttribute('data-file-id', localId);
|
|
127
|
-
|
|
128
|
-
fill(li, {
|
|
129
|
-
name: file.name,
|
|
130
|
-
sizeText: '0%',
|
|
131
|
-
iconHref: '#' + iconId,
|
|
132
|
-
removeLabel: dict['remove'] || 'Remove',
|
|
133
|
-
uploading: true,
|
|
134
|
-
error: false,
|
|
135
|
-
deleting: false
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
const progressBar = li.querySelector('.ln-upload__progress-bar');
|
|
139
|
-
const removeBtn = li.querySelector('[data-ln-upload-action="remove"]');
|
|
140
|
-
if (removeBtn) removeBtn.disabled = true;
|
|
141
|
-
|
|
142
|
-
list.appendChild(li);
|
|
143
|
-
|
|
144
|
-
const formData = new FormData();
|
|
145
|
-
formData.append('file', file);
|
|
146
|
-
|
|
147
|
-
const gatheredNames = new Set();
|
|
148
|
-
container.querySelectorAll('input, select, textarea').forEach(function (el) {
|
|
149
|
-
if (el.name && el.name !== 'file_ids[]' && el.type !== 'file') {
|
|
150
|
-
if ((el.type === 'checkbox' || el.type === 'radio') && !el.checked) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
formData.append(el.name, el.value);
|
|
154
|
-
gatheredNames.add(el.name);
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
if (!gatheredNames.has('context') && uploadContextFallback) {
|
|
159
|
-
formData.append('context', uploadContextFallback);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
const xhr = new XMLHttpRequest();
|
|
163
|
-
|
|
164
|
-
xhr.upload.addEventListener('progress', function (e) {
|
|
165
|
-
if (e.lengthComputable) {
|
|
166
|
-
const percent = Math.round((e.loaded / e.total) * 100);
|
|
167
|
-
progressBar.style.width = percent + '%';
|
|
168
|
-
fill(li, { sizeText: percent + '%' });
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
xhr.addEventListener('load', function () {
|
|
173
|
-
if (xhr.status >= 200 && xhr.status < 300) {
|
|
174
|
-
let data;
|
|
175
|
-
try {
|
|
176
|
-
data = JSON.parse(xhr.responseText);
|
|
177
|
-
} catch (e) {
|
|
178
|
-
handleError('Invalid response');
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
fill(li, { sizeText: _formatSize(data.size || file.size), uploading: false });
|
|
183
|
-
if (removeBtn) removeBtn.disabled = false;
|
|
184
|
-
|
|
185
|
-
uploadedFiles.set(localId, {
|
|
186
|
-
serverId: data.id,
|
|
187
|
-
name: data.name,
|
|
188
|
-
size: data.size
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
updateHiddenInput();
|
|
192
|
-
|
|
193
|
-
dispatch(container, 'ln-upload:uploaded', {
|
|
194
|
-
localId: localId,
|
|
195
|
-
serverId: data.id,
|
|
196
|
-
name: data.name
|
|
197
|
-
});
|
|
198
|
-
} else {
|
|
199
|
-
let message = dict['upload-failed'] || 'Upload failed';
|
|
200
|
-
try {
|
|
201
|
-
const errorData = JSON.parse(xhr.responseText);
|
|
202
|
-
message = errorData.message || message;
|
|
203
|
-
} catch (e) { }
|
|
204
|
-
handleError(message);
|
|
205
|
-
}
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
xhr.addEventListener('error', function () {
|
|
209
|
-
handleError(dict['network-error'] || 'Network error');
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
function handleError(message) {
|
|
213
|
-
if (progressBar) progressBar.style.width = '100%';
|
|
214
|
-
fill(li, { sizeText: dict['error'] || 'Error', uploading: false, error: true });
|
|
215
|
-
if (removeBtn) removeBtn.disabled = false;
|
|
216
|
-
|
|
217
|
-
dispatch(container, 'ln-upload:error', {
|
|
218
|
-
file: file,
|
|
219
|
-
message: message
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
dispatch(window, 'ln-toast:enqueue', {
|
|
223
|
-
type: 'error',
|
|
224
|
-
title: dict['error-title'] || 'Upload Error',
|
|
225
|
-
message: message || dict['upload-failed'] || 'Failed to upload file'
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
xhr.open('POST', uploadUrl);
|
|
230
|
-
xhr.setRequestHeader('X-CSRF-TOKEN', getCsrfToken());
|
|
231
|
-
xhr.setRequestHeader('Accept', 'application/json');
|
|
232
|
-
xhr.send(formData);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
function updateHiddenInput() {
|
|
236
|
-
for (const el of container.querySelectorAll('input[name="file_ids[]"]')) {
|
|
237
|
-
el.remove();
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
for (const [, fileData] of uploadedFiles) {
|
|
241
|
-
const hiddenInput = document.createElement('input');
|
|
242
|
-
hiddenInput.type = 'hidden';
|
|
243
|
-
hiddenInput.name = 'file_ids[]';
|
|
244
|
-
hiddenInput.value = fileData.serverId;
|
|
245
|
-
container.appendChild(hiddenInput);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
function removeFile(localId) {
|
|
250
|
-
const fileData = uploadedFiles.get(localId);
|
|
251
|
-
const item = list.querySelector('[data-file-id="' + localId + '"]');
|
|
252
|
-
|
|
253
|
-
if (!fileData || !fileData.serverId) {
|
|
254
|
-
if (item) item.remove();
|
|
255
|
-
uploadedFiles.delete(localId);
|
|
256
|
-
updateHiddenInput();
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
if (item) fill(item, { deleting: true });
|
|
261
|
-
|
|
262
|
-
const deleteUrl = deleteUrlPattern.replace('{id}', fileData.serverId);
|
|
263
|
-
fetch(deleteUrl, {
|
|
264
|
-
method: 'DELETE',
|
|
265
|
-
headers: {
|
|
266
|
-
'X-CSRF-TOKEN': getCsrfToken(),
|
|
267
|
-
'Accept': 'application/json'
|
|
268
|
-
}
|
|
269
|
-
})
|
|
270
|
-
.then(function (response) {
|
|
271
|
-
if (response.status === 200) {
|
|
272
|
-
if (item) item.remove();
|
|
273
|
-
uploadedFiles.delete(localId);
|
|
274
|
-
updateHiddenInput();
|
|
275
|
-
|
|
276
|
-
dispatch(container, 'ln-upload:removed', {
|
|
277
|
-
localId: localId,
|
|
278
|
-
serverId: fileData.serverId
|
|
279
|
-
});
|
|
280
|
-
} else {
|
|
281
|
-
if (item) fill(item, { deleting: false });
|
|
282
|
-
|
|
283
|
-
dispatch(window, 'ln-toast:enqueue', {
|
|
284
|
-
type: 'error',
|
|
285
|
-
title: dict['delete-title'] || 'Error',
|
|
286
|
-
message: dict['delete-error'] || 'Failed to delete file'
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
})
|
|
290
|
-
.catch(function (error) {
|
|
291
|
-
console.warn('[ln-upload] Delete error:', error);
|
|
292
|
-
if (item) fill(item, { deleting: false });
|
|
293
|
-
|
|
294
|
-
dispatch(window, 'ln-toast:enqueue', {
|
|
295
|
-
type: 'error',
|
|
296
|
-
title: dict['network-error'] || 'Network error',
|
|
297
|
-
message: dict['connection-error'] || 'Could not connect to server'
|
|
298
|
-
});
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
function handleFiles(fileList) {
|
|
303
|
-
for (const file of fileList) {
|
|
304
|
-
addFile(file);
|
|
305
|
-
}
|
|
306
|
-
input.value = '';
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
const _onZoneClick = function () { input.click(); };
|
|
310
|
-
const _onInputChange = function () { handleFiles(this.files); };
|
|
311
|
-
const _onDragEnter = function (e) { e.preventDefault(); e.stopPropagation(); zone.classList.add('ln-upload__zone--dragover'); };
|
|
312
|
-
const _onDragOver = function (e) { e.preventDefault(); e.stopPropagation(); zone.classList.add('ln-upload__zone--dragover'); };
|
|
313
|
-
const _onDragLeave = function (e) { e.preventDefault(); e.stopPropagation(); zone.classList.remove('ln-upload__zone--dragover'); };
|
|
314
|
-
const _onDrop = function (e) { e.preventDefault(); e.stopPropagation(); zone.classList.remove('ln-upload__zone--dragover'); handleFiles(e.dataTransfer.files); };
|
|
315
|
-
const _onListClick = function (e) {
|
|
316
|
-
const btn = e.target.closest('[data-ln-upload-action="remove"]');
|
|
317
|
-
if (!btn || !list.contains(btn)) return;
|
|
318
|
-
if (btn.disabled) return;
|
|
319
|
-
const item = btn.closest('.ln-upload__item');
|
|
320
|
-
if (item) removeFile(item.getAttribute('data-file-id'));
|
|
321
|
-
};
|
|
322
|
-
|
|
323
|
-
zone.addEventListener('click', _onZoneClick);
|
|
324
|
-
input.addEventListener('change', _onInputChange);
|
|
325
|
-
zone.addEventListener('dragenter', _onDragEnter);
|
|
326
|
-
zone.addEventListener('dragover', _onDragOver);
|
|
327
|
-
zone.addEventListener('dragleave', _onDragLeave);
|
|
328
|
-
zone.addEventListener('drop', _onDrop);
|
|
329
|
-
list.addEventListener('click', _onListClick);
|
|
330
|
-
|
|
331
|
-
container.lnUploadAPI = {
|
|
332
|
-
getFileIds: function () {
|
|
333
|
-
return Array.from(uploadedFiles.values()).map(function (f) { return f.serverId; });
|
|
334
|
-
},
|
|
335
|
-
getFiles: function () {
|
|
336
|
-
return Array.from(uploadedFiles.values());
|
|
337
|
-
},
|
|
338
|
-
clear: function () {
|
|
339
|
-
for (const [, fileData] of uploadedFiles) {
|
|
340
|
-
if (fileData.serverId) {
|
|
341
|
-
const deleteUrl = deleteUrlPattern.replace('{id}', fileData.serverId);
|
|
342
|
-
fetch(deleteUrl, {
|
|
343
|
-
method: 'DELETE',
|
|
344
|
-
headers: {
|
|
345
|
-
'X-CSRF-TOKEN': getCsrfToken(),
|
|
346
|
-
'Accept': 'application/json'
|
|
347
|
-
}
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
uploadedFiles.clear();
|
|
352
|
-
list.innerHTML = '';
|
|
353
|
-
updateHiddenInput();
|
|
354
|
-
dispatch(container, 'ln-upload:cleared', {});
|
|
355
|
-
},
|
|
356
|
-
destroy: function () {
|
|
357
|
-
zone.removeEventListener('click', _onZoneClick);
|
|
358
|
-
input.removeEventListener('change', _onInputChange);
|
|
359
|
-
zone.removeEventListener('dragenter', _onDragEnter);
|
|
360
|
-
zone.removeEventListener('dragover', _onDragOver);
|
|
361
|
-
zone.removeEventListener('dragleave', _onDragLeave);
|
|
362
|
-
zone.removeEventListener('drop', _onDrop);
|
|
363
|
-
list.removeEventListener('click', _onListClick);
|
|
364
|
-
uploadedFiles.clear();
|
|
365
|
-
list.innerHTML = '';
|
|
366
|
-
updateHiddenInput();
|
|
367
|
-
delete container.lnUploadAPI;
|
|
368
|
-
}
|
|
369
|
-
};
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
function _initializeAll() {
|
|
373
|
-
for (const el of document.querySelectorAll('[' + DOM_SELECTOR + ']')) {
|
|
374
|
-
_initUpload(el);
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
function _domObserver() {
|
|
379
|
-
guardBody(function () {
|
|
380
|
-
const observer = new MutationObserver(function (mutations) {
|
|
381
|
-
for (const mutation of mutations) {
|
|
382
|
-
if (mutation.type === 'childList') {
|
|
383
|
-
for (const node of mutation.addedNodes) {
|
|
384
|
-
if (node.nodeType === 1) {
|
|
385
|
-
if (node.hasAttribute(DOM_SELECTOR)) {
|
|
386
|
-
_initUpload(node);
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
for (const child of node.querySelectorAll('[' + DOM_SELECTOR + ']')) {
|
|
390
|
-
_initUpload(child);
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
} else if (mutation.type === 'attributes') {
|
|
395
|
-
if (mutation.target.hasAttribute(DOM_SELECTOR)) {
|
|
396
|
-
_initUpload(mutation.target);
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
});
|
|
401
|
-
|
|
402
|
-
observer.observe(document.body, {
|
|
403
|
-
childList: true,
|
|
404
|
-
subtree: true,
|
|
405
|
-
attributes: true,
|
|
406
|
-
attributeFilter: [DOM_SELECTOR]
|
|
407
|
-
});
|
|
408
|
-
}, 'ln-upload');
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
window[DOM_ATTRIBUTE] = {
|
|
412
|
-
init: _initUpload,
|
|
413
|
-
initAll: _initializeAll
|
|
414
|
-
};
|
|
415
|
-
|
|
416
|
-
_domObserver();
|
|
417
|
-
|
|
418
|
-
if (document.readyState === 'loading') {
|
|
419
|
-
document.addEventListener('DOMContentLoaded', _initializeAll);
|
|
420
|
-
} else {
|
|
421
|
-
_initializeAll();
|
|
422
|
-
}
|
|
423
|
-
})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";if(typeof window<"u"){const t=console.warn;console.warn=function(...e){typeof e[0]=="string"&&(e[0].startsWith("[ln-")||e[0].startsWith("[lnCore"))&&!(document.documentElement.hasAttribute("data-ln-debug")||document.body&&document.body.hasAttribute("data-ln-debug"))||t.apply(console,e)}}const w={};function D(t,e){w[t]||(w[t]=document.querySelector('[data-ln-template="'+t+'"]'));const r=w[t];return r?r.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function C(t,e,r){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:r||{}}))}function S(t,e){if(!t||!e)return t;const r=t.querySelectorAll("[data-ln-field]");for(let o=0;o<r.length;o++){const s=r[o],n=s.getAttribute("data-ln-field");e[n]!=null&&(s.textContent=e[n])}const c=t.querySelectorAll("[data-ln-attr]");for(let o=0;o<c.length;o++){const s=c[o],n=s.getAttribute("data-ln-attr").split(",");for(let i=0;i<n.length;i++){const a=n[i].trim().split(":");if(a.length!==2)continue;const f=a[0].trim(),p=a[1].trim();e[p]!=null&&s.setAttribute(f,e[p])}}const u=t.querySelectorAll("[data-ln-show]");for(let o=0;o<u.length;o++){const s=u[o],n=s.getAttribute("data-ln-show");n in e&&s.classList.toggle("hidden",!e[n])}const l=t.querySelectorAll("[data-ln-class]");for(let o=0;o<l.length;o++){const s=l[o],n=s.getAttribute("data-ln-class").split(",");for(let i=0;i<n.length;i++){const a=n[i].trim().split(":");if(a.length!==2)continue;const f=a[0].trim(),p=a[1].trim();p in e&&s.classList.toggle(f,!!e[p])}}return t}function M(t,e){t.matches&&t.matches("[data-ln-form], [data-ln-fillable]")&&t.dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));const r=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let c=0;c<r.length;c++)r[c].dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(t){if(!(!t.target.matches||!t.target.matches("[data-ln-fillable]")))if(t.detail)S(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let r=0;r<e.length;r++)e[r].textContent=""}})));function A(t,e){if(!t||!e)return t;const r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const l=r.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,s){return e[s]!==void 0?e[s]:""}))}const c=function(l,o){return e[o]!==void 0?e[o]:""},u=Array.from(t.querySelectorAll("*"));t.nodeType===1&&u.push(t);for(let l=0;l<u.length;l++){const o=u[l],s=o.attributes;for(let n=0;n<s.length;n++){const i=s[n];i.value.indexOf("{{")!==-1&&o.setAttribute(i.name,i.value.replace(/\{\{\s*(\w+)\s*\}\}/g,c))}}return t}function N(t,e,r,c,u,l){const o={};for(let n=0;n<t.children.length;n++){const i=t.children[n],a=i.getAttribute("data-ln-key");a&&(o[a]=i)}const s=document.createDocumentFragment();for(let n=0;n<e.length;n++){const i=e[n],a=String(c(i));let f=o[a];if(f)u(f,i,n);else{const p=D(r,l);if(!p||(A(p,i),f=p.firstElementChild,!f))continue;f.setAttribute("data-ln-key",a),u(f,i,n)}s.appendChild(f)}t.textContent="",t.appendChild(s)}function O(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){O(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function b(t,e,r,c){if(t.nodeType!==1)return;const l=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",o=Array.from(t.querySelectorAll(l));t.matches&&t.matches(l)&&o.push(t);for(const s of o)s[r]||(s[r]=new c(s))}function V(t,e,r,c,u={}){const l=u.extraAttributes||[],o=u.onAttributeChange||null,s=u.onInit||null;function n(i){const a=i||document.body;b(a,t,e,r),s&&s(a)}return O(function(){const i=new MutationObserver(function(f){for(let p=0;p<f.length;p++){const h=f[p];if(h.type==="childList"){for(let m=0;m<h.addedNodes.length;m++){const d=h.addedNodes[m];d.nodeType===1&&(b(d,t,e,r),s&&s(d))}for(let m=0;m<h.removedNodes.length;m++){const d=h.removedNodes[m];if(d.nodeType===1){const g=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",y=Array.from(d.querySelectorAll(g));d.matches&&d.matches(g)&&y.push(d);for(let _=0;_<y.length;_++){const T=y[_];if(!document.contains(T)){const E=T[e];E&&typeof E.destroy=="function"&&E.destroy()}}}}}else h.type==="attributes"&&(o&&h.target[e]?o(h.target,h.attributeName):(b(h.target,t,e,r),s&&s(h.target)))}});let a=[];if(t.indexOf("[")!==-1){const f=/\[([\w-]+)/g;let p;for(;(p=f.exec(t))!==null;)a.push(p[1])}else a.push(t);i.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:a.concat(l)})},c),window[e]=n,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){n(document.body)}):n(document.body),n}const x={};function F(t,e){x[t]=e}function I(t){return x[t]||{ingress:e=>e,egress:e=>e}}const q={};function R(t,e){if(!t||typeof e!="object")return;const r=t.toLowerCase().split("-")[0];q[r]=e}function j(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return q[e]||null}R("mk",{monthsLong:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],monthsShort:["јан","фев","мар","апр","мај","јун","јул","авг","септ","окт","ноем","дек"],daysLong:["недела","понеделник","вторник","среда","четврток","петок","сабота"],daysShort:["нед","пон","вт","ср","чет","пет","саб"]}),typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=F,window.lnCore.getDataMapper=I,window.lnCore.registerLocaleFallback=R,window.lnCore.getLocaleFallback=j,window.lnCore.fillTemplate=A,window.lnCore.fill=S,window.lnCore.lnFill=M,window.lnCore.renderList=N);function k(t){return(t||"").replace(/^#/,"")}function L(t){const e=t===void 0?location.hash:t,r={},c=k(e);if(!c)return r;const u=c.split("&");for(let l=0;l<u.length;l++){const o=u[l];if(!o)continue;const s=o.indexOf(":"),n=s>-1?o.slice(0,s):o,i=s>-1?o.slice(s+1):"";if(n)try{r[n]=decodeURIComponent(i)}catch{r[n]=i}}return r}function B(t){if(!t)return null;const e=L();return t in e?e[t]:null}function P(t,e){if(!t)return;const r=L();e==null?delete r[t]:r[t]=String(e);const u=Object.keys(r).map(function(l){const o=r[l];return o===""?l:l+":"+encodeURIComponent(o)}).join("&");k(location.hash)!==u&&(location.hash=u)}function W(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=L,window.lnCore.hashGet=B,window.lnCore.hashSet=P,window.lnCore.hashLinkClick=W),(function(){const t="data-ln-validate",e="lnValidate",r="data-ln-validate-errors",c="data-ln-validate-error",u="ln-validate-valid",l="ln-validate-invalid",o={required:"valueMissing",typeMismatch:"typeMismatch",tooShort:"tooShort",tooLong:"tooLong",patternMismatch:"patternMismatch",rangeUnderflow:"rangeUnderflow",rangeOverflow:"rangeOverflow"};if(window[e]!==void 0)return;function s(n){this.dom=n,this._touched=!1,this._customErrors=new Set;const i=this,a=n.tagName,f=n.type,p=a==="SELECT"||f==="checkbox"||f==="radio";this._onInput=function(){i._touched=!0,i.validate()},this._onChange=function(){i._touched=!0,i.validate()},this._onSetCustom=function(m){const d=m.detail&&m.detail.error;if(!d)return;i._customErrors.add(d),i._touched=!0;const v=n.closest(".form-element");if(v){const g=v.querySelector("["+c+'="'+d+'"]');g&&g.classList.remove("hidden")}n.classList.remove(u),n.classList.add(l),n.setAttribute("aria-invalid","true")},this._onClearCustom=function(m){const d=m.detail&&m.detail.error,v=n.closest(".form-element");if(d){if(i._customErrors.delete(d),v){const g=v.querySelector("["+c+'="'+d+'"]');g&&g.classList.add("hidden")}}else i._customErrors.forEach(function(g){if(v){const y=v.querySelector("["+c+'="'+g+'"]');y&&y.classList.add("hidden")}}),i._customErrors.clear();i._touched&&i.validate()},p||n.addEventListener("input",this._onInput),n.addEventListener("change",this._onChange),n.addEventListener("ln-validate:set-custom",this._onSetCustom),n.addEventListener("ln-validate:clear-custom",this._onClearCustom);const h=n.form;return h&&(h.hasAttribute("novalidate")||h.setAttribute("novalidate",""),this._onFormReset=function(){i.reset()},this._onValidateRequest=function(m){i._touched=!0,!i.validate()&&m.detail&&m.detail.invalidFields&&m.detail.invalidFields.push(i.dom)},h.addEventListener("reset",this._onFormReset),h.addEventListener("ln-validate:request-validate",this._onValidateRequest),h._lnValidateGateBound||(h._lnValidateGateBound=!0,h.addEventListener("submit",function(m){const d={invalidFields:[]};C(h,"ln-validate:request-validate",d),d.invalidFields.length>0&&(m.preventDefault(),d.invalidFields.sort((v,g)=>v.compareDocumentPosition(g)&Node.DOCUMENT_POSITION_PRECEDING?-1:1),d.invalidFields[0].focus())}))),this}s.prototype.validate=function(){const n=this.dom,i=n.validity,f=n.checkValidity()&&this._customErrors.size===0,p=n.closest(".form-element");if(p){const m=p.querySelector("["+r+"]");if(m){const d=m.querySelectorAll("["+c+"]");for(let v=0;v<d.length;v++){const g=d[v].getAttribute(c),y=o[g];y&&(i[y]?d[v].classList.remove("hidden"):d[v].classList.add("hidden"))}}}return n.classList.toggle(u,f),n.classList.toggle(l,!f),n.setAttribute("aria-invalid",f?"false":"true"),C(n,f?"ln-validate:valid":"ln-validate:invalid",{target:n,field:n.name}),f},s.prototype.reset=function(){this._touched=!1,this._customErrors.clear(),this.dom.classList.remove(u,l),this.dom.removeAttribute("aria-invalid");const n=this.dom.closest(".form-element");if(n){const i=n.querySelectorAll("["+c+"]");for(let a=0;a<i.length;a++)i[a].classList.add("hidden")}},Object.defineProperty(s.prototype,"isValid",{get:function(){return this.dom.checkValidity()&&this._customErrors.size===0}}),s.prototype.destroy=function(){if(!this.dom[e])return;this.dom.removeEventListener("input",this._onInput),this.dom.removeEventListener("change",this._onChange),this.dom.removeEventListener("ln-validate:set-custom",this._onSetCustom),this.dom.removeEventListener("ln-validate:clear-custom",this._onClearCustom);const n=this.dom.form;n&&(this._onFormReset&&n.removeEventListener("reset",this._onFormReset),this._onValidateRequest&&n.removeEventListener("ln-validate:request-validate",this._onValidateRequest)),this.dom.classList.remove(u,l),this.dom.removeAttribute("aria-invalid"),C(this.dom,"ln-validate:destroyed",{target:this.dom}),delete this.dom[e]},V(t,e,s,"ln-validate")})()})();
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
@use '../config/mixins' as *;
|
|
2
|
-
|
|
3
|
-
// Prototype-tier classes.
|
|
4
|
-
// These classes are provided for prototyping, inspector experimentation,
|
|
5
|
-
// and demo HTML only. In production, apply the corresponding mixin to a
|
|
6
|
-
// semantic selector:
|
|
7
|
-
//
|
|
8
|
-
// #add-user { @include btn; }
|
|
9
|
-
// #users-table ul { @include btn-group; }
|
|
10
|
-
//
|
|
11
|
-
// See CLAUDE.md "Button Architecture" and "Button Groups vs Pill Groups"
|
|
12
|
-
// for the production pattern.
|
|
13
|
-
|
|
14
|
-
.btn { @include btn; }
|
|
15
|
-
.btn-sm { @include btn-sm; }
|
|
16
|
-
.btn-lg { @include btn-lg; }
|
|
17
|
-
|
|
18
|
-
.btn-group {
|
|
19
|
-
@include btn-group;
|
|
20
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
@use '../config/mixins' as *;
|
|
2
|
-
|
|
3
|
-
// ─── Inputs ─────────────────────────────────────────────────────
|
|
4
|
-
|
|
5
|
-
input,
|
|
6
|
-
textarea,
|
|
7
|
-
select {
|
|
8
|
-
@include form-input;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
textarea {
|
|
12
|
-
@include form-textarea;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
select {
|
|
16
|
-
@include form-select;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// ─── Checkbox & Radio ───────────────────────────────────────────
|
|
20
|
-
|
|
21
|
-
input[type="checkbox"] {
|
|
22
|
-
@include form-checkbox;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
input[type="radio"] {
|
|
26
|
-
@include form-radio;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// ─── Icon input group ───────────────────────────────────────────
|
|
30
|
-
// Semantic trigger: any <label> that directly contains a <svg class="ln-icon">
|
|
31
|
-
// AND a text-ish <input>. Excludes checkbox/radio/file/button types via the
|
|
32
|
-
// :is() allowlist.
|
|
33
|
-
|
|
34
|
-
label:has(> .ln-icon):has(> :is(
|
|
35
|
-
input[type="text"],
|
|
36
|
-
input[type="search"],
|
|
37
|
-
input[type="email"],
|
|
38
|
-
input[type="url"],
|
|
39
|
-
input[type="tel"],
|
|
40
|
-
input[type="password"],
|
|
41
|
-
input[type="number"]
|
|
42
|
-
)) {
|
|
43
|
-
@include form-input-icon-group;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// ─── Label & Actions ────────────────────────────────────────────
|
|
47
|
-
|
|
48
|
-
// Non-wrapping labels only — the label sits above/beside its input, not
|
|
49
|
-
// around it. The icon-group pattern owns its full styling and must not
|
|
50
|
-
// inherit block + margin-bottom from here.
|
|
51
|
-
label:not(:has(> input)) {
|
|
52
|
-
@include form-label;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// ─── Pill groups — radio & checkbox lists ──────────────────────────
|
|
56
|
-
// Clean class-driven segmented controls and switch panels.
|
|
57
|
-
// No <fieldset> tag dependency to prevent layout collisions.
|
|
58
|
-
|
|
59
|
-
.pills {
|
|
60
|
-
@include pills;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.pills-outline {
|
|
64
|
-
@include pills-outline;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.pills-switch {
|
|
68
|
-
@include pills-switch;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.pills-segmented {
|
|
72
|
-
@include pills-segmented;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.pill {
|
|
76
|
-
@include pill;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.pill-outline {
|
|
80
|
-
@include pill-outline;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.pill-switch {
|
|
84
|
-
@include pill-switch;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.search {
|
|
88
|
-
@include search;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.form-actions {
|
|
92
|
-
@include form-actions;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// ─── Validation states ─────────────────────────────────────────
|
|
96
|
-
|
|
97
|
-
.ln-validate-invalid {
|
|
98
|
-
@include form-validate-invalid;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.ln-validate-valid {
|
|
102
|
-
@include form-validate-valid;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
[data-ln-validate-errors] {
|
|
106
|
-
@include form-validate-errors;
|
|
107
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
@use '../config/mixins' as *;
|
|
2
|
-
|
|
3
|
-
[data-ln-toast] {
|
|
4
|
-
@include toast-container;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
// The <li> IS the card: structural (item) + visual (card) styling both bind
|
|
8
|
-
// here, contextually — the <li> carries no static class (no-BEM), only the
|
|
9
|
-
// filled/authored type class.
|
|
10
|
-
[data-ln-toast] > li {
|
|
11
|
-
@include toast-item;
|
|
12
|
-
@include toast-card;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
[data-ln-toast] > li.ln-enter {
|
|
16
|
-
@include toast-item-enter;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
[data-ln-toast] > li.ln-out {
|
|
20
|
-
@include toast-item-out;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Type → tone. The status→tone map lives here (one place): warn maps to the
|
|
24
|
-
// warning family. SSR authors the class; the dynamic path fills it verbatim.
|
|
25
|
-
[data-ln-toast] > li.success { @include semantic-color(success); }
|
|
26
|
-
[data-ln-toast] > li.error { @include semantic-color(error); }
|
|
27
|
-
[data-ln-toast] > li.warn { @include semantic-color(warning); }
|
|
28
|
-
[data-ln-toast] > li.info { @include semantic-color(info); }
|
|
29
|
-
|
|
30
|
-
[data-ln-toast] .icon {
|
|
31
|
-
@include toast-icon;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
[data-ln-toast] .icon ul {
|
|
35
|
-
@include toast-icon-list;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// When-toggle — dynamic template ships all 4 icon variants; CSS shows the
|
|
39
|
-
// one matching the card's type class. Unknown/absent type → no matching
|
|
40
|
-
// class → no icon (documented degradation, see js/ln-toast/README.md).
|
|
41
|
-
[data-ln-toast] > li.success .icon li[data-ln-toast-when="success"],
|
|
42
|
-
[data-ln-toast] > li.error .icon li[data-ln-toast-when="error"],
|
|
43
|
-
[data-ln-toast] > li.warn .icon li[data-ln-toast-when="warn"],
|
|
44
|
-
[data-ln-toast] > li.info .icon li[data-ln-toast-when="info"] {
|
|
45
|
-
@include block;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
[data-ln-toast] .content {
|
|
49
|
-
@include toast-content;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
[data-ln-toast] .title {
|
|
53
|
-
@include toast-title;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// No default titles are ever filled by JS — an empty title collapses.
|
|
57
|
-
[data-ln-toast] .title:empty {
|
|
58
|
-
@include hidden;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
[data-ln-toast] .body {
|
|
62
|
-
@include toast-body;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// No hasBody flag — an unfilled body collapses via :empty.
|
|
66
|
-
[data-ln-toast] .body:empty {
|
|
67
|
-
@include hidden;
|
|
68
|
-
}
|